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 if theA<=0. or theA>=2*math.pi:
3059 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3060 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3061 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3062 anObj.SetParameters(Parameters)
3063 self._autoPublish(anObj, theName, "cylinder")
3066 ## Create a cylinder with given radius and height at
3067 # the origin of coordinate system. Axis of the cylinder
3068 # will be collinear to the OZ axis of the coordinate system.
3069 # @param theR Cylinder radius.
3070 # @param theH Cylinder height.
3071 # @param theName Object name; when specified, this parameter is used
3072 # for result publication in the study. Otherwise, if automatic
3073 # publication is switched on, default value is used for result name.
3075 # @return New GEOM.GEOM_Object, containing the created cylinder.
3077 # @ref tui_creation_cylinder "Example"
3078 @ManageTransactions("PrimOp")
3079 def MakeCylinderRH(self, theR, theH, theName=None):
3081 Create a cylinder with given radius and height at
3082 the origin of coordinate system. Axis of the cylinder
3083 will be collinear to the OZ axis of the coordinate system.
3086 theR Cylinder radius.
3087 theH Cylinder height.
3088 theName Object name; when specified, this parameter is used
3089 for result publication in the study. Otherwise, if automatic
3090 publication is switched on, default value is used for result name.
3093 New GEOM.GEOM_Object, containing the created cylinder.
3095 # Example: see GEOM_TestAll.py
3096 theR,theH,Parameters = ParseParameters(theR, theH)
3097 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3098 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3099 anObj.SetParameters(Parameters)
3100 self._autoPublish(anObj, theName, "cylinder")
3103 ## Create a portion of cylinder with given radius, height and angle at
3104 # the origin of coordinate system. Axis of the cylinder
3105 # will be collinear to the OZ axis of the coordinate system.
3106 # @param theR Cylinder radius.
3107 # @param theH Cylinder height.
3108 # @param theA Cylinder angle in radians.
3109 # @param theName Object name; when specified, this parameter is used
3110 # for result publication in the study. Otherwise, if automatic
3111 # publication is switched on, default value is used for result name.
3113 # @return New GEOM.GEOM_Object, containing the created cylinder.
3115 # @ref tui_creation_cylinder "Example"
3116 @ManageTransactions("PrimOp")
3117 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3119 Create a portion of cylinder with given radius, height and angle at
3120 the origin of coordinate system. Axis of the cylinder
3121 will be collinear to the OZ axis of the coordinate system.
3124 theR Cylinder radius.
3125 theH Cylinder height.
3126 theA Cylinder angle in radians.
3127 theName Object name; when specified, this parameter is used
3128 for result publication in the study. Otherwise, if automatic
3129 publication is switched on, default value is used for result name.
3132 New GEOM.GEOM_Object, containing the created cylinder.
3134 # Example: see GEOM_TestAll.py
3136 if isinstance(theA,str):
3138 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3140 theA = theA*math.pi/180.
3141 if theA<=0. or theA>=2*math.pi:
3142 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3143 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3144 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3145 anObj.SetParameters(Parameters)
3146 self._autoPublish(anObj, theName, "cylinder")
3149 ## Create a sphere with given center and radius.
3150 # @param thePnt Sphere center.
3151 # @param theR Sphere radius.
3152 # @param theName Object name; when specified, this parameter is used
3153 # for result publication in the study. Otherwise, if automatic
3154 # publication is switched on, default value is used for result name.
3156 # @return New GEOM.GEOM_Object, containing the created sphere.
3158 # @ref tui_creation_sphere "Example"
3159 @ManageTransactions("PrimOp")
3160 def MakeSpherePntR(self, thePnt, theR, theName=None):
3162 Create a sphere with given center and radius.
3165 thePnt Sphere center.
3167 theName Object name; when specified, this parameter is used
3168 for result publication in the study. Otherwise, if automatic
3169 publication is switched on, default value is used for result name.
3172 New GEOM.GEOM_Object, containing the created sphere.
3174 # Example: see GEOM_TestAll.py
3175 theR,Parameters = ParseParameters(theR)
3176 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3177 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3178 anObj.SetParameters(Parameters)
3179 self._autoPublish(anObj, theName, "sphere")
3182 ## Create a sphere with given center and radius.
3183 # @param x,y,z Coordinates of sphere center.
3184 # @param theR Sphere radius.
3185 # @param theName Object name; when specified, this parameter is used
3186 # for result publication in the study. Otherwise, if automatic
3187 # publication is switched on, default value is used for result name.
3189 # @return New GEOM.GEOM_Object, containing the created sphere.
3191 # @ref tui_creation_sphere "Example"
3192 def MakeSphere(self, x, y, z, theR, theName=None):
3194 Create a sphere with given center and radius.
3197 x,y,z Coordinates of sphere center.
3199 theName Object name; when specified, this parameter is used
3200 for result publication in the study. Otherwise, if automatic
3201 publication is switched on, default value is used for result name.
3204 New GEOM.GEOM_Object, containing the created sphere.
3206 # Example: see GEOM_TestAll.py
3207 point = self.MakeVertex(x, y, z)
3208 # note: auto-publishing is done in self.MakeSpherePntR()
3209 anObj = self.MakeSpherePntR(point, theR, theName)
3212 ## Create a sphere with given radius at the origin of coordinate system.
3213 # @param theR Sphere radius.
3214 # @param theName Object name; when specified, this parameter is used
3215 # for result publication in the study. Otherwise, if automatic
3216 # publication is switched on, default value is used for result name.
3218 # @return New GEOM.GEOM_Object, containing the created sphere.
3220 # @ref tui_creation_sphere "Example"
3221 @ManageTransactions("PrimOp")
3222 def MakeSphereR(self, theR, theName=None):
3224 Create a sphere with given radius at the origin of coordinate system.
3228 theName Object name; when specified, this parameter is used
3229 for result publication in the study. Otherwise, if automatic
3230 publication is switched on, default value is used for result name.
3233 New GEOM.GEOM_Object, containing the created sphere.
3235 # Example: see GEOM_TestAll.py
3236 theR,Parameters = ParseParameters(theR)
3237 anObj = self.PrimOp.MakeSphereR(theR)
3238 RaiseIfFailed("MakeSphereR", self.PrimOp)
3239 anObj.SetParameters(Parameters)
3240 self._autoPublish(anObj, theName, "sphere")
3243 ## Create a cone with given base point, axis, height and radiuses.
3244 # @param thePnt Central point of the first cone base.
3245 # @param theAxis Cone axis.
3246 # @param theR1 Radius of the first cone base.
3247 # @param theR2 Radius of the second cone base.
3248 # \note If both radiuses are non-zero, the cone will be truncated.
3249 # \note If the radiuses are equal, a cylinder will be created instead.
3250 # @param theH Cone height.
3251 # @param theName Object name; when specified, this parameter is used
3252 # for result publication in the study. Otherwise, if automatic
3253 # publication is switched on, default value is used for result name.
3255 # @return New GEOM.GEOM_Object, containing the created cone.
3257 # @ref tui_creation_cone "Example"
3258 @ManageTransactions("PrimOp")
3259 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3261 Create a cone with given base point, axis, height and radiuses.
3264 thePnt Central point of the first cone base.
3266 theR1 Radius of the first cone base.
3267 theR2 Radius of the second cone base.
3269 theName Object name; when specified, this parameter is used
3270 for result publication in the study. Otherwise, if automatic
3271 publication is switched on, default value is used for result name.
3274 If both radiuses are non-zero, the cone will be truncated.
3275 If the radiuses are equal, a cylinder will be created instead.
3278 New GEOM.GEOM_Object, containing the created cone.
3280 # Example: see GEOM_TestAll.py
3281 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3282 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3283 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3284 anObj.SetParameters(Parameters)
3285 self._autoPublish(anObj, theName, "cone")
3288 ## Create a cone with given height and radiuses at
3289 # the origin of coordinate system. Axis of the cone will
3290 # be collinear to the OZ axis of the coordinate system.
3291 # @param theR1 Radius of the first cone base.
3292 # @param theR2 Radius of the second cone base.
3293 # \note If both radiuses are non-zero, the cone will be truncated.
3294 # \note If the radiuses are equal, a cylinder will be created instead.
3295 # @param theH Cone height.
3296 # @param theName Object name; when specified, this parameter is used
3297 # for result publication in the study. Otherwise, if automatic
3298 # publication is switched on, default value is used for result name.
3300 # @return New GEOM.GEOM_Object, containing the created cone.
3302 # @ref tui_creation_cone "Example"
3303 @ManageTransactions("PrimOp")
3304 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3306 Create a cone with given height and radiuses at
3307 the origin of coordinate system. Axis of the cone will
3308 be collinear to the OZ axis of the coordinate system.
3311 theR1 Radius of the first cone base.
3312 theR2 Radius of the second cone base.
3314 theName Object name; when specified, this parameter is used
3315 for result publication in the study. Otherwise, if automatic
3316 publication is switched on, default value is used for result name.
3319 If both radiuses are non-zero, the cone will be truncated.
3320 If the radiuses are equal, a cylinder will be created instead.
3323 New GEOM.GEOM_Object, containing the created cone.
3325 # Example: see GEOM_TestAll.py
3326 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3327 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3328 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3329 anObj.SetParameters(Parameters)
3330 self._autoPublish(anObj, theName, "cone")
3333 ## Create a torus with given center, normal vector and radiuses.
3334 # @param thePnt Torus central point.
3335 # @param theVec Torus axis of symmetry.
3336 # @param theRMajor Torus major radius.
3337 # @param theRMinor Torus minor radius.
3338 # @param theName Object name; when specified, this parameter is used
3339 # for result publication in the study. Otherwise, if automatic
3340 # publication is switched on, default value is used for result name.
3342 # @return New GEOM.GEOM_Object, containing the created torus.
3344 # @ref tui_creation_torus "Example"
3345 @ManageTransactions("PrimOp")
3346 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3348 Create a torus with given center, normal vector and radiuses.
3351 thePnt Torus central point.
3352 theVec Torus axis of symmetry.
3353 theRMajor Torus major radius.
3354 theRMinor Torus minor radius.
3355 theName Object name; when specified, this parameter is used
3356 for result publication in the study. Otherwise, if automatic
3357 publication is switched on, default value is used for result name.
3360 New GEOM.GEOM_Object, containing the created torus.
3362 # Example: see GEOM_TestAll.py
3363 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3364 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3365 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3366 anObj.SetParameters(Parameters)
3367 self._autoPublish(anObj, theName, "torus")
3370 ## Create a torus with given radiuses at the origin of coordinate system.
3371 # @param theRMajor Torus major radius.
3372 # @param theRMinor Torus minor radius.
3373 # @param theName Object name; when specified, this parameter is used
3374 # for result publication in the study. Otherwise, if automatic
3375 # publication is switched on, default value is used for result name.
3377 # @return New GEOM.GEOM_Object, containing the created torus.
3379 # @ref tui_creation_torus "Example"
3380 @ManageTransactions("PrimOp")
3381 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3383 Create a torus with given radiuses at the origin of coordinate system.
3386 theRMajor Torus major radius.
3387 theRMinor Torus minor radius.
3388 theName Object name; when specified, this parameter is used
3389 for result publication in the study. Otherwise, if automatic
3390 publication is switched on, default value is used for result name.
3393 New GEOM.GEOM_Object, containing the created torus.
3395 # Example: see GEOM_TestAll.py
3396 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3397 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3398 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3399 anObj.SetParameters(Parameters)
3400 self._autoPublish(anObj, theName, "torus")
3403 # end of l3_3d_primitives
3406 ## @addtogroup l3_complex
3409 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3410 # @param theBase Base shape to be extruded.
3411 # @param thePoint1 First end of extrusion vector.
3412 # @param thePoint2 Second end of extrusion vector.
3413 # @param theScaleFactor Use it to make prism with scaled second base.
3414 # Nagative value means not scaled second base.
3415 # @param theName Object name; when specified, this parameter is used
3416 # for result publication in the study. Otherwise, if automatic
3417 # publication is switched on, default value is used for result name.
3419 # @return New GEOM.GEOM_Object, containing the created prism.
3421 # @ref tui_creation_prism "Example"
3422 @ManageTransactions("PrimOp")
3423 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3425 Create a shape by extrusion of the base shape along a vector, defined by two points.
3428 theBase Base shape to be extruded.
3429 thePoint1 First end of extrusion vector.
3430 thePoint2 Second end of extrusion vector.
3431 theScaleFactor Use it to make prism with scaled second base.
3432 Nagative value means not scaled second base.
3433 theName Object name; when specified, this parameter is used
3434 for result publication in the study. Otherwise, if automatic
3435 publication is switched on, default value is used for result name.
3438 New GEOM.GEOM_Object, containing the created prism.
3440 # Example: see GEOM_TestAll.py
3443 if theScaleFactor > 0:
3444 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3445 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3447 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3448 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3449 anObj.SetParameters(Parameters)
3450 self._autoPublish(anObj, theName, "prism")
3453 ## Create a shape by extrusion of the base shape along a
3454 # vector, defined by two points, in 2 Ways (forward/backward).
3455 # @param theBase Base shape to be extruded.
3456 # @param thePoint1 First end of extrusion vector.
3457 # @param thePoint2 Second end of extrusion vector.
3458 # @param theName Object name; when specified, this parameter is used
3459 # for result publication in the study. Otherwise, if automatic
3460 # publication is switched on, default value is used for result name.
3462 # @return New GEOM.GEOM_Object, containing the created prism.
3464 # @ref tui_creation_prism "Example"
3465 @ManageTransactions("PrimOp")
3466 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3468 Create a shape by extrusion of the base shape along a
3469 vector, defined by two points, in 2 Ways (forward/backward).
3472 theBase Base shape to be extruded.
3473 thePoint1 First end of extrusion vector.
3474 thePoint2 Second end of extrusion vector.
3475 theName Object name; when specified, this parameter is used
3476 for result publication in the study. Otherwise, if automatic
3477 publication is switched on, default value is used for result name.
3480 New GEOM.GEOM_Object, containing the created prism.
3482 # Example: see GEOM_TestAll.py
3483 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3484 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3485 self._autoPublish(anObj, theName, "prism")
3488 ## Create a shape by extrusion of the base shape along the vector,
3489 # i.e. all the space, transfixed by the base shape during its translation
3490 # along the vector on the given distance.
3491 # @param theBase Base shape to be extruded.
3492 # @param theVec Direction of extrusion.
3493 # @param theH Prism dimension along theVec.
3494 # @param theScaleFactor Use it to make prism with scaled second base.
3495 # Negative value means not scaled second base.
3496 # @param theName Object name; when specified, this parameter is used
3497 # for result publication in the study. Otherwise, if automatic
3498 # publication is switched on, default value is used for result name.
3500 # @return New GEOM.GEOM_Object, containing the created prism.
3502 # @ref tui_creation_prism "Example"
3503 @ManageTransactions("PrimOp")
3504 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3506 Create a shape by extrusion of the base shape along the vector,
3507 i.e. all the space, transfixed by the base shape during its translation
3508 along the vector on the given distance.
3511 theBase Base shape to be extruded.
3512 theVec Direction of extrusion.
3513 theH Prism dimension along theVec.
3514 theScaleFactor Use it to make prism with scaled second base.
3515 Negative value means not scaled second base.
3516 theName Object name; when specified, this parameter is used
3517 for result publication in the study. Otherwise, if automatic
3518 publication is switched on, default value is used for result name.
3521 New GEOM.GEOM_Object, containing the created prism.
3523 # Example: see GEOM_TestAll.py
3526 if theScaleFactor > 0:
3527 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3528 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3530 theH,Parameters = ParseParameters(theH)
3531 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3532 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3533 anObj.SetParameters(Parameters)
3534 self._autoPublish(anObj, theName, "prism")
3537 ## Create a shape by extrusion of the base shape along the vector,
3538 # i.e. all the space, transfixed by the base shape during its translation
3539 # along the vector on the given distance in 2 Ways (forward/backward).
3540 # @param theBase Base shape to be extruded.
3541 # @param theVec Direction of extrusion.
3542 # @param theH Prism dimension along theVec in forward direction.
3543 # @param theName Object name; when specified, this parameter is used
3544 # for result publication in the study. Otherwise, if automatic
3545 # publication is switched on, default value is used for result name.
3547 # @return New GEOM.GEOM_Object, containing the created prism.
3549 # @ref tui_creation_prism "Example"
3550 @ManageTransactions("PrimOp")
3551 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3553 Create a shape by extrusion of the base shape along the vector,
3554 i.e. all the space, transfixed by the base shape during its translation
3555 along the vector on the given distance in 2 Ways (forward/backward).
3558 theBase Base shape to be extruded.
3559 theVec Direction of extrusion.
3560 theH Prism dimension along theVec in forward direction.
3561 theName Object name; when specified, this parameter is used
3562 for result publication in the study. Otherwise, if automatic
3563 publication is switched on, default value is used for result name.
3566 New GEOM.GEOM_Object, containing the created prism.
3568 # Example: see GEOM_TestAll.py
3569 theH,Parameters = ParseParameters(theH)
3570 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3571 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3572 anObj.SetParameters(Parameters)
3573 self._autoPublish(anObj, theName, "prism")
3576 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3577 # @param theBase Base shape to be extruded.
3578 # @param theDX, theDY, theDZ Directions of extrusion.
3579 # @param theScaleFactor Use it to make prism with scaled second base.
3580 # Nagative value means not scaled second base.
3581 # @param theName Object name; when specified, this parameter is used
3582 # for result publication in the study. Otherwise, if automatic
3583 # publication is switched on, default value is used for result name.
3585 # @return New GEOM.GEOM_Object, containing the created prism.
3587 # @ref tui_creation_prism "Example"
3588 @ManageTransactions("PrimOp")
3589 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3591 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3594 theBase Base shape to be extruded.
3595 theDX, theDY, theDZ Directions of extrusion.
3596 theScaleFactor Use it to make prism with scaled second base.
3597 Nagative value means not scaled second base.
3598 theName Object name; when specified, this parameter is used
3599 for result publication in the study. Otherwise, if automatic
3600 publication is switched on, default value is used for result name.
3603 New GEOM.GEOM_Object, containing the created prism.
3605 # Example: see GEOM_TestAll.py
3608 if theScaleFactor > 0:
3609 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3610 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3612 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3613 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3614 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3615 anObj.SetParameters(Parameters)
3616 self._autoPublish(anObj, theName, "prism")
3619 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3620 # i.e. all the space, transfixed by the base shape during its translation
3621 # along the vector on the given distance in 2 Ways (forward/backward).
3622 # @param theBase Base shape to be extruded.
3623 # @param theDX, theDY, theDZ Directions of extrusion.
3624 # @param theName Object name; when specified, this parameter is used
3625 # for result publication in the study. Otherwise, if automatic
3626 # publication is switched on, default value is used for result name.
3628 # @return New GEOM.GEOM_Object, containing the created prism.
3630 # @ref tui_creation_prism "Example"
3631 @ManageTransactions("PrimOp")
3632 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3634 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3635 i.e. all the space, transfixed by the base shape during its translation
3636 along the vector on the given distance in 2 Ways (forward/backward).
3639 theBase Base shape to be extruded.
3640 theDX, theDY, theDZ Directions of extrusion.
3641 theName Object name; when specified, this parameter is used
3642 for result publication in the study. Otherwise, if automatic
3643 publication is switched on, default value is used for result name.
3646 New GEOM.GEOM_Object, containing the created prism.
3648 # Example: see GEOM_TestAll.py
3649 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3650 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3651 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3652 anObj.SetParameters(Parameters)
3653 self._autoPublish(anObj, theName, "prism")
3656 ## Create a shape by revolution of the base shape around the axis
3657 # on the given angle, i.e. all the space, transfixed by the base
3658 # shape during its rotation around the axis on the given angle.
3659 # @param theBase Base shape to be rotated.
3660 # @param theAxis Rotation axis.
3661 # @param theAngle Rotation angle in radians.
3662 # @param theName Object name; when specified, this parameter is used
3663 # for result publication in the study. Otherwise, if automatic
3664 # publication is switched on, default value is used for result name.
3666 # @return New GEOM.GEOM_Object, containing the created revolution.
3668 # @ref tui_creation_revolution "Example"
3669 @ManageTransactions("PrimOp")
3670 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3672 Create a shape by revolution of the base shape around the axis
3673 on the given angle, i.e. all the space, transfixed by the base
3674 shape during its rotation around the axis on the given angle.
3677 theBase Base shape to be rotated.
3678 theAxis Rotation axis.
3679 theAngle Rotation angle in radians.
3680 theName Object name; when specified, this parameter is used
3681 for result publication in the study. Otherwise, if automatic
3682 publication is switched on, default value is used for result name.
3685 New GEOM.GEOM_Object, containing the created revolution.
3687 # Example: see GEOM_TestAll.py
3688 theAngle,Parameters = ParseParameters(theAngle)
3689 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3690 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3691 anObj.SetParameters(Parameters)
3692 self._autoPublish(anObj, theName, "revolution")
3695 ## Create a shape by revolution of the base shape around the axis
3696 # on the given angle, i.e. all the space, transfixed by the base
3697 # shape during its rotation around the axis on the given angle in
3698 # both directions (forward/backward)
3699 # @param theBase Base shape to be rotated.
3700 # @param theAxis Rotation axis.
3701 # @param theAngle Rotation angle in radians.
3702 # @param theName Object name; when specified, this parameter is used
3703 # for result publication in the study. Otherwise, if automatic
3704 # publication is switched on, default value is used for result name.
3706 # @return New GEOM.GEOM_Object, containing the created revolution.
3708 # @ref tui_creation_revolution "Example"
3709 @ManageTransactions("PrimOp")
3710 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3712 Create a shape by revolution of the base shape around the axis
3713 on the given angle, i.e. all the space, transfixed by the base
3714 shape during its rotation around the axis on the given angle in
3715 both directions (forward/backward).
3718 theBase Base shape to be rotated.
3719 theAxis Rotation axis.
3720 theAngle Rotation angle in radians.
3721 theName Object name; when specified, this parameter is used
3722 for result publication in the study. Otherwise, if automatic
3723 publication is switched on, default value is used for result name.
3726 New GEOM.GEOM_Object, containing the created revolution.
3728 theAngle,Parameters = ParseParameters(theAngle)
3729 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3730 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3731 anObj.SetParameters(Parameters)
3732 self._autoPublish(anObj, theName, "revolution")
3735 ## Create a face from a given set of contours.
3736 # @param theContours either a list or a compound of edges/wires.
3737 # @param theMinDeg a minimal degree of BSpline surface to create.
3738 # @param theMaxDeg a maximal degree of BSpline surface to create.
3739 # @param theTol2D a 2d tolerance to be reached.
3740 # @param theTol3D a 3d tolerance to be reached.
3741 # @param theNbIter a number of iteration of approximation algorithm.
3742 # @param theMethod Kind of method to perform filling operation
3743 # (see GEOM.filling_oper_method enum).
3744 # @param isApprox if True, BSpline curves are generated in the process
3745 # of surface construction. By default it is False, that means
3746 # the surface is created using given curves. The usage of
3747 # Approximation makes the algorithm work slower, but allows
3748 # building the surface for rather complex cases.
3749 # @param theName Object name; when specified, this parameter is used
3750 # for result publication in the study. Otherwise, if automatic
3751 # publication is switched on, default value is used for result name.
3753 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3755 # @ref tui_creation_filling "Example"
3756 @ManageTransactions("PrimOp")
3757 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3758 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3760 Create a face from a given set of contours.
3763 theContours either a list or a compound of edges/wires.
3764 theMinDeg a minimal degree of BSpline surface to create.
3765 theMaxDeg a maximal degree of BSpline surface to create.
3766 theTol2D a 2d tolerance to be reached.
3767 theTol3D a 3d tolerance to be reached.
3768 theNbIter a number of iteration of approximation algorithm.
3769 theMethod Kind of method to perform filling operation
3770 (see GEOM.filling_oper_method enum).
3771 isApprox if True, BSpline curves are generated in the process
3772 of surface construction. By default it is False, that means
3773 the surface is created using given curves. The usage of
3774 Approximation makes the algorithm work slower, but allows
3775 building the surface for rather complex cases.
3776 theName Object name; when specified, this parameter is used
3777 for result publication in the study. Otherwise, if automatic
3778 publication is switched on, default value is used for result name.
3781 New GEOM.GEOM_Object (face), containing the created filling surface.
3784 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3786 # Example: see GEOM_TestAll.py
3787 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3788 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3789 theTol2D, theTol3D, theNbIter,
3790 theMethod, isApprox)
3791 RaiseIfFailed("MakeFilling", self.PrimOp)
3792 anObj.SetParameters(Parameters)
3793 self._autoPublish(anObj, theName, "filling")
3797 ## Create a face from a given set of contours.
3798 # This method corresponds to MakeFilling() with isApprox=True.
3799 # @param theContours either a list or a compound of edges/wires.
3800 # @param theMinDeg a minimal degree of BSpline surface to create.
3801 # @param theMaxDeg a maximal degree of BSpline surface to create.
3802 # @param theTol3D a 3d tolerance to be reached.
3803 # @param theName Object name; when specified, this parameter is used
3804 # for result publication in the study. Otherwise, if automatic
3805 # publication is switched on, default value is used for result name.
3807 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3809 # @ref tui_creation_filling "Example"
3810 @ManageTransactions("PrimOp")
3811 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3813 Create a filling from the given compound of contours.
3814 This method corresponds to MakeFilling() with isApprox=True.
3817 theContours either a list or a compound of edges/wires.
3818 theMinDeg a minimal degree of BSpline surface to create.
3819 theMaxDeg a maximal degree of BSpline surface to create.
3820 theTol3D a 3d tolerance to be reached.
3821 theName Object name; when specified, this parameter is used
3822 for result publication in the study. Otherwise, if automatic
3823 publication is switched on, default value is used for result name.
3826 New GEOM.GEOM_Object (face), containing the created filling surface.
3829 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3831 # Example: see GEOM_TestAll.py
3832 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3833 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3834 0, theTol3D, 0, GEOM.FOM_Default, True)
3835 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3836 anObj.SetParameters(Parameters)
3837 self._autoPublish(anObj, theName, "filling")
3840 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3841 # @param theSeqSections - set of specified sections.
3842 # @param theModeSolid - mode defining building solid or shell
3843 # @param thePreci - precision 3D used for smoothing
3844 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3845 # @param theName Object name; when specified, this parameter is used
3846 # for result publication in the study. Otherwise, if automatic
3847 # publication is switched on, default value is used for result name.
3849 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3851 # @ref swig_todo "Example"
3852 @ManageTransactions("PrimOp")
3853 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3855 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3858 theSeqSections - set of specified sections.
3859 theModeSolid - mode defining building solid or shell
3860 thePreci - precision 3D used for smoothing
3861 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3862 theName Object name; when specified, this parameter is used
3863 for result publication in the study. Otherwise, if automatic
3864 publication is switched on, default value is used for result name.
3867 New GEOM.GEOM_Object, containing the created shell or solid.
3869 # Example: see GEOM_TestAll.py
3870 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3871 RaiseIfFailed("MakeThruSections", self.PrimOp)
3872 self._autoPublish(anObj, theName, "filling")
3875 ## Create a shape by extrusion of the base shape along
3876 # the path shape. The path shape can be a wire or an edge. It is
3877 # possible to generate groups along with the result by means of
3878 # setting the flag \a IsGenerateGroups.<BR>
3879 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3880 # set, an error is occured. If \a thePath is not closed edge/wire,
3881 # the following groups are returned:
3882 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3884 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3887 # "Down" and "Up" groups contain:
3888 # - Edges if \a theBase is edge or wire;
3889 # - Faces if \a theBase is face or shell.<BR>
3891 # "Side1" and "Side2" groups contain edges generated from the first
3892 # and last vertices of \a theBase. The first and last vertices are
3893 # determined taking into account edge/wire orientation.<BR>
3894 # "Other" group represents faces generated from the bounding edges of
3897 # @param theBase Base shape to be extruded.
3898 # @param thePath Path shape to extrude the base shape along it.
3899 # @param IsGenerateGroups flag that tells if it is necessary to
3900 # create groups. It is equal to False by default.
3901 # @param theName Object name; when specified, this parameter is used
3902 # for result publication in the study. Otherwise, if automatic
3903 # publication is switched on, default value is used for result name.
3905 # @return New GEOM.GEOM_Object, containing the created pipe if
3906 # \a IsGenerateGroups is not set. Otherwise it returns new
3907 # GEOM.ListOfGO. Its first element is the created pipe, the
3908 # remaining ones are created groups.
3910 # @ref tui_creation_pipe "Example"
3911 @ManageTransactions("PrimOp")
3912 def MakePipe(self, theBase, thePath,
3913 IsGenerateGroups=False, theName=None):
3915 Create a shape by extrusion of the base shape along
3916 the path shape. The path shape can be a wire or an edge. It is
3917 possible to generate groups along with the result by means of
3918 setting the flag IsGenerateGroups.
3919 If thePath is a closed edge or wire and IsGenerateGroups is
3920 set, an error is occured. If thePath is not closed edge/wire,
3921 the following groups are returned:
3922 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
3924 - If theBase is closed edge or wire, face or shell: "Down", "Up",
3926 "Down" and "Up" groups contain:
3927 - Edges if theBase is edge or wire;
3928 - Faces if theBase is face or shell.
3929 "Side1" and "Side2" groups contain edges generated from the first
3930 and last vertices of theBase. The first and last vertices are
3931 determined taking into account edge/wire orientation.
3932 "Other" group represents faces generated from the bounding edges of
3936 theBase Base shape to be extruded.
3937 thePath Path shape to extrude the base shape along it.
3938 IsGenerateGroups flag that tells if it is necessary to
3939 create groups. It is equal to False by default.
3940 theName Object name; when specified, this parameter is used
3941 for result publication in the study. Otherwise, if automatic
3942 publication is switched on, default value is used for result name.
3945 New GEOM.GEOM_Object, containing the created pipe if
3946 IsGenerateGroups is not set. Otherwise it returns new
3947 GEOM.ListOfGO. Its first element is the created pipe, the
3948 remaining ones are created groups.
3950 # Example: see GEOM_TestAll.py
3951 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
3952 RaiseIfFailed("MakePipe", self.PrimOp)
3954 if IsGenerateGroups:
3955 self._autoPublish(aList, theName, "pipe")
3958 self._autoPublish(aList[0], theName, "pipe")
3961 ## Create a shape by extrusion of the profile shape along
3962 # the path shape. The path shape can be a wire or an edge.
3963 # the several profiles can be specified in the several locations of path.
3964 # It is possible to generate groups along with the result by means of
3965 # setting the flag \a IsGenerateGroups. For detailed information on
3966 # groups that can be created please see the method MakePipe().
3967 # @param theSeqBases - list of Bases shape to be extruded.
3968 # @param theLocations - list of locations on the path corresponding
3969 # specified list of the Bases shapes. Number of locations
3970 # should be equal to number of bases or list of locations can be empty.
3971 # @param thePath - Path shape to extrude the base shape along it.
3972 # @param theWithContact - the mode defining that the section is translated to be in
3973 # contact with the spine.
3974 # @param theWithCorrection - defining that the section is rotated to be
3975 # orthogonal to the spine tangent in the correspondent point
3976 # @param IsGenerateGroups - flag that tells if it is necessary to
3977 # create groups. It is equal to False by default.
3978 # @param theName Object name; when specified, this parameter is used
3979 # for result publication in the study. Otherwise, if automatic
3980 # publication is switched on, default value is used for result name.
3982 # @return New GEOM.GEOM_Object, containing the created pipe if
3983 # \a IsGenerateGroups is not set. Otherwise it returns new
3984 # GEOM.ListOfGO. Its first element is the created pipe, the
3985 # remaining ones are created groups.
3987 # @ref tui_creation_pipe_with_diff_sec "Example"
3988 @ManageTransactions("PrimOp")
3989 def MakePipeWithDifferentSections(self, theSeqBases,
3990 theLocations, thePath,
3991 theWithContact, theWithCorrection,
3992 IsGenerateGroups=False, theName=None):
3994 Create a shape by extrusion of the profile shape along
3995 the path shape. The path shape can be a wire or an edge.
3996 the several profiles can be specified in the several locations of path.
3997 It is possible to generate groups along with the result by means of
3998 setting the flag IsGenerateGroups. For detailed information on
3999 groups that can be created please see the method geompy.MakePipe().
4002 theSeqBases - list of Bases shape to be extruded.
4003 theLocations - list of locations on the path corresponding
4004 specified list of the Bases shapes. Number of locations
4005 should be equal to number of bases or list of locations can be empty.
4006 thePath - Path shape to extrude the base shape along it.
4007 theWithContact - the mode defining that the section is translated to be in
4008 contact with the spine(0/1)
4009 theWithCorrection - defining that the section is rotated to be
4010 orthogonal to the spine tangent in the correspondent point (0/1)
4011 IsGenerateGroups - flag that tells if it is necessary to
4012 create groups. It is equal to False by default.
4013 theName Object name; when specified, this parameter is used
4014 for result publication in the study. Otherwise, if automatic
4015 publication is switched on, default value is used for result name.
4018 New GEOM.GEOM_Object, containing the created pipe if
4019 IsGenerateGroups is not set. Otherwise it returns new
4020 GEOM.ListOfGO. Its first element is the created pipe, the
4021 remaining ones are created groups.
4023 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4024 theLocations, thePath,
4025 theWithContact, theWithCorrection,
4027 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4029 if IsGenerateGroups:
4030 self._autoPublish(aList, theName, "pipe")
4033 self._autoPublish(aList[0], theName, "pipe")
4036 ## Create a shape by extrusion of the profile shape along
4037 # the path shape. The path shape can be a wire or an edge.
4038 # the several profiles can be specified in the several locations of path.
4039 # It is possible to generate groups along with the result by means of
4040 # setting the flag \a IsGenerateGroups. For detailed information on
4041 # groups that can be created please see the method MakePipe().
4042 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4043 # shell or face. If number of faces in neighbour sections
4044 # aren't coincided result solid between such sections will
4045 # be created using external boundaries of this shells.
4046 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4047 # This list is used for searching correspondences between
4048 # faces in the sections. Size of this list must be equal
4049 # to size of list of base shapes.
4050 # @param theLocations - list of locations on the path corresponding
4051 # specified list of the Bases shapes. Number of locations
4052 # should be equal to number of bases. First and last
4053 # locations must be coincided with first and last vertexes
4054 # of path correspondingly.
4055 # @param thePath - Path shape to extrude the base shape along it.
4056 # @param theWithContact - the mode defining that the section is translated to be in
4057 # contact with the spine.
4058 # @param theWithCorrection - defining that the section is rotated to be
4059 # orthogonal to the spine tangent in the correspondent point
4060 # @param IsGenerateGroups - flag that tells if it is necessary to
4061 # create groups. It is equal to False by default.
4062 # @param theName Object name; when specified, this parameter is used
4063 # for result publication in the study. Otherwise, if automatic
4064 # publication is switched on, default value is used for result name.
4066 # @return New GEOM.GEOM_Object, containing the created solids if
4067 # \a IsGenerateGroups is not set. Otherwise it returns new
4068 # GEOM.ListOfGO. Its first element is the created solids, the
4069 # remaining ones are created groups.
4071 # @ref tui_creation_pipe_with_shell_sec "Example"
4072 @ManageTransactions("PrimOp")
4073 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4074 theLocations, thePath,
4075 theWithContact, theWithCorrection,
4076 IsGenerateGroups=False, theName=None):
4078 Create a shape by extrusion of the profile shape along
4079 the path shape. The path shape can be a wire or an edge.
4080 the several profiles can be specified in the several locations of path.
4081 It is possible to generate groups along with the result by means of
4082 setting the flag IsGenerateGroups. For detailed information on
4083 groups that can be created please see the method geompy.MakePipe().
4086 theSeqBases - list of Bases shape to be extruded. Base shape must be
4087 shell or face. If number of faces in neighbour sections
4088 aren't coincided result solid between such sections will
4089 be created using external boundaries of this shells.
4090 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4091 This list is used for searching correspondences between
4092 faces in the sections. Size of this list must be equal
4093 to size of list of base shapes.
4094 theLocations - list of locations on the path corresponding
4095 specified list of the Bases shapes. Number of locations
4096 should be equal to number of bases. First and last
4097 locations must be coincided with first and last vertexes
4098 of path correspondingly.
4099 thePath - Path shape to extrude the base shape along it.
4100 theWithContact - the mode defining that the section is translated to be in
4101 contact with the spine (0/1)
4102 theWithCorrection - defining that the section is rotated to be
4103 orthogonal to the spine tangent in the correspondent point (0/1)
4104 IsGenerateGroups - flag that tells if it is necessary to
4105 create groups. It is equal to False by default.
4106 theName Object name; when specified, this parameter is used
4107 for result publication in the study. Otherwise, if automatic
4108 publication is switched on, default value is used for result name.
4111 New GEOM.GEOM_Object, containing the created solids if
4112 IsGenerateGroups is not set. Otherwise it returns new
4113 GEOM.ListOfGO. Its first element is the created solids, the
4114 remaining ones are created groups.
4116 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4117 theLocations, thePath,
4118 theWithContact, theWithCorrection,
4120 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4122 if IsGenerateGroups:
4123 self._autoPublish(aList, theName, "pipe")
4126 self._autoPublish(aList[0], theName, "pipe")
4129 ## Create a shape by extrusion of the profile shape along
4130 # the path shape. This function is used only for debug pipe
4131 # functionality - it is a version of function MakePipeWithShellSections()
4132 # which give a possibility to recieve information about
4133 # creating pipe between each pair of sections step by step.
4134 @ManageTransactions("PrimOp")
4135 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4136 theLocations, thePath,
4137 theWithContact, theWithCorrection,
4138 IsGenerateGroups=False, theName=None):
4140 Create a shape by extrusion of the profile shape along
4141 the path shape. This function is used only for debug pipe
4142 functionality - it is a version of previous function
4143 geompy.MakePipeWithShellSections() which give a possibility to
4144 recieve information about creating pipe between each pair of
4145 sections step by step.
4148 nbsect = len(theSeqBases)
4149 nbsubsect = len(theSeqSubBases)
4150 #print "nbsect = ",nbsect
4151 for i in range(1,nbsect):
4153 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4154 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4156 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4157 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4158 tmpLocations, thePath,
4159 theWithContact, theWithCorrection,
4161 if self.PrimOp.IsDone() == 0:
4162 print "Problems with pipe creation between ",i," and ",i+1," sections"
4163 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4166 print "Pipe between ",i," and ",i+1," sections is OK"
4167 res.append(aList[0])
4171 resc = self.MakeCompound(res)
4172 #resc = self.MakeSewing(res, 0.001)
4173 #print "resc: ",resc
4174 self._autoPublish(resc, theName, "pipe")
4177 ## Create solids between given sections.
4178 # It is possible to generate groups along with the result by means of
4179 # setting the flag \a IsGenerateGroups. For detailed information on
4180 # groups that can be created please see the method MakePipe().
4181 # @param theSeqBases - list of sections (shell or face).
4182 # @param theLocations - list of corresponding vertexes
4183 # @param IsGenerateGroups - flag that tells if it is necessary to
4184 # create groups. It is equal to False by default.
4185 # @param theName Object name; when specified, this parameter is used
4186 # for result publication in the study. Otherwise, if automatic
4187 # publication is switched on, default value is used for result name.
4189 # @return New GEOM.GEOM_Object, containing the created solids if
4190 # \a IsGenerateGroups is not set. Otherwise it returns new
4191 # GEOM.ListOfGO. Its first element is the created solids, the
4192 # remaining ones are created groups.
4194 # @ref tui_creation_pipe_without_path "Example"
4195 @ManageTransactions("PrimOp")
4196 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4197 IsGenerateGroups=False, theName=None):
4199 Create solids between given sections.
4200 It is possible to generate groups along with the result by means of
4201 setting the flag IsGenerateGroups. For detailed information on
4202 groups that can be created please see the method geompy.MakePipe().
4205 theSeqBases - list of sections (shell or face).
4206 theLocations - list of corresponding vertexes
4207 IsGenerateGroups - flag that tells if it is necessary to
4208 create groups. It is equal to False by default.
4209 theName Object name; when specified, this parameter is used
4210 for result publication in the study. Otherwise, if automatic
4211 publication is switched on, default value is used for result name.
4214 New GEOM.GEOM_Object, containing the created solids if
4215 IsGenerateGroups is not set. Otherwise it returns new
4216 GEOM.ListOfGO. Its first element is the created solids, the
4217 remaining ones are created groups.
4219 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4221 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4223 if IsGenerateGroups:
4224 self._autoPublish(aList, theName, "pipe")
4227 self._autoPublish(aList[0], theName, "pipe")
4230 ## Create a shape by extrusion of the base shape along
4231 # the path shape with constant bi-normal direction along the given vector.
4232 # The path shape can be a wire or an edge.
4233 # It is possible to generate groups along with the result by means of
4234 # setting the flag \a IsGenerateGroups. For detailed information on
4235 # groups that can be created please see the method MakePipe().
4236 # @param theBase Base shape to be extruded.
4237 # @param thePath Path shape to extrude the base shape along it.
4238 # @param theVec Vector defines a constant binormal direction to keep the
4239 # same angle beetween the direction and the sections
4240 # along the sweep surface.
4241 # @param IsGenerateGroups flag that tells if it is necessary to
4242 # create groups. It is equal to False by default.
4243 # @param theName Object name; when specified, this parameter is used
4244 # for result publication in the study. Otherwise, if automatic
4245 # publication is switched on, default value is used for result name.
4247 # @return New GEOM.GEOM_Object, containing the created pipe if
4248 # \a IsGenerateGroups is not set. Otherwise it returns new
4249 # GEOM.ListOfGO. Its first element is the created pipe, the
4250 # remaining ones are created groups.
4252 # @ref tui_creation_pipe "Example"
4253 @ManageTransactions("PrimOp")
4254 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4255 IsGenerateGroups=False, theName=None):
4257 Create a shape by extrusion of the base shape along
4258 the path shape with constant bi-normal direction along the given vector.
4259 The path shape can be a wire or an edge.
4260 It is possible to generate groups along with the result by means of
4261 setting the flag IsGenerateGroups. For detailed information on
4262 groups that can be created please see the method geompy.MakePipe().
4265 theBase Base shape to be extruded.
4266 thePath Path shape to extrude the base shape along it.
4267 theVec Vector defines a constant binormal direction to keep the
4268 same angle beetween the direction and the sections
4269 along the sweep surface.
4270 IsGenerateGroups flag that tells if it is necessary to
4271 create groups. It is equal to False by default.
4272 theName Object name; when specified, this parameter is used
4273 for result publication in the study. Otherwise, if automatic
4274 publication is switched on, default value is used for result name.
4277 New GEOM.GEOM_Object, containing the created pipe if
4278 IsGenerateGroups is not set. Otherwise it returns new
4279 GEOM.ListOfGO. Its first element is the created pipe, the
4280 remaining ones are created groups.
4282 # Example: see GEOM_TestAll.py
4283 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4284 theVec, IsGenerateGroups)
4285 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4287 if IsGenerateGroups:
4288 self._autoPublish(aList, theName, "pipe")
4291 self._autoPublish(aList[0], theName, "pipe")
4294 ## Makes a thick solid from a shape. If the input is a surface shape
4295 # (face or shell) the result is a thick solid. If an input shape is
4296 # a solid the result is a hollowed solid with removed faces.
4297 # @param theShape Face or Shell to get thick solid or solid to get
4299 # @param theThickness Thickness of the resulting solid
4300 # @param theFacesIDs the list of face IDs to be removed from the
4301 # result. It is ignored if \a theShape is a face or a shell.
4302 # It is empty by default.
4303 # @param theInside If true the thickness is applied towards inside
4304 # @param theName Object name; when specified, this parameter is used
4305 # for result publication in the study. Otherwise, if automatic
4306 # publication is switched on, default value is used for result name.
4308 # @return New GEOM.GEOM_Object, containing the created solid
4310 # @ref tui_creation_thickness "Example"
4311 @ManageTransactions("PrimOp")
4312 def MakeThickSolid(self, theShape, theThickness,
4313 theFacesIDs=[], theInside=False, theName=None):
4315 Make a thick solid from a shape. If the input is a surface shape
4316 (face or shell) the result is a thick solid. If an input shape is
4317 a solid the result is a hollowed solid with removed faces.
4320 theShape Face or Shell to get thick solid or solid to get
4322 theThickness Thickness of the resulting solid
4323 theFacesIDs the list of face IDs to be removed from the
4324 result. It is ignored if theShape is a face or a
4325 shell. It is empty by default.
4326 theInside If true the thickness is applied towards inside
4327 theName Object name; when specified, this parameter is used
4328 for result publication in the study. Otherwise, if automatic
4329 publication is switched on, default value is used for result name.
4332 New GEOM.GEOM_Object, containing the created solid
4334 # Example: see GEOM_TestAll.py
4335 theThickness,Parameters = ParseParameters(theThickness)
4336 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4337 theThickness, True, theInside)
4338 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4339 anObj.SetParameters(Parameters)
4340 self._autoPublish(anObj, theName, "thickSolid")
4344 ## Modifies a shape to make it a thick solid. If the input is a surface
4345 # shape (face or shell) the result is a thick solid. If an input shape
4346 # is a solid the result is a hollowed solid with removed faces.
4347 # @param theShape Face or Shell to get thick solid or solid to get
4349 # @param theThickness Thickness of the resulting solid
4350 # @param theFacesIDs the list of face IDs to be removed from the
4351 # result. It is ignored if \a theShape is a face or a shell.
4352 # It is empty by default.
4353 # @param theInside If true the thickness is applied towards inside
4355 # @return The modified shape
4357 # @ref tui_creation_thickness "Example"
4358 @ManageTransactions("PrimOp")
4359 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4361 Modifies a shape to make it a thick solid. If the input is a
4362 surface shape (face or shell) the result is a thick solid. If
4363 an input shape is a solid the result is a hollowed solid with
4367 theShape Face or Shell to get thick solid or solid to get
4369 theThickness Thickness of the resulting solid
4370 theFacesIDs the list of face IDs to be removed from the
4371 result. It is ignored if \a theShape is a face or
4372 a shell. It is empty by default.
4373 theInside If true the thickness is applied towards inside
4378 # Example: see GEOM_TestAll.py
4379 theThickness,Parameters = ParseParameters(theThickness)
4380 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4381 theThickness, False, theInside)
4382 RaiseIfFailed("Thicken", self.PrimOp)
4383 anObj.SetParameters(Parameters)
4386 ## Build a middle path of a pipe-like shape.
4387 # The path shape can be a wire or an edge.
4388 # @param theShape It can be closed or unclosed pipe-like shell
4389 # or a pipe-like solid.
4390 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4391 # should be wires or faces of theShape.
4392 # @param theName Object name; when specified, this parameter is used
4393 # for result publication in the study. Otherwise, if automatic
4394 # publication is switched on, default value is used for result name.
4396 # @note It is not assumed that exact or approximate copy of theShape
4397 # can be obtained by applying existing Pipe operation on the
4398 # resulting "Path" wire taking theBase1 as the base - it is not
4399 # always possible; though in some particular cases it might work
4400 # it is not guaranteed. Thus, RestorePath function should not be
4401 # considered as an exact reverse operation of the Pipe.
4403 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4404 # source pipe's "path".
4406 # @ref tui_creation_pipe_path "Example"
4407 @ManageTransactions("PrimOp")
4408 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4410 Build a middle path of a pipe-like shape.
4411 The path shape can be a wire or an edge.
4414 theShape It can be closed or unclosed pipe-like shell
4415 or a pipe-like solid.
4416 theBase1, theBase2 Two bases of the supposed pipe. This
4417 should be wires or faces of theShape.
4418 theName Object name; when specified, this parameter is used
4419 for result publication in the study. Otherwise, if automatic
4420 publication is switched on, default value is used for result name.
4423 New GEOM_Object, containing an edge or wire that represent
4426 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4427 RaiseIfFailed("RestorePath", self.PrimOp)
4428 self._autoPublish(anObj, theName, "path")
4431 ## Build a middle path of a pipe-like shape.
4432 # The path shape can be a wire or an edge.
4433 # @param theShape It can be closed or unclosed pipe-like shell
4434 # or a pipe-like solid.
4435 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4436 # should be lists of edges of theShape.
4437 # @param theName Object name; when specified, this parameter is used
4438 # for result publication in the study. Otherwise, if automatic
4439 # publication is switched on, default value is used for result name.
4441 # @note It is not assumed that exact or approximate copy of theShape
4442 # can be obtained by applying existing Pipe operation on the
4443 # resulting "Path" wire taking theBase1 as the base - it is not
4444 # always possible; though in some particular cases it might work
4445 # it is not guaranteed. Thus, RestorePath function should not be
4446 # considered as an exact reverse operation of the Pipe.
4448 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4449 # source pipe's "path".
4451 # @ref tui_creation_pipe_path "Example"
4452 @ManageTransactions("PrimOp")
4453 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4455 Build a middle path of a pipe-like shape.
4456 The path shape can be a wire or an edge.
4459 theShape It can be closed or unclosed pipe-like shell
4460 or a pipe-like solid.
4461 listEdges1, listEdges2 Two bases of the supposed pipe. This
4462 should be lists of edges of theShape.
4463 theName Object name; when specified, this parameter is used
4464 for result publication in the study. Otherwise, if automatic
4465 publication is switched on, default value is used for result name.
4468 New GEOM_Object, containing an edge or wire that represent
4471 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4472 RaiseIfFailed("RestorePath", self.PrimOp)
4473 self._autoPublish(anObj, theName, "path")
4479 ## @addtogroup l3_basic_go
4482 ## Create a linear edge with specified ends.
4483 # @param thePnt1 Point for the first end of edge.
4484 # @param thePnt2 Point for the second end of edge.
4485 # @param theName Object name; when specified, this parameter is used
4486 # for result publication in the study. Otherwise, if automatic
4487 # publication is switched on, default value is used for result name.
4489 # @return New GEOM.GEOM_Object, containing the created edge.
4491 # @ref tui_creation_edge "Example"
4492 @ManageTransactions("ShapesOp")
4493 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4495 Create a linear edge with specified ends.
4498 thePnt1 Point for the first end of edge.
4499 thePnt2 Point for the second end of edge.
4500 theName Object name; when specified, this parameter is used
4501 for result publication in the study. Otherwise, if automatic
4502 publication is switched on, default value is used for result name.
4505 New GEOM.GEOM_Object, containing the created edge.
4507 # Example: see GEOM_TestAll.py
4508 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4509 RaiseIfFailed("MakeEdge", self.ShapesOp)
4510 self._autoPublish(anObj, theName, "edge")
4513 ## Create a new edge, corresponding to the given length on the given curve.
4514 # @param theRefCurve The referenced curve (edge).
4515 # @param theLength Length on the referenced curve. It can be negative.
4516 # @param theStartPoint Any point can be selected for it, the new edge will begin
4517 # at the end of \a theRefCurve, close to the selected point.
4518 # If None, start from the first point of \a theRefCurve.
4519 # @param theName Object name; when specified, this parameter is used
4520 # for result publication in the study. Otherwise, if automatic
4521 # publication is switched on, default value is used for result name.
4523 # @return New GEOM.GEOM_Object, containing the created edge.
4525 # @ref tui_creation_edge "Example"
4526 @ManageTransactions("ShapesOp")
4527 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4529 Create a new edge, corresponding to the given length on the given curve.
4532 theRefCurve The referenced curve (edge).
4533 theLength Length on the referenced curve. It can be negative.
4534 theStartPoint Any point can be selected for it, the new edge will begin
4535 at the end of theRefCurve, close to the selected point.
4536 If None, start from the first point of theRefCurve.
4537 theName Object name; when specified, this parameter is used
4538 for result publication in the study. Otherwise, if automatic
4539 publication is switched on, default value is used for result name.
4542 New GEOM.GEOM_Object, containing the created edge.
4544 # Example: see GEOM_TestAll.py
4545 theLength, Parameters = ParseParameters(theLength)
4546 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4547 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4548 anObj.SetParameters(Parameters)
4549 self._autoPublish(anObj, theName, "edge")
4552 ## Create an edge from specified wire.
4553 # @param theWire source Wire
4554 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4555 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4556 # @param theName Object name; when specified, this parameter is used
4557 # for result publication in the study. Otherwise, if automatic
4558 # publication is switched on, default value is used for result name.
4560 # @return New GEOM.GEOM_Object, containing the created edge.
4562 # @ref tui_creation_edge "Example"
4563 @ManageTransactions("ShapesOp")
4564 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4566 Create an edge from specified wire.
4570 theLinearTolerance linear tolerance value (default = 1e-07)
4571 theAngularTolerance angular tolerance value (default = 1e-12)
4572 theName Object name; when specified, this parameter is used
4573 for result publication in the study. Otherwise, if automatic
4574 publication is switched on, default value is used for result name.
4577 New GEOM.GEOM_Object, containing the created edge.
4579 # Example: see GEOM_TestAll.py
4580 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4581 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4582 self._autoPublish(anObj, theName, "edge")
4585 ## Create a wire from the set of edges and wires.
4586 # @param theEdgesAndWires List of edges and/or wires.
4587 # @param theTolerance Maximum distance between vertices, that will be merged.
4588 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4589 # @param theName Object name; when specified, this parameter is used
4590 # for result publication in the study. Otherwise, if automatic
4591 # publication is switched on, default value is used for result name.
4593 # @return New GEOM.GEOM_Object, containing the created wire.
4595 # @ref tui_creation_wire "Example"
4596 @ManageTransactions("ShapesOp")
4597 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4599 Create a wire from the set of edges and wires.
4602 theEdgesAndWires List of edges and/or wires.
4603 theTolerance Maximum distance between vertices, that will be merged.
4604 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4605 theName Object name; when specified, this parameter is used
4606 for result publication in the study. Otherwise, if automatic
4607 publication is switched on, default value is used for result name.
4610 New GEOM.GEOM_Object, containing the created wire.
4612 # Example: see GEOM_TestAll.py
4613 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4614 RaiseIfFailed("MakeWire", self.ShapesOp)
4615 self._autoPublish(anObj, theName, "wire")
4618 ## Create a face on the given wire.
4619 # @param theWire closed Wire or Edge to build the face on.
4620 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4621 # If the tolerance of the obtained planar face is less
4622 # than 1e-06, this face will be returned, otherwise the
4623 # algorithm tries to build any suitable face on the given
4624 # wire and prints a warning message.
4625 # @param theName Object name; when specified, this parameter is used
4626 # for result publication in the study. Otherwise, if automatic
4627 # publication is switched on, default value is used for result name.
4629 # @return New GEOM.GEOM_Object, containing the created face.
4631 # @ref tui_creation_face "Example"
4632 @ManageTransactions("ShapesOp")
4633 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4635 Create a face on the given wire.
4638 theWire closed Wire or Edge to build the face on.
4639 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4640 If the tolerance of the obtained planar face is less
4641 than 1e-06, this face will be returned, otherwise the
4642 algorithm tries to build any suitable face on the given
4643 wire and prints a warning message.
4644 theName Object name; when specified, this parameter is used
4645 for result publication in the study. Otherwise, if automatic
4646 publication is switched on, default value is used for result name.
4649 New GEOM.GEOM_Object, containing the created face.
4651 # Example: see GEOM_TestAll.py
4652 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4653 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4654 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4656 RaiseIfFailed("MakeFace", self.ShapesOp)
4657 self._autoPublish(anObj, theName, "face")
4660 ## Create a face on the given wires set.
4661 # @param theWires List of closed wires or edges to build the face on.
4662 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4663 # If the tolerance of the obtained planar face is less
4664 # than 1e-06, this face will be returned, otherwise the
4665 # algorithm tries to build any suitable face on the given
4666 # wire and prints a warning message.
4667 # @param theName Object name; when specified, this parameter is used
4668 # for result publication in the study. Otherwise, if automatic
4669 # publication is switched on, default value is used for result name.
4671 # @return New GEOM.GEOM_Object, containing the created face.
4673 # @ref tui_creation_face "Example"
4674 @ManageTransactions("ShapesOp")
4675 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4677 Create a face on the given wires set.
4680 theWires List of closed wires or edges to build the face on.
4681 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4682 If the tolerance of the obtained planar face is less
4683 than 1e-06, this face will be returned, otherwise the
4684 algorithm tries to build any suitable face on the given
4685 wire and prints a warning message.
4686 theName Object name; when specified, this parameter is used
4687 for result publication in the study. Otherwise, if automatic
4688 publication is switched on, default value is used for result name.
4691 New GEOM.GEOM_Object, containing the created face.
4693 # Example: see GEOM_TestAll.py
4694 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4695 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4696 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4698 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4699 self._autoPublish(anObj, theName, "face")
4702 ## See MakeFaceWires() method for details.
4704 # @ref tui_creation_face "Example 1"
4705 # \n @ref swig_MakeFaces "Example 2"
4706 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4708 See geompy.MakeFaceWires() method for details.
4710 # Example: see GEOM_TestOthers.py
4711 # note: auto-publishing is done in self.MakeFaceWires()
4712 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4715 ## Create a face based on a surface from given face bounded
4717 # @param theFace the face whose surface is used to create a new face.
4718 # @param theWire the wire that will bound a new face.
4719 # @param theName Object name; when specified, this parameter is used
4720 # for result publication in the study. Otherwise, if automatic
4721 # publication is switched on, default value is used for result name.
4723 # @return New GEOM.GEOM_Object, containing the created face.
4725 # @ref tui_creation_face "Example"
4726 @ManageTransactions("ShapesOp")
4727 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4729 Create a face based on a surface from given face bounded
4733 theFace the face whose surface is used to create a new face.
4734 theWire the wire that will bound a new face.
4735 theName Object name; when specified, this parameter is used
4736 for result publication in the study. Otherwise, if automatic
4737 publication is switched on, default value is used for result name.
4740 New GEOM.GEOM_Object, containing the created face.
4742 # Example: see GEOM_TestAll.py
4743 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4744 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4745 self._autoPublish(anObj, theName, "face")
4748 ## Create a face from a set of edges with the given constraints.
4749 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4750 # - edges should form a closed wire;
4751 # - for each edge, constraint face is optional: if a constraint face is missing
4752 # for some edge, this means that there no constraint associated with this edge.
4753 # @param theName Object name; when specified, this parameter is used
4754 # for result publication in the study. Otherwise, if automatic
4755 # publication is switched on, default value is used for result name.
4757 # @return New GEOM.GEOM_Object, containing the created face.
4759 # @ref tui_creation_face "Example"
4760 @ManageTransactions("ShapesOp")
4761 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4763 Create a face from a set of edges with the given constraints.
4766 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4767 - edges should form a closed wire;
4768 - for each edge, constraint face is optional: if a constraint face is missing
4769 for some edge, this means that there no constraint associated with this edge.
4770 theName Object name; when specified, this parameter is used
4771 for result publication in the study. Otherwise, if automatic
4772 publication is switched on, default value is used for result name.
4775 New GEOM.GEOM_Object, containing the created face.
4777 # Example: see GEOM_TestAll.py
4778 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4780 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4781 self._autoPublish(anObj, theName, "face")
4784 ## Create a shell from the set of faces and shells.
4785 # @param theFacesAndShells List of faces and/or shells.
4786 # @param theName Object name; when specified, this parameter is used
4787 # for result publication in the study. Otherwise, if automatic
4788 # publication is switched on, default value is used for result name.
4790 # @return New GEOM.GEOM_Object, containing the created shell.
4792 # @ref tui_creation_shell "Example"
4793 @ManageTransactions("ShapesOp")
4794 def MakeShell(self, theFacesAndShells, theName=None):
4796 Create a shell from the set of faces and shells.
4799 theFacesAndShells List of faces and/or shells.
4800 theName Object name; when specified, this parameter is used
4801 for result publication in the study. Otherwise, if automatic
4802 publication is switched on, default value is used for result name.
4805 New GEOM.GEOM_Object, containing the created shell.
4807 # Example: see GEOM_TestAll.py
4808 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4809 RaiseIfFailed("MakeShell", self.ShapesOp)
4810 self._autoPublish(anObj, theName, "shell")
4813 ## Create a solid, bounded by the given shells.
4814 # @param theShells Sequence of bounding shells.
4815 # @param theName Object name; when specified, this parameter is used
4816 # for result publication in the study. Otherwise, if automatic
4817 # publication is switched on, default value is used for result name.
4819 # @return New GEOM.GEOM_Object, containing the created solid.
4821 # @ref tui_creation_solid "Example"
4822 @ManageTransactions("ShapesOp")
4823 def MakeSolid(self, theShells, theName=None):
4825 Create a solid, bounded by the given shells.
4828 theShells Sequence of bounding shells.
4829 theName Object name; when specified, this parameter is used
4830 for result publication in the study. Otherwise, if automatic
4831 publication is switched on, default value is used for result name.
4834 New GEOM.GEOM_Object, containing the created solid.
4836 # Example: see GEOM_TestAll.py
4837 theShells = ToList(theShells)
4838 if len(theShells) == 1:
4839 descr = self._IsGoodForSolid(theShells[0])
4841 # raise RuntimeError, "MakeSolidShells : " + descr
4842 if descr == "WRN_SHAPE_UNCLOSED":
4843 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4844 anObj = self.ShapesOp.MakeSolidShells(theShells)
4845 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4846 self._autoPublish(anObj, theName, "solid")
4849 ## Create a compound of the given shapes.
4850 # @param theShapes List of shapes to put in compound.
4851 # @param theName Object name; when specified, this parameter is used
4852 # for result publication in the study. Otherwise, if automatic
4853 # publication is switched on, default value is used for result name.
4855 # @return New GEOM.GEOM_Object, containing the created compound.
4857 # @ref tui_creation_compound "Example"
4858 @ManageTransactions("ShapesOp")
4859 def MakeCompound(self, theShapes, theName=None):
4861 Create a compound of the given shapes.
4864 theShapes List of shapes to put in compound.
4865 theName Object name; when specified, this parameter is used
4866 for result publication in the study. Otherwise, if automatic
4867 publication is switched on, default value is used for result name.
4870 New GEOM.GEOM_Object, containing the created compound.
4872 # Example: see GEOM_TestAll.py
4873 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4874 RaiseIfFailed("MakeCompound", self.ShapesOp)
4875 self._autoPublish(anObj, theName, "compound")
4878 ## Create a solid (or solids) from the set of faces and/or shells.
4879 # @param theFacesOrShells List of faces and/or shells.
4880 # @param isIntersect If TRUE, forces performing intersections
4881 # between arguments; otherwise (default) intersection is not performed.
4882 # @param theName Object name; when specified, this parameter is used
4883 # for result publication in the study. Otherwise, if automatic
4884 # publication is switched on, default value is used for result name.
4886 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4888 # @ref tui_creation_solid_from_faces "Example"
4889 @ManageTransactions("ShapesOp")
4890 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
4892 Create a solid (or solids) from the set of connected faces and/or shells.
4895 theFacesOrShells List of faces and/or shells.
4896 isIntersect If TRUE, forces performing intersections
4897 between arguments; otherwise (default) intersection is not performed
4898 theName Object name; when specified, this parameter is used.
4899 for result publication in the study. Otherwise, if automatic
4900 publication is switched on, default value is used for result name.
4903 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4905 # Example: see GEOM_TestAll.py
4906 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
4907 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
4908 self._autoPublish(anObj, theName, "solid")
4911 # end of l3_basic_go
4914 ## @addtogroup l2_measure
4917 ## Gives quantity of faces in the given shape.
4918 # @param theShape Shape to count faces of.
4919 # @return Quantity of faces.
4921 # @ref swig_NumberOf "Example"
4922 @ManageTransactions("ShapesOp")
4923 def NumberOfFaces(self, theShape):
4925 Gives quantity of faces in the given shape.
4928 theShape Shape to count faces of.
4933 # Example: see GEOM_TestOthers.py
4934 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4935 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4938 ## Gives quantity of edges in the given shape.
4939 # @param theShape Shape to count edges of.
4940 # @return Quantity of edges.
4942 # @ref swig_NumberOf "Example"
4943 @ManageTransactions("ShapesOp")
4944 def NumberOfEdges(self, theShape):
4946 Gives quantity of edges in the given shape.
4949 theShape Shape to count edges of.
4954 # Example: see GEOM_TestOthers.py
4955 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4956 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4959 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4960 # @param theShape Shape to count sub-shapes of.
4961 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4962 # @return Quantity of sub-shapes of given type.
4964 # @ref swig_NumberOf "Example"
4965 @ManageTransactions("ShapesOp")
4966 def NumberOfSubShapes(self, theShape, theShapeType):
4968 Gives quantity of sub-shapes of type theShapeType in the given shape.
4971 theShape Shape to count sub-shapes of.
4972 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4975 Quantity of sub-shapes of given type.
4977 # Example: see GEOM_TestOthers.py
4978 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4979 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4982 ## Gives quantity of solids in the given shape.
4983 # @param theShape Shape to count solids in.
4984 # @return Quantity of solids.
4986 # @ref swig_NumberOf "Example"
4987 @ManageTransactions("ShapesOp")
4988 def NumberOfSolids(self, theShape):
4990 Gives quantity of solids in the given shape.
4993 theShape Shape to count solids in.
4998 # Example: see GEOM_TestOthers.py
4999 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5000 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5006 ## @addtogroup l3_healing
5009 ## Reverses an orientation the given shape.
5010 # @param theShape Shape to be reversed.
5011 # @param theName Object name; when specified, this parameter is used
5012 # for result publication in the study. Otherwise, if automatic
5013 # publication is switched on, default value is used for result name.
5015 # @return The reversed copy of theShape.
5017 # @ref swig_ChangeOrientation "Example"
5018 @ManageTransactions("ShapesOp")
5019 def ChangeOrientation(self, theShape, theName=None):
5021 Reverses an orientation the given shape.
5024 theShape Shape to be reversed.
5025 theName Object name; when specified, this parameter is used
5026 for result publication in the study. Otherwise, if automatic
5027 publication is switched on, default value is used for result name.
5030 The reversed copy of theShape.
5032 # Example: see GEOM_TestAll.py
5033 anObj = self.ShapesOp.ChangeOrientation(theShape)
5034 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5035 self._autoPublish(anObj, theName, "reversed")
5038 ## See ChangeOrientation() method for details.
5040 # @ref swig_OrientationChange "Example"
5041 def OrientationChange(self, theShape, theName=None):
5043 See geompy.ChangeOrientation method for details.
5045 # Example: see GEOM_TestOthers.py
5046 # note: auto-publishing is done in self.ChangeOrientation()
5047 anObj = self.ChangeOrientation(theShape, theName)
5053 ## @addtogroup l4_obtain
5056 ## Retrieve all free faces from the given shape.
5057 # Free face is a face, which is not shared between two shells of the shape.
5058 # @param theShape Shape to find free faces in.
5059 # @return List of IDs of all free faces, contained in theShape.
5061 # @ref tui_free_faces_page "Example"
5062 @ManageTransactions("ShapesOp")
5063 def GetFreeFacesIDs(self,theShape):
5065 Retrieve all free faces from the given shape.
5066 Free face is a face, which is not shared between two shells of the shape.
5069 theShape Shape to find free faces in.
5072 List of IDs of all free faces, contained in theShape.
5074 # Example: see GEOM_TestOthers.py
5075 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5076 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5079 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5080 # @param theShape1 Shape to find sub-shapes in.
5081 # @param theShape2 Shape to find shared sub-shapes with.
5082 # @param theShapeType Type of sub-shapes to be retrieved.
5083 # @param theName Object name; when specified, this parameter is used
5084 # for result publication in the study. Otherwise, if automatic
5085 # publication is switched on, default value is used for result name.
5087 # @return List of sub-shapes of theShape1, shared with theShape2.
5089 # @ref swig_GetSharedShapes "Example"
5090 @ManageTransactions("ShapesOp")
5091 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5093 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5096 theShape1 Shape to find sub-shapes in.
5097 theShape2 Shape to find shared sub-shapes with.
5098 theShapeType Type of sub-shapes to be retrieved.
5099 theName Object name; when specified, this parameter is used
5100 for result publication in the study. Otherwise, if automatic
5101 publication is switched on, default value is used for result name.
5104 List of sub-shapes of theShape1, shared with theShape2.
5106 # Example: see GEOM_TestOthers.py
5107 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5108 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5109 self._autoPublish(aList, theName, "shared")
5112 ## Get sub-shapes, shared by input shapes.
5113 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5114 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5115 # @param theMultiShare Specifies what type of shares should be checked:
5116 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5117 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5118 # @param theName Object name; when specified, this parameter is used
5119 # for result publication in the study. Otherwise, if automatic
5120 # publication is switched on, default value is used for result name.
5122 # @note If @a theShapes contains single compound, the shares between all possible couples of
5123 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5124 # and all rest input shapes are returned.
5126 # @return List of all found sub-shapes.
5129 # - @ref tui_shared_shapes "Example 1"
5130 # - @ref swig_GetSharedShapes "Example 2"
5131 @ManageTransactions("ShapesOp")
5132 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5134 Get sub-shapes, shared by input shapes.
5137 theShapes Either a list or compound of shapes to find common sub-shapes of.
5138 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5139 theMultiShare Specifies what type of shares should be checked:
5140 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5141 - False: causes to search sub-shapes shared between couples of input shapes.
5142 theName Object name; when specified, this parameter is used
5143 for result publication in the study. Otherwise, if automatic
5144 publication is switched on, default value is used for result name.
5146 Note: if theShapes contains single compound, the shares between all possible couples of
5147 its top-level shapes are returned; otherwise, only shares between 1st input shape
5148 and all rest input shapes are returned.
5151 List of all found sub-shapes.
5153 # Example: see GEOM_TestOthers.py
5154 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5155 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5156 self._autoPublish(aList, theName, "shared")
5159 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5160 # situated relatively the specified plane by the certain way,
5161 # defined through <VAR>theState</VAR> parameter.
5162 # @param theShape Shape to find sub-shapes of.
5163 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5164 # @param theAx1 Vector (or line, or linear edge), specifying normal
5165 # direction and location of the plane to find shapes on.
5166 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5167 # @param theName Object name; when specified, this parameter is used
5168 # for result publication in the study. Otherwise, if automatic
5169 # publication is switched on, default value is used for result name.
5171 # @return List of all found sub-shapes.
5173 # @ref swig_GetShapesOnPlane "Example"
5174 @ManageTransactions("ShapesOp")
5175 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5177 Find in theShape all sub-shapes of type theShapeType,
5178 situated relatively the specified plane by the certain way,
5179 defined through theState parameter.
5182 theShape Shape to find sub-shapes of.
5183 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5184 theAx1 Vector (or line, or linear edge), specifying normal
5185 direction and location of the plane to find shapes on.
5186 theState The state of the sub-shapes to find (see GEOM::shape_state)
5187 theName Object name; when specified, this parameter is used
5188 for result publication in the study. Otherwise, if automatic
5189 publication is switched on, default value is used for result name.
5192 List of all found sub-shapes.
5194 # Example: see GEOM_TestOthers.py
5195 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5196 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5197 self._autoPublish(aList, theName, "shapeOnPlane")
5200 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5201 # situated relatively the specified plane by the certain way,
5202 # defined through <VAR>theState</VAR> parameter.
5203 # @param theShape Shape to find sub-shapes of.
5204 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5205 # @param theAx1 Vector (or line, or linear edge), specifying normal
5206 # direction and location of the plane to find shapes on.
5207 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5209 # @return List of all found sub-shapes indices.
5211 # @ref swig_GetShapesOnPlaneIDs "Example"
5212 @ManageTransactions("ShapesOp")
5213 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5215 Find in theShape all sub-shapes of type theShapeType,
5216 situated relatively the specified plane by the certain way,
5217 defined through theState parameter.
5220 theShape Shape to find sub-shapes of.
5221 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5222 theAx1 Vector (or line, or linear edge), specifying normal
5223 direction and location of the plane to find shapes on.
5224 theState The state of the sub-shapes to find (see GEOM::shape_state)
5227 List of all found sub-shapes indices.
5229 # Example: see GEOM_TestOthers.py
5230 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5231 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5234 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5235 # situated relatively the specified plane by the certain way,
5236 # defined through <VAR>theState</VAR> parameter.
5237 # @param theShape Shape to find sub-shapes of.
5238 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5239 # @param theAx1 Vector (or line, or linear edge), specifying normal
5240 # direction of the plane to find shapes on.
5241 # @param thePnt Point specifying location of the plane to find shapes on.
5242 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5243 # @param theName Object name; when specified, this parameter is used
5244 # for result publication in the study. Otherwise, if automatic
5245 # publication is switched on, default value is used for result name.
5247 # @return List of all found sub-shapes.
5249 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5250 @ManageTransactions("ShapesOp")
5251 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5253 Find in theShape all sub-shapes of type theShapeType,
5254 situated relatively the specified plane by the certain way,
5255 defined through theState parameter.
5258 theShape Shape to find sub-shapes of.
5259 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5260 theAx1 Vector (or line, or linear edge), specifying normal
5261 direction and location of the plane to find shapes on.
5262 thePnt Point specifying location of the plane to find shapes on.
5263 theState The state of the sub-shapes to find (see GEOM::shape_state)
5264 theName Object name; when specified, this parameter is used
5265 for result publication in the study. Otherwise, if automatic
5266 publication is switched on, default value is used for result name.
5269 List of all found sub-shapes.
5271 # Example: see GEOM_TestOthers.py
5272 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5273 theAx1, thePnt, theState)
5274 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5275 self._autoPublish(aList, theName, "shapeOnPlane")
5278 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5279 # situated relatively the specified plane by the certain way,
5280 # defined through <VAR>theState</VAR> parameter.
5281 # @param theShape Shape to find sub-shapes of.
5282 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5283 # @param theAx1 Vector (or line, or linear edge), specifying normal
5284 # direction of the plane to find shapes on.
5285 # @param thePnt Point specifying location of the plane to find shapes on.
5286 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5288 # @return List of all found sub-shapes indices.
5290 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5291 @ManageTransactions("ShapesOp")
5292 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5294 Find in theShape all sub-shapes of type theShapeType,
5295 situated relatively the specified plane by the certain way,
5296 defined through theState parameter.
5299 theShape Shape to find sub-shapes of.
5300 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5301 theAx1 Vector (or line, or linear edge), specifying normal
5302 direction and location of the plane to find shapes on.
5303 thePnt Point specifying location of the plane to find shapes on.
5304 theState The state of the sub-shapes to find (see GEOM::shape_state)
5307 List of all found sub-shapes indices.
5309 # Example: see GEOM_TestOthers.py
5310 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5311 theAx1, thePnt, theState)
5312 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5315 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5316 # the specified cylinder by the certain way, defined through \a theState parameter.
5317 # @param theShape Shape to find sub-shapes of.
5318 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5319 # @param theAxis Vector (or line, or linear edge), specifying
5320 # axis of the cylinder to find shapes on.
5321 # @param theRadius Radius of the cylinder to find shapes on.
5322 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5323 # @param theName Object name; when specified, this parameter is used
5324 # for result publication in the study. Otherwise, if automatic
5325 # publication is switched on, default value is used for result name.
5327 # @return List of all found sub-shapes.
5329 # @ref swig_GetShapesOnCylinder "Example"
5330 @ManageTransactions("ShapesOp")
5331 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5333 Find in theShape all sub-shapes of type theShapeType, situated relatively
5334 the specified cylinder by the certain way, defined through theState parameter.
5337 theShape Shape to find sub-shapes of.
5338 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5339 theAxis Vector (or line, or linear edge), specifying
5340 axis of the cylinder to find shapes on.
5341 theRadius Radius of the cylinder to find shapes on.
5342 theState The state of the sub-shapes to find (see GEOM::shape_state)
5343 theName Object name; when specified, this parameter is used
5344 for result publication in the study. Otherwise, if automatic
5345 publication is switched on, default value is used for result name.
5348 List of all found sub-shapes.
5350 # Example: see GEOM_TestOthers.py
5351 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5352 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5353 self._autoPublish(aList, theName, "shapeOnCylinder")
5356 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5357 # the specified cylinder by the certain way, defined through \a theState parameter.
5358 # @param theShape Shape to find sub-shapes of.
5359 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5360 # @param theAxis Vector (or line, or linear edge), specifying
5361 # axis of the cylinder to find shapes on.
5362 # @param theRadius Radius of the cylinder to find shapes on.
5363 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5365 # @return List of all found sub-shapes indices.
5367 # @ref swig_GetShapesOnCylinderIDs "Example"
5368 @ManageTransactions("ShapesOp")
5369 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5371 Find in theShape all sub-shapes of type theShapeType, situated relatively
5372 the specified cylinder by the certain way, defined through theState parameter.
5375 theShape Shape to find sub-shapes of.
5376 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5377 theAxis Vector (or line, or linear edge), specifying
5378 axis of the cylinder to find shapes on.
5379 theRadius Radius of the cylinder to find shapes on.
5380 theState The state of the sub-shapes to find (see GEOM::shape_state)
5383 List of all found sub-shapes indices.
5385 # Example: see GEOM_TestOthers.py
5386 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5387 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5390 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5391 # the specified cylinder by the certain way, defined through \a theState parameter.
5392 # @param theShape Shape to find sub-shapes of.
5393 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5394 # @param theAxis Vector (or line, or linear edge), specifying
5395 # axis of the cylinder to find shapes on.
5396 # @param thePnt Point specifying location of the bottom of the cylinder.
5397 # @param theRadius Radius of the cylinder to find shapes on.
5398 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5399 # @param theName Object name; when specified, this parameter is used
5400 # for result publication in the study. Otherwise, if automatic
5401 # publication is switched on, default value is used for result name.
5403 # @return List of all found sub-shapes.
5405 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5406 @ManageTransactions("ShapesOp")
5407 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5409 Find in theShape all sub-shapes of type theShapeType, situated relatively
5410 the specified cylinder by the certain way, defined through theState parameter.
5413 theShape Shape to find sub-shapes of.
5414 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5415 theAxis Vector (or line, or linear edge), specifying
5416 axis of the cylinder to find shapes on.
5417 theRadius Radius of the cylinder to find shapes on.
5418 theState The state of the sub-shapes to find (see GEOM::shape_state)
5419 theName Object name; when specified, this parameter is used
5420 for result publication in the study. Otherwise, if automatic
5421 publication is switched on, default value is used for result name.
5424 List of all found sub-shapes.
5426 # Example: see GEOM_TestOthers.py
5427 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5428 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5429 self._autoPublish(aList, theName, "shapeOnCylinder")
5432 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5433 # the specified cylinder by the certain way, defined through \a theState parameter.
5434 # @param theShape Shape to find sub-shapes of.
5435 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5436 # @param theAxis Vector (or line, or linear edge), specifying
5437 # axis of the cylinder to find shapes on.
5438 # @param thePnt Point specifying location of the bottom of the cylinder.
5439 # @param theRadius Radius of the cylinder to find shapes on.
5440 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5442 # @return List of all found sub-shapes indices
5444 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5445 @ManageTransactions("ShapesOp")
5446 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5448 Find in theShape all sub-shapes of type theShapeType, situated relatively
5449 the specified cylinder by the certain way, defined through theState parameter.
5452 theShape Shape to find sub-shapes of.
5453 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5454 theAxis Vector (or line, or linear edge), specifying
5455 axis of the cylinder to find shapes on.
5456 theRadius Radius of the cylinder to find shapes on.
5457 theState The state of the sub-shapes to find (see GEOM::shape_state)
5460 List of all found sub-shapes indices.
5462 # Example: see GEOM_TestOthers.py
5463 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5464 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5467 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5468 # the specified sphere by the certain way, defined through \a theState parameter.
5469 # @param theShape Shape to find sub-shapes of.
5470 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5471 # @param theCenter Point, specifying center of the sphere to find shapes on.
5472 # @param theRadius Radius of the sphere to find shapes on.
5473 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5474 # @param theName Object name; when specified, this parameter is used
5475 # for result publication in the study. Otherwise, if automatic
5476 # publication is switched on, default value is used for result name.
5478 # @return List of all found sub-shapes.
5480 # @ref swig_GetShapesOnSphere "Example"
5481 @ManageTransactions("ShapesOp")
5482 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5484 Find in theShape all sub-shapes of type theShapeType, situated relatively
5485 the specified sphere by the certain way, defined through theState parameter.
5488 theShape Shape to find sub-shapes of.
5489 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5490 theCenter Point, specifying center of the sphere to find shapes on.
5491 theRadius Radius of the sphere to find shapes on.
5492 theState The state of the sub-shapes to find (see GEOM::shape_state)
5493 theName Object name; when specified, this parameter is used
5494 for result publication in the study. Otherwise, if automatic
5495 publication is switched on, default value is used for result name.
5498 List of all found sub-shapes.
5500 # Example: see GEOM_TestOthers.py
5501 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5502 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5503 self._autoPublish(aList, theName, "shapeOnSphere")
5506 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5507 # the specified sphere by the certain way, defined through \a theState parameter.
5508 # @param theShape Shape to find sub-shapes of.
5509 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5510 # @param theCenter Point, specifying center of the sphere to find shapes on.
5511 # @param theRadius Radius of the sphere to find shapes on.
5512 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5514 # @return List of all found sub-shapes indices.
5516 # @ref swig_GetShapesOnSphereIDs "Example"
5517 @ManageTransactions("ShapesOp")
5518 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5520 Find in theShape all sub-shapes of type theShapeType, situated relatively
5521 the specified sphere by the certain way, defined through theState parameter.
5524 theShape Shape to find sub-shapes of.
5525 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5526 theCenter Point, specifying center of the sphere to find shapes on.
5527 theRadius Radius of the sphere to find shapes on.
5528 theState The state of the sub-shapes to find (see GEOM::shape_state)
5531 List of all found sub-shapes indices.
5533 # Example: see GEOM_TestOthers.py
5534 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5535 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5538 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5539 # the specified quadrangle by the certain way, defined through \a theState parameter.
5540 # @param theShape Shape to find sub-shapes of.
5541 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5542 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5543 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5544 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5545 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5546 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5547 # @param theName Object name; when specified, this parameter is used
5548 # for result publication in the study. Otherwise, if automatic
5549 # publication is switched on, default value is used for result name.
5551 # @return List of all found sub-shapes.
5553 # @ref swig_GetShapesOnQuadrangle "Example"
5554 @ManageTransactions("ShapesOp")
5555 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5556 theTopLeftPoint, theTopRigthPoint,
5557 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5559 Find in theShape all sub-shapes of type theShapeType, situated relatively
5560 the specified quadrangle by the certain way, defined through theState parameter.
5563 theShape Shape to find sub-shapes of.
5564 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5565 theTopLeftPoint Point, specifying top left corner of a quadrangle
5566 theTopRigthPoint Point, specifying top right corner of a quadrangle
5567 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5568 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5569 theState The state of the sub-shapes to find (see GEOM::shape_state)
5570 theName Object name; when specified, this parameter is used
5571 for result publication in the study. Otherwise, if automatic
5572 publication is switched on, default value is used for result name.
5575 List of all found sub-shapes.
5577 # Example: see GEOM_TestOthers.py
5578 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5579 theTopLeftPoint, theTopRigthPoint,
5580 theBottomLeftPoint, theBottomRigthPoint, theState)
5581 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5582 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5585 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5586 # the specified quadrangle by the certain way, defined through \a theState parameter.
5587 # @param theShape Shape to find sub-shapes of.
5588 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5589 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5590 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5591 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5592 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5593 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5595 # @return List of all found sub-shapes indices.
5597 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5598 @ManageTransactions("ShapesOp")
5599 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5600 theTopLeftPoint, theTopRigthPoint,
5601 theBottomLeftPoint, theBottomRigthPoint, theState):
5603 Find in theShape all sub-shapes of type theShapeType, situated relatively
5604 the specified quadrangle by the certain way, defined through theState parameter.
5607 theShape Shape to find sub-shapes of.
5608 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5609 theTopLeftPoint Point, specifying top left corner of a quadrangle
5610 theTopRigthPoint Point, specifying top right corner of a quadrangle
5611 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5612 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5613 theState The state of the sub-shapes to find (see GEOM::shape_state)
5616 List of all found sub-shapes indices.
5619 # Example: see GEOM_TestOthers.py
5620 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5621 theTopLeftPoint, theTopRigthPoint,
5622 theBottomLeftPoint, theBottomRigthPoint, theState)
5623 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5626 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5627 # the specified \a theBox by the certain way, defined through \a theState parameter.
5628 # @param theBox Shape for relative comparing.
5629 # @param theShape Shape to find sub-shapes of.
5630 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5631 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5632 # @param theName Object name; when specified, this parameter is used
5633 # for result publication in the study. Otherwise, if automatic
5634 # publication is switched on, default value is used for result name.
5636 # @return List of all found sub-shapes.
5638 # @ref swig_GetShapesOnBox "Example"
5639 @ManageTransactions("ShapesOp")
5640 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5642 Find in theShape all sub-shapes of type theShapeType, situated relatively
5643 the specified theBox by the certain way, defined through theState parameter.
5646 theBox Shape for relative comparing.
5647 theShape Shape to find sub-shapes of.
5648 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5649 theState The state of the sub-shapes to find (see GEOM::shape_state)
5650 theName Object name; when specified, this parameter is used
5651 for result publication in the study. Otherwise, if automatic
5652 publication is switched on, default value is used for result name.
5655 List of all found sub-shapes.
5657 # Example: see GEOM_TestOthers.py
5658 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5659 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5660 self._autoPublish(aList, theName, "shapeOnBox")
5663 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5664 # the specified \a theBox by the certain way, defined through \a theState parameter.
5665 # @param theBox Shape for relative comparing.
5666 # @param theShape Shape to find sub-shapes of.
5667 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5668 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5670 # @return List of all found sub-shapes indices.
5672 # @ref swig_GetShapesOnBoxIDs "Example"
5673 @ManageTransactions("ShapesOp")
5674 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5676 Find in theShape all sub-shapes of type theShapeType, situated relatively
5677 the specified theBox by the certain way, defined through theState parameter.
5680 theBox Shape for relative comparing.
5681 theShape Shape to find sub-shapes of.
5682 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5683 theState The state of the sub-shapes to find (see GEOM::shape_state)
5686 List of all found sub-shapes indices.
5688 # Example: see GEOM_TestOthers.py
5689 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5690 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5693 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5694 # situated relatively the specified \a theCheckShape by the
5695 # certain way, defined through \a theState parameter.
5696 # @param theCheckShape Shape for relative comparing. It must be a solid.
5697 # @param theShape Shape to find sub-shapes of.
5698 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5699 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5700 # @param theName Object name; when specified, this parameter is used
5701 # for result publication in the study. Otherwise, if automatic
5702 # publication is switched on, default value is used for result name.
5704 # @return List of all found sub-shapes.
5706 # @ref swig_GetShapesOnShape "Example"
5707 @ManageTransactions("ShapesOp")
5708 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5710 Find in theShape all sub-shapes of type theShapeType,
5711 situated relatively the specified theCheckShape by the
5712 certain way, defined through theState parameter.
5715 theCheckShape Shape for relative comparing. It must be a solid.
5716 theShape Shape to find sub-shapes of.
5717 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5718 theState The state of the sub-shapes to find (see GEOM::shape_state)
5719 theName Object name; when specified, this parameter is used
5720 for result publication in the study. Otherwise, if automatic
5721 publication is switched on, default value is used for result name.
5724 List of all found sub-shapes.
5726 # Example: see GEOM_TestOthers.py
5727 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5728 theShapeType, theState)
5729 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5730 self._autoPublish(aList, theName, "shapeOnShape")
5733 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5734 # situated relatively the specified \a theCheckShape by the
5735 # certain way, defined through \a theState parameter.
5736 # @param theCheckShape Shape for relative comparing. It must be a solid.
5737 # @param theShape Shape to find sub-shapes of.
5738 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5739 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5740 # @param theName Object name; when specified, this parameter is used
5741 # for result publication in the study. Otherwise, if automatic
5742 # publication is switched on, default value is used for result name.
5744 # @return All found sub-shapes as compound.
5746 # @ref swig_GetShapesOnShapeAsCompound "Example"
5747 @ManageTransactions("ShapesOp")
5748 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5750 Find in theShape all sub-shapes of type theShapeType,
5751 situated relatively the specified theCheckShape by the
5752 certain way, defined through theState parameter.
5755 theCheckShape Shape for relative comparing. It must be a solid.
5756 theShape Shape to find sub-shapes of.
5757 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5758 theState The state of the sub-shapes to find (see GEOM::shape_state)
5759 theName Object name; when specified, this parameter is used
5760 for result publication in the study. Otherwise, if automatic
5761 publication is switched on, default value is used for result name.
5764 All found sub-shapes as compound.
5766 # Example: see GEOM_TestOthers.py
5767 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5768 theShapeType, theState)
5769 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5770 self._autoPublish(anObj, theName, "shapeOnShape")
5773 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5774 # situated relatively the specified \a theCheckShape by the
5775 # certain way, defined through \a theState parameter.
5776 # @param theCheckShape Shape for relative comparing. It must be a solid.
5777 # @param theShape Shape to find sub-shapes of.
5778 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5779 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5781 # @return List of all found sub-shapes indices.
5783 # @ref swig_GetShapesOnShapeIDs "Example"
5784 @ManageTransactions("ShapesOp")
5785 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5787 Find in theShape all sub-shapes of type theShapeType,
5788 situated relatively the specified theCheckShape by the
5789 certain way, defined through theState parameter.
5792 theCheckShape Shape for relative comparing. It must be a solid.
5793 theShape Shape to find sub-shapes of.
5794 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5795 theState The state of the sub-shapes to find (see GEOM::shape_state)
5798 List of all found sub-shapes indices.
5800 # Example: see GEOM_TestOthers.py
5801 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5802 theShapeType, theState)
5803 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5806 ## Get sub-shape(s) of theShapeWhere, which are
5807 # coincident with \a theShapeWhat or could be a part of it.
5808 # @param theShapeWhere Shape to find sub-shapes of.
5809 # @param theShapeWhat Shape, specifying what to find.
5810 # @param isNewImplementation implementation of GetInPlace functionality
5811 # (default = False, old alghorithm based on shape properties)
5812 # @param theName Object name; when specified, this parameter is used
5813 # for result publication in the study. Otherwise, if automatic
5814 # publication is switched on, default value is used for result name.
5816 # @return Group of all found sub-shapes or a single found sub-shape.
5818 # @note This function has a restriction on argument shapes.
5819 # If \a theShapeWhere has curved parts with significantly
5820 # outstanding centres (i.e. the mass centre of a part is closer to
5821 # \a theShapeWhat than to the part), such parts will not be found.
5822 # @image html get_in_place_lost_part.png
5824 # @ref swig_GetInPlace "Example"
5825 @ManageTransactions("ShapesOp")
5826 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5828 Get sub-shape(s) of theShapeWhere, which are
5829 coincident with theShapeWhat or could be a part of it.
5832 theShapeWhere Shape to find sub-shapes of.
5833 theShapeWhat Shape, specifying what to find.
5834 isNewImplementation Implementation of GetInPlace functionality
5835 (default = False, old alghorithm based on shape properties)
5836 theName Object name; when specified, this parameter is used
5837 for result publication in the study. Otherwise, if automatic
5838 publication is switched on, default value is used for result name.
5841 Group of all found sub-shapes or a single found sub-shape.
5845 This function has a restriction on argument shapes.
5846 If theShapeWhere has curved parts with significantly
5847 outstanding centres (i.e. the mass centre of a part is closer to
5848 theShapeWhat than to the part), such parts will not be found.
5850 # Example: see GEOM_TestOthers.py
5852 if isNewImplementation:
5853 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5855 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5857 RaiseIfFailed("GetInPlace", self.ShapesOp)
5858 self._autoPublish(anObj, theName, "inplace")
5861 ## Get sub-shape(s) of \a theShapeWhere, which are
5862 # coincident with \a theShapeWhat or could be a part of it.
5864 # Implementation of this method is based on a saved history of an operation,
5865 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5866 # arguments (an argument shape or a sub-shape of an argument shape).
5867 # The operation could be the Partition or one of boolean operations,
5868 # performed on simple shapes (not on compounds).
5870 # @param theShapeWhere Shape to find sub-shapes of.
5871 # @param theShapeWhat Shape, specifying what to find (must be in the
5872 # building history of the ShapeWhere).
5873 # @param theName Object name; when specified, this parameter is used
5874 # for result publication in the study. Otherwise, if automatic
5875 # publication is switched on, default value is used for result name.
5877 # @return Group of all found sub-shapes or a single found sub-shape.
5879 # @ref swig_GetInPlace "Example"
5880 @ManageTransactions("ShapesOp")
5881 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5883 Implementation of this method is based on a saved history of an operation,
5884 produced theShapeWhere. The theShapeWhat must be among this operation's
5885 arguments (an argument shape or a sub-shape of an argument shape).
5886 The operation could be the Partition or one of boolean operations,
5887 performed on simple shapes (not on compounds).
5890 theShapeWhere Shape to find sub-shapes of.
5891 theShapeWhat Shape, specifying what to find (must be in the
5892 building history of the ShapeWhere).
5893 theName Object name; when specified, this parameter is used
5894 for result publication in the study. Otherwise, if automatic
5895 publication is switched on, default value is used for result name.
5898 Group of all found sub-shapes or a single found sub-shape.
5900 # Example: see GEOM_TestOthers.py
5901 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5902 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5903 self._autoPublish(anObj, theName, "inplace")
5906 ## Get sub-shape of theShapeWhere, which is
5907 # equal to \a theShapeWhat.
5908 # @param theShapeWhere Shape to find sub-shape of.
5909 # @param theShapeWhat Shape, specifying what to find.
5910 # @param theName Object name; when specified, this parameter is used
5911 # for result publication in the study. Otherwise, if automatic
5912 # publication is switched on, default value is used for result name.
5914 # @return New GEOM.GEOM_Object for found sub-shape.
5916 # @ref swig_GetSame "Example"
5917 @ManageTransactions("ShapesOp")
5918 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5920 Get sub-shape of theShapeWhere, which is
5921 equal to theShapeWhat.
5924 theShapeWhere Shape to find sub-shape of.
5925 theShapeWhat Shape, specifying what to find.
5926 theName Object name; when specified, this parameter is used
5927 for result publication in the study. Otherwise, if automatic
5928 publication is switched on, default value is used for result name.
5931 New GEOM.GEOM_Object for found sub-shape.
5933 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5934 RaiseIfFailed("GetSame", self.ShapesOp)
5935 self._autoPublish(anObj, theName, "sameShape")
5939 ## Get sub-shape indices of theShapeWhere, which is
5940 # equal to \a theShapeWhat.
5941 # @param theShapeWhere Shape to find sub-shape of.
5942 # @param theShapeWhat Shape, specifying what to find.
5943 # @return List of all found sub-shapes indices.
5945 # @ref swig_GetSame "Example"
5946 @ManageTransactions("ShapesOp")
5947 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5949 Get sub-shape indices of theShapeWhere, which is
5950 equal to theShapeWhat.
5953 theShapeWhere Shape to find sub-shape of.
5954 theShapeWhat Shape, specifying what to find.
5957 List of all found sub-shapes indices.
5959 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5960 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5963 ## Resize the input edge with the new Min and Max parameters.
5964 # The input edge parameters range is [0, 1]. If theMin parameter is
5965 # negative, the input edge is extended, otherwise it is shrinked by
5966 # theMin parameter. If theMax is greater than 1, the edge is extended,
5967 # otherwise it is shrinked by theMax parameter.
5968 # @param theEdge the input edge to be resized.
5969 # @param theMin the minimal parameter value.
5970 # @param theMax the maximal parameter value.
5971 # @param theName Object name; when specified, this parameter is used
5972 # for result publication in the study. Otherwise, if automatic
5973 # publication is switched on, default value is used for result name.
5974 # @return New GEOM.GEOM_Object, containing the created edge.
5976 # @ref tui_extend "Example"
5977 @ManageTransactions("ShapesOp")
5978 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
5980 Resize the input edge with the new Min and Max parameters.
5981 The input edge parameters range is [0, 1]. If theMin parameter is
5982 negative, the input edge is extended, otherwise it is shrinked by
5983 theMin parameter. If theMax is greater than 1, the edge is extended,
5984 otherwise it is shrinked by theMax parameter.
5987 theEdge the input edge to be resized.
5988 theMin the minimal parameter value.
5989 theMax the maximal parameter value.
5990 theName Object name; when specified, this parameter is used
5991 for result publication in the study. Otherwise, if automatic
5992 publication is switched on, default value is used for result name.
5995 New GEOM.GEOM_Object, containing the created edge.
5997 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
5998 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
5999 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6000 anObj.SetParameters(Parameters)
6001 self._autoPublish(anObj, theName, "edge")
6004 ## Resize the input face with the new UMin, UMax, VMin and VMax
6005 # parameters. The input face U and V parameters range is [0, 1]. If
6006 # theUMin parameter is negative, the input face is extended, otherwise
6007 # it is shrinked along U direction by theUMin parameter. If theUMax is
6008 # greater than 1, the face is extended, otherwise it is shrinked along
6009 # U direction by theUMax parameter. So as for theVMin, theVMax and
6010 # V direction of the input face.
6011 # @param theFace the input face to be resized.
6012 # @param theUMin the minimal U parameter value.
6013 # @param theUMax the maximal U parameter value.
6014 # @param theVMin the minimal V parameter value.
6015 # @param theVMax the maximal V parameter value.
6016 # @param theName Object name; when specified, this parameter is used
6017 # for result publication in the study. Otherwise, if automatic
6018 # publication is switched on, default value is used for result name.
6019 # @return New GEOM.GEOM_Object, containing the created face.
6021 # @ref tui_extend "Example"
6022 @ManageTransactions("ShapesOp")
6023 def ExtendFace(self, theFace, theUMin, theUMax,
6024 theVMin, theVMax, theName=None):
6026 Resize the input face with the new UMin, UMax, VMin and VMax
6027 parameters. The input face U and V parameters range is [0, 1]. If
6028 theUMin parameter is negative, the input face is extended, otherwise
6029 it is shrinked along U direction by theUMin parameter. If theUMax is
6030 greater than 1, the face is extended, otherwise it is shrinked along
6031 U direction by theUMax parameter. So as for theVMin, theVMax and
6032 V direction of the input face.
6035 theFace the input face to be resized.
6036 theUMin the minimal U parameter value.
6037 theUMax the maximal U parameter value.
6038 theVMin the minimal V parameter value.
6039 theVMax the maximal V parameter value.
6040 theName Object name; when specified, this parameter is used
6041 for result publication in the study. Otherwise, if automatic
6042 publication is switched on, default value is used for result name.
6045 New GEOM.GEOM_Object, containing the created face.
6047 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6048 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6050 RaiseIfFailed("ExtendFace", self.ShapesOp)
6051 anObj.SetParameters(Parameters)
6052 self._autoPublish(anObj, theName, "face")
6055 ## This function takes some face as input parameter and creates new
6056 # GEOM_Object, i.e. topological shape by extracting underlying surface
6057 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6058 # parameters of the source face (in the parametrical space).
6059 # @param theFace the input face.
6060 # @param theName Object name; when specified, this parameter is used
6061 # for result publication in the study. Otherwise, if automatic
6062 # publication is switched on, default value is used for result name.
6063 # @return New GEOM.GEOM_Object, containing the created face.
6065 # @ref tui_creation_surface "Example"
6066 @ManageTransactions("ShapesOp")
6067 def MakeSurfaceFromFace(self, theFace, theName=None):
6069 This function takes some face as input parameter and creates new
6070 GEOM_Object, i.e. topological shape by extracting underlying surface
6071 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6072 parameters of the source face (in the parametrical space).
6075 theFace the input face.
6076 theName Object name; when specified, this parameter is used
6077 for result publication in the study. Otherwise, if automatic
6078 publication is switched on, default value is used for result name.
6081 New GEOM.GEOM_Object, containing the created face.
6083 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6084 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6085 self._autoPublish(anObj, theName, "surface")
6091 ## @addtogroup l4_access
6094 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6095 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6096 # @param aShape Shape to get sub-shape of.
6097 # @param ListOfID List of sub-shapes indices.
6098 # @param theName Object name; when specified, this parameter is used
6099 # for result publication in the study. Otherwise, if automatic
6100 # publication is switched on, default value is used for result name.
6102 # @return Found sub-shape.
6104 # @ref swig_all_decompose "Example"
6105 def GetSubShape(self, aShape, ListOfID, theName=None):
6107 Obtain a composite sub-shape of aShape, composed from sub-shapes
6108 of aShape, selected by their unique IDs inside aShape
6111 aShape Shape to get sub-shape of.
6112 ListOfID List of sub-shapes indices.
6113 theName Object name; when specified, this parameter is used
6114 for result publication in the study. Otherwise, if automatic
6115 publication is switched on, default value is used for result name.
6120 # Example: see GEOM_TestAll.py
6121 anObj = self.AddSubShape(aShape,ListOfID)
6122 self._autoPublish(anObj, theName, "subshape")
6125 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6126 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6127 # @param aShape Shape to get sub-shape of.
6128 # @param aSubShape Sub-shapes of aShape.
6129 # @return ID of found sub-shape.
6131 # @ref swig_all_decompose "Example"
6132 @ManageTransactions("LocalOp")
6133 def GetSubShapeID(self, aShape, aSubShape):
6135 Obtain unique ID of sub-shape aSubShape inside aShape
6136 of aShape, selected by their unique IDs inside aShape
6139 aShape Shape to get sub-shape of.
6140 aSubShape Sub-shapes of aShape.
6143 ID of found sub-shape.
6145 # Example: see GEOM_TestAll.py
6146 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6147 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6150 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6151 # This function is provided for performance purpose. The complexity is O(n) with n
6152 # the number of subobjects of aShape
6153 # @param aShape Shape to get sub-shape of.
6154 # @param aSubShapes Sub-shapes of aShape.
6155 # @return list of IDs of found sub-shapes.
6157 # @ref swig_all_decompose "Example"
6158 @ManageTransactions("ShapesOp")
6159 def GetSubShapesIDs(self, aShape, aSubShapes):
6161 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6162 This function is provided for performance purpose. The complexity is O(n) with n
6163 the number of subobjects of aShape
6166 aShape Shape to get sub-shape of.
6167 aSubShapes Sub-shapes of aShape.
6170 List of IDs of found sub-shape.
6172 # Example: see GEOM_TestAll.py
6173 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6174 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6180 ## @addtogroup l4_decompose
6183 ## Get all sub-shapes and groups of \a theShape,
6184 # that were created already by any other methods.
6185 # @param theShape Any shape.
6186 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6187 # returned, else all found sub-shapes and groups.
6188 # @return List of existing sub-objects of \a theShape.
6190 # @ref swig_all_decompose "Example"
6191 @ManageTransactions("ShapesOp")
6192 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6194 Get all sub-shapes and groups of theShape,
6195 that were created already by any other methods.
6199 theGroupsOnly If this parameter is TRUE, only groups will be
6200 returned, else all found sub-shapes and groups.
6203 List of existing sub-objects of theShape.
6205 # Example: see GEOM_TestAll.py
6206 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6207 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6210 ## Get all groups of \a theShape,
6211 # that were created already by any other methods.
6212 # @param theShape Any shape.
6213 # @return List of existing groups of \a theShape.
6215 # @ref swig_all_decompose "Example"
6216 @ManageTransactions("ShapesOp")
6217 def GetGroups(self, theShape):
6219 Get all groups of theShape,
6220 that were created already by any other methods.
6226 List of existing groups of theShape.
6228 # Example: see GEOM_TestAll.py
6229 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6230 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6233 ## Explode a shape on sub-shapes of a given type.
6234 # If the shape itself matches the type, it is also returned.
6235 # @param aShape Shape to be exploded.
6236 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6237 # @param theName Object name; when specified, this parameter is used
6238 # for result publication in the study. Otherwise, if automatic
6239 # publication is switched on, default value is used for result name.
6241 # @return List of sub-shapes of type theShapeType, contained in theShape.
6243 # @ref swig_all_decompose "Example"
6244 @ManageTransactions("ShapesOp")
6245 def SubShapeAll(self, aShape, aType, theName=None):
6247 Explode a shape on sub-shapes of a given type.
6248 If the shape itself matches the type, it is also returned.
6251 aShape Shape to be exploded.
6252 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6253 theName Object name; when specified, this parameter is used
6254 for result publication in the study. Otherwise, if automatic
6255 publication is switched on, default value is used for result name.
6258 List of sub-shapes of type theShapeType, contained in theShape.
6260 # Example: see GEOM_TestAll.py
6261 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6262 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6263 self._autoPublish(ListObj, theName, "subshape")
6266 ## Explode a shape on sub-shapes of a given type.
6267 # @param aShape Shape to be exploded.
6268 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6269 # @return List of IDs of sub-shapes.
6271 # @ref swig_all_decompose "Example"
6272 @ManageTransactions("ShapesOp")
6273 def SubShapeAllIDs(self, aShape, aType):
6275 Explode a shape on sub-shapes of a given type.
6278 aShape Shape to be exploded (see geompy.ShapeType)
6279 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6282 List of IDs of sub-shapes.
6284 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6285 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6288 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6289 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6290 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6291 # @param aShape Shape to get sub-shape of.
6292 # @param ListOfInd List of sub-shapes indices.
6293 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6294 # @param theName Object name; when specified, this parameter is used
6295 # for result publication in the study. Otherwise, if automatic
6296 # publication is switched on, default value is used for result name.
6298 # @return A compound of sub-shapes of aShape.
6300 # @ref swig_all_decompose "Example"
6301 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6303 Obtain a compound of sub-shapes of aShape,
6304 selected by their indices in list of all sub-shapes of type aType.
6305 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6308 aShape Shape to get sub-shape of.
6309 ListOfID List of sub-shapes indices.
6310 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6311 theName Object name; when specified, this parameter is used
6312 for result publication in the study. Otherwise, if automatic
6313 publication is switched on, default value is used for result name.
6316 A compound of sub-shapes of aShape.
6318 # Example: see GEOM_TestAll.py
6320 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6321 for ind in ListOfInd:
6322 ListOfIDs.append(AllShapeIDsList[ind - 1])
6323 # note: auto-publishing is done in self.GetSubShape()
6324 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6327 ## Explode a shape on sub-shapes of a given type.
6328 # Sub-shapes will be sorted taking into account their gravity centers,
6329 # to provide stable order of sub-shapes.
6330 # If the shape itself matches the type, it is also returned.
6331 # @param aShape Shape to be exploded.
6332 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6333 # @param theName Object name; when specified, this parameter is used
6334 # for result publication in the study. Otherwise, if automatic
6335 # publication is switched on, default value is used for result name.
6337 # @return List of sub-shapes of type theShapeType, contained in theShape.
6339 # @ref swig_SubShapeAllSorted "Example"
6340 @ManageTransactions("ShapesOp")
6341 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6343 Explode a shape on sub-shapes of a given type.
6344 Sub-shapes will be sorted taking into account their gravity centers,
6345 to provide stable order of sub-shapes.
6346 If the shape itself matches the type, it is also returned.
6349 aShape Shape to be exploded.
6350 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6351 theName Object name; when specified, this parameter is used
6352 for result publication in the study. Otherwise, if automatic
6353 publication is switched on, default value is used for result name.
6356 List of sub-shapes of type theShapeType, contained in theShape.
6358 # Example: see GEOM_TestAll.py
6359 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6360 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6361 self._autoPublish(ListObj, theName, "subshape")
6364 ## Explode a shape on sub-shapes of a given type.
6365 # Sub-shapes will be sorted taking into account their gravity centers,
6366 # to provide stable order of sub-shapes.
6367 # @param aShape Shape to be exploded.
6368 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6369 # @return List of IDs of sub-shapes.
6371 # @ref swig_all_decompose "Example"
6372 @ManageTransactions("ShapesOp")
6373 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6375 Explode a shape on sub-shapes of a given type.
6376 Sub-shapes will be sorted taking into account their gravity centers,
6377 to provide stable order of sub-shapes.
6380 aShape Shape to be exploded.
6381 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6384 List of IDs of sub-shapes.
6386 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6387 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6390 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6391 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6392 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6393 # @param aShape Shape to get sub-shape of.
6394 # @param ListOfInd List of sub-shapes indices.
6395 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6396 # @param theName Object name; when specified, this parameter is used
6397 # for result publication in the study. Otherwise, if automatic
6398 # publication is switched on, default value is used for result name.
6400 # @return A compound of sub-shapes of aShape.
6402 # @ref swig_all_decompose "Example"
6403 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6405 Obtain a compound of sub-shapes of aShape,
6406 selected by they indices in sorted list of all sub-shapes of type aType.
6407 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6410 aShape Shape to get sub-shape of.
6411 ListOfID List of sub-shapes indices.
6412 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6413 theName Object name; when specified, this parameter is used
6414 for result publication in the study. Otherwise, if automatic
6415 publication is switched on, default value is used for result name.
6418 A compound of sub-shapes of aShape.
6420 # Example: see GEOM_TestAll.py
6422 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6423 for ind in ListOfInd:
6424 ListOfIDs.append(AllShapeIDsList[ind - 1])
6425 # note: auto-publishing is done in self.GetSubShape()
6426 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6429 ## Extract shapes (excluding the main shape) of given type.
6430 # @param aShape The shape.
6431 # @param aType The shape type (see ShapeType())
6432 # @param isSorted Boolean flag to switch sorting on/off.
6433 # @param theName Object name; when specified, this parameter is used
6434 # for result publication in the study. Otherwise, if automatic
6435 # publication is switched on, default value is used for result name.
6437 # @return List of sub-shapes of type aType, contained in aShape.
6439 # @ref swig_FilletChamfer "Example"
6440 @ManageTransactions("ShapesOp")
6441 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6443 Extract shapes (excluding the main shape) of given type.
6447 aType The shape type (see geompy.ShapeType)
6448 isSorted Boolean flag to switch sorting on/off.
6449 theName Object name; when specified, this parameter is used
6450 for result publication in the study. Otherwise, if automatic
6451 publication is switched on, default value is used for result name.
6454 List of sub-shapes of type aType, contained in aShape.
6456 # Example: see GEOM_TestAll.py
6457 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6458 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6459 self._autoPublish(ListObj, theName, "subshape")
6462 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6463 # @param aShape Main shape.
6464 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6465 # @param theName Object name; when specified, this parameter is used
6466 # for result publication in the study. Otherwise, if automatic
6467 # publication is switched on, default value is used for result name.
6468 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6470 # @ref swig_all_decompose "Example"
6471 @ManageTransactions("ShapesOp")
6472 def SubShapes(self, aShape, anIDs, theName=None):
6474 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6478 anIDs List of unique IDs of sub-shapes inside theMainShape.
6479 theName Object name; when specified, this parameter is used
6480 for result publication in the study. Otherwise, if automatic
6481 publication is switched on, default value is used for result name.
6484 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6486 # Example: see GEOM_TestAll.py
6487 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6488 RaiseIfFailed("SubShapes", self.ShapesOp)
6489 self._autoPublish(ListObj, theName, "subshape")
6492 ## Explode a shape into edges sorted in a row from a starting point.
6493 # @param theShape the shape to be exploded on edges.
6494 # @param theStartPoint the starting point.
6495 # @param theName Object name; when specified, this parameter is used
6496 # for result publication in the study. Otherwise, if automatic
6497 # publication is switched on, default value is used for result name.
6498 # @return List of GEOM.GEOM_Object that is actually an ordered list
6499 # of edges sorted in a row from a starting point.
6501 # @ref swig_GetSubShapeEdgeSorted "Example"
6502 @ManageTransactions("ShapesOp")
6503 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6505 Explode a shape into edges sorted in a row from a starting point.
6508 theShape the shape to be exploded on edges.
6509 theStartPoint the starting point.
6510 theName Object name; when specified, this parameter is used
6511 for result publication in the study. Otherwise, if automatic
6512 publication is switched on, default value is used for result name.
6515 List of GEOM.GEOM_Object that is actually an ordered list
6516 of edges sorted in a row from a starting point.
6518 # Example: see GEOM_TestAll.py
6519 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6520 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6521 self._autoPublish(ListObj, theName, "SortedEdges")
6524 ## Check if the object is a sub-object of another GEOM object.
6525 # @param aSubObject Checked sub-object (or its parent object, in case if
6526 # \a theSubObjectIndex is non-zero).
6527 # @param anObject An object that is checked for ownership (or its parent object,
6528 # in case if \a theObjectIndex is non-zero).
6529 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6530 # identifies a sub-object within its parent specified via \a theSubObject.
6531 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6532 # identifies an object within its parent specified via \a theObject.
6533 # @return TRUE, if the given object contains sub-object.
6534 @ManageTransactions("ShapesOp")
6535 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6537 Check if the object is a sub-object of another GEOM object.
6540 aSubObject Checked sub-object (or its parent object, in case if
6541 \a theSubObjectIndex is non-zero).
6542 anObject An object that is checked for ownership (or its parent object,
6543 in case if \a theObjectIndex is non-zero).
6544 aSubObjectIndex When non-zero, specifies a sub-shape index that
6545 identifies a sub-object within its parent specified via \a theSubObject.
6546 anObjectIndex When non-zero, specifies a sub-shape index that
6547 identifies an object within its parent specified via \a theObject.
6550 TRUE, if the given object contains sub-object.
6552 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6553 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6556 # end of l4_decompose
6559 ## @addtogroup l4_decompose_d
6562 ## Deprecated method
6563 # It works like SubShapeAllSortedCentres(), but wrongly
6564 # defines centres of faces, shells and solids.
6565 @ManageTransactions("ShapesOp")
6566 def SubShapeAllSorted(self, aShape, aType, theName=None):
6569 It works like geompy.SubShapeAllSortedCentres, but wrongly
6570 defines centres of faces, shells and solids.
6572 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6573 RaiseIfFailed("MakeExplode", self.ShapesOp)
6574 self._autoPublish(ListObj, theName, "subshape")
6577 ## Deprecated method
6578 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6579 # defines centres of faces, shells and solids.
6580 @ManageTransactions("ShapesOp")
6581 def SubShapeAllSortedIDs(self, aShape, aType):
6584 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6585 defines centres of faces, shells and solids.
6587 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6588 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6591 ## Deprecated method
6592 # It works like SubShapeSortedCentres(), but has a bug
6593 # (wrongly defines centres of faces, shells and solids).
6594 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6597 It works like geompy.SubShapeSortedCentres, but has a bug
6598 (wrongly defines centres of faces, shells and solids).
6601 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6602 for ind in ListOfInd:
6603 ListOfIDs.append(AllShapeIDsList[ind - 1])
6604 # note: auto-publishing is done in self.GetSubShape()
6605 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6608 # end of l4_decompose_d
6611 ## @addtogroup l3_healing
6614 ## Apply a sequence of Shape Healing operators to the given object.
6615 # @param theShape Shape to be processed.
6616 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6617 # @param theParameters List of names of parameters
6618 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6619 # @param theValues List of values of parameters, in the same order
6620 # as parameters are listed in <VAR>theParameters</VAR> list.
6621 # @param theName Object name; when specified, this parameter is used
6622 # for result publication in the study. Otherwise, if automatic
6623 # publication is switched on, default value is used for result name.
6625 # <b> Operators and Parameters: </b> \n
6627 # * \b FixShape - corrects invalid shapes. \n
6628 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6629 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6631 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6632 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6633 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6634 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6635 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6636 # - \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
6637 # - \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
6638 # - \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
6640 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6641 # surfaces in segments using a certain angle. \n
6642 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6643 # if Angle=180, four if Angle=90, etc). \n
6644 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6646 # * \b SplitClosedFaces - splits closed faces in segments.
6647 # The number of segments depends on the number of splitting points.\n
6648 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6650 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6651 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6652 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6653 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6654 # This and the previous parameters can take the following values:\n
6655 # \b Parametric \b Continuity \n
6656 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6657 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6658 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6659 # ruling out sharp edges).\n
6660 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6661 # are of the same magnitude).\n
6662 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6663 # or surfaces (d/du C(u)) are the same at junction. \n
6664 # \b Geometric \b Continuity \n
6665 # \b G1: first derivatives are proportional at junction.\n
6666 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6667 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6668 # \b G2: first and second derivatives are proportional at junction.
6669 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6670 # continuity requires that the underlying parameterization was continuous as well.
6671 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6673 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6674 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6675 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6676 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6677 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6678 # with the specified parameters.\n
6679 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6680 # with the specified parameters.\n
6681 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6682 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6683 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6684 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6686 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6687 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6688 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6689 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6690 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6692 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6693 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6696 # @return New GEOM.GEOM_Object, containing processed shape.
6698 # \n @ref tui_shape_processing "Example"
6699 @ManageTransactions("HealOp")
6700 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6702 Apply a sequence of Shape Healing operators to the given object.
6705 theShape Shape to be processed.
6706 theValues List of values of parameters, in the same order
6707 as parameters are listed in theParameters list.
6708 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6709 theParameters List of names of parameters
6710 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6711 theName Object name; when specified, this parameter is used
6712 for result publication in the study. Otherwise, if automatic
6713 publication is switched on, default value is used for result name.
6715 Operators and Parameters:
6717 * FixShape - corrects invalid shapes.
6718 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6719 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6720 * FixFaceSize - removes small faces, such as spots and strips.
6721 * FixFaceSize.Tolerance - defines minimum possible face size.
6722 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6723 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6724 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6725 * 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.
6726 * 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.
6727 * 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.
6729 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6730 in segments using a certain angle.
6731 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6732 if Angle=180, four if Angle=90, etc).
6733 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6734 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6736 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6737 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6738 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6739 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6740 * SplitContinuity.CurveContinuity - required continuity for curves.
6741 This and the previous parameters can take the following values:
6743 Parametric Continuity:
6744 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6745 coincidental. The curves or surfaces may still meet at an angle,
6746 giving rise to a sharp corner or edge).
6747 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6748 are parallel, ruling out sharp edges).
6749 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6750 or surfaces are of the same magnitude).
6751 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6752 curves or surfaces (d/du C(u)) are the same at junction.
6754 Geometric Continuity:
6755 G1: first derivatives are proportional at junction.
6756 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6757 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6758 G2: first and second derivatives are proportional at junction. As the names imply,
6759 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6760 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6761 geometric continuity of order n, but not vice-versa.
6762 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6763 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6764 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6765 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6766 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6767 the specified parameters.
6768 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6769 the specified parameters.
6770 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6771 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6772 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6773 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6774 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6775 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6776 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6777 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6778 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6779 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6780 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6783 New GEOM.GEOM_Object, containing processed shape.
6785 Note: For more information look through SALOME Geometry User's Guide->
6786 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6788 # Example: see GEOM_TestHealing.py
6789 theValues,Parameters = ParseList(theValues)
6790 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6791 # To avoid script failure in case of good argument shape
6792 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6794 RaiseIfFailed("ProcessShape", self.HealOp)
6795 for string in (theOperators + theParameters):
6796 Parameters = ":" + Parameters
6798 anObj.SetParameters(Parameters)
6799 self._autoPublish(anObj, theName, "healed")
6802 ## Remove faces from the given object (shape).
6803 # @param theObject Shape to be processed.
6804 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6805 # removes ALL faces of the given object.
6806 # @param theName Object name; when specified, this parameter is used
6807 # for result publication in the study. Otherwise, if automatic
6808 # publication is switched on, default value is used for result name.
6810 # @return New GEOM.GEOM_Object, containing processed shape.
6812 # @ref tui_suppress_faces "Example"
6813 @ManageTransactions("HealOp")
6814 def SuppressFaces(self, theObject, theFaces, theName=None):
6816 Remove faces from the given object (shape).
6819 theObject Shape to be processed.
6820 theFaces Indices of faces to be removed, if EMPTY then the method
6821 removes ALL faces of the given object.
6822 theName Object name; when specified, this parameter is used
6823 for result publication in the study. Otherwise, if automatic
6824 publication is switched on, default value is used for result name.
6827 New GEOM.GEOM_Object, containing processed shape.
6829 # Example: see GEOM_TestHealing.py
6830 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6831 RaiseIfFailed("SuppressFaces", self.HealOp)
6832 self._autoPublish(anObj, theName, "suppressFaces")
6835 ## Sewing of faces into a single shell.
6836 # @param ListShape Shapes to be processed.
6837 # @param theTolerance Required tolerance value.
6838 # @param AllowNonManifold Flag that allows non-manifold sewing.
6839 # @param theName Object name; when specified, this parameter is used
6840 # for result publication in the study. Otherwise, if automatic
6841 # publication is switched on, default value is used for result name.
6843 # @return New GEOM.GEOM_Object, containing a result shell.
6845 # @ref tui_sewing "Example"
6846 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6848 Sewing of faces into a single shell.
6851 ListShape Shapes to be processed.
6852 theTolerance Required tolerance value.
6853 AllowNonManifold Flag that allows non-manifold sewing.
6854 theName Object name; when specified, this parameter is used
6855 for result publication in the study. Otherwise, if automatic
6856 publication is switched on, default value is used for result name.
6859 New GEOM.GEOM_Object, containing containing a result shell.
6861 # Example: see GEOM_TestHealing.py
6862 # note: auto-publishing is done in self.Sew()
6863 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6866 ## Sewing of faces into a single shell.
6867 # @param ListShape Shapes to be processed.
6868 # @param theTolerance Required tolerance value.
6869 # @param AllowNonManifold Flag that allows non-manifold sewing.
6870 # @param theName Object name; when specified, this parameter is used
6871 # for result publication in the study. Otherwise, if automatic
6872 # publication is switched on, default value is used for result name.
6874 # @return New GEOM.GEOM_Object, containing a result shell.
6875 @ManageTransactions("HealOp")
6876 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6878 Sewing of faces into a single shell.
6881 ListShape Shapes to be processed.
6882 theTolerance Required tolerance value.
6883 AllowNonManifold Flag that allows non-manifold sewing.
6884 theName Object name; when specified, this parameter is used
6885 for result publication in the study. Otherwise, if automatic
6886 publication is switched on, default value is used for result name.
6889 New GEOM.GEOM_Object, containing a result shell.
6891 # Example: see MakeSewing() above
6892 theTolerance,Parameters = ParseParameters(theTolerance)
6893 if AllowNonManifold:
6894 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6896 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6897 # To avoid script failure in case of good argument shape
6898 # (Fix of test cases geom/bugs11/L7,L8)
6899 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6901 RaiseIfFailed("Sew", self.HealOp)
6902 anObj.SetParameters(Parameters)
6903 self._autoPublish(anObj, theName, "sewed")
6906 ## Rebuild the topology of theSolids by removing
6907 # the faces that are shared by several solids.
6908 # @param theSolids A compound or a list of solids to be processed.
6909 # @param theName Object name; when specified, this parameter is used
6910 # for result publication in the study. Otherwise, if automatic
6911 # publication is switched on, default value is used for result name.
6913 # @return New GEOM.GEOM_Object, containing processed shape.
6915 # @ref tui_remove_webs "Example"
6916 @ManageTransactions("HealOp")
6917 def RemoveInternalFaces (self, theSolids, theName=None):
6919 Rebuild the topology of theSolids by removing
6920 the faces that are shared by several solids.
6923 theSolids A compound or a list of solids to be processed.
6924 theName Object name; when specified, this parameter is used
6925 for result publication in the study. Otherwise, if automatic
6926 publication is switched on, default value is used for result name.
6929 New GEOM.GEOM_Object, containing processed shape.
6931 # Example: see GEOM_TestHealing.py
6932 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
6933 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6934 self._autoPublish(anObj, theName, "removeWebs")
6937 ## Remove internal wires and edges from the given object (face).
6938 # @param theObject Shape to be processed.
6939 # @param theWires Indices of wires to be removed, if EMPTY then the method
6940 # removes ALL internal wires of the given object.
6941 # @param theName Object name; when specified, this parameter is used
6942 # for result publication in the study. Otherwise, if automatic
6943 # publication is switched on, default value is used for result name.
6945 # @return New GEOM.GEOM_Object, containing processed shape.
6947 # @ref tui_suppress_internal_wires "Example"
6948 @ManageTransactions("HealOp")
6949 def SuppressInternalWires(self, theObject, theWires, theName=None):
6951 Remove internal wires and edges from the given object (face).
6954 theObject Shape to be processed.
6955 theWires Indices of wires to be removed, if EMPTY then the method
6956 removes ALL internal wires of the given object.
6957 theName Object name; when specified, this parameter is used
6958 for result publication in the study. Otherwise, if automatic
6959 publication is switched on, default value is used for result name.
6962 New GEOM.GEOM_Object, containing processed shape.
6964 # Example: see GEOM_TestHealing.py
6965 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6966 RaiseIfFailed("RemoveIntWires", self.HealOp)
6967 self._autoPublish(anObj, theName, "suppressWires")
6970 ## Remove internal closed contours (holes) from the given object.
6971 # @param theObject Shape to be processed.
6972 # @param theWires Indices of wires to be removed, if EMPTY then the method
6973 # removes ALL internal holes of the given object
6974 # @param theName Object name; when specified, this parameter is used
6975 # for result publication in the study. Otherwise, if automatic
6976 # publication is switched on, default value is used for result name.
6978 # @return New GEOM.GEOM_Object, containing processed shape.
6980 # @ref tui_suppress_holes "Example"
6981 @ManageTransactions("HealOp")
6982 def SuppressHoles(self, theObject, theWires, theName=None):
6984 Remove internal closed contours (holes) from the given object.
6987 theObject Shape to be processed.
6988 theWires Indices of wires to be removed, if EMPTY then the method
6989 removes ALL internal holes of the given object
6990 theName Object name; when specified, this parameter is used
6991 for result publication in the study. Otherwise, if automatic
6992 publication is switched on, default value is used for result name.
6995 New GEOM.GEOM_Object, containing processed shape.
6997 # Example: see GEOM_TestHealing.py
6998 anObj = self.HealOp.FillHoles(theObject, theWires)
6999 RaiseIfFailed("FillHoles", self.HealOp)
7000 self._autoPublish(anObj, theName, "suppressHoles")
7003 ## Close an open wire.
7004 # @param theObject Shape to be processed.
7005 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7006 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7007 # @param isCommonVertex If True : closure by creation of a common vertex,
7008 # If False : closure by creation of an edge between ends.
7009 # @param theName Object name; when specified, this parameter is used
7010 # for result publication in the study. Otherwise, if automatic
7011 # publication is switched on, default value is used for result name.
7013 # @return New GEOM.GEOM_Object, containing processed shape.
7015 # @ref tui_close_contour "Example"
7016 @ManageTransactions("HealOp")
7017 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7022 theObject Shape to be processed.
7023 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7024 if [ ], then theObject itself is a wire.
7025 isCommonVertex If True : closure by creation of a common vertex,
7026 If False : closure by creation of an edge between ends.
7027 theName Object name; when specified, this parameter is used
7028 for result publication in the study. Otherwise, if automatic
7029 publication is switched on, default value is used for result name.
7032 New GEOM.GEOM_Object, containing processed shape.
7034 # Example: see GEOM_TestHealing.py
7035 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7036 RaiseIfFailed("CloseContour", self.HealOp)
7037 self._autoPublish(anObj, theName, "closeContour")
7040 ## Addition of a point to a given edge object.
7041 # @param theObject Shape to be processed.
7042 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7043 # if -1, then theObject itself is the edge.
7044 # @param theValue Value of parameter on edge or length parameter,
7045 # depending on \a isByParameter.
7046 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7047 # if FALSE : \a theValue is treated as a length parameter [0..1]
7048 # @param theName Object name; when specified, this parameter is used
7049 # for result publication in the study. Otherwise, if automatic
7050 # publication is switched on, default value is used for result name.
7052 # @return New GEOM.GEOM_Object, containing processed shape.
7054 # @ref tui_add_point_on_edge "Example"
7055 @ManageTransactions("HealOp")
7056 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7058 Addition of a point to a given edge object.
7061 theObject Shape to be processed.
7062 theEdgeIndex Index of edge to be divided within theObject's shape,
7063 if -1, then theObject itself is the edge.
7064 theValue Value of parameter on edge or length parameter,
7065 depending on isByParameter.
7066 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7067 if FALSE : theValue is treated as a length parameter [0..1]
7068 theName Object name; when specified, this parameter is used
7069 for result publication in the study. Otherwise, if automatic
7070 publication is switched on, default value is used for result name.
7073 New GEOM.GEOM_Object, containing processed shape.
7075 # Example: see GEOM_TestHealing.py
7076 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7077 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7078 RaiseIfFailed("DivideEdge", self.HealOp)
7079 anObj.SetParameters(Parameters)
7080 self._autoPublish(anObj, theName, "divideEdge")
7083 ## Addition of points to a given edge of \a theObject by projecting
7084 # other points to the given edge.
7085 # @param theObject Shape to be processed.
7086 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7087 # if -1, then theObject itself is the edge.
7088 # @param thePoints List of points to project to theEdgeIndex-th edge.
7089 # @param theName Object name; when specified, this parameter is used
7090 # for result publication in the study. Otherwise, if automatic
7091 # publication is switched on, default value is used for result name.
7093 # @return New GEOM.GEOM_Object, containing processed shape.
7095 # @ref tui_add_point_on_edge "Example"
7096 @ManageTransactions("HealOp")
7097 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7099 Addition of points to a given edge of \a theObject by projecting
7100 other points to the given edge.
7103 theObject Shape to be processed.
7104 theEdgeIndex The edge or its index to be divided within theObject's shape,
7105 if -1, then theObject itself is the edge.
7106 thePoints List of points to project to theEdgeIndex-th edge.
7107 theName Object name; when specified, this parameter is used
7108 for result publication in the study. Otherwise, if automatic
7109 publication is switched on, default value is used for result name.
7112 New GEOM.GEOM_Object, containing processed shape.
7114 # Example: see GEOM_TestHealing.py
7115 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7116 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7117 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7118 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7119 self._autoPublish(anObj, theName, "divideEdge")
7122 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7123 # @param theWire Wire to minimize the number of C1 continuous edges in.
7124 # @param theVertices A list of vertices to suppress. If the list
7125 # is empty, all vertices in a wire will be assumed.
7126 # @param theName Object name; when specified, this parameter is used
7127 # for result publication in the study. Otherwise, if automatic
7128 # publication is switched on, default value is used for result name.
7130 # @return New GEOM.GEOM_Object with modified wire.
7132 # @ref tui_fuse_collinear_edges "Example"
7133 @ManageTransactions("HealOp")
7134 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7136 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7139 theWire Wire to minimize the number of C1 continuous edges in.
7140 theVertices A list of vertices to suppress. If the list
7141 is empty, all vertices in a wire will be assumed.
7142 theName Object name; when specified, this parameter is used
7143 for result publication in the study. Otherwise, if automatic
7144 publication is switched on, default value is used for result name.
7147 New GEOM.GEOM_Object with modified wire.
7149 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7150 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7151 self._autoPublish(anObj, theName, "fuseEdges")
7154 ## Change orientation of the given object. Updates given shape.
7155 # @param theObject Shape to be processed.
7156 # @return Updated <var>theObject</var>
7158 # @ref swig_todo "Example"
7159 @ManageTransactions("HealOp")
7160 def ChangeOrientationShell(self,theObject):
7162 Change orientation of the given object. Updates given shape.
7165 theObject Shape to be processed.
7170 theObject = self.HealOp.ChangeOrientation(theObject)
7171 RaiseIfFailed("ChangeOrientation", self.HealOp)
7174 ## Change orientation of the given object.
7175 # @param theObject Shape to be processed.
7176 # @param theName Object name; when specified, this parameter is used
7177 # for result publication in the study. Otherwise, if automatic
7178 # publication is switched on, default value is used for result name.
7180 # @return New GEOM.GEOM_Object, containing processed shape.
7182 # @ref swig_todo "Example"
7183 @ManageTransactions("HealOp")
7184 def ChangeOrientationShellCopy(self, theObject, theName=None):
7186 Change orientation of the given object.
7189 theObject Shape to be processed.
7190 theName Object name; when specified, this parameter is used
7191 for result publication in the study. Otherwise, if automatic
7192 publication is switched on, default value is used for result name.
7195 New GEOM.GEOM_Object, containing processed shape.
7197 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7198 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7199 self._autoPublish(anObj, theName, "reversed")
7202 ## Try to limit tolerance of the given object by value \a theTolerance.
7203 # @param theObject Shape to be processed.
7204 # @param theTolerance Required tolerance value.
7205 # @param theName Object name; when specified, this parameter is used
7206 # for result publication in the study. Otherwise, if automatic
7207 # publication is switched on, default value is used for result name.
7209 # @return New GEOM.GEOM_Object, containing processed shape.
7211 # @ref tui_limit_tolerance "Example"
7212 @ManageTransactions("HealOp")
7213 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7215 Try to limit tolerance of the given object by value theTolerance.
7218 theObject Shape to be processed.
7219 theTolerance Required tolerance value.
7220 theName Object name; when specified, this parameter is used
7221 for result publication in the study. Otherwise, if automatic
7222 publication is switched on, default value is used for result name.
7225 New GEOM.GEOM_Object, containing processed shape.
7227 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7228 RaiseIfFailed("LimitTolerance", self.HealOp)
7229 self._autoPublish(anObj, theName, "limitTolerance")
7232 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7233 # that constitute a free boundary of the given shape.
7234 # @param theObject Shape to get free boundary of.
7235 # @param theName Object name; when specified, this parameter is used
7236 # for result publication in the study. Otherwise, if automatic
7237 # publication is switched on, default value is used for result name.
7239 # @return [\a status, \a theClosedWires, \a theOpenWires]
7240 # \n \a status: FALSE, if an error(s) occured during the method execution.
7241 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7242 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7244 # @ref tui_free_boundaries_page "Example"
7245 @ManageTransactions("HealOp")
7246 def GetFreeBoundary(self, theObject, theName=None):
7248 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7249 that constitute a free boundary of the given shape.
7252 theObject Shape to get free boundary of.
7253 theName Object name; when specified, this parameter is used
7254 for result publication in the study. Otherwise, if automatic
7255 publication is switched on, default value is used for result name.
7258 [status, theClosedWires, theOpenWires]
7259 status: FALSE, if an error(s) occured during the method execution.
7260 theClosedWires: Closed wires on the free boundary of the given shape.
7261 theOpenWires: Open wires on the free boundary of the given shape.
7263 # Example: see GEOM_TestHealing.py
7264 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7265 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7266 self._autoPublish(anObj[1], theName, "closedWire")
7267 self._autoPublish(anObj[2], theName, "openWire")
7270 ## Replace coincident faces in \a theShapes by one face.
7271 # @param theShapes Initial shapes, either a list or compound of shapes.
7272 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7273 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7274 # otherwise all initial shapes.
7275 # @param theName Object name; when specified, this parameter is used
7276 # for result publication in the study. Otherwise, if automatic
7277 # publication is switched on, default value is used for result name.
7279 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7281 # @ref tui_glue_faces "Example"
7282 @ManageTransactions("ShapesOp")
7283 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7285 Replace coincident faces in theShapes by one face.
7288 theShapes Initial shapes, either a list or compound of shapes.
7289 theTolerance Maximum distance between faces, which can be considered as coincident.
7290 doKeepNonSolids If FALSE, only solids will present in the result,
7291 otherwise all initial shapes.
7292 theName Object name; when specified, this parameter is used
7293 for result publication in the study. Otherwise, if automatic
7294 publication is switched on, default value is used for result name.
7297 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7299 # Example: see GEOM_Spanner.py
7300 theTolerance,Parameters = ParseParameters(theTolerance)
7301 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7303 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
7304 anObj.SetParameters(Parameters)
7305 self._autoPublish(anObj, theName, "glueFaces")
7308 ## Find coincident faces in \a theShapes for possible gluing.
7309 # @param theShapes Initial shapes, either a list or compound of shapes.
7310 # @param theTolerance Maximum distance between faces,
7311 # which can be considered as coincident.
7312 # @param theName Object name; when specified, this parameter is used
7313 # for result publication in the study. Otherwise, if automatic
7314 # publication is switched on, default value is used for result name.
7316 # @return GEOM.ListOfGO
7318 # @ref tui_glue_faces "Example"
7319 @ManageTransactions("ShapesOp")
7320 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7322 Find coincident faces in theShapes for possible gluing.
7325 theShapes Initial shapes, either a list or compound of shapes.
7326 theTolerance Maximum distance between faces,
7327 which can be considered as coincident.
7328 theName Object name; when specified, this parameter is used
7329 for result publication in the study. Otherwise, if automatic
7330 publication is switched on, default value is used for result name.
7335 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7336 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7337 self._autoPublish(anObj, theName, "facesToGlue")
7340 ## Replace coincident faces in \a theShapes by one face
7341 # in compliance with given list of faces
7342 # @param theShapes Initial shapes, either a list or compound of shapes.
7343 # @param theTolerance Maximum distance between faces,
7344 # which can be considered as coincident.
7345 # @param theFaces List of faces for gluing.
7346 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7347 # otherwise all initial shapes.
7348 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7349 # will be glued, otherwise only the edges,
7350 # belonging to <VAR>theFaces</VAR>.
7351 # @param theName Object name; when specified, this parameter is used
7352 # for result publication in the study. Otherwise, if automatic
7353 # publication is switched on, default value is used for result name.
7355 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7357 # @ref tui_glue_faces "Example"
7358 @ManageTransactions("ShapesOp")
7359 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7360 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7362 Replace coincident faces in theShapes by one face
7363 in compliance with given list of faces
7366 theShapes theShapes Initial shapes, either a list or compound of shapes.
7367 theTolerance Maximum distance between faces,
7368 which can be considered as coincident.
7369 theFaces List of faces for gluing.
7370 doKeepNonSolids If FALSE, only solids will present in the result,
7371 otherwise all initial shapes.
7372 doGlueAllEdges If TRUE, all coincident edges of theShape
7373 will be glued, otherwise only the edges,
7374 belonging to theFaces.
7375 theName Object name; when specified, this parameter is used
7376 for result publication in the study. Otherwise, if automatic
7377 publication is switched on, default value is used for result name.
7380 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7382 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7383 doKeepNonSolids, doGlueAllEdges)
7385 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
7386 self._autoPublish(anObj, theName, "glueFaces")
7389 ## Replace coincident edges in \a theShapes by one edge.
7390 # @param theShapes Initial shapes, either a list or compound of shapes.
7391 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7392 # @param theName Object name; when specified, this parameter is used
7393 # for result publication in the study. Otherwise, if automatic
7394 # publication is switched on, default value is used for result name.
7396 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7398 # @ref tui_glue_edges "Example"
7399 @ManageTransactions("ShapesOp")
7400 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7402 Replace coincident edges in theShapes by one edge.
7405 theShapes Initial shapes, either a list or compound of shapes.
7406 theTolerance Maximum distance between edges, which can be considered as coincident.
7407 theName Object name; when specified, this parameter is used
7408 for result publication in the study. Otherwise, if automatic
7409 publication is switched on, default value is used for result name.
7412 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7414 theTolerance,Parameters = ParseParameters(theTolerance)
7415 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7417 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
7418 anObj.SetParameters(Parameters)
7419 self._autoPublish(anObj, theName, "glueEdges")
7422 ## Find coincident edges in \a theShapes for possible gluing.
7423 # @param theShapes Initial shapes, either a list or compound of shapes.
7424 # @param theTolerance Maximum distance between edges,
7425 # which can be considered as coincident.
7426 # @param theName Object name; when specified, this parameter is used
7427 # for result publication in the study. Otherwise, if automatic
7428 # publication is switched on, default value is used for result name.
7430 # @return GEOM.ListOfGO
7432 # @ref tui_glue_edges "Example"
7433 @ManageTransactions("ShapesOp")
7434 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7436 Find coincident edges in theShapes for possible gluing.
7439 theShapes Initial shapes, either a list or compound of shapes.
7440 theTolerance Maximum distance between edges,
7441 which can be considered as coincident.
7442 theName Object name; when specified, this parameter is used
7443 for result publication in the study. Otherwise, if automatic
7444 publication is switched on, default value is used for result name.
7449 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7450 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7451 self._autoPublish(anObj, theName, "edgesToGlue")
7454 ## Replace coincident edges in theShapes by one edge
7455 # in compliance with given list of edges.
7456 # @param theShapes Initial shapes, either a list or compound of shapes.
7457 # @param theTolerance Maximum distance between edges,
7458 # which can be considered as coincident.
7459 # @param theEdges List of edges for gluing.
7460 # @param theName Object name; when specified, this parameter is used
7461 # for result publication in the study. Otherwise, if automatic
7462 # publication is switched on, default value is used for result name.
7464 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7466 # @ref tui_glue_edges "Example"
7467 @ManageTransactions("ShapesOp")
7468 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7470 Replace coincident edges in theShapes by one edge
7471 in compliance with given list of edges.
7474 theShapes Initial shapes, either a list or compound of shapes.
7475 theTolerance Maximum distance between edges,
7476 which can be considered as coincident.
7477 theEdges List of edges for gluing.
7478 theName Object name; when specified, this parameter is used
7479 for result publication in the study. Otherwise, if automatic
7480 publication is switched on, default value is used for result name.
7483 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7485 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7487 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
7488 self._autoPublish(anObj, theName, "glueEdges")
7494 ## @addtogroup l3_boolean Boolean Operations
7497 # -----------------------------------------------------------------------------
7498 # Boolean (Common, Cut, Fuse, Section)
7499 # -----------------------------------------------------------------------------
7501 ## Perform one of boolean operations on two given shapes.
7502 # @param theShape1 First argument for boolean operation.
7503 # @param theShape2 Second argument for boolean operation.
7504 # @param theOperation Indicates the operation to be done:\n
7505 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7506 # @param checkSelfInte The flag that tells if the arguments should
7507 # be checked for self-intersection prior to the operation.
7508 # @param theName Object name; when specified, this parameter is used
7509 # for result publication in the study. Otherwise, if automatic
7510 # publication is switched on, default value is used for result name.
7512 # @note This algorithm doesn't find all types of self-intersections.
7513 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7514 # vertex/face and edge/face intersections. Face/face
7515 # intersections detection is switched off as it is a
7516 # time-consuming operation that gives an impact on performance.
7517 # To find all self-intersections please use
7518 # CheckSelfIntersections() method.
7520 # @return New GEOM.GEOM_Object, containing the result shape.
7522 # @ref tui_fuse "Example"
7523 @ManageTransactions("BoolOp")
7524 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7526 Perform one of boolean operations on two given shapes.
7529 theShape1 First argument for boolean operation.
7530 theShape2 Second argument for boolean operation.
7531 theOperation Indicates the operation to be done:
7532 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7533 checkSelfInte The flag that tells if the arguments should
7534 be checked for self-intersection prior to
7536 theName Object name; when specified, this parameter is used
7537 for result publication in the study. Otherwise, if automatic
7538 publication is switched on, default value is used for result name.
7541 This algorithm doesn't find all types of self-intersections.
7542 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7543 vertex/face and edge/face intersections. Face/face
7544 intersections detection is switched off as it is a
7545 time-consuming operation that gives an impact on performance.
7546 To find all self-intersections please use
7547 CheckSelfIntersections() method.
7550 New GEOM.GEOM_Object, containing the result shape.
7552 # Example: see GEOM_TestAll.py
7553 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7554 RaiseIfFailed("MakeBoolean", self.BoolOp)
7555 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7556 self._autoPublish(anObj, theName, def_names[theOperation])
7559 ## Perform Common boolean operation on two given shapes.
7560 # @param theShape1 First argument for boolean operation.
7561 # @param theShape2 Second argument for boolean operation.
7562 # @param checkSelfInte The flag that tells if the arguments should
7563 # be checked for self-intersection prior to the operation.
7564 # @param theName Object name; when specified, this parameter is used
7565 # for result publication in the study. Otherwise, if automatic
7566 # publication is switched on, default value is used for result name.
7568 # @note This algorithm doesn't find all types of self-intersections.
7569 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7570 # vertex/face and edge/face intersections. Face/face
7571 # intersections detection is switched off as it is a
7572 # time-consuming operation that gives an impact on performance.
7573 # To find all self-intersections please use
7574 # CheckSelfIntersections() method.
7576 # @return New GEOM.GEOM_Object, containing the result shape.
7578 # @ref tui_common "Example 1"
7579 # \n @ref swig_MakeCommon "Example 2"
7580 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7582 Perform Common boolean operation on two given shapes.
7585 theShape1 First argument for boolean operation.
7586 theShape2 Second argument for boolean operation.
7587 checkSelfInte The flag that tells if the arguments should
7588 be checked for self-intersection prior to
7590 theName Object name; when specified, this parameter is used
7591 for result publication in the study. Otherwise, if automatic
7592 publication is switched on, default value is used for result name.
7595 This algorithm doesn't find all types of self-intersections.
7596 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7597 vertex/face and edge/face intersections. Face/face
7598 intersections detection is switched off as it is a
7599 time-consuming operation that gives an impact on performance.
7600 To find all self-intersections please use
7601 CheckSelfIntersections() method.
7604 New GEOM.GEOM_Object, containing the result shape.
7606 # Example: see GEOM_TestOthers.py
7607 # note: auto-publishing is done in self.MakeBoolean()
7608 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7610 ## Perform Cut boolean operation on two given shapes.
7611 # @param theShape1 First argument for boolean operation.
7612 # @param theShape2 Second argument for boolean operation.
7613 # @param checkSelfInte The flag that tells if the arguments should
7614 # be checked for self-intersection prior to the operation.
7615 # @param theName Object name; when specified, this parameter is used
7616 # for result publication in the study. Otherwise, if automatic
7617 # publication is switched on, default value is used for result name.
7619 # @note This algorithm doesn't find all types of self-intersections.
7620 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7621 # vertex/face and edge/face intersections. Face/face
7622 # intersections detection is switched off as it is a
7623 # time-consuming operation that gives an impact on performance.
7624 # To find all self-intersections please use
7625 # CheckSelfIntersections() method.
7627 # @return New GEOM.GEOM_Object, containing the result shape.
7629 # @ref tui_cut "Example 1"
7630 # \n @ref swig_MakeCommon "Example 2"
7631 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7633 Perform Cut boolean operation on two given shapes.
7636 theShape1 First argument for boolean operation.
7637 theShape2 Second argument for boolean operation.
7638 checkSelfInte The flag that tells if the arguments should
7639 be checked for self-intersection prior to
7641 theName Object name; when specified, this parameter is used
7642 for result publication in the study. Otherwise, if automatic
7643 publication is switched on, default value is used for result name.
7646 This algorithm doesn't find all types of self-intersections.
7647 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7648 vertex/face and edge/face intersections. Face/face
7649 intersections detection is switched off as it is a
7650 time-consuming operation that gives an impact on performance.
7651 To find all self-intersections please use
7652 CheckSelfIntersections() method.
7655 New GEOM.GEOM_Object, containing the result shape.
7658 # Example: see GEOM_TestOthers.py
7659 # note: auto-publishing is done in self.MakeBoolean()
7660 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7662 ## Perform Fuse boolean operation on two given shapes.
7663 # @param theShape1 First argument for boolean operation.
7664 # @param theShape2 Second argument for boolean operation.
7665 # @param checkSelfInte The flag that tells if the arguments should
7666 # be checked for self-intersection prior to the operation.
7667 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7668 # operation should be performed during the operation.
7669 # @param theName Object name; when specified, this parameter is used
7670 # for result publication in the study. Otherwise, if automatic
7671 # publication is switched on, default value is used for result name.
7673 # @note This algorithm doesn't find all types of self-intersections.
7674 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7675 # vertex/face and edge/face intersections. Face/face
7676 # intersections detection is switched off as it is a
7677 # time-consuming operation that gives an impact on performance.
7678 # To find all self-intersections please use
7679 # CheckSelfIntersections() method.
7681 # @return New GEOM.GEOM_Object, containing the result shape.
7683 # @ref tui_fuse "Example 1"
7684 # \n @ref swig_MakeCommon "Example 2"
7685 @ManageTransactions("BoolOp")
7686 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7687 rmExtraEdges=False, theName=None):
7689 Perform Fuse boolean operation on two given shapes.
7692 theShape1 First argument for boolean operation.
7693 theShape2 Second argument for boolean operation.
7694 checkSelfInte The flag that tells if the arguments should
7695 be checked for self-intersection prior to
7697 rmExtraEdges The flag that tells if Remove Extra Edges
7698 operation should be performed during the operation.
7699 theName Object name; when specified, this parameter is used
7700 for result publication in the study. Otherwise, if automatic
7701 publication is switched on, default value is used for result name.
7704 This algorithm doesn't find all types of self-intersections.
7705 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7706 vertex/face and edge/face intersections. Face/face
7707 intersections detection is switched off as it is a
7708 time-consuming operation that gives an impact on performance.
7709 To find all self-intersections please use
7710 CheckSelfIntersections() method.
7713 New GEOM.GEOM_Object, containing the result shape.
7716 # Example: see GEOM_TestOthers.py
7717 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7718 checkSelfInte, rmExtraEdges)
7719 RaiseIfFailed("MakeFuse", self.BoolOp)
7720 self._autoPublish(anObj, theName, "fuse")
7723 ## Perform Section boolean operation on two given shapes.
7724 # @param theShape1 First argument for boolean operation.
7725 # @param theShape2 Second argument for boolean operation.
7726 # @param checkSelfInte The flag that tells if the arguments should
7727 # be checked for self-intersection prior to the operation.
7728 # If a self-intersection detected the operation fails.
7729 # @param theName Object name; when specified, this parameter is used
7730 # for result publication in the study. Otherwise, if automatic
7731 # publication is switched on, default value is used for result name.
7732 # @return New GEOM.GEOM_Object, containing the result shape.
7734 # @ref tui_section "Example 1"
7735 # \n @ref swig_MakeCommon "Example 2"
7736 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7738 Perform Section boolean operation on two given shapes.
7741 theShape1 First argument for boolean operation.
7742 theShape2 Second argument for boolean operation.
7743 checkSelfInte The flag that tells if the arguments should
7744 be checked for self-intersection prior to the operation.
7745 If a self-intersection detected the operation fails.
7746 theName Object name; when specified, this parameter is used
7747 for result publication in the study. Otherwise, if automatic
7748 publication is switched on, default value is used for result name.
7750 New GEOM.GEOM_Object, containing the result shape.
7753 # Example: see GEOM_TestOthers.py
7754 # note: auto-publishing is done in self.MakeBoolean()
7755 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7757 ## Perform Fuse boolean operation on the list of shapes.
7758 # @param theShapesList Shapes to be fused.
7759 # @param checkSelfInte The flag that tells if the arguments should
7760 # be checked for self-intersection prior to the operation.
7761 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7762 # operation should be performed during the operation.
7763 # @param theName Object name; when specified, this parameter is used
7764 # for result publication in the study. Otherwise, if automatic
7765 # publication is switched on, default value is used for result name.
7767 # @note This algorithm doesn't find all types of self-intersections.
7768 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7769 # vertex/face and edge/face intersections. Face/face
7770 # intersections detection is switched off as it is a
7771 # time-consuming operation that gives an impact on performance.
7772 # To find all self-intersections please use
7773 # CheckSelfIntersections() method.
7775 # @return New GEOM.GEOM_Object, containing the result shape.
7777 # @ref tui_fuse "Example 1"
7778 # \n @ref swig_MakeCommon "Example 2"
7779 @ManageTransactions("BoolOp")
7780 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7781 rmExtraEdges=False, theName=None):
7783 Perform Fuse boolean operation on the list of shapes.
7786 theShapesList Shapes to be fused.
7787 checkSelfInte The flag that tells if the arguments should
7788 be checked for self-intersection prior to
7790 rmExtraEdges The flag that tells if Remove Extra Edges
7791 operation should be performed during the operation.
7792 theName Object name; when specified, this parameter is used
7793 for result publication in the study. Otherwise, if automatic
7794 publication is switched on, default value is used for result name.
7797 This algorithm doesn't find all types of self-intersections.
7798 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7799 vertex/face and edge/face intersections. Face/face
7800 intersections detection is switched off as it is a
7801 time-consuming operation that gives an impact on performance.
7802 To find all self-intersections please use
7803 CheckSelfIntersections() method.
7806 New GEOM.GEOM_Object, containing the result shape.
7809 # Example: see GEOM_TestOthers.py
7810 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7812 RaiseIfFailed("MakeFuseList", self.BoolOp)
7813 self._autoPublish(anObj, theName, "fuse")
7816 ## Perform Common boolean operation on the list of shapes.
7817 # @param theShapesList Shapes for Common operation.
7818 # @param checkSelfInte The flag that tells if the arguments should
7819 # be checked for self-intersection prior to the operation.
7820 # @param theName Object name; when specified, this parameter is used
7821 # for result publication in the study. Otherwise, if automatic
7822 # publication is switched on, default value is used for result name.
7824 # @note This algorithm doesn't find all types of self-intersections.
7825 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7826 # vertex/face and edge/face intersections. Face/face
7827 # intersections detection is switched off as it is a
7828 # time-consuming operation that gives an impact on performance.
7829 # To find all self-intersections please use
7830 # CheckSelfIntersections() method.
7832 # @return New GEOM.GEOM_Object, containing the result shape.
7834 # @ref tui_common "Example 1"
7835 # \n @ref swig_MakeCommon "Example 2"
7836 @ManageTransactions("BoolOp")
7837 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7839 Perform Common boolean operation on the list of shapes.
7842 theShapesList Shapes for Common operation.
7843 checkSelfInte The flag that tells if the arguments should
7844 be checked for self-intersection prior to
7846 theName Object name; when specified, this parameter is used
7847 for result publication in the study. Otherwise, if automatic
7848 publication is switched on, default value is used for result name.
7851 This algorithm doesn't find all types of self-intersections.
7852 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7853 vertex/face and edge/face intersections. Face/face
7854 intersections detection is switched off as it is a
7855 time-consuming operation that gives an impact on performance.
7856 To find all self-intersections please use
7857 CheckSelfIntersections() method.
7860 New GEOM.GEOM_Object, containing the result shape.
7863 # Example: see GEOM_TestOthers.py
7864 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7865 RaiseIfFailed("MakeCommonList", self.BoolOp)
7866 self._autoPublish(anObj, theName, "common")
7869 ## Perform Cut boolean operation on one object and the list of tools.
7870 # @param theMainShape The object of the operation.
7871 # @param theShapesList The list of tools of the operation.
7872 # @param checkSelfInte The flag that tells if the arguments should
7873 # be checked for self-intersection prior to the operation.
7874 # @param theName Object name; when specified, this parameter is used
7875 # for result publication in the study. Otherwise, if automatic
7876 # publication is switched on, default value is used for result name.
7878 # @note This algorithm doesn't find all types of self-intersections.
7879 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7880 # vertex/face and edge/face intersections. Face/face
7881 # intersections detection is switched off as it is a
7882 # time-consuming operation that gives an impact on performance.
7883 # To find all self-intersections please use
7884 # CheckSelfIntersections() method.
7886 # @return New GEOM.GEOM_Object, containing the result shape.
7888 # @ref tui_cut "Example 1"
7889 # \n @ref swig_MakeCommon "Example 2"
7890 @ManageTransactions("BoolOp")
7891 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7893 Perform Cut boolean operation on one object and the list of tools.
7896 theMainShape The object of the operation.
7897 theShapesList The list of tools of the operation.
7898 checkSelfInte The flag that tells if the arguments should
7899 be checked for self-intersection prior to
7901 theName Object name; when specified, this parameter is used
7902 for result publication in the study. Otherwise, if automatic
7903 publication is switched on, default value is used for result name.
7906 This algorithm doesn't find all types of self-intersections.
7907 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7908 vertex/face and edge/face intersections. Face/face
7909 intersections detection is switched off as it is a
7910 time-consuming operation that gives an impact on performance.
7911 To find all self-intersections please use
7912 CheckSelfIntersections() method.
7915 New GEOM.GEOM_Object, containing the result shape.
7918 # Example: see GEOM_TestOthers.py
7919 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7920 RaiseIfFailed("MakeCutList", self.BoolOp)
7921 self._autoPublish(anObj, theName, "cut")
7927 ## @addtogroup l3_basic_op
7930 ## Perform partition operation.
7931 # @param ListShapes Shapes to be intersected.
7932 # @param ListTools Shapes to intersect theShapes.
7933 # @param Limit Type of resulting shapes (see ShapeType()).\n
7934 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7935 # type will be detected automatically.
7936 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7937 # target type (equal to Limit) are kept in the result,
7938 # else standalone shapes of lower dimension
7939 # are kept also (if they exist).
7941 # @param theName Object name; when specified, this parameter is used
7942 # for result publication in the study. Otherwise, if automatic
7943 # publication is switched on, default value is used for result name.
7945 # @note Each compound from ListShapes and ListTools will be exploded
7946 # in order to avoid possible intersection between shapes from this compound.
7948 # After implementation new version of PartitionAlgo (October 2006)
7949 # other parameters are ignored by current functionality. They are kept
7950 # in this function only for support old versions.
7951 # @param ListKeepInside Shapes, outside which the results will be deleted.
7952 # Each shape from theKeepInside must belong to theShapes also.
7953 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7954 # Each shape from theRemoveInside must belong to theShapes also.
7955 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7956 # @param ListMaterials Material indices for each shape. Make sence,
7957 # only if theRemoveWebs is TRUE.
7959 # @return New GEOM.GEOM_Object, containing the result shapes.
7961 # @ref tui_partition "Example"
7962 @ManageTransactions("BoolOp")
7963 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7964 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7965 KeepNonlimitShapes=0, theName=None):
7967 Perform partition operation.
7970 ListShapes Shapes to be intersected.
7971 ListTools Shapes to intersect theShapes.
7972 Limit Type of resulting shapes (see geompy.ShapeType)
7973 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7974 type will be detected automatically.
7975 KeepNonlimitShapes if this parameter == 0, then only shapes of
7976 target type (equal to Limit) are kept in the result,
7977 else standalone shapes of lower dimension
7978 are kept also (if they exist).
7980 theName Object name; when specified, this parameter is used
7981 for result publication in the study. Otherwise, if automatic
7982 publication is switched on, default value is used for result name.
7984 Each compound from ListShapes and ListTools will be exploded
7985 in order to avoid possible intersection between shapes from
7988 After implementation new version of PartitionAlgo (October 2006) other
7989 parameters are ignored by current functionality. They are kept in this
7990 function only for support old versions.
7993 ListKeepInside Shapes, outside which the results will be deleted.
7994 Each shape from theKeepInside must belong to theShapes also.
7995 ListRemoveInside Shapes, inside which the results will be deleted.
7996 Each shape from theRemoveInside must belong to theShapes also.
7997 RemoveWebs If TRUE, perform Glue 3D algorithm.
7998 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
8001 New GEOM.GEOM_Object, containing the result shapes.
8003 # Example: see GEOM_TestAll.py
8004 if Limit == self.ShapeType["AUTO"]:
8005 # automatic detection of the most appropriate shape limit type
8007 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
8008 Limit = EnumToLong(lim)
8010 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8011 ListKeepInside, ListRemoveInside,
8012 Limit, RemoveWebs, ListMaterials,
8013 KeepNonlimitShapes);
8014 RaiseIfFailed("MakePartition", self.BoolOp)
8015 self._autoPublish(anObj, theName, "partition")
8018 ## Perform partition operation.
8019 # This method may be useful if it is needed to make a partition for
8020 # compound contains nonintersected shapes. Performance will be better
8021 # since intersection between shapes from compound is not performed.
8023 # Description of all parameters as in previous method MakePartition().
8024 # One additional parameter is provided:
8025 # @param checkSelfInte The flag that tells if the arguments should
8026 # be checked for self-intersection prior to the operation.
8028 # @note This algorithm doesn't find all types of self-intersections.
8029 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8030 # vertex/face and edge/face intersections. Face/face
8031 # intersections detection is switched off as it is a
8032 # time-consuming operation that gives an impact on performance.
8033 # To find all self-intersections please use
8034 # CheckSelfIntersections() method.
8036 # @note Passed compounds (via ListShapes or via ListTools)
8037 # have to consist of nonintersecting shapes.
8039 # @return New GEOM.GEOM_Object, containing the result shapes.
8041 # @ref swig_todo "Example"
8042 @ManageTransactions("BoolOp")
8043 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8044 ListKeepInside=[], ListRemoveInside=[],
8045 Limit=ShapeType["AUTO"], RemoveWebs=0,
8046 ListMaterials=[], KeepNonlimitShapes=0,
8047 checkSelfInte=False, theName=None):
8049 Perform partition operation.
8050 This method may be useful if it is needed to make a partition for
8051 compound contains nonintersected shapes. Performance will be better
8052 since intersection between shapes from compound is not performed.
8055 Description of all parameters as in method geompy.MakePartition.
8056 One additional parameter is provided:
8057 checkSelfInte The flag that tells if the arguments should
8058 be checked for self-intersection prior to
8062 This algorithm doesn't find all types of self-intersections.
8063 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8064 vertex/face and edge/face intersections. Face/face
8065 intersections detection is switched off as it is a
8066 time-consuming operation that gives an impact on performance.
8067 To find all self-intersections please use
8068 CheckSelfIntersections() method.
8071 Passed compounds (via ListShapes or via ListTools)
8072 have to consist of nonintersecting shapes.
8075 New GEOM.GEOM_Object, containing the result shapes.
8077 if Limit == self.ShapeType["AUTO"]:
8078 # automatic detection of the most appropriate shape limit type
8080 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
8081 Limit = EnumToLong(lim)
8083 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8084 ListKeepInside, ListRemoveInside,
8085 Limit, RemoveWebs, ListMaterials,
8086 KeepNonlimitShapes, checkSelfInte);
8087 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8088 self._autoPublish(anObj, theName, "partition")
8091 ## See method MakePartition() for more information.
8093 # @ref tui_partition "Example 1"
8094 # \n @ref swig_Partition "Example 2"
8095 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8096 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8097 KeepNonlimitShapes=0, theName=None):
8099 See method geompy.MakePartition for more information.
8101 # Example: see GEOM_TestOthers.py
8102 # note: auto-publishing is done in self.MakePartition()
8103 anObj = self.MakePartition(ListShapes, ListTools,
8104 ListKeepInside, ListRemoveInside,
8105 Limit, RemoveWebs, ListMaterials,
8106 KeepNonlimitShapes, theName);
8109 ## Perform partition of the Shape with the Plane
8110 # @param theShape Shape to be intersected.
8111 # @param thePlane Tool shape, to intersect theShape.
8112 # @param theName Object name; when specified, this parameter is used
8113 # for result publication in the study. Otherwise, if automatic
8114 # publication is switched on, default value is used for result name.
8116 # @return New GEOM.GEOM_Object, containing the result shape.
8118 # @note This operation is a shortcut to the more general @ref MakePartition
8119 # operation, where @a theShape specifies single "object" (shape being partitioned)
8120 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8121 # @ref MakePartition operation have default values:
8122 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8123 # - @a KeepNonlimitShapes: 0
8124 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8125 # @a Materials (obsolete parameters): empty
8127 # @note I.e. the following two operations are equivalent:
8129 # Result = geompy.MakeHalfPartition(Object, Plane)
8130 # Result = geompy.MakePartition([Object], [Plane])
8133 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8135 # @ref tui_partition "Example"
8136 @ManageTransactions("BoolOp")
8137 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8139 Perform partition of the Shape with the Plane
8142 theShape Shape to be intersected.
8143 thePlane Tool shape, to intersect theShape.
8144 theName Object name; when specified, this parameter is used
8145 for result publication in the study. Otherwise, if automatic
8146 publication is switched on, default value is used for result name.
8149 New GEOM.GEOM_Object, containing the result shape.
8151 Note: This operation is a shortcut to the more general MakePartition
8152 operation, where theShape specifies single "object" (shape being partitioned)
8153 and thePlane specifies single "tool" (intersector shape). Other parameters of
8154 MakePartition operation have default values:
8155 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8156 - KeepNonlimitShapes: 0
8157 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8159 I.e. the following two operations are equivalent:
8160 Result = geompy.MakeHalfPartition(Object, Plane)
8161 Result = geompy.MakePartition([Object], [Plane])
8163 # Example: see GEOM_TestAll.py
8164 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8165 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8166 self._autoPublish(anObj, theName, "partition")
8169 # end of l3_basic_op
8172 ## @addtogroup l3_transform
8175 ## Translate the given object along the vector, specified
8176 # by its end points.
8177 # @param theObject The object to be translated.
8178 # @param thePoint1 Start point of translation vector.
8179 # @param thePoint2 End point of translation vector.
8180 # @param theCopy Flag used to translate object itself or create a copy.
8181 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8182 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8183 @ManageTransactions("TrsfOp")
8184 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8186 Translate the given object along the vector, specified by its end points.
8189 theObject The object to be translated.
8190 thePoint1 Start point of translation vector.
8191 thePoint2 End point of translation vector.
8192 theCopy Flag used to translate object itself or create a copy.
8195 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8196 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8199 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8201 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8202 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8205 ## Translate the given object along the vector, specified
8206 # by its end points, creating its copy before the translation.
8207 # @param theObject The object to be translated.
8208 # @param thePoint1 Start point of translation vector.
8209 # @param thePoint2 End point of translation vector.
8210 # @param theName Object name; when specified, this parameter is used
8211 # for result publication in the study. Otherwise, if automatic
8212 # publication is switched on, default value is used for result name.
8214 # @return New GEOM.GEOM_Object, containing the translated object.
8216 # @ref tui_translation "Example 1"
8217 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8218 @ManageTransactions("TrsfOp")
8219 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8221 Translate the given object along the vector, specified
8222 by its end points, creating its copy before the translation.
8225 theObject The object to be translated.
8226 thePoint1 Start point of translation vector.
8227 thePoint2 End point of translation vector.
8228 theName Object name; when specified, this parameter is used
8229 for result publication in the study. Otherwise, if automatic
8230 publication is switched on, default value is used for result name.
8233 New GEOM.GEOM_Object, containing the translated object.
8235 # Example: see GEOM_TestAll.py
8236 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8237 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8238 self._autoPublish(anObj, theName, "translated")
8241 ## Translate the given object along the vector, specified by its components.
8242 # @param theObject The object to be translated.
8243 # @param theDX,theDY,theDZ Components of translation vector.
8244 # @param theCopy Flag used to translate object itself or create a copy.
8245 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8246 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8248 # @ref tui_translation "Example"
8249 @ManageTransactions("TrsfOp")
8250 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8252 Translate the given object along the vector, specified by its components.
8255 theObject The object to be translated.
8256 theDX,theDY,theDZ Components of translation vector.
8257 theCopy Flag used to translate object itself or create a copy.
8260 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8261 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8263 # Example: see GEOM_TestAll.py
8264 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8266 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8268 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8269 anObj.SetParameters(Parameters)
8270 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8273 ## Translate the given object along the vector, specified
8274 # by its components, creating its copy before the translation.
8275 # @param theObject The object to be translated.
8276 # @param theDX,theDY,theDZ Components of translation vector.
8277 # @param theName Object name; when specified, this parameter is used
8278 # for result publication in the study. Otherwise, if automatic
8279 # publication is switched on, default value is used for result name.
8281 # @return New GEOM.GEOM_Object, containing the translated object.
8283 # @ref tui_translation "Example"
8284 @ManageTransactions("TrsfOp")
8285 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8287 Translate the given object along the vector, specified
8288 by its components, creating its copy before the translation.
8291 theObject The object to be translated.
8292 theDX,theDY,theDZ Components of translation vector.
8293 theName Object name; when specified, this parameter is used
8294 for result publication in the study. Otherwise, if automatic
8295 publication is switched on, default value is used for result name.
8298 New GEOM.GEOM_Object, containing the translated object.
8300 # Example: see GEOM_TestAll.py
8301 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8302 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8303 anObj.SetParameters(Parameters)
8304 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8305 self._autoPublish(anObj, theName, "translated")
8308 ## Translate the given object along the given vector.
8309 # @param theObject The object to be translated.
8310 # @param theVector The translation vector.
8311 # @param theCopy Flag used to translate object itself or create a copy.
8312 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8313 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8314 @ManageTransactions("TrsfOp")
8315 def TranslateVector(self, theObject, theVector, theCopy=False):
8317 Translate the given object along the given vector.
8320 theObject The object to be translated.
8321 theVector The translation vector.
8322 theCopy Flag used to translate object itself or create a copy.
8325 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8326 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8329 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8331 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8332 RaiseIfFailed("TranslateVector", self.TrsfOp)
8335 ## Translate the given object along the given vector,
8336 # creating its copy before the translation.
8337 # @param theObject The object to be translated.
8338 # @param theVector The translation vector.
8339 # @param theName Object name; when specified, this parameter is used
8340 # for result publication in the study. Otherwise, if automatic
8341 # publication is switched on, default value is used for result name.
8343 # @return New GEOM.GEOM_Object, containing the translated object.
8345 # @ref tui_translation "Example"
8346 @ManageTransactions("TrsfOp")
8347 def MakeTranslationVector(self, theObject, theVector, theName=None):
8349 Translate the given object along the given vector,
8350 creating its copy before the translation.
8353 theObject The object to be translated.
8354 theVector The translation vector.
8355 theName Object name; when specified, this parameter is used
8356 for result publication in the study. Otherwise, if automatic
8357 publication is switched on, default value is used for result name.
8360 New GEOM.GEOM_Object, containing the translated object.
8362 # Example: see GEOM_TestAll.py
8363 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8364 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8365 self._autoPublish(anObj, theName, "translated")
8368 ## Translate the given object along the given vector on given distance.
8369 # @param theObject The object to be translated.
8370 # @param theVector The translation vector.
8371 # @param theDistance The translation distance.
8372 # @param theCopy Flag used to translate object itself or create a copy.
8373 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8374 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8376 # @ref tui_translation "Example"
8377 @ManageTransactions("TrsfOp")
8378 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8380 Translate the given object along the given vector on given distance.
8383 theObject The object to be translated.
8384 theVector The translation vector.
8385 theDistance The translation distance.
8386 theCopy Flag used to translate object itself or create a copy.
8389 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8390 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8392 # Example: see GEOM_TestAll.py
8393 theDistance,Parameters = ParseParameters(theDistance)
8394 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8395 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8396 anObj.SetParameters(Parameters)
8399 ## Translate the given object along the given vector on given distance,
8400 # creating its copy before the translation.
8401 # @param theObject The object to be translated.
8402 # @param theVector The translation vector.
8403 # @param theDistance The translation distance.
8404 # @param theName Object name; when specified, this parameter is used
8405 # for result publication in the study. Otherwise, if automatic
8406 # publication is switched on, default value is used for result name.
8408 # @return New GEOM.GEOM_Object, containing the translated object.
8410 # @ref tui_translation "Example"
8411 @ManageTransactions("TrsfOp")
8412 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8414 Translate the given object along the given vector on given distance,
8415 creating its copy before the translation.
8418 theObject The object to be translated.
8419 theVector The translation vector.
8420 theDistance The translation distance.
8421 theName Object name; when specified, this parameter is used
8422 for result publication in the study. Otherwise, if automatic
8423 publication is switched on, default value is used for result name.
8426 New GEOM.GEOM_Object, containing the translated object.
8428 # Example: see GEOM_TestAll.py
8429 theDistance,Parameters = ParseParameters(theDistance)
8430 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8431 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8432 anObj.SetParameters(Parameters)
8433 self._autoPublish(anObj, theName, "translated")
8436 ## Rotate the given object around the given axis on the given angle.
8437 # @param theObject The object to be rotated.
8438 # @param theAxis Rotation axis.
8439 # @param theAngle Rotation angle in radians.
8440 # @param theCopy Flag used to rotate object itself or create a copy.
8442 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8443 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8445 # @ref tui_rotation "Example"
8446 @ManageTransactions("TrsfOp")
8447 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8449 Rotate the given object around the given axis on the given angle.
8452 theObject The object to be rotated.
8453 theAxis Rotation axis.
8454 theAngle Rotation angle in radians.
8455 theCopy Flag used to rotate object itself or create a copy.
8458 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8459 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8461 # Example: see GEOM_TestAll.py
8463 if isinstance(theAngle,str):
8465 theAngle, Parameters = ParseParameters(theAngle)
8467 theAngle = theAngle*math.pi/180.0
8469 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8471 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8472 RaiseIfFailed("Rotate", self.TrsfOp)
8473 anObj.SetParameters(Parameters)
8476 ## Rotate the given object around the given axis
8477 # on the given angle, creating its copy before the rotation.
8478 # @param theObject The object to be rotated.
8479 # @param theAxis Rotation axis.
8480 # @param theAngle Rotation angle in radians.
8481 # @param theName Object name; when specified, this parameter is used
8482 # for result publication in the study. Otherwise, if automatic
8483 # publication is switched on, default value is used for result name.
8485 # @return New GEOM.GEOM_Object, containing the rotated object.
8487 # @ref tui_rotation "Example"
8488 @ManageTransactions("TrsfOp")
8489 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8491 Rotate the given object around the given axis
8492 on the given angle, creating its copy before the rotatation.
8495 theObject The object to be rotated.
8496 theAxis Rotation axis.
8497 theAngle Rotation angle in radians.
8498 theName Object name; when specified, this parameter is used
8499 for result publication in the study. Otherwise, if automatic
8500 publication is switched on, default value is used for result name.
8503 New GEOM.GEOM_Object, containing the rotated object.
8505 # Example: see GEOM_TestAll.py
8507 if isinstance(theAngle,str):
8509 theAngle, Parameters = ParseParameters(theAngle)
8511 theAngle = theAngle*math.pi/180.0
8512 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8513 RaiseIfFailed("RotateCopy", self.TrsfOp)
8514 anObj.SetParameters(Parameters)
8515 self._autoPublish(anObj, theName, "rotated")
8518 ## Rotate given object around vector perpendicular to plane
8519 # containing three points.
8520 # @param theObject The object to be rotated.
8521 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8522 # containing the three points.
8523 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8524 # @param theCopy Flag used to rotate object itself or create a copy.
8525 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8526 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8527 @ManageTransactions("TrsfOp")
8528 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8530 Rotate given object around vector perpendicular to plane
8531 containing three points.
8534 theObject The object to be rotated.
8535 theCentPoint central point the axis is the vector perpendicular to the plane
8536 containing the three points.
8537 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8538 theCopy Flag used to rotate object itself or create a copy.
8541 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8542 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8545 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8547 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8548 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8551 ## Rotate given object around vector perpendicular to plane
8552 # containing three points, creating its copy before the rotatation.
8553 # @param theObject The object to be rotated.
8554 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8555 # containing the three points.
8556 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8557 # @param theName Object name; when specified, this parameter is used
8558 # for result publication in the study. Otherwise, if automatic
8559 # publication is switched on, default value is used for result name.
8561 # @return New GEOM.GEOM_Object, containing the rotated object.
8563 # @ref tui_rotation "Example"
8564 @ManageTransactions("TrsfOp")
8565 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8567 Rotate given object around vector perpendicular to plane
8568 containing three points, creating its copy before the rotatation.
8571 theObject The object to be rotated.
8572 theCentPoint central point the axis is the vector perpendicular to the plane
8573 containing the three points.
8574 thePoint1,thePoint2 in a perpendicular plane of the axis.
8575 theName Object name; when specified, this parameter is used
8576 for result publication in the study. Otherwise, if automatic
8577 publication is switched on, default value is used for result name.
8580 New GEOM.GEOM_Object, containing the rotated object.
8582 # Example: see GEOM_TestAll.py
8583 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8584 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8585 self._autoPublish(anObj, theName, "rotated")
8588 ## Scale the given object by the specified factor.
8589 # @param theObject The object to be scaled.
8590 # @param thePoint Center point for scaling.
8591 # Passing None for it means scaling relatively the origin of global CS.
8592 # @param theFactor Scaling factor value.
8593 # @param theCopy Flag used to scale object itself or create a copy.
8594 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8595 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8596 @ManageTransactions("TrsfOp")
8597 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8599 Scale the given object by the specified factor.
8602 theObject The object to be scaled.
8603 thePoint Center point for scaling.
8604 Passing None for it means scaling relatively the origin of global CS.
8605 theFactor Scaling factor value.
8606 theCopy Flag used to scale object itself or create a copy.
8609 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8610 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8612 # Example: see GEOM_TestAll.py
8613 theFactor, Parameters = ParseParameters(theFactor)
8615 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8617 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8618 RaiseIfFailed("Scale", self.TrsfOp)
8619 anObj.SetParameters(Parameters)
8622 ## Scale the given object by the factor, creating its copy before the scaling.
8623 # @param theObject The object to be scaled.
8624 # @param thePoint Center point for scaling.
8625 # Passing None for it means scaling relatively the origin of global CS.
8626 # @param theFactor Scaling factor value.
8627 # @param theName Object name; when specified, this parameter is used
8628 # for result publication in the study. Otherwise, if automatic
8629 # publication is switched on, default value is used for result name.
8631 # @return New GEOM.GEOM_Object, containing the scaled shape.
8633 # @ref tui_scale "Example"
8634 @ManageTransactions("TrsfOp")
8635 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8637 Scale the given object by the factor, creating its copy before the scaling.
8640 theObject The object to be scaled.
8641 thePoint Center point for scaling.
8642 Passing None for it means scaling relatively the origin of global CS.
8643 theFactor Scaling factor value.
8644 theName Object name; when specified, this parameter is used
8645 for result publication in the study. Otherwise, if automatic
8646 publication is switched on, default value is used for result name.
8649 New GEOM.GEOM_Object, containing the scaled shape.
8651 # Example: see GEOM_TestAll.py
8652 theFactor, Parameters = ParseParameters(theFactor)
8653 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8654 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8655 anObj.SetParameters(Parameters)
8656 self._autoPublish(anObj, theName, "scaled")
8659 ## Scale the given object by different factors along coordinate axes.
8660 # @param theObject The object to be scaled.
8661 # @param thePoint Center point for scaling.
8662 # Passing None for it means scaling relatively the origin of global CS.
8663 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8664 # @param theCopy Flag used to scale object itself or create a copy.
8665 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8666 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8667 @ManageTransactions("TrsfOp")
8668 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8670 Scale the given object by different factors along coordinate axes.
8673 theObject The object to be scaled.
8674 thePoint Center point for scaling.
8675 Passing None for it means scaling relatively the origin of global CS.
8676 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8677 theCopy Flag used to scale object itself or create a copy.
8680 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8681 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8683 # Example: see GEOM_TestAll.py
8684 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8686 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8687 theFactorX, theFactorY, theFactorZ)
8689 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8690 theFactorX, theFactorY, theFactorZ)
8691 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8692 anObj.SetParameters(Parameters)
8695 ## Scale the given object by different factors along coordinate axes,
8696 # creating its copy before the scaling.
8697 # @param theObject The object to be scaled.
8698 # @param thePoint Center point for scaling.
8699 # Passing None for it means scaling relatively the origin of global CS.
8700 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8701 # @param theName Object name; when specified, this parameter is used
8702 # for result publication in the study. Otherwise, if automatic
8703 # publication is switched on, default value is used for result name.
8705 # @return New GEOM.GEOM_Object, containing the scaled shape.
8707 # @ref swig_scale "Example"
8708 @ManageTransactions("TrsfOp")
8709 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8711 Scale the given object by different factors along coordinate axes,
8712 creating its copy before the scaling.
8715 theObject The object to be scaled.
8716 thePoint Center point for scaling.
8717 Passing None for it means scaling relatively the origin of global CS.
8718 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8719 theName Object name; when specified, this parameter is used
8720 for result publication in the study. Otherwise, if automatic
8721 publication is switched on, default value is used for result name.
8724 New GEOM.GEOM_Object, containing the scaled shape.
8726 # Example: see GEOM_TestAll.py
8727 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8728 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8729 theFactorX, theFactorY, theFactorZ)
8730 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8731 anObj.SetParameters(Parameters)
8732 self._autoPublish(anObj, theName, "scaled")
8735 ## Mirror an object relatively the given plane.
8736 # @param theObject The object to be mirrored.
8737 # @param thePlane Plane of symmetry.
8738 # @param theCopy Flag used to mirror object itself or create a copy.
8739 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8740 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8741 @ManageTransactions("TrsfOp")
8742 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8744 Mirror an object relatively the given plane.
8747 theObject The object to be mirrored.
8748 thePlane Plane of symmetry.
8749 theCopy Flag used to mirror object itself or create a copy.
8752 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8753 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8756 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8758 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8759 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8762 ## Create an object, symmetrical
8763 # to the given one relatively the given plane.
8764 # @param theObject The object to be mirrored.
8765 # @param thePlane Plane of symmetry.
8766 # @param theName Object name; when specified, this parameter is used
8767 # for result publication in the study. Otherwise, if automatic
8768 # publication is switched on, default value is used for result name.
8770 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8772 # @ref tui_mirror "Example"
8773 @ManageTransactions("TrsfOp")
8774 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8776 Create an object, symmetrical to the given one relatively the given plane.
8779 theObject The object to be mirrored.
8780 thePlane Plane of symmetry.
8781 theName Object name; when specified, this parameter is used
8782 for result publication in the study. Otherwise, if automatic
8783 publication is switched on, default value is used for result name.
8786 New GEOM.GEOM_Object, containing the mirrored shape.
8788 # Example: see GEOM_TestAll.py
8789 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8790 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8791 self._autoPublish(anObj, theName, "mirrored")
8794 ## Mirror an object relatively the given axis.
8795 # @param theObject The object to be mirrored.
8796 # @param theAxis Axis of symmetry.
8797 # @param theCopy Flag used to mirror object itself or create a copy.
8798 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8799 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8800 @ManageTransactions("TrsfOp")
8801 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8803 Mirror an object relatively the given axis.
8806 theObject The object to be mirrored.
8807 theAxis Axis of symmetry.
8808 theCopy Flag used to mirror object itself or create a copy.
8811 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8812 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8815 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8817 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8818 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8821 ## Create an object, symmetrical
8822 # to the given one relatively the given axis.
8823 # @param theObject The object to be mirrored.
8824 # @param theAxis Axis of symmetry.
8825 # @param theName Object name; when specified, this parameter is used
8826 # for result publication in the study. Otherwise, if automatic
8827 # publication is switched on, default value is used for result name.
8829 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8831 # @ref tui_mirror "Example"
8832 @ManageTransactions("TrsfOp")
8833 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8835 Create an object, symmetrical to the given one relatively the given axis.
8838 theObject The object to be mirrored.
8839 theAxis Axis of symmetry.
8840 theName Object name; when specified, this parameter is used
8841 for result publication in the study. Otherwise, if automatic
8842 publication is switched on, default value is used for result name.
8845 New GEOM.GEOM_Object, containing the mirrored shape.
8847 # Example: see GEOM_TestAll.py
8848 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8849 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8850 self._autoPublish(anObj, theName, "mirrored")
8853 ## Mirror an object relatively the given point.
8854 # @param theObject The object to be mirrored.
8855 # @param thePoint Point of symmetry.
8856 # @param theCopy Flag used to mirror object itself or create a copy.
8857 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8858 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8859 @ManageTransactions("TrsfOp")
8860 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8862 Mirror an object relatively the given point.
8865 theObject The object to be mirrored.
8866 thePoint Point of symmetry.
8867 theCopy Flag used to mirror object itself or create a copy.
8870 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8871 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8873 # Example: see GEOM_TestAll.py
8875 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8877 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8878 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8881 ## Create an object, symmetrical
8882 # to the given one relatively the given point.
8883 # @param theObject The object to be mirrored.
8884 # @param thePoint Point of symmetry.
8885 # @param theName Object name; when specified, this parameter is used
8886 # for result publication in the study. Otherwise, if automatic
8887 # publication is switched on, default value is used for result name.
8889 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8891 # @ref tui_mirror "Example"
8892 @ManageTransactions("TrsfOp")
8893 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8895 Create an object, symmetrical
8896 to the given one relatively the given point.
8899 theObject The object to be mirrored.
8900 thePoint Point of symmetry.
8901 theName Object name; when specified, this parameter is used
8902 for result publication in the study. Otherwise, if automatic
8903 publication is switched on, default value is used for result name.
8906 New GEOM.GEOM_Object, containing the mirrored shape.
8908 # Example: see GEOM_TestAll.py
8909 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8910 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8911 self._autoPublish(anObj, theName, "mirrored")
8914 ## Modify the location of the given object.
8915 # @param theObject The object to be displaced.
8916 # @param theStartLCS Coordinate system to perform displacement from it.\n
8917 # If \a theStartLCS is NULL, displacement
8918 # will be performed from global CS.\n
8919 # If \a theObject itself is used as \a theStartLCS,
8920 # its location will be changed to \a theEndLCS.
8921 # @param theEndLCS Coordinate system to perform displacement to it.
8922 # @param theCopy Flag used to displace object itself or create a copy.
8923 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8924 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8925 @ManageTransactions("TrsfOp")
8926 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8928 Modify the Location of the given object by LCS, creating its copy before the setting.
8931 theObject The object to be displaced.
8932 theStartLCS Coordinate system to perform displacement from it.
8933 If theStartLCS is NULL, displacement
8934 will be performed from global CS.
8935 If theObject itself is used as theStartLCS,
8936 its location will be changed to theEndLCS.
8937 theEndLCS Coordinate system to perform displacement to it.
8938 theCopy Flag used to displace object itself or create a copy.
8941 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8942 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8944 # Example: see GEOM_TestAll.py
8946 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8948 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8949 RaiseIfFailed("Displace", self.TrsfOp)
8952 ## Modify the Location of the given object by LCS,
8953 # creating its copy before the setting.
8954 # @param theObject The object to be displaced.
8955 # @param theStartLCS Coordinate system to perform displacement from it.\n
8956 # If \a theStartLCS is NULL, displacement
8957 # will be performed from global CS.\n
8958 # If \a theObject itself is used as \a theStartLCS,
8959 # its location will be changed to \a theEndLCS.
8960 # @param theEndLCS Coordinate system to perform displacement to it.
8961 # @param theName Object name; when specified, this parameter is used
8962 # for result publication in the study. Otherwise, if automatic
8963 # publication is switched on, default value is used for result name.
8965 # @return New GEOM.GEOM_Object, containing the displaced shape.
8967 # @ref tui_modify_location "Example"
8968 @ManageTransactions("TrsfOp")
8969 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8971 Modify the Location of the given object by LCS, creating its copy before the setting.
8974 theObject The object to be displaced.
8975 theStartLCS Coordinate system to perform displacement from it.
8976 If theStartLCS is NULL, displacement
8977 will be performed from global CS.
8978 If theObject itself is used as theStartLCS,
8979 its location will be changed to theEndLCS.
8980 theEndLCS Coordinate system to perform displacement to it.
8981 theName Object name; when specified, this parameter is used
8982 for result publication in the study. Otherwise, if automatic
8983 publication is switched on, default value is used for result name.
8986 New GEOM.GEOM_Object, containing the displaced shape.
8989 # create local coordinate systems
8990 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8991 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8992 # modify the location of the given object
8993 position = geompy.MakePosition(cylinder, cs1, cs2)
8995 # Example: see GEOM_TestAll.py
8996 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8997 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8998 self._autoPublish(anObj, theName, "displaced")
9001 ## Modify the Location of the given object by Path.
9002 # @param theObject The object to be displaced.
9003 # @param thePath Wire or Edge along that the object will be translated.
9004 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9005 # @param theCopy is to create a copy objects if true.
9006 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9007 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9008 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9010 # @ref tui_modify_location "Example"
9011 @ManageTransactions("TrsfOp")
9012 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9014 Modify the Location of the given object by Path.
9017 theObject The object to be displaced.
9018 thePath Wire or Edge along that the object will be translated.
9019 theDistance progress of Path (0 = start location, 1 = end of path location).
9020 theCopy is to create a copy objects if true.
9021 theReverse 0 - for usual direction, 1 - to reverse path direction.
9024 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9025 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9028 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9030 # Example: see GEOM_TestAll.py
9031 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9032 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9035 ## Modify the Location of the given object by Path, creating its copy before the operation.
9036 # @param theObject The object to be displaced.
9037 # @param thePath Wire or Edge along that the object will be translated.
9038 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9039 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9040 # @param theName Object name; when specified, this parameter is used
9041 # for result publication in the study. Otherwise, if automatic
9042 # publication is switched on, default value is used for result name.
9044 # @return New GEOM.GEOM_Object, containing the displaced shape.
9045 @ManageTransactions("TrsfOp")
9046 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9048 Modify the Location of the given object by Path, creating its copy before the operation.
9051 theObject The object to be displaced.
9052 thePath Wire or Edge along that the object will be translated.
9053 theDistance progress of Path (0 = start location, 1 = end of path location).
9054 theReverse 0 - for usual direction, 1 - to reverse path direction.
9055 theName Object name; when specified, this parameter is used
9056 for result publication in the study. Otherwise, if automatic
9057 publication is switched on, default value is used for result name.
9060 New GEOM.GEOM_Object, containing the displaced shape.
9062 # Example: see GEOM_TestAll.py
9063 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9064 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9065 self._autoPublish(anObj, theName, "displaced")
9068 ## Offset given shape.
9069 # @param theObject The base object for the offset.
9070 # @param theOffset Offset value.
9071 # @param theCopy Flag used to offset object itself or create a copy.
9072 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9073 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9074 @ManageTransactions("TrsfOp")
9075 def Offset(self, theObject, theOffset, theCopy=False):
9080 theObject The base object for the offset.
9081 theOffset Offset value.
9082 theCopy Flag used to offset object itself or create a copy.
9085 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9086 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9088 theOffset, Parameters = ParseParameters(theOffset)
9090 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
9092 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
9093 RaiseIfFailed("Offset", self.TrsfOp)
9094 anObj.SetParameters(Parameters)
9097 ## Create new object as offset of the given one.
9098 # @param theObject The base object for the offset.
9099 # @param theOffset Offset value.
9100 # @param theName Object name; when specified, this parameter is used
9101 # for result publication in the study. Otherwise, if automatic
9102 # publication is switched on, default value is used for result name.
9104 # @return New GEOM.GEOM_Object, containing the offset object.
9106 # @ref tui_offset "Example"
9107 @ManageTransactions("TrsfOp")
9108 def MakeOffset(self, theObject, theOffset, theName=None):
9110 Create new object as offset of the given one.
9113 theObject The base object for the offset.
9114 theOffset Offset value.
9115 theName Object name; when specified, this parameter is used
9116 for result publication in the study. Otherwise, if automatic
9117 publication is switched on, default value is used for result name.
9120 New GEOM.GEOM_Object, containing the offset object.
9123 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9124 # create a new object as offset of the given object
9125 offset = geompy.MakeOffset(box, 70.)
9127 # Example: see GEOM_TestAll.py
9128 theOffset, Parameters = ParseParameters(theOffset)
9129 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
9130 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9131 anObj.SetParameters(Parameters)
9132 self._autoPublish(anObj, theName, "offset")
9135 ## Create new object as projection of the given one on another.
9136 # @param theSource The source object for the projection. It can be a point, edge or wire.
9137 # Edge and wire are acceptable if @a theTarget is a face.
9138 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9139 # @param theName Object name; when specified, this parameter is used
9140 # for result publication in the study. Otherwise, if automatic
9141 # publication is switched on, default value is used for result name.
9143 # @return New GEOM.GEOM_Object, containing the projection.
9145 # @ref tui_projection "Example"
9146 @ManageTransactions("TrsfOp")
9147 def MakeProjection(self, theSource, theTarget, theName=None):
9149 Create new object as projection of the given one on another.
9152 theSource The source object for the projection. It can be a point, edge or wire.
9153 Edge and wire are acceptable if theTarget is a face.
9154 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9155 theName Object name; when specified, this parameter is used
9156 for result publication in the study. Otherwise, if automatic
9157 publication is switched on, default value is used for result name.
9160 New GEOM.GEOM_Object, containing the projection.
9162 # Example: see GEOM_TestAll.py
9163 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9164 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9165 self._autoPublish(anObj, theName, "projection")
9168 ## Create a projection of the given point on a wire or an edge.
9169 # If there are no solutions or there are 2 or more solutions It throws an
9171 # @param thePoint the point to be projected.
9172 # @param theWire the wire. The edge is accepted as well.
9173 # @param theName Object name; when specified, this parameter is used
9174 # for result publication in the study. Otherwise, if automatic
9175 # publication is switched on, default value is used for result name.
9177 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9178 # \n \a u: The parameter of projection point on edge.
9179 # \n \a PointOnEdge: The projection point.
9180 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9182 # @ref tui_projection "Example"
9183 @ManageTransactions("TrsfOp")
9184 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9186 Create a projection of the given point on a wire or an edge.
9187 If there are no solutions or there are 2 or more solutions It throws an
9191 thePoint the point to be projected.
9192 theWire the wire. The edge is accepted as well.
9193 theName Object name; when specified, this parameter is used
9194 for result publication in the study. Otherwise, if automatic
9195 publication is switched on, default value is used for result name.
9198 [u, PointOnEdge, EdgeInWireIndex]
9199 u: The parameter of projection point on edge.
9200 PointOnEdge: The projection point.
9201 EdgeInWireIndex: The index of an edge in a wire.
9203 # Example: see GEOM_TestAll.py
9204 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9205 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9206 self._autoPublish(anObj[1], theName, "projection")
9209 # -----------------------------------------------------------------------------
9211 # -----------------------------------------------------------------------------
9213 ## Translate the given object along the given vector a given number times
9214 # @param theObject The object to be translated.
9215 # @param theVector Direction of the translation. DX if None.
9216 # @param theStep Distance to translate on.
9217 # @param theNbTimes Quantity of translations to be done.
9218 # @param theName Object name; when specified, this parameter is used
9219 # for result publication in the study. Otherwise, if automatic
9220 # publication is switched on, default value is used for result name.
9222 # @return New GEOM.GEOM_Object, containing compound of all
9223 # the shapes, obtained after each translation.
9225 # @ref tui_multi_translation "Example"
9226 @ManageTransactions("TrsfOp")
9227 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9229 Translate the given object along the given vector a given number times
9232 theObject The object to be translated.
9233 theVector Direction of the translation. DX if None.
9234 theStep Distance to translate on.
9235 theNbTimes Quantity of translations to be done.
9236 theName Object name; when specified, this parameter is used
9237 for result publication in the study. Otherwise, if automatic
9238 publication is switched on, default value is used for result name.
9241 New GEOM.GEOM_Object, containing compound of all
9242 the shapes, obtained after each translation.
9245 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9247 # Example: see GEOM_TestAll.py
9248 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9249 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9250 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9251 anObj.SetParameters(Parameters)
9252 self._autoPublish(anObj, theName, "multitranslation")
9255 ## Conseqently apply two specified translations to theObject specified number of times.
9256 # @param theObject The object to be translated.
9257 # @param theVector1 Direction of the first translation. DX if None.
9258 # @param theStep1 Step of the first translation.
9259 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9260 # @param theVector2 Direction of the second translation. DY if None.
9261 # @param theStep2 Step of the second translation.
9262 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9263 # @param theName Object name; when specified, this parameter is used
9264 # for result publication in the study. Otherwise, if automatic
9265 # publication is switched on, default value is used for result name.
9267 # @return New GEOM.GEOM_Object, containing compound of all
9268 # the shapes, obtained after each translation.
9270 # @ref tui_multi_translation "Example"
9271 @ManageTransactions("TrsfOp")
9272 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9273 theVector2, theStep2, theNbTimes2, theName=None):
9275 Conseqently apply two specified translations to theObject specified number of times.
9278 theObject The object to be translated.
9279 theVector1 Direction of the first translation. DX if None.
9280 theStep1 Step of the first translation.
9281 theNbTimes1 Quantity of translations to be done along theVector1.
9282 theVector2 Direction of the second translation. DY if None.
9283 theStep2 Step of the second translation.
9284 theNbTimes2 Quantity of translations to be done along theVector2.
9285 theName Object name; when specified, this parameter is used
9286 for result publication in the study. Otherwise, if automatic
9287 publication is switched on, default value is used for result name.
9290 New GEOM.GEOM_Object, containing compound of all
9291 the shapes, obtained after each translation.
9294 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9296 # Example: see GEOM_TestAll.py
9297 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9298 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9299 theVector2, theStep2, theNbTimes2)
9300 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9301 anObj.SetParameters(Parameters)
9302 self._autoPublish(anObj, theName, "multitranslation")
9305 ## Rotate the given object around the given axis a given number times.
9306 # Rotation angle will be 2*PI/theNbTimes.
9307 # @param theObject The object to be rotated.
9308 # @param theAxis The rotation axis. DZ if None.
9309 # @param theNbTimes Quantity of rotations to be done.
9310 # @param theName Object name; when specified, this parameter is used
9311 # for result publication in the study. Otherwise, if automatic
9312 # publication is switched on, default value is used for result name.
9314 # @return New GEOM.GEOM_Object, containing compound of all the
9315 # shapes, obtained after each rotation.
9317 # @ref tui_multi_rotation "Example"
9318 @ManageTransactions("TrsfOp")
9319 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9321 Rotate the given object around the given axis a given number times.
9322 Rotation angle will be 2*PI/theNbTimes.
9325 theObject The object to be rotated.
9326 theAxis The rotation axis. DZ if None.
9327 theNbTimes Quantity of rotations to be done.
9328 theName Object name; when specified, this parameter is used
9329 for result publication in the study. Otherwise, if automatic
9330 publication is switched on, default value is used for result name.
9333 New GEOM.GEOM_Object, containing compound of all the
9334 shapes, obtained after each rotation.
9337 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9339 # Example: see GEOM_TestAll.py
9340 theNbTimes, Parameters = ParseParameters(theNbTimes)
9341 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9342 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9343 anObj.SetParameters(Parameters)
9344 self._autoPublish(anObj, theName, "multirotation")
9347 ## Rotate the given object around the given axis
9348 # a given number times on the given angle.
9349 # @param theObject The object to be rotated.
9350 # @param theAxis The rotation axis. DZ if None.
9351 # @param theAngleStep Rotation angle in radians.
9352 # @param theNbTimes Quantity of rotations to be done.
9353 # @param theName Object name; when specified, this parameter is used
9354 # for result publication in the study. Otherwise, if automatic
9355 # publication is switched on, default value is used for result name.
9357 # @return New GEOM.GEOM_Object, containing compound of all the
9358 # shapes, obtained after each rotation.
9360 # @ref tui_multi_rotation "Example"
9361 @ManageTransactions("TrsfOp")
9362 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9364 Rotate the given object around the given axis
9365 a given number times on the given angle.
9368 theObject The object to be rotated.
9369 theAxis The rotation axis. DZ if None.
9370 theAngleStep Rotation angle in radians.
9371 theNbTimes Quantity of rotations to be done.
9372 theName Object name; when specified, this parameter is used
9373 for result publication in the study. Otherwise, if automatic
9374 publication is switched on, default value is used for result name.
9377 New GEOM.GEOM_Object, containing compound of all the
9378 shapes, obtained after each rotation.
9381 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9383 # Example: see GEOM_TestAll.py
9384 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9385 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9386 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9387 anObj.SetParameters(Parameters)
9388 self._autoPublish(anObj, theName, "multirotation")
9391 ## Rotate the given object around the given axis a given
9392 # number times and multi-translate each rotation result.
9393 # Rotation angle will be 2*PI/theNbTimes1.
9394 # Translation direction passes through center of gravity
9395 # of rotated shape and its projection on the rotation axis.
9396 # @param theObject The object to be rotated.
9397 # @param theAxis Rotation axis. DZ if None.
9398 # @param theNbTimes1 Quantity of rotations to be done.
9399 # @param theRadialStep Translation distance.
9400 # @param theNbTimes2 Quantity of translations to be done.
9401 # @param theName Object name; when specified, this parameter is used
9402 # for result publication in the study. Otherwise, if automatic
9403 # publication is switched on, default value is used for result name.
9405 # @return New GEOM.GEOM_Object, containing compound of all the
9406 # shapes, obtained after each transformation.
9408 # @ref tui_multi_rotation "Example"
9409 @ManageTransactions("TrsfOp")
9410 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9412 Rotate the given object around the
9413 given axis on the given angle a given number
9414 times and multi-translate each rotation result.
9415 Translation direction passes through center of gravity
9416 of rotated shape and its projection on the rotation axis.
9419 theObject The object to be rotated.
9420 theAxis Rotation axis. DZ if None.
9421 theNbTimes1 Quantity of rotations to be done.
9422 theRadialStep Translation distance.
9423 theNbTimes2 Quantity of translations to be done.
9424 theName Object name; when specified, this parameter is used
9425 for result publication in the study. Otherwise, if automatic
9426 publication is switched on, default value is used for result name.
9429 New GEOM.GEOM_Object, containing compound of all the
9430 shapes, obtained after each transformation.
9433 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9435 # Example: see GEOM_TestAll.py
9436 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9437 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9438 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9439 anObj.SetParameters(Parameters)
9440 self._autoPublish(anObj, theName, "multirotation")
9443 ## Rotate the given object around the
9444 # given axis on the given angle a given number
9445 # times and multi-translate each rotation result.
9446 # Translation direction passes through center of gravity
9447 # of rotated shape and its projection on the rotation axis.
9448 # @param theObject The object to be rotated.
9449 # @param theAxis Rotation axis. DZ if None.
9450 # @param theAngleStep Rotation angle in radians.
9451 # @param theNbTimes1 Quantity of rotations to be done.
9452 # @param theRadialStep Translation distance.
9453 # @param theNbTimes2 Quantity of translations to be done.
9454 # @param theName Object name; when specified, this parameter is used
9455 # for result publication in the study. Otherwise, if automatic
9456 # publication is switched on, default value is used for result name.
9458 # @return New GEOM.GEOM_Object, containing compound of all the
9459 # shapes, obtained after each transformation.
9461 # @ref tui_multi_rotation "Example"
9462 @ManageTransactions("TrsfOp")
9463 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9465 Rotate the given object around the
9466 given axis on the given angle a given number
9467 times and multi-translate each rotation result.
9468 Translation direction passes through center of gravity
9469 of rotated shape and its projection on the rotation axis.
9472 theObject The object to be rotated.
9473 theAxis Rotation axis. DZ if None.
9474 theAngleStep Rotation angle in radians.
9475 theNbTimes1 Quantity of rotations to be done.
9476 theRadialStep Translation distance.
9477 theNbTimes2 Quantity of translations to be done.
9478 theName Object name; when specified, this parameter is used
9479 for result publication in the study. Otherwise, if automatic
9480 publication is switched on, default value is used for result name.
9483 New GEOM.GEOM_Object, containing compound of all the
9484 shapes, obtained after each transformation.
9487 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9489 # Example: see GEOM_TestAll.py
9490 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9491 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9492 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9493 anObj.SetParameters(Parameters)
9494 self._autoPublish(anObj, theName, "multirotation")
9497 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9499 # @ref swig_MakeMultiRotation "Example"
9500 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9502 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9505 pz = geompy.MakeVertex(0, 0, 100)
9506 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9507 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9509 # Example: see GEOM_TestOthers.py
9510 aVec = self.MakeLine(aPoint,aDir)
9511 # note: auto-publishing is done in self.MultiRotate1D()
9512 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9515 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9517 # @ref swig_MakeMultiRotation "Example"
9518 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9520 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9523 pz = geompy.MakeVertex(0, 0, 100)
9524 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9525 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9527 # Example: see GEOM_TestOthers.py
9528 aVec = self.MakeLine(aPoint,aDir)
9529 # note: auto-publishing is done in self.MultiRotate1D()
9530 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9533 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9535 # @ref swig_MakeMultiRotation "Example"
9536 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9538 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9541 pz = geompy.MakeVertex(0, 0, 100)
9542 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9543 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9545 # Example: see GEOM_TestOthers.py
9546 aVec = self.MakeLine(aPoint,aDir)
9547 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9548 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9551 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9553 # @ref swig_MakeMultiRotation "Example"
9554 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9556 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9559 pz = geompy.MakeVertex(0, 0, 100)
9560 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9561 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9563 # Example: see GEOM_TestOthers.py
9564 aVec = self.MakeLine(aPoint,aDir)
9565 # note: auto-publishing is done in self.MultiRotate2D()
9566 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9570 # Compute a wire or a face that represents a projection of the source
9571 # shape onto cylinder. The cylinder's coordinate system is the same
9572 # as the global coordinate system.
9574 # @param theObject The object to be projected. It can be either
9575 # a planar wire or a face.
9576 # @param theRadius The radius of the cylinder.
9577 # @param theStartAngle The starting angle in radians from
9578 # the cylinder's X axis around Z axis. The angle from which
9579 # the projection is started.
9580 # @param theAngleLength The projection length angle in radians.
9581 # The angle in which to project the total length of the wire.
9582 # If it is negative the projection is not scaled and natural
9583 # wire length is kept for the projection.
9584 # @param theName Object name; when specified, this parameter is used
9585 # for result publication in the study. Otherwise, if automatic
9586 # publication is switched on, default value is used for result name.
9588 # @return New GEOM.GEOM_Object, containing the result shape. The result
9589 # represents a wire or a face that represents a projection of
9590 # the source shape onto a cylinder.
9592 # @ref tui_projection "Example"
9593 def MakeProjectionOnCylinder (self, theObject, theRadius,
9594 theStartAngle=0.0, theAngleLength=-1.0,
9597 Compute a wire or a face that represents a projection of the source
9598 shape onto cylinder. The cylinder's coordinate system is the same
9599 as the global coordinate system.
9602 theObject The object to be projected. It can be either
9603 a planar wire or a face.
9604 theRadius The radius of the cylinder.
9605 theStartAngle The starting angle in radians from the cylinder's X axis
9606 around Z axis. The angle from which the projection is started.
9607 theAngleLength The projection length angle in radians. The angle in which
9608 to project the total length of the wire. If it is negative the
9609 projection is not scaled and natural wire length is kept for
9611 theName Object name; when specified, this parameter is used
9612 for result publication in the study. Otherwise, if automatic
9613 publication is switched on, default value is used for result name.
9616 New GEOM.GEOM_Object, containing the result shape. The result
9617 represents a wire or a face that represents a projection of
9618 the source shape onto a cylinder.
9620 # Example: see GEOM_TestAll.py
9621 flagStartAngle = False
9622 if isinstance(theStartAngle,str):
9623 flagStartAngle = True
9624 flagAngleLength = False
9625 if isinstance(theAngleLength,str):
9626 flagAngleLength = True
9627 theRadius, theStartAngle, theAngleLength, Parameters = ParseParameters(
9628 theRadius, theStartAngle, theAngleLength)
9630 theStartAngle = theStartAngle*math.pi/180.
9632 theAngleLength = theAngleLength*math.pi/180.
9633 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9634 theStartAngle, theAngleLength)
9635 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9636 anObj.SetParameters(Parameters)
9637 self._autoPublish(anObj, theName, "projection")
9640 # end of l3_transform
9643 ## @addtogroup l3_transform_d
9646 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9647 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9649 Deprecated method. Use MultiRotate1DNbTimes instead.
9651 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9652 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9654 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9655 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9656 @ManageTransactions("TrsfOp")
9657 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9659 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9660 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9663 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9665 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9666 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9667 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9668 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9669 anObj.SetParameters(Parameters)
9670 self._autoPublish(anObj, theName, "multirotation")
9673 ## The same, as MultiRotate1D(), but axis is given by direction and point
9674 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9675 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9677 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9678 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9681 pz = geompy.MakeVertex(0, 0, 100)
9682 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9683 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9685 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9686 aVec = self.MakeLine(aPoint,aDir)
9687 # note: auto-publishing is done in self.MultiRotate1D()
9688 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9691 ## The same, as MultiRotate2D(), but axis is given by direction and point
9692 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9693 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9695 The same, as MultiRotate2D(), but axis is given by direction and point
9696 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9699 pz = geompy.MakeVertex(0, 0, 100)
9700 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9701 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9703 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9704 aVec = self.MakeLine(aPoint,aDir)
9705 # note: auto-publishing is done in self.MultiRotate2D()
9706 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9709 # end of l3_transform_d
9712 ## @addtogroup l3_local
9715 ## Perform a fillet on all edges of the given shape.
9716 # @param theShape Shape, to perform fillet on.
9717 # @param theR Fillet radius.
9718 # @param theName Object name; when specified, this parameter is used
9719 # for result publication in the study. Otherwise, if automatic
9720 # publication is switched on, default value is used for result name.
9722 # @return New GEOM.GEOM_Object, containing the result shape.
9724 # @ref tui_fillet "Example 1"
9725 # \n @ref swig_MakeFilletAll "Example 2"
9726 @ManageTransactions("LocalOp")
9727 def MakeFilletAll(self, theShape, theR, theName=None):
9729 Perform a fillet on all edges of the given shape.
9732 theShape Shape, to perform fillet on.
9734 theName Object name; when specified, this parameter is used
9735 for result publication in the study. Otherwise, if automatic
9736 publication is switched on, default value is used for result name.
9739 New GEOM.GEOM_Object, containing the result shape.
9742 filletall = geompy.MakeFilletAll(prism, 10.)
9744 # Example: see GEOM_TestOthers.py
9745 theR,Parameters = ParseParameters(theR)
9746 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9747 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9748 anObj.SetParameters(Parameters)
9749 self._autoPublish(anObj, theName, "fillet")
9752 ## Perform a fillet on the specified edges/faces of the given shape
9753 # @param theShape Shape, to perform fillet on.
9754 # @param theR Fillet radius.
9755 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9756 # @param theListShapes Global indices of edges/faces to perform fillet on.
9757 # @param theName Object name; when specified, this parameter is used
9758 # for result publication in the study. Otherwise, if automatic
9759 # publication is switched on, default value is used for result name.
9761 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9763 # @return New GEOM.GEOM_Object, containing the result shape.
9765 # @ref tui_fillet "Example"
9766 @ManageTransactions("LocalOp")
9767 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9769 Perform a fillet on the specified edges/faces of the given shape
9772 theShape Shape, to perform fillet on.
9774 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9775 theListShapes Global indices of edges/faces to perform fillet on.
9776 theName Object name; when specified, this parameter is used
9777 for result publication in the study. Otherwise, if automatic
9778 publication is switched on, default value is used for result name.
9781 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9784 New GEOM.GEOM_Object, containing the result shape.
9787 # get the list of IDs (IDList) for the fillet
9788 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9790 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9791 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9792 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9793 # make a fillet on the specified edges of the given shape
9794 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9796 # Example: see GEOM_TestAll.py
9797 theR,Parameters = ParseParameters(theR)
9799 if theShapeType == self.ShapeType["EDGE"]:
9800 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9801 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9803 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9804 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9805 anObj.SetParameters(Parameters)
9806 self._autoPublish(anObj, theName, "fillet")
9809 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9810 @ManageTransactions("LocalOp")
9811 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9813 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9816 # get the list of IDs (IDList) for the fillet
9817 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9819 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9820 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9821 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9822 # make a fillet on the specified edges of the given shape
9823 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9825 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9827 if theShapeType == self.ShapeType["EDGE"]:
9828 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9829 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9831 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9832 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9833 anObj.SetParameters(Parameters)
9834 self._autoPublish(anObj, theName, "fillet")
9837 ## Perform a fillet on the specified edges of the given shape
9838 # @param theShape Wire Shape to perform fillet on.
9839 # @param theR Fillet radius.
9840 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9841 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9842 # \note The list of vertices could be empty,
9843 # in this case fillet will done done at all vertices in wire
9844 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9845 # by the length of the edges, nearest to the fillet vertex.
9846 # But sometimes the next edge is C1 continuous with the one, nearest to
9847 # the fillet point, and such two (or more) edges can be united to allow
9848 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9849 # thus ignoring the secant vertex (vertices).
9850 # @param theName Object name; when specified, this parameter is used
9851 # for result publication in the study. Otherwise, if automatic
9852 # publication is switched on, default value is used for result name.
9854 # @return New GEOM.GEOM_Object, containing the result shape.
9856 # @ref tui_fillet2d "Example"
9857 @ManageTransactions("LocalOp")
9858 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9860 Perform a fillet on the specified edges of the given shape
9863 theShape Wire Shape to perform fillet on.
9865 theListOfVertexes Global indices of vertexes to perform fillet on.
9866 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9867 by the length of the edges, nearest to the fillet vertex.
9868 But sometimes the next edge is C1 continuous with the one, nearest to
9869 the fillet point, and such two (or more) edges can be united to allow
9870 bigger radius. Set this flag to TRUE to allow collinear edges union,
9871 thus ignoring the secant vertex (vertices).
9872 theName Object name; when specified, this parameter is used
9873 for result publication in the study. Otherwise, if automatic
9874 publication is switched on, default value is used for result name.
9876 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9878 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9881 New GEOM.GEOM_Object, containing the result shape.
9885 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9886 # make fillet at given wire vertices with giver radius
9887 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9889 # Example: see GEOM_TestAll.py
9890 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9891 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9892 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9893 anObj.SetParameters(Parameters)
9894 self._autoPublish(anObj, theName, "fillet")
9897 ## Perform a fillet at the specified vertices of the given face/shell.
9898 # @param theShape Face or Shell shape to perform fillet on.
9899 # @param theR Fillet radius.
9900 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9901 # @param theName Object name; when specified, this parameter is used
9902 # for result publication in the study. Otherwise, if automatic
9903 # publication is switched on, default value is used for result name.
9905 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9907 # @return New GEOM.GEOM_Object, containing the result shape.
9909 # @ref tui_fillet2d "Example"
9910 @ManageTransactions("LocalOp")
9911 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9913 Perform a fillet at the specified vertices of the given face/shell.
9916 theShape Face or Shell shape to perform fillet on.
9918 theListOfVertexes Global indices of vertexes to perform fillet on.
9919 theName Object name; when specified, this parameter is used
9920 for result publication in the study. Otherwise, if automatic
9921 publication is switched on, default value is used for result name.
9923 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9926 New GEOM.GEOM_Object, containing the result shape.
9929 face = geompy.MakeFaceHW(100, 100, 1)
9930 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9932 # Example: see GEOM_TestAll.py
9933 theR,Parameters = ParseParameters(theR)
9934 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9935 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9936 anObj.SetParameters(Parameters)
9937 self._autoPublish(anObj, theName, "fillet")
9940 ## Perform a symmetric chamfer on all edges of the given shape.
9941 # @param theShape Shape, to perform chamfer on.
9942 # @param theD Chamfer size along each face.
9943 # @param theName Object name; when specified, this parameter is used
9944 # for result publication in the study. Otherwise, if automatic
9945 # publication is switched on, default value is used for result name.
9947 # @return New GEOM.GEOM_Object, containing the result shape.
9949 # @ref tui_chamfer "Example 1"
9950 # \n @ref swig_MakeChamferAll "Example 2"
9951 @ManageTransactions("LocalOp")
9952 def MakeChamferAll(self, theShape, theD, theName=None):
9954 Perform a symmetric chamfer on all edges of the given shape.
9957 theShape Shape, to perform chamfer on.
9958 theD Chamfer size along each face.
9959 theName Object name; when specified, this parameter is used
9960 for result publication in the study. Otherwise, if automatic
9961 publication is switched on, default value is used for result name.
9964 New GEOM.GEOM_Object, containing the result shape.
9967 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9969 # Example: see GEOM_TestOthers.py
9970 theD,Parameters = ParseParameters(theD)
9971 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9972 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9973 anObj.SetParameters(Parameters)
9974 self._autoPublish(anObj, theName, "chamfer")
9977 ## Perform a chamfer on edges, common to the specified faces,
9978 # with distance D1 on the Face1
9979 # @param theShape Shape, to perform chamfer on.
9980 # @param theD1 Chamfer size along \a theFace1.
9981 # @param theD2 Chamfer size along \a theFace2.
9982 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9983 # @param theName Object name; when specified, this parameter is used
9984 # for result publication in the study. Otherwise, if automatic
9985 # publication is switched on, default value is used for result name.
9987 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9989 # @return New GEOM.GEOM_Object, containing the result shape.
9991 # @ref tui_chamfer "Example"
9992 @ManageTransactions("LocalOp")
9993 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9995 Perform a chamfer on edges, common to the specified faces,
9996 with distance D1 on the Face1
9999 theShape Shape, to perform chamfer on.
10000 theD1 Chamfer size along theFace1.
10001 theD2 Chamfer size along theFace2.
10002 theFace1,theFace2 Global indices of two faces of theShape.
10003 theName Object name; when specified, this parameter is used
10004 for result publication in the study. Otherwise, if automatic
10005 publication is switched on, default value is used for result name.
10008 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10011 New GEOM.GEOM_Object, containing the result shape.
10014 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10015 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10016 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10017 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10019 # Example: see GEOM_TestAll.py
10020 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10021 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10022 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10023 anObj.SetParameters(Parameters)
10024 self._autoPublish(anObj, theName, "chamfer")
10027 ## Perform a chamfer on edges
10028 # @param theShape Shape, to perform chamfer on.
10029 # @param theD Chamfer length
10030 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10031 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10032 # @param theName Object name; when specified, this parameter is used
10033 # for result publication in the study. Otherwise, if automatic
10034 # publication is switched on, default value is used for result name.
10036 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10038 # @return New GEOM.GEOM_Object, containing the result shape.
10039 @ManageTransactions("LocalOp")
10040 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10042 Perform a chamfer on edges
10045 theShape Shape, to perform chamfer on.
10046 theD1 Chamfer size along theFace1.
10047 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10048 theFace1,theFace2 Global indices of two faces of theShape.
10049 theName Object name; when specified, this parameter is used
10050 for result publication in the study. Otherwise, if automatic
10051 publication is switched on, default value is used for result name.
10054 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10057 New GEOM.GEOM_Object, containing the result shape.
10060 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10061 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10062 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10064 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10067 if isinstance(theAngle,str):
10069 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10071 theAngle = theAngle*math.pi/180.0
10072 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10073 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10074 anObj.SetParameters(Parameters)
10075 self._autoPublish(anObj, theName, "chamfer")
10078 ## Perform a chamfer on all edges of the specified faces,
10079 # with distance D1 on the first specified face (if several for one edge)
10080 # @param theShape Shape, to perform chamfer on.
10081 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10082 # connected to the edge, are in \a theFaces, \a theD1
10083 # will be get along face, which is nearer to \a theFaces beginning.
10084 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10085 # @param theFaces Sequence of global indices of faces of \a theShape.
10086 # @param theName Object name; when specified, this parameter is used
10087 # for result publication in the study. Otherwise, if automatic
10088 # publication is switched on, default value is used for result name.
10090 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10092 # @return New GEOM.GEOM_Object, containing the result shape.
10094 # @ref tui_chamfer "Example"
10095 @ManageTransactions("LocalOp")
10096 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10098 Perform a chamfer on all edges of the specified faces,
10099 with distance D1 on the first specified face (if several for one edge)
10102 theShape Shape, to perform chamfer on.
10103 theD1 Chamfer size along face from theFaces. If both faces,
10104 connected to the edge, are in theFaces, theD1
10105 will be get along face, which is nearer to theFaces beginning.
10106 theD2 Chamfer size along another of two faces, connected to the edge.
10107 theFaces Sequence of global indices of faces of theShape.
10108 theName Object name; when specified, this parameter is used
10109 for result publication in the study. Otherwise, if automatic
10110 publication is switched on, default value is used for result name.
10112 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10115 New GEOM.GEOM_Object, containing the result shape.
10117 # Example: see GEOM_TestAll.py
10118 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10119 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10120 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10121 anObj.SetParameters(Parameters)
10122 self._autoPublish(anObj, theName, "chamfer")
10125 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
10126 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10128 # @ref swig_FilletChamfer "Example"
10129 @ManageTransactions("LocalOp")
10130 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10132 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
10133 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10136 if isinstance(theAngle,str):
10138 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10140 theAngle = theAngle*math.pi/180.0
10141 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10142 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10143 anObj.SetParameters(Parameters)
10144 self._autoPublish(anObj, theName, "chamfer")
10147 ## Perform a chamfer on edges,
10148 # with distance D1 on the first specified face (if several for one edge)
10149 # @param theShape Shape, to perform chamfer on.
10150 # @param theD1,theD2 Chamfer size
10151 # @param theEdges Sequence of edges of \a theShape.
10152 # @param theName Object name; when specified, this parameter is used
10153 # for result publication in the study. Otherwise, if automatic
10154 # publication is switched on, default value is used for result name.
10156 # @return New GEOM.GEOM_Object, containing the result shape.
10158 # @ref swig_FilletChamfer "Example"
10159 @ManageTransactions("LocalOp")
10160 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10162 Perform a chamfer on edges,
10163 with distance D1 on the first specified face (if several for one edge)
10166 theShape Shape, to perform chamfer on.
10167 theD1,theD2 Chamfer size
10168 theEdges Sequence of edges of theShape.
10169 theName Object name; when specified, this parameter is used
10170 for result publication in the study. Otherwise, if automatic
10171 publication is switched on, default value is used for result name.
10174 New GEOM.GEOM_Object, containing the result shape.
10176 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10177 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10178 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10179 anObj.SetParameters(Parameters)
10180 self._autoPublish(anObj, theName, "chamfer")
10183 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
10184 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10185 @ManageTransactions("LocalOp")
10186 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10188 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
10189 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10192 if isinstance(theAngle,str):
10194 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10196 theAngle = theAngle*math.pi/180.0
10197 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10198 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10199 anObj.SetParameters(Parameters)
10200 self._autoPublish(anObj, theName, "chamfer")
10203 ## @sa MakeChamferEdge(), MakeChamferFaces()
10205 # @ref swig_MakeChamfer "Example"
10206 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10208 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10210 # Example: see GEOM_TestOthers.py
10212 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10213 if aShapeType == self.ShapeType["EDGE"]:
10214 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10216 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10219 ## Remove material from a solid by extrusion of the base shape on the given distance.
10220 # @param theInit Shape to remove material from. It must be a solid or
10221 # a compound made of a single solid.
10222 # @param theBase Closed edge or wire defining the base shape to be extruded.
10223 # @param theH Prism dimension along the normal to theBase
10224 # @param theAngle Draft angle in degrees.
10225 # @param theInvert If true material changes the direction
10226 # @param theName Object name; when specified, this parameter is used
10227 # for result publication in the study. Otherwise, if automatic
10228 # publication is switched on, default value is used for result name.
10230 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10232 # @ref tui_creation_prism "Example"
10233 @ManageTransactions("PrimOp")
10234 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10236 Add material to a solid by extrusion of the base shape on the given distance.
10239 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10240 theBase Closed edge or wire defining the base shape to be extruded.
10241 theH Prism dimension along the normal to theBase
10242 theAngle Draft angle in degrees.
10243 theInvert If true material changes the direction.
10244 theName Object name; when specified, this parameter is used
10245 for result publication in the study. Otherwise, if automatic
10246 publication is switched on, default value is used for result name.
10249 New GEOM.GEOM_Object, containing the initial shape with removed material.
10251 # Example: see GEOM_TestAll.py
10252 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10253 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10254 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10255 anObj.SetParameters(Parameters)
10256 self._autoPublish(anObj, theName, "extrudedCut")
10259 ## Add material to a solid by extrusion of the base shape on the given distance.
10260 # @param theInit Shape to add material to. It must be a solid or
10261 # a compound made of a single solid.
10262 # @param theBase Closed edge or wire defining the base shape to be extruded.
10263 # @param theH Prism dimension along the normal to theBase
10264 # @param theAngle Draft angle in degrees.
10265 # @param theInvert If true material changes the direction
10266 # @param theName Object name; when specified, this parameter is used
10267 # for result publication in the study. Otherwise, if automatic
10268 # publication is switched on, default value is used for result name.
10270 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10272 # @ref tui_creation_prism "Example"
10273 @ManageTransactions("PrimOp")
10274 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10276 Add material to a solid by extrusion of the base shape on the given distance.
10279 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10280 theBase Closed edge or wire defining the base shape to be extruded.
10281 theH Prism dimension along the normal to theBase
10282 theAngle Draft angle in degrees.
10283 theInvert If true material changes the direction.
10284 theName Object name; when specified, this parameter is used
10285 for result publication in the study. Otherwise, if automatic
10286 publication is switched on, default value is used for result name.
10289 New GEOM.GEOM_Object, containing the initial shape with added material.
10291 # Example: see GEOM_TestAll.py
10292 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10293 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10294 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10295 anObj.SetParameters(Parameters)
10296 self._autoPublish(anObj, theName, "extrudedBoss")
10302 ## @addtogroup l3_basic_op
10305 ## Perform an Archimde operation on the given shape with given parameters.
10306 # The object presenting the resulting face is returned.
10307 # @param theShape Shape to be put in water.
10308 # @param theWeight Weight of the shape.
10309 # @param theWaterDensity Density of the water.
10310 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10311 # @param theName Object name; when specified, this parameter is used
10312 # for result publication in the study. Otherwise, if automatic
10313 # publication is switched on, default value is used for result name.
10315 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10316 # by a plane, corresponding to water level.
10318 # @ref tui_archimede "Example"
10319 @ManageTransactions("LocalOp")
10320 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10322 Perform an Archimde operation on the given shape with given parameters.
10323 The object presenting the resulting face is returned.
10326 theShape Shape to be put in water.
10327 theWeight Weight of the shape.
10328 theWaterDensity Density of the water.
10329 theMeshDeflection Deflection of the mesh, using to compute the section.
10330 theName Object name; when specified, this parameter is used
10331 for result publication in the study. Otherwise, if automatic
10332 publication is switched on, default value is used for result name.
10335 New GEOM.GEOM_Object, containing a section of theShape
10336 by a plane, corresponding to water level.
10338 # Example: see GEOM_TestAll.py
10339 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10340 theWeight,theWaterDensity,theMeshDeflection)
10341 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10342 RaiseIfFailed("MakeArchimede", self.LocalOp)
10343 anObj.SetParameters(Parameters)
10344 self._autoPublish(anObj, theName, "archimede")
10347 # end of l3_basic_op
10350 ## @addtogroup l2_measure
10353 ## Get point coordinates
10354 # @return [x, y, z]
10356 # @ref tui_point_coordinates_page "Example"
10357 @ManageTransactions("MeasuOp")
10358 def PointCoordinates(self,Point):
10360 Get point coordinates
10365 # Example: see GEOM_TestMeasures.py
10366 aTuple = self.MeasuOp.PointCoordinates(Point)
10367 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10370 ## Get vector coordinates
10371 # @return [x, y, z]
10373 # @ref tui_measurement_tools_page "Example"
10374 def VectorCoordinates(self,Vector):
10376 Get vector coordinates
10382 p1=self.GetFirstVertex(Vector)
10383 p2=self.GetLastVertex(Vector)
10385 X1=self.PointCoordinates(p1)
10386 X2=self.PointCoordinates(p2)
10388 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10391 ## Compute cross product
10392 # @return vector w=u^v
10394 # @ref tui_measurement_tools_page "Example"
10395 def CrossProduct(self, Vector1, Vector2):
10397 Compute cross product
10399 Returns: vector w=u^v
10401 u=self.VectorCoordinates(Vector1)
10402 v=self.VectorCoordinates(Vector2)
10403 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])
10407 ## Compute cross product
10408 # @return dot product p=u.v
10410 # @ref tui_measurement_tools_page "Example"
10411 def DotProduct(self, Vector1, Vector2):
10413 Compute cross product
10415 Returns: dot product p=u.v
10417 u=self.VectorCoordinates(Vector1)
10418 v=self.VectorCoordinates(Vector2)
10419 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10424 ## Get summarized length of all wires,
10425 # area of surface and volume of the given shape.
10426 # @param theShape Shape to define properties of.
10427 # @return [theLength, theSurfArea, theVolume]\n
10428 # theLength: Summarized length of all wires of the given shape.\n
10429 # theSurfArea: Area of surface of the given shape.\n
10430 # theVolume: Volume of the given shape.
10432 # @ref tui_basic_properties_page "Example"
10433 @ManageTransactions("MeasuOp")
10434 def BasicProperties(self,theShape):
10436 Get summarized length of all wires,
10437 area of surface and volume of the given shape.
10440 theShape Shape to define properties of.
10443 [theLength, theSurfArea, theVolume]
10444 theLength: Summarized length of all wires of the given shape.
10445 theSurfArea: Area of surface of the given shape.
10446 theVolume: Volume of the given shape.
10448 # Example: see GEOM_TestMeasures.py
10449 aTuple = self.MeasuOp.GetBasicProperties(theShape)
10450 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10453 ## Get parameters of bounding box of the given shape
10454 # @param theShape Shape to obtain bounding box of.
10455 # @param precise TRUE for precise computation; FALSE for fast one.
10456 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10457 # Xmin,Xmax: Limits of shape along OX axis.
10458 # Ymin,Ymax: Limits of shape along OY axis.
10459 # Zmin,Zmax: Limits of shape along OZ axis.
10461 # @ref tui_bounding_box_page "Example"
10462 @ManageTransactions("MeasuOp")
10463 def BoundingBox (self, theShape, precise=False):
10465 Get parameters of bounding box of the given shape
10468 theShape Shape to obtain bounding box of.
10469 precise TRUE for precise computation; FALSE for fast one.
10472 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10473 Xmin,Xmax: Limits of shape along OX axis.
10474 Ymin,Ymax: Limits of shape along OY axis.
10475 Zmin,Zmax: Limits of shape along OZ axis.
10477 # Example: see GEOM_TestMeasures.py
10478 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10479 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10482 ## Get bounding box of the given shape
10483 # @param theShape Shape to obtain bounding box of.
10484 # @param precise TRUE for precise computation; FALSE for fast one.
10485 # @param theName Object name; when specified, this parameter is used
10486 # for result publication in the study. Otherwise, if automatic
10487 # publication is switched on, default value is used for result name.
10489 # @return New GEOM.GEOM_Object, containing the created box.
10491 # @ref tui_bounding_box_page "Example"
10492 @ManageTransactions("MeasuOp")
10493 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10495 Get bounding box of the given shape
10498 theShape Shape to obtain bounding box of.
10499 precise TRUE for precise computation; FALSE for fast one.
10500 theName Object name; when specified, this parameter is used
10501 for result publication in the study. Otherwise, if automatic
10502 publication is switched on, default value is used for result name.
10505 New GEOM.GEOM_Object, containing the created box.
10507 # Example: see GEOM_TestMeasures.py
10508 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10509 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10510 self._autoPublish(anObj, theName, "bndbox")
10513 ## Get inertia matrix and moments of inertia of theShape.
10514 # @param theShape Shape to calculate inertia of.
10515 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10516 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10517 # Ix,Iy,Iz: Moments of inertia of the given shape.
10519 # @ref tui_inertia_page "Example"
10520 @ManageTransactions("MeasuOp")
10521 def Inertia(self,theShape):
10523 Get inertia matrix and moments of inertia of theShape.
10526 theShape Shape to calculate inertia of.
10529 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10530 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10531 Ix,Iy,Iz: Moments of inertia of the given shape.
10533 # Example: see GEOM_TestMeasures.py
10534 aTuple = self.MeasuOp.GetInertia(theShape)
10535 RaiseIfFailed("GetInertia", self.MeasuOp)
10538 ## Get if coords are included in the shape (ST_IN or ST_ON)
10539 # @param theShape Shape
10540 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10541 # @param tolerance to be used (default is 1.0e-7)
10542 # @return list_of_boolean = [res1, res2, ...]
10543 @ManageTransactions("MeasuOp")
10544 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10546 Get if coords are included in the shape (ST_IN or ST_ON)
10550 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10551 tolerance to be used (default is 1.0e-7)
10554 list_of_boolean = [res1, res2, ...]
10556 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10558 ## Get minimal distance between the given shapes.
10559 # @param theShape1,theShape2 Shapes to find minimal distance between.
10560 # @return Value of the minimal distance between the given shapes.
10562 # @ref tui_min_distance_page "Example"
10563 @ManageTransactions("MeasuOp")
10564 def MinDistance(self, theShape1, theShape2):
10566 Get minimal distance between the given shapes.
10569 theShape1,theShape2 Shapes to find minimal distance between.
10572 Value of the minimal distance between the given shapes.
10574 # Example: see GEOM_TestMeasures.py
10575 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10576 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10579 ## Get minimal distance between the given shapes.
10580 # @param theShape1,theShape2 Shapes to find minimal distance between.
10581 # @return Value of the minimal distance between the given shapes, in form of list
10582 # [Distance, DX, DY, DZ].
10584 # @ref tui_min_distance_page "Example"
10585 @ManageTransactions("MeasuOp")
10586 def MinDistanceComponents(self, theShape1, theShape2):
10588 Get minimal distance between the given shapes.
10591 theShape1,theShape2 Shapes to find minimal distance between.
10594 Value of the minimal distance between the given shapes, in form of list
10595 [Distance, DX, DY, DZ]
10597 # Example: see GEOM_TestMeasures.py
10598 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10599 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10600 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10603 ## Get closest points of the given shapes.
10604 # @param theShape1,theShape2 Shapes to find closest points of.
10605 # @return The number of found solutions (-1 in case of infinite number of
10606 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10608 # @ref tui_min_distance_page "Example"
10609 @ManageTransactions("MeasuOp")
10610 def ClosestPoints (self, theShape1, theShape2):
10612 Get closest points of the given shapes.
10615 theShape1,theShape2 Shapes to find closest points of.
10618 The number of found solutions (-1 in case of infinite number of
10619 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10621 # Example: see GEOM_TestMeasures.py
10622 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10623 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10626 ## Get angle between the given shapes in degrees.
10627 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10628 # @note If both arguments are vectors, the angle is computed in accordance
10629 # with their orientations, otherwise the minimum angle is computed.
10630 # @return Value of the angle between the given shapes in degrees.
10632 # @ref tui_angle_page "Example"
10633 @ManageTransactions("MeasuOp")
10634 def GetAngle(self, theShape1, theShape2):
10636 Get angle between the given shapes in degrees.
10639 theShape1,theShape2 Lines or linear edges to find angle between.
10642 If both arguments are vectors, the angle is computed in accordance
10643 with their orientations, otherwise the minimum angle is computed.
10646 Value of the angle between the given shapes in degrees.
10648 # Example: see GEOM_TestMeasures.py
10649 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10650 RaiseIfFailed("GetAngle", self.MeasuOp)
10653 ## Get angle between the given shapes in radians.
10654 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10655 # @note If both arguments are vectors, the angle is computed in accordance
10656 # with their orientations, otherwise the minimum angle is computed.
10657 # @return Value of the angle between the given shapes in radians.
10659 # @ref tui_angle_page "Example"
10660 @ManageTransactions("MeasuOp")
10661 def GetAngleRadians(self, theShape1, theShape2):
10663 Get angle between the given shapes in radians.
10666 theShape1,theShape2 Lines or linear edges to find angle between.
10670 If both arguments are vectors, the angle is computed in accordance
10671 with their orientations, otherwise the minimum angle is computed.
10674 Value of the angle between the given shapes in radians.
10676 # Example: see GEOM_TestMeasures.py
10677 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10678 RaiseIfFailed("GetAngle", self.MeasuOp)
10681 ## Get angle between the given vectors in degrees.
10682 # @param theShape1,theShape2 Vectors to find angle between.
10683 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10684 # if False, the opposite vector to the normal vector is used.
10685 # @return Value of the angle between the given vectors in degrees.
10687 # @ref tui_angle_page "Example"
10688 @ManageTransactions("MeasuOp")
10689 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10691 Get angle between the given vectors in degrees.
10694 theShape1,theShape2 Vectors to find angle between.
10695 theFlag If True, the normal vector is defined by the two vectors cross,
10696 if False, the opposite vector to the normal vector is used.
10699 Value of the angle between the given vectors in degrees.
10701 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10703 anAngle = 360. - anAngle
10704 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10707 ## The same as GetAngleVectors, but the result is in radians.
10708 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10710 Get angle between the given vectors in radians.
10713 theShape1,theShape2 Vectors to find angle between.
10714 theFlag If True, the normal vector is defined by the two vectors cross,
10715 if False, the opposite vector to the normal vector is used.
10718 Value of the angle between the given vectors in radians.
10720 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10723 ## @name Curve Curvature Measurement
10724 # Methods for receiving radius of curvature of curves
10725 # in the given point
10728 ## Measure curvature of a curve at a point, set by parameter.
10729 # @param theCurve a curve.
10730 # @param theParam parameter.
10731 # @return radius of curvature of \a theCurve.
10733 # @ref swig_todo "Example"
10734 @ManageTransactions("MeasuOp")
10735 def CurveCurvatureByParam(self, theCurve, theParam):
10737 Measure curvature of a curve at a point, set by parameter.
10741 theParam parameter.
10744 radius of curvature of theCurve.
10746 # Example: see GEOM_TestMeasures.py
10747 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10748 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10751 ## Measure curvature of a curve at a point.
10752 # @param theCurve a curve.
10753 # @param thePoint given point.
10754 # @return radius of curvature of \a theCurve.
10756 # @ref swig_todo "Example"
10757 @ManageTransactions("MeasuOp")
10758 def CurveCurvatureByPoint(self, theCurve, thePoint):
10760 Measure curvature of a curve at a point.
10764 thePoint given point.
10767 radius of curvature of theCurve.
10769 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10770 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10774 ## @name Surface Curvature Measurement
10775 # Methods for receiving max and min radius of curvature of surfaces
10776 # in the given point
10779 ## Measure max radius of curvature of surface.
10780 # @param theSurf the given surface.
10781 # @param theUParam Value of U-parameter on the referenced surface.
10782 # @param theVParam Value of V-parameter on the referenced surface.
10783 # @return max radius of curvature of theSurf.
10785 ## @ref swig_todo "Example"
10786 @ManageTransactions("MeasuOp")
10787 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10789 Measure max radius of curvature of surface.
10792 theSurf the given surface.
10793 theUParam Value of U-parameter on the referenced surface.
10794 theVParam Value of V-parameter on the referenced surface.
10797 max radius of curvature of theSurf.
10799 # Example: see GEOM_TestMeasures.py
10800 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10801 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10804 ## Measure max radius of curvature of surface in the given point
10805 # @param theSurf the given surface.
10806 # @param thePoint given point.
10807 # @return max radius of curvature of theSurf.
10809 ## @ref swig_todo "Example"
10810 @ManageTransactions("MeasuOp")
10811 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10813 Measure max radius of curvature of surface in the given point.
10816 theSurf the given surface.
10817 thePoint given point.
10820 max radius of curvature of theSurf.
10822 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10823 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10826 ## Measure min radius of curvature of surface.
10827 # @param theSurf the given surface.
10828 # @param theUParam Value of U-parameter on the referenced surface.
10829 # @param theVParam Value of V-parameter on the referenced surface.
10830 # @return min radius of curvature of theSurf.
10832 ## @ref swig_todo "Example"
10833 @ManageTransactions("MeasuOp")
10834 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10836 Measure min radius of curvature of surface.
10839 theSurf the given surface.
10840 theUParam Value of U-parameter on the referenced surface.
10841 theVParam Value of V-parameter on the referenced surface.
10844 Min radius of curvature of theSurf.
10846 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10847 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10850 ## Measure min radius of curvature of surface in the given point
10851 # @param theSurf the given surface.
10852 # @param thePoint given point.
10853 # @return min radius of curvature of theSurf.
10855 ## @ref swig_todo "Example"
10856 @ManageTransactions("MeasuOp")
10857 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10859 Measure min radius of curvature of surface in the given point.
10862 theSurf the given surface.
10863 thePoint given point.
10866 Min radius of curvature of theSurf.
10868 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10869 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10873 ## Get min and max tolerances of sub-shapes of theShape
10874 # @param theShape Shape, to get tolerances of.
10875 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10876 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10877 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10878 # VertMin,VertMax: Min and max tolerances of the vertices.
10880 # @ref tui_tolerance_page "Example"
10881 @ManageTransactions("MeasuOp")
10882 def Tolerance(self,theShape):
10884 Get min and max tolerances of sub-shapes of theShape
10887 theShape Shape, to get tolerances of.
10890 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10891 FaceMin,FaceMax: Min and max tolerances of the faces.
10892 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10893 VertMin,VertMax: Min and max tolerances of the vertices.
10895 # Example: see GEOM_TestMeasures.py
10896 aTuple = self.MeasuOp.GetTolerance(theShape)
10897 RaiseIfFailed("GetTolerance", self.MeasuOp)
10900 ## Obtain description of the given shape (number of sub-shapes of each type)
10901 # @param theShape Shape to be described.
10902 # @return Description of the given shape.
10904 # @ref tui_whatis_page "Example"
10905 @ManageTransactions("MeasuOp")
10906 def WhatIs(self,theShape):
10908 Obtain description of the given shape (number of sub-shapes of each type)
10911 theShape Shape to be described.
10914 Description of the given shape.
10916 # Example: see GEOM_TestMeasures.py
10917 aDescr = self.MeasuOp.WhatIs(theShape)
10918 RaiseIfFailed("WhatIs", self.MeasuOp)
10921 ## Obtain quantity of shapes of the given type in \a theShape.
10922 # If \a theShape is of type \a theType, it is also counted.
10923 # @param theShape Shape to be described.
10924 # @param theType the given ShapeType().
10925 # @return Quantity of shapes of type \a theType in \a theShape.
10927 # @ref tui_measurement_tools_page "Example"
10928 def NbShapes (self, theShape, theType):
10930 Obtain quantity of shapes of the given type in theShape.
10931 If theShape is of type theType, it is also counted.
10934 theShape Shape to be described.
10935 theType the given geompy.ShapeType
10938 Quantity of shapes of type theType in theShape.
10940 # Example: see GEOM_TestMeasures.py
10941 listSh = self.SubShapeAllIDs(theShape, theType)
10945 ## Obtain quantity of shapes of each type in \a theShape.
10946 # The \a theShape is also counted.
10947 # @param theShape Shape to be described.
10948 # @return Dictionary of ShapeType() with bound quantities of shapes.
10950 # @ref tui_measurement_tools_page "Example"
10951 def ShapeInfo (self, theShape):
10953 Obtain quantity of shapes of each type in theShape.
10954 The theShape is also counted.
10957 theShape Shape to be described.
10960 Dictionary of geompy.ShapeType with bound quantities of shapes.
10962 # Example: see GEOM_TestMeasures.py
10964 for typeSh in self.ShapeType:
10965 if typeSh in ( "AUTO", "SHAPE" ): continue
10966 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10972 def GetCreationInformation(self, theShape):
10974 infos = theShape.GetCreationInformation()
10977 opName = info.operationName
10978 if not opName: opName = "no info available"
10979 if res: res += "\n"
10980 res += "Operation: " + opName
10982 for parVal in info.params:
10983 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
10986 ## Get a point, situated at the centre of mass of theShape.
10987 # @param theShape Shape to define centre of mass of.
10988 # @param theName Object name; when specified, this parameter is used
10989 # for result publication in the study. Otherwise, if automatic
10990 # publication is switched on, default value is used for result name.
10992 # @return New GEOM.GEOM_Object, containing the created point.
10994 # @ref tui_center_of_mass_page "Example"
10995 @ManageTransactions("MeasuOp")
10996 def MakeCDG(self, theShape, theName=None):
10998 Get a point, situated at the centre of mass of theShape.
11001 theShape Shape to define centre of mass of.
11002 theName Object name; when specified, this parameter is used
11003 for result publication in the study. Otherwise, if automatic
11004 publication is switched on, default value is used for result name.
11007 New GEOM.GEOM_Object, containing the created point.
11009 # Example: see GEOM_TestMeasures.py
11010 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11011 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11012 self._autoPublish(anObj, theName, "centerOfMass")
11015 ## Get a vertex sub-shape by index depended with orientation.
11016 # @param theShape Shape to find sub-shape.
11017 # @param theIndex Index to find vertex by this index (starting from zero)
11018 # @param theName Object name; when specified, this parameter is used
11019 # for result publication in the study. Otherwise, if automatic
11020 # publication is switched on, default value is used for result name.
11022 # @return New GEOM.GEOM_Object, containing the created vertex.
11024 # @ref tui_measurement_tools_page "Example"
11025 @ManageTransactions("MeasuOp")
11026 def GetVertexByIndex(self, theShape, theIndex, theName=None):
11028 Get a vertex sub-shape by index depended with orientation.
11031 theShape Shape to find sub-shape.
11032 theIndex Index to find vertex by this index (starting from zero)
11033 theName Object name; when specified, this parameter is used
11034 for result publication in the study. Otherwise, if automatic
11035 publication is switched on, default value is used for result name.
11038 New GEOM.GEOM_Object, containing the created vertex.
11040 # Example: see GEOM_TestMeasures.py
11041 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
11042 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11043 self._autoPublish(anObj, theName, "vertex")
11046 ## Get the first vertex of wire/edge depended orientation.
11047 # @param theShape Shape to find first vertex.
11048 # @param theName Object name; when specified, this parameter is used
11049 # for result publication in the study. Otherwise, if automatic
11050 # publication is switched on, default value is used for result name.
11052 # @return New GEOM.GEOM_Object, containing the created vertex.
11054 # @ref tui_measurement_tools_page "Example"
11055 def GetFirstVertex(self, theShape, theName=None):
11057 Get the first vertex of wire/edge depended orientation.
11060 theShape Shape to find first vertex.
11061 theName Object name; when specified, this parameter is used
11062 for result publication in the study. Otherwise, if automatic
11063 publication is switched on, default value is used for result name.
11066 New GEOM.GEOM_Object, containing the created vertex.
11068 # Example: see GEOM_TestMeasures.py
11069 # note: auto-publishing is done in self.GetVertexByIndex()
11070 return self.GetVertexByIndex(theShape, 0, theName)
11072 ## Get the last vertex of wire/edge depended orientation.
11073 # @param theShape Shape to find last vertex.
11074 # @param theName Object name; when specified, this parameter is used
11075 # for result publication in the study. Otherwise, if automatic
11076 # publication is switched on, default value is used for result name.
11078 # @return New GEOM.GEOM_Object, containing the created vertex.
11080 # @ref tui_measurement_tools_page "Example"
11081 def GetLastVertex(self, theShape, theName=None):
11083 Get the last vertex of wire/edge depended orientation.
11086 theShape Shape to find last vertex.
11087 theName Object name; when specified, this parameter is used
11088 for result publication in the study. Otherwise, if automatic
11089 publication is switched on, default value is used for result name.
11092 New GEOM.GEOM_Object, containing the created vertex.
11094 # Example: see GEOM_TestMeasures.py
11095 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11096 # note: auto-publishing is done in self.GetVertexByIndex()
11097 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
11099 ## Get a normale to the given face. If the point is not given,
11100 # the normale is calculated at the center of mass.
11101 # @param theFace Face to define normale of.
11102 # @param theOptionalPoint Point to compute the normale at.
11103 # @param theName Object name; when specified, this parameter is used
11104 # for result publication in the study. Otherwise, if automatic
11105 # publication is switched on, default value is used for result name.
11107 # @return New GEOM.GEOM_Object, containing the created vector.
11109 # @ref swig_todo "Example"
11110 @ManageTransactions("MeasuOp")
11111 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11113 Get a normale to the given face. If the point is not given,
11114 the normale is calculated at the center of mass.
11117 theFace Face to define normale of.
11118 theOptionalPoint Point to compute the normale at.
11119 theName Object name; when specified, this parameter is used
11120 for result publication in the study. Otherwise, if automatic
11121 publication is switched on, default value is used for result name.
11124 New GEOM.GEOM_Object, containing the created vector.
11126 # Example: see GEOM_TestMeasures.py
11127 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11128 RaiseIfFailed("GetNormal", self.MeasuOp)
11129 self._autoPublish(anObj, theName, "normal")
11132 ## Print shape errors obtained from CheckShape.
11133 # @param theShape Shape that was checked.
11134 # @param theShapeErrors the shape errors obtained by CheckShape.
11135 # @param theReturnStatus If 0 the description of problem is printed.
11136 # If 1 the description of problem is returned.
11137 # @return If theReturnStatus is equal to 1 the description is returned.
11138 # Otherwise doesn't return anything.
11140 # @ref tui_check_shape_page "Example"
11141 @ManageTransactions("MeasuOp")
11142 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11144 Print shape errors obtained from CheckShape.
11147 theShape Shape that was checked.
11148 theShapeErrors the shape errors obtained by CheckShape.
11149 theReturnStatus If 0 the description of problem is printed.
11150 If 1 the description of problem is returned.
11153 If theReturnStatus is equal to 1 the description is returned.
11154 Otherwise doesn't return anything.
11156 # Example: see GEOM_TestMeasures.py
11157 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11158 if theReturnStatus == 1:
11163 ## Check a topology of the given shape.
11164 # @param theShape Shape to check validity of.
11165 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11166 # if TRUE, the shape's geometry will be checked also.
11167 # @param theReturnStatus If 0 and if theShape is invalid, a description
11168 # of problem is printed.
11169 # If 1 isValid flag and the description of
11170 # problem is returned.
11171 # If 2 isValid flag and the list of error data
11173 # @return TRUE, if the shape "seems to be valid".
11174 # If theShape is invalid, prints a description of problem.
11175 # If theReturnStatus is equal to 1 the description is returned
11176 # along with IsValid flag.
11177 # If theReturnStatus is equal to 2 the list of error data is
11178 # returned along with IsValid flag.
11180 # @ref tui_check_shape_page "Example"
11181 @ManageTransactions("MeasuOp")
11182 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11184 Check a topology of the given shape.
11187 theShape Shape to check validity of.
11188 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11189 if TRUE, the shape's geometry will be checked also.
11190 theReturnStatus If 0 and if theShape is invalid, a description
11191 of problem is printed.
11192 If 1 IsValid flag and the description of
11193 problem is returned.
11194 If 2 IsValid flag and the list of error data
11198 TRUE, if the shape "seems to be valid".
11199 If theShape is invalid, prints a description of problem.
11200 If theReturnStatus is equal to 1 the description is returned
11201 along with IsValid flag.
11202 If theReturnStatus is equal to 2 the list of error data is
11203 returned along with IsValid flag.
11205 # Example: see GEOM_TestMeasures.py
11207 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11208 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11210 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11211 RaiseIfFailed("CheckShape", self.MeasuOp)
11213 if theReturnStatus == 0:
11214 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11216 if theReturnStatus == 1:
11217 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11218 return (IsValid, Descr)
11219 elif theReturnStatus == 2:
11220 return (IsValid, ShapeErrors)
11223 ## Detect self-intersections in the given shape.
11224 # @param theShape Shape to check.
11225 # @param theCheckLevel is the level of self-intersection check.
11226 # Possible input values are:
11227 # - GEOM.SI_V_V(0) - only V/V interferences
11228 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11229 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11230 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11231 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11232 # - GEOM.SI_ALL(5) - all interferences.
11233 # @return TRUE, if the shape contains no self-intersections.
11235 # @ref tui_check_self_intersections_page "Example"
11236 @ManageTransactions("MeasuOp")
11237 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11239 Detect self-intersections in the given shape.
11242 theShape Shape to check.
11243 theCheckLevel is the level of self-intersection check.
11244 Possible input values are:
11245 - GEOM.SI_V_V(0) - only V/V interferences
11246 - GEOM.SI_V_E(1) - V/V and V/E interferences
11247 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11248 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11249 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11250 - GEOM.SI_ALL(5) - all interferences.
11253 TRUE, if the shape contains no self-intersections.
11255 # Example: see GEOM_TestMeasures.py
11256 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11257 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11260 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11261 # @param theShape1 First source object
11262 # @param theShape2 Second source object
11263 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11264 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11265 # - if \a theTolerance > 0, algorithm detects gaps
11266 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
11267 # - if \a theDeflection <= 0, default deflection 0.001 is used
11268 # @return TRUE, if there are intersections (gaps) between source shapes
11269 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11270 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11272 # @ref tui_fast_intersection_page "Example"
11273 @ManageTransactions("MeasuOp")
11274 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11276 Detect intersections of the given shapes with algorithm based on mesh intersections.
11279 theShape1 First source object
11280 theShape2 Second source object
11281 theTolerance Specifies a distance between shapes used for detecting gaps:
11282 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11283 - if theTolerance > 0, algorithm detects gaps
11284 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11285 - if theDeflection <= 0, default deflection 0.001 is used
11288 TRUE, if there are intersections (gaps) between source shapes
11289 List of sub-shapes IDs from 1st shape that localize intersection.
11290 List of sub-shapes IDs from 2nd shape that localize intersection.
11292 # Example: see GEOM_TestMeasures.py
11293 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11294 RaiseIfFailed("FastIntersect", self.MeasuOp)
11295 return IsOk, Res1, Res2
11297 ## Get position (LCS) of theShape.
11299 # Origin of the LCS is situated at the shape's center of mass.
11300 # Axes of the LCS are obtained from shape's location or,
11301 # if the shape is a planar face, from position of its plane.
11303 # @param theShape Shape to calculate position of.
11304 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11305 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11306 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11307 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11309 # @ref swig_todo "Example"
11310 @ManageTransactions("MeasuOp")
11311 def GetPosition(self,theShape):
11313 Get position (LCS) of theShape.
11314 Origin of the LCS is situated at the shape's center of mass.
11315 Axes of the LCS are obtained from shape's location or,
11316 if the shape is a planar face, from position of its plane.
11319 theShape Shape to calculate position of.
11322 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11323 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11324 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11325 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11327 # Example: see GEOM_TestMeasures.py
11328 aTuple = self.MeasuOp.GetPosition(theShape)
11329 RaiseIfFailed("GetPosition", self.MeasuOp)
11332 ## Get kind of theShape.
11334 # @param theShape Shape to get a kind of.
11335 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11336 # and a list of parameters, describing the shape.
11337 # @note Concrete meaning of each value, returned via \a theIntegers
11338 # or \a theDoubles list depends on the kind() of the shape.
11340 # @ref swig_todo "Example"
11341 @ManageTransactions("MeasuOp")
11342 def KindOfShape(self,theShape):
11344 Get kind of theShape.
11347 theShape Shape to get a kind of.
11350 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11351 and a list of parameters, describing the shape.
11353 Concrete meaning of each value, returned via theIntegers
11354 or theDoubles list depends on the geompy.kind of the shape
11356 # Example: see GEOM_TestMeasures.py
11357 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11358 RaiseIfFailed("KindOfShape", self.MeasuOp)
11360 aKind = aRoughTuple[0]
11361 anInts = aRoughTuple[1]
11362 aDbls = aRoughTuple[2]
11364 # Now there is no exception from this rule:
11365 aKindTuple = [aKind] + aDbls + anInts
11367 # If they are we will regroup parameters for such kind of shape.
11369 #if aKind == kind.SOME_KIND:
11370 # # SOME_KIND int int double int double double
11371 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11375 ## Returns the string that describes if the shell is good for solid.
11376 # This is a support method for MakeSolid.
11378 # @param theShell the shell to be checked.
11379 # @return Returns a string that describes the shell validity for
11380 # solid construction.
11381 @ManageTransactions("MeasuOp")
11382 def _IsGoodForSolid(self, theShell):
11384 Returns the string that describes if the shell is good for solid.
11385 This is a support method for MakeSolid.
11388 theShell the shell to be checked.
11391 Returns a string that describes the shell validity for
11392 solid construction.
11394 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11397 # end of l2_measure
11400 ## @addtogroup l2_import_export
11403 ## Import a shape from the BREP, IGES, STEP or other file
11404 # (depends on given format) with given name.
11406 # Note: this function is deprecated, it is kept for backward compatibility only
11407 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11409 # @param theFileName The file, containing the shape.
11410 # @param theFormatName Specify format for the file reading.
11411 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11412 # If format 'IGES_SCALE' is used instead of 'IGES' or
11413 # format 'STEP_SCALE' is used instead of 'STEP',
11414 # length unit will be set to 'meter' and result model will be scaled.
11415 # @param theName Object name; when specified, this parameter is used
11416 # for result publication in the study. Otherwise, if automatic
11417 # publication is switched on, default value is used for result name.
11419 # @return New GEOM.GEOM_Object, containing the imported shape.
11420 # If material names are imported it returns the list of
11421 # objects. The first one is the imported object followed by
11423 # @note Auto publishing is allowed for the shape itself. Imported
11424 # material groups are not automatically published.
11426 # @ref swig_Import_Export "Example"
11427 @ManageTransactions("InsertOp")
11428 def ImportFile(self, theFileName, theFormatName, theName=None):
11430 Import a shape from the BREP, IGES, STEP or other file
11431 (depends on given format) with given name.
11433 Note: this function is deprecated, it is kept for backward compatibility only
11434 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11437 theFileName The file, containing the shape.
11438 theFormatName Specify format for the file reading.
11439 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11440 If format 'IGES_SCALE' is used instead of 'IGES' or
11441 format 'STEP_SCALE' is used instead of 'STEP',
11442 length unit will be set to 'meter' and result model will be scaled.
11443 theName Object name; when specified, this parameter is used
11444 for result publication in the study. Otherwise, if automatic
11445 publication is switched on, default value is used for result name.
11448 New GEOM.GEOM_Object, containing the imported shape.
11449 If material names are imported it returns the list of
11450 objects. The first one is the imported object followed by
11453 Auto publishing is allowed for the shape itself. Imported
11454 material groups are not automatically published.
11456 # Example: see GEOM_TestOthers.py
11458 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11459 where <FormatName> is a name of desirable format for importing.
11461 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11462 RaiseIfFailed("ImportFile", self.InsertOp)
11463 aNbObj = len(aListObj)
11465 self._autoPublish(aListObj[0], theName, "imported")
11470 ## Deprecated analog of ImportFile()
11471 def Import(self, theFileName, theFormatName, theName=None):
11473 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11475 # note: auto-publishing is done in self.ImportFile()
11476 return self.ImportFile(theFileName, theFormatName, theName)
11478 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11479 # @note This method will not be dumped to the python script by DumpStudy functionality.
11480 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
11481 # @param theStream The BRep binary stream.
11482 # @param theName Object name; when specified, this parameter is used
11483 # for result publication in the study. Otherwise, if automatic
11484 # publication is switched on, default value is used for result name.
11486 # @return New GEOM_Object, containing the shape, read from theStream.
11488 # @ref swig_Import_Export "Example"
11489 @ManageTransactions("InsertOp")
11490 def RestoreShape (self, theStream, theName=None):
11492 Read a shape from the binary stream, containing its bounding representation (BRep).
11495 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11498 theStream The BRep binary stream.
11499 theName Object name; when specified, this parameter is used
11500 for result publication in the study. Otherwise, if automatic
11501 publication is switched on, default value is used for result name.
11504 New GEOM_Object, containing the shape, read from theStream.
11506 # Example: see GEOM_TestOthers.py
11507 anObj = self.InsertOp.RestoreShape(theStream)
11508 RaiseIfFailed("RestoreShape", self.InsertOp)
11509 self._autoPublish(anObj, theName, "restored")
11512 ## Export the given shape into a file with given name.
11514 # Note: this function is deprecated, it is kept for backward compatibility only
11515 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11517 # @param theObject Shape to be stored in the file.
11518 # @param theFileName Name of the file to store the given shape in.
11519 # @param theFormatName Specify format for the shape storage.
11520 # Available formats can be obtained with
11521 # geompy.InsertOp.ExportTranslators()[0] method.
11523 # @ref swig_Import_Export "Example"
11524 @ManageTransactions("InsertOp")
11525 def Export(self, theObject, theFileName, theFormatName):
11527 Export the given shape into a file with given name.
11529 Note: this function is deprecated, it is kept for backward compatibility only
11530 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11533 theObject Shape to be stored in the file.
11534 theFileName Name of the file to store the given shape in.
11535 theFormatName Specify format for the shape storage.
11536 Available formats can be obtained with
11537 geompy.InsertOp.ExportTranslators()[0] method.
11539 # Example: see GEOM_TestOthers.py
11541 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11542 where <FormatName> is a name of desirable format for exporting.
11544 self.InsertOp.Export(theObject, theFileName, theFormatName)
11545 if self.InsertOp.IsDone() == 0:
11546 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
11550 # end of l2_import_export
11553 ## @addtogroup l3_blocks
11556 ## Create a quadrangle face from four edges. Order of Edges is not
11557 # important. It is not necessary that edges share the same vertex.
11558 # @param E1,E2,E3,E4 Edges for the face bound.
11559 # @param theName Object name; when specified, this parameter is used
11560 # for result publication in the study. Otherwise, if automatic
11561 # publication is switched on, default value is used for result name.
11563 # @return New GEOM.GEOM_Object, containing the created face.
11565 # @ref tui_building_by_blocks_page "Example"
11566 @ManageTransactions("BlocksOp")
11567 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11569 Create a quadrangle face from four edges. Order of Edges is not
11570 important. It is not necessary that edges share the same vertex.
11573 E1,E2,E3,E4 Edges for the face bound.
11574 theName Object name; when specified, this parameter is used
11575 for result publication in the study. Otherwise, if automatic
11576 publication is switched on, default value is used for result name.
11579 New GEOM.GEOM_Object, containing the created face.
11582 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11584 # Example: see GEOM_Spanner.py
11585 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11586 RaiseIfFailed("MakeQuad", self.BlocksOp)
11587 self._autoPublish(anObj, theName, "quad")
11590 ## Create a quadrangle face on two edges.
11591 # The missing edges will be built by creating the shortest ones.
11592 # @param E1,E2 Two opposite edges for the face.
11593 # @param theName Object name; when specified, this parameter is used
11594 # for result publication in the study. Otherwise, if automatic
11595 # publication is switched on, default value is used for result name.
11597 # @return New GEOM.GEOM_Object, containing the created face.
11599 # @ref tui_building_by_blocks_page "Example"
11600 @ManageTransactions("BlocksOp")
11601 def MakeQuad2Edges(self, E1, E2, theName=None):
11603 Create a quadrangle face on two edges.
11604 The missing edges will be built by creating the shortest ones.
11607 E1,E2 Two opposite edges for the face.
11608 theName Object name; when specified, this parameter is used
11609 for result publication in the study. Otherwise, if automatic
11610 publication is switched on, default value is used for result name.
11613 New GEOM.GEOM_Object, containing the created face.
11617 p1 = geompy.MakeVertex( 0., 0., 0.)
11618 p2 = geompy.MakeVertex(150., 30., 0.)
11619 p3 = geompy.MakeVertex( 0., 120., 50.)
11620 p4 = geompy.MakeVertex( 0., 40., 70.)
11622 edge1 = geompy.MakeEdge(p1, p2)
11623 edge2 = geompy.MakeEdge(p3, p4)
11624 # create a quadrangle face from two edges
11625 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11627 # Example: see GEOM_Spanner.py
11628 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11629 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11630 self._autoPublish(anObj, theName, "quad")
11633 ## Create a quadrangle face with specified corners.
11634 # The missing edges will be built by creating the shortest ones.
11635 # @param V1,V2,V3,V4 Corner vertices for the face.
11636 # @param theName Object name; when specified, this parameter is used
11637 # for result publication in the study. Otherwise, if automatic
11638 # publication is switched on, default value is used for result name.
11640 # @return New GEOM.GEOM_Object, containing the created face.
11642 # @ref tui_building_by_blocks_page "Example 1"
11643 # \n @ref swig_MakeQuad4Vertices "Example 2"
11644 @ManageTransactions("BlocksOp")
11645 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11647 Create a quadrangle face with specified corners.
11648 The missing edges will be built by creating the shortest ones.
11651 V1,V2,V3,V4 Corner vertices for the face.
11652 theName Object name; when specified, this parameter is used
11653 for result publication in the study. Otherwise, if automatic
11654 publication is switched on, default value is used for result name.
11657 New GEOM.GEOM_Object, containing the created face.
11661 p1 = geompy.MakeVertex( 0., 0., 0.)
11662 p2 = geompy.MakeVertex(150., 30., 0.)
11663 p3 = geompy.MakeVertex( 0., 120., 50.)
11664 p4 = geompy.MakeVertex( 0., 40., 70.)
11665 # create a quadrangle from four points in its corners
11666 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11668 # Example: see GEOM_Spanner.py
11669 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11670 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11671 self._autoPublish(anObj, theName, "quad")
11674 ## Create a hexahedral solid, bounded by the six given faces. Order of
11675 # faces is not important. It is not necessary that Faces share the same edge.
11676 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11677 # @param theName Object name; when specified, this parameter is used
11678 # for result publication in the study. Otherwise, if automatic
11679 # publication is switched on, default value is used for result name.
11681 # @return New GEOM.GEOM_Object, containing the created solid.
11683 # @ref tui_building_by_blocks_page "Example 1"
11684 # \n @ref swig_MakeHexa "Example 2"
11685 @ManageTransactions("BlocksOp")
11686 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11688 Create a hexahedral solid, bounded by the six given faces. Order of
11689 faces is not important. It is not necessary that Faces share the same edge.
11692 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11693 theName Object name; when specified, this parameter is used
11694 for result publication in the study. Otherwise, if automatic
11695 publication is switched on, default value is used for result name.
11698 New GEOM.GEOM_Object, containing the created solid.
11701 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11703 # Example: see GEOM_Spanner.py
11704 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11705 RaiseIfFailed("MakeHexa", self.BlocksOp)
11706 self._autoPublish(anObj, theName, "hexa")
11709 ## Create a hexahedral solid between two given faces.
11710 # The missing faces will be built by creating the smallest ones.
11711 # @param F1,F2 Two opposite faces for the hexahedral solid.
11712 # @param theName Object name; when specified, this parameter is used
11713 # for result publication in the study. Otherwise, if automatic
11714 # publication is switched on, default value is used for result name.
11716 # @return New GEOM.GEOM_Object, containing the created solid.
11718 # @ref tui_building_by_blocks_page "Example 1"
11719 # \n @ref swig_MakeHexa2Faces "Example 2"
11720 @ManageTransactions("BlocksOp")
11721 def MakeHexa2Faces(self, F1, F2, theName=None):
11723 Create a hexahedral solid between two given faces.
11724 The missing faces will be built by creating the smallest ones.
11727 F1,F2 Two opposite faces for the hexahedral solid.
11728 theName Object name; when specified, this parameter is used
11729 for result publication in the study. Otherwise, if automatic
11730 publication is switched on, default value is used for result name.
11733 New GEOM.GEOM_Object, containing the created solid.
11736 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11738 # Example: see GEOM_Spanner.py
11739 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11740 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11741 self._autoPublish(anObj, theName, "hexa")
11747 ## @addtogroup l3_blocks_op
11750 ## Get a vertex, found in the given shape by its coordinates.
11751 # @param theShape Block or a compound of blocks.
11752 # @param theX,theY,theZ Coordinates of the sought vertex.
11753 # @param theEpsilon Maximum allowed distance between the resulting
11754 # vertex and point with the given coordinates.
11755 # @param theName Object name; when specified, this parameter is used
11756 # for result publication in the study. Otherwise, if automatic
11757 # publication is switched on, default value is used for result name.
11759 # @return New GEOM.GEOM_Object, containing the found vertex.
11761 # @ref swig_GetPoint "Example"
11762 @ManageTransactions("BlocksOp")
11763 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11765 Get a vertex, found in the given shape by its coordinates.
11768 theShape Block or a compound of blocks.
11769 theX,theY,theZ Coordinates of the sought vertex.
11770 theEpsilon Maximum allowed distance between the resulting
11771 vertex and point with the given coordinates.
11772 theName Object name; when specified, this parameter is used
11773 for result publication in the study. Otherwise, if automatic
11774 publication is switched on, default value is used for result name.
11777 New GEOM.GEOM_Object, containing the found vertex.
11780 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11782 # Example: see GEOM_TestOthers.py
11783 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11784 RaiseIfFailed("GetPoint", self.BlocksOp)
11785 self._autoPublish(anObj, theName, "vertex")
11788 ## Find a vertex of the given shape, which has minimal distance to the given point.
11789 # @param theShape Any shape.
11790 # @param thePoint Point, close to the desired vertex.
11791 # @param theName Object name; when specified, this parameter is used
11792 # for result publication in the study. Otherwise, if automatic
11793 # publication is switched on, default value is used for result name.
11795 # @return New GEOM.GEOM_Object, containing the found vertex.
11797 # @ref swig_GetVertexNearPoint "Example"
11798 @ManageTransactions("BlocksOp")
11799 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11801 Find a vertex of the given shape, which has minimal distance to the given point.
11804 theShape Any shape.
11805 thePoint Point, close to the desired vertex.
11806 theName Object name; when specified, this parameter is used
11807 for result publication in the study. Otherwise, if automatic
11808 publication is switched on, default value is used for result name.
11811 New GEOM.GEOM_Object, containing the found vertex.
11814 pmidle = geompy.MakeVertex(50, 0, 50)
11815 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11817 # Example: see GEOM_TestOthers.py
11818 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11819 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11820 self._autoPublish(anObj, theName, "vertex")
11823 ## Get an edge, found in the given shape by two given vertices.
11824 # @param theShape Block or a compound of blocks.
11825 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11826 # @param theName Object name; when specified, this parameter is used
11827 # for result publication in the study. Otherwise, if automatic
11828 # publication is switched on, default value is used for result name.
11830 # @return New GEOM.GEOM_Object, containing the found edge.
11832 # @ref swig_GetEdge "Example"
11833 @ManageTransactions("BlocksOp")
11834 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11836 Get an edge, found in the given shape by two given vertices.
11839 theShape Block or a compound of blocks.
11840 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11841 theName Object name; when specified, this parameter is used
11842 for result publication in the study. Otherwise, if automatic
11843 publication is switched on, default value is used for result name.
11846 New GEOM.GEOM_Object, containing the found edge.
11848 # Example: see GEOM_Spanner.py
11849 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11850 RaiseIfFailed("GetEdge", self.BlocksOp)
11851 self._autoPublish(anObj, theName, "edge")
11854 ## Find an edge of the given shape, which has minimal distance to the given point.
11855 # @param theShape Block or a compound of blocks.
11856 # @param thePoint Point, close to the desired edge.
11857 # @param theName Object name; when specified, this parameter is used
11858 # for result publication in the study. Otherwise, if automatic
11859 # publication is switched on, default value is used for result name.
11861 # @return New GEOM.GEOM_Object, containing the found edge.
11863 # @ref swig_GetEdgeNearPoint "Example"
11864 @ManageTransactions("BlocksOp")
11865 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11867 Find an edge of the given shape, which has minimal distance to the given point.
11870 theShape Block or a compound of blocks.
11871 thePoint Point, close to the desired edge.
11872 theName Object name; when specified, this parameter is used
11873 for result publication in the study. Otherwise, if automatic
11874 publication is switched on, default value is used for result name.
11877 New GEOM.GEOM_Object, containing the found edge.
11879 # Example: see GEOM_TestOthers.py
11880 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11881 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11882 self._autoPublish(anObj, theName, "edge")
11885 ## Returns a face, found in the given shape by four given corner vertices.
11886 # @param theShape Block or a compound of blocks.
11887 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11888 # @param theName Object name; when specified, this parameter is used
11889 # for result publication in the study. Otherwise, if automatic
11890 # publication is switched on, default value is used for result name.
11892 # @return New GEOM.GEOM_Object, containing the found face.
11894 # @ref swig_todo "Example"
11895 @ManageTransactions("BlocksOp")
11896 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11898 Returns a face, found in the given shape by four given corner vertices.
11901 theShape Block or a compound of blocks.
11902 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11903 theName Object name; when specified, this parameter is used
11904 for result publication in the study. Otherwise, if automatic
11905 publication is switched on, default value is used for result name.
11908 New GEOM.GEOM_Object, containing the found face.
11910 # Example: see GEOM_Spanner.py
11911 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11912 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11913 self._autoPublish(anObj, theName, "face")
11916 ## Get a face of block, found in the given shape by two given edges.
11917 # @param theShape Block or a compound of blocks.
11918 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11919 # @param theName Object name; when specified, this parameter is used
11920 # for result publication in the study. Otherwise, if automatic
11921 # publication is switched on, default value is used for result name.
11923 # @return New GEOM.GEOM_Object, containing the found face.
11925 # @ref swig_todo "Example"
11926 @ManageTransactions("BlocksOp")
11927 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11929 Get a face of block, found in the given shape by two given edges.
11932 theShape Block or a compound of blocks.
11933 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11934 theName Object name; when specified, this parameter is used
11935 for result publication in the study. Otherwise, if automatic
11936 publication is switched on, default value is used for result name.
11939 New GEOM.GEOM_Object, containing the found face.
11941 # Example: see GEOM_Spanner.py
11942 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11943 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11944 self._autoPublish(anObj, theName, "face")
11947 ## Find a face, opposite to the given one in the given block.
11948 # @param theBlock Must be a hexahedral solid.
11949 # @param theFace Face of \a theBlock, opposite to the desired face.
11950 # @param theName Object name; when specified, this parameter is used
11951 # for result publication in the study. Otherwise, if automatic
11952 # publication is switched on, default value is used for result name.
11954 # @return New GEOM.GEOM_Object, containing the found face.
11956 # @ref swig_GetOppositeFace "Example"
11957 @ManageTransactions("BlocksOp")
11958 def GetOppositeFace(self, theBlock, theFace, theName=None):
11960 Find a face, opposite to the given one in the given block.
11963 theBlock Must be a hexahedral solid.
11964 theFace Face of theBlock, opposite to the desired face.
11965 theName Object name; when specified, this parameter is used
11966 for result publication in the study. Otherwise, if automatic
11967 publication is switched on, default value is used for result name.
11970 New GEOM.GEOM_Object, containing the found face.
11972 # Example: see GEOM_Spanner.py
11973 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11974 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11975 self._autoPublish(anObj, theName, "face")
11978 ## Find a face of the given shape, which has minimal distance to the given point.
11979 # @param theShape Block or a compound of blocks.
11980 # @param thePoint Point, close to the desired face.
11981 # @param theName Object name; when specified, this parameter is used
11982 # for result publication in the study. Otherwise, if automatic
11983 # publication is switched on, default value is used for result name.
11985 # @return New GEOM.GEOM_Object, containing the found face.
11987 # @ref swig_GetFaceNearPoint "Example"
11988 @ManageTransactions("BlocksOp")
11989 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11991 Find a face of the given shape, which has minimal distance to the given point.
11994 theShape Block or a compound of blocks.
11995 thePoint Point, close to the desired face.
11996 theName Object name; when specified, this parameter is used
11997 for result publication in the study. Otherwise, if automatic
11998 publication is switched on, default value is used for result name.
12001 New GEOM.GEOM_Object, containing the found face.
12003 # Example: see GEOM_Spanner.py
12004 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12005 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12006 self._autoPublish(anObj, theName, "face")
12009 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12010 # @param theBlock Block or a compound of blocks.
12011 # @param theVector Vector, close to the normale of the desired face.
12012 # @param theName Object name; when specified, this parameter is used
12013 # for result publication in the study. Otherwise, if automatic
12014 # publication is switched on, default value is used for result name.
12016 # @return New GEOM.GEOM_Object, containing the found face.
12018 # @ref swig_todo "Example"
12019 @ManageTransactions("BlocksOp")
12020 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12022 Find a face of block, whose outside normale has minimal angle with the given vector.
12025 theBlock Block or a compound of blocks.
12026 theVector Vector, close to the normale of the desired face.
12027 theName Object name; when specified, this parameter is used
12028 for result publication in the study. Otherwise, if automatic
12029 publication is switched on, default value is used for result name.
12032 New GEOM.GEOM_Object, containing the found face.
12034 # Example: see GEOM_Spanner.py
12035 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12036 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12037 self._autoPublish(anObj, theName, "face")
12040 ## Find all sub-shapes of type \a theShapeType of the given shape,
12041 # which have minimal distance to the given point.
12042 # @param theShape Any shape.
12043 # @param thePoint Point, close to the desired shape.
12044 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12045 # @param theTolerance The tolerance for distances comparison. All shapes
12046 # with distances to the given point in interval
12047 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12048 # @param theName Object name; when specified, this parameter is used
12049 # for result publication in the study. Otherwise, if automatic
12050 # publication is switched on, default value is used for result name.
12052 # @return New GEOM_Object, containing a group of all found shapes.
12054 # @ref swig_GetShapesNearPoint "Example"
12055 @ManageTransactions("BlocksOp")
12056 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12058 Find all sub-shapes of type theShapeType of the given shape,
12059 which have minimal distance to the given point.
12062 theShape Any shape.
12063 thePoint Point, close to the desired shape.
12064 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12065 theTolerance The tolerance for distances comparison. All shapes
12066 with distances to the given point in interval
12067 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12068 theName Object name; when specified, this parameter is used
12069 for result publication in the study. Otherwise, if automatic
12070 publication is switched on, default value is used for result name.
12073 New GEOM_Object, containing a group of all found shapes.
12075 # Example: see GEOM_TestOthers.py
12076 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12077 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12078 self._autoPublish(anObj, theName, "group")
12081 # end of l3_blocks_op
12084 ## @addtogroup l4_blocks_measure
12087 ## Check, if the compound of blocks is given.
12088 # To be considered as a compound of blocks, the
12089 # given shape must satisfy the following conditions:
12090 # - Each element of the compound should be a Block (6 faces).
12091 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12092 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12093 # there are more than 4 edges in the only wire of a face,
12094 # this face is considered to be quadrangle if it has 4 bounds
12095 # (1 or more edge) of C1 continuity.
12096 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12097 # - The compound should be connexe.
12098 # - The glue between two quadrangle faces should be applied.
12099 # @param theCompound The compound to check.
12100 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12101 # taking into account C1 continuity.
12102 # @param theAngTolerance the angular tolerance to check if two neighbor
12103 # edges are codirectional in the common vertex with this
12104 # tolerance. This parameter is used only if
12105 # <VAR>theIsUseC1</VAR> is set to True.
12106 # @return TRUE, if the given shape is a compound of blocks.
12107 # If theCompound is not valid, prints all discovered errors.
12109 # @ref tui_check_compound_of_blocks_page "Example 1"
12110 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12111 @ManageTransactions("BlocksOp")
12112 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12113 theAngTolerance = 1.e-12):
12115 Check, if the compound of blocks is given.
12116 To be considered as a compound of blocks, the
12117 given shape must satisfy the following conditions:
12118 - Each element of the compound should be a Block (6 faces).
12119 - Each face should be a quadrangle, i.e. it should have only 1 wire
12120 with 4 edges. If theIsUseC1 is set to True and
12121 there are more than 4 edges in the only wire of a face,
12122 this face is considered to be quadrangle if it has 4 bounds
12123 (1 or more edge) of C1 continuity.
12124 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12125 - The compound should be connexe.
12126 - The glue between two quadrangle faces should be applied.
12129 theCompound The compound to check.
12130 theIsUseC1 Flag to check if there are 4 bounds on a face
12131 taking into account C1 continuity.
12132 theAngTolerance the angular tolerance to check if two neighbor
12133 edges are codirectional in the common vertex with this
12134 tolerance. This parameter is used only if
12135 theIsUseC1 is set to True.
12138 TRUE, if the given shape is a compound of blocks.
12139 If theCompound is not valid, prints all discovered errors.
12141 # Example: see GEOM_Spanner.py
12144 aTolerance = theAngTolerance
12145 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12146 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12148 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12152 ## Retrieve all non blocks solids and faces from \a theShape.
12153 # @param theShape The shape to explore.
12154 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12155 # taking into account C1 continuity.
12156 # @param theAngTolerance the angular tolerance to check if two neighbor
12157 # edges are codirectional in the common vertex with this
12158 # tolerance. This parameter is used only if
12159 # <VAR>theIsUseC1</VAR> is set to True.
12160 # @param theName Object name; when specified, this parameter is used
12161 # for result publication in the study. Otherwise, if automatic
12162 # publication is switched on, default value is used for result name.
12164 # @return A tuple of two GEOM_Objects. The first object is a group of all
12165 # non block solids (= not 6 faces, or with 6 faces, but with the
12166 # presence of non-quadrangular faces). The second object is a
12167 # group of all non quadrangular faces (= faces with more then
12168 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12169 # with 1 wire with not 4 edges that do not form 4 bounds of
12172 # @ref tui_get_non_blocks_page "Example 1"
12173 # \n @ref swig_GetNonBlocks "Example 2"
12174 @ManageTransactions("BlocksOp")
12175 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12176 theAngTolerance = 1.e-12, theName=None):
12178 Retrieve all non blocks solids and faces from theShape.
12181 theShape The shape to explore.
12182 theIsUseC1 Flag to check if there are 4 bounds on a face
12183 taking into account C1 continuity.
12184 theAngTolerance the angular tolerance to check if two neighbor
12185 edges are codirectional in the common vertex with this
12186 tolerance. This parameter is used only if
12187 theIsUseC1 is set to True.
12188 theName Object name; when specified, this parameter is used
12189 for result publication in the study. Otherwise, if automatic
12190 publication is switched on, default value is used for result name.
12193 A tuple of two GEOM_Objects. The first object is a group of all
12194 non block solids (= not 6 faces, or with 6 faces, but with the
12195 presence of non-quadrangular faces). The second object is a
12196 group of all non quadrangular faces (= faces with more then
12197 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12198 with 1 wire with not 4 edges that do not form 4 bounds of
12202 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12204 # Example: see GEOM_Spanner.py
12207 aTolerance = theAngTolerance
12208 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12209 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12210 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12213 ## Remove all seam and degenerated edges from \a theShape.
12214 # Unite faces and edges, sharing one surface. It means that
12215 # this faces must have references to one C++ surface object (handle).
12216 # @param theShape The compound or single solid to remove irregular edges from.
12217 # @param doUnionFaces If True, then unite faces. If False (the default value),
12218 # do not unite faces.
12219 # @param theName Object name; when specified, this parameter is used
12220 # for result publication in the study. Otherwise, if automatic
12221 # publication is switched on, default value is used for result name.
12223 # @return Improved shape.
12225 # @ref swig_RemoveExtraEdges "Example"
12226 @ManageTransactions("BlocksOp")
12227 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12229 Remove all seam and degenerated edges from theShape.
12230 Unite faces and edges, sharing one surface. It means that
12231 this faces must have references to one C++ surface object (handle).
12234 theShape The compound or single solid to remove irregular edges from.
12235 doUnionFaces If True, then unite faces. If False (the default value),
12236 do not unite faces.
12237 theName Object name; when specified, this parameter is used
12238 for result publication in the study. Otherwise, if automatic
12239 publication is switched on, default value is used for result name.
12244 # Example: see GEOM_TestOthers.py
12245 nbFacesOptimum = -1 # -1 means do not unite faces
12246 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12247 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12248 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12249 self._autoPublish(anObj, theName, "removeExtraEdges")
12252 ## Performs union faces of \a theShape
12253 # Unite faces sharing one surface. It means that
12254 # these faces must have references to one C++ surface object (handle).
12255 # @param theShape The compound or single solid that contains faces
12256 # to perform union.
12257 # @param theName Object name; when specified, this parameter is used
12258 # for result publication in the study. Otherwise, if automatic
12259 # publication is switched on, default value is used for result name.
12261 # @return Improved shape.
12263 # @ref swig_UnionFaces "Example"
12264 @ManageTransactions("BlocksOp")
12265 def UnionFaces(self, theShape, theName=None):
12267 Performs union faces of theShape.
12268 Unite faces sharing one surface. It means that
12269 these faces must have references to one C++ surface object (handle).
12272 theShape The compound or single solid that contains faces
12274 theName Object name; when specified, this parameter is used
12275 for result publication in the study. Otherwise, if automatic
12276 publication is switched on, default value is used for result name.
12281 # Example: see GEOM_TestOthers.py
12282 anObj = self.BlocksOp.UnionFaces(theShape)
12283 RaiseIfFailed("UnionFaces", self.BlocksOp)
12284 self._autoPublish(anObj, theName, "unionFaces")
12287 ## Check, if the given shape is a blocks compound.
12288 # Fix all detected errors.
12289 # \note Single block can be also fixed by this method.
12290 # @param theShape The compound to check and improve.
12291 # @param theName Object name; when specified, this parameter is used
12292 # for result publication in the study. Otherwise, if automatic
12293 # publication is switched on, default value is used for result name.
12295 # @return Improved compound.
12297 # @ref swig_CheckAndImprove "Example"
12298 @ManageTransactions("BlocksOp")
12299 def CheckAndImprove(self, theShape, theName=None):
12301 Check, if the given shape is a blocks compound.
12302 Fix all detected errors.
12305 Single block can be also fixed by this method.
12308 theShape The compound to check and improve.
12309 theName Object name; when specified, this parameter is used
12310 for result publication in the study. Otherwise, if automatic
12311 publication is switched on, default value is used for result name.
12316 # Example: see GEOM_TestOthers.py
12317 anObj = self.BlocksOp.CheckAndImprove(theShape)
12318 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12319 self._autoPublish(anObj, theName, "improved")
12322 # end of l4_blocks_measure
12325 ## @addtogroup l3_blocks_op
12328 ## Get all the blocks, contained in the given compound.
12329 # @param theCompound The compound to explode.
12330 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12331 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12332 # @param theName Object name; when specified, this parameter is used
12333 # for result publication in the study. Otherwise, if automatic
12334 # publication is switched on, default value is used for result name.
12336 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12338 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12340 # @ref tui_explode_on_blocks "Example 1"
12341 # \n @ref swig_MakeBlockExplode "Example 2"
12342 @ManageTransactions("BlocksOp")
12343 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12345 Get all the blocks, contained in the given compound.
12348 theCompound The compound to explode.
12349 theMinNbFaces If solid has lower number of faces, it is not a block.
12350 theMaxNbFaces If solid has higher number of faces, it is not a block.
12351 theName Object name; when specified, this parameter is used
12352 for result publication in the study. Otherwise, if automatic
12353 publication is switched on, default value is used for result name.
12356 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12359 List of GEOM.GEOM_Object, containing the retrieved blocks.
12361 # Example: see GEOM_TestOthers.py
12362 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12363 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12364 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12365 for anObj in aList:
12366 anObj.SetParameters(Parameters)
12368 self._autoPublish(aList, theName, "block")
12371 ## Find block, containing the given point inside its volume or on boundary.
12372 # @param theCompound Compound, to find block in.
12373 # @param thePoint Point, close to the desired block. If the point lays on
12374 # boundary between some blocks, we return block with nearest center.
12375 # @param theName Object name; when specified, this parameter is used
12376 # for result publication in the study. Otherwise, if automatic
12377 # publication is switched on, default value is used for result name.
12379 # @return New GEOM.GEOM_Object, containing the found block.
12381 # @ref swig_todo "Example"
12382 @ManageTransactions("BlocksOp")
12383 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12385 Find block, containing the given point inside its volume or on boundary.
12388 theCompound Compound, to find block in.
12389 thePoint Point, close to the desired block. If the point lays on
12390 boundary between some blocks, we return block with nearest center.
12391 theName Object name; when specified, this parameter is used
12392 for result publication in the study. Otherwise, if automatic
12393 publication is switched on, default value is used for result name.
12396 New GEOM.GEOM_Object, containing the found block.
12398 # Example: see GEOM_Spanner.py
12399 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12400 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12401 self._autoPublish(anObj, theName, "block")
12404 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12405 # @param theCompound Compound, to find block in.
12406 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12407 # @param theName Object name; when specified, this parameter is used
12408 # for result publication in the study. Otherwise, if automatic
12409 # publication is switched on, default value is used for result name.
12411 # @return New GEOM.GEOM_Object, containing the found block.
12413 # @ref swig_GetBlockByParts "Example"
12414 @ManageTransactions("BlocksOp")
12415 def GetBlockByParts(self, theCompound, theParts, theName=None):
12417 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12420 theCompound Compound, to find block in.
12421 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12422 theName Object name; when specified, this parameter is used
12423 for result publication in the study. Otherwise, if automatic
12424 publication is switched on, default value is used for result name.
12427 New GEOM_Object, containing the found block.
12429 # Example: see GEOM_TestOthers.py
12430 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12431 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12432 self._autoPublish(anObj, theName, "block")
12435 ## Return all blocks, containing all the elements, passed as the parts.
12436 # @param theCompound Compound, to find blocks in.
12437 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12438 # @param theName Object name; when specified, this parameter is used
12439 # for result publication in the study. Otherwise, if automatic
12440 # publication is switched on, default value is used for result name.
12442 # @return List of GEOM.GEOM_Object, containing the found blocks.
12444 # @ref swig_todo "Example"
12445 @ManageTransactions("BlocksOp")
12446 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12448 Return all blocks, containing all the elements, passed as the parts.
12451 theCompound Compound, to find blocks in.
12452 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12453 theName Object name; when specified, this parameter is used
12454 for result publication in the study. Otherwise, if automatic
12455 publication is switched on, default value is used for result name.
12458 List of GEOM.GEOM_Object, containing the found blocks.
12460 # Example: see GEOM_Spanner.py
12461 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12462 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12463 self._autoPublish(aList, theName, "block")
12466 ## Multi-transformate block and glue the result.
12467 # Transformation is defined so, as to superpose direction faces.
12468 # @param Block Hexahedral solid to be multi-transformed.
12469 # @param DirFace1 ID of First direction face.
12470 # @param DirFace2 ID of Second direction face.
12471 # @param NbTimes Quantity of transformations to be done.
12472 # @param theName Object name; when specified, this parameter is used
12473 # for result publication in the study. Otherwise, if automatic
12474 # publication is switched on, default value is used for result name.
12476 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12478 # @return New GEOM.GEOM_Object, containing the result shape.
12480 # @ref tui_multi_transformation "Example"
12481 @ManageTransactions("BlocksOp")
12482 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12484 Multi-transformate block and glue the result.
12485 Transformation is defined so, as to superpose direction faces.
12488 Block Hexahedral solid to be multi-transformed.
12489 DirFace1 ID of First direction face.
12490 DirFace2 ID of Second direction face.
12491 NbTimes Quantity of transformations to be done.
12492 theName Object name; when specified, this parameter is used
12493 for result publication in the study. Otherwise, if automatic
12494 publication is switched on, default value is used for result name.
12497 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12500 New GEOM.GEOM_Object, containing the result shape.
12502 # Example: see GEOM_Spanner.py
12503 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12504 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12505 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12506 anObj.SetParameters(Parameters)
12507 self._autoPublish(anObj, theName, "transformed")
12510 ## Multi-transformate block and glue the result.
12511 # @param Block Hexahedral solid to be multi-transformed.
12512 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12513 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12514 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12515 # @param theName Object name; when specified, this parameter is used
12516 # for result publication in the study. Otherwise, if automatic
12517 # publication is switched on, default value is used for result name.
12519 # @return New GEOM.GEOM_Object, containing the result shape.
12521 # @ref tui_multi_transformation "Example"
12522 @ManageTransactions("BlocksOp")
12523 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12524 DirFace1V, DirFace2V, NbTimesV, theName=None):
12526 Multi-transformate block and glue the result.
12529 Block Hexahedral solid to be multi-transformed.
12530 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12531 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12532 NbTimesU,NbTimesV Quantity of transformations to be done.
12533 theName Object name; when specified, this parameter is used
12534 for result publication in the study. Otherwise, if automatic
12535 publication is switched on, default value is used for result name.
12538 New GEOM.GEOM_Object, containing the result shape.
12540 # Example: see GEOM_Spanner.py
12541 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12542 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12543 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12544 DirFace1V, DirFace2V, NbTimesV)
12545 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12546 anObj.SetParameters(Parameters)
12547 self._autoPublish(anObj, theName, "transformed")
12550 ## Build all possible propagation groups.
12551 # Propagation group is a set of all edges, opposite to one (main)
12552 # edge of this group directly or through other opposite edges.
12553 # Notion of Opposite Edge make sence only on quadrangle face.
12554 # @param theShape Shape to build propagation groups on.
12555 # @param theName Object name; when specified, this parameter is used
12556 # for result publication in the study. Otherwise, if automatic
12557 # publication is switched on, default value is used for result name.
12559 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12561 # @ref swig_Propagate "Example"
12562 @ManageTransactions("BlocksOp")
12563 def Propagate(self, theShape, theName=None):
12565 Build all possible propagation groups.
12566 Propagation group is a set of all edges, opposite to one (main)
12567 edge of this group directly or through other opposite edges.
12568 Notion of Opposite Edge make sence only on quadrangle face.
12571 theShape Shape to build propagation groups on.
12572 theName Object name; when specified, this parameter is used
12573 for result publication in the study. Otherwise, if automatic
12574 publication is switched on, default value is used for result name.
12577 List of GEOM.GEOM_Object, each of them is a propagation group.
12579 # Example: see GEOM_TestOthers.py
12580 listChains = self.BlocksOp.Propagate(theShape)
12581 RaiseIfFailed("Propagate", self.BlocksOp)
12582 self._autoPublish(listChains, theName, "propagate")
12585 # end of l3_blocks_op
12588 ## @addtogroup l3_groups
12591 ## Creates a new group which will store sub-shapes of theMainShape
12592 # @param theMainShape is a GEOM object on which the group is selected
12593 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12594 # @param theName Object name; when specified, this parameter is used
12595 # for result publication in the study. Otherwise, if automatic
12596 # publication is switched on, default value is used for result name.
12598 # @return a newly created GEOM group (GEOM.GEOM_Object)
12600 # @ref tui_working_with_groups_page "Example 1"
12601 # \n @ref swig_CreateGroup "Example 2"
12602 @ManageTransactions("GroupOp")
12603 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12605 Creates a new group which will store sub-shapes of theMainShape
12608 theMainShape is a GEOM object on which the group is selected
12609 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12610 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12611 theName Object name; when specified, this parameter is used
12612 for result publication in the study. Otherwise, if automatic
12613 publication is switched on, default value is used for result name.
12616 a newly created GEOM group
12619 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12622 # Example: see GEOM_TestOthers.py
12623 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12624 RaiseIfFailed("CreateGroup", self.GroupOp)
12625 self._autoPublish(anObj, theName, "group")
12628 ## Adds a sub-object with ID theSubShapeId to the group
12629 # @param theGroup is a GEOM group to which the new sub-shape is added
12630 # @param theSubShapeID is a sub-shape ID in the main object.
12631 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12633 # @ref tui_working_with_groups_page "Example"
12634 @ManageTransactions("GroupOp")
12635 def AddObject(self,theGroup, theSubShapeID):
12637 Adds a sub-object with ID theSubShapeId to the group
12640 theGroup is a GEOM group to which the new sub-shape is added
12641 theSubShapeID is a sub-shape ID in the main object.
12644 Use method GetSubShapeID() to get an unique ID of the sub-shape
12646 # Example: see GEOM_TestOthers.py
12647 self.GroupOp.AddObject(theGroup, theSubShapeID)
12648 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12649 RaiseIfFailed("AddObject", self.GroupOp)
12653 ## Removes a sub-object with ID \a theSubShapeId from the group
12654 # @param theGroup is a GEOM group from which the new sub-shape is removed
12655 # @param theSubShapeID is a sub-shape ID in the main object.
12656 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12658 # @ref tui_working_with_groups_page "Example"
12659 @ManageTransactions("GroupOp")
12660 def RemoveObject(self,theGroup, theSubShapeID):
12662 Removes a sub-object with ID theSubShapeId from the group
12665 theGroup is a GEOM group from which the new sub-shape is removed
12666 theSubShapeID is a sub-shape ID in the main object.
12669 Use method GetSubShapeID() to get an unique ID of the sub-shape
12671 # Example: see GEOM_TestOthers.py
12672 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12673 RaiseIfFailed("RemoveObject", self.GroupOp)
12676 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12677 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12678 # @param theSubShapes is a list of sub-shapes to be added.
12680 # @ref tui_working_with_groups_page "Example"
12681 @ManageTransactions("GroupOp")
12682 def UnionList (self,theGroup, theSubShapes):
12684 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12687 theGroup is a GEOM group to which the new sub-shapes are added.
12688 theSubShapes is a list of sub-shapes to be added.
12690 # Example: see GEOM_TestOthers.py
12691 self.GroupOp.UnionList(theGroup, theSubShapes)
12692 RaiseIfFailed("UnionList", self.GroupOp)
12695 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12696 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12697 # @param theSubShapes is a list of indices of sub-shapes to be added.
12699 # @ref swig_UnionIDs "Example"
12700 @ManageTransactions("GroupOp")
12701 def UnionIDs(self,theGroup, theSubShapes):
12703 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12706 theGroup is a GEOM group to which the new sub-shapes are added.
12707 theSubShapes is a list of indices of sub-shapes to be added.
12709 # Example: see GEOM_TestOthers.py
12710 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12711 RaiseIfFailed("UnionIDs", self.GroupOp)
12714 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12715 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12716 # @param theSubShapes is a list of sub-shapes to be removed.
12718 # @ref tui_working_with_groups_page "Example"
12719 @ManageTransactions("GroupOp")
12720 def DifferenceList (self,theGroup, theSubShapes):
12722 Removes from the group all the given shapes. No errors, if some shapes are not included.
12725 theGroup is a GEOM group from which the sub-shapes are removed.
12726 theSubShapes is a list of sub-shapes to be removed.
12728 # Example: see GEOM_TestOthers.py
12729 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12730 RaiseIfFailed("DifferenceList", self.GroupOp)
12733 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12734 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12735 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12737 # @ref swig_DifferenceIDs "Example"
12738 @ManageTransactions("GroupOp")
12739 def DifferenceIDs(self,theGroup, theSubShapes):
12741 Removes from the group all the given shapes. No errors, if some shapes are not included.
12744 theGroup is a GEOM group from which the sub-shapes are removed.
12745 theSubShapes is a list of indices of sub-shapes to be removed.
12747 # Example: see GEOM_TestOthers.py
12748 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12749 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12752 ## Union of two groups.
12753 # New group is created. It will contain all entities
12754 # which are present in groups theGroup1 and theGroup2.
12755 # @param theGroup1, theGroup2 are the initial GEOM groups
12756 # to create the united group from.
12757 # @param theName Object name; when specified, this parameter is used
12758 # for result publication in the study. Otherwise, if automatic
12759 # publication is switched on, default value is used for result name.
12761 # @return a newly created GEOM group.
12763 # @ref tui_union_groups_anchor "Example"
12764 @ManageTransactions("GroupOp")
12765 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12767 Union of two groups.
12768 New group is created. It will contain all entities
12769 which are present in groups theGroup1 and theGroup2.
12772 theGroup1, theGroup2 are the initial GEOM groups
12773 to create the united group from.
12774 theName Object name; when specified, this parameter is used
12775 for result publication in the study. Otherwise, if automatic
12776 publication is switched on, default value is used for result name.
12779 a newly created GEOM group.
12781 # Example: see GEOM_TestOthers.py
12782 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12783 RaiseIfFailed("UnionGroups", self.GroupOp)
12784 self._autoPublish(aGroup, theName, "group")
12787 ## Intersection of two groups.
12788 # New group is created. It will contain only those entities
12789 # which are present in both groups theGroup1 and theGroup2.
12790 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12791 # @param theName Object name; when specified, this parameter is used
12792 # for result publication in the study. Otherwise, if automatic
12793 # publication is switched on, default value is used for result name.
12795 # @return a newly created GEOM group.
12797 # @ref tui_intersect_groups_anchor "Example"
12798 @ManageTransactions("GroupOp")
12799 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12801 Intersection of two groups.
12802 New group is created. It will contain only those entities
12803 which are present in both groups theGroup1 and theGroup2.
12806 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12807 theName Object name; when specified, this parameter is used
12808 for result publication in the study. Otherwise, if automatic
12809 publication is switched on, default value is used for result name.
12812 a newly created GEOM group.
12814 # Example: see GEOM_TestOthers.py
12815 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12816 RaiseIfFailed("IntersectGroups", self.GroupOp)
12817 self._autoPublish(aGroup, theName, "group")
12820 ## Cut of two groups.
12821 # New group is created. It will contain entities which are
12822 # present in group theGroup1 but are not present in group theGroup2.
12823 # @param theGroup1 is a GEOM group to include elements of.
12824 # @param theGroup2 is a GEOM group to exclude elements of.
12825 # @param theName Object name; when specified, this parameter is used
12826 # for result publication in the study. Otherwise, if automatic
12827 # publication is switched on, default value is used for result name.
12829 # @return a newly created GEOM group.
12831 # @ref tui_cut_groups_anchor "Example"
12832 @ManageTransactions("GroupOp")
12833 def CutGroups (self, theGroup1, theGroup2, theName=None):
12836 New group is created. It will contain entities which are
12837 present in group theGroup1 but are not present in group theGroup2.
12840 theGroup1 is a GEOM group to include elements of.
12841 theGroup2 is a GEOM group to exclude elements of.
12842 theName Object name; when specified, this parameter is used
12843 for result publication in the study. Otherwise, if automatic
12844 publication is switched on, default value is used for result name.
12847 a newly created GEOM group.
12849 # Example: see GEOM_TestOthers.py
12850 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12851 RaiseIfFailed("CutGroups", self.GroupOp)
12852 self._autoPublish(aGroup, theName, "group")
12855 ## Union of list of groups.
12856 # New group is created. It will contain all entities that are
12857 # present in groups listed in theGList.
12858 # @param theGList is a list of GEOM groups to create the united group from.
12859 # @param theName Object name; when specified, this parameter is used
12860 # for result publication in the study. Otherwise, if automatic
12861 # publication is switched on, default value is used for result name.
12863 # @return a newly created GEOM group.
12865 # @ref tui_union_groups_anchor "Example"
12866 @ManageTransactions("GroupOp")
12867 def UnionListOfGroups (self, theGList, theName=None):
12869 Union of list of groups.
12870 New group is created. It will contain all entities that are
12871 present in groups listed in theGList.
12874 theGList is a list of GEOM groups to create the united group from.
12875 theName Object name; when specified, this parameter is used
12876 for result publication in the study. Otherwise, if automatic
12877 publication is switched on, default value is used for result name.
12880 a newly created GEOM group.
12882 # Example: see GEOM_TestOthers.py
12883 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12884 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12885 self._autoPublish(aGroup, theName, "group")
12888 ## Cut of lists of groups.
12889 # New group is created. It will contain only entities
12890 # which are present in groups listed in theGList.
12891 # @param theGList is a list of GEOM groups to include elements of.
12892 # @param theName Object name; when specified, this parameter is used
12893 # for result publication in the study. Otherwise, if automatic
12894 # publication is switched on, default value is used for result name.
12896 # @return a newly created GEOM group.
12898 # @ref tui_intersect_groups_anchor "Example"
12899 @ManageTransactions("GroupOp")
12900 def IntersectListOfGroups (self, theGList, theName=None):
12902 Cut of lists of groups.
12903 New group is created. It will contain only entities
12904 which are present in groups listed in theGList.
12907 theGList is a list of GEOM groups to include elements of.
12908 theName Object name; when specified, this parameter is used
12909 for result publication in the study. Otherwise, if automatic
12910 publication is switched on, default value is used for result name.
12913 a newly created GEOM group.
12915 # Example: see GEOM_TestOthers.py
12916 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12917 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12918 self._autoPublish(aGroup, theName, "group")
12921 ## Cut of lists of groups.
12922 # New group is created. It will contain only entities
12923 # which are present in groups listed in theGList1 but
12924 # are not present in groups from theGList2.
12925 # @param theGList1 is a list of GEOM groups to include elements of.
12926 # @param theGList2 is a list of GEOM groups to exclude elements of.
12927 # @param theName Object name; when specified, this parameter is used
12928 # for result publication in the study. Otherwise, if automatic
12929 # publication is switched on, default value is used for result name.
12931 # @return a newly created GEOM group.
12933 # @ref tui_cut_groups_anchor "Example"
12934 @ManageTransactions("GroupOp")
12935 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12937 Cut of lists of groups.
12938 New group is created. It will contain only entities
12939 which are present in groups listed in theGList1 but
12940 are not present in groups from theGList2.
12943 theGList1 is a list of GEOM groups to include elements of.
12944 theGList2 is a list of GEOM groups to exclude elements of.
12945 theName Object name; when specified, this parameter is used
12946 for result publication in the study. Otherwise, if automatic
12947 publication is switched on, default value is used for result name.
12950 a newly created GEOM group.
12952 # Example: see GEOM_TestOthers.py
12953 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12954 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12955 self._autoPublish(aGroup, theName, "group")
12958 ## Returns a list of sub-objects ID stored in the group
12959 # @param theGroup is a GEOM group for which a list of IDs is requested
12961 # @ref swig_GetObjectIDs "Example"
12962 @ManageTransactions("GroupOp")
12963 def GetObjectIDs(self,theGroup):
12965 Returns a list of sub-objects ID stored in the group
12968 theGroup is a GEOM group for which a list of IDs is requested
12970 # Example: see GEOM_TestOthers.py
12971 ListIDs = self.GroupOp.GetObjects(theGroup)
12972 RaiseIfFailed("GetObjects", self.GroupOp)
12975 ## Returns a type of sub-objects stored in the group
12976 # @param theGroup is a GEOM group which type is returned.
12978 # @ref swig_GetType "Example"
12979 @ManageTransactions("GroupOp")
12980 def GetType(self,theGroup):
12982 Returns a type of sub-objects stored in the group
12985 theGroup is a GEOM group which type is returned.
12987 # Example: see GEOM_TestOthers.py
12988 aType = self.GroupOp.GetType(theGroup)
12989 RaiseIfFailed("GetType", self.GroupOp)
12992 ## Convert a type of geom object from id to string value
12993 # @param theId is a GEOM obect type id.
12994 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12995 # @ref swig_GetType "Example"
12996 def ShapeIdToType(self, theId):
12998 Convert a type of geom object from id to string value
13001 theId is a GEOM obect type id.
13004 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13031 return "REVOLUTION"
13079 return "FREE_BOUNDS"
13087 return "THRUSECTIONS"
13089 return "COMPOUNDFILTER"
13091 return "SHAPES_ON_SHAPE"
13093 return "ELLIPSE_ARC"
13095 return "3DSKETCHER"
13101 return "PIPETSHAPE"
13102 return "Shape Id not exist."
13104 ## Returns a main shape associated with the group
13105 # @param theGroup is a GEOM group for which a main shape object is requested
13106 # @return a GEOM object which is a main shape for theGroup
13108 # @ref swig_GetMainShape "Example"
13109 @ManageTransactions("GroupOp")
13110 def GetMainShape(self,theGroup):
13112 Returns a main shape associated with the group
13115 theGroup is a GEOM group for which a main shape object is requested
13118 a GEOM object which is a main shape for theGroup
13120 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13122 # Example: see GEOM_TestOthers.py
13123 anObj = self.GroupOp.GetMainShape(theGroup)
13124 RaiseIfFailed("GetMainShape", self.GroupOp)
13127 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13128 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13129 # @param theShape given shape (see GEOM.GEOM_Object)
13130 # @param min_length minimum length of edges of theShape
13131 # @param max_length maximum length of edges of theShape
13132 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13133 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13134 # @param theName Object name; when specified, this parameter is used
13135 # for result publication in the study. Otherwise, if automatic
13136 # publication is switched on, default value is used for result name.
13138 # @return a newly created GEOM group of edges
13140 # @@ref swig_todo "Example"
13141 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13143 Create group of edges of theShape, whose length is in range [min_length, max_length].
13144 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13147 theShape given shape
13148 min_length minimum length of edges of theShape
13149 max_length maximum length of edges of theShape
13150 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13151 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13152 theName Object name; when specified, this parameter is used
13153 for result publication in the study. Otherwise, if automatic
13154 publication is switched on, default value is used for result name.
13157 a newly created GEOM group of edges.
13159 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13160 edges_in_range = []
13162 Props = self.BasicProperties(edge)
13163 if min_length <= Props[0] and Props[0] <= max_length:
13164 if (not include_min) and (min_length == Props[0]):
13167 if (not include_max) and (Props[0] == max_length):
13170 edges_in_range.append(edge)
13172 if len(edges_in_range) <= 0:
13173 print "No edges found by given criteria"
13176 # note: auto-publishing is done in self.CreateGroup()
13177 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13178 self.UnionList(group_edges, edges_in_range)
13182 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13183 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13184 # @param min_length minimum length of edges of selected shape
13185 # @param max_length maximum length of edges of selected shape
13186 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13187 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13188 # @return a newly created GEOM group of edges
13189 # @ref swig_todo "Example"
13190 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13192 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13193 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13196 min_length minimum length of edges of selected shape
13197 max_length maximum length of edges of selected shape
13198 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13199 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13202 a newly created GEOM group of edges.
13204 nb_selected = sg.SelectedCount()
13205 if nb_selected < 1:
13206 print "Select a shape before calling this function, please."
13208 if nb_selected > 1:
13209 print "Only one shape must be selected"
13212 id_shape = sg.getSelected(0)
13213 shape = IDToObject( id_shape )
13215 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13219 if include_min: left_str = " <= "
13220 if include_max: right_str = " <= "
13222 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
13223 + left_str + "length" + right_str + `max_length`)
13225 sg.updateObjBrowser(1)
13232 #@@ insert new functions before this line @@ do not remove this line @@#
13234 ## Create a copy of the given object
13236 # @param theOriginal geometry object for copy
13237 # @param theName Object name; when specified, this parameter is used
13238 # for result publication in the study. Otherwise, if automatic
13239 # publication is switched on, default value is used for result name.
13241 # @return New GEOM_Object, containing the copied shape.
13243 # @ingroup l1_geomBuilder_auxiliary
13244 # @ref swig_MakeCopy "Example"
13245 @ManageTransactions("InsertOp")
13246 def MakeCopy(self, theOriginal, theName=None):
13248 Create a copy of the given object
13251 theOriginal geometry object for copy
13252 theName Object name; when specified, this parameter is used
13253 for result publication in the study. Otherwise, if automatic
13254 publication is switched on, default value is used for result name.
13257 New GEOM_Object, containing the copied shape.
13259 Example of usage: Copy = geompy.MakeCopy(Box)
13261 # Example: see GEOM_TestAll.py
13262 anObj = self.InsertOp.MakeCopy(theOriginal)
13263 RaiseIfFailed("MakeCopy", self.InsertOp)
13264 self._autoPublish(anObj, theName, "copy")
13267 ## Add Path to load python scripts from
13268 # @param Path a path to load python scripts from
13269 # @ingroup l1_geomBuilder_auxiliary
13270 def addPath(self,Path):
13272 Add Path to load python scripts from
13275 Path a path to load python scripts from
13277 if (sys.path.count(Path) < 1):
13278 sys.path.append(Path)
13282 ## Load marker texture from the file
13283 # @param Path a path to the texture file
13284 # @return unique texture identifier
13285 # @ingroup l1_geomBuilder_auxiliary
13286 @ManageTransactions("InsertOp")
13287 def LoadTexture(self, Path):
13289 Load marker texture from the file
13292 Path a path to the texture file
13295 unique texture identifier
13297 # Example: see GEOM_TestAll.py
13298 ID = self.InsertOp.LoadTexture(Path)
13299 RaiseIfFailed("LoadTexture", self.InsertOp)
13302 ## Get internal name of the object based on its study entry
13303 # @note This method does not provide an unique identifier of the geometry object.
13304 # @note This is internal function of GEOM component, though it can be used outside it for
13305 # appropriate reason (e.g. for identification of geometry object).
13306 # @param obj geometry object
13307 # @return unique object identifier
13308 # @ingroup l1_geomBuilder_auxiliary
13309 def getObjectID(self, obj):
13311 Get internal name of the object based on its study entry.
13312 Note: this method does not provide an unique identifier of the geometry object.
13313 It is an internal function of GEOM component, though it can be used outside GEOM for
13314 appropriate reason (e.g. for identification of geometry object).
13317 obj geometry object
13320 unique object identifier
13323 entry = salome.ObjectToID(obj)
13324 if entry is not None:
13325 lst = entry.split(":")
13327 ID = lst[-1] # -1 means last item in the list
13328 return "GEOM_" + ID
13333 ## Add marker texture. @a Width and @a Height parameters
13334 # specify width and height of the texture in pixels.
13335 # If @a RowData is @c True, @a Texture parameter should represent texture data
13336 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13337 # parameter should be unpacked string, in which '1' symbols represent opaque
13338 # pixels and '0' represent transparent pixels of the texture bitmap.
13340 # @param Width texture width in pixels
13341 # @param Height texture height in pixels
13342 # @param Texture texture data
13343 # @param RowData if @c True, @a Texture data are packed in the byte stream
13344 # @return unique texture identifier
13345 # @ingroup l1_geomBuilder_auxiliary
13346 @ManageTransactions("InsertOp")
13347 def AddTexture(self, Width, Height, Texture, RowData=False):
13349 Add marker texture. Width and Height parameters
13350 specify width and height of the texture in pixels.
13351 If RowData is True, Texture parameter should represent texture data
13352 packed into the byte array. If RowData is False (default), Texture
13353 parameter should be unpacked string, in which '1' symbols represent opaque
13354 pixels and '0' represent transparent pixels of the texture bitmap.
13357 Width texture width in pixels
13358 Height texture height in pixels
13359 Texture texture data
13360 RowData if True, Texture data are packed in the byte stream
13363 return unique texture identifier
13365 if not RowData: Texture = PackData(Texture)
13366 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13367 RaiseIfFailed("AddTexture", self.InsertOp)
13370 ## Transfer not topological data from one GEOM object to another.
13372 # @param theObjectFrom the source object of non-topological data
13373 # @param theObjectTo the destination object of non-topological data
13374 # @param theFindMethod method to search sub-shapes of theObjectFrom
13375 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13376 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13377 # Other values of GEOM.find_shape_method are not supported.
13379 # @return True in case of success; False otherwise.
13381 # @ingroup l1_geomBuilder_auxiliary
13383 # @ref swig_TransferData "Example"
13384 @ManageTransactions("InsertOp")
13385 def TransferData(self, theObjectFrom, theObjectTo,
13386 theFindMethod=GEOM.FSM_GetInPlace):
13388 Transfer not topological data from one GEOM object to another.
13391 theObjectFrom the source object of non-topological data
13392 theObjectTo the destination object of non-topological data
13393 theFindMethod method to search sub-shapes of theObjectFrom
13394 in shape theObjectTo. Possible values are:
13395 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13396 and GEOM.FSM_GetInPlace_Old. Other values of
13397 GEOM.find_shape_method are not supported.
13400 True in case of success; False otherwise.
13402 # Example: see GEOM_TestOthers.py
13404 # Example: see GEOM_TestAll.py
13405 isOk = self.InsertOp.TransferData(theObjectFrom,
13406 theObjectTo, theFindMethod)
13407 RaiseIfFailed("TransferData", self.InsertOp)
13410 ## Creates a new folder object. It is a container for any GEOM objects.
13411 # @param Name name of the container
13412 # @param Father parent object. If None,
13413 # folder under 'Geometry' root object will be created.
13414 # @return a new created folder
13415 # @ingroup l1_publish_data
13416 def NewFolder(self, Name, Father=None):
13418 Create a new folder object. It is an auxiliary container for any GEOM objects.
13421 Name name of the container
13422 Father parent object. If None,
13423 folder under 'Geometry' root object will be created.
13426 a new created folder
13428 if not Father: Father = self.father
13429 return self.CreateFolder(Name, Father)
13431 ## Move object to the specified folder
13432 # @param Object object to move
13433 # @param Folder target folder
13434 # @ingroup l1_publish_data
13435 def PutToFolder(self, Object, Folder):
13437 Move object to the specified folder
13440 Object object to move
13441 Folder target folder
13443 self.MoveToFolder(Object, Folder)
13446 ## Move list of objects to the specified folder
13447 # @param ListOfSO list of objects to move
13448 # @param Folder target folder
13449 # @ingroup l1_publish_data
13450 def PutListToFolder(self, ListOfSO, Folder):
13452 Move list of objects to the specified folder
13455 ListOfSO list of objects to move
13456 Folder target folder
13458 self.MoveListToFolder(ListOfSO, Folder)
13461 ## @addtogroup l2_field
13465 # @param shape the shape the field lies on
13466 # @param name the field name
13467 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13468 # @param dimension dimension of the shape the field lies on
13469 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13470 # @param componentNames names of components
13471 # @return a created field
13472 @ManageTransactions("FieldOp")
13473 def CreateField(self, shape, name, type, dimension, componentNames):
13478 shape the shape the field lies on
13479 name the field name
13480 type type of field data
13481 dimension dimension of the shape the field lies on
13482 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13483 componentNames names of components
13488 if isinstance( type, int ):
13489 if type < 0 or type > 3:
13490 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13491 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13493 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13494 RaiseIfFailed("CreateField", self.FieldOp)
13496 geom._autoPublish( f, "", name)
13499 ## Removes a field from the GEOM component
13500 # @param field the field to remove
13501 def RemoveField(self, field):
13502 "Removes a field from the GEOM component"
13504 if isinstance( field, GEOM._objref_GEOM_Field ):
13505 geom.RemoveObject( field )
13506 elif isinstance( field, geomField ):
13507 geom.RemoveObject( field.field )
13509 raise RuntimeError, "RemoveField() : the object is not a field"
13512 ## Returns number of fields on a shape
13513 @ManageTransactions("FieldOp")
13514 def CountFields(self, shape):
13515 "Returns number of fields on a shape"
13516 nb = self.FieldOp.CountFields( shape )
13517 RaiseIfFailed("CountFields", self.FieldOp)
13520 ## Returns all fields on a shape
13521 @ManageTransactions("FieldOp")
13522 def GetFields(self, shape):
13523 "Returns all fields on a shape"
13524 ff = self.FieldOp.GetFields( shape )
13525 RaiseIfFailed("GetFields", self.FieldOp)
13528 ## Returns a field on a shape by its name
13529 @ManageTransactions("FieldOp")
13530 def GetField(self, shape, name):
13531 "Returns a field on a shape by its name"
13532 f = self.FieldOp.GetField( shape, name )
13533 RaiseIfFailed("GetField", self.FieldOp)
13541 # Register the new proxy for GEOM_Gen
13542 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13545 ## Field on Geometry
13546 # @ingroup l2_field
13547 class geomField( GEOM._objref_GEOM_Field ):
13549 def __init__(self):
13550 GEOM._objref_GEOM_Field.__init__(self)
13551 self.field = GEOM._objref_GEOM_Field
13554 ## Returns the shape the field lies on
13555 def getShape(self):
13556 "Returns the shape the field lies on"
13557 return self.field.GetShape(self)
13559 ## Returns the field name
13561 "Returns the field name"
13562 return self.field.GetName(self)
13564 ## Returns type of field data as integer [0-3]
13566 "Returns type of field data"
13567 return self.field.GetDataType(self)._v
13569 ## Returns type of field data:
13570 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13571 def getTypeEnum(self):
13572 "Returns type of field data"
13573 return self.field.GetDataType(self)
13575 ## Returns dimension of the shape the field lies on:
13576 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13577 def getDimension(self):
13578 """Returns dimension of the shape the field lies on:
13579 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13580 return self.field.GetDimension(self)
13582 ## Returns names of components
13583 def getComponents(self):
13584 "Returns names of components"
13585 return self.field.GetComponents(self)
13587 ## Adds a time step to the field
13588 # @param step the time step number further used as the step identifier
13589 # @param stamp the time step time
13590 # @param values the values of the time step
13591 def addStep(self, step, stamp, values):
13592 "Adds a time step to the field"
13593 stp = self.field.AddStep( self, step, stamp )
13595 raise RuntimeError, \
13596 "Field.addStep() : Error: step %s already exists in this field"%step
13598 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13599 self.setValues( step, values )
13602 ## Remove a time step from the field
13603 def removeStep(self,step):
13604 "Remove a time step from the field"
13607 stepObj = self.field.GetStep( self, step )
13609 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13612 #traceback.print_exc()
13614 self.field.RemoveStep( self, step )
13616 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13619 ## Returns number of time steps in the field
13620 def countSteps(self):
13621 "Returns number of time steps in the field"
13622 return self.field.CountSteps(self)
13624 ## Returns a list of time step IDs in the field
13625 def getSteps(self):
13626 "Returns a list of time step IDs in the field"
13627 return self.field.GetSteps(self)
13629 ## Returns a time step by its ID
13630 def getStep(self,step):
13631 "Returns a time step by its ID"
13632 stp = self.field.GetStep(self, step)
13634 raise RuntimeError, "Step %s is missing from this field"%step
13637 ## Returns the time of the field step
13638 def getStamp(self,step):
13639 "Returns the time of the field step"
13640 return self.getStep(step).GetStamp()
13642 ## Changes the time of the field step
13643 def setStamp(self, step, stamp):
13644 "Changes the time of the field step"
13645 return self.getStep(step).SetStamp(stamp)
13647 ## Returns values of the field step
13648 def getValues(self, step):
13649 "Returns values of the field step"
13650 return self.getStep(step).GetValues()
13652 ## Changes values of the field step
13653 def setValues(self, step, values):
13654 "Changes values of the field step"
13655 stp = self.getStep(step)
13656 errBeg = "Field.setValues(values) : Error: "
13658 ok = stp.SetValues( values )
13659 except Exception, e:
13661 if excStr.find("WrongPythonType") > 0:
13662 raise RuntimeError, errBeg +\
13663 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13664 raise RuntimeError, errBeg + str(e)
13666 nbOK = self.field.GetArraySize(self)
13669 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13671 raise RuntimeError, errBeg + "failed"
13674 pass # end of class geomField
13676 # Register the new proxy for GEOM_Field
13677 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13680 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13681 # interface to GEOM operations.
13686 # salome.salome_init()
13687 # from salome.geom import geomBuilder
13688 # geompy = geomBuilder.New(salome.myStudy)
13690 # @param study SALOME study, generally obtained by salome.myStudy.
13691 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13692 # @return geomBuilder instance
13693 def New( study, instance=None):
13695 Create a new geomBuilder instance.The geomBuilder class provides the Python
13696 interface to GEOM operations.
13700 salome.salome_init()
13701 from salome.geom import geomBuilder
13702 geompy = geomBuilder.New(salome.myStudy)
13705 study SALOME study, generally obtained by salome.myStudy.
13706 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13708 geomBuilder instance
13710 #print "New geomBuilder ", study, instance
13717 geom = geomBuilder()
13718 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13719 geom.init_geom(study)
13723 # Register methods from the plug-ins in the geomBuilder class
13724 plugins_var = os.environ.get( "GEOM_PluginsList" )
13727 if plugins_var is not None:
13728 plugins = plugins_var.split( ":" )
13729 plugins=filter(lambda x: len(x)>0, plugins)
13730 if plugins is not None:
13731 for pluginName in plugins:
13732 pluginBuilderName = pluginName + "Builder"
13734 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
13735 except Exception, e:
13736 from salome_utils import verbose
13737 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
13739 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
13740 plugin = eval( pluginBuilderName )
13742 # add methods from plugin module to the geomBuilder class
13743 for k in dir( plugin ):
13744 if k[0] == '_': continue
13745 method = getattr( plugin, k )
13746 if type( method ).__name__ == 'function':
13747 if not hasattr( geomBuilder, k ):
13748 setattr( geomBuilder, k, method )