1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
262 def _toListOfNames(_names, _size=-1):
265 if type(_names) in [types.ListType, types.TupleType]:
266 for i in _names: l.append(i)
269 if l and len(l) < _size:
270 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
273 # Decorator function to manage transactions for all geometric operations.
274 def ManageTransactions(theOpeName):
275 def MTDecorator(theFunction):
276 # To keep the original function name an documentation.
277 @functools.wraps(theFunction)
278 def OpenCallClose(self, *args, **kwargs):
280 anOperation = getattr(self, theOpeName)
281 anOperation.StartOperation()
284 res = theFunction(self, *args, **kwargs)
286 anOperation.FinishOperation()
290 anOperation.AbortOperation()
295 ## Raise an Error, containing the Method_name, if Operation is Failed
296 ## @ingroup l1_geomBuilder_auxiliary
297 def RaiseIfFailed (Method_name, Operation):
298 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
299 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
301 ## Return list of variables value from salome notebook
302 ## @ingroup l1_geomBuilder_auxiliary
303 def ParseParameters(*parameters):
306 for parameter in parameters:
307 if isinstance(parameter, list):
308 lResults = ParseParameters(*parameter)
309 if len(lResults) > 0:
310 Result.append(lResults[:-1])
311 StringResult += lResults[-1].split(":")
315 if isinstance(parameter,str):
316 if notebook.isVariable(parameter):
317 Result.append(notebook.get(parameter))
319 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
322 Result.append(parameter)
324 StringResult.append(str(parameter))
328 Result.append(":".join(StringResult))
330 Result = ":".join(StringResult)
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
338 for parameter in list:
339 if isinstance(parameter,str) and notebook.isVariable(parameter):
340 Result.append(str(notebook.get(parameter)))
343 Result.append(str(parameter))
346 StringResult = StringResult + str(parameter)
347 StringResult = StringResult + ":"
349 StringResult = StringResult[:len(StringResult)-1]
350 return Result, StringResult
352 ## Return list of variables value from salome notebook
353 ## @ingroup l1_geomBuilder_auxiliary
354 def ParseSketcherCommand(command):
357 sections = command.split(":")
358 for section in sections:
359 parameters = section.split(" ")
361 for parameter in parameters:
362 if paramIndex > 1 and parameter.find("'") != -1:
363 parameter = parameter.replace("'","")
364 if notebook.isVariable(parameter):
365 Result = Result + str(notebook.get(parameter)) + " "
368 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
372 Result = Result + str(parameter) + " "
375 StringResult = StringResult + parameter
376 StringResult = StringResult + ":"
378 paramIndex = paramIndex + 1
380 Result = Result[:len(Result)-1] + ":"
382 Result = Result[:len(Result)-1]
383 return Result, StringResult
385 ## Helper function which can be used to pack the passed string to the byte data.
386 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
387 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
390 ## val = PackData("10001110") # val = 0xAE
391 ## val = PackData("1") # val = 0x80
393 ## @param data unpacked data - a string containing '1' and '0' symbols
394 ## @return data packed to the byte stream
395 ## @ingroup l1_geomBuilder_auxiliary
398 Helper function which can be used to pack the passed string to the byte data.
399 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
400 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
403 data unpacked data - a string containing '1' and '0' symbols
406 data packed to the byte stream
409 val = PackData("10001110") # val = 0xAE
410 val = PackData("1") # val = 0x80
413 if len(data)%8: bytes += 1
415 for b in range(bytes):
416 d = data[b*8:(b+1)*8]
421 if d[i] == "1": val += 1
423 raise "Invalid symbol %s" % d[i]
430 ## Read bitmap texture from the text file.
431 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
432 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
433 ## The function returns width and height of the pixmap in pixels and byte stream representing
434 ## texture bitmap itself.
436 ## This function can be used to read the texture to the byte stream in order to pass it to
437 ## the AddTexture() function of geomBuilder class.
440 ## from salome.geom import geomBuilder
441 ## geompy = geomBuilder.New(salome.myStudy)
442 ## texture = geompy.readtexture('mytexture.dat')
443 ## texture = geompy.AddTexture(*texture)
444 ## obj.SetMarkerTexture(texture)
446 ## @param fname texture file name
447 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
448 ## @ingroup l1_geomBuilder_auxiliary
449 def ReadTexture(fname):
451 Read bitmap texture from the text file.
452 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
453 A zero symbol ('0') represents transparent pixel of the texture bitmap.
454 The function returns width and height of the pixmap in pixels and byte stream representing
455 texture bitmap itself.
456 This function can be used to read the texture to the byte stream in order to pass it to
457 the AddTexture() function of geomBuilder class.
460 fname texture file name
463 sequence of tree values: texture's width, height in pixels and its byte stream
466 from salome.geom import geomBuilder
467 geompy = geomBuilder.New(salome.myStudy)
468 texture = geompy.readtexture('mytexture.dat')
469 texture = geompy.AddTexture(*texture)
470 obj.SetMarkerTexture(texture)
474 lines = [ l.strip() for l in f.readlines()]
477 if lines: maxlen = max([len(x) for x in lines])
479 if maxlen%8: lenbytes += 1
483 lenline = (len(line)/8+1)*8
486 lenline = (len(line)/8)*8
488 for i in range(lenline/8):
491 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
494 bytedata += PackData(byte)
496 for i in range(lenline/8, lenbytes):
497 bytedata += PackData("0")
499 return lenbytes*8, len(lines), bytedata
504 ## Returns a long value from enumeration type
505 # Can be used for CORBA enumerator types like GEOM.shape_type
506 # @param theItem enumeration type
507 # @ingroup l1_geomBuilder_auxiliary
508 def EnumToLong(theItem):
510 Returns a long value from enumeration type
511 Can be used for CORBA enumerator types like geomBuilder.ShapeType
514 theItem enumeration type
517 if hasattr(theItem, "_v"): ret = theItem._v
520 ## Pack an argument into a list
522 if isinstance( arg, list ):
524 if hasattr( arg, "__getitem__" ):
528 ## Information about closed/unclosed state of shell or wire
529 # @ingroup l1_geomBuilder_auxiliary
532 Information about closed/unclosed state of shell or wire
538 ## Private class used to bind calls of plugin operations to geomBuilder
539 class PluginOperation:
540 def __init__(self, operation, function):
541 self.operation = operation
542 self.function = function
545 @ManageTransactions("operation")
546 def __call__(self, *args):
547 res = self.function(self.operation, *args)
548 RaiseIfFailed(self.function.__name__, self.operation)
551 # Warning: geom is a singleton
557 class geomBuilder(object, GEOM._objref_GEOM_Gen):
559 ## Enumeration ShapeType as a dictionary. \n
560 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
561 # @ingroup l1_geomBuilder_auxiliary
562 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
564 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
565 # and a list of parameters, describing the shape.
566 # List of parameters, describing the shape:
567 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
568 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
570 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
572 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
574 # - SPHERE: [xc yc zc R]
575 # - CYLINDER: [xb yb zb dx dy dz R H]
576 # - BOX: [xc yc zc ax ay az]
577 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
578 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
579 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
580 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
581 # - SOLID: [nb_faces nb_edges nb_vertices]
583 # - SPHERE2D: [xc yc zc R]
584 # - CYLINDER2D: [xb yb zb dx dy dz R H]
585 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
586 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
587 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
588 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
589 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
590 # - PLANE: [xo yo zo dx dy dz]
591 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
592 # - FACE: [nb_edges nb_vertices]
594 # - CIRCLE: [xc yc zc dx dy dz R]
595 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
596 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
597 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
598 # - LINE: [xo yo zo dx dy dz]
599 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
600 # - EDGE: [nb_vertices]
603 # @ingroup l1_geomBuilder_auxiliary
604 kind = GEOM.GEOM_IKindOfShape
611 #print "==== __new__ ", engine, geom, doLcc, created
613 # geom engine is either retrieved from engine, or created
615 # Following test avoids a recursive loop
618 # geom engine not created: existing engine found
620 if doLcc and not created:
622 # FindOrLoadComponent called:
623 # 1. CORBA resolution of server
624 # 2. the __new__ method is called again
625 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
626 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
629 # FindOrLoadComponent not called
631 # geomBuilder instance is created from lcc.FindOrLoadComponent
632 #print "==== super ", engine, geom, doLcc, created
633 geom = super(geomBuilder,cls).__new__(cls)
636 # geom engine not created: existing engine found
637 #print "==== existing ", engine, geom, doLcc, created
639 #print "return geom 1 ", geom
642 #print "return geom 2 ", geom
647 #print "-------- geomBuilder __init__ --- ", created, self
650 GEOM._objref_GEOM_Gen.__init__(self)
651 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
652 self.myBuilder = None
671 ## Process object publication in the study, as follows:
672 # - if @a theName is specified (not None), the object is published in the study
673 # with this name, not taking into account "auto-publishing" option;
674 # - if @a theName is NOT specified, the object is published in the study
675 # (using default name, which can be customized using @a theDefaultName parameter)
676 # only if auto-publishing is switched on.
678 # @param theObj object, a subject for publishing
679 # @param theName object name for study
680 # @param theDefaultName default name for the auto-publishing
682 # @sa addToStudyAuto()
683 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
685 def _item_name(_names, _defname, _idx=-1):
686 if not _names: _names = _defname
687 if type(_names) in [types.ListType, types.TupleType]:
689 if _idx >= len(_names) or not _names[_idx]:
690 if type(_defname) not in [types.ListType, types.TupleType]:
691 _name = "%s_%d"%(_defname, _idx+1)
692 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
693 _name = _defname[_idx]
695 _name = "%noname_%d"%(dn, _idx+1)
701 # must be wrong usage
706 _name = "%s_%d"%(_names, _idx+1)
712 def _publish( _name, _obj ):
714 if isinstance( _obj, GEOM._objref_GEOM_Field ):
715 fatherObj = _obj.GetShape()
716 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
717 fatherObj = _obj.GetField()
718 elif not _obj.IsMainShape():
719 fatherObj = _obj.GetMainShape()
721 if fatherObj and fatherObj.GetStudyEntry():
722 self.addToStudyInFather(fatherObj, _obj, _name)
724 self.addToStudy(_obj, _name)
730 if not theName and not self.myMaxNbSubShapesAllowed:
731 return # nothing to do: auto-publishing is disabled
732 if not theName and not theDefaultName:
733 return # neither theName nor theDefaultName is given
735 if type(theObj) in [types.ListType, types.TupleType]:
736 # list of objects is being published
739 if not obj: continue # bad object
740 name = _item_name(theName, theDefaultName, idx)
741 _publish( name, obj )
743 if not theName and idx == self.myMaxNbSubShapesAllowed: break
747 # single object is published
748 name = _item_name(theName, theDefaultName)
749 _publish( name, theObj )
752 ## @addtogroup l1_geomBuilder_auxiliary
754 def init_geom(self,theStudy):
755 self.myStudy = theStudy
756 self.myStudyId = self.myStudy._get_StudyId()
757 self.myBuilder = self.myStudy.NewBuilder()
758 self.father = self.myStudy.FindComponent("GEOM")
759 notebook.myStudy = theStudy
760 if self.father is None:
761 self.father = self.myBuilder.NewComponent("GEOM")
762 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
763 FName = A1._narrow(SALOMEDS.AttributeName)
764 FName.SetValue("Geometry")
765 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
766 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
767 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
768 self.myBuilder.DefineComponentInstance(self.father,self)
770 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
771 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
772 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
773 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
774 self.HealOp = self.GetIHealingOperations (self.myStudyId)
775 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
776 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
777 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
778 self.LocalOp = self.GetILocalOperations (self.myStudyId)
779 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
780 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
781 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
782 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
784 # set GEOM as root in the use case tree
785 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
786 self.myUseCaseBuilder.SetRootCurrent()
787 self.myUseCaseBuilder.Append(self.father)
789 # load data from the study file, if necessary
790 self.myBuilder.LoadWith(self.father, self)
793 def GetPluginOperations(self, studyID, libraryName):
794 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
797 ## Enable / disable results auto-publishing
799 # The automatic publishing is managed in the following way:
800 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
801 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
802 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
803 # value passed as parameter has the same effect.
804 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
805 # maximum number of sub-shapes allowed for publishing is set to specified value.
807 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
808 # @ingroup l1_publish_data
809 def addToStudyAuto(self, maxNbSubShapes=-1):
811 Enable / disable results auto-publishing
813 The automatic publishing is managed in the following way:
814 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
815 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
816 maximum number of sub-shapes allowed for publishing is unlimited; any negative
817 value passed as parameter has the same effect.
818 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
819 maximum number of sub-shapes allowed for publishing is set to this value.
822 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
825 geompy.addToStudyAuto() # enable auto-publishing
826 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
827 geompy.addToStudyAuto(0) # disable auto-publishing
829 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
832 ## Dump component to the Python script
833 # This method overrides IDL function to allow default values for the parameters.
834 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
836 Dump component to the Python script
837 This method overrides IDL function to allow default values for the parameters.
839 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
841 ## Get name for sub-shape aSubObj of shape aMainObj
843 # @ref swig_SubShapeName "Example"
844 @ManageTransactions("ShapesOp")
845 def SubShapeName(self,aSubObj, aMainObj):
847 Get name for sub-shape aSubObj of shape aMainObj
849 # Example: see GEOM_TestAll.py
851 #aSubId = orb.object_to_string(aSubObj)
852 #aMainId = orb.object_to_string(aMainObj)
853 #index = gg.getIndexTopology(aSubId, aMainId)
854 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
855 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
856 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
859 ## Publish in study aShape with name aName
861 # \param aShape the shape to be published
862 # \param aName the name for the shape
863 # \param doRestoreSubShapes if True, finds and publishes also
864 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
865 # and published sub-shapes of arguments
866 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
867 # these arguments description
868 # \return study entry of the published shape in form of string
870 # @ingroup l1_publish_data
871 # @ref swig_all_addtostudy "Example"
872 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
873 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
875 Publish in study aShape with name aName
878 aShape the shape to be published
879 aName the name for the shape
880 doRestoreSubShapes if True, finds and publishes also
881 sub-shapes of aShape, corresponding to its arguments
882 and published sub-shapes of arguments
883 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
884 these arguments description
887 study entry of the published shape in form of string
890 id_block1 = geompy.addToStudy(Block1, "Block 1")
892 # Example: see GEOM_TestAll.py
894 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
895 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
896 if doRestoreSubShapes:
897 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
898 theFindMethod, theInheritFirstArg, True )
900 print "addToStudy() failed"
902 return aShape.GetStudyEntry()
904 ## Publish in study aShape with name aName as sub-object of previously published aFather
905 # \param aFather previously published object
906 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
907 # \param aName the name for the shape
909 # \return study entry of the published shape in form of string
911 # @ingroup l1_publish_data
912 # @ref swig_all_addtostudyInFather "Example"
913 def addToStudyInFather(self, aFather, aShape, aName):
915 Publish in study aShape with name aName as sub-object of previously published aFather
918 aFather previously published object
919 aShape the shape to be published as sub-object of aFather
920 aName the name for the shape
923 study entry of the published shape in form of string
925 # Example: see GEOM_TestAll.py
927 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
928 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
930 print "addToStudyInFather() failed"
932 return aShape.GetStudyEntry()
934 ## Unpublish object in study
936 # \param obj the object to be unpublished
937 def hideInStudy(self, obj):
939 Unpublish object in study
942 obj the object to be unpublished
944 ior = salome.orb.object_to_string(obj)
945 aSObject = self.myStudy.FindObjectIOR(ior)
946 if aSObject is not None:
947 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
948 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
949 drwAttribute.SetDrawable(False)
950 # hide references if any
951 vso = self.myStudy.FindDependances(aSObject);
953 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
954 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
955 drwAttribute.SetDrawable(False)
959 # end of l1_geomBuilder_auxiliary
962 ## @addtogroup l3_restore_ss
965 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
966 # To be used from python scripts out of addToStudy() (non-default usage)
967 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
968 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
969 # If this list is empty, all operation arguments will be published
970 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
971 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
972 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
973 # Do not publish sub-shapes in place of arguments, but only
974 # in place of sub-shapes of the first argument,
975 # because the whole shape corresponds to the first argument.
976 # Mainly to be used after transformations, but it also can be
977 # usefull after partition with one object shape, and some other
978 # operations, where only the first argument has to be considered.
979 # If theObject has only one argument shape, this flag is automatically
980 # considered as True, not regarding really passed value.
981 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
982 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
983 # \return list of published sub-shapes
985 # @ref tui_restore_prs_params "Example"
986 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
987 theInheritFirstArg=False, theAddPrefix=True):
989 Publish sub-shapes, standing for arguments and sub-shapes of arguments
990 To be used from python scripts out of geompy.addToStudy (non-default usage)
993 theObject published GEOM.GEOM_Object, arguments of which will be published
994 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
995 If this list is empty, all operation arguments will be published
996 theFindMethod method to search sub-shapes, corresponding to arguments and
997 their sub-shapes. Value from enumeration GEOM.find_shape_method.
998 theInheritFirstArg set properties of the first argument for theObject.
999 Do not publish sub-shapes in place of arguments, but only
1000 in place of sub-shapes of the first argument,
1001 because the whole shape corresponds to the first argument.
1002 Mainly to be used after transformations, but it also can be
1003 usefull after partition with one object shape, and some other
1004 operations, where only the first argument has to be considered.
1005 If theObject has only one argument shape, this flag is automatically
1006 considered as True, not regarding really passed value.
1007 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1008 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1010 list of published sub-shapes
1012 # Example: see GEOM_TestAll.py
1013 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1014 theFindMethod, theInheritFirstArg, theAddPrefix)
1016 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1017 # To be used from python scripts out of addToStudy() (non-default usage)
1018 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1019 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1020 # If this list is empty, all operation arguments will be published
1021 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1022 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1023 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1024 # Do not publish sub-shapes in place of arguments, but only
1025 # in place of sub-shapes of the first argument,
1026 # because the whole shape corresponds to the first argument.
1027 # Mainly to be used after transformations, but it also can be
1028 # usefull after partition with one object shape, and some other
1029 # operations, where only the first argument has to be considered.
1030 # If theObject has only one argument shape, this flag is automatically
1031 # considered as True, not regarding really passed value.
1032 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1033 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1034 # \return list of published sub-shapes
1036 # @ref tui_restore_prs_params "Example"
1037 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1038 theInheritFirstArg=False, theAddPrefix=True):
1040 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1041 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1044 theObject published GEOM.GEOM_Object, arguments of which will be published
1045 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1046 If this list is empty, all operation arguments will be published
1047 theFindMethod method to search sub-shapes, corresponding to arguments and
1048 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1049 theInheritFirstArg set properties of the first argument for theObject.
1050 Do not publish sub-shapes in place of arguments, but only
1051 in place of sub-shapes of the first argument,
1052 because the whole shape corresponds to the first argument.
1053 Mainly to be used after transformations, but it also can be
1054 usefull after partition with one object shape, and some other
1055 operations, where only the first argument has to be considered.
1056 If theObject has only one argument shape, this flag is automatically
1057 considered as True, not regarding really passed value.
1058 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1059 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1062 list of published sub-shapes
1064 # Example: see GEOM_TestAll.py
1065 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1066 theFindMethod, theInheritFirstArg, theAddPrefix)
1068 # end of l3_restore_ss
1071 ## @addtogroup l3_basic_go
1074 ## Create point by three coordinates.
1075 # @param theX The X coordinate of the point.
1076 # @param theY The Y coordinate of the point.
1077 # @param theZ The Z coordinate of the point.
1078 # @param theName Object name; when specified, this parameter is used
1079 # for result publication in the study. Otherwise, if automatic
1080 # publication is switched on, default value is used for result name.
1082 # @return New GEOM.GEOM_Object, containing the created point.
1084 # @ref tui_creation_point "Example"
1085 @ManageTransactions("BasicOp")
1086 def MakeVertex(self, theX, theY, theZ, theName=None):
1088 Create point by three coordinates.
1091 theX The X coordinate of the point.
1092 theY The Y coordinate of the point.
1093 theZ The Z coordinate of the point.
1094 theName Object name; when specified, this parameter is used
1095 for result publication in the study. Otherwise, if automatic
1096 publication is switched on, default value is used for result name.
1099 New GEOM.GEOM_Object, containing the created point.
1101 # Example: see GEOM_TestAll.py
1102 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1103 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1104 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1105 anObj.SetParameters(Parameters)
1106 self._autoPublish(anObj, theName, "vertex")
1109 ## Create a point, distant from the referenced point
1110 # on the given distances along the coordinate axes.
1111 # @param theReference The referenced point.
1112 # @param theX Displacement from the referenced point along OX axis.
1113 # @param theY Displacement from the referenced point along OY axis.
1114 # @param theZ Displacement from the referenced point along OZ axis.
1115 # @param theName Object name; when specified, this parameter is used
1116 # for result publication in the study. Otherwise, if automatic
1117 # publication is switched on, default value is used for result name.
1119 # @return New GEOM.GEOM_Object, containing the created point.
1121 # @ref tui_creation_point "Example"
1122 @ManageTransactions("BasicOp")
1123 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1125 Create a point, distant from the referenced point
1126 on the given distances along the coordinate axes.
1129 theReference The referenced point.
1130 theX Displacement from the referenced point along OX axis.
1131 theY Displacement from the referenced point along OY axis.
1132 theZ Displacement from the referenced point along OZ axis.
1133 theName Object name; when specified, this parameter is used
1134 for result publication in the study. Otherwise, if automatic
1135 publication is switched on, default value is used for result name.
1138 New GEOM.GEOM_Object, containing the created point.
1140 # Example: see GEOM_TestAll.py
1141 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1142 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1143 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1144 anObj.SetParameters(Parameters)
1145 self._autoPublish(anObj, theName, "vertex")
1148 ## Create a point, corresponding to the given parameter on the given curve.
1149 # @param theRefCurve The referenced curve.
1150 # @param theParameter Value of parameter on the referenced curve.
1151 # @param theName Object name; when specified, this parameter is used
1152 # for result publication in the study. Otherwise, if automatic
1153 # publication is switched on, default value is used for result name.
1155 # @return New GEOM.GEOM_Object, containing the created point.
1157 # @ref tui_creation_point "Example"
1158 @ManageTransactions("BasicOp")
1159 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1161 Create a point, corresponding to the given parameter on the given curve.
1164 theRefCurve The referenced curve.
1165 theParameter Value of parameter on the referenced curve.
1166 theName Object name; when specified, this parameter is used
1167 for result publication in the study. Otherwise, if automatic
1168 publication is switched on, default value is used for result name.
1171 New GEOM.GEOM_Object, containing the created point.
1174 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1176 # Example: see GEOM_TestAll.py
1177 theParameter, Parameters = ParseParameters(theParameter)
1178 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1179 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1180 anObj.SetParameters(Parameters)
1181 self._autoPublish(anObj, theName, "vertex")
1184 ## Create a point by projection give coordinates on the given curve
1185 # @param theRefCurve The referenced curve.
1186 # @param theX X-coordinate in 3D space
1187 # @param theY Y-coordinate in 3D space
1188 # @param theZ Z-coordinate in 3D space
1189 # @param theName Object name; when specified, this parameter is used
1190 # for result publication in the study. Otherwise, if automatic
1191 # publication is switched on, default value is used for result name.
1193 # @return New GEOM.GEOM_Object, containing the created point.
1195 # @ref tui_creation_point "Example"
1196 @ManageTransactions("BasicOp")
1197 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1199 Create a point by projection give coordinates on the given curve
1202 theRefCurve The referenced curve.
1203 theX X-coordinate in 3D space
1204 theY Y-coordinate in 3D space
1205 theZ Z-coordinate in 3D space
1206 theName Object name; when specified, this parameter is used
1207 for result publication in the study. Otherwise, if automatic
1208 publication is switched on, default value is used for result name.
1211 New GEOM.GEOM_Object, containing the created point.
1214 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1216 # Example: see GEOM_TestAll.py
1217 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1218 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1219 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1220 anObj.SetParameters(Parameters)
1221 self._autoPublish(anObj, theName, "vertex")
1224 ## Create a point, corresponding to the given length on the given curve.
1225 # @param theRefCurve The referenced curve.
1226 # @param theLength Length on the referenced curve. It can be negative.
1227 # @param theStartPoint Point allowing to choose the direction for the calculation
1228 # of the length. If None, start from the first point of theRefCurve.
1229 # @param theName Object name; when specified, this parameter is used
1230 # for result publication in the study. Otherwise, if automatic
1231 # publication is switched on, default value is used for result name.
1233 # @return New GEOM.GEOM_Object, containing the created point.
1235 # @ref tui_creation_point "Example"
1236 @ManageTransactions("BasicOp")
1237 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1239 Create a point, corresponding to the given length on the given curve.
1242 theRefCurve The referenced curve.
1243 theLength Length on the referenced curve. It can be negative.
1244 theStartPoint Point allowing to choose the direction for the calculation
1245 of the length. If None, start from the first point of theRefCurve.
1246 theName Object name; when specified, this parameter is used
1247 for result publication in the study. Otherwise, if automatic
1248 publication is switched on, default value is used for result name.
1251 New GEOM.GEOM_Object, containing the created point.
1253 # Example: see GEOM_TestAll.py
1254 theLength, Parameters = ParseParameters(theLength)
1255 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1256 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1257 anObj.SetParameters(Parameters)
1258 self._autoPublish(anObj, theName, "vertex")
1261 ## Create a point, corresponding to the given parameters on the
1263 # @param theRefSurf The referenced surface.
1264 # @param theUParameter Value of U-parameter on the referenced surface.
1265 # @param theVParameter Value of V-parameter on the referenced surface.
1266 # @param theName Object name; when specified, this parameter is used
1267 # for result publication in the study. Otherwise, if automatic
1268 # publication is switched on, default value is used for result name.
1270 # @return New GEOM.GEOM_Object, containing the created point.
1272 # @ref swig_MakeVertexOnSurface "Example"
1273 @ManageTransactions("BasicOp")
1274 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1276 Create a point, corresponding to the given parameters on the
1280 theRefSurf The referenced surface.
1281 theUParameter Value of U-parameter on the referenced surface.
1282 theVParameter Value of V-parameter on the referenced surface.
1283 theName Object name; when specified, this parameter is used
1284 for result publication in the study. Otherwise, if automatic
1285 publication is switched on, default value is used for result name.
1288 New GEOM.GEOM_Object, containing the created point.
1291 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1293 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1294 # Example: see GEOM_TestAll.py
1295 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1296 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1297 anObj.SetParameters(Parameters);
1298 self._autoPublish(anObj, theName, "vertex")
1301 ## Create a point by projection give coordinates on the given surface
1302 # @param theRefSurf The referenced surface.
1303 # @param theX X-coordinate in 3D space
1304 # @param theY Y-coordinate in 3D space
1305 # @param theZ Z-coordinate in 3D space
1306 # @param theName Object name; when specified, this parameter is used
1307 # for result publication in the study. Otherwise, if automatic
1308 # publication is switched on, default value is used for result name.
1310 # @return New GEOM.GEOM_Object, containing the created point.
1312 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1313 @ManageTransactions("BasicOp")
1314 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1316 Create a point by projection give coordinates on the given surface
1319 theRefSurf The referenced surface.
1320 theX X-coordinate in 3D space
1321 theY Y-coordinate in 3D space
1322 theZ Z-coordinate in 3D space
1323 theName Object name; when specified, this parameter is used
1324 for result publication in the study. Otherwise, if automatic
1325 publication is switched on, default value is used for result name.
1328 New GEOM.GEOM_Object, containing the created point.
1331 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1333 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1334 # Example: see GEOM_TestAll.py
1335 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1336 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1337 anObj.SetParameters(Parameters);
1338 self._autoPublish(anObj, theName, "vertex")
1341 ## Create a point, which lays on the given face.
1342 # The point will lay in arbitrary place of the face.
1343 # The only condition on it is a non-zero distance to the face boundary.
1344 # Such point can be used to uniquely identify the face inside any
1345 # shape in case, when the shape does not contain overlapped faces.
1346 # @param theFace The referenced face.
1347 # @param theName Object name; when specified, this parameter is used
1348 # for result publication in the study. Otherwise, if automatic
1349 # publication is switched on, default value is used for result name.
1351 # @return New GEOM.GEOM_Object, containing the created point.
1353 # @ref swig_MakeVertexInsideFace "Example"
1354 @ManageTransactions("BasicOp")
1355 def MakeVertexInsideFace (self, theFace, theName=None):
1357 Create a point, which lays on the given face.
1358 The point will lay in arbitrary place of the face.
1359 The only condition on it is a non-zero distance to the face boundary.
1360 Such point can be used to uniquely identify the face inside any
1361 shape in case, when the shape does not contain overlapped faces.
1364 theFace The referenced face.
1365 theName Object name; when specified, this parameter is used
1366 for result publication in the study. Otherwise, if automatic
1367 publication is switched on, default value is used for result name.
1370 New GEOM.GEOM_Object, containing the created point.
1373 p_on_face = geompy.MakeVertexInsideFace(Face)
1375 # Example: see GEOM_TestAll.py
1376 anObj = self.BasicOp.MakePointOnFace(theFace)
1377 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1378 self._autoPublish(anObj, theName, "vertex")
1381 ## Create a point on intersection of two lines.
1382 # @param theRefLine1, theRefLine2 The referenced lines.
1383 # @param theName Object name; when specified, this parameter is used
1384 # for result publication in the study. Otherwise, if automatic
1385 # publication is switched on, default value is used for result name.
1387 # @return New GEOM.GEOM_Object, containing the created point.
1389 # @ref swig_MakeVertexOnLinesIntersection "Example"
1390 @ManageTransactions("BasicOp")
1391 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1393 Create a point on intersection of two lines.
1396 theRefLine1, theRefLine2 The referenced lines.
1397 theName Object name; when specified, this parameter is used
1398 for result publication in the study. Otherwise, if automatic
1399 publication is switched on, default value is used for result name.
1402 New GEOM.GEOM_Object, containing the created point.
1404 # Example: see GEOM_TestAll.py
1405 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1406 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1407 self._autoPublish(anObj, theName, "vertex")
1410 ## Create a tangent, corresponding to the given parameter on the given curve.
1411 # @param theRefCurve The referenced curve.
1412 # @param theParameter Value of parameter on the referenced curve.
1413 # @param theName Object name; when specified, this parameter is used
1414 # for result publication in the study. Otherwise, if automatic
1415 # publication is switched on, default value is used for result name.
1417 # @return New GEOM.GEOM_Object, containing the created tangent.
1419 # @ref swig_MakeTangentOnCurve "Example"
1420 @ManageTransactions("BasicOp")
1421 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1423 Create a tangent, corresponding to the given parameter on the given curve.
1426 theRefCurve The referenced curve.
1427 theParameter Value of parameter on the referenced curve.
1428 theName Object name; when specified, this parameter is used
1429 for result publication in the study. Otherwise, if automatic
1430 publication is switched on, default value is used for result name.
1433 New GEOM.GEOM_Object, containing the created tangent.
1436 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1438 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1439 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1440 self._autoPublish(anObj, theName, "tangent")
1443 ## Create a tangent plane, corresponding to the given parameter on the given face.
1444 # @param theFace The face for which tangent plane should be built.
1445 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1446 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1447 # @param theTrimSize the size of plane.
1448 # @param theName Object name; when specified, this parameter is used
1449 # for result publication in the study. Otherwise, if automatic
1450 # publication is switched on, default value is used for result name.
1452 # @return New GEOM.GEOM_Object, containing the created tangent.
1454 # @ref swig_MakeTangentPlaneOnFace "Example"
1455 @ManageTransactions("BasicOp")
1456 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1458 Create a tangent plane, corresponding to the given parameter on the given face.
1461 theFace The face for which tangent plane should be built.
1462 theParameterV vertical value of the center point (0.0 - 1.0).
1463 theParameterU horisontal value of the center point (0.0 - 1.0).
1464 theTrimSize the size of plane.
1465 theName Object name; when specified, this parameter is used
1466 for result publication in the study. Otherwise, if automatic
1467 publication is switched on, default value is used for result name.
1470 New GEOM.GEOM_Object, containing the created tangent.
1473 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1475 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1476 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1477 self._autoPublish(anObj, theName, "tangent")
1480 ## Create a vector with the given components.
1481 # @param theDX X component of the vector.
1482 # @param theDY Y component of the vector.
1483 # @param theDZ Z component of the vector.
1484 # @param theName Object name; when specified, this parameter is used
1485 # for result publication in the study. Otherwise, if automatic
1486 # publication is switched on, default value is used for result name.
1488 # @return New GEOM.GEOM_Object, containing the created vector.
1490 # @ref tui_creation_vector "Example"
1491 @ManageTransactions("BasicOp")
1492 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1494 Create a vector with the given components.
1497 theDX X component of the vector.
1498 theDY Y component of the vector.
1499 theDZ Z component of the vector.
1500 theName Object name; when specified, this parameter is used
1501 for result publication in the study. Otherwise, if automatic
1502 publication is switched on, default value is used for result name.
1505 New GEOM.GEOM_Object, containing the created vector.
1507 # Example: see GEOM_TestAll.py
1508 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1509 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1510 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1511 anObj.SetParameters(Parameters)
1512 self._autoPublish(anObj, theName, "vector")
1515 ## Create a vector between two points.
1516 # @param thePnt1 Start point for the vector.
1517 # @param thePnt2 End point for the vector.
1518 # @param theName Object name; when specified, this parameter is used
1519 # for result publication in the study. Otherwise, if automatic
1520 # publication is switched on, default value is used for result name.
1522 # @return New GEOM.GEOM_Object, containing the created vector.
1524 # @ref tui_creation_vector "Example"
1525 @ManageTransactions("BasicOp")
1526 def MakeVector(self, thePnt1, thePnt2, theName=None):
1528 Create a vector between two points.
1531 thePnt1 Start point for the vector.
1532 thePnt2 End point for the vector.
1533 theName Object name; when specified, this parameter is used
1534 for result publication in the study. Otherwise, if automatic
1535 publication is switched on, default value is used for result name.
1538 New GEOM.GEOM_Object, containing the created vector.
1540 # Example: see GEOM_TestAll.py
1541 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1542 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1543 self._autoPublish(anObj, theName, "vector")
1546 ## Create a line, passing through the given point
1547 # and parrallel to the given direction
1548 # @param thePnt Point. The resulting line will pass through it.
1549 # @param theDir Direction. The resulting line will be parallel to it.
1550 # @param theName Object name; when specified, this parameter is used
1551 # for result publication in the study. Otherwise, if automatic
1552 # publication is switched on, default value is used for result name.
1554 # @return New GEOM.GEOM_Object, containing the created line.
1556 # @ref tui_creation_line "Example"
1557 @ManageTransactions("BasicOp")
1558 def MakeLine(self, thePnt, theDir, theName=None):
1560 Create a line, passing through the given point
1561 and parrallel to the given direction
1564 thePnt Point. The resulting line will pass through it.
1565 theDir Direction. The resulting line will be parallel to it.
1566 theName Object name; when specified, this parameter is used
1567 for result publication in the study. Otherwise, if automatic
1568 publication is switched on, default value is used for result name.
1571 New GEOM.GEOM_Object, containing the created line.
1573 # Example: see GEOM_TestAll.py
1574 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1575 RaiseIfFailed("MakeLine", self.BasicOp)
1576 self._autoPublish(anObj, theName, "line")
1579 ## Create a line, passing through the given points
1580 # @param thePnt1 First of two points, defining the line.
1581 # @param thePnt2 Second of two points, defining the line.
1582 # @param theName Object name; when specified, this parameter is used
1583 # for result publication in the study. Otherwise, if automatic
1584 # publication is switched on, default value is used for result name.
1586 # @return New GEOM.GEOM_Object, containing the created line.
1588 # @ref tui_creation_line "Example"
1589 @ManageTransactions("BasicOp")
1590 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1592 Create a line, passing through the given points
1595 thePnt1 First of two points, defining the line.
1596 thePnt2 Second of two points, defining the line.
1597 theName Object name; when specified, this parameter is used
1598 for result publication in the study. Otherwise, if automatic
1599 publication is switched on, default value is used for result name.
1602 New GEOM.GEOM_Object, containing the created line.
1604 # Example: see GEOM_TestAll.py
1605 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1606 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1607 self._autoPublish(anObj, theName, "line")
1610 ## Create a line on two faces intersection.
1611 # @param theFace1 First of two faces, defining the line.
1612 # @param theFace2 Second of two faces, defining the line.
1613 # @param theName Object name; when specified, this parameter is used
1614 # for result publication in the study. Otherwise, if automatic
1615 # publication is switched on, default value is used for result name.
1617 # @return New GEOM.GEOM_Object, containing the created line.
1619 # @ref swig_MakeLineTwoFaces "Example"
1620 @ManageTransactions("BasicOp")
1621 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1623 Create a line on two faces intersection.
1626 theFace1 First of two faces, defining the line.
1627 theFace2 Second of two faces, defining the line.
1628 theName Object name; when specified, this parameter is used
1629 for result publication in the study. Otherwise, if automatic
1630 publication is switched on, default value is used for result name.
1633 New GEOM.GEOM_Object, containing the created line.
1635 # Example: see GEOM_TestAll.py
1636 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1637 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1638 self._autoPublish(anObj, theName, "line")
1641 ## Create a plane, passing through the given point
1642 # and normal to the given vector.
1643 # @param thePnt Point, the plane has to pass through.
1644 # @param theVec Vector, defining the plane normal direction.
1645 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1646 # @param theName Object name; when specified, this parameter is used
1647 # for result publication in the study. Otherwise, if automatic
1648 # publication is switched on, default value is used for result name.
1650 # @return New GEOM.GEOM_Object, containing the created plane.
1652 # @ref tui_creation_plane "Example"
1653 @ManageTransactions("BasicOp")
1654 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1656 Create a plane, passing through the given point
1657 and normal to the given vector.
1660 thePnt Point, the plane has to pass through.
1661 theVec Vector, defining the plane normal direction.
1662 theTrimSize Half size of a side of quadrangle face, representing the plane.
1663 theName Object name; when specified, this parameter is used
1664 for result publication in the study. Otherwise, if automatic
1665 publication is switched on, default value is used for result name.
1668 New GEOM.GEOM_Object, containing the created plane.
1670 # Example: see GEOM_TestAll.py
1671 theTrimSize, Parameters = ParseParameters(theTrimSize);
1672 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1673 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1674 anObj.SetParameters(Parameters)
1675 self._autoPublish(anObj, theName, "plane")
1678 ## Create a plane, passing through the three given points
1679 # @param thePnt1 First of three points, defining the plane.
1680 # @param thePnt2 Second of three points, defining the plane.
1681 # @param thePnt3 Fird of three points, defining the plane.
1682 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1683 # @param theName Object name; when specified, this parameter is used
1684 # for result publication in the study. Otherwise, if automatic
1685 # publication is switched on, default value is used for result name.
1687 # @return New GEOM.GEOM_Object, containing the created plane.
1689 # @ref tui_creation_plane "Example"
1690 @ManageTransactions("BasicOp")
1691 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1693 Create a plane, passing through the three given points
1696 thePnt1 First of three points, defining the plane.
1697 thePnt2 Second of three points, defining the plane.
1698 thePnt3 Fird of three points, defining the plane.
1699 theTrimSize Half size of a side of quadrangle face, representing the plane.
1700 theName Object name; when specified, this parameter is used
1701 for result publication in the study. Otherwise, if automatic
1702 publication is switched on, default value is used for result name.
1705 New GEOM.GEOM_Object, containing the created plane.
1707 # Example: see GEOM_TestAll.py
1708 theTrimSize, Parameters = ParseParameters(theTrimSize);
1709 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1710 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1711 anObj.SetParameters(Parameters)
1712 self._autoPublish(anObj, theName, "plane")
1715 ## Create a plane, similar to the existing one, but with another size of representing face.
1716 # @param theFace Referenced plane or LCS(Marker).
1717 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1718 # @param theName Object name; when specified, this parameter is used
1719 # for result publication in the study. Otherwise, if automatic
1720 # publication is switched on, default value is used for result name.
1722 # @return New GEOM.GEOM_Object, containing the created plane.
1724 # @ref tui_creation_plane "Example"
1725 @ManageTransactions("BasicOp")
1726 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1728 Create a plane, similar to the existing one, but with another size of representing face.
1731 theFace Referenced plane or LCS(Marker).
1732 theTrimSize New half size of a side of quadrangle face, representing the plane.
1733 theName Object name; when specified, this parameter is used
1734 for result publication in the study. Otherwise, if automatic
1735 publication is switched on, default value is used for result name.
1738 New GEOM.GEOM_Object, containing the created plane.
1740 # Example: see GEOM_TestAll.py
1741 theTrimSize, Parameters = ParseParameters(theTrimSize);
1742 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1743 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1744 anObj.SetParameters(Parameters)
1745 self._autoPublish(anObj, theName, "plane")
1748 ## Create a plane, passing through the 2 vectors
1749 # with center in a start point of the first vector.
1750 # @param theVec1 Vector, defining center point and plane direction.
1751 # @param theVec2 Vector, defining the plane normal direction.
1752 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1753 # @param theName Object name; when specified, this parameter is used
1754 # for result publication in the study. Otherwise, if automatic
1755 # publication is switched on, default value is used for result name.
1757 # @return New GEOM.GEOM_Object, containing the created plane.
1759 # @ref tui_creation_plane "Example"
1760 @ManageTransactions("BasicOp")
1761 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1763 Create a plane, passing through the 2 vectors
1764 with center in a start point of the first vector.
1767 theVec1 Vector, defining center point and plane direction.
1768 theVec2 Vector, defining the plane normal direction.
1769 theTrimSize Half size of a side of quadrangle face, representing the plane.
1770 theName Object name; when specified, this parameter is used
1771 for result publication in the study. Otherwise, if automatic
1772 publication is switched on, default value is used for result name.
1775 New GEOM.GEOM_Object, containing the created plane.
1777 # Example: see GEOM_TestAll.py
1778 theTrimSize, Parameters = ParseParameters(theTrimSize);
1779 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1780 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1781 anObj.SetParameters(Parameters)
1782 self._autoPublish(anObj, theName, "plane")
1785 ## Create a plane, based on a Local coordinate system.
1786 # @param theLCS coordinate system, defining plane.
1787 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1788 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1789 # @param theName Object name; when specified, this parameter is used
1790 # for result publication in the study. Otherwise, if automatic
1791 # publication is switched on, default value is used for result name.
1793 # @return New GEOM.GEOM_Object, containing the created plane.
1795 # @ref tui_creation_plane "Example"
1796 @ManageTransactions("BasicOp")
1797 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1799 Create a plane, based on a Local coordinate system.
1802 theLCS coordinate system, defining plane.
1803 theTrimSize Half size of a side of quadrangle face, representing the plane.
1804 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1805 theName Object name; when specified, this parameter is used
1806 for result publication in the study. Otherwise, if automatic
1807 publication is switched on, default value is used for result name.
1810 New GEOM.GEOM_Object, containing the created plane.
1812 # Example: see GEOM_TestAll.py
1813 theTrimSize, Parameters = ParseParameters(theTrimSize);
1814 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1815 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1816 anObj.SetParameters(Parameters)
1817 self._autoPublish(anObj, theName, "plane")
1820 ## Create a local coordinate system.
1821 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1822 # @param XDX,XDY,XDZ Three components of OX direction
1823 # @param YDX,YDY,YDZ Three components of OY direction
1824 # @param theName Object name; when specified, this parameter is used
1825 # for result publication in the study. Otherwise, if automatic
1826 # publication is switched on, default value is used for result name.
1828 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1830 # @ref swig_MakeMarker "Example"
1831 @ManageTransactions("BasicOp")
1832 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1834 Create a local coordinate system.
1837 OX,OY,OZ Three coordinates of coordinate system origin.
1838 XDX,XDY,XDZ Three components of OX direction
1839 YDX,YDY,YDZ Three components of OY direction
1840 theName Object name; when specified, this parameter is used
1841 for result publication in the study. Otherwise, if automatic
1842 publication is switched on, default value is used for result name.
1845 New GEOM.GEOM_Object, containing the created coordinate system.
1847 # Example: see GEOM_TestAll.py
1848 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1849 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1850 RaiseIfFailed("MakeMarker", self.BasicOp)
1851 anObj.SetParameters(Parameters)
1852 self._autoPublish(anObj, theName, "lcs")
1855 ## Create a local coordinate system from shape.
1856 # @param theShape The initial shape to detect the coordinate system.
1857 # @param theName Object name; when specified, this parameter is used
1858 # for result publication in the study. Otherwise, if automatic
1859 # publication is switched on, default value is used for result name.
1861 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1863 # @ref tui_creation_lcs "Example"
1864 @ManageTransactions("BasicOp")
1865 def MakeMarkerFromShape(self, theShape, theName=None):
1867 Create a local coordinate system from shape.
1870 theShape The initial shape to detect the coordinate system.
1871 theName Object name; when specified, this parameter is used
1872 for result publication in the study. Otherwise, if automatic
1873 publication is switched on, default value is used for result name.
1876 New GEOM.GEOM_Object, containing the created coordinate system.
1878 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1879 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1880 self._autoPublish(anObj, theName, "lcs")
1883 ## Create a local coordinate system from point and two vectors.
1884 # @param theOrigin Point of coordinate system origin.
1885 # @param theXVec Vector of X direction
1886 # @param theYVec Vector of Y direction
1887 # @param theName Object name; when specified, this parameter is used
1888 # for result publication in the study. Otherwise, if automatic
1889 # publication is switched on, default value is used for result name.
1891 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1893 # @ref tui_creation_lcs "Example"
1894 @ManageTransactions("BasicOp")
1895 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1897 Create a local coordinate system from point and two vectors.
1900 theOrigin Point of coordinate system origin.
1901 theXVec Vector of X direction
1902 theYVec Vector of Y direction
1903 theName Object name; when specified, this parameter is used
1904 for result publication in the study. Otherwise, if automatic
1905 publication is switched on, default value is used for result name.
1908 New GEOM.GEOM_Object, containing the created coordinate system.
1911 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1912 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1913 self._autoPublish(anObj, theName, "lcs")
1916 # end of l3_basic_go
1919 ## @addtogroup l4_curves
1922 ## Create an arc of circle, passing through three given points.
1923 # @param thePnt1 Start point of the arc.
1924 # @param thePnt2 Middle point of the arc.
1925 # @param thePnt3 End point of the arc.
1926 # @param theName Object name; when specified, this parameter is used
1927 # for result publication in the study. Otherwise, if automatic
1928 # publication is switched on, default value is used for result name.
1930 # @return New GEOM.GEOM_Object, containing the created arc.
1932 # @ref swig_MakeArc "Example"
1933 @ManageTransactions("CurvesOp")
1934 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1936 Create an arc of circle, passing through three given points.
1939 thePnt1 Start point of the arc.
1940 thePnt2 Middle point of the arc.
1941 thePnt3 End point of the arc.
1942 theName Object name; when specified, this parameter is used
1943 for result publication in the study. Otherwise, if automatic
1944 publication is switched on, default value is used for result name.
1947 New GEOM.GEOM_Object, containing the created arc.
1949 # Example: see GEOM_TestAll.py
1950 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1951 RaiseIfFailed("MakeArc", self.CurvesOp)
1952 self._autoPublish(anObj, theName, "arc")
1955 ## Create an arc of circle from a center and 2 points.
1956 # @param thePnt1 Center of the arc
1957 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1958 # @param thePnt3 End point of the arc (Gives also a direction)
1959 # @param theSense Orientation of the arc
1960 # @param theName Object name; when specified, this parameter is used
1961 # for result publication in the study. Otherwise, if automatic
1962 # publication is switched on, default value is used for result name.
1964 # @return New GEOM.GEOM_Object, containing the created arc.
1966 # @ref swig_MakeArc "Example"
1967 @ManageTransactions("CurvesOp")
1968 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1970 Create an arc of circle from a center and 2 points.
1973 thePnt1 Center of the arc
1974 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1975 thePnt3 End point of the arc (Gives also a direction)
1976 theSense Orientation of the arc
1977 theName Object name; when specified, this parameter is used
1978 for result publication in the study. Otherwise, if automatic
1979 publication is switched on, default value is used for result name.
1982 New GEOM.GEOM_Object, containing the created arc.
1984 # Example: see GEOM_TestAll.py
1985 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1986 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1987 self._autoPublish(anObj, theName, "arc")
1990 ## Create an arc of ellipse, of center and two points.
1991 # @param theCenter Center of the arc.
1992 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1993 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1994 # @param theName Object name; when specified, this parameter is used
1995 # for result publication in the study. Otherwise, if automatic
1996 # publication is switched on, default value is used for result name.
1998 # @return New GEOM.GEOM_Object, containing the created arc.
2000 # @ref swig_MakeArc "Example"
2001 @ManageTransactions("CurvesOp")
2002 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2004 Create an arc of ellipse, of center and two points.
2007 theCenter Center of the arc.
2008 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2009 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2010 theName Object name; when specified, this parameter is used
2011 for result publication in the study. Otherwise, if automatic
2012 publication is switched on, default value is used for result name.
2015 New GEOM.GEOM_Object, containing the created arc.
2017 # Example: see GEOM_TestAll.py
2018 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2019 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2020 self._autoPublish(anObj, theName, "arc")
2023 ## Create a circle with given center, normal vector and radius.
2024 # @param thePnt Circle center.
2025 # @param theVec Vector, normal to the plane of the circle.
2026 # @param theR Circle radius.
2027 # @param theName Object name; when specified, this parameter is used
2028 # for result publication in the study. Otherwise, if automatic
2029 # publication is switched on, default value is used for result name.
2031 # @return New GEOM.GEOM_Object, containing the created circle.
2033 # @ref tui_creation_circle "Example"
2034 @ManageTransactions("CurvesOp")
2035 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2037 Create a circle with given center, normal vector and radius.
2040 thePnt Circle center.
2041 theVec Vector, normal to the plane of the circle.
2043 theName Object name; when specified, this parameter is used
2044 for result publication in the study. Otherwise, if automatic
2045 publication is switched on, default value is used for result name.
2048 New GEOM.GEOM_Object, containing the created circle.
2050 # Example: see GEOM_TestAll.py
2051 theR, Parameters = ParseParameters(theR)
2052 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2053 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2054 anObj.SetParameters(Parameters)
2055 self._autoPublish(anObj, theName, "circle")
2058 ## Create a circle with given radius.
2059 # Center of the circle will be in the origin of global
2060 # coordinate system and normal vector will be codirected with Z axis
2061 # @param theR Circle radius.
2062 # @param theName Object name; when specified, this parameter is used
2063 # for result publication in the study. Otherwise, if automatic
2064 # publication is switched on, default value is used for result name.
2066 # @return New GEOM.GEOM_Object, containing the created circle.
2067 @ManageTransactions("CurvesOp")
2068 def MakeCircleR(self, theR, theName=None):
2070 Create a circle with given radius.
2071 Center of the circle will be in the origin of global
2072 coordinate system and normal vector will be codirected with Z axis
2076 theName Object name; when specified, this parameter is used
2077 for result publication in the study. Otherwise, if automatic
2078 publication is switched on, default value is used for result name.
2081 New GEOM.GEOM_Object, containing the created circle.
2083 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2084 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2085 self._autoPublish(anObj, theName, "circle")
2088 ## Create a circle, passing through three given points
2089 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2090 # @param theName Object name; when specified, this parameter is used
2091 # for result publication in the study. Otherwise, if automatic
2092 # publication is switched on, default value is used for result name.
2094 # @return New GEOM.GEOM_Object, containing the created circle.
2096 # @ref tui_creation_circle "Example"
2097 @ManageTransactions("CurvesOp")
2098 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2100 Create a circle, passing through three given points
2103 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2104 theName Object name; when specified, this parameter is used
2105 for result publication in the study. Otherwise, if automatic
2106 publication is switched on, default value is used for result name.
2109 New GEOM.GEOM_Object, containing the created circle.
2111 # Example: see GEOM_TestAll.py
2112 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2113 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2114 self._autoPublish(anObj, theName, "circle")
2117 ## Create a circle, with given point1 as center,
2118 # passing through the point2 as radius and laying in the plane,
2119 # defined by all three given points.
2120 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2121 # @param theName Object name; when specified, this parameter is used
2122 # for result publication in the study. Otherwise, if automatic
2123 # publication is switched on, default value is used for result name.
2125 # @return New GEOM.GEOM_Object, containing the created circle.
2127 # @ref swig_MakeCircle "Example"
2128 @ManageTransactions("CurvesOp")
2129 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2131 Create a circle, with given point1 as center,
2132 passing through the point2 as radius and laying in the plane,
2133 defined by all three given points.
2136 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2137 theName Object name; when specified, this parameter is used
2138 for result publication in the study. Otherwise, if automatic
2139 publication is switched on, default value is used for result name.
2142 New GEOM.GEOM_Object, containing the created circle.
2144 # Example: see GEOM_example6.py
2145 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2146 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2147 self._autoPublish(anObj, theName, "circle")
2150 ## Create an ellipse with given center, normal vector and radiuses.
2151 # @param thePnt Ellipse center.
2152 # @param theVec Vector, normal to the plane of the ellipse.
2153 # @param theRMajor Major ellipse radius.
2154 # @param theRMinor Minor ellipse radius.
2155 # @param theVecMaj Vector, direction of the ellipse's main axis.
2156 # @param theName Object name; when specified, this parameter is used
2157 # for result publication in the study. Otherwise, if automatic
2158 # publication is switched on, default value is used for result name.
2160 # @return New GEOM.GEOM_Object, containing the created ellipse.
2162 # @ref tui_creation_ellipse "Example"
2163 @ManageTransactions("CurvesOp")
2164 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2166 Create an ellipse with given center, normal vector and radiuses.
2169 thePnt Ellipse center.
2170 theVec Vector, normal to the plane of the ellipse.
2171 theRMajor Major ellipse radius.
2172 theRMinor Minor ellipse radius.
2173 theVecMaj Vector, direction of the ellipse's main axis.
2174 theName Object name; when specified, this parameter is used
2175 for result publication in the study. Otherwise, if automatic
2176 publication is switched on, default value is used for result name.
2179 New GEOM.GEOM_Object, containing the created ellipse.
2181 # Example: see GEOM_TestAll.py
2182 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2183 if theVecMaj is not None:
2184 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2186 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2188 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2189 anObj.SetParameters(Parameters)
2190 self._autoPublish(anObj, theName, "ellipse")
2193 ## Create an ellipse with given radiuses.
2194 # Center of the ellipse will be in the origin of global
2195 # coordinate system and normal vector will be codirected with Z axis
2196 # @param theRMajor Major ellipse radius.
2197 # @param theRMinor Minor ellipse radius.
2198 # @param theName Object name; when specified, this parameter is used
2199 # for result publication in the study. Otherwise, if automatic
2200 # publication is switched on, default value is used for result name.
2202 # @return New GEOM.GEOM_Object, containing the created ellipse.
2203 @ManageTransactions("CurvesOp")
2204 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2206 Create an ellipse with given radiuses.
2207 Center of the ellipse will be in the origin of global
2208 coordinate system and normal vector will be codirected with Z axis
2211 theRMajor Major ellipse radius.
2212 theRMinor Minor ellipse radius.
2213 theName Object name; when specified, this parameter is used
2214 for result publication in the study. Otherwise, if automatic
2215 publication is switched on, default value is used for result name.
2218 New GEOM.GEOM_Object, containing the created ellipse.
2220 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2221 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2222 self._autoPublish(anObj, theName, "ellipse")
2225 ## Create a polyline on the set of points.
2226 # @param thePoints Sequence of points for the polyline.
2227 # @param theIsClosed If True, build a closed wire.
2228 # @param theName Object name; when specified, this parameter is used
2229 # for result publication in the study. Otherwise, if automatic
2230 # publication is switched on, default value is used for result name.
2232 # @return New GEOM.GEOM_Object, containing the created polyline.
2234 # @ref tui_creation_curve "Example"
2235 @ManageTransactions("CurvesOp")
2236 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2238 Create a polyline on the set of points.
2241 thePoints Sequence of points for the polyline.
2242 theIsClosed If True, build a closed wire.
2243 theName Object name; when specified, this parameter is used
2244 for result publication in the study. Otherwise, if automatic
2245 publication is switched on, default value is used for result name.
2248 New GEOM.GEOM_Object, containing the created polyline.
2250 # Example: see GEOM_TestAll.py
2251 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2252 RaiseIfFailed("MakePolyline", self.CurvesOp)
2253 self._autoPublish(anObj, theName, "polyline")
2256 ## Create bezier curve on the set of points.
2257 # @param thePoints Sequence of points for the bezier curve.
2258 # @param theIsClosed If True, build a closed curve.
2259 # @param theName Object name; when specified, this parameter is used
2260 # for result publication in the study. Otherwise, if automatic
2261 # publication is switched on, default value is used for result name.
2263 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2265 # @ref tui_creation_curve "Example"
2266 @ManageTransactions("CurvesOp")
2267 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2269 Create bezier curve on the set of points.
2272 thePoints Sequence of points for the bezier curve.
2273 theIsClosed If True, build a closed curve.
2274 theName Object name; when specified, this parameter is used
2275 for result publication in the study. Otherwise, if automatic
2276 publication is switched on, default value is used for result name.
2279 New GEOM.GEOM_Object, containing the created bezier curve.
2281 # Example: see GEOM_TestAll.py
2282 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2283 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2284 self._autoPublish(anObj, theName, "bezier")
2287 ## Create B-Spline curve on the set of points.
2288 # @param thePoints Sequence of points for the B-Spline curve.
2289 # @param theIsClosed If True, build a closed curve.
2290 # @param theDoReordering If TRUE, the algo does not follow the order of
2291 # \a thePoints but searches for the closest vertex.
2292 # @param theName Object name; when specified, this parameter is used
2293 # for result publication in the study. Otherwise, if automatic
2294 # publication is switched on, default value is used for result name.
2296 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2298 # @ref tui_creation_curve "Example"
2299 @ManageTransactions("CurvesOp")
2300 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2302 Create B-Spline curve on the set of points.
2305 thePoints Sequence of points for the B-Spline curve.
2306 theIsClosed If True, build a closed curve.
2307 theDoReordering If True, the algo does not follow the order of
2308 thePoints but searches for the closest vertex.
2309 theName Object name; when specified, this parameter is used
2310 for result publication in the study. Otherwise, if automatic
2311 publication is switched on, default value is used for result name.
2314 New GEOM.GEOM_Object, containing the created B-Spline curve.
2316 # Example: see GEOM_TestAll.py
2317 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2318 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2319 self._autoPublish(anObj, theName, "bspline")
2322 ## Create B-Spline curve on the set of points.
2323 # @param thePoints Sequence of points for the B-Spline curve.
2324 # @param theFirstVec Vector object, defining the curve direction at its first point.
2325 # @param theLastVec Vector object, defining the curve direction at its last point.
2326 # @param theName Object name; when specified, this parameter is used
2327 # for result publication in the study. Otherwise, if automatic
2328 # publication is switched on, default value is used for result name.
2330 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2332 # @ref tui_creation_curve "Example"
2333 @ManageTransactions("CurvesOp")
2334 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2336 Create B-Spline curve on the set of points.
2339 thePoints Sequence of points for the B-Spline curve.
2340 theFirstVec Vector object, defining the curve direction at its first point.
2341 theLastVec Vector object, defining the curve direction at its last point.
2342 theName Object name; when specified, this parameter is used
2343 for result publication in the study. Otherwise, if automatic
2344 publication is switched on, default value is used for result name.
2347 New GEOM.GEOM_Object, containing the created B-Spline curve.
2349 # Example: see GEOM_TestAll.py
2350 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2351 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2352 self._autoPublish(anObj, theName, "bspline")
2355 ## Creates a curve using the parametric definition of the basic points.
2356 # @param thexExpr parametric equation of the coordinates X.
2357 # @param theyExpr parametric equation of the coordinates Y.
2358 # @param thezExpr parametric equation of the coordinates Z.
2359 # @param theParamMin the minimal value of the parameter.
2360 # @param theParamMax the maximum value of the parameter.
2361 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2362 # @param theCurveType the type of the curve,
2363 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2364 # @param theNewMethod flag for switching to the new method if the flag is set to false a deprecated method is used which can lead to a bug.
2365 # @param theName Object name; when specified, this parameter is used
2366 # for result publication in the study. Otherwise, if automatic
2367 # publication is switched on, default value is used for result name.
2369 # @return New GEOM.GEOM_Object, containing the created curve.
2371 # @ref tui_creation_curve "Example"
2372 @ManageTransactions("CurvesOp")
2373 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2374 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2376 Creates a curve using the parametric definition of the basic points.
2379 thexExpr parametric equation of the coordinates X.
2380 theyExpr parametric equation of the coordinates Y.
2381 thezExpr parametric equation of the coordinates Z.
2382 theParamMin the minimal value of the parameter.
2383 theParamMax the maximum value of the parameter.
2384 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2385 theCurveType the type of the curve,
2386 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2387 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2388 method is used which can lead to a bug.
2389 theName Object name; when specified, this parameter is used
2390 for result publication in the study. Otherwise, if automatic
2391 publication is switched on, default value is used for result name.
2394 New GEOM.GEOM_Object, containing the created curve.
2396 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2398 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2400 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2401 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2402 anObj.SetParameters(Parameters)
2403 self._autoPublish(anObj, theName, "curve")
2406 ## Create an isoline curve on a face.
2407 # @param theFace the face for which an isoline is created.
2408 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2410 # @param theParameter the U parameter for U-isoline or V parameter
2412 # @param theName Object name; when specified, this parameter is used
2413 # for result publication in the study. Otherwise, if automatic
2414 # publication is switched on, default value is used for result name.
2416 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2417 # a compound of edges.
2419 # @ref tui_creation_curve "Example"
2420 @ManageTransactions("CurvesOp")
2421 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2423 Create an isoline curve on a face.
2426 theFace the face for which an isoline is created.
2427 IsUIsoline True for U-isoline creation; False for V-isoline
2429 theParameter the U parameter for U-isoline or V parameter
2431 theName Object name; when specified, this parameter is used
2432 for result publication in the study. Otherwise, if automatic
2433 publication is switched on, default value is used for result name.
2436 New GEOM.GEOM_Object, containing the created isoline edge or a
2439 # Example: see GEOM_TestAll.py
2440 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2441 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2443 self._autoPublish(anObj, theName, "U-Isoline")
2445 self._autoPublish(anObj, theName, "V-Isoline")
2451 ## @addtogroup l3_sketcher
2454 ## Create a sketcher (wire or face), following the textual description,
2455 # passed through <VAR>theCommand</VAR> argument. \n
2456 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2457 # Format of the description string have to be the following:
2459 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2462 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2464 # - "R angle" : Set the direction by angle
2465 # - "D dx dy" : Set the direction by DX & DY
2468 # - "TT x y" : Create segment by point at X & Y
2469 # - "T dx dy" : Create segment by point with DX & DY
2470 # - "L length" : Create segment by direction & Length
2471 # - "IX x" : Create segment by direction & Intersect. X
2472 # - "IY y" : Create segment by direction & Intersect. Y
2475 # - "C radius length" : Create arc by direction, radius and length(in degree)
2476 # - "AA x y": Create arc by point at X & Y
2477 # - "A dx dy" : Create arc by point with DX & DY
2478 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2479 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2480 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2481 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2484 # - "WW" : Close Wire (to finish)
2485 # - "WF" : Close Wire and build face (to finish)
2488 # - Flag1 (= reverse) is 0 or 2 ...
2489 # - if 0 the drawn arc is the one of lower angle (< Pi)
2490 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2493 # - Flag2 (= control tolerance) is 0 or 1 ...
2494 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2495 # - if 1 the wire is built only if the end point is on the arc
2496 # with a tolerance of 10^-7 on the distance else the creation fails
2498 # @param theCommand String, defining the sketcher in local
2499 # coordinates of the working plane.
2500 # @param theWorkingPlane Nine double values, defining origin,
2501 # OZ and OX directions of the working plane.
2502 # @param theName Object name; when specified, this parameter is used
2503 # for result publication in the study. Otherwise, if automatic
2504 # publication is switched on, default value is used for result name.
2506 # @return New GEOM.GEOM_Object, containing the created wire.
2508 # @ref tui_sketcher_page "Example"
2509 @ManageTransactions("CurvesOp")
2510 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2512 Create a sketcher (wire or face), following the textual description, passed
2513 through theCommand argument.
2514 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2515 Format of the description string have to be the following:
2516 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2518 - x1, y1 are coordinates of the first sketcher point (zero by default),
2520 - "R angle" : Set the direction by angle
2521 - "D dx dy" : Set the direction by DX & DY
2523 - "TT x y" : Create segment by point at X & Y
2524 - "T dx dy" : Create segment by point with DX & DY
2525 - "L length" : Create segment by direction & Length
2526 - "IX x" : Create segment by direction & Intersect. X
2527 - "IY y" : Create segment by direction & Intersect. Y
2529 - "C radius length" : Create arc by direction, radius and length(in degree)
2530 - "AA x y": Create arc by point at X & Y
2531 - "A dx dy" : Create arc by point with DX & DY
2532 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2533 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2534 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2535 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2537 - "WW" : Close Wire (to finish)
2538 - "WF" : Close Wire and build face (to finish)
2540 - Flag1 (= reverse) is 0 or 2 ...
2541 - if 0 the drawn arc is the one of lower angle (< Pi)
2542 - if 2 the drawn arc ius the one of greater angle (> Pi)
2544 - Flag2 (= control tolerance) is 0 or 1 ...
2545 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2546 - if 1 the wire is built only if the end point is on the arc
2547 with a tolerance of 10^-7 on the distance else the creation fails
2550 theCommand String, defining the sketcher in local
2551 coordinates of the working plane.
2552 theWorkingPlane Nine double values, defining origin,
2553 OZ and OX directions of the working plane.
2554 theName Object name; when specified, this parameter is used
2555 for result publication in the study. Otherwise, if automatic
2556 publication is switched on, default value is used for result name.
2559 New GEOM.GEOM_Object, containing the created wire.
2561 # Example: see GEOM_TestAll.py
2562 theCommand,Parameters = ParseSketcherCommand(theCommand)
2563 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2564 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2565 anObj.SetParameters(Parameters)
2566 self._autoPublish(anObj, theName, "wire")
2569 ## Create a sketcher (wire or face), following the textual description,
2570 # passed through <VAR>theCommand</VAR> argument. \n
2571 # For format of the description string see MakeSketcher() method.\n
2572 # @param theCommand String, defining the sketcher in local
2573 # coordinates of the working plane.
2574 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2575 # @param theName Object name; when specified, this parameter is used
2576 # for result publication in the study. Otherwise, if automatic
2577 # publication is switched on, default value is used for result name.
2579 # @return New GEOM.GEOM_Object, containing the created wire.
2581 # @ref tui_sketcher_page "Example"
2582 @ManageTransactions("CurvesOp")
2583 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2585 Create a sketcher (wire or face), following the textual description,
2586 passed through theCommand argument.
2587 For format of the description string see geompy.MakeSketcher() method.
2590 theCommand String, defining the sketcher in local
2591 coordinates of the working plane.
2592 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2593 theName Object name; when specified, this parameter is used
2594 for result publication in the study. Otherwise, if automatic
2595 publication is switched on, default value is used for result name.
2598 New GEOM.GEOM_Object, containing the created wire.
2600 theCommand,Parameters = ParseSketcherCommand(theCommand)
2601 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2602 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2603 anObj.SetParameters(Parameters)
2604 self._autoPublish(anObj, theName, "wire")
2607 ## Obtain a 2D sketcher interface
2608 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2609 def Sketcher2D (self):
2611 Obtain a 2D sketcher interface.
2614 sk = geompy.Sketcher2D()
2616 sk.addSegmentRelative(15, 70)
2617 sk.addSegmentPerpY(50)
2618 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2619 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2620 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2622 Sketch_1 = sk.wire(geomObj_1)
2624 sk = Sketcher2D (self)
2627 ## Create a sketcher wire, following the numerical description,
2628 # passed through <VAR>theCoordinates</VAR> argument. \n
2629 # @param theCoordinates double values, defining points to create a wire,
2631 # @param theName Object name; when specified, this parameter is used
2632 # for result publication in the study. Otherwise, if automatic
2633 # publication is switched on, default value is used for result name.
2635 # @return New GEOM.GEOM_Object, containing the created wire.
2637 # @ref tui_3dsketcher_page "Example"
2638 @ManageTransactions("CurvesOp")
2639 def Make3DSketcher(self, theCoordinates, theName=None):
2641 Create a sketcher wire, following the numerical description,
2642 passed through theCoordinates argument.
2645 theCoordinates double values, defining points to create a wire,
2647 theName Object name; when specified, this parameter is used
2648 for result publication in the study. Otherwise, if automatic
2649 publication is switched on, default value is used for result name.
2652 New GEOM_Object, containing the created wire.
2654 theCoordinates,Parameters = ParseParameters(theCoordinates)
2655 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2656 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2657 anObj.SetParameters(Parameters)
2658 self._autoPublish(anObj, theName, "wire")
2661 ## Obtain a 3D sketcher interface
2662 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2664 # @ref tui_3dsketcher_page "Example"
2665 def Sketcher3D (self):
2667 Obtain a 3D sketcher interface.
2670 sk = geompy.Sketcher3D()
2671 sk.addPointsAbsolute(0,0,0, 70,0,0)
2672 sk.addPointsRelative(0, 0, 130)
2673 sk.addPointAnglesLength("OXY", 50, 0, 100)
2674 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2676 a3D_Sketcher_1 = sk.wire()
2678 sk = Sketcher3D (self)
2681 ## Obtain a 2D polyline creation interface
2682 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2684 # @ref tui_3dsketcher_page "Example"
2685 def Polyline2D (self):
2687 Obtain a 2D polyline creation interface.
2690 pl = geompy.Polyline2D()
2691 pl.addSection("section 1", GEOM.Polyline, True)
2692 pl.addPoints(0, 0, 10, 0, 10, 10)
2693 pl.addSection("section 2", GEOM.Interpolation, False)
2694 pl.addPoints(20, 0, 30, 0, 30, 10)
2695 resultObj = pl.result(WorkingPlane)
2697 pl = Polyline2D (self)
2700 # end of l3_sketcher
2703 ## @addtogroup l3_3d_primitives
2706 ## Create a box by coordinates of two opposite vertices.
2708 # @param x1,y1,z1 double values, defining first point it.
2709 # @param x2,y2,z2 double values, defining first point it.
2710 # @param theName Object name; when specified, this parameter is used
2711 # for result publication in the study. Otherwise, if automatic
2712 # publication is switched on, default value is used for result name.
2714 # @return New GEOM.GEOM_Object, containing the created box.
2716 # @ref tui_creation_box "Example"
2717 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2719 Create a box by coordinates of two opposite vertices.
2722 x1,y1,z1 double values, defining first point.
2723 x2,y2,z2 double values, defining second point.
2724 theName Object name; when specified, this parameter is used
2725 for result publication in the study. Otherwise, if automatic
2726 publication is switched on, default value is used for result name.
2729 New GEOM.GEOM_Object, containing the created box.
2731 # Example: see GEOM_TestAll.py
2732 pnt1 = self.MakeVertex(x1,y1,z1)
2733 pnt2 = self.MakeVertex(x2,y2,z2)
2734 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2735 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2737 ## Create a box with specified dimensions along the coordinate axes
2738 # and with edges, parallel to the coordinate axes.
2739 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2740 # @param theDX Length of Box edges, parallel to OX axis.
2741 # @param theDY Length of Box edges, parallel to OY axis.
2742 # @param theDZ Length of Box edges, parallel to OZ axis.
2743 # @param theName Object name; when specified, this parameter is used
2744 # for result publication in the study. Otherwise, if automatic
2745 # publication is switched on, default value is used for result name.
2747 # @return New GEOM.GEOM_Object, containing the created box.
2749 # @ref tui_creation_box "Example"
2750 @ManageTransactions("PrimOp")
2751 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2753 Create a box with specified dimensions along the coordinate axes
2754 and with edges, parallel to the coordinate axes.
2755 Center of the box will be at point (DX/2, DY/2, DZ/2).
2758 theDX Length of Box edges, parallel to OX axis.
2759 theDY Length of Box edges, parallel to OY axis.
2760 theDZ Length of Box edges, parallel to OZ axis.
2761 theName Object name; when specified, this parameter is used
2762 for result publication in the study. Otherwise, if automatic
2763 publication is switched on, default value is used for result name.
2766 New GEOM.GEOM_Object, containing the created box.
2768 # Example: see GEOM_TestAll.py
2769 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2770 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2771 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2772 anObj.SetParameters(Parameters)
2773 self._autoPublish(anObj, theName, "box")
2776 ## Create a box with two specified opposite vertices,
2777 # and with edges, parallel to the coordinate axes
2778 # @param thePnt1 First of two opposite vertices.
2779 # @param thePnt2 Second of two opposite vertices.
2780 # @param theName Object name; when specified, this parameter is used
2781 # for result publication in the study. Otherwise, if automatic
2782 # publication is switched on, default value is used for result name.
2784 # @return New GEOM.GEOM_Object, containing the created box.
2786 # @ref tui_creation_box "Example"
2787 @ManageTransactions("PrimOp")
2788 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2790 Create a box with two specified opposite vertices,
2791 and with edges, parallel to the coordinate axes
2794 thePnt1 First of two opposite vertices.
2795 thePnt2 Second of two opposite vertices.
2796 theName Object name; when specified, this parameter is used
2797 for result publication in the study. Otherwise, if automatic
2798 publication is switched on, default value is used for result name.
2801 New GEOM.GEOM_Object, containing the created box.
2803 # Example: see GEOM_TestAll.py
2804 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2805 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2806 self._autoPublish(anObj, theName, "box")
2809 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2810 # @param theH height of Face.
2811 # @param theW width of Face.
2812 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2813 # @param theName Object name; when specified, this parameter is used
2814 # for result publication in the study. Otherwise, if automatic
2815 # publication is switched on, default value is used for result name.
2817 # @return New GEOM.GEOM_Object, containing the created face.
2819 # @ref tui_creation_face "Example"
2820 @ManageTransactions("PrimOp")
2821 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2823 Create a face with specified dimensions with edges parallel to coordinate axes.
2826 theH height of Face.
2828 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2829 theName Object name; when specified, this parameter is used
2830 for result publication in the study. Otherwise, if automatic
2831 publication is switched on, default value is used for result name.
2834 New GEOM.GEOM_Object, containing the created face.
2836 # Example: see GEOM_TestAll.py
2837 theH,theW,Parameters = ParseParameters(theH, theW)
2838 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2839 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2840 anObj.SetParameters(Parameters)
2841 self._autoPublish(anObj, theName, "rectangle")
2844 ## Create a face from another plane and two sizes,
2845 # vertical size and horisontal size.
2846 # @param theObj Normale vector to the creating face or
2848 # @param theH Height (vertical size).
2849 # @param theW Width (horisontal size).
2850 # @param theName Object name; when specified, this parameter is used
2851 # for result publication in the study. Otherwise, if automatic
2852 # publication is switched on, default value is used for result name.
2854 # @return New GEOM.GEOM_Object, containing the created face.
2856 # @ref tui_creation_face "Example"
2857 @ManageTransactions("PrimOp")
2858 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2860 Create a face from another plane and two sizes,
2861 vertical size and horisontal size.
2864 theObj Normale vector to the creating face or
2866 theH Height (vertical size).
2867 theW Width (horisontal size).
2868 theName Object name; when specified, this parameter is used
2869 for result publication in the study. Otherwise, if automatic
2870 publication is switched on, default value is used for result name.
2873 New GEOM_Object, containing the created face.
2875 # Example: see GEOM_TestAll.py
2876 theH,theW,Parameters = ParseParameters(theH, theW)
2877 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2878 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2879 anObj.SetParameters(Parameters)
2880 self._autoPublish(anObj, theName, "rectangle")
2883 ## Create a disk with given center, normal vector and radius.
2884 # @param thePnt Disk center.
2885 # @param theVec Vector, normal to the plane of the disk.
2886 # @param theR Disk radius.
2887 # @param theName Object name; when specified, this parameter is used
2888 # for result publication in the study. Otherwise, if automatic
2889 # publication is switched on, default value is used for result name.
2891 # @return New GEOM.GEOM_Object, containing the created disk.
2893 # @ref tui_creation_disk "Example"
2894 @ManageTransactions("PrimOp")
2895 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2897 Create a disk with given center, normal vector and radius.
2901 theVec Vector, normal to the plane of the disk.
2903 theName Object name; when specified, this parameter is used
2904 for result publication in the study. Otherwise, if automatic
2905 publication is switched on, default value is used for result name.
2908 New GEOM.GEOM_Object, containing the created disk.
2910 # Example: see GEOM_TestAll.py
2911 theR,Parameters = ParseParameters(theR)
2912 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2913 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2914 anObj.SetParameters(Parameters)
2915 self._autoPublish(anObj, theName, "disk")
2918 ## Create a disk, passing through three given points
2919 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2920 # @param theName Object name; when specified, this parameter is used
2921 # for result publication in the study. Otherwise, if automatic
2922 # publication is switched on, default value is used for result name.
2924 # @return New GEOM.GEOM_Object, containing the created disk.
2926 # @ref tui_creation_disk "Example"
2927 @ManageTransactions("PrimOp")
2928 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2930 Create a disk, passing through three given points
2933 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2934 theName Object name; when specified, this parameter is used
2935 for result publication in the study. Otherwise, if automatic
2936 publication is switched on, default value is used for result name.
2939 New GEOM.GEOM_Object, containing the created disk.
2941 # Example: see GEOM_TestAll.py
2942 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2943 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2944 self._autoPublish(anObj, theName, "disk")
2947 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2948 # @param theR Radius of Face.
2949 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2950 # @param theName Object name; when specified, this parameter is used
2951 # for result publication in the study. Otherwise, if automatic
2952 # publication is switched on, default value is used for result name.
2954 # @return New GEOM.GEOM_Object, containing the created disk.
2956 # @ref tui_creation_face "Example"
2957 @ManageTransactions("PrimOp")
2958 def MakeDiskR(self, theR, theOrientation, theName=None):
2960 Create a disk with specified dimensions along OX-OY coordinate axes.
2963 theR Radius of Face.
2964 theOrientation set the orientation belong axis OXY or OYZ or OZX
2965 theName Object name; when specified, this parameter is used
2966 for result publication in the study. Otherwise, if automatic
2967 publication is switched on, default value is used for result name.
2970 New GEOM.GEOM_Object, containing the created disk.
2973 Disk3 = geompy.MakeDiskR(100., 1)
2975 # Example: see GEOM_TestAll.py
2976 theR,Parameters = ParseParameters(theR)
2977 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2978 RaiseIfFailed("MakeDiskR", self.PrimOp)
2979 anObj.SetParameters(Parameters)
2980 self._autoPublish(anObj, theName, "disk")
2983 ## Create a cylinder with given base point, axis, radius and height.
2984 # @param thePnt Central point of cylinder base.
2985 # @param theAxis Cylinder axis.
2986 # @param theR Cylinder radius.
2987 # @param theH Cylinder height.
2988 # @param theName Object name; when specified, this parameter is used
2989 # for result publication in the study. Otherwise, if automatic
2990 # publication is switched on, default value is used for result name.
2992 # @return New GEOM.GEOM_Object, containing the created cylinder.
2994 # @ref tui_creation_cylinder "Example"
2995 @ManageTransactions("PrimOp")
2996 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2998 Create a cylinder with given base point, axis, radius and height.
3001 thePnt Central point of cylinder base.
3002 theAxis Cylinder axis.
3003 theR Cylinder radius.
3004 theH Cylinder height.
3005 theName Object name; when specified, this parameter is used
3006 for result publication in the study. Otherwise, if automatic
3007 publication is switched on, default value is used for result name.
3010 New GEOM.GEOM_Object, containing the created cylinder.
3012 # Example: see GEOM_TestAll.py
3013 theR,theH,Parameters = ParseParameters(theR, theH)
3014 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3015 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3016 anObj.SetParameters(Parameters)
3017 self._autoPublish(anObj, theName, "cylinder")
3020 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3021 # @param thePnt Central point of cylinder base.
3022 # @param theAxis Cylinder axis.
3023 # @param theR Cylinder radius.
3024 # @param theH Cylinder height.
3025 # @param theA Cylinder angle in radians.
3026 # @param theName Object name; when specified, this parameter is used
3027 # for result publication in the study. Otherwise, if automatic
3028 # publication is switched on, default value is used for result name.
3030 # @return New GEOM.GEOM_Object, containing the created cylinder.
3032 # @ref tui_creation_cylinder "Example"
3033 @ManageTransactions("PrimOp")
3034 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3036 Create a portion of cylinder with given base point, axis, radius, height and angle.
3039 thePnt Central point of cylinder base.
3040 theAxis Cylinder axis.
3041 theR Cylinder radius.
3042 theH Cylinder height.
3043 theA Cylinder angle in radians.
3044 theName Object name; when specified, this parameter is used
3045 for result publication in the study. Otherwise, if automatic
3046 publication is switched on, default value is used for result name.
3049 New GEOM.GEOM_Object, containing the created cylinder.
3051 # Example: see GEOM_TestAll.py
3053 if isinstance(theA,str):
3055 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3057 theA = theA*math.pi/180.
3058 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3059 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3060 anObj.SetParameters(Parameters)
3061 self._autoPublish(anObj, theName, "cylinder")
3064 ## Create a cylinder with given radius and height at
3065 # the origin of coordinate system. Axis of the cylinder
3066 # will be collinear to the OZ axis of the coordinate system.
3067 # @param theR Cylinder radius.
3068 # @param theH Cylinder height.
3069 # @param theName Object name; when specified, this parameter is used
3070 # for result publication in the study. Otherwise, if automatic
3071 # publication is switched on, default value is used for result name.
3073 # @return New GEOM.GEOM_Object, containing the created cylinder.
3075 # @ref tui_creation_cylinder "Example"
3076 @ManageTransactions("PrimOp")
3077 def MakeCylinderRH(self, theR, theH, theName=None):
3079 Create a cylinder with given radius and height at
3080 the origin of coordinate system. Axis of the cylinder
3081 will be collinear to the OZ axis of the coordinate system.
3084 theR Cylinder radius.
3085 theH Cylinder height.
3086 theName Object name; when specified, this parameter is used
3087 for result publication in the study. Otherwise, if automatic
3088 publication is switched on, default value is used for result name.
3091 New GEOM.GEOM_Object, containing the created cylinder.
3093 # Example: see GEOM_TestAll.py
3094 theR,theH,Parameters = ParseParameters(theR, theH)
3095 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3096 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3097 anObj.SetParameters(Parameters)
3098 self._autoPublish(anObj, theName, "cylinder")
3101 ## Create a portion of cylinder with given radius, height and angle at
3102 # the origin of coordinate system. Axis of the cylinder
3103 # will be collinear to the OZ axis of the coordinate system.
3104 # @param theR Cylinder radius.
3105 # @param theH Cylinder height.
3106 # @param theA Cylinder angle in radians.
3107 # @param theName Object name; when specified, this parameter is used
3108 # for result publication in the study. Otherwise, if automatic
3109 # publication is switched on, default value is used for result name.
3111 # @return New GEOM.GEOM_Object, containing the created cylinder.
3113 # @ref tui_creation_cylinder "Example"
3114 @ManageTransactions("PrimOp")
3115 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3117 Create a portion of cylinder with given radius, height and angle at
3118 the origin of coordinate system. Axis of the cylinder
3119 will be collinear to the OZ axis of the coordinate system.
3122 theR Cylinder radius.
3123 theH Cylinder height.
3124 theA Cylinder angle in radians.
3125 theName Object name; when specified, this parameter is used
3126 for result publication in the study. Otherwise, if automatic
3127 publication is switched on, default value is used for result name.
3130 New GEOM.GEOM_Object, containing the created cylinder.
3132 # Example: see GEOM_TestAll.py
3134 if isinstance(theA,str):
3136 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3138 theA = theA*math.pi/180.
3139 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3140 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3141 anObj.SetParameters(Parameters)
3142 self._autoPublish(anObj, theName, "cylinder")
3145 ## Create a sphere with given center and radius.
3146 # @param thePnt Sphere center.
3147 # @param theR Sphere radius.
3148 # @param theName Object name; when specified, this parameter is used
3149 # for result publication in the study. Otherwise, if automatic
3150 # publication is switched on, default value is used for result name.
3152 # @return New GEOM.GEOM_Object, containing the created sphere.
3154 # @ref tui_creation_sphere "Example"
3155 @ManageTransactions("PrimOp")
3156 def MakeSpherePntR(self, thePnt, theR, theName=None):
3158 Create a sphere with given center and radius.
3161 thePnt Sphere center.
3163 theName Object name; when specified, this parameter is used
3164 for result publication in the study. Otherwise, if automatic
3165 publication is switched on, default value is used for result name.
3168 New GEOM.GEOM_Object, containing the created sphere.
3170 # Example: see GEOM_TestAll.py
3171 theR,Parameters = ParseParameters(theR)
3172 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3173 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3174 anObj.SetParameters(Parameters)
3175 self._autoPublish(anObj, theName, "sphere")
3178 ## Create a sphere with given center and radius.
3179 # @param x,y,z Coordinates of sphere center.
3180 # @param theR Sphere radius.
3181 # @param theName Object name; when specified, this parameter is used
3182 # for result publication in the study. Otherwise, if automatic
3183 # publication is switched on, default value is used for result name.
3185 # @return New GEOM.GEOM_Object, containing the created sphere.
3187 # @ref tui_creation_sphere "Example"
3188 def MakeSphere(self, x, y, z, theR, theName=None):
3190 Create a sphere with given center and radius.
3193 x,y,z Coordinates of sphere center.
3195 theName Object name; when specified, this parameter is used
3196 for result publication in the study. Otherwise, if automatic
3197 publication is switched on, default value is used for result name.
3200 New GEOM.GEOM_Object, containing the created sphere.
3202 # Example: see GEOM_TestAll.py
3203 point = self.MakeVertex(x, y, z)
3204 # note: auto-publishing is done in self.MakeSpherePntR()
3205 anObj = self.MakeSpherePntR(point, theR, theName)
3208 ## Create a sphere with given radius at the origin of coordinate system.
3209 # @param theR Sphere radius.
3210 # @param theName Object name; when specified, this parameter is used
3211 # for result publication in the study. Otherwise, if automatic
3212 # publication is switched on, default value is used for result name.
3214 # @return New GEOM.GEOM_Object, containing the created sphere.
3216 # @ref tui_creation_sphere "Example"
3217 @ManageTransactions("PrimOp")
3218 def MakeSphereR(self, theR, theName=None):
3220 Create a sphere with given radius at the origin of coordinate system.
3224 theName Object name; when specified, this parameter is used
3225 for result publication in the study. Otherwise, if automatic
3226 publication is switched on, default value is used for result name.
3229 New GEOM.GEOM_Object, containing the created sphere.
3231 # Example: see GEOM_TestAll.py
3232 theR,Parameters = ParseParameters(theR)
3233 anObj = self.PrimOp.MakeSphereR(theR)
3234 RaiseIfFailed("MakeSphereR", self.PrimOp)
3235 anObj.SetParameters(Parameters)
3236 self._autoPublish(anObj, theName, "sphere")
3239 ## Create a cone with given base point, axis, height and radiuses.
3240 # @param thePnt Central point of the first cone base.
3241 # @param theAxis Cone axis.
3242 # @param theR1 Radius of the first cone base.
3243 # @param theR2 Radius of the second cone base.
3244 # \note If both radiuses are non-zero, the cone will be truncated.
3245 # \note If the radiuses are equal, a cylinder will be created instead.
3246 # @param theH Cone height.
3247 # @param theName Object name; when specified, this parameter is used
3248 # for result publication in the study. Otherwise, if automatic
3249 # publication is switched on, default value is used for result name.
3251 # @return New GEOM.GEOM_Object, containing the created cone.
3253 # @ref tui_creation_cone "Example"
3254 @ManageTransactions("PrimOp")
3255 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3257 Create a cone with given base point, axis, height and radiuses.
3260 thePnt Central point of the first cone base.
3262 theR1 Radius of the first cone base.
3263 theR2 Radius of the second cone base.
3265 theName Object name; when specified, this parameter is used
3266 for result publication in the study. Otherwise, if automatic
3267 publication is switched on, default value is used for result name.
3270 If both radiuses are non-zero, the cone will be truncated.
3271 If the radiuses are equal, a cylinder will be created instead.
3274 New GEOM.GEOM_Object, containing the created cone.
3276 # Example: see GEOM_TestAll.py
3277 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3278 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3279 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3280 anObj.SetParameters(Parameters)
3281 self._autoPublish(anObj, theName, "cone")
3284 ## Create a cone with given height and radiuses at
3285 # the origin of coordinate system. Axis of the cone will
3286 # be collinear to the OZ axis of the coordinate system.
3287 # @param theR1 Radius of the first cone base.
3288 # @param theR2 Radius of the second cone base.
3289 # \note If both radiuses are non-zero, the cone will be truncated.
3290 # \note If the radiuses are equal, a cylinder will be created instead.
3291 # @param theH Cone height.
3292 # @param theName Object name; when specified, this parameter is used
3293 # for result publication in the study. Otherwise, if automatic
3294 # publication is switched on, default value is used for result name.
3296 # @return New GEOM.GEOM_Object, containing the created cone.
3298 # @ref tui_creation_cone "Example"
3299 @ManageTransactions("PrimOp")
3300 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3302 Create a cone with given height and radiuses at
3303 the origin of coordinate system. Axis of the cone will
3304 be collinear to the OZ axis of the coordinate system.
3307 theR1 Radius of the first cone base.
3308 theR2 Radius of the second cone base.
3310 theName Object name; when specified, this parameter is used
3311 for result publication in the study. Otherwise, if automatic
3312 publication is switched on, default value is used for result name.
3315 If both radiuses are non-zero, the cone will be truncated.
3316 If the radiuses are equal, a cylinder will be created instead.
3319 New GEOM.GEOM_Object, containing the created cone.
3321 # Example: see GEOM_TestAll.py
3322 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3323 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3324 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3325 anObj.SetParameters(Parameters)
3326 self._autoPublish(anObj, theName, "cone")
3329 ## Create a torus with given center, normal vector and radiuses.
3330 # @param thePnt Torus central point.
3331 # @param theVec Torus axis of symmetry.
3332 # @param theRMajor Torus major radius.
3333 # @param theRMinor Torus minor radius.
3334 # @param theName Object name; when specified, this parameter is used
3335 # for result publication in the study. Otherwise, if automatic
3336 # publication is switched on, default value is used for result name.
3338 # @return New GEOM.GEOM_Object, containing the created torus.
3340 # @ref tui_creation_torus "Example"
3341 @ManageTransactions("PrimOp")
3342 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3344 Create a torus with given center, normal vector and radiuses.
3347 thePnt Torus central point.
3348 theVec Torus axis of symmetry.
3349 theRMajor Torus major radius.
3350 theRMinor Torus minor radius.
3351 theName Object name; when specified, this parameter is used
3352 for result publication in the study. Otherwise, if automatic
3353 publication is switched on, default value is used for result name.
3356 New GEOM.GEOM_Object, containing the created torus.
3358 # Example: see GEOM_TestAll.py
3359 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3360 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3361 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3362 anObj.SetParameters(Parameters)
3363 self._autoPublish(anObj, theName, "torus")
3366 ## Create a torus with given radiuses at the origin of coordinate system.
3367 # @param theRMajor Torus major radius.
3368 # @param theRMinor Torus minor radius.
3369 # @param theName Object name; when specified, this parameter is used
3370 # for result publication in the study. Otherwise, if automatic
3371 # publication is switched on, default value is used for result name.
3373 # @return New GEOM.GEOM_Object, containing the created torus.
3375 # @ref tui_creation_torus "Example"
3376 @ManageTransactions("PrimOp")
3377 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3379 Create a torus with given radiuses at the origin of coordinate system.
3382 theRMajor Torus major radius.
3383 theRMinor Torus minor radius.
3384 theName Object name; when specified, this parameter is used
3385 for result publication in the study. Otherwise, if automatic
3386 publication is switched on, default value is used for result name.
3389 New GEOM.GEOM_Object, containing the created torus.
3391 # Example: see GEOM_TestAll.py
3392 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3393 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3394 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3395 anObj.SetParameters(Parameters)
3396 self._autoPublish(anObj, theName, "torus")
3399 # end of l3_3d_primitives
3402 ## @addtogroup l3_complex
3405 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3406 # @param theBase Base shape to be extruded.
3407 # @param thePoint1 First end of extrusion vector.
3408 # @param thePoint2 Second end of extrusion vector.
3409 # @param theScaleFactor Use it to make prism with scaled second base.
3410 # Nagative value means not scaled second base.
3411 # @param theName Object name; when specified, this parameter is used
3412 # for result publication in the study. Otherwise, if automatic
3413 # publication is switched on, default value is used for result name.
3415 # @return New GEOM.GEOM_Object, containing the created prism.
3417 # @ref tui_creation_prism "Example"
3418 @ManageTransactions("PrimOp")
3419 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3421 Create a shape by extrusion of the base shape along a vector, defined by two points.
3424 theBase Base shape to be extruded.
3425 thePoint1 First end of extrusion vector.
3426 thePoint2 Second end of extrusion vector.
3427 theScaleFactor Use it to make prism with scaled second base.
3428 Nagative value means not scaled second base.
3429 theName Object name; when specified, this parameter is used
3430 for result publication in the study. Otherwise, if automatic
3431 publication is switched on, default value is used for result name.
3434 New GEOM.GEOM_Object, containing the created prism.
3436 # Example: see GEOM_TestAll.py
3439 if theScaleFactor > 0:
3440 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3441 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3443 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3444 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3445 anObj.SetParameters(Parameters)
3446 self._autoPublish(anObj, theName, "prism")
3449 ## Create a shape by extrusion of the base shape along a
3450 # vector, defined by two points, in 2 Ways (forward/backward).
3451 # @param theBase Base shape to be extruded.
3452 # @param thePoint1 First end of extrusion vector.
3453 # @param thePoint2 Second end of extrusion vector.
3454 # @param theName Object name; when specified, this parameter is used
3455 # for result publication in the study. Otherwise, if automatic
3456 # publication is switched on, default value is used for result name.
3458 # @return New GEOM.GEOM_Object, containing the created prism.
3460 # @ref tui_creation_prism "Example"
3461 @ManageTransactions("PrimOp")
3462 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3464 Create a shape by extrusion of the base shape along a
3465 vector, defined by two points, in 2 Ways (forward/backward).
3468 theBase Base shape to be extruded.
3469 thePoint1 First end of extrusion vector.
3470 thePoint2 Second end of extrusion vector.
3471 theName Object name; when specified, this parameter is used
3472 for result publication in the study. Otherwise, if automatic
3473 publication is switched on, default value is used for result name.
3476 New GEOM.GEOM_Object, containing the created prism.
3478 # Example: see GEOM_TestAll.py
3479 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3480 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3481 self._autoPublish(anObj, theName, "prism")
3484 ## Create a shape by extrusion of the base shape along the vector,
3485 # i.e. all the space, transfixed by the base shape during its translation
3486 # along the vector on the given distance.
3487 # @param theBase Base shape to be extruded.
3488 # @param theVec Direction of extrusion.
3489 # @param theH Prism dimension along theVec.
3490 # @param theScaleFactor Use it to make prism with scaled second base.
3491 # Negative value means not scaled second base.
3492 # @param theName Object name; when specified, this parameter is used
3493 # for result publication in the study. Otherwise, if automatic
3494 # publication is switched on, default value is used for result name.
3496 # @return New GEOM.GEOM_Object, containing the created prism.
3498 # @ref tui_creation_prism "Example"
3499 @ManageTransactions("PrimOp")
3500 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3502 Create a shape by extrusion of the base shape along the vector,
3503 i.e. all the space, transfixed by the base shape during its translation
3504 along the vector on the given distance.
3507 theBase Base shape to be extruded.
3508 theVec Direction of extrusion.
3509 theH Prism dimension along theVec.
3510 theScaleFactor Use it to make prism with scaled second base.
3511 Negative value means not scaled second base.
3512 theName Object name; when specified, this parameter is used
3513 for result publication in the study. Otherwise, if automatic
3514 publication is switched on, default value is used for result name.
3517 New GEOM.GEOM_Object, containing the created prism.
3519 # Example: see GEOM_TestAll.py
3522 if theScaleFactor > 0:
3523 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3524 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3526 theH,Parameters = ParseParameters(theH)
3527 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3528 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3529 anObj.SetParameters(Parameters)
3530 self._autoPublish(anObj, theName, "prism")
3533 ## Create a shape by extrusion of the base shape along the vector,
3534 # i.e. all the space, transfixed by the base shape during its translation
3535 # along the vector on the given distance in 2 Ways (forward/backward).
3536 # @param theBase Base shape to be extruded.
3537 # @param theVec Direction of extrusion.
3538 # @param theH Prism dimension along theVec in forward direction.
3539 # @param theName Object name; when specified, this parameter is used
3540 # for result publication in the study. Otherwise, if automatic
3541 # publication is switched on, default value is used for result name.
3543 # @return New GEOM.GEOM_Object, containing the created prism.
3545 # @ref tui_creation_prism "Example"
3546 @ManageTransactions("PrimOp")
3547 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3549 Create a shape by extrusion of the base shape along the vector,
3550 i.e. all the space, transfixed by the base shape during its translation
3551 along the vector on the given distance in 2 Ways (forward/backward).
3554 theBase Base shape to be extruded.
3555 theVec Direction of extrusion.
3556 theH Prism dimension along theVec in forward direction.
3557 theName Object name; when specified, this parameter is used
3558 for result publication in the study. Otherwise, if automatic
3559 publication is switched on, default value is used for result name.
3562 New GEOM.GEOM_Object, containing the created prism.
3564 # Example: see GEOM_TestAll.py
3565 theH,Parameters = ParseParameters(theH)
3566 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3567 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3568 anObj.SetParameters(Parameters)
3569 self._autoPublish(anObj, theName, "prism")
3572 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3573 # @param theBase Base shape to be extruded.
3574 # @param theDX, theDY, theDZ Directions of extrusion.
3575 # @param theScaleFactor Use it to make prism with scaled second base.
3576 # Nagative value means not scaled second base.
3577 # @param theName Object name; when specified, this parameter is used
3578 # for result publication in the study. Otherwise, if automatic
3579 # publication is switched on, default value is used for result name.
3581 # @return New GEOM.GEOM_Object, containing the created prism.
3583 # @ref tui_creation_prism "Example"
3584 @ManageTransactions("PrimOp")
3585 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3587 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3590 theBase Base shape to be extruded.
3591 theDX, theDY, theDZ Directions of extrusion.
3592 theScaleFactor Use it to make prism with scaled second base.
3593 Nagative value means not scaled second base.
3594 theName Object name; when specified, this parameter is used
3595 for result publication in the study. Otherwise, if automatic
3596 publication is switched on, default value is used for result name.
3599 New GEOM.GEOM_Object, containing the created prism.
3601 # Example: see GEOM_TestAll.py
3604 if theScaleFactor > 0:
3605 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3606 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3608 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3609 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3610 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3611 anObj.SetParameters(Parameters)
3612 self._autoPublish(anObj, theName, "prism")
3615 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3616 # i.e. all the space, transfixed by the base shape during its translation
3617 # along the vector on the given distance in 2 Ways (forward/backward).
3618 # @param theBase Base shape to be extruded.
3619 # @param theDX, theDY, theDZ Directions of extrusion.
3620 # @param theName Object name; when specified, this parameter is used
3621 # for result publication in the study. Otherwise, if automatic
3622 # publication is switched on, default value is used for result name.
3624 # @return New GEOM.GEOM_Object, containing the created prism.
3626 # @ref tui_creation_prism "Example"
3627 @ManageTransactions("PrimOp")
3628 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3630 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3631 i.e. all the space, transfixed by the base shape during its translation
3632 along the vector on the given distance in 2 Ways (forward/backward).
3635 theBase Base shape to be extruded.
3636 theDX, theDY, theDZ Directions of extrusion.
3637 theName Object name; when specified, this parameter is used
3638 for result publication in the study. Otherwise, if automatic
3639 publication is switched on, default value is used for result name.
3642 New GEOM.GEOM_Object, containing the created prism.
3644 # Example: see GEOM_TestAll.py
3645 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3646 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3647 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3648 anObj.SetParameters(Parameters)
3649 self._autoPublish(anObj, theName, "prism")
3652 ## Create a shape by revolution of the base shape around the axis
3653 # on the given angle, i.e. all the space, transfixed by the base
3654 # shape during its rotation around the axis on the given angle.
3655 # @param theBase Base shape to be rotated.
3656 # @param theAxis Rotation axis.
3657 # @param theAngle Rotation angle in radians.
3658 # @param theName Object name; when specified, this parameter is used
3659 # for result publication in the study. Otherwise, if automatic
3660 # publication is switched on, default value is used for result name.
3662 # @return New GEOM.GEOM_Object, containing the created revolution.
3664 # @ref tui_creation_revolution "Example"
3665 @ManageTransactions("PrimOp")
3666 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3668 Create a shape by revolution of the base shape around the axis
3669 on the given angle, i.e. all the space, transfixed by the base
3670 shape during its rotation around the axis on the given angle.
3673 theBase Base shape to be rotated.
3674 theAxis Rotation axis.
3675 theAngle Rotation angle in radians.
3676 theName Object name; when specified, this parameter is used
3677 for result publication in the study. Otherwise, if automatic
3678 publication is switched on, default value is used for result name.
3681 New GEOM.GEOM_Object, containing the created revolution.
3683 # Example: see GEOM_TestAll.py
3684 theAngle,Parameters = ParseParameters(theAngle)
3685 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3686 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3687 anObj.SetParameters(Parameters)
3688 self._autoPublish(anObj, theName, "revolution")
3691 ## Create a shape by revolution of the base shape around the axis
3692 # on the given angle, i.e. all the space, transfixed by the base
3693 # shape during its rotation around the axis on the given angle in
3694 # both directions (forward/backward)
3695 # @param theBase Base shape to be rotated.
3696 # @param theAxis Rotation axis.
3697 # @param theAngle Rotation angle in radians.
3698 # @param theName Object name; when specified, this parameter is used
3699 # for result publication in the study. Otherwise, if automatic
3700 # publication is switched on, default value is used for result name.
3702 # @return New GEOM.GEOM_Object, containing the created revolution.
3704 # @ref tui_creation_revolution "Example"
3705 @ManageTransactions("PrimOp")
3706 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3708 Create a shape by revolution of the base shape around the axis
3709 on the given angle, i.e. all the space, transfixed by the base
3710 shape during its rotation around the axis on the given angle in
3711 both directions (forward/backward).
3714 theBase Base shape to be rotated.
3715 theAxis Rotation axis.
3716 theAngle Rotation angle in radians.
3717 theName Object name; when specified, this parameter is used
3718 for result publication in the study. Otherwise, if automatic
3719 publication is switched on, default value is used for result name.
3722 New GEOM.GEOM_Object, containing the created revolution.
3724 theAngle,Parameters = ParseParameters(theAngle)
3725 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3726 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3727 anObj.SetParameters(Parameters)
3728 self._autoPublish(anObj, theName, "revolution")
3731 ## Create a face from a given set of contours.
3732 # @param theContours either a list or a compound of edges/wires.
3733 # @param theMinDeg a minimal degree of BSpline surface to create.
3734 # @param theMaxDeg a maximal degree of BSpline surface to create.
3735 # @param theTol2D a 2d tolerance to be reached.
3736 # @param theTol3D a 3d tolerance to be reached.
3737 # @param theNbIter a number of iteration of approximation algorithm.
3738 # @param theMethod Kind of method to perform filling operation
3739 # (see GEOM.filling_oper_method enum).
3740 # @param isApprox if True, BSpline curves are generated in the process
3741 # of surface construction. By default it is False, that means
3742 # the surface is created using given curves. The usage of
3743 # Approximation makes the algorithm work slower, but allows
3744 # building the surface for rather complex cases.
3745 # @param theName Object name; when specified, this parameter is used
3746 # for result publication in the study. Otherwise, if automatic
3747 # publication is switched on, default value is used for result name.
3749 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3751 # @ref tui_creation_filling "Example"
3752 @ManageTransactions("PrimOp")
3753 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3754 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3756 Create a face from a given set of contours.
3759 theContours either a list or a compound of edges/wires.
3760 theMinDeg a minimal degree of BSpline surface to create.
3761 theMaxDeg a maximal degree of BSpline surface to create.
3762 theTol2D a 2d tolerance to be reached.
3763 theTol3D a 3d tolerance to be reached.
3764 theNbIter a number of iteration of approximation algorithm.
3765 theMethod Kind of method to perform filling operation
3766 (see GEOM.filling_oper_method enum).
3767 isApprox if True, BSpline curves are generated in the process
3768 of surface construction. By default it is False, that means
3769 the surface is created using given curves. The usage of
3770 Approximation makes the algorithm work slower, but allows
3771 building the surface for rather complex cases.
3772 theName Object name; when specified, this parameter is used
3773 for result publication in the study. Otherwise, if automatic
3774 publication is switched on, default value is used for result name.
3777 New GEOM.GEOM_Object (face), containing the created filling surface.
3780 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3782 # Example: see GEOM_TestAll.py
3783 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3784 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3785 theTol2D, theTol3D, theNbIter,
3786 theMethod, isApprox)
3787 RaiseIfFailed("MakeFilling", self.PrimOp)
3788 anObj.SetParameters(Parameters)
3789 self._autoPublish(anObj, theName, "filling")
3793 ## Create a face from a given set of contours.
3794 # This method corresponds to MakeFilling() with isApprox=True.
3795 # @param theContours either a list or a compound of edges/wires.
3796 # @param theMinDeg a minimal degree of BSpline surface to create.
3797 # @param theMaxDeg a maximal degree of BSpline surface to create.
3798 # @param theTol3D a 3d tolerance to be reached.
3799 # @param theName Object name; when specified, this parameter is used
3800 # for result publication in the study. Otherwise, if automatic
3801 # publication is switched on, default value is used for result name.
3803 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3805 # @ref tui_creation_filling "Example"
3806 @ManageTransactions("PrimOp")
3807 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3809 Create a filling from the given compound of contours.
3810 This method corresponds to MakeFilling() with isApprox=True.
3813 theContours either a list or a compound of edges/wires.
3814 theMinDeg a minimal degree of BSpline surface to create.
3815 theMaxDeg a maximal degree of BSpline surface to create.
3816 theTol3D a 3d tolerance to be reached.
3817 theName Object name; when specified, this parameter is used
3818 for result publication in the study. Otherwise, if automatic
3819 publication is switched on, default value is used for result name.
3822 New GEOM.GEOM_Object (face), containing the created filling surface.
3825 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3827 # Example: see GEOM_TestAll.py
3828 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3829 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3830 0, theTol3D, 0, GEOM.FOM_Default, True)
3831 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3832 anObj.SetParameters(Parameters)
3833 self._autoPublish(anObj, theName, "filling")
3836 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3837 # @param theSeqSections - set of specified sections.
3838 # @param theModeSolid - mode defining building solid or shell
3839 # @param thePreci - precision 3D used for smoothing
3840 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3841 # @param theName Object name; when specified, this parameter is used
3842 # for result publication in the study. Otherwise, if automatic
3843 # publication is switched on, default value is used for result name.
3845 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3847 # @ref swig_todo "Example"
3848 @ManageTransactions("PrimOp")
3849 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3851 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3854 theSeqSections - set of specified sections.
3855 theModeSolid - mode defining building solid or shell
3856 thePreci - precision 3D used for smoothing
3857 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3858 theName Object name; when specified, this parameter is used
3859 for result publication in the study. Otherwise, if automatic
3860 publication is switched on, default value is used for result name.
3863 New GEOM.GEOM_Object, containing the created shell or solid.
3865 # Example: see GEOM_TestAll.py
3866 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3867 RaiseIfFailed("MakeThruSections", self.PrimOp)
3868 self._autoPublish(anObj, theName, "filling")
3871 ## Create a shape by extrusion of the base shape along
3872 # the path shape. The path shape can be a wire or an edge. It is
3873 # possible to generate groups along with the result by means of
3874 # setting the flag \a IsGenerateGroups.<BR>
3875 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3876 # set, an error is occured. If \a thePath is not closed edge/wire,
3877 # the following groups are returned:
3878 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3880 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3883 # "Down" and "Up" groups contain:
3884 # - Edges if \a theBase is edge or wire;
3885 # - Faces if \a theBase is face or shell.<BR>
3887 # "Side1" and "Side2" groups contain edges generated from the first
3888 # and last vertices of \a theBase. The first and last vertices are
3889 # determined taking into account edge/wire orientation.<BR>
3890 # "Other" group represents faces generated from the bounding edges of
3893 # @param theBase Base shape to be extruded.
3894 # @param thePath Path shape to extrude the base shape along it.
3895 # @param IsGenerateGroups flag that tells if it is necessary to
3896 # create groups. It is equal to False by default.
3897 # @param theName Object name; when specified, this parameter is used
3898 # for result publication in the study. Otherwise, if automatic
3899 # publication is switched on, default value is used for result name.
3901 # @return New GEOM.GEOM_Object, containing the created pipe if
3902 # \a IsGenerateGroups is not set. Otherwise it returns new
3903 # GEOM.ListOfGO. Its first element is the created pipe, the
3904 # remaining ones are created groups.
3906 # @ref tui_creation_pipe "Example"
3907 @ManageTransactions("PrimOp")
3908 def MakePipe(self, theBase, thePath,
3909 IsGenerateGroups=False, theName=None):
3911 Create a shape by extrusion of the base shape along
3912 the path shape. The path shape can be a wire or an edge. It is
3913 possible to generate groups along with the result by means of
3914 setting the flag IsGenerateGroups.
3915 If thePath is a closed edge or wire and IsGenerateGroups is
3916 set, an error is occured. If thePath is not closed edge/wire,
3917 the following groups are returned:
3918 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
3920 - If theBase is closed edge or wire, face or shell: "Down", "Up",
3922 "Down" and "Up" groups contain:
3923 - Edges if theBase is edge or wire;
3924 - Faces if theBase is face or shell.
3925 "Side1" and "Side2" groups contain edges generated from the first
3926 and last vertices of theBase. The first and last vertices are
3927 determined taking into account edge/wire orientation.
3928 "Other" group represents faces generated from the bounding edges of
3932 theBase Base shape to be extruded.
3933 thePath Path shape to extrude the base shape along it.
3934 IsGenerateGroups flag that tells if it is necessary to
3935 create groups. It is equal to False by default.
3936 theName Object name; when specified, this parameter is used
3937 for result publication in the study. Otherwise, if automatic
3938 publication is switched on, default value is used for result name.
3941 New GEOM.GEOM_Object, containing the created pipe if
3942 IsGenerateGroups is not set. Otherwise it returns new
3943 GEOM.ListOfGO. Its first element is the created pipe, the
3944 remaining ones are created groups.
3946 # Example: see GEOM_TestAll.py
3947 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
3948 RaiseIfFailed("MakePipe", self.PrimOp)
3950 if IsGenerateGroups:
3951 self._autoPublish(aList, theName, "pipe")
3954 self._autoPublish(aList[0], theName, "pipe")
3957 ## Create a shape by extrusion of the profile shape along
3958 # the path shape. The path shape can be a wire or an edge.
3959 # the several profiles can be specified in the several locations of path.
3960 # It is possible to generate groups along with the result by means of
3961 # setting the flag \a IsGenerateGroups. For detailed information on
3962 # groups that can be created please see the method MakePipe().
3963 # @param theSeqBases - list of Bases shape to be extruded.
3964 # @param theLocations - list of locations on the path corresponding
3965 # specified list of the Bases shapes. Number of locations
3966 # should be equal to number of bases or list of locations can be empty.
3967 # @param thePath - Path shape to extrude the base shape along it.
3968 # @param theWithContact - the mode defining that the section is translated to be in
3969 # contact with the spine.
3970 # @param theWithCorrection - defining that the section is rotated to be
3971 # orthogonal to the spine tangent in the correspondent point
3972 # @param IsGenerateGroups - flag that tells if it is necessary to
3973 # create groups. It is equal to False by default.
3974 # @param theName Object name; when specified, this parameter is used
3975 # for result publication in the study. Otherwise, if automatic
3976 # publication is switched on, default value is used for result name.
3978 # @return New GEOM.GEOM_Object, containing the created pipe if
3979 # \a IsGenerateGroups is not set. Otherwise it returns new
3980 # GEOM.ListOfGO. Its first element is the created pipe, the
3981 # remaining ones are created groups.
3983 # @ref tui_creation_pipe_with_diff_sec "Example"
3984 @ManageTransactions("PrimOp")
3985 def MakePipeWithDifferentSections(self, theSeqBases,
3986 theLocations, thePath,
3987 theWithContact, theWithCorrection,
3988 IsGenerateGroups=False, theName=None):
3990 Create a shape by extrusion of the profile shape along
3991 the path shape. The path shape can be a wire or an edge.
3992 the several profiles can be specified in the several locations of path.
3993 It is possible to generate groups along with the result by means of
3994 setting the flag IsGenerateGroups. For detailed information on
3995 groups that can be created please see the method geompy.MakePipe().
3998 theSeqBases - list of Bases shape to be extruded.
3999 theLocations - list of locations on the path corresponding
4000 specified list of the Bases shapes. Number of locations
4001 should be equal to number of bases or list of locations can be empty.
4002 thePath - Path shape to extrude the base shape along it.
4003 theWithContact - the mode defining that the section is translated to be in
4004 contact with the spine(0/1)
4005 theWithCorrection - defining that the section is rotated to be
4006 orthogonal to the spine tangent in the correspondent point (0/1)
4007 IsGenerateGroups - flag that tells if it is necessary to
4008 create groups. It is equal to False by default.
4009 theName Object name; when specified, this parameter is used
4010 for result publication in the study. Otherwise, if automatic
4011 publication is switched on, default value is used for result name.
4014 New GEOM.GEOM_Object, containing the created pipe if
4015 IsGenerateGroups is not set. Otherwise it returns new
4016 GEOM.ListOfGO. Its first element is the created pipe, the
4017 remaining ones are created groups.
4019 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4020 theLocations, thePath,
4021 theWithContact, theWithCorrection,
4023 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4025 if IsGenerateGroups:
4026 self._autoPublish(aList, theName, "pipe")
4029 self._autoPublish(aList[0], theName, "pipe")
4032 ## Create a shape by extrusion of the profile shape along
4033 # the path shape. The path shape can be a wire or an edge.
4034 # the several profiles can be specified in the several locations of path.
4035 # It is possible to generate groups along with the result by means of
4036 # setting the flag \a IsGenerateGroups. For detailed information on
4037 # groups that can be created please see the method MakePipe().
4038 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4039 # shell or face. If number of faces in neighbour sections
4040 # aren't coincided result solid between such sections will
4041 # be created using external boundaries of this shells.
4042 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4043 # This list is used for searching correspondences between
4044 # faces in the sections. Size of this list must be equal
4045 # to size of list of base shapes.
4046 # @param theLocations - list of locations on the path corresponding
4047 # specified list of the Bases shapes. Number of locations
4048 # should be equal to number of bases. First and last
4049 # locations must be coincided with first and last vertexes
4050 # of path correspondingly.
4051 # @param thePath - Path shape to extrude the base shape along it.
4052 # @param theWithContact - the mode defining that the section is translated to be in
4053 # contact with the spine.
4054 # @param theWithCorrection - defining that the section is rotated to be
4055 # orthogonal to the spine tangent in the correspondent point
4056 # @param IsGenerateGroups - flag that tells if it is necessary to
4057 # create groups. It is equal to False by default.
4058 # @param theName Object name; when specified, this parameter is used
4059 # for result publication in the study. Otherwise, if automatic
4060 # publication is switched on, default value is used for result name.
4062 # @return New GEOM.GEOM_Object, containing the created solids if
4063 # \a IsGenerateGroups is not set. Otherwise it returns new
4064 # GEOM.ListOfGO. Its first element is the created solids, the
4065 # remaining ones are created groups.
4067 # @ref tui_creation_pipe_with_shell_sec "Example"
4068 @ManageTransactions("PrimOp")
4069 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4070 theLocations, thePath,
4071 theWithContact, theWithCorrection,
4072 IsGenerateGroups=False, theName=None):
4074 Create a shape by extrusion of the profile shape along
4075 the path shape. The path shape can be a wire or an edge.
4076 the several profiles can be specified in the several locations of path.
4077 It is possible to generate groups along with the result by means of
4078 setting the flag IsGenerateGroups. For detailed information on
4079 groups that can be created please see the method geompy.MakePipe().
4082 theSeqBases - list of Bases shape to be extruded. Base shape must be
4083 shell or face. If number of faces in neighbour sections
4084 aren't coincided result solid between such sections will
4085 be created using external boundaries of this shells.
4086 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4087 This list is used for searching correspondences between
4088 faces in the sections. Size of this list must be equal
4089 to size of list of base shapes.
4090 theLocations - list of locations on the path corresponding
4091 specified list of the Bases shapes. Number of locations
4092 should be equal to number of bases. First and last
4093 locations must be coincided with first and last vertexes
4094 of path correspondingly.
4095 thePath - Path shape to extrude the base shape along it.
4096 theWithContact - the mode defining that the section is translated to be in
4097 contact with the spine (0/1)
4098 theWithCorrection - defining that the section is rotated to be
4099 orthogonal to the spine tangent in the correspondent point (0/1)
4100 IsGenerateGroups - flag that tells if it is necessary to
4101 create groups. It is equal to False by default.
4102 theName Object name; when specified, this parameter is used
4103 for result publication in the study. Otherwise, if automatic
4104 publication is switched on, default value is used for result name.
4107 New GEOM.GEOM_Object, containing the created solids if
4108 IsGenerateGroups is not set. Otherwise it returns new
4109 GEOM.ListOfGO. Its first element is the created solids, the
4110 remaining ones are created groups.
4112 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4113 theLocations, thePath,
4114 theWithContact, theWithCorrection,
4116 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4118 if IsGenerateGroups:
4119 self._autoPublish(aList, theName, "pipe")
4122 self._autoPublish(aList[0], theName, "pipe")
4125 ## Create a shape by extrusion of the profile shape along
4126 # the path shape. This function is used only for debug pipe
4127 # functionality - it is a version of function MakePipeWithShellSections()
4128 # which give a possibility to recieve information about
4129 # creating pipe between each pair of sections step by step.
4130 @ManageTransactions("PrimOp")
4131 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4132 theLocations, thePath,
4133 theWithContact, theWithCorrection,
4134 IsGenerateGroups=False, theName=None):
4136 Create a shape by extrusion of the profile shape along
4137 the path shape. This function is used only for debug pipe
4138 functionality - it is a version of previous function
4139 geompy.MakePipeWithShellSections() which give a possibility to
4140 recieve information about creating pipe between each pair of
4141 sections step by step.
4144 nbsect = len(theSeqBases)
4145 nbsubsect = len(theSeqSubBases)
4146 #print "nbsect = ",nbsect
4147 for i in range(1,nbsect):
4149 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4150 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4152 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4153 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4154 tmpLocations, thePath,
4155 theWithContact, theWithCorrection,
4157 if self.PrimOp.IsDone() == 0:
4158 print "Problems with pipe creation between ",i," and ",i+1," sections"
4159 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4162 print "Pipe between ",i," and ",i+1," sections is OK"
4163 res.append(aList[0])
4167 resc = self.MakeCompound(res)
4168 #resc = self.MakeSewing(res, 0.001)
4169 #print "resc: ",resc
4170 self._autoPublish(resc, theName, "pipe")
4173 ## Create solids between given sections.
4174 # It is possible to generate groups along with the result by means of
4175 # setting the flag \a IsGenerateGroups. For detailed information on
4176 # groups that can be created please see the method MakePipe().
4177 # @param theSeqBases - list of sections (shell or face).
4178 # @param theLocations - list of corresponding vertexes
4179 # @param IsGenerateGroups - flag that tells if it is necessary to
4180 # create groups. It is equal to False by default.
4181 # @param theName Object name; when specified, this parameter is used
4182 # for result publication in the study. Otherwise, if automatic
4183 # publication is switched on, default value is used for result name.
4185 # @return New GEOM.GEOM_Object, containing the created solids if
4186 # \a IsGenerateGroups is not set. Otherwise it returns new
4187 # GEOM.ListOfGO. Its first element is the created solids, the
4188 # remaining ones are created groups.
4190 # @ref tui_creation_pipe_without_path "Example"
4191 @ManageTransactions("PrimOp")
4192 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4193 IsGenerateGroups=False, theName=None):
4195 Create solids between given sections.
4196 It is possible to generate groups along with the result by means of
4197 setting the flag IsGenerateGroups. For detailed information on
4198 groups that can be created please see the method geompy.MakePipe().
4201 theSeqBases - list of sections (shell or face).
4202 theLocations - list of corresponding vertexes
4203 IsGenerateGroups - flag that tells if it is necessary to
4204 create groups. It is equal to False by default.
4205 theName Object name; when specified, this parameter is used
4206 for result publication in the study. Otherwise, if automatic
4207 publication is switched on, default value is used for result name.
4210 New GEOM.GEOM_Object, containing the created solids if
4211 IsGenerateGroups is not set. Otherwise it returns new
4212 GEOM.ListOfGO. Its first element is the created solids, the
4213 remaining ones are created groups.
4215 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4217 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4219 if IsGenerateGroups:
4220 self._autoPublish(aList, theName, "pipe")
4223 self._autoPublish(aList[0], theName, "pipe")
4226 ## Create a shape by extrusion of the base shape along
4227 # the path shape with constant bi-normal direction along the given vector.
4228 # The path shape can be a wire or an edge.
4229 # It is possible to generate groups along with the result by means of
4230 # setting the flag \a IsGenerateGroups. For detailed information on
4231 # groups that can be created please see the method MakePipe().
4232 # @param theBase Base shape to be extruded.
4233 # @param thePath Path shape to extrude the base shape along it.
4234 # @param theVec Vector defines a constant binormal direction to keep the
4235 # same angle beetween the direction and the sections
4236 # along the sweep surface.
4237 # @param IsGenerateGroups flag that tells if it is necessary to
4238 # create groups. It is equal to False by default.
4239 # @param theName Object name; when specified, this parameter is used
4240 # for result publication in the study. Otherwise, if automatic
4241 # publication is switched on, default value is used for result name.
4243 # @return New GEOM.GEOM_Object, containing the created pipe if
4244 # \a IsGenerateGroups is not set. Otherwise it returns new
4245 # GEOM.ListOfGO. Its first element is the created pipe, the
4246 # remaining ones are created groups.
4248 # @ref tui_creation_pipe "Example"
4249 @ManageTransactions("PrimOp")
4250 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4251 IsGenerateGroups=False, theName=None):
4253 Create a shape by extrusion of the base shape along
4254 the path shape with constant bi-normal direction along the given vector.
4255 The path shape can be a wire or an edge.
4256 It is possible to generate groups along with the result by means of
4257 setting the flag IsGenerateGroups. For detailed information on
4258 groups that can be created please see the method geompy.MakePipe().
4261 theBase Base shape to be extruded.
4262 thePath Path shape to extrude the base shape along it.
4263 theVec Vector defines a constant binormal direction to keep the
4264 same angle beetween the direction and the sections
4265 along the sweep surface.
4266 IsGenerateGroups flag that tells if it is necessary to
4267 create groups. It is equal to False by default.
4268 theName Object name; when specified, this parameter is used
4269 for result publication in the study. Otherwise, if automatic
4270 publication is switched on, default value is used for result name.
4273 New GEOM.GEOM_Object, containing the created pipe if
4274 IsGenerateGroups is not set. Otherwise it returns new
4275 GEOM.ListOfGO. Its first element is the created pipe, the
4276 remaining ones are created groups.
4278 # Example: see GEOM_TestAll.py
4279 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4280 theVec, IsGenerateGroups)
4281 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4283 if IsGenerateGroups:
4284 self._autoPublish(aList, theName, "pipe")
4287 self._autoPublish(aList[0], theName, "pipe")
4290 ## Makes a thick solid from a shape. If the input is a surface shape
4291 # (face or shell) the result is a thick solid. If an input shape is
4292 # a solid the result is a hollowed solid with removed faces.
4293 # @param theShape Face or Shell to get thick solid or solid to get
4295 # @param theThickness Thickness of the resulting solid
4296 # @param theFacesIDs the list of face IDs to be removed from the
4297 # result. It is ignored if \a theShape is a face or a shell.
4298 # It is empty by default.
4299 # @param theInside If true the thickness is applied towards inside
4300 # @param theName Object name; when specified, this parameter is used
4301 # for result publication in the study. Otherwise, if automatic
4302 # publication is switched on, default value is used for result name.
4304 # @return New GEOM.GEOM_Object, containing the created solid
4306 # @ref tui_creation_thickness "Example"
4307 @ManageTransactions("PrimOp")
4308 def MakeThickSolid(self, theShape, theThickness,
4309 theFacesIDs=[], theInside=False, theName=None):
4311 Make a thick solid from a shape. If the input is a surface shape
4312 (face or shell) the result is a thick solid. If an input shape is
4313 a solid the result is a hollowed solid with removed faces.
4316 theShape Face or Shell to get thick solid or solid to get
4318 theThickness Thickness of the resulting solid
4319 theFacesIDs the list of face IDs to be removed from the
4320 result. It is ignored if theShape is a face or a
4321 shell. It is empty by default.
4322 theInside If true the thickness is applied towards inside
4323 theName Object name; when specified, this parameter is used
4324 for result publication in the study. Otherwise, if automatic
4325 publication is switched on, default value is used for result name.
4328 New GEOM.GEOM_Object, containing the created solid
4330 # Example: see GEOM_TestAll.py
4331 theThickness,Parameters = ParseParameters(theThickness)
4332 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4333 theThickness, True, theInside)
4334 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4335 anObj.SetParameters(Parameters)
4336 self._autoPublish(anObj, theName, "thickSolid")
4340 ## Modifies a shape to make it a thick solid. If the input is a surface
4341 # shape (face or shell) the result is a thick solid. If an input shape
4342 # is a solid the result is a hollowed solid with removed faces.
4343 # @param theShape Face or Shell to get thick solid or solid to get
4345 # @param theThickness Thickness of the resulting solid
4346 # @param theFacesIDs the list of face IDs to be removed from the
4347 # result. It is ignored if \a theShape is a face or a shell.
4348 # It is empty by default.
4349 # @param theInside If true the thickness is applied towards inside
4351 # @return The modified shape
4353 # @ref tui_creation_thickness "Example"
4354 @ManageTransactions("PrimOp")
4355 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4357 Modifies a shape to make it a thick solid. If the input is a
4358 surface shape (face or shell) the result is a thick solid. If
4359 an input shape is a solid the result is a hollowed solid with
4363 theShape Face or Shell to get thick solid or solid to get
4365 theThickness Thickness of the resulting solid
4366 theFacesIDs the list of face IDs to be removed from the
4367 result. It is ignored if \a theShape is a face or
4368 a shell. It is empty by default.
4369 theInside If true the thickness is applied towards inside
4374 # Example: see GEOM_TestAll.py
4375 theThickness,Parameters = ParseParameters(theThickness)
4376 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4377 theThickness, False, theInside)
4378 RaiseIfFailed("Thicken", self.PrimOp)
4379 anObj.SetParameters(Parameters)
4382 ## Build a middle path of a pipe-like shape.
4383 # The path shape can be a wire or an edge.
4384 # @param theShape It can be closed or unclosed pipe-like shell
4385 # or a pipe-like solid.
4386 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4387 # should be wires or faces of theShape.
4388 # @param theName Object name; when specified, this parameter is used
4389 # for result publication in the study. Otherwise, if automatic
4390 # publication is switched on, default value is used for result name.
4392 # @note It is not assumed that exact or approximate copy of theShape
4393 # can be obtained by applying existing Pipe operation on the
4394 # resulting "Path" wire taking theBase1 as the base - it is not
4395 # always possible; though in some particular cases it might work
4396 # it is not guaranteed. Thus, RestorePath function should not be
4397 # considered as an exact reverse operation of the Pipe.
4399 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4400 # source pipe's "path".
4402 # @ref tui_creation_pipe_path "Example"
4403 @ManageTransactions("PrimOp")
4404 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4406 Build a middle path of a pipe-like shape.
4407 The path shape can be a wire or an edge.
4410 theShape It can be closed or unclosed pipe-like shell
4411 or a pipe-like solid.
4412 theBase1, theBase2 Two bases of the supposed pipe. This
4413 should be wires or faces of theShape.
4414 theName Object name; when specified, this parameter is used
4415 for result publication in the study. Otherwise, if automatic
4416 publication is switched on, default value is used for result name.
4419 New GEOM_Object, containing an edge or wire that represent
4422 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4423 RaiseIfFailed("RestorePath", self.PrimOp)
4424 self._autoPublish(anObj, theName, "path")
4427 ## Build a middle path of a pipe-like shape.
4428 # The path shape can be a wire or an edge.
4429 # @param theShape It can be closed or unclosed pipe-like shell
4430 # or a pipe-like solid.
4431 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4432 # should be lists of edges of theShape.
4433 # @param theName Object name; when specified, this parameter is used
4434 # for result publication in the study. Otherwise, if automatic
4435 # publication is switched on, default value is used for result name.
4437 # @note It is not assumed that exact or approximate copy of theShape
4438 # can be obtained by applying existing Pipe operation on the
4439 # resulting "Path" wire taking theBase1 as the base - it is not
4440 # always possible; though in some particular cases it might work
4441 # it is not guaranteed. Thus, RestorePath function should not be
4442 # considered as an exact reverse operation of the Pipe.
4444 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4445 # source pipe's "path".
4447 # @ref tui_creation_pipe_path "Example"
4448 @ManageTransactions("PrimOp")
4449 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4451 Build a middle path of a pipe-like shape.
4452 The path shape can be a wire or an edge.
4455 theShape It can be closed or unclosed pipe-like shell
4456 or a pipe-like solid.
4457 listEdges1, listEdges2 Two bases of the supposed pipe. This
4458 should be lists of edges of theShape.
4459 theName Object name; when specified, this parameter is used
4460 for result publication in the study. Otherwise, if automatic
4461 publication is switched on, default value is used for result name.
4464 New GEOM_Object, containing an edge or wire that represent
4467 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4468 RaiseIfFailed("RestorePath", self.PrimOp)
4469 self._autoPublish(anObj, theName, "path")
4475 ## @addtogroup l3_basic_go
4478 ## Create a linear edge with specified ends.
4479 # @param thePnt1 Point for the first end of edge.
4480 # @param thePnt2 Point for the second end of edge.
4481 # @param theName Object name; when specified, this parameter is used
4482 # for result publication in the study. Otherwise, if automatic
4483 # publication is switched on, default value is used for result name.
4485 # @return New GEOM.GEOM_Object, containing the created edge.
4487 # @ref tui_creation_edge "Example"
4488 @ManageTransactions("ShapesOp")
4489 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4491 Create a linear edge with specified ends.
4494 thePnt1 Point for the first end of edge.
4495 thePnt2 Point for the second end of edge.
4496 theName Object name; when specified, this parameter is used
4497 for result publication in the study. Otherwise, if automatic
4498 publication is switched on, default value is used for result name.
4501 New GEOM.GEOM_Object, containing the created edge.
4503 # Example: see GEOM_TestAll.py
4504 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4505 RaiseIfFailed("MakeEdge", self.ShapesOp)
4506 self._autoPublish(anObj, theName, "edge")
4509 ## Create a new edge, corresponding to the given length on the given curve.
4510 # @param theRefCurve The referenced curve (edge).
4511 # @param theLength Length on the referenced curve. It can be negative.
4512 # @param theStartPoint Any point can be selected for it, the new edge will begin
4513 # at the end of \a theRefCurve, close to the selected point.
4514 # If None, start from the first point of \a theRefCurve.
4515 # @param theName Object name; when specified, this parameter is used
4516 # for result publication in the study. Otherwise, if automatic
4517 # publication is switched on, default value is used for result name.
4519 # @return New GEOM.GEOM_Object, containing the created edge.
4521 # @ref tui_creation_edge "Example"
4522 @ManageTransactions("ShapesOp")
4523 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4525 Create a new edge, corresponding to the given length on the given curve.
4528 theRefCurve The referenced curve (edge).
4529 theLength Length on the referenced curve. It can be negative.
4530 theStartPoint Any point can be selected for it, the new edge will begin
4531 at the end of theRefCurve, close to the selected point.
4532 If None, start from the first point of theRefCurve.
4533 theName Object name; when specified, this parameter is used
4534 for result publication in the study. Otherwise, if automatic
4535 publication is switched on, default value is used for result name.
4538 New GEOM.GEOM_Object, containing the created edge.
4540 # Example: see GEOM_TestAll.py
4541 theLength, Parameters = ParseParameters(theLength)
4542 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4543 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4544 anObj.SetParameters(Parameters)
4545 self._autoPublish(anObj, theName, "edge")
4548 ## Create an edge from specified wire.
4549 # @param theWire source Wire
4550 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4551 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4552 # @param theName Object name; when specified, this parameter is used
4553 # for result publication in the study. Otherwise, if automatic
4554 # publication is switched on, default value is used for result name.
4556 # @return New GEOM.GEOM_Object, containing the created edge.
4558 # @ref tui_creation_edge "Example"
4559 @ManageTransactions("ShapesOp")
4560 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4562 Create an edge from specified wire.
4566 theLinearTolerance linear tolerance value (default = 1e-07)
4567 theAngularTolerance angular tolerance value (default = 1e-12)
4568 theName Object name; when specified, this parameter is used
4569 for result publication in the study. Otherwise, if automatic
4570 publication is switched on, default value is used for result name.
4573 New GEOM.GEOM_Object, containing the created edge.
4575 # Example: see GEOM_TestAll.py
4576 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4577 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4578 self._autoPublish(anObj, theName, "edge")
4581 ## Create a wire from the set of edges and wires.
4582 # @param theEdgesAndWires List of edges and/or wires.
4583 # @param theTolerance Maximum distance between vertices, that will be merged.
4584 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4585 # @param theName Object name; when specified, this parameter is used
4586 # for result publication in the study. Otherwise, if automatic
4587 # publication is switched on, default value is used for result name.
4589 # @return New GEOM.GEOM_Object, containing the created wire.
4591 # @ref tui_creation_wire "Example"
4592 @ManageTransactions("ShapesOp")
4593 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4595 Create a wire from the set of edges and wires.
4598 theEdgesAndWires List of edges and/or wires.
4599 theTolerance Maximum distance between vertices, that will be merged.
4600 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4601 theName Object name; when specified, this parameter is used
4602 for result publication in the study. Otherwise, if automatic
4603 publication is switched on, default value is used for result name.
4606 New GEOM.GEOM_Object, containing the created wire.
4608 # Example: see GEOM_TestAll.py
4609 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4610 RaiseIfFailed("MakeWire", self.ShapesOp)
4611 self._autoPublish(anObj, theName, "wire")
4614 ## Create a face on the given wire.
4615 # @param theWire closed Wire or Edge to build the face on.
4616 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4617 # If the tolerance of the obtained planar face is less
4618 # than 1e-06, this face will be returned, otherwise the
4619 # algorithm tries to build any suitable face on the given
4620 # wire and prints a warning message.
4621 # @param theName Object name; when specified, this parameter is used
4622 # for result publication in the study. Otherwise, if automatic
4623 # publication is switched on, default value is used for result name.
4625 # @return New GEOM.GEOM_Object, containing the created face.
4627 # @ref tui_creation_face "Example"
4628 @ManageTransactions("ShapesOp")
4629 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4631 Create a face on the given wire.
4634 theWire closed Wire or Edge to build the face on.
4635 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4636 If the tolerance of the obtained planar face is less
4637 than 1e-06, this face will be returned, otherwise the
4638 algorithm tries to build any suitable face on the given
4639 wire and prints a warning message.
4640 theName Object name; when specified, this parameter is used
4641 for result publication in the study. Otherwise, if automatic
4642 publication is switched on, default value is used for result name.
4645 New GEOM.GEOM_Object, containing the created face.
4647 # Example: see GEOM_TestAll.py
4648 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4649 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4650 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4652 RaiseIfFailed("MakeFace", self.ShapesOp)
4653 self._autoPublish(anObj, theName, "face")
4656 ## Create a face on the given wires set.
4657 # @param theWires List of closed wires or edges to build the face on.
4658 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4659 # If the tolerance of the obtained planar face is less
4660 # than 1e-06, this face will be returned, otherwise the
4661 # algorithm tries to build any suitable face on the given
4662 # wire and prints a warning message.
4663 # @param theName Object name; when specified, this parameter is used
4664 # for result publication in the study. Otherwise, if automatic
4665 # publication is switched on, default value is used for result name.
4667 # @return New GEOM.GEOM_Object, containing the created face.
4669 # @ref tui_creation_face "Example"
4670 @ManageTransactions("ShapesOp")
4671 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4673 Create a face on the given wires set.
4676 theWires List of closed wires or edges to build the face on.
4677 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4678 If the tolerance of the obtained planar face is less
4679 than 1e-06, this face will be returned, otherwise the
4680 algorithm tries to build any suitable face on the given
4681 wire and prints a warning message.
4682 theName Object name; when specified, this parameter is used
4683 for result publication in the study. Otherwise, if automatic
4684 publication is switched on, default value is used for result name.
4687 New GEOM.GEOM_Object, containing the created face.
4689 # Example: see GEOM_TestAll.py
4690 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4691 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4692 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4694 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4695 self._autoPublish(anObj, theName, "face")
4698 ## See MakeFaceWires() method for details.
4700 # @ref tui_creation_face "Example 1"
4701 # \n @ref swig_MakeFaces "Example 2"
4702 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4704 See geompy.MakeFaceWires() method for details.
4706 # Example: see GEOM_TestOthers.py
4707 # note: auto-publishing is done in self.MakeFaceWires()
4708 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4711 ## Create a face based on a surface from given face bounded
4713 # @param theFace the face whose surface is used to create a new face.
4714 # @param theWire the wire that will bound a new face.
4715 # @param 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.
4719 # @return New GEOM.GEOM_Object, containing the created face.
4721 # @ref tui_creation_face "Example"
4722 @ManageTransactions("ShapesOp")
4723 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4725 Create a face based on a surface from given face bounded
4729 theFace the face whose surface is used to create a new face.
4730 theWire the wire that will bound a new face.
4731 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.
4736 New GEOM.GEOM_Object, containing the created face.
4738 # Example: see GEOM_TestAll.py
4739 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4740 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4741 self._autoPublish(anObj, theName, "face")
4744 ## Create a face from a set of edges with the given constraints.
4745 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4746 # - edges should form a closed wire;
4747 # - for each edge, constraint face is optional: if a constraint face is missing
4748 # for some edge, this means that there no constraint associated with this edge.
4749 # @param theName Object name; when specified, this parameter is used
4750 # for result publication in the study. Otherwise, if automatic
4751 # publication is switched on, default value is used for result name.
4753 # @return New GEOM.GEOM_Object, containing the created face.
4755 # @ref tui_creation_face "Example"
4756 @ManageTransactions("ShapesOp")
4757 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4759 Create a face from a set of edges with the given constraints.
4762 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4763 - edges should form a closed wire;
4764 - for each edge, constraint face is optional: if a constraint face is missing
4765 for some edge, this means that there no constraint associated with this edge.
4766 theName Object name; when specified, this parameter is used
4767 for result publication in the study. Otherwise, if automatic
4768 publication is switched on, default value is used for result name.
4771 New GEOM.GEOM_Object, containing the created face.
4773 # Example: see GEOM_TestAll.py
4774 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4776 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4777 self._autoPublish(anObj, theName, "face")
4780 ## Create a shell from the set of faces and shells.
4781 # @param theFacesAndShells List of faces and/or shells.
4782 # @param theName Object name; when specified, this parameter is used
4783 # for result publication in the study. Otherwise, if automatic
4784 # publication is switched on, default value is used for result name.
4786 # @return New GEOM.GEOM_Object, containing the created shell.
4788 # @ref tui_creation_shell "Example"
4789 @ManageTransactions("ShapesOp")
4790 def MakeShell(self, theFacesAndShells, theName=None):
4792 Create a shell from the set of faces and shells.
4795 theFacesAndShells List of faces and/or shells.
4796 theName Object name; when specified, this parameter is used
4797 for result publication in the study. Otherwise, if automatic
4798 publication is switched on, default value is used for result name.
4801 New GEOM.GEOM_Object, containing the created shell.
4803 # Example: see GEOM_TestAll.py
4804 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4805 RaiseIfFailed("MakeShell", self.ShapesOp)
4806 self._autoPublish(anObj, theName, "shell")
4809 ## Create a solid, bounded by the given shells.
4810 # @param theShells Sequence of bounding shells.
4811 # @param theName Object name; when specified, this parameter is used
4812 # for result publication in the study. Otherwise, if automatic
4813 # publication is switched on, default value is used for result name.
4815 # @return New GEOM.GEOM_Object, containing the created solid.
4817 # @ref tui_creation_solid "Example"
4818 @ManageTransactions("ShapesOp")
4819 def MakeSolid(self, theShells, theName=None):
4821 Create a solid, bounded by the given shells.
4824 theShells Sequence of bounding shells.
4825 theName Object name; when specified, this parameter is used
4826 for result publication in the study. Otherwise, if automatic
4827 publication is switched on, default value is used for result name.
4830 New GEOM.GEOM_Object, containing the created solid.
4832 # Example: see GEOM_TestAll.py
4833 theShells = ToList(theShells)
4834 if len(theShells) == 1:
4835 descr = self._IsGoodForSolid(theShells[0])
4837 # raise RuntimeError, "MakeSolidShells : " + descr
4838 if descr == "WRN_SHAPE_UNCLOSED":
4839 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4840 anObj = self.ShapesOp.MakeSolidShells(theShells)
4841 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4842 self._autoPublish(anObj, theName, "solid")
4845 ## Create a compound of the given shapes.
4846 # @param theShapes List of shapes to put in compound.
4847 # @param theName Object name; when specified, this parameter is used
4848 # for result publication in the study. Otherwise, if automatic
4849 # publication is switched on, default value is used for result name.
4851 # @return New GEOM.GEOM_Object, containing the created compound.
4853 # @ref tui_creation_compound "Example"
4854 @ManageTransactions("ShapesOp")
4855 def MakeCompound(self, theShapes, theName=None):
4857 Create a compound of the given shapes.
4860 theShapes List of shapes to put in compound.
4861 theName Object name; when specified, this parameter is used
4862 for result publication in the study. Otherwise, if automatic
4863 publication is switched on, default value is used for result name.
4866 New GEOM.GEOM_Object, containing the created compound.
4868 # Example: see GEOM_TestAll.py
4869 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4870 RaiseIfFailed("MakeCompound", self.ShapesOp)
4871 self._autoPublish(anObj, theName, "compound")
4874 ## Create a solid (or solids) from the set of faces and/or shells.
4875 # @param theFacesOrShells List of faces and/or shells.
4876 # @param isIntersect If TRUE, forces performing intersections
4877 # between arguments; otherwise (default) intersection is not performed.
4878 # @param theName Object name; when specified, this parameter is used
4879 # for result publication in the study. Otherwise, if automatic
4880 # publication is switched on, default value is used for result name.
4882 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4884 # @ref tui_creation_solid_from_faces "Example"
4885 @ManageTransactions("ShapesOp")
4886 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
4888 Create a solid (or solids) from the set of connected faces and/or shells.
4891 theFacesOrShells List of faces and/or shells.
4892 isIntersect If TRUE, forces performing intersections
4893 between arguments; otherwise (default) intersection is not performed
4894 theName Object name; when specified, this parameter is used.
4895 for result publication in the study. Otherwise, if automatic
4896 publication is switched on, default value is used for result name.
4899 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4901 # Example: see GEOM_TestAll.py
4902 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
4903 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
4904 self._autoPublish(anObj, theName, "solid")
4907 # end of l3_basic_go
4910 ## @addtogroup l2_measure
4913 ## Gives quantity of faces in the given shape.
4914 # @param theShape Shape to count faces of.
4915 # @return Quantity of faces.
4917 # @ref swig_NumberOf "Example"
4918 @ManageTransactions("ShapesOp")
4919 def NumberOfFaces(self, theShape):
4921 Gives quantity of faces in the given shape.
4924 theShape Shape to count faces of.
4929 # Example: see GEOM_TestOthers.py
4930 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4931 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4934 ## Gives quantity of edges in the given shape.
4935 # @param theShape Shape to count edges of.
4936 # @return Quantity of edges.
4938 # @ref swig_NumberOf "Example"
4939 @ManageTransactions("ShapesOp")
4940 def NumberOfEdges(self, theShape):
4942 Gives quantity of edges in the given shape.
4945 theShape Shape to count edges of.
4950 # Example: see GEOM_TestOthers.py
4951 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4952 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4955 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4956 # @param theShape Shape to count sub-shapes of.
4957 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4958 # @return Quantity of sub-shapes of given type.
4960 # @ref swig_NumberOf "Example"
4961 @ManageTransactions("ShapesOp")
4962 def NumberOfSubShapes(self, theShape, theShapeType):
4964 Gives quantity of sub-shapes of type theShapeType in the given shape.
4967 theShape Shape to count sub-shapes of.
4968 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4971 Quantity of sub-shapes of given type.
4973 # Example: see GEOM_TestOthers.py
4974 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4975 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4978 ## Gives quantity of solids in the given shape.
4979 # @param theShape Shape to count solids in.
4980 # @return Quantity of solids.
4982 # @ref swig_NumberOf "Example"
4983 @ManageTransactions("ShapesOp")
4984 def NumberOfSolids(self, theShape):
4986 Gives quantity of solids in the given shape.
4989 theShape Shape to count solids in.
4994 # Example: see GEOM_TestOthers.py
4995 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4996 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5002 ## @addtogroup l3_healing
5005 ## Reverses an orientation the given shape.
5006 # @param theShape Shape to be reversed.
5007 # @param theName Object name; when specified, this parameter is used
5008 # for result publication in the study. Otherwise, if automatic
5009 # publication is switched on, default value is used for result name.
5011 # @return The reversed copy of theShape.
5013 # @ref swig_ChangeOrientation "Example"
5014 @ManageTransactions("ShapesOp")
5015 def ChangeOrientation(self, theShape, theName=None):
5017 Reverses an orientation the given shape.
5020 theShape Shape to be reversed.
5021 theName Object name; when specified, this parameter is used
5022 for result publication in the study. Otherwise, if automatic
5023 publication is switched on, default value is used for result name.
5026 The reversed copy of theShape.
5028 # Example: see GEOM_TestAll.py
5029 anObj = self.ShapesOp.ChangeOrientation(theShape)
5030 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5031 self._autoPublish(anObj, theName, "reversed")
5034 ## See ChangeOrientation() method for details.
5036 # @ref swig_OrientationChange "Example"
5037 def OrientationChange(self, theShape, theName=None):
5039 See geompy.ChangeOrientation method for details.
5041 # Example: see GEOM_TestOthers.py
5042 # note: auto-publishing is done in self.ChangeOrientation()
5043 anObj = self.ChangeOrientation(theShape, theName)
5049 ## @addtogroup l4_obtain
5052 ## Retrieve all free faces from the given shape.
5053 # Free face is a face, which is not shared between two shells of the shape.
5054 # @param theShape Shape to find free faces in.
5055 # @return List of IDs of all free faces, contained in theShape.
5057 # @ref tui_free_faces_page "Example"
5058 @ManageTransactions("ShapesOp")
5059 def GetFreeFacesIDs(self,theShape):
5061 Retrieve all free faces from the given shape.
5062 Free face is a face, which is not shared between two shells of the shape.
5065 theShape Shape to find free faces in.
5068 List of IDs of all free faces, contained in theShape.
5070 # Example: see GEOM_TestOthers.py
5071 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5072 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5075 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5076 # @param theShape1 Shape to find sub-shapes in.
5077 # @param theShape2 Shape to find shared sub-shapes with.
5078 # @param theShapeType Type of sub-shapes to be retrieved.
5079 # @param theName Object name; when specified, this parameter is used
5080 # for result publication in the study. Otherwise, if automatic
5081 # publication is switched on, default value is used for result name.
5083 # @return List of sub-shapes of theShape1, shared with theShape2.
5085 # @ref swig_GetSharedShapes "Example"
5086 @ManageTransactions("ShapesOp")
5087 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5089 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5092 theShape1 Shape to find sub-shapes in.
5093 theShape2 Shape to find shared sub-shapes with.
5094 theShapeType Type of sub-shapes to be retrieved.
5095 theName Object name; when specified, this parameter is used
5096 for result publication in the study. Otherwise, if automatic
5097 publication is switched on, default value is used for result name.
5100 List of sub-shapes of theShape1, shared with theShape2.
5102 # Example: see GEOM_TestOthers.py
5103 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5104 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5105 self._autoPublish(aList, theName, "shared")
5108 ## Get sub-shapes, shared by input shapes.
5109 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5110 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5111 # @param theMultiShare Specifies what type of shares should be checked:
5112 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5113 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5114 # @param theName Object name; when specified, this parameter is used
5115 # for result publication in the study. Otherwise, if automatic
5116 # publication is switched on, default value is used for result name.
5118 # @note If @a theShapes contains single compound, the shares between all possible couples of
5119 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5120 # and all rest input shapes are returned.
5122 # @return List of all found sub-shapes.
5125 # - @ref tui_shared_shapes "Example 1"
5126 # - @ref swig_GetSharedShapes "Example 2"
5127 @ManageTransactions("ShapesOp")
5128 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5130 Get sub-shapes, shared by input shapes.
5133 theShapes Either a list or compound of shapes to find common sub-shapes of.
5134 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5135 theMultiShare Specifies what type of shares should be checked:
5136 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5137 - False: causes to search sub-shapes shared between couples of input shapes.
5138 theName Object name; when specified, this parameter is used
5139 for result publication in the study. Otherwise, if automatic
5140 publication is switched on, default value is used for result name.
5142 Note: if theShapes contains single compound, the shares between all possible couples of
5143 its top-level shapes are returned; otherwise, only shares between 1st input shape
5144 and all rest input shapes are returned.
5147 List of all found sub-shapes.
5149 # Example: see GEOM_TestOthers.py
5150 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5151 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5152 self._autoPublish(aList, theName, "shared")
5155 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5156 # situated relatively the specified plane by the certain way,
5157 # defined through <VAR>theState</VAR> parameter.
5158 # @param theShape Shape to find sub-shapes of.
5159 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5160 # @param theAx1 Vector (or line, or linear edge), specifying normal
5161 # direction and location of the plane to find shapes on.
5162 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5163 # @param theName Object name; when specified, this parameter is used
5164 # for result publication in the study. Otherwise, if automatic
5165 # publication is switched on, default value is used for result name.
5167 # @return List of all found sub-shapes.
5169 # @ref swig_GetShapesOnPlane "Example"
5170 @ManageTransactions("ShapesOp")
5171 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5173 Find in theShape all sub-shapes of type theShapeType,
5174 situated relatively the specified plane by the certain way,
5175 defined through theState parameter.
5178 theShape Shape to find sub-shapes of.
5179 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5180 theAx1 Vector (or line, or linear edge), specifying normal
5181 direction and location of the plane to find shapes on.
5182 theState The state of the sub-shapes to find (see GEOM::shape_state)
5183 theName Object name; when specified, this parameter is used
5184 for result publication in the study. Otherwise, if automatic
5185 publication is switched on, default value is used for result name.
5188 List of all found sub-shapes.
5190 # Example: see GEOM_TestOthers.py
5191 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5192 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5193 self._autoPublish(aList, theName, "shapeOnPlane")
5196 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5197 # situated relatively the specified plane by the certain way,
5198 # defined through <VAR>theState</VAR> parameter.
5199 # @param theShape Shape to find sub-shapes of.
5200 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5201 # @param theAx1 Vector (or line, or linear edge), specifying normal
5202 # direction and location of the plane to find shapes on.
5203 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5205 # @return List of all found sub-shapes indices.
5207 # @ref swig_GetShapesOnPlaneIDs "Example"
5208 @ManageTransactions("ShapesOp")
5209 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5211 Find in theShape all sub-shapes of type theShapeType,
5212 situated relatively the specified plane by the certain way,
5213 defined through theState parameter.
5216 theShape Shape to find sub-shapes of.
5217 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5218 theAx1 Vector (or line, or linear edge), specifying normal
5219 direction and location of the plane to find shapes on.
5220 theState The state of the sub-shapes to find (see GEOM::shape_state)
5223 List of all found sub-shapes indices.
5225 # Example: see GEOM_TestOthers.py
5226 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5227 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5230 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5231 # situated relatively the specified plane by the certain way,
5232 # defined through <VAR>theState</VAR> parameter.
5233 # @param theShape Shape to find sub-shapes of.
5234 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5235 # @param theAx1 Vector (or line, or linear edge), specifying normal
5236 # direction of the plane to find shapes on.
5237 # @param thePnt Point specifying location of the plane to find shapes on.
5238 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5239 # @param theName Object name; when specified, this parameter is used
5240 # for result publication in the study. Otherwise, if automatic
5241 # publication is switched on, default value is used for result name.
5243 # @return List of all found sub-shapes.
5245 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5246 @ManageTransactions("ShapesOp")
5247 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5249 Find in theShape all sub-shapes of type theShapeType,
5250 situated relatively the specified plane by the certain way,
5251 defined through theState parameter.
5254 theShape Shape to find sub-shapes of.
5255 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5256 theAx1 Vector (or line, or linear edge), specifying normal
5257 direction and location of the plane to find shapes on.
5258 thePnt Point specifying location of the plane to find shapes on.
5259 theState The state of the sub-shapes to find (see GEOM::shape_state)
5260 theName Object name; when specified, this parameter is used
5261 for result publication in the study. Otherwise, if automatic
5262 publication is switched on, default value is used for result name.
5265 List of all found sub-shapes.
5267 # Example: see GEOM_TestOthers.py
5268 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5269 theAx1, thePnt, theState)
5270 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5271 self._autoPublish(aList, theName, "shapeOnPlane")
5274 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5275 # situated relatively the specified plane by the certain way,
5276 # defined through <VAR>theState</VAR> parameter.
5277 # @param theShape Shape to find sub-shapes of.
5278 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5279 # @param theAx1 Vector (or line, or linear edge), specifying normal
5280 # direction of the plane to find shapes on.
5281 # @param thePnt Point specifying location of the plane to find shapes on.
5282 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5284 # @return List of all found sub-shapes indices.
5286 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5287 @ManageTransactions("ShapesOp")
5288 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5290 Find in theShape all sub-shapes of type theShapeType,
5291 situated relatively the specified plane by the certain way,
5292 defined through theState parameter.
5295 theShape Shape to find sub-shapes of.
5296 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5297 theAx1 Vector (or line, or linear edge), specifying normal
5298 direction and location of the plane to find shapes on.
5299 thePnt Point specifying location of the plane to find shapes on.
5300 theState The state of the sub-shapes to find (see GEOM::shape_state)
5303 List of all found sub-shapes indices.
5305 # Example: see GEOM_TestOthers.py
5306 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5307 theAx1, thePnt, theState)
5308 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5311 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5312 # the specified cylinder by the certain way, defined through \a theState parameter.
5313 # @param theShape Shape to find sub-shapes of.
5314 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5315 # @param theAxis Vector (or line, or linear edge), specifying
5316 # axis of the cylinder to find shapes on.
5317 # @param theRadius Radius of the cylinder to find shapes on.
5318 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5319 # @param 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.
5323 # @return List of all found sub-shapes.
5325 # @ref swig_GetShapesOnCylinder "Example"
5326 @ManageTransactions("ShapesOp")
5327 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5329 Find in theShape all sub-shapes of type theShapeType, situated relatively
5330 the specified cylinder by the certain way, defined through theState parameter.
5333 theShape Shape to find sub-shapes of.
5334 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5335 theAxis Vector (or line, or linear edge), specifying
5336 axis of the cylinder to find shapes on.
5337 theRadius Radius of the cylinder to find shapes on.
5338 theState The state of the sub-shapes to find (see GEOM::shape_state)
5339 theName Object name; when specified, this parameter is used
5340 for result publication in the study. Otherwise, if automatic
5341 publication is switched on, default value is used for result name.
5344 List of all found sub-shapes.
5346 # Example: see GEOM_TestOthers.py
5347 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5348 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5349 self._autoPublish(aList, theName, "shapeOnCylinder")
5352 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5353 # the specified cylinder by the certain way, defined through \a theState parameter.
5354 # @param theShape Shape to find sub-shapes of.
5355 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5356 # @param theAxis Vector (or line, or linear edge), specifying
5357 # axis of the cylinder to find shapes on.
5358 # @param theRadius Radius of the cylinder to find shapes on.
5359 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5361 # @return List of all found sub-shapes indices.
5363 # @ref swig_GetShapesOnCylinderIDs "Example"
5364 @ManageTransactions("ShapesOp")
5365 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5367 Find in theShape all sub-shapes of type theShapeType, situated relatively
5368 the specified cylinder by the certain way, defined through theState parameter.
5371 theShape Shape to find sub-shapes of.
5372 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5373 theAxis Vector (or line, or linear edge), specifying
5374 axis of the cylinder to find shapes on.
5375 theRadius Radius of the cylinder to find shapes on.
5376 theState The state of the sub-shapes to find (see GEOM::shape_state)
5379 List of all found sub-shapes indices.
5381 # Example: see GEOM_TestOthers.py
5382 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5383 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5386 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5387 # the specified cylinder by the certain way, defined through \a theState parameter.
5388 # @param theShape Shape to find sub-shapes of.
5389 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5390 # @param theAxis Vector (or line, or linear edge), specifying
5391 # axis of the cylinder to find shapes on.
5392 # @param thePnt Point specifying location of the bottom of the cylinder.
5393 # @param theRadius Radius of the cylinder to find shapes on.
5394 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5395 # @param theName Object name; when specified, this parameter is used
5396 # for result publication in the study. Otherwise, if automatic
5397 # publication is switched on, default value is used for result name.
5399 # @return List of all found sub-shapes.
5401 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5402 @ManageTransactions("ShapesOp")
5403 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5405 Find in theShape all sub-shapes of type theShapeType, situated relatively
5406 the specified cylinder by the certain way, defined through theState parameter.
5409 theShape Shape to find sub-shapes of.
5410 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5411 theAxis Vector (or line, or linear edge), specifying
5412 axis of the cylinder to find shapes on.
5413 theRadius Radius of the cylinder to find shapes on.
5414 theState The state of the sub-shapes to find (see GEOM::shape_state)
5415 theName Object name; when specified, this parameter is used
5416 for result publication in the study. Otherwise, if automatic
5417 publication is switched on, default value is used for result name.
5420 List of all found sub-shapes.
5422 # Example: see GEOM_TestOthers.py
5423 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5424 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5425 self._autoPublish(aList, theName, "shapeOnCylinder")
5428 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5429 # the specified cylinder by the certain way, defined through \a theState parameter.
5430 # @param theShape Shape to find sub-shapes of.
5431 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5432 # @param theAxis Vector (or line, or linear edge), specifying
5433 # axis of the cylinder to find shapes on.
5434 # @param thePnt Point specifying location of the bottom of the cylinder.
5435 # @param theRadius Radius of the cylinder to find shapes on.
5436 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5438 # @return List of all found sub-shapes indices
5440 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5441 @ManageTransactions("ShapesOp")
5442 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5444 Find in theShape all sub-shapes of type theShapeType, situated relatively
5445 the specified cylinder by the certain way, defined through theState parameter.
5448 theShape Shape to find sub-shapes of.
5449 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5450 theAxis Vector (or line, or linear edge), specifying
5451 axis of the cylinder to find shapes on.
5452 theRadius Radius of the cylinder to find shapes on.
5453 theState The state of the sub-shapes to find (see GEOM::shape_state)
5456 List of all found sub-shapes indices.
5458 # Example: see GEOM_TestOthers.py
5459 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5460 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5463 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5464 # the specified sphere by the certain way, defined through \a theState parameter.
5465 # @param theShape Shape to find sub-shapes of.
5466 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5467 # @param theCenter Point, specifying center of the sphere to find shapes on.
5468 # @param theRadius Radius of the sphere to find shapes on.
5469 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5470 # @param theName Object name; when specified, this parameter is used
5471 # for result publication in the study. Otherwise, if automatic
5472 # publication is switched on, default value is used for result name.
5474 # @return List of all found sub-shapes.
5476 # @ref swig_GetShapesOnSphere "Example"
5477 @ManageTransactions("ShapesOp")
5478 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5480 Find in theShape all sub-shapes of type theShapeType, situated relatively
5481 the specified sphere by the certain way, defined through theState parameter.
5484 theShape Shape to find sub-shapes of.
5485 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5486 theCenter Point, specifying center of the sphere to find shapes on.
5487 theRadius Radius of the sphere to find shapes on.
5488 theState The state of the sub-shapes to find (see GEOM::shape_state)
5489 theName Object name; when specified, this parameter is used
5490 for result publication in the study. Otherwise, if automatic
5491 publication is switched on, default value is used for result name.
5494 List of all found sub-shapes.
5496 # Example: see GEOM_TestOthers.py
5497 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5498 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5499 self._autoPublish(aList, theName, "shapeOnSphere")
5502 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5503 # the specified sphere by the certain way, defined through \a theState parameter.
5504 # @param theShape Shape to find sub-shapes of.
5505 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5506 # @param theCenter Point, specifying center of the sphere to find shapes on.
5507 # @param theRadius Radius of the sphere to find shapes on.
5508 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5510 # @return List of all found sub-shapes indices.
5512 # @ref swig_GetShapesOnSphereIDs "Example"
5513 @ManageTransactions("ShapesOp")
5514 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5516 Find in theShape all sub-shapes of type theShapeType, situated relatively
5517 the specified sphere by the certain way, defined through theState parameter.
5520 theShape Shape to find sub-shapes of.
5521 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5522 theCenter Point, specifying center of the sphere to find shapes on.
5523 theRadius Radius of the sphere to find shapes on.
5524 theState The state of the sub-shapes to find (see GEOM::shape_state)
5527 List of all found sub-shapes indices.
5529 # Example: see GEOM_TestOthers.py
5530 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5531 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5534 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5535 # the specified quadrangle by the certain way, defined through \a theState parameter.
5536 # @param theShape Shape to find sub-shapes of.
5537 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5538 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5539 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5540 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5541 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5542 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5543 # @param theName Object name; when specified, this parameter is used
5544 # for result publication in the study. Otherwise, if automatic
5545 # publication is switched on, default value is used for result name.
5547 # @return List of all found sub-shapes.
5549 # @ref swig_GetShapesOnQuadrangle "Example"
5550 @ManageTransactions("ShapesOp")
5551 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5552 theTopLeftPoint, theTopRigthPoint,
5553 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5555 Find in theShape all sub-shapes of type theShapeType, situated relatively
5556 the specified quadrangle by the certain way, defined through theState parameter.
5559 theShape Shape to find sub-shapes of.
5560 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5561 theTopLeftPoint Point, specifying top left corner of a quadrangle
5562 theTopRigthPoint Point, specifying top right corner of a quadrangle
5563 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5564 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5565 theState The state of the sub-shapes to find (see GEOM::shape_state)
5566 theName Object name; when specified, this parameter is used
5567 for result publication in the study. Otherwise, if automatic
5568 publication is switched on, default value is used for result name.
5571 List of all found sub-shapes.
5573 # Example: see GEOM_TestOthers.py
5574 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5575 theTopLeftPoint, theTopRigthPoint,
5576 theBottomLeftPoint, theBottomRigthPoint, theState)
5577 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5578 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5581 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5582 # the specified quadrangle by the certain way, defined through \a theState parameter.
5583 # @param theShape Shape to find sub-shapes of.
5584 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5585 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5586 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5587 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5588 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5589 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5591 # @return List of all found sub-shapes indices.
5593 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5594 @ManageTransactions("ShapesOp")
5595 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5596 theTopLeftPoint, theTopRigthPoint,
5597 theBottomLeftPoint, theBottomRigthPoint, theState):
5599 Find in theShape all sub-shapes of type theShapeType, situated relatively
5600 the specified quadrangle by the certain way, defined through theState parameter.
5603 theShape Shape to find sub-shapes of.
5604 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5605 theTopLeftPoint Point, specifying top left corner of a quadrangle
5606 theTopRigthPoint Point, specifying top right corner of a quadrangle
5607 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5608 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5609 theState The state of the sub-shapes to find (see GEOM::shape_state)
5612 List of all found sub-shapes indices.
5615 # Example: see GEOM_TestOthers.py
5616 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5617 theTopLeftPoint, theTopRigthPoint,
5618 theBottomLeftPoint, theBottomRigthPoint, theState)
5619 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5622 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5623 # the specified \a theBox by the certain way, defined through \a theState parameter.
5624 # @param theBox Shape for relative comparing.
5625 # @param theShape Shape to find sub-shapes of.
5626 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5627 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5628 # @param theName Object name; when specified, this parameter is used
5629 # for result publication in the study. Otherwise, if automatic
5630 # publication is switched on, default value is used for result name.
5632 # @return List of all found sub-shapes.
5634 # @ref swig_GetShapesOnBox "Example"
5635 @ManageTransactions("ShapesOp")
5636 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5638 Find in theShape all sub-shapes of type theShapeType, situated relatively
5639 the specified theBox by the certain way, defined through theState parameter.
5642 theBox Shape for relative comparing.
5643 theShape Shape to find sub-shapes of.
5644 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5645 theState The state of the sub-shapes to find (see GEOM::shape_state)
5646 theName Object name; when specified, this parameter is used
5647 for result publication in the study. Otherwise, if automatic
5648 publication is switched on, default value is used for result name.
5651 List of all found sub-shapes.
5653 # Example: see GEOM_TestOthers.py
5654 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5655 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5656 self._autoPublish(aList, theName, "shapeOnBox")
5659 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5660 # the specified \a theBox by the certain way, defined through \a theState parameter.
5661 # @param theBox Shape for relative comparing.
5662 # @param theShape Shape to find sub-shapes of.
5663 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5664 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5666 # @return List of all found sub-shapes indices.
5668 # @ref swig_GetShapesOnBoxIDs "Example"
5669 @ManageTransactions("ShapesOp")
5670 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5672 Find in theShape all sub-shapes of type theShapeType, situated relatively
5673 the specified theBox by the certain way, defined through theState parameter.
5676 theBox Shape for relative comparing.
5677 theShape Shape to find sub-shapes of.
5678 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5679 theState The state of the sub-shapes to find (see GEOM::shape_state)
5682 List of all found sub-shapes indices.
5684 # Example: see GEOM_TestOthers.py
5685 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5686 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5689 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5690 # situated relatively the specified \a theCheckShape by the
5691 # certain way, defined through \a theState parameter.
5692 # @param theCheckShape Shape for relative comparing. It must be a solid.
5693 # @param theShape Shape to find sub-shapes of.
5694 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5695 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5696 # @param theName Object name; when specified, this parameter is used
5697 # for result publication in the study. Otherwise, if automatic
5698 # publication is switched on, default value is used for result name.
5700 # @return List of all found sub-shapes.
5702 # @ref swig_GetShapesOnShape "Example"
5703 @ManageTransactions("ShapesOp")
5704 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5706 Find in theShape all sub-shapes of type theShapeType,
5707 situated relatively the specified theCheckShape by the
5708 certain way, defined through theState parameter.
5711 theCheckShape Shape for relative comparing. It must be a solid.
5712 theShape Shape to find sub-shapes of.
5713 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5714 theState The state of the sub-shapes to find (see GEOM::shape_state)
5715 theName Object name; when specified, this parameter is used
5716 for result publication in the study. Otherwise, if automatic
5717 publication is switched on, default value is used for result name.
5720 List of all found sub-shapes.
5722 # Example: see GEOM_TestOthers.py
5723 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5724 theShapeType, theState)
5725 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5726 self._autoPublish(aList, theName, "shapeOnShape")
5729 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5730 # situated relatively the specified \a theCheckShape by the
5731 # certain way, defined through \a theState parameter.
5732 # @param theCheckShape Shape for relative comparing. It must be a solid.
5733 # @param theShape Shape to find sub-shapes of.
5734 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5735 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5736 # @param theName Object name; when specified, this parameter is used
5737 # for result publication in the study. Otherwise, if automatic
5738 # publication is switched on, default value is used for result name.
5740 # @return All found sub-shapes as compound.
5742 # @ref swig_GetShapesOnShapeAsCompound "Example"
5743 @ManageTransactions("ShapesOp")
5744 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5746 Find in theShape all sub-shapes of type theShapeType,
5747 situated relatively the specified theCheckShape by the
5748 certain way, defined through theState parameter.
5751 theCheckShape Shape for relative comparing. It must be a solid.
5752 theShape Shape to find sub-shapes of.
5753 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5754 theState The state of the sub-shapes to find (see GEOM::shape_state)
5755 theName Object name; when specified, this parameter is used
5756 for result publication in the study. Otherwise, if automatic
5757 publication is switched on, default value is used for result name.
5760 All found sub-shapes as compound.
5762 # Example: see GEOM_TestOthers.py
5763 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5764 theShapeType, theState)
5765 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5766 self._autoPublish(anObj, theName, "shapeOnShape")
5769 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5770 # situated relatively the specified \a theCheckShape by the
5771 # certain way, defined through \a theState parameter.
5772 # @param theCheckShape Shape for relative comparing. It must be a solid.
5773 # @param theShape Shape to find sub-shapes of.
5774 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5775 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5777 # @return List of all found sub-shapes indices.
5779 # @ref swig_GetShapesOnShapeIDs "Example"
5780 @ManageTransactions("ShapesOp")
5781 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5783 Find in theShape all sub-shapes of type theShapeType,
5784 situated relatively the specified theCheckShape by the
5785 certain way, defined through theState parameter.
5788 theCheckShape Shape for relative comparing. It must be a solid.
5789 theShape Shape to find sub-shapes of.
5790 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5791 theState The state of the sub-shapes to find (see GEOM::shape_state)
5794 List of all found sub-shapes indices.
5796 # Example: see GEOM_TestOthers.py
5797 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5798 theShapeType, theState)
5799 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5802 ## Get sub-shape(s) of theShapeWhere, which are
5803 # coincident with \a theShapeWhat or could be a part of it.
5804 # @param theShapeWhere Shape to find sub-shapes of.
5805 # @param theShapeWhat Shape, specifying what to find.
5806 # @param isNewImplementation implementation of GetInPlace functionality
5807 # (default = False, old alghorithm based on shape properties)
5808 # @param theName Object name; when specified, this parameter is used
5809 # for result publication in the study. Otherwise, if automatic
5810 # publication is switched on, default value is used for result name.
5812 # @return Group of all found sub-shapes or a single found sub-shape.
5814 # @note This function has a restriction on argument shapes.
5815 # If \a theShapeWhere has curved parts with significantly
5816 # outstanding centres (i.e. the mass centre of a part is closer to
5817 # \a theShapeWhat than to the part), such parts will not be found.
5818 # @image html get_in_place_lost_part.png
5820 # @ref swig_GetInPlace "Example"
5821 @ManageTransactions("ShapesOp")
5822 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5824 Get sub-shape(s) of theShapeWhere, which are
5825 coincident with theShapeWhat or could be a part of it.
5828 theShapeWhere Shape to find sub-shapes of.
5829 theShapeWhat Shape, specifying what to find.
5830 isNewImplementation Implementation of GetInPlace functionality
5831 (default = False, old alghorithm based on shape properties)
5832 theName Object name; when specified, this parameter is used
5833 for result publication in the study. Otherwise, if automatic
5834 publication is switched on, default value is used for result name.
5837 Group of all found sub-shapes or a single found sub-shape.
5841 This function has a restriction on argument shapes.
5842 If theShapeWhere has curved parts with significantly
5843 outstanding centres (i.e. the mass centre of a part is closer to
5844 theShapeWhat than to the part), such parts will not be found.
5846 # Example: see GEOM_TestOthers.py
5848 if isNewImplementation:
5849 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5851 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5853 RaiseIfFailed("GetInPlace", self.ShapesOp)
5854 self._autoPublish(anObj, theName, "inplace")
5857 ## Get sub-shape(s) of \a theShapeWhere, which are
5858 # coincident with \a theShapeWhat or could be a part of it.
5860 # Implementation of this method is based on a saved history of an operation,
5861 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5862 # arguments (an argument shape or a sub-shape of an argument shape).
5863 # The operation could be the Partition or one of boolean operations,
5864 # performed on simple shapes (not on compounds).
5866 # @param theShapeWhere Shape to find sub-shapes of.
5867 # @param theShapeWhat Shape, specifying what to find (must be in the
5868 # building history of the ShapeWhere).
5869 # @param theName Object name; when specified, this parameter is used
5870 # for result publication in the study. Otherwise, if automatic
5871 # publication is switched on, default value is used for result name.
5873 # @return Group of all found sub-shapes or a single found sub-shape.
5875 # @ref swig_GetInPlace "Example"
5876 @ManageTransactions("ShapesOp")
5877 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5879 Implementation of this method is based on a saved history of an operation,
5880 produced theShapeWhere. The theShapeWhat must be among this operation's
5881 arguments (an argument shape or a sub-shape of an argument shape).
5882 The operation could be the Partition or one of boolean operations,
5883 performed on simple shapes (not on compounds).
5886 theShapeWhere Shape to find sub-shapes of.
5887 theShapeWhat Shape, specifying what to find (must be in the
5888 building history of the ShapeWhere).
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 Group of all found sub-shapes or a single found sub-shape.
5896 # Example: see GEOM_TestOthers.py
5897 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5898 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5899 self._autoPublish(anObj, theName, "inplace")
5902 ## Get sub-shape of theShapeWhere, which is
5903 # equal to \a theShapeWhat.
5904 # @param theShapeWhere Shape to find sub-shape of.
5905 # @param theShapeWhat Shape, specifying what to find.
5906 # @param theName Object name; when specified, this parameter is used
5907 # for result publication in the study. Otherwise, if automatic
5908 # publication is switched on, default value is used for result name.
5910 # @return New GEOM.GEOM_Object for found sub-shape.
5912 # @ref swig_GetSame "Example"
5913 @ManageTransactions("ShapesOp")
5914 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5916 Get sub-shape of theShapeWhere, which is
5917 equal to theShapeWhat.
5920 theShapeWhere Shape to find sub-shape of.
5921 theShapeWhat Shape, specifying what to find.
5922 theName Object name; when specified, this parameter is used
5923 for result publication in the study. Otherwise, if automatic
5924 publication is switched on, default value is used for result name.
5927 New GEOM.GEOM_Object for found sub-shape.
5929 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5930 RaiseIfFailed("GetSame", self.ShapesOp)
5931 self._autoPublish(anObj, theName, "sameShape")
5935 ## Get sub-shape indices of theShapeWhere, which is
5936 # equal to \a theShapeWhat.
5937 # @param theShapeWhere Shape to find sub-shape of.
5938 # @param theShapeWhat Shape, specifying what to find.
5939 # @return List of all found sub-shapes indices.
5941 # @ref swig_GetSame "Example"
5942 @ManageTransactions("ShapesOp")
5943 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5945 Get sub-shape indices of theShapeWhere, which is
5946 equal to theShapeWhat.
5949 theShapeWhere Shape to find sub-shape of.
5950 theShapeWhat Shape, specifying what to find.
5953 List of all found sub-shapes indices.
5955 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5956 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5959 ## Resize the input edge with the new Min and Max parameters.
5960 # The input edge parameters range is [0, 1]. If theMin parameter is
5961 # negative, the input edge is extended, otherwise it is shrinked by
5962 # theMin parameter. If theMax is greater than 1, the edge is extended,
5963 # otherwise it is shrinked by theMax parameter.
5964 # @param theEdge the input edge to be resized.
5965 # @param theMin the minimal parameter value.
5966 # @param theMax the maximal parameter value.
5967 # @param theName Object name; when specified, this parameter is used
5968 # for result publication in the study. Otherwise, if automatic
5969 # publication is switched on, default value is used for result name.
5970 # @return New GEOM.GEOM_Object, containing the created edge.
5972 # @ref tui_extend "Example"
5973 @ManageTransactions("ShapesOp")
5974 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
5976 Resize the input edge with the new Min and Max parameters.
5977 The input edge parameters range is [0, 1]. If theMin parameter is
5978 negative, the input edge is extended, otherwise it is shrinked by
5979 theMin parameter. If theMax is greater than 1, the edge is extended,
5980 otherwise it is shrinked by theMax parameter.
5983 theEdge the input edge to be resized.
5984 theMin the minimal parameter value.
5985 theMax the maximal parameter value.
5986 theName Object name; when specified, this parameter is used
5987 for result publication in the study. Otherwise, if automatic
5988 publication is switched on, default value is used for result name.
5991 New GEOM.GEOM_Object, containing the created edge.
5993 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
5994 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
5995 RaiseIfFailed("ExtendEdge", self.ShapesOp)
5996 anObj.SetParameters(Parameters)
5997 self._autoPublish(anObj, theName, "edge")
6000 ## Resize the input face with the new UMin, UMax, VMin and VMax
6001 # parameters. The input face U and V parameters range is [0, 1]. If
6002 # theUMin parameter is negative, the input face is extended, otherwise
6003 # it is shrinked along U direction by theUMin parameter. If theUMax is
6004 # greater than 1, the face is extended, otherwise it is shrinked along
6005 # U direction by theUMax parameter. So as for theVMin, theVMax and
6006 # V direction of the input face.
6007 # @param theFace the input face to be resized.
6008 # @param theUMin the minimal U parameter value.
6009 # @param theUMax the maximal U parameter value.
6010 # @param theVMin the minimal V parameter value.
6011 # @param theVMax the maximal V parameter value.
6012 # @param theName Object name; when specified, this parameter is used
6013 # for result publication in the study. Otherwise, if automatic
6014 # publication is switched on, default value is used for result name.
6015 # @return New GEOM.GEOM_Object, containing the created face.
6017 # @ref tui_extend "Example"
6018 @ManageTransactions("ShapesOp")
6019 def ExtendFace(self, theFace, theUMin, theUMax,
6020 theVMin, theVMax, theName=None):
6022 Resize the input face with the new UMin, UMax, VMin and VMax
6023 parameters. The input face U and V parameters range is [0, 1]. If
6024 theUMin parameter is negative, the input face is extended, otherwise
6025 it is shrinked along U direction by theUMin parameter. If theUMax is
6026 greater than 1, the face is extended, otherwise it is shrinked along
6027 U direction by theUMax parameter. So as for theVMin, theVMax and
6028 V direction of the input face.
6031 theFace the input face to be resized.
6032 theUMin the minimal U parameter value.
6033 theUMax the maximal U parameter value.
6034 theVMin the minimal V parameter value.
6035 theVMax the maximal V parameter value.
6036 theName Object name; when specified, this parameter is used
6037 for result publication in the study. Otherwise, if automatic
6038 publication is switched on, default value is used for result name.
6041 New GEOM.GEOM_Object, containing the created face.
6043 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6044 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6046 RaiseIfFailed("ExtendFace", self.ShapesOp)
6047 anObj.SetParameters(Parameters)
6048 self._autoPublish(anObj, theName, "face")
6051 ## This function takes some face as input parameter and creates new
6052 # GEOM_Object, i.e. topological shape by extracting underlying surface
6053 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6054 # parameters of the source face (in the parametrical space).
6055 # @param theFace the input face.
6056 # @param theName Object name; when specified, this parameter is used
6057 # for result publication in the study. Otherwise, if automatic
6058 # publication is switched on, default value is used for result name.
6059 # @return New GEOM.GEOM_Object, containing the created face.
6061 # @ref tui_creation_surface "Example"
6062 @ManageTransactions("ShapesOp")
6063 def MakeSurfaceFromFace(self, theFace, theName=None):
6065 This function takes some face as input parameter and creates new
6066 GEOM_Object, i.e. topological shape by extracting underlying surface
6067 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6068 parameters of the source face (in the parametrical space).
6071 theFace the input face.
6072 theName Object name; when specified, this parameter is used
6073 for result publication in the study. Otherwise, if automatic
6074 publication is switched on, default value is used for result name.
6077 New GEOM.GEOM_Object, containing the created face.
6079 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6080 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6081 self._autoPublish(anObj, theName, "surface")
6087 ## @addtogroup l4_access
6090 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6091 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6092 # @param aShape Shape to get sub-shape of.
6093 # @param ListOfID List of sub-shapes indices.
6094 # @param theName Object name; when specified, this parameter is used
6095 # for result publication in the study. Otherwise, if automatic
6096 # publication is switched on, default value is used for result name.
6098 # @return Found sub-shape.
6100 # @ref swig_all_decompose "Example"
6101 def GetSubShape(self, aShape, ListOfID, theName=None):
6103 Obtain a composite sub-shape of aShape, composed from sub-shapes
6104 of aShape, selected by their unique IDs inside aShape
6107 aShape Shape to get sub-shape of.
6108 ListOfID List of sub-shapes indices.
6109 theName Object name; when specified, this parameter is used
6110 for result publication in the study. Otherwise, if automatic
6111 publication is switched on, default value is used for result name.
6116 # Example: see GEOM_TestAll.py
6117 anObj = self.AddSubShape(aShape,ListOfID)
6118 self._autoPublish(anObj, theName, "subshape")
6121 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6122 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6123 # @param aShape Shape to get sub-shape of.
6124 # @param aSubShape Sub-shapes of aShape.
6125 # @return ID of found sub-shape.
6127 # @ref swig_all_decompose "Example"
6128 @ManageTransactions("LocalOp")
6129 def GetSubShapeID(self, aShape, aSubShape):
6131 Obtain unique ID of sub-shape aSubShape inside aShape
6132 of aShape, selected by their unique IDs inside aShape
6135 aShape Shape to get sub-shape of.
6136 aSubShape Sub-shapes of aShape.
6139 ID of found sub-shape.
6141 # Example: see GEOM_TestAll.py
6142 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6143 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6146 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6147 # This function is provided for performance purpose. The complexity is O(n) with n
6148 # the number of subobjects of aShape
6149 # @param aShape Shape to get sub-shape of.
6150 # @param aSubShapes Sub-shapes of aShape.
6151 # @return list of IDs of found sub-shapes.
6153 # @ref swig_all_decompose "Example"
6154 @ManageTransactions("ShapesOp")
6155 def GetSubShapesIDs(self, aShape, aSubShapes):
6157 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6158 This function is provided for performance purpose. The complexity is O(n) with n
6159 the number of subobjects of aShape
6162 aShape Shape to get sub-shape of.
6163 aSubShapes Sub-shapes of aShape.
6166 List of IDs of found sub-shape.
6168 # Example: see GEOM_TestAll.py
6169 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6170 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6176 ## @addtogroup l4_decompose
6179 ## Get all sub-shapes and groups of \a theShape,
6180 # that were created already by any other methods.
6181 # @param theShape Any shape.
6182 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6183 # returned, else all found sub-shapes and groups.
6184 # @return List of existing sub-objects of \a theShape.
6186 # @ref swig_all_decompose "Example"
6187 @ManageTransactions("ShapesOp")
6188 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6190 Get all sub-shapes and groups of theShape,
6191 that were created already by any other methods.
6195 theGroupsOnly If this parameter is TRUE, only groups will be
6196 returned, else all found sub-shapes and groups.
6199 List of existing sub-objects of theShape.
6201 # Example: see GEOM_TestAll.py
6202 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6203 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6206 ## Get all groups of \a theShape,
6207 # that were created already by any other methods.
6208 # @param theShape Any shape.
6209 # @return List of existing groups of \a theShape.
6211 # @ref swig_all_decompose "Example"
6212 @ManageTransactions("ShapesOp")
6213 def GetGroups(self, theShape):
6215 Get all groups of theShape,
6216 that were created already by any other methods.
6222 List of existing groups of theShape.
6224 # Example: see GEOM_TestAll.py
6225 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6226 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6229 ## Explode a shape on sub-shapes of a given type.
6230 # If the shape itself matches the type, it is also returned.
6231 # @param aShape Shape to be exploded.
6232 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6233 # @param theName Object name; when specified, this parameter is used
6234 # for result publication in the study. Otherwise, if automatic
6235 # publication is switched on, default value is used for result name.
6237 # @return List of sub-shapes of type theShapeType, contained in theShape.
6239 # @ref swig_all_decompose "Example"
6240 @ManageTransactions("ShapesOp")
6241 def SubShapeAll(self, aShape, aType, theName=None):
6243 Explode a shape on sub-shapes of a given type.
6244 If the shape itself matches the type, it is also returned.
6247 aShape Shape to be exploded.
6248 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6249 theName Object name; when specified, this parameter is used
6250 for result publication in the study. Otherwise, if automatic
6251 publication is switched on, default value is used for result name.
6254 List of sub-shapes of type theShapeType, contained in theShape.
6256 # Example: see GEOM_TestAll.py
6257 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6258 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6259 self._autoPublish(ListObj, theName, "subshape")
6262 ## Explode a shape on sub-shapes of a given type.
6263 # @param aShape Shape to be exploded.
6264 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6265 # @return List of IDs of sub-shapes.
6267 # @ref swig_all_decompose "Example"
6268 @ManageTransactions("ShapesOp")
6269 def SubShapeAllIDs(self, aShape, aType):
6271 Explode a shape on sub-shapes of a given type.
6274 aShape Shape to be exploded (see geompy.ShapeType)
6275 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6278 List of IDs of sub-shapes.
6280 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6281 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6284 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6285 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6286 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6287 # @param aShape Shape to get sub-shape of.
6288 # @param ListOfInd List of sub-shapes indices.
6289 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6290 # @param theName Object name; when specified, this parameter is used
6291 # for result publication in the study. Otherwise, if automatic
6292 # publication is switched on, default value is used for result name.
6294 # @return A compound of sub-shapes of aShape.
6296 # @ref swig_all_decompose "Example"
6297 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6299 Obtain a compound of sub-shapes of aShape,
6300 selected by their indices in list of all sub-shapes of type aType.
6301 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6304 aShape Shape to get sub-shape of.
6305 ListOfID List of sub-shapes indices.
6306 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6307 theName Object name; when specified, this parameter is used
6308 for result publication in the study. Otherwise, if automatic
6309 publication is switched on, default value is used for result name.
6312 A compound of sub-shapes of aShape.
6314 # Example: see GEOM_TestAll.py
6316 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6317 for ind in ListOfInd:
6318 ListOfIDs.append(AllShapeIDsList[ind - 1])
6319 # note: auto-publishing is done in self.GetSubShape()
6320 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6323 ## Explode a shape on sub-shapes of a given type.
6324 # Sub-shapes will be sorted taking into account their gravity centers,
6325 # to provide stable order of sub-shapes.
6326 # If the shape itself matches the type, it is also returned.
6327 # @param aShape Shape to be exploded.
6328 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6329 # @param theName Object name; when specified, this parameter is used
6330 # for result publication in the study. Otherwise, if automatic
6331 # publication is switched on, default value is used for result name.
6333 # @return List of sub-shapes of type theShapeType, contained in theShape.
6335 # @ref swig_SubShapeAllSorted "Example"
6336 @ManageTransactions("ShapesOp")
6337 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6339 Explode a shape on sub-shapes of a given type.
6340 Sub-shapes will be sorted taking into account their gravity centers,
6341 to provide stable order of sub-shapes.
6342 If the shape itself matches the type, it is also returned.
6345 aShape Shape to be exploded.
6346 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6347 theName Object name; when specified, this parameter is used
6348 for result publication in the study. Otherwise, if automatic
6349 publication is switched on, default value is used for result name.
6352 List of sub-shapes of type theShapeType, contained in theShape.
6354 # Example: see GEOM_TestAll.py
6355 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6356 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6357 self._autoPublish(ListObj, theName, "subshape")
6360 ## Explode a shape on sub-shapes of a given type.
6361 # Sub-shapes will be sorted taking into account their gravity centers,
6362 # to provide stable order of sub-shapes.
6363 # @param aShape Shape to be exploded.
6364 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6365 # @return List of IDs of sub-shapes.
6367 # @ref swig_all_decompose "Example"
6368 @ManageTransactions("ShapesOp")
6369 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6371 Explode a shape on sub-shapes of a given type.
6372 Sub-shapes will be sorted taking into account their gravity centers,
6373 to provide stable order of sub-shapes.
6376 aShape Shape to be exploded.
6377 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6380 List of IDs of sub-shapes.
6382 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6383 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6386 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6387 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6388 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6389 # @param aShape Shape to get sub-shape of.
6390 # @param ListOfInd List of sub-shapes indices.
6391 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6392 # @param theName Object name; when specified, this parameter is used
6393 # for result publication in the study. Otherwise, if automatic
6394 # publication is switched on, default value is used for result name.
6396 # @return A compound of sub-shapes of aShape.
6398 # @ref swig_all_decompose "Example"
6399 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6401 Obtain a compound of sub-shapes of aShape,
6402 selected by they indices in sorted list of all sub-shapes of type aType.
6403 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6406 aShape Shape to get sub-shape of.
6407 ListOfID List of sub-shapes indices.
6408 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6409 theName Object name; when specified, this parameter is used
6410 for result publication in the study. Otherwise, if automatic
6411 publication is switched on, default value is used for result name.
6414 A compound of sub-shapes of aShape.
6416 # Example: see GEOM_TestAll.py
6418 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6419 for ind in ListOfInd:
6420 ListOfIDs.append(AllShapeIDsList[ind - 1])
6421 # note: auto-publishing is done in self.GetSubShape()
6422 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6425 ## Extract shapes (excluding the main shape) of given type.
6426 # @param aShape The shape.
6427 # @param aType The shape type (see ShapeType())
6428 # @param isSorted Boolean flag to switch sorting on/off.
6429 # @param theName Object name; when specified, this parameter is used
6430 # for result publication in the study. Otherwise, if automatic
6431 # publication is switched on, default value is used for result name.
6433 # @return List of sub-shapes of type aType, contained in aShape.
6435 # @ref swig_FilletChamfer "Example"
6436 @ManageTransactions("ShapesOp")
6437 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6439 Extract shapes (excluding the main shape) of given type.
6443 aType The shape type (see geompy.ShapeType)
6444 isSorted Boolean flag to switch sorting on/off.
6445 theName Object name; when specified, this parameter is used
6446 for result publication in the study. Otherwise, if automatic
6447 publication is switched on, default value is used for result name.
6450 List of sub-shapes of type aType, contained in aShape.
6452 # Example: see GEOM_TestAll.py
6453 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6454 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6455 self._autoPublish(ListObj, theName, "subshape")
6458 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6459 # @param aShape Main shape.
6460 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6461 # @param theName Object name; when specified, this parameter is used
6462 # for result publication in the study. Otherwise, if automatic
6463 # publication is switched on, default value is used for result name.
6464 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6466 # @ref swig_all_decompose "Example"
6467 @ManageTransactions("ShapesOp")
6468 def SubShapes(self, aShape, anIDs, theName=None):
6470 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6474 anIDs List of unique IDs of sub-shapes inside theMainShape.
6475 theName Object name; when specified, this parameter is used
6476 for result publication in the study. Otherwise, if automatic
6477 publication is switched on, default value is used for result name.
6480 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6482 # Example: see GEOM_TestAll.py
6483 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6484 RaiseIfFailed("SubShapes", self.ShapesOp)
6485 self._autoPublish(ListObj, theName, "subshape")
6488 ## Explode a shape into edges sorted in a row from a starting point.
6489 # @param theShape the shape to be exploded on edges.
6490 # @param theStartPoint the starting point.
6491 # @param theName Object name; when specified, this parameter is used
6492 # for result publication in the study. Otherwise, if automatic
6493 # publication is switched on, default value is used for result name.
6494 # @return List of GEOM.GEOM_Object that is actually an ordered list
6495 # of edges sorted in a row from a starting point.
6497 # @ref swig_GetSubShapeEdgeSorted "Example"
6498 @ManageTransactions("ShapesOp")
6499 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6501 Explode a shape into edges sorted in a row from a starting point.
6504 theShape the shape to be exploded on edges.
6505 theStartPoint the starting point.
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 List of GEOM.GEOM_Object that is actually an ordered list
6512 of edges sorted in a row from a starting point.
6514 # Example: see GEOM_TestAll.py
6515 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6516 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6517 self._autoPublish(ListObj, theName, "SortedEdges")
6520 ## Check if the object is a sub-object of another GEOM object.
6521 # @param aSubObject Checked sub-object (or its parent object, in case if
6522 # \a theSubObjectIndex is non-zero).
6523 # @param anObject An object that is checked for ownership (or its parent object,
6524 # in case if \a theObjectIndex is non-zero).
6525 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6526 # identifies a sub-object within its parent specified via \a theSubObject.
6527 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6528 # identifies an object within its parent specified via \a theObject.
6529 # @return TRUE, if the given object contains sub-object.
6530 @ManageTransactions("ShapesOp")
6531 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6533 Check if the object is a sub-object of another GEOM object.
6536 aSubObject Checked sub-object (or its parent object, in case if
6537 \a theSubObjectIndex is non-zero).
6538 anObject An object that is checked for ownership (or its parent object,
6539 in case if \a theObjectIndex is non-zero).
6540 aSubObjectIndex When non-zero, specifies a sub-shape index that
6541 identifies a sub-object within its parent specified via \a theSubObject.
6542 anObjectIndex When non-zero, specifies a sub-shape index that
6543 identifies an object within its parent specified via \a theObject.
6546 TRUE, if the given object contains sub-object.
6548 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6549 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6552 # end of l4_decompose
6555 ## @addtogroup l4_decompose_d
6558 ## Deprecated method
6559 # It works like SubShapeAllSortedCentres(), but wrongly
6560 # defines centres of faces, shells and solids.
6561 @ManageTransactions("ShapesOp")
6562 def SubShapeAllSorted(self, aShape, aType, theName=None):
6565 It works like geompy.SubShapeAllSortedCentres, but wrongly
6566 defines centres of faces, shells and solids.
6568 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6569 RaiseIfFailed("MakeExplode", self.ShapesOp)
6570 self._autoPublish(ListObj, theName, "subshape")
6573 ## Deprecated method
6574 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6575 # defines centres of faces, shells and solids.
6576 @ManageTransactions("ShapesOp")
6577 def SubShapeAllSortedIDs(self, aShape, aType):
6580 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6581 defines centres of faces, shells and solids.
6583 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6584 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6587 ## Deprecated method
6588 # It works like SubShapeSortedCentres(), but has a bug
6589 # (wrongly defines centres of faces, shells and solids).
6590 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6593 It works like geompy.SubShapeSortedCentres, but has a bug
6594 (wrongly defines centres of faces, shells and solids).
6597 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6598 for ind in ListOfInd:
6599 ListOfIDs.append(AllShapeIDsList[ind - 1])
6600 # note: auto-publishing is done in self.GetSubShape()
6601 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6604 # end of l4_decompose_d
6607 ## @addtogroup l3_healing
6610 ## Apply a sequence of Shape Healing operators to the given object.
6611 # @param theShape Shape to be processed.
6612 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6613 # @param theParameters List of names of parameters
6614 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6615 # @param theValues List of values of parameters, in the same order
6616 # as parameters are listed in <VAR>theParameters</VAR> list.
6617 # @param 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.
6621 # <b> Operators and Parameters: </b> \n
6623 # * \b FixShape - corrects invalid shapes. \n
6624 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6625 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6627 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6628 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6629 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6630 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6631 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6632 # - \b DropSmallSolids.WidthFactorThreshold - defines maximum value of <em>2V/S</em> of a solid which is considered small, where \a V is volume and \a S is surface area of the solid. \n
6633 # - \b DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria. \n
6634 # - \b DropSmallSolids.MergeSolids - if "1", small solids are removed; if "0" small solids are merged to adjacent non-small solids or left untouched if cannot be merged. \n
6636 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6637 # surfaces in segments using a certain angle. \n
6638 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6639 # if Angle=180, four if Angle=90, etc). \n
6640 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6642 # * \b SplitClosedFaces - splits closed faces in segments.
6643 # The number of segments depends on the number of splitting points.\n
6644 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6646 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6647 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6648 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6649 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6650 # This and the previous parameters can take the following values:\n
6651 # \b Parametric \b Continuity \n
6652 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6653 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6654 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6655 # ruling out sharp edges).\n
6656 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6657 # are of the same magnitude).\n
6658 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6659 # or surfaces (d/du C(u)) are the same at junction. \n
6660 # \b Geometric \b Continuity \n
6661 # \b G1: first derivatives are proportional at junction.\n
6662 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6663 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6664 # \b G2: first and second derivatives are proportional at junction.
6665 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6666 # continuity requires that the underlying parameterization was continuous as well.
6667 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6669 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6670 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6671 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6672 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6673 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6674 # with the specified parameters.\n
6675 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6676 # with the specified parameters.\n
6677 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6678 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6679 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6680 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6682 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6683 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6684 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6685 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6686 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6688 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6689 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6692 # @return New GEOM.GEOM_Object, containing processed shape.
6694 # \n @ref tui_shape_processing "Example"
6695 @ManageTransactions("HealOp")
6696 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6698 Apply a sequence of Shape Healing operators to the given object.
6701 theShape Shape to be processed.
6702 theValues List of values of parameters, in the same order
6703 as parameters are listed in theParameters list.
6704 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6705 theParameters List of names of parameters
6706 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6707 theName Object name; when specified, this parameter is used
6708 for result publication in the study. Otherwise, if automatic
6709 publication is switched on, default value is used for result name.
6711 Operators and Parameters:
6713 * FixShape - corrects invalid shapes.
6714 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6715 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6716 * FixFaceSize - removes small faces, such as spots and strips.
6717 * FixFaceSize.Tolerance - defines minimum possible face size.
6718 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6719 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6720 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6721 * DropSmallSolids.WidthFactorThreshold - defines maximum value of 2V/S of a solid which is considered small, where V is volume and S is surface area of the solid.
6722 * DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria.
6723 * DropSmallSolids.MergeSolids - if '1', small solids are removed; if '0' small solids are merged to adjacent non-small solids or left untouched if cannot be merged.
6725 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6726 in segments using a certain angle.
6727 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6728 if Angle=180, four if Angle=90, etc).
6729 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6730 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6732 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6733 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6734 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6735 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6736 * SplitContinuity.CurveContinuity - required continuity for curves.
6737 This and the previous parameters can take the following values:
6739 Parametric Continuity:
6740 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6741 coincidental. The curves or surfaces may still meet at an angle,
6742 giving rise to a sharp corner or edge).
6743 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6744 are parallel, ruling out sharp edges).
6745 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6746 or surfaces are of the same magnitude).
6747 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6748 curves or surfaces (d/du C(u)) are the same at junction.
6750 Geometric Continuity:
6751 G1: first derivatives are proportional at junction.
6752 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6753 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6754 G2: first and second derivatives are proportional at junction. As the names imply,
6755 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6756 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6757 geometric continuity of order n, but not vice-versa.
6758 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6759 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6760 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6761 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6762 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6763 the specified parameters.
6764 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6765 the specified parameters.
6766 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6767 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6768 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6769 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6770 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6771 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6772 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6773 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6774 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6775 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6776 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6779 New GEOM.GEOM_Object, containing processed shape.
6781 Note: For more information look through SALOME Geometry User's Guide->
6782 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6784 # Example: see GEOM_TestHealing.py
6785 theValues,Parameters = ParseList(theValues)
6786 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6787 # To avoid script failure in case of good argument shape
6788 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6790 RaiseIfFailed("ProcessShape", self.HealOp)
6791 for string in (theOperators + theParameters):
6792 Parameters = ":" + Parameters
6794 anObj.SetParameters(Parameters)
6795 self._autoPublish(anObj, theName, "healed")
6798 ## Remove faces from the given object (shape).
6799 # @param theObject Shape to be processed.
6800 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6801 # removes ALL faces of the given object.
6802 # @param theName Object name; when specified, this parameter is used
6803 # for result publication in the study. Otherwise, if automatic
6804 # publication is switched on, default value is used for result name.
6806 # @return New GEOM.GEOM_Object, containing processed shape.
6808 # @ref tui_suppress_faces "Example"
6809 @ManageTransactions("HealOp")
6810 def SuppressFaces(self, theObject, theFaces, theName=None):
6812 Remove faces from the given object (shape).
6815 theObject Shape to be processed.
6816 theFaces Indices of faces to be removed, if EMPTY then the method
6817 removes ALL faces of the given object.
6818 theName Object name; when specified, this parameter is used
6819 for result publication in the study. Otherwise, if automatic
6820 publication is switched on, default value is used for result name.
6823 New GEOM.GEOM_Object, containing processed shape.
6825 # Example: see GEOM_TestHealing.py
6826 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6827 RaiseIfFailed("SuppressFaces", self.HealOp)
6828 self._autoPublish(anObj, theName, "suppressFaces")
6831 ## Sewing of faces into a single shell.
6832 # @param ListShape Shapes to be processed.
6833 # @param theTolerance Required tolerance value.
6834 # @param AllowNonManifold Flag that allows non-manifold sewing.
6835 # @param theName Object name; when specified, this parameter is used
6836 # for result publication in the study. Otherwise, if automatic
6837 # publication is switched on, default value is used for result name.
6839 # @return New GEOM.GEOM_Object, containing a result shell.
6841 # @ref tui_sewing "Example"
6842 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6844 Sewing of faces into a single shell.
6847 ListShape Shapes to be processed.
6848 theTolerance Required tolerance value.
6849 AllowNonManifold Flag that allows non-manifold sewing.
6850 theName Object name; when specified, this parameter is used
6851 for result publication in the study. Otherwise, if automatic
6852 publication is switched on, default value is used for result name.
6855 New GEOM.GEOM_Object, containing containing a result shell.
6857 # Example: see GEOM_TestHealing.py
6858 # note: auto-publishing is done in self.Sew()
6859 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6862 ## Sewing of faces into a single shell.
6863 # @param ListShape Shapes to be processed.
6864 # @param theTolerance Required tolerance value.
6865 # @param AllowNonManifold Flag that allows non-manifold sewing.
6866 # @param theName Object name; when specified, this parameter is used
6867 # for result publication in the study. Otherwise, if automatic
6868 # publication is switched on, default value is used for result name.
6870 # @return New GEOM.GEOM_Object, containing a result shell.
6871 @ManageTransactions("HealOp")
6872 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6874 Sewing of faces into a single shell.
6877 ListShape Shapes to be processed.
6878 theTolerance Required tolerance value.
6879 AllowNonManifold Flag that allows non-manifold sewing.
6880 theName Object name; when specified, this parameter is used
6881 for result publication in the study. Otherwise, if automatic
6882 publication is switched on, default value is used for result name.
6885 New GEOM.GEOM_Object, containing a result shell.
6887 # Example: see MakeSewing() above
6888 theTolerance,Parameters = ParseParameters(theTolerance)
6889 if AllowNonManifold:
6890 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6892 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6893 # To avoid script failure in case of good argument shape
6894 # (Fix of test cases geom/bugs11/L7,L8)
6895 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6897 RaiseIfFailed("Sew", self.HealOp)
6898 anObj.SetParameters(Parameters)
6899 self._autoPublish(anObj, theName, "sewed")
6902 ## Rebuild the topology of theSolids by removing
6903 # the faces that are shared by several solids.
6904 # @param theSolids A compound or a list of solids to be processed.
6905 # @param theName Object name; when specified, this parameter is used
6906 # for result publication in the study. Otherwise, if automatic
6907 # publication is switched on, default value is used for result name.
6909 # @return New GEOM.GEOM_Object, containing processed shape.
6911 # @ref tui_remove_webs "Example"
6912 @ManageTransactions("HealOp")
6913 def RemoveInternalFaces (self, theSolids, theName=None):
6915 Rebuild the topology of theSolids by removing
6916 the faces that are shared by several solids.
6919 theSolids A compound or a list of solids to be processed.
6920 theName Object name; when specified, this parameter is used
6921 for result publication in the study. Otherwise, if automatic
6922 publication is switched on, default value is used for result name.
6925 New GEOM.GEOM_Object, containing processed shape.
6927 # Example: see GEOM_TestHealing.py
6928 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
6929 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6930 self._autoPublish(anObj, theName, "removeWebs")
6933 ## Remove internal wires and edges from the given object (face).
6934 # @param theObject Shape to be processed.
6935 # @param theWires Indices of wires to be removed, if EMPTY then the method
6936 # removes ALL internal wires of the given object.
6937 # @param theName Object name; when specified, this parameter is used
6938 # for result publication in the study. Otherwise, if automatic
6939 # publication is switched on, default value is used for result name.
6941 # @return New GEOM.GEOM_Object, containing processed shape.
6943 # @ref tui_suppress_internal_wires "Example"
6944 @ManageTransactions("HealOp")
6945 def SuppressInternalWires(self, theObject, theWires, theName=None):
6947 Remove internal wires and edges from the given object (face).
6950 theObject Shape to be processed.
6951 theWires Indices of wires to be removed, if EMPTY then the method
6952 removes ALL internal wires of the given object.
6953 theName Object name; when specified, this parameter is used
6954 for result publication in the study. Otherwise, if automatic
6955 publication is switched on, default value is used for result name.
6958 New GEOM.GEOM_Object, containing processed shape.
6960 # Example: see GEOM_TestHealing.py
6961 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6962 RaiseIfFailed("RemoveIntWires", self.HealOp)
6963 self._autoPublish(anObj, theName, "suppressWires")
6966 ## Remove internal closed contours (holes) from the given object.
6967 # @param theObject Shape to be processed.
6968 # @param theWires Indices of wires to be removed, if EMPTY then the method
6969 # removes ALL internal holes of the given object
6970 # @param theName Object name; when specified, this parameter is used
6971 # for result publication in the study. Otherwise, if automatic
6972 # publication is switched on, default value is used for result name.
6974 # @return New GEOM.GEOM_Object, containing processed shape.
6976 # @ref tui_suppress_holes "Example"
6977 @ManageTransactions("HealOp")
6978 def SuppressHoles(self, theObject, theWires, theName=None):
6980 Remove internal closed contours (holes) from the given object.
6983 theObject Shape to be processed.
6984 theWires Indices of wires to be removed, if EMPTY then the method
6985 removes ALL internal holes of the given object
6986 theName Object name; when specified, this parameter is used
6987 for result publication in the study. Otherwise, if automatic
6988 publication is switched on, default value is used for result name.
6991 New GEOM.GEOM_Object, containing processed shape.
6993 # Example: see GEOM_TestHealing.py
6994 anObj = self.HealOp.FillHoles(theObject, theWires)
6995 RaiseIfFailed("FillHoles", self.HealOp)
6996 self._autoPublish(anObj, theName, "suppressHoles")
6999 ## Close an open wire.
7000 # @param theObject Shape to be processed.
7001 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7002 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7003 # @param isCommonVertex If True : closure by creation of a common vertex,
7004 # If False : closure by creation of an edge between ends.
7005 # @param theName Object name; when specified, this parameter is used
7006 # for result publication in the study. Otherwise, if automatic
7007 # publication is switched on, default value is used for result name.
7009 # @return New GEOM.GEOM_Object, containing processed shape.
7011 # @ref tui_close_contour "Example"
7012 @ManageTransactions("HealOp")
7013 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7018 theObject Shape to be processed.
7019 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7020 if [ ], then theObject itself is a wire.
7021 isCommonVertex If True : closure by creation of a common vertex,
7022 If False : closure by creation of an edge between ends.
7023 theName Object name; when specified, this parameter is used
7024 for result publication in the study. Otherwise, if automatic
7025 publication is switched on, default value is used for result name.
7028 New GEOM.GEOM_Object, containing processed shape.
7030 # Example: see GEOM_TestHealing.py
7031 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7032 RaiseIfFailed("CloseContour", self.HealOp)
7033 self._autoPublish(anObj, theName, "closeContour")
7036 ## Addition of a point to a given edge object.
7037 # @param theObject Shape to be processed.
7038 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7039 # if -1, then theObject itself is the edge.
7040 # @param theValue Value of parameter on edge or length parameter,
7041 # depending on \a isByParameter.
7042 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7043 # if FALSE : \a theValue is treated as a length parameter [0..1]
7044 # @param theName Object name; when specified, this parameter is used
7045 # for result publication in the study. Otherwise, if automatic
7046 # publication is switched on, default value is used for result name.
7048 # @return New GEOM.GEOM_Object, containing processed shape.
7050 # @ref tui_add_point_on_edge "Example"
7051 @ManageTransactions("HealOp")
7052 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7054 Addition of a point to a given edge object.
7057 theObject Shape to be processed.
7058 theEdgeIndex Index of edge to be divided within theObject's shape,
7059 if -1, then theObject itself is the edge.
7060 theValue Value of parameter on edge or length parameter,
7061 depending on isByParameter.
7062 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7063 if FALSE : theValue is treated as a length parameter [0..1]
7064 theName Object name; when specified, this parameter is used
7065 for result publication in the study. Otherwise, if automatic
7066 publication is switched on, default value is used for result name.
7069 New GEOM.GEOM_Object, containing processed shape.
7071 # Example: see GEOM_TestHealing.py
7072 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7073 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7074 RaiseIfFailed("DivideEdge", self.HealOp)
7075 anObj.SetParameters(Parameters)
7076 self._autoPublish(anObj, theName, "divideEdge")
7079 ## Addition of points to a given edge of \a theObject by projecting
7080 # other points to the given edge.
7081 # @param theObject Shape to be processed.
7082 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7083 # if -1, then theObject itself is the edge.
7084 # @param thePoints List of points to project to theEdgeIndex-th edge.
7085 # @param theName Object name; when specified, this parameter is used
7086 # for result publication in the study. Otherwise, if automatic
7087 # publication is switched on, default value is used for result name.
7089 # @return New GEOM.GEOM_Object, containing processed shape.
7091 # @ref tui_add_point_on_edge "Example"
7092 @ManageTransactions("HealOp")
7093 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7095 Addition of points to a given edge of \a theObject by projecting
7096 other points to the given edge.
7099 theObject Shape to be processed.
7100 theEdgeIndex The edge or its index to be divided within theObject's shape,
7101 if -1, then theObject itself is the edge.
7102 thePoints List of points to project to theEdgeIndex-th edge.
7103 theName Object name; when specified, this parameter is used
7104 for result publication in the study. Otherwise, if automatic
7105 publication is switched on, default value is used for result name.
7108 New GEOM.GEOM_Object, containing processed shape.
7110 # Example: see GEOM_TestHealing.py
7111 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7112 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7113 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7114 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7115 self._autoPublish(anObj, theName, "divideEdge")
7118 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7119 # @param theWire Wire to minimize the number of C1 continuous edges in.
7120 # @param theVertices A list of vertices to suppress. If the list
7121 # is empty, all vertices in a wire will be assumed.
7122 # @param theName Object name; when specified, this parameter is used
7123 # for result publication in the study. Otherwise, if automatic
7124 # publication is switched on, default value is used for result name.
7126 # @return New GEOM.GEOM_Object with modified wire.
7128 # @ref tui_fuse_collinear_edges "Example"
7129 @ManageTransactions("HealOp")
7130 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7132 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7135 theWire Wire to minimize the number of C1 continuous edges in.
7136 theVertices A list of vertices to suppress. If the list
7137 is empty, all vertices in a wire will be assumed.
7138 theName Object name; when specified, this parameter is used
7139 for result publication in the study. Otherwise, if automatic
7140 publication is switched on, default value is used for result name.
7143 New GEOM.GEOM_Object with modified wire.
7145 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7146 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7147 self._autoPublish(anObj, theName, "fuseEdges")
7150 ## Change orientation of the given object. Updates given shape.
7151 # @param theObject Shape to be processed.
7152 # @return Updated <var>theObject</var>
7154 # @ref swig_todo "Example"
7155 @ManageTransactions("HealOp")
7156 def ChangeOrientationShell(self,theObject):
7158 Change orientation of the given object. Updates given shape.
7161 theObject Shape to be processed.
7166 theObject = self.HealOp.ChangeOrientation(theObject)
7167 RaiseIfFailed("ChangeOrientation", self.HealOp)
7170 ## Change orientation of the given object.
7171 # @param theObject Shape to be processed.
7172 # @param theName Object name; when specified, this parameter is used
7173 # for result publication in the study. Otherwise, if automatic
7174 # publication is switched on, default value is used for result name.
7176 # @return New GEOM.GEOM_Object, containing processed shape.
7178 # @ref swig_todo "Example"
7179 @ManageTransactions("HealOp")
7180 def ChangeOrientationShellCopy(self, theObject, theName=None):
7182 Change orientation of the given object.
7185 theObject Shape to be processed.
7186 theName Object name; when specified, this parameter is used
7187 for result publication in the study. Otherwise, if automatic
7188 publication is switched on, default value is used for result name.
7191 New GEOM.GEOM_Object, containing processed shape.
7193 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7194 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7195 self._autoPublish(anObj, theName, "reversed")
7198 ## Try to limit tolerance of the given object by value \a theTolerance.
7199 # @param theObject Shape to be processed.
7200 # @param theTolerance Required tolerance value.
7201 # @param theName Object name; when specified, this parameter is used
7202 # for result publication in the study. Otherwise, if automatic
7203 # publication is switched on, default value is used for result name.
7205 # @return New GEOM.GEOM_Object, containing processed shape.
7207 # @ref tui_limit_tolerance "Example"
7208 @ManageTransactions("HealOp")
7209 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7211 Try to limit tolerance of the given object by value theTolerance.
7214 theObject Shape to be processed.
7215 theTolerance Required tolerance value.
7216 theName Object name; when specified, this parameter is used
7217 for result publication in the study. Otherwise, if automatic
7218 publication is switched on, default value is used for result name.
7221 New GEOM.GEOM_Object, containing processed shape.
7223 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7224 RaiseIfFailed("LimitTolerance", self.HealOp)
7225 self._autoPublish(anObj, theName, "limitTolerance")
7228 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7229 # that constitute a free boundary of the given shape.
7230 # @param theObject Shape to get free boundary of.
7231 # @param theName Object name; when specified, this parameter is used
7232 # for result publication in the study. Otherwise, if automatic
7233 # publication is switched on, default value is used for result name.
7235 # @return [\a status, \a theClosedWires, \a theOpenWires]
7236 # \n \a status: FALSE, if an error(s) occured during the method execution.
7237 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7238 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7240 # @ref tui_free_boundaries_page "Example"
7241 @ManageTransactions("HealOp")
7242 def GetFreeBoundary(self, theObject, theName=None):
7244 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7245 that constitute a free boundary of the given shape.
7248 theObject Shape to get free boundary of.
7249 theName Object name; when specified, this parameter is used
7250 for result publication in the study. Otherwise, if automatic
7251 publication is switched on, default value is used for result name.
7254 [status, theClosedWires, theOpenWires]
7255 status: FALSE, if an error(s) occured during the method execution.
7256 theClosedWires: Closed wires on the free boundary of the given shape.
7257 theOpenWires: Open wires on the free boundary of the given shape.
7259 # Example: see GEOM_TestHealing.py
7260 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7261 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7262 self._autoPublish(anObj[1], theName, "closedWire")
7263 self._autoPublish(anObj[2], theName, "openWire")
7266 ## Replace coincident faces in \a theShapes by one face.
7267 # @param theShapes Initial shapes, either a list or compound of shapes.
7268 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7269 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7270 # otherwise all initial shapes.
7271 # @param theName Object name; when specified, this parameter is used
7272 # for result publication in the study. Otherwise, if automatic
7273 # publication is switched on, default value is used for result name.
7275 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7277 # @ref tui_glue_faces "Example"
7278 @ManageTransactions("ShapesOp")
7279 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7281 Replace coincident faces in theShapes by one face.
7284 theShapes Initial shapes, either a list or compound of shapes.
7285 theTolerance Maximum distance between faces, which can be considered as coincident.
7286 doKeepNonSolids If FALSE, only solids will present in the result,
7287 otherwise all initial shapes.
7288 theName Object name; when specified, this parameter is used
7289 for result publication in the study. Otherwise, if automatic
7290 publication is switched on, default value is used for result name.
7293 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7295 # Example: see GEOM_Spanner.py
7296 theTolerance,Parameters = ParseParameters(theTolerance)
7297 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7299 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
7300 anObj.SetParameters(Parameters)
7301 self._autoPublish(anObj, theName, "glueFaces")
7304 ## Find coincident faces in \a theShapes for possible gluing.
7305 # @param theShapes Initial shapes, either a list or compound of shapes.
7306 # @param theTolerance Maximum distance between faces,
7307 # which can be considered as coincident.
7308 # @param theName Object name; when specified, this parameter is used
7309 # for result publication in the study. Otherwise, if automatic
7310 # publication is switched on, default value is used for result name.
7312 # @return GEOM.ListOfGO
7314 # @ref tui_glue_faces "Example"
7315 @ManageTransactions("ShapesOp")
7316 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7318 Find coincident faces in theShapes for possible gluing.
7321 theShapes Initial shapes, either a list or compound of shapes.
7322 theTolerance Maximum distance between faces,
7323 which can be considered as coincident.
7324 theName Object name; when specified, this parameter is used
7325 for result publication in the study. Otherwise, if automatic
7326 publication is switched on, default value is used for result name.
7331 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7332 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7333 self._autoPublish(anObj, theName, "facesToGlue")
7336 ## Replace coincident faces in \a theShapes by one face
7337 # in compliance with given list of faces
7338 # @param theShapes Initial shapes, either a list or compound of shapes.
7339 # @param theTolerance Maximum distance between faces,
7340 # which can be considered as coincident.
7341 # @param theFaces List of faces for gluing.
7342 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7343 # otherwise all initial shapes.
7344 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7345 # will be glued, otherwise only the edges,
7346 # belonging to <VAR>theFaces</VAR>.
7347 # @param theName Object name; when specified, this parameter is used
7348 # for result publication in the study. Otherwise, if automatic
7349 # publication is switched on, default value is used for result name.
7351 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7353 # @ref tui_glue_faces "Example"
7354 @ManageTransactions("ShapesOp")
7355 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7356 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7358 Replace coincident faces in theShapes by one face
7359 in compliance with given list of faces
7362 theShapes theShapes Initial shapes, either a list or compound of shapes.
7363 theTolerance Maximum distance between faces,
7364 which can be considered as coincident.
7365 theFaces List of faces for gluing.
7366 doKeepNonSolids If FALSE, only solids will present in the result,
7367 otherwise all initial shapes.
7368 doGlueAllEdges If TRUE, all coincident edges of theShape
7369 will be glued, otherwise only the edges,
7370 belonging to theFaces.
7371 theName Object name; when specified, this parameter is used
7372 for result publication in the study. Otherwise, if automatic
7373 publication is switched on, default value is used for result name.
7376 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7378 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7379 doKeepNonSolids, doGlueAllEdges)
7381 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
7382 self._autoPublish(anObj, theName, "glueFaces")
7385 ## Replace coincident edges in \a theShapes by one edge.
7386 # @param theShapes Initial shapes, either a list or compound of shapes.
7387 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7388 # @param theName Object name; when specified, this parameter is used
7389 # for result publication in the study. Otherwise, if automatic
7390 # publication is switched on, default value is used for result name.
7392 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7394 # @ref tui_glue_edges "Example"
7395 @ManageTransactions("ShapesOp")
7396 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7398 Replace coincident edges in theShapes by one edge.
7401 theShapes Initial shapes, either a list or compound of shapes.
7402 theTolerance Maximum distance between edges, which can be considered as coincident.
7403 theName Object name; when specified, this parameter is used
7404 for result publication in the study. Otherwise, if automatic
7405 publication is switched on, default value is used for result name.
7408 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7410 theTolerance,Parameters = ParseParameters(theTolerance)
7411 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7413 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
7414 anObj.SetParameters(Parameters)
7415 self._autoPublish(anObj, theName, "glueEdges")
7418 ## Find coincident edges in \a theShapes for possible gluing.
7419 # @param theShapes Initial shapes, either a list or compound of shapes.
7420 # @param theTolerance Maximum distance between edges,
7421 # which can be considered as coincident.
7422 # @param theName Object name; when specified, this parameter is used
7423 # for result publication in the study. Otherwise, if automatic
7424 # publication is switched on, default value is used for result name.
7426 # @return GEOM.ListOfGO
7428 # @ref tui_glue_edges "Example"
7429 @ManageTransactions("ShapesOp")
7430 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7432 Find coincident edges in theShapes for possible gluing.
7435 theShapes Initial shapes, either a list or compound of shapes.
7436 theTolerance Maximum distance between edges,
7437 which can be considered as coincident.
7438 theName Object name; when specified, this parameter is used
7439 for result publication in the study. Otherwise, if automatic
7440 publication is switched on, default value is used for result name.
7445 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7446 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7447 self._autoPublish(anObj, theName, "edgesToGlue")
7450 ## Replace coincident edges in theShapes by one edge
7451 # in compliance with given list of edges.
7452 # @param theShapes Initial shapes, either a list or compound of shapes.
7453 # @param theTolerance Maximum distance between edges,
7454 # which can be considered as coincident.
7455 # @param theEdges List of edges for gluing.
7456 # @param theName Object name; when specified, this parameter is used
7457 # for result publication in the study. Otherwise, if automatic
7458 # publication is switched on, default value is used for result name.
7460 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7462 # @ref tui_glue_edges "Example"
7463 @ManageTransactions("ShapesOp")
7464 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7466 Replace coincident edges in theShapes by one edge
7467 in compliance with given list of edges.
7470 theShapes Initial shapes, either a list or compound of shapes.
7471 theTolerance Maximum distance between edges,
7472 which can be considered as coincident.
7473 theEdges List of edges for gluing.
7474 theName Object name; when specified, this parameter is used
7475 for result publication in the study. Otherwise, if automatic
7476 publication is switched on, default value is used for result name.
7479 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7481 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7483 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
7484 self._autoPublish(anObj, theName, "glueEdges")
7490 ## @addtogroup l3_boolean Boolean Operations
7493 # -----------------------------------------------------------------------------
7494 # Boolean (Common, Cut, Fuse, Section)
7495 # -----------------------------------------------------------------------------
7497 ## Perform one of boolean operations on two given shapes.
7498 # @param theShape1 First argument for boolean operation.
7499 # @param theShape2 Second argument for boolean operation.
7500 # @param theOperation Indicates the operation to be done:\n
7501 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7502 # @param checkSelfInte The flag that tells if the arguments should
7503 # be checked for self-intersection prior to the operation.
7504 # @param theName Object name; when specified, this parameter is used
7505 # for result publication in the study. Otherwise, if automatic
7506 # publication is switched on, default value is used for result name.
7508 # @note This algorithm doesn't find all types of self-intersections.
7509 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7510 # vertex/face and edge/face intersections. Face/face
7511 # intersections detection is switched off as it is a
7512 # time-consuming operation that gives an impact on performance.
7513 # To find all self-intersections please use
7514 # CheckSelfIntersections() method.
7516 # @return New GEOM.GEOM_Object, containing the result shape.
7518 # @ref tui_fuse "Example"
7519 @ManageTransactions("BoolOp")
7520 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7522 Perform one of boolean operations on two given shapes.
7525 theShape1 First argument for boolean operation.
7526 theShape2 Second argument for boolean operation.
7527 theOperation Indicates the operation to be done:
7528 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7529 checkSelfInte The flag that tells if the arguments should
7530 be checked for self-intersection prior to
7532 theName Object name; when specified, this parameter is used
7533 for result publication in the study. Otherwise, if automatic
7534 publication is switched on, default value is used for result name.
7537 This algorithm doesn't find all types of self-intersections.
7538 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7539 vertex/face and edge/face intersections. Face/face
7540 intersections detection is switched off as it is a
7541 time-consuming operation that gives an impact on performance.
7542 To find all self-intersections please use
7543 CheckSelfIntersections() method.
7546 New GEOM.GEOM_Object, containing the result shape.
7548 # Example: see GEOM_TestAll.py
7549 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7550 RaiseIfFailed("MakeBoolean", self.BoolOp)
7551 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7552 self._autoPublish(anObj, theName, def_names[theOperation])
7555 ## Perform Common boolean operation on two given shapes.
7556 # @param theShape1 First argument for boolean operation.
7557 # @param theShape2 Second argument for boolean operation.
7558 # @param checkSelfInte The flag that tells if the arguments should
7559 # be checked for self-intersection prior to the operation.
7560 # @param theName Object name; when specified, this parameter is used
7561 # for result publication in the study. Otherwise, if automatic
7562 # publication is switched on, default value is used for result name.
7564 # @note This algorithm doesn't find all types of self-intersections.
7565 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7566 # vertex/face and edge/face intersections. Face/face
7567 # intersections detection is switched off as it is a
7568 # time-consuming operation that gives an impact on performance.
7569 # To find all self-intersections please use
7570 # CheckSelfIntersections() method.
7572 # @return New GEOM.GEOM_Object, containing the result shape.
7574 # @ref tui_common "Example 1"
7575 # \n @ref swig_MakeCommon "Example 2"
7576 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7578 Perform Common boolean operation on two given shapes.
7581 theShape1 First argument for boolean operation.
7582 theShape2 Second argument for boolean operation.
7583 checkSelfInte The flag that tells if the arguments should
7584 be checked for self-intersection prior to
7586 theName Object name; when specified, this parameter is used
7587 for result publication in the study. Otherwise, if automatic
7588 publication is switched on, default value is used for result name.
7591 This algorithm doesn't find all types of self-intersections.
7592 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7593 vertex/face and edge/face intersections. Face/face
7594 intersections detection is switched off as it is a
7595 time-consuming operation that gives an impact on performance.
7596 To find all self-intersections please use
7597 CheckSelfIntersections() method.
7600 New GEOM.GEOM_Object, containing the result shape.
7602 # Example: see GEOM_TestOthers.py
7603 # note: auto-publishing is done in self.MakeBoolean()
7604 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7606 ## Perform Cut boolean operation on two given shapes.
7607 # @param theShape1 First argument for boolean operation.
7608 # @param theShape2 Second argument for boolean operation.
7609 # @param checkSelfInte The flag that tells if the arguments should
7610 # be checked for self-intersection prior to the operation.
7611 # @param theName Object name; when specified, this parameter is used
7612 # for result publication in the study. Otherwise, if automatic
7613 # publication is switched on, default value is used for result name.
7615 # @note This algorithm doesn't find all types of self-intersections.
7616 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7617 # vertex/face and edge/face intersections. Face/face
7618 # intersections detection is switched off as it is a
7619 # time-consuming operation that gives an impact on performance.
7620 # To find all self-intersections please use
7621 # CheckSelfIntersections() method.
7623 # @return New GEOM.GEOM_Object, containing the result shape.
7625 # @ref tui_cut "Example 1"
7626 # \n @ref swig_MakeCommon "Example 2"
7627 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7629 Perform Cut boolean operation on two given shapes.
7632 theShape1 First argument for boolean operation.
7633 theShape2 Second argument for boolean operation.
7634 checkSelfInte The flag that tells if the arguments should
7635 be checked for self-intersection prior to
7637 theName Object name; when specified, this parameter is used
7638 for result publication in the study. Otherwise, if automatic
7639 publication is switched on, default value is used for result name.
7642 This algorithm doesn't find all types of self-intersections.
7643 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7644 vertex/face and edge/face intersections. Face/face
7645 intersections detection is switched off as it is a
7646 time-consuming operation that gives an impact on performance.
7647 To find all self-intersections please use
7648 CheckSelfIntersections() method.
7651 New GEOM.GEOM_Object, containing the result shape.
7654 # Example: see GEOM_TestOthers.py
7655 # note: auto-publishing is done in self.MakeBoolean()
7656 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7658 ## Perform Fuse boolean operation on two given shapes.
7659 # @param theShape1 First argument for boolean operation.
7660 # @param theShape2 Second argument for boolean operation.
7661 # @param checkSelfInte The flag that tells if the arguments should
7662 # be checked for self-intersection prior to the operation.
7663 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7664 # operation should be performed during the operation.
7665 # @param theName Object name; when specified, this parameter is used
7666 # for result publication in the study. Otherwise, if automatic
7667 # publication is switched on, default value is used for result name.
7669 # @note This algorithm doesn't find all types of self-intersections.
7670 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7671 # vertex/face and edge/face intersections. Face/face
7672 # intersections detection is switched off as it is a
7673 # time-consuming operation that gives an impact on performance.
7674 # To find all self-intersections please use
7675 # CheckSelfIntersections() method.
7677 # @return New GEOM.GEOM_Object, containing the result shape.
7679 # @ref tui_fuse "Example 1"
7680 # \n @ref swig_MakeCommon "Example 2"
7681 @ManageTransactions("BoolOp")
7682 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7683 rmExtraEdges=False, theName=None):
7685 Perform Fuse boolean operation on two given shapes.
7688 theShape1 First argument for boolean operation.
7689 theShape2 Second argument for boolean operation.
7690 checkSelfInte The flag that tells if the arguments should
7691 be checked for self-intersection prior to
7693 rmExtraEdges The flag that tells if Remove Extra Edges
7694 operation should be performed during the operation.
7695 theName Object name; when specified, this parameter is used
7696 for result publication in the study. Otherwise, if automatic
7697 publication is switched on, default value is used for result name.
7700 This algorithm doesn't find all types of self-intersections.
7701 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7702 vertex/face and edge/face intersections. Face/face
7703 intersections detection is switched off as it is a
7704 time-consuming operation that gives an impact on performance.
7705 To find all self-intersections please use
7706 CheckSelfIntersections() method.
7709 New GEOM.GEOM_Object, containing the result shape.
7712 # Example: see GEOM_TestOthers.py
7713 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7714 checkSelfInte, rmExtraEdges)
7715 RaiseIfFailed("MakeFuse", self.BoolOp)
7716 self._autoPublish(anObj, theName, "fuse")
7719 ## Perform Section boolean operation on two given shapes.
7720 # @param theShape1 First argument for boolean operation.
7721 # @param theShape2 Second argument for boolean operation.
7722 # @param checkSelfInte The flag that tells if the arguments should
7723 # be checked for self-intersection prior to the operation.
7724 # If a self-intersection detected the operation fails.
7725 # @param theName Object name; when specified, this parameter is used
7726 # for result publication in the study. Otherwise, if automatic
7727 # publication is switched on, default value is used for result name.
7728 # @return New GEOM.GEOM_Object, containing the result shape.
7730 # @ref tui_section "Example 1"
7731 # \n @ref swig_MakeCommon "Example 2"
7732 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7734 Perform Section boolean operation on two given shapes.
7737 theShape1 First argument for boolean operation.
7738 theShape2 Second argument for boolean operation.
7739 checkSelfInte The flag that tells if the arguments should
7740 be checked for self-intersection prior to the operation.
7741 If a self-intersection detected the operation fails.
7742 theName Object name; when specified, this parameter is used
7743 for result publication in the study. Otherwise, if automatic
7744 publication is switched on, default value is used for result name.
7746 New GEOM.GEOM_Object, containing the result shape.
7749 # Example: see GEOM_TestOthers.py
7750 # note: auto-publishing is done in self.MakeBoolean()
7751 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7753 ## Perform Fuse boolean operation on the list of shapes.
7754 # @param theShapesList Shapes to be fused.
7755 # @param checkSelfInte The flag that tells if the arguments should
7756 # be checked for self-intersection prior to the operation.
7757 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7758 # operation should be performed during the operation.
7759 # @param theName Object name; when specified, this parameter is used
7760 # for result publication in the study. Otherwise, if automatic
7761 # publication is switched on, default value is used for result name.
7763 # @note This algorithm doesn't find all types of self-intersections.
7764 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7765 # vertex/face and edge/face intersections. Face/face
7766 # intersections detection is switched off as it is a
7767 # time-consuming operation that gives an impact on performance.
7768 # To find all self-intersections please use
7769 # CheckSelfIntersections() method.
7771 # @return New GEOM.GEOM_Object, containing the result shape.
7773 # @ref tui_fuse "Example 1"
7774 # \n @ref swig_MakeCommon "Example 2"
7775 @ManageTransactions("BoolOp")
7776 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7777 rmExtraEdges=False, theName=None):
7779 Perform Fuse boolean operation on the list of shapes.
7782 theShapesList Shapes to be fused.
7783 checkSelfInte The flag that tells if the arguments should
7784 be checked for self-intersection prior to
7786 rmExtraEdges The flag that tells if Remove Extra Edges
7787 operation should be performed during the operation.
7788 theName Object name; when specified, this parameter is used
7789 for result publication in the study. Otherwise, if automatic
7790 publication is switched on, default value is used for result name.
7793 This algorithm doesn't find all types of self-intersections.
7794 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7795 vertex/face and edge/face intersections. Face/face
7796 intersections detection is switched off as it is a
7797 time-consuming operation that gives an impact on performance.
7798 To find all self-intersections please use
7799 CheckSelfIntersections() method.
7802 New GEOM.GEOM_Object, containing the result shape.
7805 # Example: see GEOM_TestOthers.py
7806 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7808 RaiseIfFailed("MakeFuseList", self.BoolOp)
7809 self._autoPublish(anObj, theName, "fuse")
7812 ## Perform Common boolean operation on the list of shapes.
7813 # @param theShapesList Shapes for Common operation.
7814 # @param checkSelfInte The flag that tells if the arguments should
7815 # be checked for self-intersection prior to the operation.
7816 # @param theName Object name; when specified, this parameter is used
7817 # for result publication in the study. Otherwise, if automatic
7818 # publication is switched on, default value is used for result name.
7820 # @note This algorithm doesn't find all types of self-intersections.
7821 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7822 # vertex/face and edge/face intersections. Face/face
7823 # intersections detection is switched off as it is a
7824 # time-consuming operation that gives an impact on performance.
7825 # To find all self-intersections please use
7826 # CheckSelfIntersections() method.
7828 # @return New GEOM.GEOM_Object, containing the result shape.
7830 # @ref tui_common "Example 1"
7831 # \n @ref swig_MakeCommon "Example 2"
7832 @ManageTransactions("BoolOp")
7833 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7835 Perform Common boolean operation on the list of shapes.
7838 theShapesList Shapes for Common operation.
7839 checkSelfInte The flag that tells if the arguments should
7840 be checked for self-intersection prior to
7842 theName Object name; when specified, this parameter is used
7843 for result publication in the study. Otherwise, if automatic
7844 publication is switched on, default value is used for result name.
7847 This algorithm doesn't find all types of self-intersections.
7848 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7849 vertex/face and edge/face intersections. Face/face
7850 intersections detection is switched off as it is a
7851 time-consuming operation that gives an impact on performance.
7852 To find all self-intersections please use
7853 CheckSelfIntersections() method.
7856 New GEOM.GEOM_Object, containing the result shape.
7859 # Example: see GEOM_TestOthers.py
7860 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7861 RaiseIfFailed("MakeCommonList", self.BoolOp)
7862 self._autoPublish(anObj, theName, "common")
7865 ## Perform Cut boolean operation on one object and the list of tools.
7866 # @param theMainShape The object of the operation.
7867 # @param theShapesList The list of tools of the operation.
7868 # @param checkSelfInte The flag that tells if the arguments should
7869 # be checked for self-intersection prior to the operation.
7870 # @param theName Object name; when specified, this parameter is used
7871 # for result publication in the study. Otherwise, if automatic
7872 # publication is switched on, default value is used for result name.
7874 # @note This algorithm doesn't find all types of self-intersections.
7875 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7876 # vertex/face and edge/face intersections. Face/face
7877 # intersections detection is switched off as it is a
7878 # time-consuming operation that gives an impact on performance.
7879 # To find all self-intersections please use
7880 # CheckSelfIntersections() method.
7882 # @return New GEOM.GEOM_Object, containing the result shape.
7884 # @ref tui_cut "Example 1"
7885 # \n @ref swig_MakeCommon "Example 2"
7886 @ManageTransactions("BoolOp")
7887 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7889 Perform Cut boolean operation on one object and the list of tools.
7892 theMainShape The object of the operation.
7893 theShapesList The list of tools of the operation.
7894 checkSelfInte The flag that tells if the arguments should
7895 be checked for self-intersection prior to
7897 theName Object name; when specified, this parameter is used
7898 for result publication in the study. Otherwise, if automatic
7899 publication is switched on, default value is used for result name.
7902 This algorithm doesn't find all types of self-intersections.
7903 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7904 vertex/face and edge/face intersections. Face/face
7905 intersections detection is switched off as it is a
7906 time-consuming operation that gives an impact on performance.
7907 To find all self-intersections please use
7908 CheckSelfIntersections() method.
7911 New GEOM.GEOM_Object, containing the result shape.
7914 # Example: see GEOM_TestOthers.py
7915 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7916 RaiseIfFailed("MakeCutList", self.BoolOp)
7917 self._autoPublish(anObj, theName, "cut")
7923 ## @addtogroup l3_basic_op
7926 ## Perform partition operation.
7927 # @param ListShapes Shapes to be intersected.
7928 # @param ListTools Shapes to intersect theShapes.
7929 # @param Limit Type of resulting shapes (see ShapeType()).\n
7930 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7931 # type will be detected automatically.
7932 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7933 # target type (equal to Limit) are kept in the result,
7934 # else standalone shapes of lower dimension
7935 # are kept also (if they exist).
7937 # @param theName Object name; when specified, this parameter is used
7938 # for result publication in the study. Otherwise, if automatic
7939 # publication is switched on, default value is used for result name.
7941 # @note Each compound from ListShapes and ListTools will be exploded
7942 # in order to avoid possible intersection between shapes from this compound.
7944 # After implementation new version of PartitionAlgo (October 2006)
7945 # other parameters are ignored by current functionality. They are kept
7946 # in this function only for support old versions.
7947 # @param ListKeepInside Shapes, outside which the results will be deleted.
7948 # Each shape from theKeepInside must belong to theShapes also.
7949 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7950 # Each shape from theRemoveInside must belong to theShapes also.
7951 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7952 # @param ListMaterials Material indices for each shape. Make sence,
7953 # only if theRemoveWebs is TRUE.
7955 # @return New GEOM.GEOM_Object, containing the result shapes.
7957 # @ref tui_partition "Example"
7958 @ManageTransactions("BoolOp")
7959 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7960 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7961 KeepNonlimitShapes=0, theName=None):
7963 Perform partition operation.
7966 ListShapes Shapes to be intersected.
7967 ListTools Shapes to intersect theShapes.
7968 Limit Type of resulting shapes (see geompy.ShapeType)
7969 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7970 type will be detected automatically.
7971 KeepNonlimitShapes if this parameter == 0, then only shapes of
7972 target type (equal to Limit) are kept in the result,
7973 else standalone shapes of lower dimension
7974 are kept also (if they exist).
7976 theName Object name; when specified, this parameter is used
7977 for result publication in the study. Otherwise, if automatic
7978 publication is switched on, default value is used for result name.
7980 Each compound from ListShapes and ListTools will be exploded
7981 in order to avoid possible intersection between shapes from
7984 After implementation new version of PartitionAlgo (October 2006) other
7985 parameters are ignored by current functionality. They are kept in this
7986 function only for support old versions.
7989 ListKeepInside Shapes, outside which the results will be deleted.
7990 Each shape from theKeepInside must belong to theShapes also.
7991 ListRemoveInside Shapes, inside which the results will be deleted.
7992 Each shape from theRemoveInside must belong to theShapes also.
7993 RemoveWebs If TRUE, perform Glue 3D algorithm.
7994 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7997 New GEOM.GEOM_Object, containing the result shapes.
7999 # Example: see GEOM_TestAll.py
8000 if Limit == self.ShapeType["AUTO"]:
8001 # automatic detection of the most appropriate shape limit type
8003 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
8004 Limit = EnumToLong(lim)
8006 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8007 ListKeepInside, ListRemoveInside,
8008 Limit, RemoveWebs, ListMaterials,
8009 KeepNonlimitShapes);
8010 RaiseIfFailed("MakePartition", self.BoolOp)
8011 self._autoPublish(anObj, theName, "partition")
8014 ## Perform partition operation.
8015 # This method may be useful if it is needed to make a partition for
8016 # compound contains nonintersected shapes. Performance will be better
8017 # since intersection between shapes from compound is not performed.
8019 # Description of all parameters as in previous method MakePartition().
8020 # One additional parameter is provided:
8021 # @param checkSelfInte The flag that tells if the arguments should
8022 # be checked for self-intersection prior to the operation.
8024 # @note This algorithm doesn't find all types of self-intersections.
8025 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8026 # vertex/face and edge/face intersections. Face/face
8027 # intersections detection is switched off as it is a
8028 # time-consuming operation that gives an impact on performance.
8029 # To find all self-intersections please use
8030 # CheckSelfIntersections() method.
8032 # @note Passed compounds (via ListShapes or via ListTools)
8033 # have to consist of nonintersecting shapes.
8035 # @return New GEOM.GEOM_Object, containing the result shapes.
8037 # @ref swig_todo "Example"
8038 @ManageTransactions("BoolOp")
8039 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8040 ListKeepInside=[], ListRemoveInside=[],
8041 Limit=ShapeType["AUTO"], RemoveWebs=0,
8042 ListMaterials=[], KeepNonlimitShapes=0,
8043 checkSelfInte=False, theName=None):
8045 Perform partition operation.
8046 This method may be useful if it is needed to make a partition for
8047 compound contains nonintersected shapes. Performance will be better
8048 since intersection between shapes from compound is not performed.
8051 Description of all parameters as in method geompy.MakePartition.
8052 One additional parameter is provided:
8053 checkSelfInte The flag that tells if the arguments should
8054 be checked for self-intersection prior to
8058 This algorithm doesn't find all types of self-intersections.
8059 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8060 vertex/face and edge/face intersections. Face/face
8061 intersections detection is switched off as it is a
8062 time-consuming operation that gives an impact on performance.
8063 To find all self-intersections please use
8064 CheckSelfIntersections() method.
8067 Passed compounds (via ListShapes or via ListTools)
8068 have to consist of nonintersecting shapes.
8071 New GEOM.GEOM_Object, containing the result shapes.
8073 if Limit == self.ShapeType["AUTO"]:
8074 # automatic detection of the most appropriate shape limit type
8076 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
8077 Limit = EnumToLong(lim)
8079 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8080 ListKeepInside, ListRemoveInside,
8081 Limit, RemoveWebs, ListMaterials,
8082 KeepNonlimitShapes, checkSelfInte);
8083 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8084 self._autoPublish(anObj, theName, "partition")
8087 ## See method MakePartition() for more information.
8089 # @ref tui_partition "Example 1"
8090 # \n @ref swig_Partition "Example 2"
8091 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8092 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8093 KeepNonlimitShapes=0, theName=None):
8095 See method geompy.MakePartition for more information.
8097 # Example: see GEOM_TestOthers.py
8098 # note: auto-publishing is done in self.MakePartition()
8099 anObj = self.MakePartition(ListShapes, ListTools,
8100 ListKeepInside, ListRemoveInside,
8101 Limit, RemoveWebs, ListMaterials,
8102 KeepNonlimitShapes, theName);
8105 ## Perform partition of the Shape with the Plane
8106 # @param theShape Shape to be intersected.
8107 # @param thePlane Tool shape, to intersect theShape.
8108 # @param theName Object name; when specified, this parameter is used
8109 # for result publication in the study. Otherwise, if automatic
8110 # publication is switched on, default value is used for result name.
8112 # @return New GEOM.GEOM_Object, containing the result shape.
8114 # @note This operation is a shortcut to the more general @ref MakePartition
8115 # operation, where @a theShape specifies single "object" (shape being partitioned)
8116 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8117 # @ref MakePartition operation have default values:
8118 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8119 # - @a KeepNonlimitShapes: 0
8120 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8121 # @a Materials (obsolete parameters): empty
8123 # @note I.e. the following two operations are equivalent:
8125 # Result = geompy.MakeHalfPartition(Object, Plane)
8126 # Result = geompy.MakePartition([Object], [Plane])
8129 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8131 # @ref tui_partition "Example"
8132 @ManageTransactions("BoolOp")
8133 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8135 Perform partition of the Shape with the Plane
8138 theShape Shape to be intersected.
8139 thePlane Tool shape, to intersect theShape.
8140 theName Object name; when specified, this parameter is used
8141 for result publication in the study. Otherwise, if automatic
8142 publication is switched on, default value is used for result name.
8145 New GEOM.GEOM_Object, containing the result shape.
8147 Note: This operation is a shortcut to the more general MakePartition
8148 operation, where theShape specifies single "object" (shape being partitioned)
8149 and thePlane specifies single "tool" (intersector shape). Other parameters of
8150 MakePartition operation have default values:
8151 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8152 - KeepNonlimitShapes: 0
8153 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8155 I.e. the following two operations are equivalent:
8156 Result = geompy.MakeHalfPartition(Object, Plane)
8157 Result = geompy.MakePartition([Object], [Plane])
8159 # Example: see GEOM_TestAll.py
8160 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8161 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8162 self._autoPublish(anObj, theName, "partition")
8165 # end of l3_basic_op
8168 ## @addtogroup l3_transform
8171 ## Translate the given object along the vector, specified
8172 # by its end points.
8173 # @param theObject The object to be translated.
8174 # @param thePoint1 Start point of translation vector.
8175 # @param thePoint2 End point of translation vector.
8176 # @param theCopy Flag used to translate object itself or create a copy.
8177 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8178 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8179 @ManageTransactions("TrsfOp")
8180 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8182 Translate the given object along the vector, specified by its end points.
8185 theObject The object to be translated.
8186 thePoint1 Start point of translation vector.
8187 thePoint2 End point of translation vector.
8188 theCopy Flag used to translate object itself or create a copy.
8191 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8192 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8195 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8197 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8198 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8201 ## Translate the given object along the vector, specified
8202 # by its end points, creating its copy before the translation.
8203 # @param theObject The object to be translated.
8204 # @param thePoint1 Start point of translation vector.
8205 # @param thePoint2 End point of translation vector.
8206 # @param theName Object name; when specified, this parameter is used
8207 # for result publication in the study. Otherwise, if automatic
8208 # publication is switched on, default value is used for result name.
8210 # @return New GEOM.GEOM_Object, containing the translated object.
8212 # @ref tui_translation "Example 1"
8213 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8214 @ManageTransactions("TrsfOp")
8215 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8217 Translate the given object along the vector, specified
8218 by its end points, creating its copy before the translation.
8221 theObject The object to be translated.
8222 thePoint1 Start point of translation vector.
8223 thePoint2 End point of translation vector.
8224 theName Object name; when specified, this parameter is used
8225 for result publication in the study. Otherwise, if automatic
8226 publication is switched on, default value is used for result name.
8229 New GEOM.GEOM_Object, containing the translated object.
8231 # Example: see GEOM_TestAll.py
8232 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8233 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8234 self._autoPublish(anObj, theName, "translated")
8237 ## Translate the given object along the vector, specified by its components.
8238 # @param theObject The object to be translated.
8239 # @param theDX,theDY,theDZ Components of translation vector.
8240 # @param theCopy Flag used to translate object itself or create a copy.
8241 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8242 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8244 # @ref tui_translation "Example"
8245 @ManageTransactions("TrsfOp")
8246 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8248 Translate the given object along the vector, specified by its components.
8251 theObject The object to be translated.
8252 theDX,theDY,theDZ Components of translation vector.
8253 theCopy Flag used to translate object itself or create a copy.
8256 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8257 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8259 # Example: see GEOM_TestAll.py
8260 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8262 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8264 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8265 anObj.SetParameters(Parameters)
8266 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8269 ## Translate the given object along the vector, specified
8270 # by its components, creating its copy before the translation.
8271 # @param theObject The object to be translated.
8272 # @param theDX,theDY,theDZ Components of translation vector.
8273 # @param theName Object name; when specified, this parameter is used
8274 # for result publication in the study. Otherwise, if automatic
8275 # publication is switched on, default value is used for result name.
8277 # @return New GEOM.GEOM_Object, containing the translated object.
8279 # @ref tui_translation "Example"
8280 @ManageTransactions("TrsfOp")
8281 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8283 Translate the given object along the vector, specified
8284 by its components, creating its copy before the translation.
8287 theObject The object to be translated.
8288 theDX,theDY,theDZ Components of translation vector.
8289 theName Object name; when specified, this parameter is used
8290 for result publication in the study. Otherwise, if automatic
8291 publication is switched on, default value is used for result name.
8294 New GEOM.GEOM_Object, containing the translated object.
8296 # Example: see GEOM_TestAll.py
8297 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8298 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8299 anObj.SetParameters(Parameters)
8300 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8301 self._autoPublish(anObj, theName, "translated")
8304 ## Translate the given object along the given vector.
8305 # @param theObject The object to be translated.
8306 # @param theVector The translation vector.
8307 # @param theCopy Flag used to translate object itself or create a copy.
8308 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8309 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8310 @ManageTransactions("TrsfOp")
8311 def TranslateVector(self, theObject, theVector, theCopy=False):
8313 Translate the given object along the given vector.
8316 theObject The object to be translated.
8317 theVector The translation vector.
8318 theCopy Flag used to translate object itself or create a copy.
8321 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8322 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8325 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8327 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8328 RaiseIfFailed("TranslateVector", self.TrsfOp)
8331 ## Translate the given object along the given vector,
8332 # creating its copy before the translation.
8333 # @param theObject The object to be translated.
8334 # @param theVector The translation vector.
8335 # @param theName Object name; when specified, this parameter is used
8336 # for result publication in the study. Otherwise, if automatic
8337 # publication is switched on, default value is used for result name.
8339 # @return New GEOM.GEOM_Object, containing the translated object.
8341 # @ref tui_translation "Example"
8342 @ManageTransactions("TrsfOp")
8343 def MakeTranslationVector(self, theObject, theVector, theName=None):
8345 Translate the given object along the given vector,
8346 creating its copy before the translation.
8349 theObject The object to be translated.
8350 theVector The translation vector.
8351 theName Object name; when specified, this parameter is used
8352 for result publication in the study. Otherwise, if automatic
8353 publication is switched on, default value is used for result name.
8356 New GEOM.GEOM_Object, containing the translated object.
8358 # Example: see GEOM_TestAll.py
8359 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8360 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8361 self._autoPublish(anObj, theName, "translated")
8364 ## Translate the given object along the given vector on given distance.
8365 # @param theObject The object to be translated.
8366 # @param theVector The translation vector.
8367 # @param theDistance The translation distance.
8368 # @param theCopy Flag used to translate object itself or create a copy.
8369 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8370 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8372 # @ref tui_translation "Example"
8373 @ManageTransactions("TrsfOp")
8374 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8376 Translate the given object along the given vector on given distance.
8379 theObject The object to be translated.
8380 theVector The translation vector.
8381 theDistance The translation distance.
8382 theCopy Flag used to translate object itself or create a copy.
8385 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8386 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8388 # Example: see GEOM_TestAll.py
8389 theDistance,Parameters = ParseParameters(theDistance)
8390 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8391 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8392 anObj.SetParameters(Parameters)
8395 ## Translate the given object along the given vector on given distance,
8396 # creating its copy before the translation.
8397 # @param theObject The object to be translated.
8398 # @param theVector The translation vector.
8399 # @param theDistance The translation distance.
8400 # @param theName Object name; when specified, this parameter is used
8401 # for result publication in the study. Otherwise, if automatic
8402 # publication is switched on, default value is used for result name.
8404 # @return New GEOM.GEOM_Object, containing the translated object.
8406 # @ref tui_translation "Example"
8407 @ManageTransactions("TrsfOp")
8408 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8410 Translate the given object along the given vector on given distance,
8411 creating its copy before the translation.
8414 theObject The object to be translated.
8415 theVector The translation vector.
8416 theDistance The translation distance.
8417 theName Object name; when specified, this parameter is used
8418 for result publication in the study. Otherwise, if automatic
8419 publication is switched on, default value is used for result name.
8422 New GEOM.GEOM_Object, containing the translated object.
8424 # Example: see GEOM_TestAll.py
8425 theDistance,Parameters = ParseParameters(theDistance)
8426 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8427 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8428 anObj.SetParameters(Parameters)
8429 self._autoPublish(anObj, theName, "translated")
8432 ## Rotate the given object around the given axis on the given angle.
8433 # @param theObject The object to be rotated.
8434 # @param theAxis Rotation axis.
8435 # @param theAngle Rotation angle in radians.
8436 # @param theCopy Flag used to rotate object itself or create a copy.
8438 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8439 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8441 # @ref tui_rotation "Example"
8442 @ManageTransactions("TrsfOp")
8443 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8445 Rotate the given object around the given axis on the given angle.
8448 theObject The object to be rotated.
8449 theAxis Rotation axis.
8450 theAngle Rotation angle in radians.
8451 theCopy Flag used to rotate object itself or create a copy.
8454 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8455 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8457 # Example: see GEOM_TestAll.py
8459 if isinstance(theAngle,str):
8461 theAngle, Parameters = ParseParameters(theAngle)
8463 theAngle = theAngle*math.pi/180.0
8465 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8467 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8468 RaiseIfFailed("Rotate", self.TrsfOp)
8469 anObj.SetParameters(Parameters)
8472 ## Rotate the given object around the given axis
8473 # on the given angle, creating its copy before the rotation.
8474 # @param theObject The object to be rotated.
8475 # @param theAxis Rotation axis.
8476 # @param theAngle Rotation angle in radians.
8477 # @param theName Object name; when specified, this parameter is used
8478 # for result publication in the study. Otherwise, if automatic
8479 # publication is switched on, default value is used for result name.
8481 # @return New GEOM.GEOM_Object, containing the rotated object.
8483 # @ref tui_rotation "Example"
8484 @ManageTransactions("TrsfOp")
8485 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8487 Rotate the given object around the given axis
8488 on the given angle, creating its copy before the rotatation.
8491 theObject The object to be rotated.
8492 theAxis Rotation axis.
8493 theAngle Rotation angle in radians.
8494 theName Object name; when specified, this parameter is used
8495 for result publication in the study. Otherwise, if automatic
8496 publication is switched on, default value is used for result name.
8499 New GEOM.GEOM_Object, containing the rotated object.
8501 # Example: see GEOM_TestAll.py
8503 if isinstance(theAngle,str):
8505 theAngle, Parameters = ParseParameters(theAngle)
8507 theAngle = theAngle*math.pi/180.0
8508 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8509 RaiseIfFailed("RotateCopy", self.TrsfOp)
8510 anObj.SetParameters(Parameters)
8511 self._autoPublish(anObj, theName, "rotated")
8514 ## Rotate given object around vector perpendicular to plane
8515 # containing three points.
8516 # @param theObject The object to be rotated.
8517 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8518 # containing the three points.
8519 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8520 # @param theCopy Flag used to rotate object itself or create a copy.
8521 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8522 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8523 @ManageTransactions("TrsfOp")
8524 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8526 Rotate given object around vector perpendicular to plane
8527 containing three points.
8530 theObject The object to be rotated.
8531 theCentPoint central point the axis is the vector perpendicular to the plane
8532 containing the three points.
8533 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8534 theCopy Flag used to rotate object itself or create a copy.
8537 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8538 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8541 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8543 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8544 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8547 ## Rotate given object around vector perpendicular to plane
8548 # containing three points, creating its copy before the rotatation.
8549 # @param theObject The object to be rotated.
8550 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8551 # containing the three points.
8552 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8553 # @param theName Object name; when specified, this parameter is used
8554 # for result publication in the study. Otherwise, if automatic
8555 # publication is switched on, default value is used for result name.
8557 # @return New GEOM.GEOM_Object, containing the rotated object.
8559 # @ref tui_rotation "Example"
8560 @ManageTransactions("TrsfOp")
8561 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8563 Rotate given object around vector perpendicular to plane
8564 containing three points, creating its copy before the rotatation.
8567 theObject The object to be rotated.
8568 theCentPoint central point the axis is the vector perpendicular to the plane
8569 containing the three points.
8570 thePoint1,thePoint2 in a perpendicular plane of the axis.
8571 theName Object name; when specified, this parameter is used
8572 for result publication in the study. Otherwise, if automatic
8573 publication is switched on, default value is used for result name.
8576 New GEOM.GEOM_Object, containing the rotated object.
8578 # Example: see GEOM_TestAll.py
8579 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8580 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8581 self._autoPublish(anObj, theName, "rotated")
8584 ## Scale the given object by the specified factor.
8585 # @param theObject The object to be scaled.
8586 # @param thePoint Center point for scaling.
8587 # Passing None for it means scaling relatively the origin of global CS.
8588 # @param theFactor Scaling factor value.
8589 # @param theCopy Flag used to scale object itself or create a copy.
8590 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8591 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8592 @ManageTransactions("TrsfOp")
8593 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8595 Scale the given object by the specified factor.
8598 theObject The object to be scaled.
8599 thePoint Center point for scaling.
8600 Passing None for it means scaling relatively the origin of global CS.
8601 theFactor Scaling factor value.
8602 theCopy Flag used to scale object itself or create a copy.
8605 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8606 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8608 # Example: see GEOM_TestAll.py
8609 theFactor, Parameters = ParseParameters(theFactor)
8611 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8613 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8614 RaiseIfFailed("Scale", self.TrsfOp)
8615 anObj.SetParameters(Parameters)
8618 ## Scale the given object by the factor, creating its copy before the scaling.
8619 # @param theObject The object to be scaled.
8620 # @param thePoint Center point for scaling.
8621 # Passing None for it means scaling relatively the origin of global CS.
8622 # @param theFactor Scaling factor value.
8623 # @param theName Object name; when specified, this parameter is used
8624 # for result publication in the study. Otherwise, if automatic
8625 # publication is switched on, default value is used for result name.
8627 # @return New GEOM.GEOM_Object, containing the scaled shape.
8629 # @ref tui_scale "Example"
8630 @ManageTransactions("TrsfOp")
8631 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8633 Scale the given object by the factor, creating its copy before the scaling.
8636 theObject The object to be scaled.
8637 thePoint Center point for scaling.
8638 Passing None for it means scaling relatively the origin of global CS.
8639 theFactor Scaling factor value.
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 the scaled shape.
8647 # Example: see GEOM_TestAll.py
8648 theFactor, Parameters = ParseParameters(theFactor)
8649 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8650 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8651 anObj.SetParameters(Parameters)
8652 self._autoPublish(anObj, theName, "scaled")
8655 ## Scale the given object by different factors along coordinate axes.
8656 # @param theObject The object to be scaled.
8657 # @param thePoint Center point for scaling.
8658 # Passing None for it means scaling relatively the origin of global CS.
8659 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8660 # @param theCopy Flag used to scale object itself or create a copy.
8661 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8662 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8663 @ManageTransactions("TrsfOp")
8664 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8666 Scale the given object by different factors along coordinate axes.
8669 theObject The object to be scaled.
8670 thePoint Center point for scaling.
8671 Passing None for it means scaling relatively the origin of global CS.
8672 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8673 theCopy Flag used to scale object itself or create a copy.
8676 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8677 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8679 # Example: see GEOM_TestAll.py
8680 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8682 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8683 theFactorX, theFactorY, theFactorZ)
8685 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8686 theFactorX, theFactorY, theFactorZ)
8687 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8688 anObj.SetParameters(Parameters)
8691 ## Scale the given object by different factors along coordinate axes,
8692 # creating its copy before the scaling.
8693 # @param theObject The object to be scaled.
8694 # @param thePoint Center point for scaling.
8695 # Passing None for it means scaling relatively the origin of global CS.
8696 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8697 # @param theName Object name; when specified, this parameter is used
8698 # for result publication in the study. Otherwise, if automatic
8699 # publication is switched on, default value is used for result name.
8701 # @return New GEOM.GEOM_Object, containing the scaled shape.
8703 # @ref swig_scale "Example"
8704 @ManageTransactions("TrsfOp")
8705 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8707 Scale the given object by different factors along coordinate axes,
8708 creating its copy before the scaling.
8711 theObject The object to be scaled.
8712 thePoint Center point for scaling.
8713 Passing None for it means scaling relatively the origin of global CS.
8714 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8715 theName Object name; when specified, this parameter is used
8716 for result publication in the study. Otherwise, if automatic
8717 publication is switched on, default value is used for result name.
8720 New GEOM.GEOM_Object, containing the scaled shape.
8722 # Example: see GEOM_TestAll.py
8723 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8724 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8725 theFactorX, theFactorY, theFactorZ)
8726 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8727 anObj.SetParameters(Parameters)
8728 self._autoPublish(anObj, theName, "scaled")
8731 ## Mirror an object relatively the given plane.
8732 # @param theObject The object to be mirrored.
8733 # @param thePlane Plane of symmetry.
8734 # @param theCopy Flag used to mirror object itself or create a copy.
8735 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8736 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8737 @ManageTransactions("TrsfOp")
8738 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8740 Mirror an object relatively the given plane.
8743 theObject The object to be mirrored.
8744 thePlane Plane of symmetry.
8745 theCopy Flag used to mirror object itself or create a copy.
8748 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8749 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8752 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8754 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8755 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8758 ## Create an object, symmetrical
8759 # to the given one relatively the given plane.
8760 # @param theObject The object to be mirrored.
8761 # @param thePlane Plane of symmetry.
8762 # @param theName Object name; when specified, this parameter is used
8763 # for result publication in the study. Otherwise, if automatic
8764 # publication is switched on, default value is used for result name.
8766 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8768 # @ref tui_mirror "Example"
8769 @ManageTransactions("TrsfOp")
8770 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8772 Create an object, symmetrical to the given one relatively the given plane.
8775 theObject The object to be mirrored.
8776 thePlane Plane of symmetry.
8777 theName Object name; when specified, this parameter is used
8778 for result publication in the study. Otherwise, if automatic
8779 publication is switched on, default value is used for result name.
8782 New GEOM.GEOM_Object, containing the mirrored shape.
8784 # Example: see GEOM_TestAll.py
8785 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8786 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8787 self._autoPublish(anObj, theName, "mirrored")
8790 ## Mirror an object relatively the given axis.
8791 # @param theObject The object to be mirrored.
8792 # @param theAxis Axis of symmetry.
8793 # @param theCopy Flag used to mirror object itself or create a copy.
8794 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8795 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8796 @ManageTransactions("TrsfOp")
8797 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8799 Mirror an object relatively the given axis.
8802 theObject The object to be mirrored.
8803 theAxis Axis of symmetry.
8804 theCopy Flag used to mirror object itself or create a copy.
8807 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8808 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8811 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8813 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8814 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8817 ## Create an object, symmetrical
8818 # to the given one relatively the given axis.
8819 # @param theObject The object to be mirrored.
8820 # @param theAxis Axis of symmetry.
8821 # @param theName Object name; when specified, this parameter is used
8822 # for result publication in the study. Otherwise, if automatic
8823 # publication is switched on, default value is used for result name.
8825 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8827 # @ref tui_mirror "Example"
8828 @ManageTransactions("TrsfOp")
8829 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8831 Create an object, symmetrical to the given one relatively the given axis.
8834 theObject The object to be mirrored.
8835 theAxis Axis of symmetry.
8836 theName Object name; when specified, this parameter is used
8837 for result publication in the study. Otherwise, if automatic
8838 publication is switched on, default value is used for result name.
8841 New GEOM.GEOM_Object, containing the mirrored shape.
8843 # Example: see GEOM_TestAll.py
8844 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8845 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8846 self._autoPublish(anObj, theName, "mirrored")
8849 ## Mirror an object relatively the given point.
8850 # @param theObject The object to be mirrored.
8851 # @param thePoint Point of symmetry.
8852 # @param theCopy Flag used to mirror object itself or create a copy.
8853 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8854 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8855 @ManageTransactions("TrsfOp")
8856 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8858 Mirror an object relatively the given point.
8861 theObject The object to be mirrored.
8862 thePoint Point of symmetry.
8863 theCopy Flag used to mirror object itself or create a copy.
8866 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8867 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8869 # Example: see GEOM_TestAll.py
8871 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8873 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8874 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8877 ## Create an object, symmetrical
8878 # to the given one relatively the given point.
8879 # @param theObject The object to be mirrored.
8880 # @param thePoint Point of symmetry.
8881 # @param theName Object name; when specified, this parameter is used
8882 # for result publication in the study. Otherwise, if automatic
8883 # publication is switched on, default value is used for result name.
8885 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8887 # @ref tui_mirror "Example"
8888 @ManageTransactions("TrsfOp")
8889 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8891 Create an object, symmetrical
8892 to the given one relatively the given point.
8895 theObject The object to be mirrored.
8896 thePoint Point of symmetry.
8897 theName Object name; when specified, this parameter is used
8898 for result publication in the study. Otherwise, if automatic
8899 publication is switched on, default value is used for result name.
8902 New GEOM.GEOM_Object, containing the mirrored shape.
8904 # Example: see GEOM_TestAll.py
8905 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8906 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8907 self._autoPublish(anObj, theName, "mirrored")
8910 ## Modify the location of the given object.
8911 # @param theObject The object to be displaced.
8912 # @param theStartLCS Coordinate system to perform displacement from it.\n
8913 # If \a theStartLCS is NULL, displacement
8914 # will be performed from global CS.\n
8915 # If \a theObject itself is used as \a theStartLCS,
8916 # its location will be changed to \a theEndLCS.
8917 # @param theEndLCS Coordinate system to perform displacement to it.
8918 # @param theCopy Flag used to displace object itself or create a copy.
8919 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8920 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8921 @ManageTransactions("TrsfOp")
8922 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8924 Modify the Location of the given object by LCS, creating its copy before the setting.
8927 theObject The object to be displaced.
8928 theStartLCS Coordinate system to perform displacement from it.
8929 If theStartLCS is NULL, displacement
8930 will be performed from global CS.
8931 If theObject itself is used as theStartLCS,
8932 its location will be changed to theEndLCS.
8933 theEndLCS Coordinate system to perform displacement to it.
8934 theCopy Flag used to displace object itself or create a copy.
8937 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8938 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8940 # Example: see GEOM_TestAll.py
8942 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8944 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8945 RaiseIfFailed("Displace", self.TrsfOp)
8948 ## Modify the Location of the given object by LCS,
8949 # creating its copy before the setting.
8950 # @param theObject The object to be displaced.
8951 # @param theStartLCS Coordinate system to perform displacement from it.\n
8952 # If \a theStartLCS is NULL, displacement
8953 # will be performed from global CS.\n
8954 # If \a theObject itself is used as \a theStartLCS,
8955 # its location will be changed to \a theEndLCS.
8956 # @param theEndLCS Coordinate system to perform displacement to it.
8957 # @param theName Object name; when specified, this parameter is used
8958 # for result publication in the study. Otherwise, if automatic
8959 # publication is switched on, default value is used for result name.
8961 # @return New GEOM.GEOM_Object, containing the displaced shape.
8963 # @ref tui_modify_location "Example"
8964 @ManageTransactions("TrsfOp")
8965 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8967 Modify the Location of the given object by LCS, creating its copy before the setting.
8970 theObject The object to be displaced.
8971 theStartLCS Coordinate system to perform displacement from it.
8972 If theStartLCS is NULL, displacement
8973 will be performed from global CS.
8974 If theObject itself is used as theStartLCS,
8975 its location will be changed to theEndLCS.
8976 theEndLCS Coordinate system to perform displacement to it.
8977 theName Object name; when specified, this parameter is used
8978 for result publication in the study. Otherwise, if automatic
8979 publication is switched on, default value is used for result name.
8982 New GEOM.GEOM_Object, containing the displaced shape.
8985 # create local coordinate systems
8986 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8987 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8988 # modify the location of the given object
8989 position = geompy.MakePosition(cylinder, cs1, cs2)
8991 # Example: see GEOM_TestAll.py
8992 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8993 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8994 self._autoPublish(anObj, theName, "displaced")
8997 ## Modify the Location of the given object by Path.
8998 # @param theObject The object to be displaced.
8999 # @param thePath Wire or Edge along that the object will be translated.
9000 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9001 # @param theCopy is to create a copy objects if true.
9002 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9003 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9004 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9006 # @ref tui_modify_location "Example"
9007 @ManageTransactions("TrsfOp")
9008 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9010 Modify the Location of the given object by Path.
9013 theObject The object to be displaced.
9014 thePath Wire or Edge along that the object will be translated.
9015 theDistance progress of Path (0 = start location, 1 = end of path location).
9016 theCopy is to create a copy objects if true.
9017 theReverse 0 - for usual direction, 1 - to reverse path direction.
9020 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9021 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9024 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9026 # Example: see GEOM_TestAll.py
9027 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9028 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9031 ## Modify the Location of the given object by Path, creating its copy before the operation.
9032 # @param theObject The object to be displaced.
9033 # @param thePath Wire or Edge along that the object will be translated.
9034 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9035 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9036 # @param theName Object name; when specified, this parameter is used
9037 # for result publication in the study. Otherwise, if automatic
9038 # publication is switched on, default value is used for result name.
9040 # @return New GEOM.GEOM_Object, containing the displaced shape.
9041 @ManageTransactions("TrsfOp")
9042 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9044 Modify the Location of the given object by Path, creating its copy before the operation.
9047 theObject The object to be displaced.
9048 thePath Wire or Edge along that the object will be translated.
9049 theDistance progress of Path (0 = start location, 1 = end of path location).
9050 theReverse 0 - for usual direction, 1 - to reverse path direction.
9051 theName Object name; when specified, this parameter is used
9052 for result publication in the study. Otherwise, if automatic
9053 publication is switched on, default value is used for result name.
9056 New GEOM.GEOM_Object, containing the displaced shape.
9058 # Example: see GEOM_TestAll.py
9059 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9060 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9061 self._autoPublish(anObj, theName, "displaced")
9064 ## Offset given shape.
9065 # @param theObject The base object for the offset.
9066 # @param theOffset Offset value.
9067 # @param theCopy Flag used to offset object itself or create a copy.
9068 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9069 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9070 @ManageTransactions("TrsfOp")
9071 def Offset(self, theObject, theOffset, theCopy=False):
9076 theObject The base object for the offset.
9077 theOffset Offset value.
9078 theCopy Flag used to offset object itself or create a copy.
9081 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9082 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9084 theOffset, Parameters = ParseParameters(theOffset)
9086 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
9088 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
9089 RaiseIfFailed("Offset", self.TrsfOp)
9090 anObj.SetParameters(Parameters)
9093 ## Create new object as offset of the given one.
9094 # @param theObject The base object for the offset.
9095 # @param theOffset Offset value.
9096 # @param theName Object name; when specified, this parameter is used
9097 # for result publication in the study. Otherwise, if automatic
9098 # publication is switched on, default value is used for result name.
9100 # @return New GEOM.GEOM_Object, containing the offset object.
9102 # @ref tui_offset "Example"
9103 @ManageTransactions("TrsfOp")
9104 def MakeOffset(self, theObject, theOffset, theName=None):
9106 Create new object as offset of the given one.
9109 theObject The base object for the offset.
9110 theOffset Offset value.
9111 theName Object name; when specified, this parameter is used
9112 for result publication in the study. Otherwise, if automatic
9113 publication is switched on, default value is used for result name.
9116 New GEOM.GEOM_Object, containing the offset object.
9119 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9120 # create a new object as offset of the given object
9121 offset = geompy.MakeOffset(box, 70.)
9123 # Example: see GEOM_TestAll.py
9124 theOffset, Parameters = ParseParameters(theOffset)
9125 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
9126 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9127 anObj.SetParameters(Parameters)
9128 self._autoPublish(anObj, theName, "offset")
9131 ## Create new object as projection of the given one on another.
9132 # @param theSource The source object for the projection. It can be a point, edge or wire.
9133 # Edge and wire are acceptable if @a theTarget is a face.
9134 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9135 # @param theName Object name; when specified, this parameter is used
9136 # for result publication in the study. Otherwise, if automatic
9137 # publication is switched on, default value is used for result name.
9139 # @return New GEOM.GEOM_Object, containing the projection.
9141 # @ref tui_projection "Example"
9142 @ManageTransactions("TrsfOp")
9143 def MakeProjection(self, theSource, theTarget, theName=None):
9145 Create new object as projection of the given one on another.
9148 theSource The source object for the projection. It can be a point, edge or wire.
9149 Edge and wire are acceptable if theTarget is a face.
9150 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9151 theName Object name; when specified, this parameter is used
9152 for result publication in the study. Otherwise, if automatic
9153 publication is switched on, default value is used for result name.
9156 New GEOM.GEOM_Object, containing the projection.
9158 # Example: see GEOM_TestAll.py
9159 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9160 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9161 self._autoPublish(anObj, theName, "projection")
9164 ## Create a projection of the given point on a wire or an edge.
9165 # If there are no solutions or there are 2 or more solutions It throws an
9167 # @param thePoint the point to be projected.
9168 # @param theWire the wire. The edge is accepted as well.
9169 # @param theName Object name; when specified, this parameter is used
9170 # for result publication in the study. Otherwise, if automatic
9171 # publication is switched on, default value is used for result name.
9173 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9174 # \n \a u: The parameter of projection point on edge.
9175 # \n \a PointOnEdge: The projection point.
9176 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9178 # @ref tui_projection "Example"
9179 @ManageTransactions("TrsfOp")
9180 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9182 Create a projection of the given point on a wire or an edge.
9183 If there are no solutions or there are 2 or more solutions It throws an
9187 thePoint the point to be projected.
9188 theWire the wire. The edge is accepted as well.
9189 theName Object name; when specified, this parameter is used
9190 for result publication in the study. Otherwise, if automatic
9191 publication is switched on, default value is used for result name.
9194 [u, PointOnEdge, EdgeInWireIndex]
9195 u: The parameter of projection point on edge.
9196 PointOnEdge: The projection point.
9197 EdgeInWireIndex: The index of an edge in a wire.
9199 # Example: see GEOM_TestAll.py
9200 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9201 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9202 self._autoPublish(anObj[1], theName, "projection")
9205 # -----------------------------------------------------------------------------
9207 # -----------------------------------------------------------------------------
9209 ## Translate the given object along the given vector a given number times
9210 # @param theObject The object to be translated.
9211 # @param theVector Direction of the translation. DX if None.
9212 # @param theStep Distance to translate on.
9213 # @param theNbTimes Quantity of translations to be done.
9214 # @param theName Object name; when specified, this parameter is used
9215 # for result publication in the study. Otherwise, if automatic
9216 # publication is switched on, default value is used for result name.
9218 # @return New GEOM.GEOM_Object, containing compound of all
9219 # the shapes, obtained after each translation.
9221 # @ref tui_multi_translation "Example"
9222 @ManageTransactions("TrsfOp")
9223 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9225 Translate the given object along the given vector a given number times
9228 theObject The object to be translated.
9229 theVector Direction of the translation. DX if None.
9230 theStep Distance to translate on.
9231 theNbTimes Quantity of translations to be done.
9232 theName Object name; when specified, this parameter is used
9233 for result publication in the study. Otherwise, if automatic
9234 publication is switched on, default value is used for result name.
9237 New GEOM.GEOM_Object, containing compound of all
9238 the shapes, obtained after each translation.
9241 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9243 # Example: see GEOM_TestAll.py
9244 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9245 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9246 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9247 anObj.SetParameters(Parameters)
9248 self._autoPublish(anObj, theName, "multitranslation")
9251 ## Conseqently apply two specified translations to theObject specified number of times.
9252 # @param theObject The object to be translated.
9253 # @param theVector1 Direction of the first translation. DX if None.
9254 # @param theStep1 Step of the first translation.
9255 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9256 # @param theVector2 Direction of the second translation. DY if None.
9257 # @param theStep2 Step of the second translation.
9258 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9259 # @param theName Object name; when specified, this parameter is used
9260 # for result publication in the study. Otherwise, if automatic
9261 # publication is switched on, default value is used for result name.
9263 # @return New GEOM.GEOM_Object, containing compound of all
9264 # the shapes, obtained after each translation.
9266 # @ref tui_multi_translation "Example"
9267 @ManageTransactions("TrsfOp")
9268 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9269 theVector2, theStep2, theNbTimes2, theName=None):
9271 Conseqently apply two specified translations to theObject specified number of times.
9274 theObject The object to be translated.
9275 theVector1 Direction of the first translation. DX if None.
9276 theStep1 Step of the first translation.
9277 theNbTimes1 Quantity of translations to be done along theVector1.
9278 theVector2 Direction of the second translation. DY if None.
9279 theStep2 Step of the second translation.
9280 theNbTimes2 Quantity of translations to be done along theVector2.
9281 theName Object name; when specified, this parameter is used
9282 for result publication in the study. Otherwise, if automatic
9283 publication is switched on, default value is used for result name.
9286 New GEOM.GEOM_Object, containing compound of all
9287 the shapes, obtained after each translation.
9290 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9292 # Example: see GEOM_TestAll.py
9293 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9294 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9295 theVector2, theStep2, theNbTimes2)
9296 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9297 anObj.SetParameters(Parameters)
9298 self._autoPublish(anObj, theName, "multitranslation")
9301 ## Rotate the given object around the given axis a given number times.
9302 # Rotation angle will be 2*PI/theNbTimes.
9303 # @param theObject The object to be rotated.
9304 # @param theAxis The rotation axis. DZ if None.
9305 # @param theNbTimes Quantity of rotations to be done.
9306 # @param theName Object name; when specified, this parameter is used
9307 # for result publication in the study. Otherwise, if automatic
9308 # publication is switched on, default value is used for result name.
9310 # @return New GEOM.GEOM_Object, containing compound of all the
9311 # shapes, obtained after each rotation.
9313 # @ref tui_multi_rotation "Example"
9314 @ManageTransactions("TrsfOp")
9315 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9317 Rotate the given object around the given axis a given number times.
9318 Rotation angle will be 2*PI/theNbTimes.
9321 theObject The object to be rotated.
9322 theAxis The rotation axis. DZ if None.
9323 theNbTimes Quantity of rotations to be done.
9324 theName Object name; when specified, this parameter is used
9325 for result publication in the study. Otherwise, if automatic
9326 publication is switched on, default value is used for result name.
9329 New GEOM.GEOM_Object, containing compound of all the
9330 shapes, obtained after each rotation.
9333 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9335 # Example: see GEOM_TestAll.py
9336 theNbTimes, Parameters = ParseParameters(theNbTimes)
9337 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9338 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9339 anObj.SetParameters(Parameters)
9340 self._autoPublish(anObj, theName, "multirotation")
9343 ## Rotate the given object around the given axis
9344 # a given number times on the given angle.
9345 # @param theObject The object to be rotated.
9346 # @param theAxis The rotation axis. DZ if None.
9347 # @param theAngleStep Rotation angle in radians.
9348 # @param theNbTimes Quantity of rotations to be done.
9349 # @param theName Object name; when specified, this parameter is used
9350 # for result publication in the study. Otherwise, if automatic
9351 # publication is switched on, default value is used for result name.
9353 # @return New GEOM.GEOM_Object, containing compound of all the
9354 # shapes, obtained after each rotation.
9356 # @ref tui_multi_rotation "Example"
9357 @ManageTransactions("TrsfOp")
9358 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9360 Rotate the given object around the given axis
9361 a given number times on the given angle.
9364 theObject The object to be rotated.
9365 theAxis The rotation axis. DZ if None.
9366 theAngleStep Rotation angle in radians.
9367 theNbTimes Quantity of rotations to be done.
9368 theName Object name; when specified, this parameter is used
9369 for result publication in the study. Otherwise, if automatic
9370 publication is switched on, default value is used for result name.
9373 New GEOM.GEOM_Object, containing compound of all the
9374 shapes, obtained after each rotation.
9377 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9379 # Example: see GEOM_TestAll.py
9380 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9381 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9382 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9383 anObj.SetParameters(Parameters)
9384 self._autoPublish(anObj, theName, "multirotation")
9387 ## Rotate the given object around the given axis a given
9388 # number times and multi-translate each rotation result.
9389 # Rotation angle will be 2*PI/theNbTimes1.
9390 # Translation direction passes through center of gravity
9391 # of rotated shape and its projection on the rotation axis.
9392 # @param theObject The object to be rotated.
9393 # @param theAxis Rotation axis. DZ if None.
9394 # @param theNbTimes1 Quantity of rotations to be done.
9395 # @param theRadialStep Translation distance.
9396 # @param theNbTimes2 Quantity of translations to be done.
9397 # @param theName Object name; when specified, this parameter is used
9398 # for result publication in the study. Otherwise, if automatic
9399 # publication is switched on, default value is used for result name.
9401 # @return New GEOM.GEOM_Object, containing compound of all the
9402 # shapes, obtained after each transformation.
9404 # @ref tui_multi_rotation "Example"
9405 @ManageTransactions("TrsfOp")
9406 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9408 Rotate the given object around the
9409 given axis on the given angle a given number
9410 times and multi-translate each rotation result.
9411 Translation direction passes through center of gravity
9412 of rotated shape and its projection on the rotation axis.
9415 theObject The object to be rotated.
9416 theAxis Rotation axis. DZ if None.
9417 theNbTimes1 Quantity of rotations to be done.
9418 theRadialStep Translation distance.
9419 theNbTimes2 Quantity of translations to be done.
9420 theName Object name; when specified, this parameter is used
9421 for result publication in the study. Otherwise, if automatic
9422 publication is switched on, default value is used for result name.
9425 New GEOM.GEOM_Object, containing compound of all the
9426 shapes, obtained after each transformation.
9429 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9431 # Example: see GEOM_TestAll.py
9432 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9433 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9434 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9435 anObj.SetParameters(Parameters)
9436 self._autoPublish(anObj, theName, "multirotation")
9439 ## Rotate the given object around the
9440 # given axis on the given angle a given number
9441 # times and multi-translate each rotation result.
9442 # Translation direction passes through center of gravity
9443 # of rotated shape and its projection on the rotation axis.
9444 # @param theObject The object to be rotated.
9445 # @param theAxis Rotation axis. DZ if None.
9446 # @param theAngleStep Rotation angle in radians.
9447 # @param theNbTimes1 Quantity of rotations to be done.
9448 # @param theRadialStep Translation distance.
9449 # @param theNbTimes2 Quantity of translations to be done.
9450 # @param theName Object name; when specified, this parameter is used
9451 # for result publication in the study. Otherwise, if automatic
9452 # publication is switched on, default value is used for result name.
9454 # @return New GEOM.GEOM_Object, containing compound of all the
9455 # shapes, obtained after each transformation.
9457 # @ref tui_multi_rotation "Example"
9458 @ManageTransactions("TrsfOp")
9459 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9461 Rotate the given object around the
9462 given axis on the given angle a given number
9463 times and multi-translate each rotation result.
9464 Translation direction passes through center of gravity
9465 of rotated shape and its projection on the rotation axis.
9468 theObject The object to be rotated.
9469 theAxis Rotation axis. DZ if None.
9470 theAngleStep Rotation angle in radians.
9471 theNbTimes1 Quantity of rotations to be done.
9472 theRadialStep Translation distance.
9473 theNbTimes2 Quantity of translations to be done.
9474 theName Object name; when specified, this parameter is used
9475 for result publication in the study. Otherwise, if automatic
9476 publication is switched on, default value is used for result name.
9479 New GEOM.GEOM_Object, containing compound of all the
9480 shapes, obtained after each transformation.
9483 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9485 # Example: see GEOM_TestAll.py
9486 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9487 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9488 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9489 anObj.SetParameters(Parameters)
9490 self._autoPublish(anObj, theName, "multirotation")
9493 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9495 # @ref swig_MakeMultiRotation "Example"
9496 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9498 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9501 pz = geompy.MakeVertex(0, 0, 100)
9502 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9503 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9505 # Example: see GEOM_TestOthers.py
9506 aVec = self.MakeLine(aPoint,aDir)
9507 # note: auto-publishing is done in self.MultiRotate1D()
9508 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9511 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9513 # @ref swig_MakeMultiRotation "Example"
9514 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9516 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9519 pz = geompy.MakeVertex(0, 0, 100)
9520 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9521 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9523 # Example: see GEOM_TestOthers.py
9524 aVec = self.MakeLine(aPoint,aDir)
9525 # note: auto-publishing is done in self.MultiRotate1D()
9526 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9529 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9531 # @ref swig_MakeMultiRotation "Example"
9532 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9534 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9537 pz = geompy.MakeVertex(0, 0, 100)
9538 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9539 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9541 # Example: see GEOM_TestOthers.py
9542 aVec = self.MakeLine(aPoint,aDir)
9543 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9544 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9547 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9549 # @ref swig_MakeMultiRotation "Example"
9550 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9552 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9555 pz = geompy.MakeVertex(0, 0, 100)
9556 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9557 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9559 # Example: see GEOM_TestOthers.py
9560 aVec = self.MakeLine(aPoint,aDir)
9561 # note: auto-publishing is done in self.MultiRotate2D()
9562 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9566 # Compute a wire or a face that represents a projection of the source
9567 # shape onto cylinder. The cylinder's coordinate system is the same
9568 # as the global coordinate system.
9570 # @param theObject The object to be projected. It can be either
9571 # a planar wire or a face.
9572 # @param theRadius The radius of the cylinder.
9573 # @param theStartAngle The starting angle in radians from
9574 # the cylinder's X axis around Z axis. The angle from which
9575 # the projection is started.
9576 # @param theAngleLength The projection length angle in radians.
9577 # The angle in which to project the total length of the wire.
9578 # If it is negative the projection is not scaled and natural
9579 # wire length is kept for the projection.
9580 # @param theName Object name; when specified, this parameter is used
9581 # for result publication in the study. Otherwise, if automatic
9582 # publication is switched on, default value is used for result name.
9584 # @return New GEOM.GEOM_Object, containing the result shape. The result
9585 # represents a wire or a face that represents a projection of
9586 # the source shape onto a cylinder.
9588 # @ref tui_projection "Example"
9589 def MakeProjectionOnCylinder (self, theObject, theRadius,
9590 theStartAngle=0.0, theAngleLength=-1.0,
9593 Compute a wire or a face that represents a projection of the source
9594 shape onto cylinder. The cylinder's coordinate system is the same
9595 as the global coordinate system.
9598 theObject The object to be projected. It can be either
9599 a planar wire or a face.
9600 theRadius The radius of the cylinder.
9601 theStartAngle The starting angle in radians from the cylinder's X axis
9602 around Z axis. The angle from which the projection is started.
9603 theAngleLength The projection length angle in radians. The angle in which
9604 to project the total length of the wire. If it is negative the
9605 projection is not scaled and natural wire length is kept for
9607 theName Object name; when specified, this parameter is used
9608 for result publication in the study. Otherwise, if automatic
9609 publication is switched on, default value is used for result name.
9612 New GEOM.GEOM_Object, containing the result shape. The result
9613 represents a wire or a face that represents a projection of
9614 the source shape onto a cylinder.
9616 # Example: see GEOM_TestAll.py
9617 flagStartAngle = False
9618 if isinstance(theStartAngle,str):
9619 flagStartAngle = True
9620 flagAngleLength = False
9621 if isinstance(theAngleLength,str):
9622 flagAngleLength = True
9623 theRadius, theStartAngle, theAngleLength, Parameters = ParseParameters(
9624 theRadius, theStartAngle, theAngleLength)
9626 theStartAngle = theStartAngle*math.pi/180.
9628 theAngleLength = theAngleLength*math.pi/180.
9629 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9630 theStartAngle, theAngleLength)
9631 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9632 anObj.SetParameters(Parameters)
9633 self._autoPublish(anObj, theName, "projection")
9636 # end of l3_transform
9639 ## @addtogroup l3_transform_d
9642 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9643 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9645 Deprecated method. Use MultiRotate1DNbTimes instead.
9647 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9648 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9650 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9651 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9652 @ManageTransactions("TrsfOp")
9653 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9655 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9656 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9659 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9661 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9662 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9663 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9664 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9665 anObj.SetParameters(Parameters)
9666 self._autoPublish(anObj, theName, "multirotation")
9669 ## The same, as MultiRotate1D(), but axis is given by direction and point
9670 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9671 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9673 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9674 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9677 pz = geompy.MakeVertex(0, 0, 100)
9678 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9679 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9681 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9682 aVec = self.MakeLine(aPoint,aDir)
9683 # note: auto-publishing is done in self.MultiRotate1D()
9684 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9687 ## The same, as MultiRotate2D(), but axis is given by direction and point
9688 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9689 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9691 The same, as MultiRotate2D(), but axis is given by direction and point
9692 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9695 pz = geompy.MakeVertex(0, 0, 100)
9696 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9697 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9699 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9700 aVec = self.MakeLine(aPoint,aDir)
9701 # note: auto-publishing is done in self.MultiRotate2D()
9702 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9705 # end of l3_transform_d
9708 ## @addtogroup l3_local
9711 ## Perform a fillet on all edges of the given shape.
9712 # @param theShape Shape, to perform fillet on.
9713 # @param theR Fillet radius.
9714 # @param theName Object name; when specified, this parameter is used
9715 # for result publication in the study. Otherwise, if automatic
9716 # publication is switched on, default value is used for result name.
9718 # @return New GEOM.GEOM_Object, containing the result shape.
9720 # @ref tui_fillet "Example 1"
9721 # \n @ref swig_MakeFilletAll "Example 2"
9722 @ManageTransactions("LocalOp")
9723 def MakeFilletAll(self, theShape, theR, theName=None):
9725 Perform a fillet on all edges of the given shape.
9728 theShape Shape, to perform fillet on.
9730 theName Object name; when specified, this parameter is used
9731 for result publication in the study. Otherwise, if automatic
9732 publication is switched on, default value is used for result name.
9735 New GEOM.GEOM_Object, containing the result shape.
9738 filletall = geompy.MakeFilletAll(prism, 10.)
9740 # Example: see GEOM_TestOthers.py
9741 theR,Parameters = ParseParameters(theR)
9742 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9743 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9744 anObj.SetParameters(Parameters)
9745 self._autoPublish(anObj, theName, "fillet")
9748 ## Perform a fillet on the specified edges/faces of the given shape
9749 # @param theShape Shape, to perform fillet on.
9750 # @param theR Fillet radius.
9751 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9752 # @param theListShapes Global indices of edges/faces to perform fillet on.
9753 # @param theName Object name; when specified, this parameter is used
9754 # for result publication in the study. Otherwise, if automatic
9755 # publication is switched on, default value is used for result name.
9757 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9759 # @return New GEOM.GEOM_Object, containing the result shape.
9761 # @ref tui_fillet "Example"
9762 @ManageTransactions("LocalOp")
9763 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9765 Perform a fillet on the specified edges/faces of the given shape
9768 theShape Shape, to perform fillet on.
9770 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9771 theListShapes Global indices of edges/faces to perform fillet on.
9772 theName Object name; when specified, this parameter is used
9773 for result publication in the study. Otherwise, if automatic
9774 publication is switched on, default value is used for result name.
9777 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9780 New GEOM.GEOM_Object, containing the result shape.
9783 # get the list of IDs (IDList) for the fillet
9784 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9786 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9787 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9788 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9789 # make a fillet on the specified edges of the given shape
9790 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9792 # Example: see GEOM_TestAll.py
9793 theR,Parameters = ParseParameters(theR)
9795 if theShapeType == self.ShapeType["EDGE"]:
9796 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9797 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9799 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9800 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9801 anObj.SetParameters(Parameters)
9802 self._autoPublish(anObj, theName, "fillet")
9805 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9806 @ManageTransactions("LocalOp")
9807 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9809 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9812 # get the list of IDs (IDList) for the fillet
9813 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9815 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9816 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9817 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9818 # make a fillet on the specified edges of the given shape
9819 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9821 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9823 if theShapeType == self.ShapeType["EDGE"]:
9824 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9825 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9827 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9828 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9829 anObj.SetParameters(Parameters)
9830 self._autoPublish(anObj, theName, "fillet")
9833 ## Perform a fillet on the specified edges of the given shape
9834 # @param theShape Wire Shape to perform fillet on.
9835 # @param theR Fillet radius.
9836 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9837 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9838 # \note The list of vertices could be empty,
9839 # in this case fillet will done done at all vertices in wire
9840 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9841 # by the length of the edges, nearest to the fillet vertex.
9842 # But sometimes the next edge is C1 continuous with the one, nearest to
9843 # the fillet point, and such two (or more) edges can be united to allow
9844 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9845 # thus ignoring the secant vertex (vertices).
9846 # @param theName Object name; when specified, this parameter is used
9847 # for result publication in the study. Otherwise, if automatic
9848 # publication is switched on, default value is used for result name.
9850 # @return New GEOM.GEOM_Object, containing the result shape.
9852 # @ref tui_fillet2d "Example"
9853 @ManageTransactions("LocalOp")
9854 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9856 Perform a fillet on the specified edges of the given shape
9859 theShape Wire Shape to perform fillet on.
9861 theListOfVertexes Global indices of vertexes to perform fillet on.
9862 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9863 by the length of the edges, nearest to the fillet vertex.
9864 But sometimes the next edge is C1 continuous with the one, nearest to
9865 the fillet point, and such two (or more) edges can be united to allow
9866 bigger radius. Set this flag to TRUE to allow collinear edges union,
9867 thus ignoring the secant vertex (vertices).
9868 theName Object name; when specified, this parameter is used
9869 for result publication in the study. Otherwise, if automatic
9870 publication is switched on, default value is used for result name.
9872 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9874 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9877 New GEOM.GEOM_Object, containing the result shape.
9881 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9882 # make fillet at given wire vertices with giver radius
9883 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9885 # Example: see GEOM_TestAll.py
9886 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9887 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9888 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9889 anObj.SetParameters(Parameters)
9890 self._autoPublish(anObj, theName, "fillet")
9893 ## Perform a fillet at the specified vertices of the given face/shell.
9894 # @param theShape Face or Shell shape to perform fillet on.
9895 # @param theR Fillet radius.
9896 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9897 # @param theName Object name; when specified, this parameter is used
9898 # for result publication in the study. Otherwise, if automatic
9899 # publication is switched on, default value is used for result name.
9901 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9903 # @return New GEOM.GEOM_Object, containing the result shape.
9905 # @ref tui_fillet2d "Example"
9906 @ManageTransactions("LocalOp")
9907 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9909 Perform a fillet at the specified vertices of the given face/shell.
9912 theShape Face or Shell shape to perform fillet on.
9914 theListOfVertexes Global indices of vertexes to perform fillet on.
9915 theName Object name; when specified, this parameter is used
9916 for result publication in the study. Otherwise, if automatic
9917 publication is switched on, default value is used for result name.
9919 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9922 New GEOM.GEOM_Object, containing the result shape.
9925 face = geompy.MakeFaceHW(100, 100, 1)
9926 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9928 # Example: see GEOM_TestAll.py
9929 theR,Parameters = ParseParameters(theR)
9930 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9931 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9932 anObj.SetParameters(Parameters)
9933 self._autoPublish(anObj, theName, "fillet")
9936 ## Perform a symmetric chamfer on all edges of the given shape.
9937 # @param theShape Shape, to perform chamfer on.
9938 # @param theD Chamfer size along each face.
9939 # @param theName Object name; when specified, this parameter is used
9940 # for result publication in the study. Otherwise, if automatic
9941 # publication is switched on, default value is used for result name.
9943 # @return New GEOM.GEOM_Object, containing the result shape.
9945 # @ref tui_chamfer "Example 1"
9946 # \n @ref swig_MakeChamferAll "Example 2"
9947 @ManageTransactions("LocalOp")
9948 def MakeChamferAll(self, theShape, theD, theName=None):
9950 Perform a symmetric chamfer on all edges of the given shape.
9953 theShape Shape, to perform chamfer on.
9954 theD Chamfer size along each face.
9955 theName Object name; when specified, this parameter is used
9956 for result publication in the study. Otherwise, if automatic
9957 publication is switched on, default value is used for result name.
9960 New GEOM.GEOM_Object, containing the result shape.
9963 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9965 # Example: see GEOM_TestOthers.py
9966 theD,Parameters = ParseParameters(theD)
9967 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9968 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9969 anObj.SetParameters(Parameters)
9970 self._autoPublish(anObj, theName, "chamfer")
9973 ## Perform a chamfer on edges, common to the specified faces,
9974 # with distance D1 on the Face1
9975 # @param theShape Shape, to perform chamfer on.
9976 # @param theD1 Chamfer size along \a theFace1.
9977 # @param theD2 Chamfer size along \a theFace2.
9978 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9979 # @param theName Object name; when specified, this parameter is used
9980 # for result publication in the study. Otherwise, if automatic
9981 # publication is switched on, default value is used for result name.
9983 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9985 # @return New GEOM.GEOM_Object, containing the result shape.
9987 # @ref tui_chamfer "Example"
9988 @ManageTransactions("LocalOp")
9989 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9991 Perform a chamfer on edges, common to the specified faces,
9992 with distance D1 on the Face1
9995 theShape Shape, to perform chamfer on.
9996 theD1 Chamfer size along theFace1.
9997 theD2 Chamfer size along theFace2.
9998 theFace1,theFace2 Global indices of two faces of theShape.
9999 theName Object name; when specified, this parameter is used
10000 for result publication in the study. Otherwise, if automatic
10001 publication is switched on, default value is used for result name.
10004 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10007 New GEOM.GEOM_Object, containing the result shape.
10010 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10011 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10012 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10013 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10015 # Example: see GEOM_TestAll.py
10016 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10017 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10018 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10019 anObj.SetParameters(Parameters)
10020 self._autoPublish(anObj, theName, "chamfer")
10023 ## Perform a chamfer on edges
10024 # @param theShape Shape, to perform chamfer on.
10025 # @param theD Chamfer length
10026 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10027 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10028 # @param theName Object name; when specified, this parameter is used
10029 # for result publication in the study. Otherwise, if automatic
10030 # publication is switched on, default value is used for result name.
10032 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10034 # @return New GEOM.GEOM_Object, containing the result shape.
10035 @ManageTransactions("LocalOp")
10036 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10038 Perform a chamfer on edges
10041 theShape Shape, to perform chamfer on.
10042 theD1 Chamfer size along theFace1.
10043 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10044 theFace1,theFace2 Global indices of two faces of theShape.
10045 theName Object name; when specified, this parameter is used
10046 for result publication in the study. Otherwise, if automatic
10047 publication is switched on, default value is used for result name.
10050 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10053 New GEOM.GEOM_Object, containing the result shape.
10056 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10057 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10058 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10060 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10063 if isinstance(theAngle,str):
10065 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10067 theAngle = theAngle*math.pi/180.0
10068 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10069 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10070 anObj.SetParameters(Parameters)
10071 self._autoPublish(anObj, theName, "chamfer")
10074 ## Perform a chamfer on all edges of the specified faces,
10075 # with distance D1 on the first specified face (if several for one edge)
10076 # @param theShape Shape, to perform chamfer on.
10077 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10078 # connected to the edge, are in \a theFaces, \a theD1
10079 # will be get along face, which is nearer to \a theFaces beginning.
10080 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10081 # @param theFaces Sequence of global indices of faces of \a theShape.
10082 # @param theName Object name; when specified, this parameter is used
10083 # for result publication in the study. Otherwise, if automatic
10084 # publication is switched on, default value is used for result name.
10086 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10088 # @return New GEOM.GEOM_Object, containing the result shape.
10090 # @ref tui_chamfer "Example"
10091 @ManageTransactions("LocalOp")
10092 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10094 Perform a chamfer on all edges of the specified faces,
10095 with distance D1 on the first specified face (if several for one edge)
10098 theShape Shape, to perform chamfer on.
10099 theD1 Chamfer size along face from theFaces. If both faces,
10100 connected to the edge, are in theFaces, theD1
10101 will be get along face, which is nearer to theFaces beginning.
10102 theD2 Chamfer size along another of two faces, connected to the edge.
10103 theFaces Sequence of global indices of faces of theShape.
10104 theName Object name; when specified, this parameter is used
10105 for result publication in the study. Otherwise, if automatic
10106 publication is switched on, default value is used for result name.
10108 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10111 New GEOM.GEOM_Object, containing the result shape.
10113 # Example: see GEOM_TestAll.py
10114 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10115 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10116 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10117 anObj.SetParameters(Parameters)
10118 self._autoPublish(anObj, theName, "chamfer")
10121 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
10122 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10124 # @ref swig_FilletChamfer "Example"
10125 @ManageTransactions("LocalOp")
10126 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10128 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
10129 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10132 if isinstance(theAngle,str):
10134 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10136 theAngle = theAngle*math.pi/180.0
10137 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10138 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10139 anObj.SetParameters(Parameters)
10140 self._autoPublish(anObj, theName, "chamfer")
10143 ## Perform a chamfer on edges,
10144 # with distance D1 on the first specified face (if several for one edge)
10145 # @param theShape Shape, to perform chamfer on.
10146 # @param theD1,theD2 Chamfer size
10147 # @param theEdges Sequence of edges of \a theShape.
10148 # @param theName Object name; when specified, this parameter is used
10149 # for result publication in the study. Otherwise, if automatic
10150 # publication is switched on, default value is used for result name.
10152 # @return New GEOM.GEOM_Object, containing the result shape.
10154 # @ref swig_FilletChamfer "Example"
10155 @ManageTransactions("LocalOp")
10156 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10158 Perform a chamfer on edges,
10159 with distance D1 on the first specified face (if several for one edge)
10162 theShape Shape, to perform chamfer on.
10163 theD1,theD2 Chamfer size
10164 theEdges Sequence of edges of theShape.
10165 theName Object name; when specified, this parameter is used
10166 for result publication in the study. Otherwise, if automatic
10167 publication is switched on, default value is used for result name.
10170 New GEOM.GEOM_Object, containing the result shape.
10172 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10173 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10174 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10175 anObj.SetParameters(Parameters)
10176 self._autoPublish(anObj, theName, "chamfer")
10179 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
10180 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10181 @ManageTransactions("LocalOp")
10182 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10184 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
10185 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10188 if isinstance(theAngle,str):
10190 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10192 theAngle = theAngle*math.pi/180.0
10193 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10194 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10195 anObj.SetParameters(Parameters)
10196 self._autoPublish(anObj, theName, "chamfer")
10199 ## @sa MakeChamferEdge(), MakeChamferFaces()
10201 # @ref swig_MakeChamfer "Example"
10202 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10204 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10206 # Example: see GEOM_TestOthers.py
10208 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10209 if aShapeType == self.ShapeType["EDGE"]:
10210 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10212 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10215 ## Remove material from a solid by extrusion of the base shape on the given distance.
10216 # @param theInit Shape to remove material from. It must be a solid or
10217 # a compound made of a single solid.
10218 # @param theBase Closed edge or wire defining the base shape to be extruded.
10219 # @param theH Prism dimension along the normal to theBase
10220 # @param theAngle Draft angle in degrees.
10221 # @param theInvert If true material changes the direction
10222 # @param theName Object name; when specified, this parameter is used
10223 # for result publication in the study. Otherwise, if automatic
10224 # publication is switched on, default value is used for result name.
10226 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10228 # @ref tui_creation_prism "Example"
10229 @ManageTransactions("PrimOp")
10230 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10232 Add material to a solid by extrusion of the base shape on the given distance.
10235 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10236 theBase Closed edge or wire defining the base shape to be extruded.
10237 theH Prism dimension along the normal to theBase
10238 theAngle Draft angle in degrees.
10239 theInvert If true material changes the direction.
10240 theName Object name; when specified, this parameter is used
10241 for result publication in the study. Otherwise, if automatic
10242 publication is switched on, default value is used for result name.
10245 New GEOM.GEOM_Object, containing the initial shape with removed material.
10247 # Example: see GEOM_TestAll.py
10248 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10249 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10250 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10251 anObj.SetParameters(Parameters)
10252 self._autoPublish(anObj, theName, "extrudedCut")
10255 ## Add material to a solid by extrusion of the base shape on the given distance.
10256 # @param theInit Shape to add material to. It must be a solid or
10257 # a compound made of a single solid.
10258 # @param theBase Closed edge or wire defining the base shape to be extruded.
10259 # @param theH Prism dimension along the normal to theBase
10260 # @param theAngle Draft angle in degrees.
10261 # @param theInvert If true material changes the direction
10262 # @param theName Object name; when specified, this parameter is used
10263 # for result publication in the study. Otherwise, if automatic
10264 # publication is switched on, default value is used for result name.
10266 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10268 # @ref tui_creation_prism "Example"
10269 @ManageTransactions("PrimOp")
10270 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10272 Add material to a solid by extrusion of the base shape on the given distance.
10275 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10276 theBase Closed edge or wire defining the base shape to be extruded.
10277 theH Prism dimension along the normal to theBase
10278 theAngle Draft angle in degrees.
10279 theInvert If true material changes the direction.
10280 theName Object name; when specified, this parameter is used
10281 for result publication in the study. Otherwise, if automatic
10282 publication is switched on, default value is used for result name.
10285 New GEOM.GEOM_Object, containing the initial shape with added material.
10287 # Example: see GEOM_TestAll.py
10288 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10289 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10290 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10291 anObj.SetParameters(Parameters)
10292 self._autoPublish(anObj, theName, "extrudedBoss")
10298 ## @addtogroup l3_basic_op
10301 ## Perform an Archimde operation on the given shape with given parameters.
10302 # The object presenting the resulting face is returned.
10303 # @param theShape Shape to be put in water.
10304 # @param theWeight Weight of the shape.
10305 # @param theWaterDensity Density of the water.
10306 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10307 # @param theName Object name; when specified, this parameter is used
10308 # for result publication in the study. Otherwise, if automatic
10309 # publication is switched on, default value is used for result name.
10311 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10312 # by a plane, corresponding to water level.
10314 # @ref tui_archimede "Example"
10315 @ManageTransactions("LocalOp")
10316 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10318 Perform an Archimde operation on the given shape with given parameters.
10319 The object presenting the resulting face is returned.
10322 theShape Shape to be put in water.
10323 theWeight Weight of the shape.
10324 theWaterDensity Density of the water.
10325 theMeshDeflection Deflection of the mesh, using to compute the section.
10326 theName Object name; when specified, this parameter is used
10327 for result publication in the study. Otherwise, if automatic
10328 publication is switched on, default value is used for result name.
10331 New GEOM.GEOM_Object, containing a section of theShape
10332 by a plane, corresponding to water level.
10334 # Example: see GEOM_TestAll.py
10335 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10336 theWeight,theWaterDensity,theMeshDeflection)
10337 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10338 RaiseIfFailed("MakeArchimede", self.LocalOp)
10339 anObj.SetParameters(Parameters)
10340 self._autoPublish(anObj, theName, "archimede")
10343 # end of l3_basic_op
10346 ## @addtogroup l2_measure
10349 ## Get point coordinates
10350 # @return [x, y, z]
10352 # @ref tui_point_coordinates_page "Example"
10353 @ManageTransactions("MeasuOp")
10354 def PointCoordinates(self,Point):
10356 Get point coordinates
10361 # Example: see GEOM_TestMeasures.py
10362 aTuple = self.MeasuOp.PointCoordinates(Point)
10363 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10366 ## Get vector coordinates
10367 # @return [x, y, z]
10369 # @ref tui_measurement_tools_page "Example"
10370 def VectorCoordinates(self,Vector):
10372 Get vector coordinates
10378 p1=self.GetFirstVertex(Vector)
10379 p2=self.GetLastVertex(Vector)
10381 X1=self.PointCoordinates(p1)
10382 X2=self.PointCoordinates(p2)
10384 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10387 ## Compute cross product
10388 # @return vector w=u^v
10390 # @ref tui_measurement_tools_page "Example"
10391 def CrossProduct(self, Vector1, Vector2):
10393 Compute cross product
10395 Returns: vector w=u^v
10397 u=self.VectorCoordinates(Vector1)
10398 v=self.VectorCoordinates(Vector2)
10399 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])
10403 ## Compute cross product
10404 # @return dot product p=u.v
10406 # @ref tui_measurement_tools_page "Example"
10407 def DotProduct(self, Vector1, Vector2):
10409 Compute cross product
10411 Returns: dot product p=u.v
10413 u=self.VectorCoordinates(Vector1)
10414 v=self.VectorCoordinates(Vector2)
10415 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10420 ## Get summarized length of all wires,
10421 # area of surface and volume of the given shape.
10422 # @param theShape Shape to define properties of.
10423 # @return [theLength, theSurfArea, theVolume]\n
10424 # theLength: Summarized length of all wires of the given shape.\n
10425 # theSurfArea: Area of surface of the given shape.\n
10426 # theVolume: Volume of the given shape.
10428 # @ref tui_basic_properties_page "Example"
10429 @ManageTransactions("MeasuOp")
10430 def BasicProperties(self,theShape):
10432 Get summarized length of all wires,
10433 area of surface and volume of the given shape.
10436 theShape Shape to define properties of.
10439 [theLength, theSurfArea, theVolume]
10440 theLength: Summarized length of all wires of the given shape.
10441 theSurfArea: Area of surface of the given shape.
10442 theVolume: Volume of the given shape.
10444 # Example: see GEOM_TestMeasures.py
10445 aTuple = self.MeasuOp.GetBasicProperties(theShape)
10446 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10449 ## Get parameters of bounding box of the given shape
10450 # @param theShape Shape to obtain bounding box of.
10451 # @param precise TRUE for precise computation; FALSE for fast one.
10452 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10453 # Xmin,Xmax: Limits of shape along OX axis.
10454 # Ymin,Ymax: Limits of shape along OY axis.
10455 # Zmin,Zmax: Limits of shape along OZ axis.
10457 # @ref tui_bounding_box_page "Example"
10458 @ManageTransactions("MeasuOp")
10459 def BoundingBox (self, theShape, precise=False):
10461 Get parameters of bounding box of the given shape
10464 theShape Shape to obtain bounding box of.
10465 precise TRUE for precise computation; FALSE for fast one.
10468 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10469 Xmin,Xmax: Limits of shape along OX axis.
10470 Ymin,Ymax: Limits of shape along OY axis.
10471 Zmin,Zmax: Limits of shape along OZ axis.
10473 # Example: see GEOM_TestMeasures.py
10474 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10475 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10478 ## Get bounding box of the given shape
10479 # @param theShape Shape to obtain bounding box of.
10480 # @param precise TRUE for precise computation; FALSE for fast one.
10481 # @param theName Object name; when specified, this parameter is used
10482 # for result publication in the study. Otherwise, if automatic
10483 # publication is switched on, default value is used for result name.
10485 # @return New GEOM.GEOM_Object, containing the created box.
10487 # @ref tui_bounding_box_page "Example"
10488 @ManageTransactions("MeasuOp")
10489 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10491 Get bounding box of the given shape
10494 theShape Shape to obtain bounding box of.
10495 precise TRUE for precise computation; FALSE for fast one.
10496 theName Object name; when specified, this parameter is used
10497 for result publication in the study. Otherwise, if automatic
10498 publication is switched on, default value is used for result name.
10501 New GEOM.GEOM_Object, containing the created box.
10503 # Example: see GEOM_TestMeasures.py
10504 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10505 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10506 self._autoPublish(anObj, theName, "bndbox")
10509 ## Get inertia matrix and moments of inertia of theShape.
10510 # @param theShape Shape to calculate inertia of.
10511 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10512 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10513 # Ix,Iy,Iz: Moments of inertia of the given shape.
10515 # @ref tui_inertia_page "Example"
10516 @ManageTransactions("MeasuOp")
10517 def Inertia(self,theShape):
10519 Get inertia matrix and moments of inertia of theShape.
10522 theShape Shape to calculate inertia of.
10525 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10526 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10527 Ix,Iy,Iz: Moments of inertia of the given shape.
10529 # Example: see GEOM_TestMeasures.py
10530 aTuple = self.MeasuOp.GetInertia(theShape)
10531 RaiseIfFailed("GetInertia", self.MeasuOp)
10534 ## Get if coords are included in the shape (ST_IN or ST_ON)
10535 # @param theShape Shape
10536 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10537 # @param tolerance to be used (default is 1.0e-7)
10538 # @return list_of_boolean = [res1, res2, ...]
10539 @ManageTransactions("MeasuOp")
10540 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10542 Get if coords are included in the shape (ST_IN or ST_ON)
10546 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10547 tolerance to be used (default is 1.0e-7)
10550 list_of_boolean = [res1, res2, ...]
10552 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10554 ## Get minimal distance between the given shapes.
10555 # @param theShape1,theShape2 Shapes to find minimal distance between.
10556 # @return Value of the minimal distance between the given shapes.
10558 # @ref tui_min_distance_page "Example"
10559 @ManageTransactions("MeasuOp")
10560 def MinDistance(self, theShape1, theShape2):
10562 Get minimal distance between the given shapes.
10565 theShape1,theShape2 Shapes to find minimal distance between.
10568 Value of the minimal distance between the given shapes.
10570 # Example: see GEOM_TestMeasures.py
10571 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10572 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10575 ## Get minimal distance between the given shapes.
10576 # @param theShape1,theShape2 Shapes to find minimal distance between.
10577 # @return Value of the minimal distance between the given shapes, in form of list
10578 # [Distance, DX, DY, DZ].
10580 # @ref tui_min_distance_page "Example"
10581 @ManageTransactions("MeasuOp")
10582 def MinDistanceComponents(self, theShape1, theShape2):
10584 Get minimal distance between the given shapes.
10587 theShape1,theShape2 Shapes to find minimal distance between.
10590 Value of the minimal distance between the given shapes, in form of list
10591 [Distance, DX, DY, DZ]
10593 # Example: see GEOM_TestMeasures.py
10594 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10595 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10596 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10599 ## Get closest points of the given shapes.
10600 # @param theShape1,theShape2 Shapes to find closest points of.
10601 # @return The number of found solutions (-1 in case of infinite number of
10602 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10604 # @ref tui_min_distance_page "Example"
10605 @ManageTransactions("MeasuOp")
10606 def ClosestPoints (self, theShape1, theShape2):
10608 Get closest points of the given shapes.
10611 theShape1,theShape2 Shapes to find closest points of.
10614 The number of found solutions (-1 in case of infinite number of
10615 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10617 # Example: see GEOM_TestMeasures.py
10618 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10619 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10622 ## Get angle between the given shapes in degrees.
10623 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10624 # @note If both arguments are vectors, the angle is computed in accordance
10625 # with their orientations, otherwise the minimum angle is computed.
10626 # @return Value of the angle between the given shapes in degrees.
10628 # @ref tui_angle_page "Example"
10629 @ManageTransactions("MeasuOp")
10630 def GetAngle(self, theShape1, theShape2):
10632 Get angle between the given shapes in degrees.
10635 theShape1,theShape2 Lines or linear edges to find angle between.
10638 If both arguments are vectors, the angle is computed in accordance
10639 with their orientations, otherwise the minimum angle is computed.
10642 Value of the angle between the given shapes in degrees.
10644 # Example: see GEOM_TestMeasures.py
10645 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10646 RaiseIfFailed("GetAngle", self.MeasuOp)
10649 ## Get angle between the given shapes in radians.
10650 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10651 # @note If both arguments are vectors, the angle is computed in accordance
10652 # with their orientations, otherwise the minimum angle is computed.
10653 # @return Value of the angle between the given shapes in radians.
10655 # @ref tui_angle_page "Example"
10656 @ManageTransactions("MeasuOp")
10657 def GetAngleRadians(self, theShape1, theShape2):
10659 Get angle between the given shapes in radians.
10662 theShape1,theShape2 Lines or linear edges to find angle between.
10666 If both arguments are vectors, the angle is computed in accordance
10667 with their orientations, otherwise the minimum angle is computed.
10670 Value of the angle between the given shapes in radians.
10672 # Example: see GEOM_TestMeasures.py
10673 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10674 RaiseIfFailed("GetAngle", self.MeasuOp)
10677 ## Get angle between the given vectors in degrees.
10678 # @param theShape1,theShape2 Vectors to find angle between.
10679 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10680 # if False, the opposite vector to the normal vector is used.
10681 # @return Value of the angle between the given vectors in degrees.
10683 # @ref tui_angle_page "Example"
10684 @ManageTransactions("MeasuOp")
10685 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10687 Get angle between the given vectors in degrees.
10690 theShape1,theShape2 Vectors to find angle between.
10691 theFlag If True, the normal vector is defined by the two vectors cross,
10692 if False, the opposite vector to the normal vector is used.
10695 Value of the angle between the given vectors in degrees.
10697 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10699 anAngle = 360. - anAngle
10700 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10703 ## The same as GetAngleVectors, but the result is in radians.
10704 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10706 Get angle between the given vectors in radians.
10709 theShape1,theShape2 Vectors to find angle between.
10710 theFlag If True, the normal vector is defined by the two vectors cross,
10711 if False, the opposite vector to the normal vector is used.
10714 Value of the angle between the given vectors in radians.
10716 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10719 ## @name Curve Curvature Measurement
10720 # Methods for receiving radius of curvature of curves
10721 # in the given point
10724 ## Measure curvature of a curve at a point, set by parameter.
10725 # @param theCurve a curve.
10726 # @param theParam parameter.
10727 # @return radius of curvature of \a theCurve.
10729 # @ref swig_todo "Example"
10730 @ManageTransactions("MeasuOp")
10731 def CurveCurvatureByParam(self, theCurve, theParam):
10733 Measure curvature of a curve at a point, set by parameter.
10737 theParam parameter.
10740 radius of curvature of theCurve.
10742 # Example: see GEOM_TestMeasures.py
10743 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10744 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10747 ## Measure curvature of a curve at a point.
10748 # @param theCurve a curve.
10749 # @param thePoint given point.
10750 # @return radius of curvature of \a theCurve.
10752 # @ref swig_todo "Example"
10753 @ManageTransactions("MeasuOp")
10754 def CurveCurvatureByPoint(self, theCurve, thePoint):
10756 Measure curvature of a curve at a point.
10760 thePoint given point.
10763 radius of curvature of theCurve.
10765 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10766 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10770 ## @name Surface Curvature Measurement
10771 # Methods for receiving max and min radius of curvature of surfaces
10772 # in the given point
10775 ## Measure max radius of curvature of surface.
10776 # @param theSurf the given surface.
10777 # @param theUParam Value of U-parameter on the referenced surface.
10778 # @param theVParam Value of V-parameter on the referenced surface.
10779 # @return max radius of curvature of theSurf.
10781 ## @ref swig_todo "Example"
10782 @ManageTransactions("MeasuOp")
10783 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10785 Measure max radius of curvature of surface.
10788 theSurf the given surface.
10789 theUParam Value of U-parameter on the referenced surface.
10790 theVParam Value of V-parameter on the referenced surface.
10793 max radius of curvature of theSurf.
10795 # Example: see GEOM_TestMeasures.py
10796 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10797 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10800 ## Measure max radius of curvature of surface in the given point
10801 # @param theSurf the given surface.
10802 # @param thePoint given point.
10803 # @return max radius of curvature of theSurf.
10805 ## @ref swig_todo "Example"
10806 @ManageTransactions("MeasuOp")
10807 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10809 Measure max radius of curvature of surface in the given point.
10812 theSurf the given surface.
10813 thePoint given point.
10816 max radius of curvature of theSurf.
10818 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10819 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10822 ## Measure min radius of curvature of surface.
10823 # @param theSurf the given surface.
10824 # @param theUParam Value of U-parameter on the referenced surface.
10825 # @param theVParam Value of V-parameter on the referenced surface.
10826 # @return min radius of curvature of theSurf.
10828 ## @ref swig_todo "Example"
10829 @ManageTransactions("MeasuOp")
10830 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10832 Measure min radius of curvature of surface.
10835 theSurf the given surface.
10836 theUParam Value of U-parameter on the referenced surface.
10837 theVParam Value of V-parameter on the referenced surface.
10840 Min radius of curvature of theSurf.
10842 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10843 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10846 ## Measure min radius of curvature of surface in the given point
10847 # @param theSurf the given surface.
10848 # @param thePoint given point.
10849 # @return min radius of curvature of theSurf.
10851 ## @ref swig_todo "Example"
10852 @ManageTransactions("MeasuOp")
10853 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10855 Measure min radius of curvature of surface in the given point.
10858 theSurf the given surface.
10859 thePoint given point.
10862 Min radius of curvature of theSurf.
10864 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10865 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10869 ## Get min and max tolerances of sub-shapes of theShape
10870 # @param theShape Shape, to get tolerances of.
10871 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10872 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10873 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10874 # VertMin,VertMax: Min and max tolerances of the vertices.
10876 # @ref tui_tolerance_page "Example"
10877 @ManageTransactions("MeasuOp")
10878 def Tolerance(self,theShape):
10880 Get min and max tolerances of sub-shapes of theShape
10883 theShape Shape, to get tolerances of.
10886 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10887 FaceMin,FaceMax: Min and max tolerances of the faces.
10888 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10889 VertMin,VertMax: Min and max tolerances of the vertices.
10891 # Example: see GEOM_TestMeasures.py
10892 aTuple = self.MeasuOp.GetTolerance(theShape)
10893 RaiseIfFailed("GetTolerance", self.MeasuOp)
10896 ## Obtain description of the given shape (number of sub-shapes of each type)
10897 # @param theShape Shape to be described.
10898 # @return Description of the given shape.
10900 # @ref tui_whatis_page "Example"
10901 @ManageTransactions("MeasuOp")
10902 def WhatIs(self,theShape):
10904 Obtain description of the given shape (number of sub-shapes of each type)
10907 theShape Shape to be described.
10910 Description of the given shape.
10912 # Example: see GEOM_TestMeasures.py
10913 aDescr = self.MeasuOp.WhatIs(theShape)
10914 RaiseIfFailed("WhatIs", self.MeasuOp)
10917 ## Obtain quantity of shapes of the given type in \a theShape.
10918 # If \a theShape is of type \a theType, it is also counted.
10919 # @param theShape Shape to be described.
10920 # @param theType the given ShapeType().
10921 # @return Quantity of shapes of type \a theType in \a theShape.
10923 # @ref tui_measurement_tools_page "Example"
10924 def NbShapes (self, theShape, theType):
10926 Obtain quantity of shapes of the given type in theShape.
10927 If theShape is of type theType, it is also counted.
10930 theShape Shape to be described.
10931 theType the given geompy.ShapeType
10934 Quantity of shapes of type theType in theShape.
10936 # Example: see GEOM_TestMeasures.py
10937 listSh = self.SubShapeAllIDs(theShape, theType)
10941 ## Obtain quantity of shapes of each type in \a theShape.
10942 # The \a theShape is also counted.
10943 # @param theShape Shape to be described.
10944 # @return Dictionary of ShapeType() with bound quantities of shapes.
10946 # @ref tui_measurement_tools_page "Example"
10947 def ShapeInfo (self, theShape):
10949 Obtain quantity of shapes of each type in theShape.
10950 The theShape is also counted.
10953 theShape Shape to be described.
10956 Dictionary of geompy.ShapeType with bound quantities of shapes.
10958 # Example: see GEOM_TestMeasures.py
10960 for typeSh in self.ShapeType:
10961 if typeSh in ( "AUTO", "SHAPE" ): continue
10962 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10968 def GetCreationInformation(self, theShape):
10969 info = theShape.GetCreationInformation()
10971 opName = info.operationName
10972 if not opName: opName = "no info available"
10973 res = "Operation: " + opName
10975 for parVal in info.params:
10976 res += " \n %s = %s" % ( parVal.name, parVal.value )
10979 ## Get a point, situated at the centre of mass of theShape.
10980 # @param theShape Shape to define centre of mass of.
10981 # @param theName Object name; when specified, this parameter is used
10982 # for result publication in the study. Otherwise, if automatic
10983 # publication is switched on, default value is used for result name.
10985 # @return New GEOM.GEOM_Object, containing the created point.
10987 # @ref tui_center_of_mass_page "Example"
10988 @ManageTransactions("MeasuOp")
10989 def MakeCDG(self, theShape, theName=None):
10991 Get a point, situated at the centre of mass of theShape.
10994 theShape Shape to define centre of mass of.
10995 theName Object name; when specified, this parameter is used
10996 for result publication in the study. Otherwise, if automatic
10997 publication is switched on, default value is used for result name.
11000 New GEOM.GEOM_Object, containing the created point.
11002 # Example: see GEOM_TestMeasures.py
11003 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11004 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11005 self._autoPublish(anObj, theName, "centerOfMass")
11008 ## Get a vertex sub-shape by index depended with orientation.
11009 # @param theShape Shape to find sub-shape.
11010 # @param theIndex Index to find vertex by this index (starting from zero)
11011 # @param theName Object name; when specified, this parameter is used
11012 # for result publication in the study. Otherwise, if automatic
11013 # publication is switched on, default value is used for result name.
11015 # @return New GEOM.GEOM_Object, containing the created vertex.
11017 # @ref tui_measurement_tools_page "Example"
11018 @ManageTransactions("MeasuOp")
11019 def GetVertexByIndex(self, theShape, theIndex, theName=None):
11021 Get a vertex sub-shape by index depended with orientation.
11024 theShape Shape to find sub-shape.
11025 theIndex Index to find vertex by this index (starting from zero)
11026 theName Object name; when specified, this parameter is used
11027 for result publication in the study. Otherwise, if automatic
11028 publication is switched on, default value is used for result name.
11031 New GEOM.GEOM_Object, containing the created vertex.
11033 # Example: see GEOM_TestMeasures.py
11034 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
11035 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11036 self._autoPublish(anObj, theName, "vertex")
11039 ## Get the first vertex of wire/edge depended orientation.
11040 # @param theShape Shape to find first vertex.
11041 # @param theName Object name; when specified, this parameter is used
11042 # for result publication in the study. Otherwise, if automatic
11043 # publication is switched on, default value is used for result name.
11045 # @return New GEOM.GEOM_Object, containing the created vertex.
11047 # @ref tui_measurement_tools_page "Example"
11048 def GetFirstVertex(self, theShape, theName=None):
11050 Get the first vertex of wire/edge depended orientation.
11053 theShape Shape to find first vertex.
11054 theName Object name; when specified, this parameter is used
11055 for result publication in the study. Otherwise, if automatic
11056 publication is switched on, default value is used for result name.
11059 New GEOM.GEOM_Object, containing the created vertex.
11061 # Example: see GEOM_TestMeasures.py
11062 # note: auto-publishing is done in self.GetVertexByIndex()
11063 return self.GetVertexByIndex(theShape, 0, theName)
11065 ## Get the last vertex of wire/edge depended orientation.
11066 # @param theShape Shape to find last vertex.
11067 # @param theName Object name; when specified, this parameter is used
11068 # for result publication in the study. Otherwise, if automatic
11069 # publication is switched on, default value is used for result name.
11071 # @return New GEOM.GEOM_Object, containing the created vertex.
11073 # @ref tui_measurement_tools_page "Example"
11074 def GetLastVertex(self, theShape, theName=None):
11076 Get the last vertex of wire/edge depended orientation.
11079 theShape Shape to find last vertex.
11080 theName Object name; when specified, this parameter is used
11081 for result publication in the study. Otherwise, if automatic
11082 publication is switched on, default value is used for result name.
11085 New GEOM.GEOM_Object, containing the created vertex.
11087 # Example: see GEOM_TestMeasures.py
11088 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11089 # note: auto-publishing is done in self.GetVertexByIndex()
11090 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
11092 ## Get a normale to the given face. If the point is not given,
11093 # the normale is calculated at the center of mass.
11094 # @param theFace Face to define normale of.
11095 # @param theOptionalPoint Point to compute the normale at.
11096 # @param theName Object name; when specified, this parameter is used
11097 # for result publication in the study. Otherwise, if automatic
11098 # publication is switched on, default value is used for result name.
11100 # @return New GEOM.GEOM_Object, containing the created vector.
11102 # @ref swig_todo "Example"
11103 @ManageTransactions("MeasuOp")
11104 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11106 Get a normale to the given face. If the point is not given,
11107 the normale is calculated at the center of mass.
11110 theFace Face to define normale of.
11111 theOptionalPoint Point to compute the normale at.
11112 theName Object name; when specified, this parameter is used
11113 for result publication in the study. Otherwise, if automatic
11114 publication is switched on, default value is used for result name.
11117 New GEOM.GEOM_Object, containing the created vector.
11119 # Example: see GEOM_TestMeasures.py
11120 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11121 RaiseIfFailed("GetNormal", self.MeasuOp)
11122 self._autoPublish(anObj, theName, "normal")
11125 ## Print shape errors obtained from CheckShape.
11126 # @param theShape Shape that was checked.
11127 # @param theShapeErrors the shape errors obtained by CheckShape.
11128 # @param theReturnStatus If 0 the description of problem is printed.
11129 # If 1 the description of problem is returned.
11130 # @return If theReturnStatus is equal to 1 the description is returned.
11131 # Otherwise doesn't return anything.
11133 # @ref tui_check_shape_page "Example"
11134 @ManageTransactions("MeasuOp")
11135 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11137 Print shape errors obtained from CheckShape.
11140 theShape Shape that was checked.
11141 theShapeErrors the shape errors obtained by CheckShape.
11142 theReturnStatus If 0 the description of problem is printed.
11143 If 1 the description of problem is returned.
11146 If theReturnStatus is equal to 1 the description is returned.
11147 Otherwise doesn't return anything.
11149 # Example: see GEOM_TestMeasures.py
11150 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11151 if theReturnStatus == 1:
11156 ## Check a topology of the given shape.
11157 # @param theShape Shape to check validity of.
11158 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11159 # if TRUE, the shape's geometry will be checked also.
11160 # @param theReturnStatus If 0 and if theShape is invalid, a description
11161 # of problem is printed.
11162 # If 1 isValid flag and the description of
11163 # problem is returned.
11164 # If 2 isValid flag and the list of error data
11166 # @return TRUE, if the shape "seems to be valid".
11167 # If theShape is invalid, prints a description of problem.
11168 # If theReturnStatus is equal to 1 the description is returned
11169 # along with IsValid flag.
11170 # If theReturnStatus is equal to 2 the list of error data is
11171 # returned along with IsValid flag.
11173 # @ref tui_check_shape_page "Example"
11174 @ManageTransactions("MeasuOp")
11175 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11177 Check a topology of the given shape.
11180 theShape Shape to check validity of.
11181 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11182 if TRUE, the shape's geometry will be checked also.
11183 theReturnStatus If 0 and if theShape is invalid, a description
11184 of problem is printed.
11185 If 1 IsValid flag and the description of
11186 problem is returned.
11187 If 2 IsValid flag and the list of error data
11191 TRUE, if the shape "seems to be valid".
11192 If theShape is invalid, prints a description of problem.
11193 If theReturnStatus is equal to 1 the description is returned
11194 along with IsValid flag.
11195 If theReturnStatus is equal to 2 the list of error data is
11196 returned along with IsValid flag.
11198 # Example: see GEOM_TestMeasures.py
11200 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11201 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11203 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11204 RaiseIfFailed("CheckShape", self.MeasuOp)
11206 if theReturnStatus == 0:
11207 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11209 if theReturnStatus == 1:
11210 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11211 return (IsValid, Descr)
11212 elif theReturnStatus == 2:
11213 return (IsValid, ShapeErrors)
11216 ## Detect self-intersections in the given shape.
11217 # @param theShape Shape to check.
11218 # @param theCheckLevel is the level of self-intersection check.
11219 # Possible input values are:
11220 # - GEOM.SI_V_V(0) - only V/V interferences
11221 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11222 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11223 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11224 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11225 # - GEOM.SI_ALL(5) - all interferences.
11226 # @return TRUE, if the shape contains no self-intersections.
11228 # @ref tui_check_self_intersections_page "Example"
11229 @ManageTransactions("MeasuOp")
11230 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11232 Detect self-intersections in the given shape.
11235 theShape Shape to check.
11236 theCheckLevel is the level of self-intersection check.
11237 Possible input values are:
11238 - GEOM.SI_V_V(0) - only V/V interferences
11239 - GEOM.SI_V_E(1) - V/V and V/E interferences
11240 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11241 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11242 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11243 - GEOM.SI_ALL(5) - all interferences.
11246 TRUE, if the shape contains no self-intersections.
11248 # Example: see GEOM_TestMeasures.py
11249 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11250 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11253 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11254 # @param theShape1 First source object
11255 # @param theShape2 Second source object
11256 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11257 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11258 # - if \a theTolerance > 0, algorithm detects gaps
11259 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
11260 # - if \a theDeflection <= 0, default deflection 0.001 is used
11261 # @return TRUE, if there are intersections (gaps) between source shapes
11262 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11263 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11265 # @ref tui_fast_intersection_page "Example"
11266 @ManageTransactions("MeasuOp")
11267 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11269 Detect intersections of the given shapes with algorithm based on mesh intersections.
11272 theShape1 First source object
11273 theShape2 Second source object
11274 theTolerance Specifies a distance between shapes used for detecting gaps:
11275 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11276 - if theTolerance > 0, algorithm detects gaps
11277 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11278 - if theDeflection <= 0, default deflection 0.001 is used
11281 TRUE, if there are intersections (gaps) between source shapes
11282 List of sub-shapes IDs from 1st shape that localize intersection.
11283 List of sub-shapes IDs from 2nd shape that localize intersection.
11285 # Example: see GEOM_TestMeasures.py
11286 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11287 RaiseIfFailed("FastIntersect", self.MeasuOp)
11288 return IsOk, Res1, Res2
11290 ## Get position (LCS) of theShape.
11292 # Origin of the LCS is situated at the shape's center of mass.
11293 # Axes of the LCS are obtained from shape's location or,
11294 # if the shape is a planar face, from position of its plane.
11296 # @param theShape Shape to calculate position of.
11297 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11298 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11299 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11300 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11302 # @ref swig_todo "Example"
11303 @ManageTransactions("MeasuOp")
11304 def GetPosition(self,theShape):
11306 Get position (LCS) of theShape.
11307 Origin of the LCS is situated at the shape's center of mass.
11308 Axes of the LCS are obtained from shape's location or,
11309 if the shape is a planar face, from position of its plane.
11312 theShape Shape to calculate position of.
11315 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11316 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11317 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11318 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11320 # Example: see GEOM_TestMeasures.py
11321 aTuple = self.MeasuOp.GetPosition(theShape)
11322 RaiseIfFailed("GetPosition", self.MeasuOp)
11325 ## Get kind of theShape.
11327 # @param theShape Shape to get a kind of.
11328 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11329 # and a list of parameters, describing the shape.
11330 # @note Concrete meaning of each value, returned via \a theIntegers
11331 # or \a theDoubles list depends on the kind() of the shape.
11333 # @ref swig_todo "Example"
11334 @ManageTransactions("MeasuOp")
11335 def KindOfShape(self,theShape):
11337 Get kind of theShape.
11340 theShape Shape to get a kind of.
11343 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11344 and a list of parameters, describing the shape.
11346 Concrete meaning of each value, returned via theIntegers
11347 or theDoubles list depends on the geompy.kind of the shape
11349 # Example: see GEOM_TestMeasures.py
11350 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11351 RaiseIfFailed("KindOfShape", self.MeasuOp)
11353 aKind = aRoughTuple[0]
11354 anInts = aRoughTuple[1]
11355 aDbls = aRoughTuple[2]
11357 # Now there is no exception from this rule:
11358 aKindTuple = [aKind] + aDbls + anInts
11360 # If they are we will regroup parameters for such kind of shape.
11362 #if aKind == kind.SOME_KIND:
11363 # # SOME_KIND int int double int double double
11364 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11368 ## Returns the string that describes if the shell is good for solid.
11369 # This is a support method for MakeSolid.
11371 # @param theShell the shell to be checked.
11372 # @return Returns a string that describes the shell validity for
11373 # solid construction.
11374 @ManageTransactions("MeasuOp")
11375 def _IsGoodForSolid(self, theShell):
11377 Returns the string that describes if the shell is good for solid.
11378 This is a support method for MakeSolid.
11381 theShell the shell to be checked.
11384 Returns a string that describes the shell validity for
11385 solid construction.
11387 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11390 # end of l2_measure
11393 ## @addtogroup l2_import_export
11396 ## Import a shape from the BREP, IGES, STEP or other file
11397 # (depends on given format) with given name.
11399 # Note: this function is deprecated, it is kept for backward compatibility only
11400 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11402 # @param theFileName The file, containing the shape.
11403 # @param theFormatName Specify format for the file reading.
11404 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11405 # If format 'IGES_SCALE' is used instead of 'IGES' or
11406 # format 'STEP_SCALE' is used instead of 'STEP',
11407 # length unit will be set to 'meter' and result model will be scaled.
11408 # @param theName Object name; when specified, this parameter is used
11409 # for result publication in the study. Otherwise, if automatic
11410 # publication is switched on, default value is used for result name.
11412 # @return New GEOM.GEOM_Object, containing the imported shape.
11413 # If material names are imported it returns the list of
11414 # objects. The first one is the imported object followed by
11416 # @note Auto publishing is allowed for the shape itself. Imported
11417 # material groups are not automatically published.
11419 # @ref swig_Import_Export "Example"
11420 @ManageTransactions("InsertOp")
11421 def ImportFile(self, theFileName, theFormatName, theName=None):
11423 Import a shape from the BREP, IGES, STEP or other file
11424 (depends on given format) with given name.
11426 Note: this function is deprecated, it is kept for backward compatibility only
11427 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11430 theFileName The file, containing the shape.
11431 theFormatName Specify format for the file reading.
11432 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11433 If format 'IGES_SCALE' is used instead of 'IGES' or
11434 format 'STEP_SCALE' is used instead of 'STEP',
11435 length unit will be set to 'meter' and result model will be scaled.
11436 theName Object name; when specified, this parameter is used
11437 for result publication in the study. Otherwise, if automatic
11438 publication is switched on, default value is used for result name.
11441 New GEOM.GEOM_Object, containing the imported shape.
11442 If material names are imported it returns the list of
11443 objects. The first one is the imported object followed by
11446 Auto publishing is allowed for the shape itself. Imported
11447 material groups are not automatically published.
11449 # Example: see GEOM_TestOthers.py
11451 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11452 where <FormatName> is a name of desirable format for importing.
11454 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11455 RaiseIfFailed("ImportFile", self.InsertOp)
11456 aNbObj = len(aListObj)
11458 self._autoPublish(aListObj[0], theName, "imported")
11463 ## Deprecated analog of ImportFile()
11464 def Import(self, theFileName, theFormatName, theName=None):
11466 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11468 # note: auto-publishing is done in self.ImportFile()
11469 return self.ImportFile(theFileName, theFormatName, theName)
11471 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11472 # @note This method will not be dumped to the python script by DumpStudy functionality.
11473 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
11474 # @param theStream The BRep binary stream.
11475 # @param theName Object name; when specified, this parameter is used
11476 # for result publication in the study. Otherwise, if automatic
11477 # publication is switched on, default value is used for result name.
11479 # @return New GEOM_Object, containing the shape, read from theStream.
11481 # @ref swig_Import_Export "Example"
11482 @ManageTransactions("InsertOp")
11483 def RestoreShape (self, theStream, theName=None):
11485 Read a shape from the binary stream, containing its bounding representation (BRep).
11488 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11491 theStream The BRep binary stream.
11492 theName Object name; when specified, this parameter is used
11493 for result publication in the study. Otherwise, if automatic
11494 publication is switched on, default value is used for result name.
11497 New GEOM_Object, containing the shape, read from theStream.
11499 # Example: see GEOM_TestOthers.py
11500 anObj = self.InsertOp.RestoreShape(theStream)
11501 RaiseIfFailed("RestoreShape", self.InsertOp)
11502 self._autoPublish(anObj, theName, "restored")
11505 ## Export the given shape into a file with given name.
11507 # Note: this function is deprecated, it is kept for backward compatibility only
11508 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11510 # @param theObject Shape to be stored in the file.
11511 # @param theFileName Name of the file to store the given shape in.
11512 # @param theFormatName Specify format for the shape storage.
11513 # Available formats can be obtained with
11514 # geompy.InsertOp.ExportTranslators()[0] method.
11516 # @ref swig_Import_Export "Example"
11517 @ManageTransactions("InsertOp")
11518 def Export(self, theObject, theFileName, theFormatName):
11520 Export the given shape into a file with given name.
11522 Note: this function is deprecated, it is kept for backward compatibility only
11523 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11526 theObject Shape to be stored in the file.
11527 theFileName Name of the file to store the given shape in.
11528 theFormatName Specify format for the shape storage.
11529 Available formats can be obtained with
11530 geompy.InsertOp.ExportTranslators()[0] method.
11532 # Example: see GEOM_TestOthers.py
11534 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11535 where <FormatName> is a name of desirable format for exporting.
11537 self.InsertOp.Export(theObject, theFileName, theFormatName)
11538 if self.InsertOp.IsDone() == 0:
11539 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
11543 # end of l2_import_export
11546 ## @addtogroup l3_blocks
11549 ## Create a quadrangle face from four edges. Order of Edges is not
11550 # important. It is not necessary that edges share the same vertex.
11551 # @param E1,E2,E3,E4 Edges for the face bound.
11552 # @param theName Object name; when specified, this parameter is used
11553 # for result publication in the study. Otherwise, if automatic
11554 # publication is switched on, default value is used for result name.
11556 # @return New GEOM.GEOM_Object, containing the created face.
11558 # @ref tui_building_by_blocks_page "Example"
11559 @ManageTransactions("BlocksOp")
11560 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11562 Create a quadrangle face from four edges. Order of Edges is not
11563 important. It is not necessary that edges share the same vertex.
11566 E1,E2,E3,E4 Edges for the face bound.
11567 theName Object name; when specified, this parameter is used
11568 for result publication in the study. Otherwise, if automatic
11569 publication is switched on, default value is used for result name.
11572 New GEOM.GEOM_Object, containing the created face.
11575 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11577 # Example: see GEOM_Spanner.py
11578 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11579 RaiseIfFailed("MakeQuad", self.BlocksOp)
11580 self._autoPublish(anObj, theName, "quad")
11583 ## Create a quadrangle face on two edges.
11584 # The missing edges will be built by creating the shortest ones.
11585 # @param E1,E2 Two opposite edges for the face.
11586 # @param theName Object name; when specified, this parameter is used
11587 # for result publication in the study. Otherwise, if automatic
11588 # publication is switched on, default value is used for result name.
11590 # @return New GEOM.GEOM_Object, containing the created face.
11592 # @ref tui_building_by_blocks_page "Example"
11593 @ManageTransactions("BlocksOp")
11594 def MakeQuad2Edges(self, E1, E2, theName=None):
11596 Create a quadrangle face on two edges.
11597 The missing edges will be built by creating the shortest ones.
11600 E1,E2 Two opposite edges for the face.
11601 theName Object name; when specified, this parameter is used
11602 for result publication in the study. Otherwise, if automatic
11603 publication is switched on, default value is used for result name.
11606 New GEOM.GEOM_Object, containing the created face.
11610 p1 = geompy.MakeVertex( 0., 0., 0.)
11611 p2 = geompy.MakeVertex(150., 30., 0.)
11612 p3 = geompy.MakeVertex( 0., 120., 50.)
11613 p4 = geompy.MakeVertex( 0., 40., 70.)
11615 edge1 = geompy.MakeEdge(p1, p2)
11616 edge2 = geompy.MakeEdge(p3, p4)
11617 # create a quadrangle face from two edges
11618 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11620 # Example: see GEOM_Spanner.py
11621 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11622 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11623 self._autoPublish(anObj, theName, "quad")
11626 ## Create a quadrangle face with specified corners.
11627 # The missing edges will be built by creating the shortest ones.
11628 # @param V1,V2,V3,V4 Corner vertices for the face.
11629 # @param theName Object name; when specified, this parameter is used
11630 # for result publication in the study. Otherwise, if automatic
11631 # publication is switched on, default value is used for result name.
11633 # @return New GEOM.GEOM_Object, containing the created face.
11635 # @ref tui_building_by_blocks_page "Example 1"
11636 # \n @ref swig_MakeQuad4Vertices "Example 2"
11637 @ManageTransactions("BlocksOp")
11638 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11640 Create a quadrangle face with specified corners.
11641 The missing edges will be built by creating the shortest ones.
11644 V1,V2,V3,V4 Corner vertices for the face.
11645 theName Object name; when specified, this parameter is used
11646 for result publication in the study. Otherwise, if automatic
11647 publication is switched on, default value is used for result name.
11650 New GEOM.GEOM_Object, containing the created face.
11654 p1 = geompy.MakeVertex( 0., 0., 0.)
11655 p2 = geompy.MakeVertex(150., 30., 0.)
11656 p3 = geompy.MakeVertex( 0., 120., 50.)
11657 p4 = geompy.MakeVertex( 0., 40., 70.)
11658 # create a quadrangle from four points in its corners
11659 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11661 # Example: see GEOM_Spanner.py
11662 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11663 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11664 self._autoPublish(anObj, theName, "quad")
11667 ## Create a hexahedral solid, bounded by the six given faces. Order of
11668 # faces is not important. It is not necessary that Faces share the same edge.
11669 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11670 # @param theName Object name; when specified, this parameter is used
11671 # for result publication in the study. Otherwise, if automatic
11672 # publication is switched on, default value is used for result name.
11674 # @return New GEOM.GEOM_Object, containing the created solid.
11676 # @ref tui_building_by_blocks_page "Example 1"
11677 # \n @ref swig_MakeHexa "Example 2"
11678 @ManageTransactions("BlocksOp")
11679 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11681 Create a hexahedral solid, bounded by the six given faces. Order of
11682 faces is not important. It is not necessary that Faces share the same edge.
11685 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11686 theName Object name; when specified, this parameter is used
11687 for result publication in the study. Otherwise, if automatic
11688 publication is switched on, default value is used for result name.
11691 New GEOM.GEOM_Object, containing the created solid.
11694 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11696 # Example: see GEOM_Spanner.py
11697 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11698 RaiseIfFailed("MakeHexa", self.BlocksOp)
11699 self._autoPublish(anObj, theName, "hexa")
11702 ## Create a hexahedral solid between two given faces.
11703 # The missing faces will be built by creating the smallest ones.
11704 # @param F1,F2 Two opposite faces for the hexahedral solid.
11705 # @param theName Object name; when specified, this parameter is used
11706 # for result publication in the study. Otherwise, if automatic
11707 # publication is switched on, default value is used for result name.
11709 # @return New GEOM.GEOM_Object, containing the created solid.
11711 # @ref tui_building_by_blocks_page "Example 1"
11712 # \n @ref swig_MakeHexa2Faces "Example 2"
11713 @ManageTransactions("BlocksOp")
11714 def MakeHexa2Faces(self, F1, F2, theName=None):
11716 Create a hexahedral solid between two given faces.
11717 The missing faces will be built by creating the smallest ones.
11720 F1,F2 Two opposite faces for the hexahedral solid.
11721 theName Object name; when specified, this parameter is used
11722 for result publication in the study. Otherwise, if automatic
11723 publication is switched on, default value is used for result name.
11726 New GEOM.GEOM_Object, containing the created solid.
11729 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11731 # Example: see GEOM_Spanner.py
11732 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11733 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11734 self._autoPublish(anObj, theName, "hexa")
11740 ## @addtogroup l3_blocks_op
11743 ## Get a vertex, found in the given shape by its coordinates.
11744 # @param theShape Block or a compound of blocks.
11745 # @param theX,theY,theZ Coordinates of the sought vertex.
11746 # @param theEpsilon Maximum allowed distance between the resulting
11747 # vertex and point with the given coordinates.
11748 # @param theName Object name; when specified, this parameter is used
11749 # for result publication in the study. Otherwise, if automatic
11750 # publication is switched on, default value is used for result name.
11752 # @return New GEOM.GEOM_Object, containing the found vertex.
11754 # @ref swig_GetPoint "Example"
11755 @ManageTransactions("BlocksOp")
11756 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11758 Get a vertex, found in the given shape by its coordinates.
11761 theShape Block or a compound of blocks.
11762 theX,theY,theZ Coordinates of the sought vertex.
11763 theEpsilon Maximum allowed distance between the resulting
11764 vertex and point with the given coordinates.
11765 theName Object name; when specified, this parameter is used
11766 for result publication in the study. Otherwise, if automatic
11767 publication is switched on, default value is used for result name.
11770 New GEOM.GEOM_Object, containing the found vertex.
11773 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11775 # Example: see GEOM_TestOthers.py
11776 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11777 RaiseIfFailed("GetPoint", self.BlocksOp)
11778 self._autoPublish(anObj, theName, "vertex")
11781 ## Find a vertex of the given shape, which has minimal distance to the given point.
11782 # @param theShape Any shape.
11783 # @param thePoint Point, close to the desired vertex.
11784 # @param theName Object name; when specified, this parameter is used
11785 # for result publication in the study. Otherwise, if automatic
11786 # publication is switched on, default value is used for result name.
11788 # @return New GEOM.GEOM_Object, containing the found vertex.
11790 # @ref swig_GetVertexNearPoint "Example"
11791 @ManageTransactions("BlocksOp")
11792 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11794 Find a vertex of the given shape, which has minimal distance to the given point.
11797 theShape Any shape.
11798 thePoint Point, close to the desired vertex.
11799 theName Object name; when specified, this parameter is used
11800 for result publication in the study. Otherwise, if automatic
11801 publication is switched on, default value is used for result name.
11804 New GEOM.GEOM_Object, containing the found vertex.
11807 pmidle = geompy.MakeVertex(50, 0, 50)
11808 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11810 # Example: see GEOM_TestOthers.py
11811 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11812 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11813 self._autoPublish(anObj, theName, "vertex")
11816 ## Get an edge, found in the given shape by two given vertices.
11817 # @param theShape Block or a compound of blocks.
11818 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11819 # @param theName Object name; when specified, this parameter is used
11820 # for result publication in the study. Otherwise, if automatic
11821 # publication is switched on, default value is used for result name.
11823 # @return New GEOM.GEOM_Object, containing the found edge.
11825 # @ref swig_GetEdge "Example"
11826 @ManageTransactions("BlocksOp")
11827 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11829 Get an edge, found in the given shape by two given vertices.
11832 theShape Block or a compound of blocks.
11833 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11834 theName Object name; when specified, this parameter is used
11835 for result publication in the study. Otherwise, if automatic
11836 publication is switched on, default value is used for result name.
11839 New GEOM.GEOM_Object, containing the found edge.
11841 # Example: see GEOM_Spanner.py
11842 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11843 RaiseIfFailed("GetEdge", self.BlocksOp)
11844 self._autoPublish(anObj, theName, "edge")
11847 ## Find an edge of the given shape, which has minimal distance to the given point.
11848 # @param theShape Block or a compound of blocks.
11849 # @param thePoint Point, close to the desired edge.
11850 # @param theName Object name; when specified, this parameter is used
11851 # for result publication in the study. Otherwise, if automatic
11852 # publication is switched on, default value is used for result name.
11854 # @return New GEOM.GEOM_Object, containing the found edge.
11856 # @ref swig_GetEdgeNearPoint "Example"
11857 @ManageTransactions("BlocksOp")
11858 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11860 Find an edge of the given shape, which has minimal distance to the given point.
11863 theShape Block or a compound of blocks.
11864 thePoint Point, close to the desired edge.
11865 theName Object name; when specified, this parameter is used
11866 for result publication in the study. Otherwise, if automatic
11867 publication is switched on, default value is used for result name.
11870 New GEOM.GEOM_Object, containing the found edge.
11872 # Example: see GEOM_TestOthers.py
11873 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11874 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11875 self._autoPublish(anObj, theName, "edge")
11878 ## Returns a face, found in the given shape by four given corner vertices.
11879 # @param theShape Block or a compound of blocks.
11880 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11881 # @param theName Object name; when specified, this parameter is used
11882 # for result publication in the study. Otherwise, if automatic
11883 # publication is switched on, default value is used for result name.
11885 # @return New GEOM.GEOM_Object, containing the found face.
11887 # @ref swig_todo "Example"
11888 @ManageTransactions("BlocksOp")
11889 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11891 Returns a face, found in the given shape by four given corner vertices.
11894 theShape Block or a compound of blocks.
11895 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11896 theName Object name; when specified, this parameter is used
11897 for result publication in the study. Otherwise, if automatic
11898 publication is switched on, default value is used for result name.
11901 New GEOM.GEOM_Object, containing the found face.
11903 # Example: see GEOM_Spanner.py
11904 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11905 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11906 self._autoPublish(anObj, theName, "face")
11909 ## Get a face of block, found in the given shape by two given edges.
11910 # @param theShape Block or a compound of blocks.
11911 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11912 # @param theName Object name; when specified, this parameter is used
11913 # for result publication in the study. Otherwise, if automatic
11914 # publication is switched on, default value is used for result name.
11916 # @return New GEOM.GEOM_Object, containing the found face.
11918 # @ref swig_todo "Example"
11919 @ManageTransactions("BlocksOp")
11920 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11922 Get a face of block, found in the given shape by two given edges.
11925 theShape Block or a compound of blocks.
11926 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11927 theName Object name; when specified, this parameter is used
11928 for result publication in the study. Otherwise, if automatic
11929 publication is switched on, default value is used for result name.
11932 New GEOM.GEOM_Object, containing the found face.
11934 # Example: see GEOM_Spanner.py
11935 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11936 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11937 self._autoPublish(anObj, theName, "face")
11940 ## Find a face, opposite to the given one in the given block.
11941 # @param theBlock Must be a hexahedral solid.
11942 # @param theFace Face of \a theBlock, opposite to the desired face.
11943 # @param theName Object name; when specified, this parameter is used
11944 # for result publication in the study. Otherwise, if automatic
11945 # publication is switched on, default value is used for result name.
11947 # @return New GEOM.GEOM_Object, containing the found face.
11949 # @ref swig_GetOppositeFace "Example"
11950 @ManageTransactions("BlocksOp")
11951 def GetOppositeFace(self, theBlock, theFace, theName=None):
11953 Find a face, opposite to the given one in the given block.
11956 theBlock Must be a hexahedral solid.
11957 theFace Face of theBlock, opposite to the desired face.
11958 theName Object name; when specified, this parameter is used
11959 for result publication in the study. Otherwise, if automatic
11960 publication is switched on, default value is used for result name.
11963 New GEOM.GEOM_Object, containing the found face.
11965 # Example: see GEOM_Spanner.py
11966 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11967 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11968 self._autoPublish(anObj, theName, "face")
11971 ## Find a face of the given shape, which has minimal distance to the given point.
11972 # @param theShape Block or a compound of blocks.
11973 # @param thePoint Point, close to the desired face.
11974 # @param theName Object name; when specified, this parameter is used
11975 # for result publication in the study. Otherwise, if automatic
11976 # publication is switched on, default value is used for result name.
11978 # @return New GEOM.GEOM_Object, containing the found face.
11980 # @ref swig_GetFaceNearPoint "Example"
11981 @ManageTransactions("BlocksOp")
11982 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11984 Find a face of the given shape, which has minimal distance to the given point.
11987 theShape Block or a compound of blocks.
11988 thePoint Point, close to the desired face.
11989 theName Object name; when specified, this parameter is used
11990 for result publication in the study. Otherwise, if automatic
11991 publication is switched on, default value is used for result name.
11994 New GEOM.GEOM_Object, containing the found face.
11996 # Example: see GEOM_Spanner.py
11997 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11998 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11999 self._autoPublish(anObj, theName, "face")
12002 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12003 # @param theBlock Block or a compound of blocks.
12004 # @param theVector Vector, close to the normale of the desired face.
12005 # @param theName Object name; when specified, this parameter is used
12006 # for result publication in the study. Otherwise, if automatic
12007 # publication is switched on, default value is used for result name.
12009 # @return New GEOM.GEOM_Object, containing the found face.
12011 # @ref swig_todo "Example"
12012 @ManageTransactions("BlocksOp")
12013 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12015 Find a face of block, whose outside normale has minimal angle with the given vector.
12018 theBlock Block or a compound of blocks.
12019 theVector Vector, close to the normale of the desired face.
12020 theName Object name; when specified, this parameter is used
12021 for result publication in the study. Otherwise, if automatic
12022 publication is switched on, default value is used for result name.
12025 New GEOM.GEOM_Object, containing the found face.
12027 # Example: see GEOM_Spanner.py
12028 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12029 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12030 self._autoPublish(anObj, theName, "face")
12033 ## Find all sub-shapes of type \a theShapeType of the given shape,
12034 # which have minimal distance to the given point.
12035 # @param theShape Any shape.
12036 # @param thePoint Point, close to the desired shape.
12037 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12038 # @param theTolerance The tolerance for distances comparison. All shapes
12039 # with distances to the given point in interval
12040 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12041 # @param theName Object name; when specified, this parameter is used
12042 # for result publication in the study. Otherwise, if automatic
12043 # publication is switched on, default value is used for result name.
12045 # @return New GEOM_Object, containing a group of all found shapes.
12047 # @ref swig_GetShapesNearPoint "Example"
12048 @ManageTransactions("BlocksOp")
12049 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12051 Find all sub-shapes of type theShapeType of the given shape,
12052 which have minimal distance to the given point.
12055 theShape Any shape.
12056 thePoint Point, close to the desired shape.
12057 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12058 theTolerance The tolerance for distances comparison. All shapes
12059 with distances to the given point in interval
12060 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12061 theName Object name; when specified, this parameter is used
12062 for result publication in the study. Otherwise, if automatic
12063 publication is switched on, default value is used for result name.
12066 New GEOM_Object, containing a group of all found shapes.
12068 # Example: see GEOM_TestOthers.py
12069 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12070 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12071 self._autoPublish(anObj, theName, "group")
12074 # end of l3_blocks_op
12077 ## @addtogroup l4_blocks_measure
12080 ## Check, if the compound of blocks is given.
12081 # To be considered as a compound of blocks, the
12082 # given shape must satisfy the following conditions:
12083 # - Each element of the compound should be a Block (6 faces).
12084 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12085 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12086 # there are more than 4 edges in the only wire of a face,
12087 # this face is considered to be quadrangle if it has 4 bounds
12088 # (1 or more edge) of C1 continuity.
12089 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12090 # - The compound should be connexe.
12091 # - The glue between two quadrangle faces should be applied.
12092 # @param theCompound The compound to check.
12093 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12094 # taking into account C1 continuity.
12095 # @param theAngTolerance the angular tolerance to check if two neighbor
12096 # edges are codirectional in the common vertex with this
12097 # tolerance. This parameter is used only if
12098 # <VAR>theIsUseC1</VAR> is set to True.
12099 # @return TRUE, if the given shape is a compound of blocks.
12100 # If theCompound is not valid, prints all discovered errors.
12102 # @ref tui_check_compound_of_blocks_page "Example 1"
12103 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12104 @ManageTransactions("BlocksOp")
12105 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12106 theAngTolerance = 1.e-12):
12108 Check, if the compound of blocks is given.
12109 To be considered as a compound of blocks, the
12110 given shape must satisfy the following conditions:
12111 - Each element of the compound should be a Block (6 faces).
12112 - Each face should be a quadrangle, i.e. it should have only 1 wire
12113 with 4 edges. If theIsUseC1 is set to True and
12114 there are more than 4 edges in the only wire of a face,
12115 this face is considered to be quadrangle if it has 4 bounds
12116 (1 or more edge) of C1 continuity.
12117 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12118 - The compound should be connexe.
12119 - The glue between two quadrangle faces should be applied.
12122 theCompound The compound to check.
12123 theIsUseC1 Flag to check if there are 4 bounds on a face
12124 taking into account C1 continuity.
12125 theAngTolerance the angular tolerance to check if two neighbor
12126 edges are codirectional in the common vertex with this
12127 tolerance. This parameter is used only if
12128 theIsUseC1 is set to True.
12131 TRUE, if the given shape is a compound of blocks.
12132 If theCompound is not valid, prints all discovered errors.
12134 # Example: see GEOM_Spanner.py
12137 aTolerance = theAngTolerance
12138 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12139 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12141 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12145 ## Retrieve all non blocks solids and faces from \a theShape.
12146 # @param theShape The shape to explore.
12147 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12148 # taking into account C1 continuity.
12149 # @param theAngTolerance the angular tolerance to check if two neighbor
12150 # edges are codirectional in the common vertex with this
12151 # tolerance. This parameter is used only if
12152 # <VAR>theIsUseC1</VAR> is set to True.
12153 # @param theName Object name; when specified, this parameter is used
12154 # for result publication in the study. Otherwise, if automatic
12155 # publication is switched on, default value is used for result name.
12157 # @return A tuple of two GEOM_Objects. The first object is a group of all
12158 # non block solids (= not 6 faces, or with 6 faces, but with the
12159 # presence of non-quadrangular faces). The second object is a
12160 # group of all non quadrangular faces (= faces with more then
12161 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12162 # with 1 wire with not 4 edges that do not form 4 bounds of
12165 # @ref tui_get_non_blocks_page "Example 1"
12166 # \n @ref swig_GetNonBlocks "Example 2"
12167 @ManageTransactions("BlocksOp")
12168 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12169 theAngTolerance = 1.e-12, theName=None):
12171 Retrieve all non blocks solids and faces from theShape.
12174 theShape The shape to explore.
12175 theIsUseC1 Flag to check if there are 4 bounds on a face
12176 taking into account C1 continuity.
12177 theAngTolerance the angular tolerance to check if two neighbor
12178 edges are codirectional in the common vertex with this
12179 tolerance. This parameter is used only if
12180 theIsUseC1 is set to True.
12181 theName Object name; when specified, this parameter is used
12182 for result publication in the study. Otherwise, if automatic
12183 publication is switched on, default value is used for result name.
12186 A tuple of two GEOM_Objects. The first object is a group of all
12187 non block solids (= not 6 faces, or with 6 faces, but with the
12188 presence of non-quadrangular faces). The second object is a
12189 group of all non quadrangular faces (= faces with more then
12190 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12191 with 1 wire with not 4 edges that do not form 4 bounds of
12195 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12197 # Example: see GEOM_Spanner.py
12200 aTolerance = theAngTolerance
12201 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12202 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12203 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12206 ## Remove all seam and degenerated edges from \a theShape.
12207 # Unite faces and edges, sharing one surface. It means that
12208 # this faces must have references to one C++ surface object (handle).
12209 # @param theShape The compound or single solid to remove irregular edges from.
12210 # @param doUnionFaces If True, then unite faces. If False (the default value),
12211 # do not unite faces.
12212 # @param theName Object name; when specified, this parameter is used
12213 # for result publication in the study. Otherwise, if automatic
12214 # publication is switched on, default value is used for result name.
12216 # @return Improved shape.
12218 # @ref swig_RemoveExtraEdges "Example"
12219 @ManageTransactions("BlocksOp")
12220 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12222 Remove all seam and degenerated edges from theShape.
12223 Unite faces and edges, sharing one surface. It means that
12224 this faces must have references to one C++ surface object (handle).
12227 theShape The compound or single solid to remove irregular edges from.
12228 doUnionFaces If True, then unite faces. If False (the default value),
12229 do not unite faces.
12230 theName Object name; when specified, this parameter is used
12231 for result publication in the study. Otherwise, if automatic
12232 publication is switched on, default value is used for result name.
12237 # Example: see GEOM_TestOthers.py
12238 nbFacesOptimum = -1 # -1 means do not unite faces
12239 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12240 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12241 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12242 self._autoPublish(anObj, theName, "removeExtraEdges")
12245 ## Performs union faces of \a theShape
12246 # Unite faces sharing one surface. It means that
12247 # these faces must have references to one C++ surface object (handle).
12248 # @param theShape The compound or single solid that contains faces
12249 # to perform union.
12250 # @param theName Object name; when specified, this parameter is used
12251 # for result publication in the study. Otherwise, if automatic
12252 # publication is switched on, default value is used for result name.
12254 # @return Improved shape.
12256 # @ref swig_UnionFaces "Example"
12257 @ManageTransactions("BlocksOp")
12258 def UnionFaces(self, theShape, theName=None):
12260 Performs union faces of theShape.
12261 Unite faces sharing one surface. It means that
12262 these faces must have references to one C++ surface object (handle).
12265 theShape The compound or single solid that contains faces
12267 theName Object name; when specified, this parameter is used
12268 for result publication in the study. Otherwise, if automatic
12269 publication is switched on, default value is used for result name.
12274 # Example: see GEOM_TestOthers.py
12275 anObj = self.BlocksOp.UnionFaces(theShape)
12276 RaiseIfFailed("UnionFaces", self.BlocksOp)
12277 self._autoPublish(anObj, theName, "unionFaces")
12280 ## Check, if the given shape is a blocks compound.
12281 # Fix all detected errors.
12282 # \note Single block can be also fixed by this method.
12283 # @param theShape The compound to check and improve.
12284 # @param theName Object name; when specified, this parameter is used
12285 # for result publication in the study. Otherwise, if automatic
12286 # publication is switched on, default value is used for result name.
12288 # @return Improved compound.
12290 # @ref swig_CheckAndImprove "Example"
12291 @ManageTransactions("BlocksOp")
12292 def CheckAndImprove(self, theShape, theName=None):
12294 Check, if the given shape is a blocks compound.
12295 Fix all detected errors.
12298 Single block can be also fixed by this method.
12301 theShape The compound to check and improve.
12302 theName Object name; when specified, this parameter is used
12303 for result publication in the study. Otherwise, if automatic
12304 publication is switched on, default value is used for result name.
12309 # Example: see GEOM_TestOthers.py
12310 anObj = self.BlocksOp.CheckAndImprove(theShape)
12311 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12312 self._autoPublish(anObj, theName, "improved")
12315 # end of l4_blocks_measure
12318 ## @addtogroup l3_blocks_op
12321 ## Get all the blocks, contained in the given compound.
12322 # @param theCompound The compound to explode.
12323 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12324 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12325 # @param theName Object name; when specified, this parameter is used
12326 # for result publication in the study. Otherwise, if automatic
12327 # publication is switched on, default value is used for result name.
12329 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12331 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12333 # @ref tui_explode_on_blocks "Example 1"
12334 # \n @ref swig_MakeBlockExplode "Example 2"
12335 @ManageTransactions("BlocksOp")
12336 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12338 Get all the blocks, contained in the given compound.
12341 theCompound The compound to explode.
12342 theMinNbFaces If solid has lower number of faces, it is not a block.
12343 theMaxNbFaces If solid has higher number of faces, it is not a block.
12344 theName Object name; when specified, this parameter is used
12345 for result publication in the study. Otherwise, if automatic
12346 publication is switched on, default value is used for result name.
12349 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12352 List of GEOM.GEOM_Object, containing the retrieved blocks.
12354 # Example: see GEOM_TestOthers.py
12355 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12356 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12357 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12358 for anObj in aList:
12359 anObj.SetParameters(Parameters)
12361 self._autoPublish(aList, theName, "block")
12364 ## Find block, containing the given point inside its volume or on boundary.
12365 # @param theCompound Compound, to find block in.
12366 # @param thePoint Point, close to the desired block. If the point lays on
12367 # boundary between some blocks, we return block with nearest center.
12368 # @param theName Object name; when specified, this parameter is used
12369 # for result publication in the study. Otherwise, if automatic
12370 # publication is switched on, default value is used for result name.
12372 # @return New GEOM.GEOM_Object, containing the found block.
12374 # @ref swig_todo "Example"
12375 @ManageTransactions("BlocksOp")
12376 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12378 Find block, containing the given point inside its volume or on boundary.
12381 theCompound Compound, to find block in.
12382 thePoint Point, close to the desired block. If the point lays on
12383 boundary between some blocks, we return block with nearest center.
12384 theName Object name; when specified, this parameter is used
12385 for result publication in the study. Otherwise, if automatic
12386 publication is switched on, default value is used for result name.
12389 New GEOM.GEOM_Object, containing the found block.
12391 # Example: see GEOM_Spanner.py
12392 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12393 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12394 self._autoPublish(anObj, theName, "block")
12397 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12398 # @param theCompound Compound, to find block in.
12399 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12400 # @param theName Object name; when specified, this parameter is used
12401 # for result publication in the study. Otherwise, if automatic
12402 # publication is switched on, default value is used for result name.
12404 # @return New GEOM.GEOM_Object, containing the found block.
12406 # @ref swig_GetBlockByParts "Example"
12407 @ManageTransactions("BlocksOp")
12408 def GetBlockByParts(self, theCompound, theParts, theName=None):
12410 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12413 theCompound Compound, to find block in.
12414 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12415 theName Object name; when specified, this parameter is used
12416 for result publication in the study. Otherwise, if automatic
12417 publication is switched on, default value is used for result name.
12420 New GEOM_Object, containing the found block.
12422 # Example: see GEOM_TestOthers.py
12423 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12424 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12425 self._autoPublish(anObj, theName, "block")
12428 ## Return all blocks, containing all the elements, passed as the parts.
12429 # @param theCompound Compound, to find blocks in.
12430 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12431 # @param theName Object name; when specified, this parameter is used
12432 # for result publication in the study. Otherwise, if automatic
12433 # publication is switched on, default value is used for result name.
12435 # @return List of GEOM.GEOM_Object, containing the found blocks.
12437 # @ref swig_todo "Example"
12438 @ManageTransactions("BlocksOp")
12439 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12441 Return all blocks, containing all the elements, passed as the parts.
12444 theCompound Compound, to find blocks in.
12445 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12446 theName Object name; when specified, this parameter is used
12447 for result publication in the study. Otherwise, if automatic
12448 publication is switched on, default value is used for result name.
12451 List of GEOM.GEOM_Object, containing the found blocks.
12453 # Example: see GEOM_Spanner.py
12454 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12455 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12456 self._autoPublish(aList, theName, "block")
12459 ## Multi-transformate block and glue the result.
12460 # Transformation is defined so, as to superpose direction faces.
12461 # @param Block Hexahedral solid to be multi-transformed.
12462 # @param DirFace1 ID of First direction face.
12463 # @param DirFace2 ID of Second direction face.
12464 # @param NbTimes Quantity of transformations to be done.
12465 # @param theName Object name; when specified, this parameter is used
12466 # for result publication in the study. Otherwise, if automatic
12467 # publication is switched on, default value is used for result name.
12469 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12471 # @return New GEOM.GEOM_Object, containing the result shape.
12473 # @ref tui_multi_transformation "Example"
12474 @ManageTransactions("BlocksOp")
12475 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12477 Multi-transformate block and glue the result.
12478 Transformation is defined so, as to superpose direction faces.
12481 Block Hexahedral solid to be multi-transformed.
12482 DirFace1 ID of First direction face.
12483 DirFace2 ID of Second direction face.
12484 NbTimes Quantity of transformations to be done.
12485 theName Object name; when specified, this parameter is used
12486 for result publication in the study. Otherwise, if automatic
12487 publication is switched on, default value is used for result name.
12490 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12493 New GEOM.GEOM_Object, containing the result shape.
12495 # Example: see GEOM_Spanner.py
12496 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12497 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12498 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12499 anObj.SetParameters(Parameters)
12500 self._autoPublish(anObj, theName, "transformed")
12503 ## Multi-transformate block and glue the result.
12504 # @param Block Hexahedral solid to be multi-transformed.
12505 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12506 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12507 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12508 # @param theName Object name; when specified, this parameter is used
12509 # for result publication in the study. Otherwise, if automatic
12510 # publication is switched on, default value is used for result name.
12512 # @return New GEOM.GEOM_Object, containing the result shape.
12514 # @ref tui_multi_transformation "Example"
12515 @ManageTransactions("BlocksOp")
12516 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12517 DirFace1V, DirFace2V, NbTimesV, theName=None):
12519 Multi-transformate block and glue the result.
12522 Block Hexahedral solid to be multi-transformed.
12523 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12524 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12525 NbTimesU,NbTimesV Quantity of transformations to be done.
12526 theName Object name; when specified, this parameter is used
12527 for result publication in the study. Otherwise, if automatic
12528 publication is switched on, default value is used for result name.
12531 New GEOM.GEOM_Object, containing the result shape.
12533 # Example: see GEOM_Spanner.py
12534 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12535 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12536 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12537 DirFace1V, DirFace2V, NbTimesV)
12538 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12539 anObj.SetParameters(Parameters)
12540 self._autoPublish(anObj, theName, "transformed")
12543 ## Build all possible propagation groups.
12544 # Propagation group is a set of all edges, opposite to one (main)
12545 # edge of this group directly or through other opposite edges.
12546 # Notion of Opposite Edge make sence only on quadrangle face.
12547 # @param theShape Shape to build propagation groups on.
12548 # @param theName Object name; when specified, this parameter is used
12549 # for result publication in the study. Otherwise, if automatic
12550 # publication is switched on, default value is used for result name.
12552 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12554 # @ref swig_Propagate "Example"
12555 @ManageTransactions("BlocksOp")
12556 def Propagate(self, theShape, theName=None):
12558 Build all possible propagation groups.
12559 Propagation group is a set of all edges, opposite to one (main)
12560 edge of this group directly or through other opposite edges.
12561 Notion of Opposite Edge make sence only on quadrangle face.
12564 theShape Shape to build propagation groups on.
12565 theName Object name; when specified, this parameter is used
12566 for result publication in the study. Otherwise, if automatic
12567 publication is switched on, default value is used for result name.
12570 List of GEOM.GEOM_Object, each of them is a propagation group.
12572 # Example: see GEOM_TestOthers.py
12573 listChains = self.BlocksOp.Propagate(theShape)
12574 RaiseIfFailed("Propagate", self.BlocksOp)
12575 self._autoPublish(listChains, theName, "propagate")
12578 # end of l3_blocks_op
12581 ## @addtogroup l3_groups
12584 ## Creates a new group which will store sub-shapes of theMainShape
12585 # @param theMainShape is a GEOM object on which the group is selected
12586 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12587 # @param theName Object name; when specified, this parameter is used
12588 # for result publication in the study. Otherwise, if automatic
12589 # publication is switched on, default value is used for result name.
12591 # @return a newly created GEOM group (GEOM.GEOM_Object)
12593 # @ref tui_working_with_groups_page "Example 1"
12594 # \n @ref swig_CreateGroup "Example 2"
12595 @ManageTransactions("GroupOp")
12596 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12598 Creates a new group which will store sub-shapes of theMainShape
12601 theMainShape is a GEOM object on which the group is selected
12602 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12603 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12604 theName Object name; when specified, this parameter is used
12605 for result publication in the study. Otherwise, if automatic
12606 publication is switched on, default value is used for result name.
12609 a newly created GEOM group
12612 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12615 # Example: see GEOM_TestOthers.py
12616 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12617 RaiseIfFailed("CreateGroup", self.GroupOp)
12618 self._autoPublish(anObj, theName, "group")
12621 ## Adds a sub-object with ID theSubShapeId to the group
12622 # @param theGroup is a GEOM group to which the new sub-shape is added
12623 # @param theSubShapeID is a sub-shape ID in the main object.
12624 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12626 # @ref tui_working_with_groups_page "Example"
12627 @ManageTransactions("GroupOp")
12628 def AddObject(self,theGroup, theSubShapeID):
12630 Adds a sub-object with ID theSubShapeId to the group
12633 theGroup is a GEOM group to which the new sub-shape is added
12634 theSubShapeID is a sub-shape ID in the main object.
12637 Use method GetSubShapeID() to get an unique ID of the sub-shape
12639 # Example: see GEOM_TestOthers.py
12640 self.GroupOp.AddObject(theGroup, theSubShapeID)
12641 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12642 RaiseIfFailed("AddObject", self.GroupOp)
12646 ## Removes a sub-object with ID \a theSubShapeId from the group
12647 # @param theGroup is a GEOM group from which the new sub-shape is removed
12648 # @param theSubShapeID is a sub-shape ID in the main object.
12649 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12651 # @ref tui_working_with_groups_page "Example"
12652 @ManageTransactions("GroupOp")
12653 def RemoveObject(self,theGroup, theSubShapeID):
12655 Removes a sub-object with ID theSubShapeId from the group
12658 theGroup is a GEOM group from which the new sub-shape is removed
12659 theSubShapeID is a sub-shape ID in the main object.
12662 Use method GetSubShapeID() to get an unique ID of the sub-shape
12664 # Example: see GEOM_TestOthers.py
12665 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12666 RaiseIfFailed("RemoveObject", self.GroupOp)
12669 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12670 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12671 # @param theSubShapes is a list of sub-shapes to be added.
12673 # @ref tui_working_with_groups_page "Example"
12674 @ManageTransactions("GroupOp")
12675 def UnionList (self,theGroup, theSubShapes):
12677 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12680 theGroup is a GEOM group to which the new sub-shapes are added.
12681 theSubShapes is a list of sub-shapes to be added.
12683 # Example: see GEOM_TestOthers.py
12684 self.GroupOp.UnionList(theGroup, theSubShapes)
12685 RaiseIfFailed("UnionList", self.GroupOp)
12688 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12689 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12690 # @param theSubShapes is a list of indices of sub-shapes to be added.
12692 # @ref swig_UnionIDs "Example"
12693 @ManageTransactions("GroupOp")
12694 def UnionIDs(self,theGroup, theSubShapes):
12696 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12699 theGroup is a GEOM group to which the new sub-shapes are added.
12700 theSubShapes is a list of indices of sub-shapes to be added.
12702 # Example: see GEOM_TestOthers.py
12703 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12704 RaiseIfFailed("UnionIDs", self.GroupOp)
12707 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12708 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12709 # @param theSubShapes is a list of sub-shapes to be removed.
12711 # @ref tui_working_with_groups_page "Example"
12712 @ManageTransactions("GroupOp")
12713 def DifferenceList (self,theGroup, theSubShapes):
12715 Removes from the group all the given shapes. No errors, if some shapes are not included.
12718 theGroup is a GEOM group from which the sub-shapes are removed.
12719 theSubShapes is a list of sub-shapes to be removed.
12721 # Example: see GEOM_TestOthers.py
12722 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12723 RaiseIfFailed("DifferenceList", self.GroupOp)
12726 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12727 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12728 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12730 # @ref swig_DifferenceIDs "Example"
12731 @ManageTransactions("GroupOp")
12732 def DifferenceIDs(self,theGroup, theSubShapes):
12734 Removes from the group all the given shapes. No errors, if some shapes are not included.
12737 theGroup is a GEOM group from which the sub-shapes are removed.
12738 theSubShapes is a list of indices of sub-shapes to be removed.
12740 # Example: see GEOM_TestOthers.py
12741 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12742 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12745 ## Union of two groups.
12746 # New group is created. It will contain all entities
12747 # which are present in groups theGroup1 and theGroup2.
12748 # @param theGroup1, theGroup2 are the initial GEOM groups
12749 # to create the united group from.
12750 # @param theName Object name; when specified, this parameter is used
12751 # for result publication in the study. Otherwise, if automatic
12752 # publication is switched on, default value is used for result name.
12754 # @return a newly created GEOM group.
12756 # @ref tui_union_groups_anchor "Example"
12757 @ManageTransactions("GroupOp")
12758 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12760 Union of two groups.
12761 New group is created. It will contain all entities
12762 which are present in groups theGroup1 and theGroup2.
12765 theGroup1, theGroup2 are the initial GEOM groups
12766 to create the united group from.
12767 theName Object name; when specified, this parameter is used
12768 for result publication in the study. Otherwise, if automatic
12769 publication is switched on, default value is used for result name.
12772 a newly created GEOM group.
12774 # Example: see GEOM_TestOthers.py
12775 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12776 RaiseIfFailed("UnionGroups", self.GroupOp)
12777 self._autoPublish(aGroup, theName, "group")
12780 ## Intersection of two groups.
12781 # New group is created. It will contain only those entities
12782 # which are present in both groups theGroup1 and theGroup2.
12783 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12784 # @param theName Object name; when specified, this parameter is used
12785 # for result publication in the study. Otherwise, if automatic
12786 # publication is switched on, default value is used for result name.
12788 # @return a newly created GEOM group.
12790 # @ref tui_intersect_groups_anchor "Example"
12791 @ManageTransactions("GroupOp")
12792 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12794 Intersection of two groups.
12795 New group is created. It will contain only those entities
12796 which are present in both groups theGroup1 and theGroup2.
12799 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12800 theName Object name; when specified, this parameter is used
12801 for result publication in the study. Otherwise, if automatic
12802 publication is switched on, default value is used for result name.
12805 a newly created GEOM group.
12807 # Example: see GEOM_TestOthers.py
12808 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12809 RaiseIfFailed("IntersectGroups", self.GroupOp)
12810 self._autoPublish(aGroup, theName, "group")
12813 ## Cut of two groups.
12814 # New group is created. It will contain entities which are
12815 # present in group theGroup1 but are not present in group theGroup2.
12816 # @param theGroup1 is a GEOM group to include elements of.
12817 # @param theGroup2 is a GEOM group to exclude elements of.
12818 # @param theName Object name; when specified, this parameter is used
12819 # for result publication in the study. Otherwise, if automatic
12820 # publication is switched on, default value is used for result name.
12822 # @return a newly created GEOM group.
12824 # @ref tui_cut_groups_anchor "Example"
12825 @ManageTransactions("GroupOp")
12826 def CutGroups (self, theGroup1, theGroup2, theName=None):
12829 New group is created. It will contain entities which are
12830 present in group theGroup1 but are not present in group theGroup2.
12833 theGroup1 is a GEOM group to include elements of.
12834 theGroup2 is a GEOM group to exclude elements of.
12835 theName Object name; when specified, this parameter is used
12836 for result publication in the study. Otherwise, if automatic
12837 publication is switched on, default value is used for result name.
12840 a newly created GEOM group.
12842 # Example: see GEOM_TestOthers.py
12843 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12844 RaiseIfFailed("CutGroups", self.GroupOp)
12845 self._autoPublish(aGroup, theName, "group")
12848 ## Union of list of groups.
12849 # New group is created. It will contain all entities that are
12850 # present in groups listed in theGList.
12851 # @param theGList is a list of GEOM groups to create the united group from.
12852 # @param theName Object name; when specified, this parameter is used
12853 # for result publication in the study. Otherwise, if automatic
12854 # publication is switched on, default value is used for result name.
12856 # @return a newly created GEOM group.
12858 # @ref tui_union_groups_anchor "Example"
12859 @ManageTransactions("GroupOp")
12860 def UnionListOfGroups (self, theGList, theName=None):
12862 Union of list of groups.
12863 New group is created. It will contain all entities that are
12864 present in groups listed in theGList.
12867 theGList is a list of GEOM groups to create the united group from.
12868 theName Object name; when specified, this parameter is used
12869 for result publication in the study. Otherwise, if automatic
12870 publication is switched on, default value is used for result name.
12873 a newly created GEOM group.
12875 # Example: see GEOM_TestOthers.py
12876 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12877 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12878 self._autoPublish(aGroup, theName, "group")
12881 ## Cut of lists of groups.
12882 # New group is created. It will contain only entities
12883 # which are present in groups listed in theGList.
12884 # @param theGList is a list of GEOM groups to include elements of.
12885 # @param theName Object name; when specified, this parameter is used
12886 # for result publication in the study. Otherwise, if automatic
12887 # publication is switched on, default value is used for result name.
12889 # @return a newly created GEOM group.
12891 # @ref tui_intersect_groups_anchor "Example"
12892 @ManageTransactions("GroupOp")
12893 def IntersectListOfGroups (self, theGList, theName=None):
12895 Cut of lists of groups.
12896 New group is created. It will contain only entities
12897 which are present in groups listed in theGList.
12900 theGList is a list of GEOM groups to include elements of.
12901 theName Object name; when specified, this parameter is used
12902 for result publication in the study. Otherwise, if automatic
12903 publication is switched on, default value is used for result name.
12906 a newly created GEOM group.
12908 # Example: see GEOM_TestOthers.py
12909 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12910 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12911 self._autoPublish(aGroup, theName, "group")
12914 ## Cut of lists of groups.
12915 # New group is created. It will contain only entities
12916 # which are present in groups listed in theGList1 but
12917 # are not present in groups from theGList2.
12918 # @param theGList1 is a list of GEOM groups to include elements of.
12919 # @param theGList2 is a list of GEOM groups to exclude elements of.
12920 # @param theName Object name; when specified, this parameter is used
12921 # for result publication in the study. Otherwise, if automatic
12922 # publication is switched on, default value is used for result name.
12924 # @return a newly created GEOM group.
12926 # @ref tui_cut_groups_anchor "Example"
12927 @ManageTransactions("GroupOp")
12928 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12930 Cut of lists of groups.
12931 New group is created. It will contain only entities
12932 which are present in groups listed in theGList1 but
12933 are not present in groups from theGList2.
12936 theGList1 is a list of GEOM groups to include elements of.
12937 theGList2 is a list of GEOM groups to exclude elements of.
12938 theName Object name; when specified, this parameter is used
12939 for result publication in the study. Otherwise, if automatic
12940 publication is switched on, default value is used for result name.
12943 a newly created GEOM group.
12945 # Example: see GEOM_TestOthers.py
12946 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12947 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12948 self._autoPublish(aGroup, theName, "group")
12951 ## Returns a list of sub-objects ID stored in the group
12952 # @param theGroup is a GEOM group for which a list of IDs is requested
12954 # @ref swig_GetObjectIDs "Example"
12955 @ManageTransactions("GroupOp")
12956 def GetObjectIDs(self,theGroup):
12958 Returns a list of sub-objects ID stored in the group
12961 theGroup is a GEOM group for which a list of IDs is requested
12963 # Example: see GEOM_TestOthers.py
12964 ListIDs = self.GroupOp.GetObjects(theGroup)
12965 RaiseIfFailed("GetObjects", self.GroupOp)
12968 ## Returns a type of sub-objects stored in the group
12969 # @param theGroup is a GEOM group which type is returned.
12971 # @ref swig_GetType "Example"
12972 @ManageTransactions("GroupOp")
12973 def GetType(self,theGroup):
12975 Returns a type of sub-objects stored in the group
12978 theGroup is a GEOM group which type is returned.
12980 # Example: see GEOM_TestOthers.py
12981 aType = self.GroupOp.GetType(theGroup)
12982 RaiseIfFailed("GetType", self.GroupOp)
12985 ## Convert a type of geom object from id to string value
12986 # @param theId is a GEOM obect type id.
12987 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12988 # @ref swig_GetType "Example"
12989 def ShapeIdToType(self, theId):
12991 Convert a type of geom object from id to string value
12994 theId is a GEOM obect type id.
12997 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13024 return "REVOLUTION"
13072 return "FREE_BOUNDS"
13080 return "THRUSECTIONS"
13082 return "COMPOUNDFILTER"
13084 return "SHAPES_ON_SHAPE"
13086 return "ELLIPSE_ARC"
13088 return "3DSKETCHER"
13094 return "PIPETSHAPE"
13095 return "Shape Id not exist."
13097 ## Returns a main shape associated with the group
13098 # @param theGroup is a GEOM group for which a main shape object is requested
13099 # @return a GEOM object which is a main shape for theGroup
13101 # @ref swig_GetMainShape "Example"
13102 @ManageTransactions("GroupOp")
13103 def GetMainShape(self,theGroup):
13105 Returns a main shape associated with the group
13108 theGroup is a GEOM group for which a main shape object is requested
13111 a GEOM object which is a main shape for theGroup
13113 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13115 # Example: see GEOM_TestOthers.py
13116 anObj = self.GroupOp.GetMainShape(theGroup)
13117 RaiseIfFailed("GetMainShape", self.GroupOp)
13120 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13121 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13122 # @param theShape given shape (see GEOM.GEOM_Object)
13123 # @param min_length minimum length of edges of theShape
13124 # @param max_length maximum length of edges of theShape
13125 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13126 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13127 # @param theName Object name; when specified, this parameter is used
13128 # for result publication in the study. Otherwise, if automatic
13129 # publication is switched on, default value is used for result name.
13131 # @return a newly created GEOM group of edges
13133 # @@ref swig_todo "Example"
13134 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13136 Create group of edges of theShape, whose length is in range [min_length, max_length].
13137 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13140 theShape given shape
13141 min_length minimum length of edges of theShape
13142 max_length maximum length of edges of theShape
13143 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13144 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13145 theName Object name; when specified, this parameter is used
13146 for result publication in the study. Otherwise, if automatic
13147 publication is switched on, default value is used for result name.
13150 a newly created GEOM group of edges.
13152 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13153 edges_in_range = []
13155 Props = self.BasicProperties(edge)
13156 if min_length <= Props[0] and Props[0] <= max_length:
13157 if (not include_min) and (min_length == Props[0]):
13160 if (not include_max) and (Props[0] == max_length):
13163 edges_in_range.append(edge)
13165 if len(edges_in_range) <= 0:
13166 print "No edges found by given criteria"
13169 # note: auto-publishing is done in self.CreateGroup()
13170 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13171 self.UnionList(group_edges, edges_in_range)
13175 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13176 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13177 # @param min_length minimum length of edges of selected shape
13178 # @param max_length maximum length of edges of selected shape
13179 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13180 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13181 # @return a newly created GEOM group of edges
13182 # @ref swig_todo "Example"
13183 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13185 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13186 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13189 min_length minimum length of edges of selected shape
13190 max_length maximum length of edges of selected shape
13191 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13192 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13195 a newly created GEOM group of edges.
13197 nb_selected = sg.SelectedCount()
13198 if nb_selected < 1:
13199 print "Select a shape before calling this function, please."
13201 if nb_selected > 1:
13202 print "Only one shape must be selected"
13205 id_shape = sg.getSelected(0)
13206 shape = IDToObject( id_shape )
13208 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13212 if include_min: left_str = " <= "
13213 if include_max: right_str = " <= "
13215 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
13216 + left_str + "length" + right_str + `max_length`)
13218 sg.updateObjBrowser(1)
13225 #@@ insert new functions before this line @@ do not remove this line @@#
13227 ## Create a copy of the given object
13229 # @param theOriginal geometry object for copy
13230 # @param theName Object name; when specified, this parameter is used
13231 # for result publication in the study. Otherwise, if automatic
13232 # publication is switched on, default value is used for result name.
13234 # @return New GEOM_Object, containing the copied shape.
13236 # @ingroup l1_geomBuilder_auxiliary
13237 # @ref swig_MakeCopy "Example"
13238 @ManageTransactions("InsertOp")
13239 def MakeCopy(self, theOriginal, theName=None):
13241 Create a copy of the given object
13244 theOriginal geometry object for copy
13245 theName Object name; when specified, this parameter is used
13246 for result publication in the study. Otherwise, if automatic
13247 publication is switched on, default value is used for result name.
13250 New GEOM_Object, containing the copied shape.
13252 Example of usage: Copy = geompy.MakeCopy(Box)
13254 # Example: see GEOM_TestAll.py
13255 anObj = self.InsertOp.MakeCopy(theOriginal)
13256 RaiseIfFailed("MakeCopy", self.InsertOp)
13257 self._autoPublish(anObj, theName, "copy")
13260 ## Add Path to load python scripts from
13261 # @param Path a path to load python scripts from
13262 # @ingroup l1_geomBuilder_auxiliary
13263 def addPath(self,Path):
13265 Add Path to load python scripts from
13268 Path a path to load python scripts from
13270 if (sys.path.count(Path) < 1):
13271 sys.path.append(Path)
13275 ## Load marker texture from the file
13276 # @param Path a path to the texture file
13277 # @return unique texture identifier
13278 # @ingroup l1_geomBuilder_auxiliary
13279 @ManageTransactions("InsertOp")
13280 def LoadTexture(self, Path):
13282 Load marker texture from the file
13285 Path a path to the texture file
13288 unique texture identifier
13290 # Example: see GEOM_TestAll.py
13291 ID = self.InsertOp.LoadTexture(Path)
13292 RaiseIfFailed("LoadTexture", self.InsertOp)
13295 ## Get internal name of the object based on its study entry
13296 # @note This method does not provide an unique identifier of the geometry object.
13297 # @note This is internal function of GEOM component, though it can be used outside it for
13298 # appropriate reason (e.g. for identification of geometry object).
13299 # @param obj geometry object
13300 # @return unique object identifier
13301 # @ingroup l1_geomBuilder_auxiliary
13302 def getObjectID(self, obj):
13304 Get internal name of the object based on its study entry.
13305 Note: this method does not provide an unique identifier of the geometry object.
13306 It is an internal function of GEOM component, though it can be used outside GEOM for
13307 appropriate reason (e.g. for identification of geometry object).
13310 obj geometry object
13313 unique object identifier
13316 entry = salome.ObjectToID(obj)
13317 if entry is not None:
13318 lst = entry.split(":")
13320 ID = lst[-1] # -1 means last item in the list
13321 return "GEOM_" + ID
13326 ## Add marker texture. @a Width and @a Height parameters
13327 # specify width and height of the texture in pixels.
13328 # If @a RowData is @c True, @a Texture parameter should represent texture data
13329 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13330 # parameter should be unpacked string, in which '1' symbols represent opaque
13331 # pixels and '0' represent transparent pixels of the texture bitmap.
13333 # @param Width texture width in pixels
13334 # @param Height texture height in pixels
13335 # @param Texture texture data
13336 # @param RowData if @c True, @a Texture data are packed in the byte stream
13337 # @return unique texture identifier
13338 # @ingroup l1_geomBuilder_auxiliary
13339 @ManageTransactions("InsertOp")
13340 def AddTexture(self, Width, Height, Texture, RowData=False):
13342 Add marker texture. Width and Height parameters
13343 specify width and height of the texture in pixels.
13344 If RowData is True, Texture parameter should represent texture data
13345 packed into the byte array. If RowData is False (default), Texture
13346 parameter should be unpacked string, in which '1' symbols represent opaque
13347 pixels and '0' represent transparent pixels of the texture bitmap.
13350 Width texture width in pixels
13351 Height texture height in pixels
13352 Texture texture data
13353 RowData if True, Texture data are packed in the byte stream
13356 return unique texture identifier
13358 if not RowData: Texture = PackData(Texture)
13359 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13360 RaiseIfFailed("AddTexture", self.InsertOp)
13363 ## Transfer not topological data from one GEOM object to another.
13365 # @param theObjectFrom the source object of non-topological data
13366 # @param theObjectTo the destination object of non-topological data
13367 # @param theFindMethod method to search sub-shapes of theObjectFrom
13368 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13369 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13370 # Other values of GEOM.find_shape_method are not supported.
13372 # @return True in case of success; False otherwise.
13374 # @ingroup l1_geomBuilder_auxiliary
13376 # @ref swig_TransferData "Example"
13377 @ManageTransactions("InsertOp")
13378 def TransferData(self, theObjectFrom, theObjectTo,
13379 theFindMethod=GEOM.FSM_GetInPlace):
13381 Transfer not topological data from one GEOM object to another.
13384 theObjectFrom the source object of non-topological data
13385 theObjectTo the destination object of non-topological data
13386 theFindMethod method to search sub-shapes of theObjectFrom
13387 in shape theObjectTo. Possible values are:
13388 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13389 and GEOM.FSM_GetInPlace_Old. Other values of
13390 GEOM.find_shape_method are not supported.
13393 True in case of success; False otherwise.
13395 # Example: see GEOM_TestOthers.py
13397 # Example: see GEOM_TestAll.py
13398 isOk = self.InsertOp.TransferData(theObjectFrom,
13399 theObjectTo, theFindMethod)
13400 RaiseIfFailed("TransferData", self.InsertOp)
13403 ## Creates a new folder object. It is a container for any GEOM objects.
13404 # @param Name name of the container
13405 # @param Father parent object. If None,
13406 # folder under 'Geometry' root object will be created.
13407 # @return a new created folder
13408 # @ingroup l1_publish_data
13409 def NewFolder(self, Name, Father=None):
13411 Create a new folder object. It is an auxiliary container for any GEOM objects.
13414 Name name of the container
13415 Father parent object. If None,
13416 folder under 'Geometry' root object will be created.
13419 a new created folder
13421 if not Father: Father = self.father
13422 return self.CreateFolder(Name, Father)
13424 ## Move object to the specified folder
13425 # @param Object object to move
13426 # @param Folder target folder
13427 # @ingroup l1_publish_data
13428 def PutToFolder(self, Object, Folder):
13430 Move object to the specified folder
13433 Object object to move
13434 Folder target folder
13436 self.MoveToFolder(Object, Folder)
13439 ## Move list of objects to the specified folder
13440 # @param ListOfSO list of objects to move
13441 # @param Folder target folder
13442 # @ingroup l1_publish_data
13443 def PutListToFolder(self, ListOfSO, Folder):
13445 Move list of objects to the specified folder
13448 ListOfSO list of objects to move
13449 Folder target folder
13451 self.MoveListToFolder(ListOfSO, Folder)
13454 ## @addtogroup l2_field
13458 # @param shape the shape the field lies on
13459 # @param name the field name
13460 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13461 # @param dimension dimension of the shape the field lies on
13462 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13463 # @param componentNames names of components
13464 # @return a created field
13465 @ManageTransactions("FieldOp")
13466 def CreateField(self, shape, name, type, dimension, componentNames):
13471 shape the shape the field lies on
13472 name the field name
13473 type type of field data
13474 dimension dimension of the shape the field lies on
13475 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13476 componentNames names of components
13481 if isinstance( type, int ):
13482 if type < 0 or type > 3:
13483 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13484 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13486 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13487 RaiseIfFailed("CreateField", self.FieldOp)
13489 geom._autoPublish( f, "", name)
13492 ## Removes a field from the GEOM component
13493 # @param field the field to remove
13494 def RemoveField(self, field):
13495 "Removes a field from the GEOM component"
13497 if isinstance( field, GEOM._objref_GEOM_Field ):
13498 geom.RemoveObject( field )
13499 elif isinstance( field, geomField ):
13500 geom.RemoveObject( field.field )
13502 raise RuntimeError, "RemoveField() : the object is not a field"
13505 ## Returns number of fields on a shape
13506 @ManageTransactions("FieldOp")
13507 def CountFields(self, shape):
13508 "Returns number of fields on a shape"
13509 nb = self.FieldOp.CountFields( shape )
13510 RaiseIfFailed("CountFields", self.FieldOp)
13513 ## Returns all fields on a shape
13514 @ManageTransactions("FieldOp")
13515 def GetFields(self, shape):
13516 "Returns all fields on a shape"
13517 ff = self.FieldOp.GetFields( shape )
13518 RaiseIfFailed("GetFields", self.FieldOp)
13521 ## Returns a field on a shape by its name
13522 @ManageTransactions("FieldOp")
13523 def GetField(self, shape, name):
13524 "Returns a field on a shape by its name"
13525 f = self.FieldOp.GetField( shape, name )
13526 RaiseIfFailed("GetField", self.FieldOp)
13534 # Register the new proxy for GEOM_Gen
13535 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13538 ## Field on Geometry
13539 # @ingroup l2_field
13540 class geomField( GEOM._objref_GEOM_Field ):
13542 def __init__(self):
13543 GEOM._objref_GEOM_Field.__init__(self)
13544 self.field = GEOM._objref_GEOM_Field
13547 ## Returns the shape the field lies on
13548 def getShape(self):
13549 "Returns the shape the field lies on"
13550 return self.field.GetShape(self)
13552 ## Returns the field name
13554 "Returns the field name"
13555 return self.field.GetName(self)
13557 ## Returns type of field data as integer [0-3]
13559 "Returns type of field data"
13560 return self.field.GetDataType(self)._v
13562 ## Returns type of field data:
13563 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13564 def getTypeEnum(self):
13565 "Returns type of field data"
13566 return self.field.GetDataType(self)
13568 ## Returns dimension of the shape the field lies on:
13569 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13570 def getDimension(self):
13571 """Returns dimension of the shape the field lies on:
13572 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13573 return self.field.GetDimension(self)
13575 ## Returns names of components
13576 def getComponents(self):
13577 "Returns names of components"
13578 return self.field.GetComponents(self)
13580 ## Adds a time step to the field
13581 # @param step the time step number further used as the step identifier
13582 # @param stamp the time step time
13583 # @param values the values of the time step
13584 def addStep(self, step, stamp, values):
13585 "Adds a time step to the field"
13586 stp = self.field.AddStep( self, step, stamp )
13588 raise RuntimeError, \
13589 "Field.addStep() : Error: step %s already exists in this field"%step
13591 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13592 self.setValues( step, values )
13595 ## Remove a time step from the field
13596 def removeStep(self,step):
13597 "Remove a time step from the field"
13600 stepObj = self.field.GetStep( self, step )
13602 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13605 #traceback.print_exc()
13607 self.field.RemoveStep( self, step )
13609 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13612 ## Returns number of time steps in the field
13613 def countSteps(self):
13614 "Returns number of time steps in the field"
13615 return self.field.CountSteps(self)
13617 ## Returns a list of time step IDs in the field
13618 def getSteps(self):
13619 "Returns a list of time step IDs in the field"
13620 return self.field.GetSteps(self)
13622 ## Returns a time step by its ID
13623 def getStep(self,step):
13624 "Returns a time step by its ID"
13625 stp = self.field.GetStep(self, step)
13627 raise RuntimeError, "Step %s is missing from this field"%step
13630 ## Returns the time of the field step
13631 def getStamp(self,step):
13632 "Returns the time of the field step"
13633 return self.getStep(step).GetStamp()
13635 ## Changes the time of the field step
13636 def setStamp(self, step, stamp):
13637 "Changes the time of the field step"
13638 return self.getStep(step).SetStamp(stamp)
13640 ## Returns values of the field step
13641 def getValues(self, step):
13642 "Returns values of the field step"
13643 return self.getStep(step).GetValues()
13645 ## Changes values of the field step
13646 def setValues(self, step, values):
13647 "Changes values of the field step"
13648 stp = self.getStep(step)
13649 errBeg = "Field.setValues(values) : Error: "
13651 ok = stp.SetValues( values )
13652 except Exception, e:
13654 if excStr.find("WrongPythonType") > 0:
13655 raise RuntimeError, errBeg +\
13656 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13657 raise RuntimeError, errBeg + str(e)
13659 nbOK = self.field.GetArraySize(self)
13662 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13664 raise RuntimeError, errBeg + "failed"
13667 pass # end of class geomField
13669 # Register the new proxy for GEOM_Field
13670 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13673 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13674 # interface to GEOM operations.
13679 # salome.salome_init()
13680 # from salome.geom import geomBuilder
13681 # geompy = geomBuilder.New(salome.myStudy)
13683 # @param study SALOME study, generally obtained by salome.myStudy.
13684 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13685 # @return geomBuilder instance
13686 def New( study, instance=None):
13688 Create a new geomBuilder instance.The geomBuilder class provides the Python
13689 interface to GEOM operations.
13693 salome.salome_init()
13694 from salome.geom import geomBuilder
13695 geompy = geomBuilder.New(salome.myStudy)
13698 study SALOME study, generally obtained by salome.myStudy.
13699 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13701 geomBuilder instance
13703 #print "New geomBuilder ", study, instance
13710 geom = geomBuilder()
13711 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13712 geom.init_geom(study)
13716 # Register methods from the plug-ins in the geomBuilder class
13717 plugins_var = os.environ.get( "GEOM_PluginsList" )
13720 if plugins_var is not None:
13721 plugins = plugins_var.split( ":" )
13722 plugins=filter(lambda x: len(x)>0, plugins)
13723 if plugins is not None:
13724 for pluginName in plugins:
13725 pluginBuilderName = pluginName + "Builder"
13727 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
13728 except Exception, e:
13729 from salome_utils import verbose
13730 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
13732 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
13733 plugin = eval( pluginBuilderName )
13735 # add methods from plugin module to the geomBuilder class
13736 for k in dir( plugin ):
13737 if k[0] == '_': continue
13738 method = getattr( plugin, k )
13739 if type( method ).__name__ == 'function':
13740 if not hasattr( geomBuilder, k ):
13741 setattr( geomBuilder, k, method )