1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
262 def _toListOfNames(_names, _size=-1):
265 if type(_names) in [types.ListType, types.TupleType]:
266 for i in _names: l.append(i)
269 if l and len(l) < _size:
270 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
273 # Decorator function to manage transactions for all geometric operations.
274 def ManageTransactions(theOpeName):
275 def MTDecorator(theFunction):
276 # To keep the original function name an documentation.
277 @functools.wraps(theFunction)
278 def OpenCallClose(self, *args, **kwargs):
280 anOperation = getattr(self, theOpeName)
281 anOperation.StartOperation()
284 res = theFunction(self, *args, **kwargs)
286 anOperation.FinishOperation()
290 anOperation.AbortOperation()
295 ## Raise an Error, containing the Method_name, if Operation is Failed
296 ## @ingroup l1_geomBuilder_auxiliary
297 def RaiseIfFailed (Method_name, Operation):
298 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
299 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
301 ## Return list of variables value from salome notebook
302 ## @ingroup l1_geomBuilder_auxiliary
303 def ParseParameters(*parameters):
306 for parameter in parameters:
307 if isinstance(parameter, list):
308 lResults = ParseParameters(*parameter)
309 if len(lResults) > 0:
310 Result.append(lResults[:-1])
311 StringResult += lResults[-1].split(":")
315 if isinstance(parameter,str):
316 if notebook.isVariable(parameter):
317 Result.append(notebook.get(parameter))
319 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
322 Result.append(parameter)
324 StringResult.append(str(parameter))
328 Result.append(":".join(StringResult))
330 Result = ":".join(StringResult)
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
338 for parameter in list:
339 if isinstance(parameter,str) and notebook.isVariable(parameter):
340 Result.append(str(notebook.get(parameter)))
343 Result.append(str(parameter))
346 StringResult = StringResult + str(parameter)
347 StringResult = StringResult + ":"
349 StringResult = StringResult[:len(StringResult)-1]
350 return Result, StringResult
352 ## Return list of variables value from salome notebook
353 ## @ingroup l1_geomBuilder_auxiliary
354 def ParseSketcherCommand(command):
357 sections = command.split(":")
358 for section in sections:
359 parameters = section.split(" ")
361 for parameter in parameters:
362 if paramIndex > 1 and parameter.find("'") != -1:
363 parameter = parameter.replace("'","")
364 if notebook.isVariable(parameter):
365 Result = Result + str(notebook.get(parameter)) + " "
368 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
372 Result = Result + str(parameter) + " "
375 StringResult = StringResult + parameter
376 StringResult = StringResult + ":"
378 paramIndex = paramIndex + 1
380 Result = Result[:len(Result)-1] + ":"
382 Result = Result[:len(Result)-1]
383 return Result, StringResult
385 ## Helper function which can be used to pack the passed string to the byte data.
386 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
387 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
390 ## val = PackData("10001110") # val = 0xAE
391 ## val = PackData("1") # val = 0x80
393 ## @param data unpacked data - a string containing '1' and '0' symbols
394 ## @return data packed to the byte stream
395 ## @ingroup l1_geomBuilder_auxiliary
398 Helper function which can be used to pack the passed string to the byte data.
399 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
400 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
403 data unpacked data - a string containing '1' and '0' symbols
406 data packed to the byte stream
409 val = PackData("10001110") # val = 0xAE
410 val = PackData("1") # val = 0x80
413 if len(data)%8: bytes += 1
415 for b in range(bytes):
416 d = data[b*8:(b+1)*8]
421 if d[i] == "1": val += 1
423 raise "Invalid symbol %s" % d[i]
430 ## Read bitmap texture from the text file.
431 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
432 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
433 ## The function returns width and height of the pixmap in pixels and byte stream representing
434 ## texture bitmap itself.
436 ## This function can be used to read the texture to the byte stream in order to pass it to
437 ## the AddTexture() function of geomBuilder class.
440 ## from salome.geom import geomBuilder
441 ## geompy = geomBuilder.New(salome.myStudy)
442 ## texture = geompy.readtexture('mytexture.dat')
443 ## texture = geompy.AddTexture(*texture)
444 ## obj.SetMarkerTexture(texture)
446 ## @param fname texture file name
447 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
448 ## @ingroup l1_geomBuilder_auxiliary
449 def ReadTexture(fname):
451 Read bitmap texture from the text file.
452 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
453 A zero symbol ('0') represents transparent pixel of the texture bitmap.
454 The function returns width and height of the pixmap in pixels and byte stream representing
455 texture bitmap itself.
456 This function can be used to read the texture to the byte stream in order to pass it to
457 the AddTexture() function of geomBuilder class.
460 fname texture file name
463 sequence of tree values: texture's width, height in pixels and its byte stream
466 from salome.geom import geomBuilder
467 geompy = geomBuilder.New(salome.myStudy)
468 texture = geompy.readtexture('mytexture.dat')
469 texture = geompy.AddTexture(*texture)
470 obj.SetMarkerTexture(texture)
474 lines = [ l.strip() for l in f.readlines()]
477 if lines: maxlen = max([len(x) for x in lines])
479 if maxlen%8: lenbytes += 1
483 lenline = (len(line)/8+1)*8
486 lenline = (len(line)/8)*8
488 for i in range(lenline/8):
491 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
494 bytedata += PackData(byte)
496 for i in range(lenline/8, lenbytes):
497 bytedata += PackData("0")
499 return lenbytes*8, len(lines), bytedata
504 ## Returns a long value from enumeration type
505 # Can be used for CORBA enumerator types like GEOM.shape_type
506 # @param theItem enumeration type
507 # @ingroup l1_geomBuilder_auxiliary
508 def EnumToLong(theItem):
510 Returns a long value from enumeration type
511 Can be used for CORBA enumerator types like geomBuilder.ShapeType
514 theItem enumeration type
517 if hasattr(theItem, "_v"): ret = theItem._v
520 ## Pack an argument into a list
522 if isinstance( arg, list ):
524 if hasattr( arg, "__getitem__" ):
528 ## Information about closed/unclosed state of shell or wire
529 # @ingroup l1_geomBuilder_auxiliary
532 Information about closed/unclosed state of shell or wire
538 ## Private class used to bind calls of plugin operations to geomBuilder
539 class PluginOperation:
540 def __init__(self, operation, function):
541 self.operation = operation
542 self.function = function
545 @ManageTransactions("operation")
546 def __call__(self, *args):
547 res = self.function(self.operation, *args)
548 RaiseIfFailed(self.function.__name__, self.operation)
551 # Warning: geom is a singleton
557 class geomBuilder(object, GEOM._objref_GEOM_Gen):
559 ## Enumeration ShapeType as a dictionary. \n
560 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
561 # @ingroup l1_geomBuilder_auxiliary
562 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
564 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
565 # and a list of parameters, describing the shape.
566 # List of parameters, describing the shape:
567 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
568 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
570 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
572 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
574 # - SPHERE: [xc yc zc R]
575 # - CYLINDER: [xb yb zb dx dy dz R H]
576 # - BOX: [xc yc zc ax ay az]
577 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
578 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
579 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
580 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
581 # - SOLID: [nb_faces nb_edges nb_vertices]
583 # - SPHERE2D: [xc yc zc R]
584 # - CYLINDER2D: [xb yb zb dx dy dz R H]
585 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
586 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
587 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
588 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
589 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
590 # - PLANE: [xo yo zo dx dy dz]
591 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
592 # - FACE: [nb_edges nb_vertices]
594 # - CIRCLE: [xc yc zc dx dy dz R]
595 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
596 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
597 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
598 # - LINE: [xo yo zo dx dy dz]
599 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
600 # - EDGE: [nb_vertices]
603 # @ingroup l1_geomBuilder_auxiliary
604 kind = GEOM.GEOM_IKindOfShape
611 #print "==== __new__ ", engine, geom, doLcc, created
613 # geom engine is either retrieved from engine, or created
615 # Following test avoids a recursive loop
618 # geom engine not created: existing engine found
620 if doLcc and not created:
622 # FindOrLoadComponent called:
623 # 1. CORBA resolution of server
624 # 2. the __new__ method is called again
625 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
626 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
629 # FindOrLoadComponent not called
631 # geomBuilder instance is created from lcc.FindOrLoadComponent
632 #print "==== super ", engine, geom, doLcc, created
633 geom = super(geomBuilder,cls).__new__(cls)
636 # geom engine not created: existing engine found
637 #print "==== existing ", engine, geom, doLcc, created
639 #print "return geom 1 ", geom
642 #print "return geom 2 ", geom
647 #print "-------- geomBuilder __init__ --- ", created, self
650 GEOM._objref_GEOM_Gen.__init__(self)
651 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
652 self.myBuilder = None
671 ## Process object publication in the study, as follows:
672 # - if @a theName is specified (not None), the object is published in the study
673 # with this name, not taking into account "auto-publishing" option;
674 # - if @a theName is NOT specified, the object is published in the study
675 # (using default name, which can be customized using @a theDefaultName parameter)
676 # only if auto-publishing is switched on.
678 # @param theObj object, a subject for publishing
679 # @param theName object name for study
680 # @param theDefaultName default name for the auto-publishing
682 # @sa addToStudyAuto()
683 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
685 def _item_name(_names, _defname, _idx=-1):
686 if not _names: _names = _defname
687 if type(_names) in [types.ListType, types.TupleType]:
689 if _idx >= len(_names) or not _names[_idx]:
690 if type(_defname) not in [types.ListType, types.TupleType]:
691 _name = "%s_%d"%(_defname, _idx+1)
692 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
693 _name = _defname[_idx]
695 _name = "%noname_%d"%(dn, _idx+1)
701 # must be wrong usage
706 _name = "%s_%d"%(_names, _idx+1)
712 def _publish( _name, _obj ):
714 if isinstance( _obj, GEOM._objref_GEOM_Field ):
715 fatherObj = _obj.GetShape()
716 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
717 fatherObj = _obj.GetField()
718 elif not _obj.IsMainShape():
719 fatherObj = _obj.GetMainShape()
721 if fatherObj and fatherObj.GetStudyEntry():
722 self.addToStudyInFather(fatherObj, _obj, _name)
724 self.addToStudy(_obj, _name)
730 if not theName and not self.myMaxNbSubShapesAllowed:
731 return # nothing to do: auto-publishing is disabled
732 if not theName and not theDefaultName:
733 return # neither theName nor theDefaultName is given
735 if type(theObj) in [types.ListType, types.TupleType]:
736 # list of objects is being published
739 if not obj: continue # bad object
740 name = _item_name(theName, theDefaultName, idx)
741 _publish( name, obj )
743 if not theName and idx == self.myMaxNbSubShapesAllowed: break
747 # single object is published
748 name = _item_name(theName, theDefaultName)
749 _publish( name, theObj )
752 ## @addtogroup l1_geomBuilder_auxiliary
754 def init_geom(self,theStudy):
755 self.myStudy = theStudy
756 self.myStudyId = self.myStudy._get_StudyId()
757 self.myBuilder = self.myStudy.NewBuilder()
758 self.father = self.myStudy.FindComponent("GEOM")
759 notebook.myStudy = theStudy
760 if self.father is None:
761 self.father = self.myBuilder.NewComponent("GEOM")
762 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
763 FName = A1._narrow(SALOMEDS.AttributeName)
764 FName.SetValue("Geometry")
765 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
766 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
767 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
768 self.myBuilder.DefineComponentInstance(self.father,self)
770 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
771 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
772 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
773 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
774 self.HealOp = self.GetIHealingOperations (self.myStudyId)
775 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
776 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
777 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
778 self.LocalOp = self.GetILocalOperations (self.myStudyId)
779 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
780 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
781 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
782 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
784 # set GEOM as root in the use case tree
785 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
786 self.myUseCaseBuilder.SetRootCurrent()
787 self.myUseCaseBuilder.Append(self.father)
789 # load data from the study file, if necessary
790 self.myBuilder.LoadWith(self.father, self)
793 def GetPluginOperations(self, studyID, libraryName):
794 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
797 ## Enable / disable results auto-publishing
799 # The automatic publishing is managed in the following way:
800 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
801 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
802 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
803 # value passed as parameter has the same effect.
804 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
805 # maximum number of sub-shapes allowed for publishing is set to specified value.
807 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
808 # @ingroup l1_publish_data
809 def addToStudyAuto(self, maxNbSubShapes=-1):
811 Enable / disable results auto-publishing
813 The automatic publishing is managed in the following way:
814 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
815 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
816 maximum number of sub-shapes allowed for publishing is unlimited; any negative
817 value passed as parameter has the same effect.
818 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
819 maximum number of sub-shapes allowed for publishing is set to this value.
822 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
825 geompy.addToStudyAuto() # enable auto-publishing
826 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
827 geompy.addToStudyAuto(0) # disable auto-publishing
829 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
832 ## Dump component to the Python script
833 # This method overrides IDL function to allow default values for the parameters.
834 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
836 Dump component to the Python script
837 This method overrides IDL function to allow default values for the parameters.
839 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
841 ## Get name for sub-shape aSubObj of shape aMainObj
843 # @ref swig_SubShapeName "Example"
844 @ManageTransactions("ShapesOp")
845 def SubShapeName(self,aSubObj, aMainObj):
847 Get name for sub-shape aSubObj of shape aMainObj
849 # Example: see GEOM_TestAll.py
851 #aSubId = orb.object_to_string(aSubObj)
852 #aMainId = orb.object_to_string(aMainObj)
853 #index = gg.getIndexTopology(aSubId, aMainId)
854 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
855 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
856 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
859 ## Publish in study aShape with name aName
861 # \param aShape the shape to be published
862 # \param aName the name for the shape
863 # \param doRestoreSubShapes if True, finds and publishes also
864 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
865 # and published sub-shapes of arguments
866 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
867 # these arguments description
868 # \return study entry of the published shape in form of string
870 # @ingroup l1_publish_data
871 # @ref swig_all_addtostudy "Example"
872 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
873 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
875 Publish in study aShape with name aName
878 aShape the shape to be published
879 aName the name for the shape
880 doRestoreSubShapes if True, finds and publishes also
881 sub-shapes of aShape, corresponding to its arguments
882 and published sub-shapes of arguments
883 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
884 these arguments description
887 study entry of the published shape in form of string
890 id_block1 = geompy.addToStudy(Block1, "Block 1")
892 # Example: see GEOM_TestAll.py
894 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
895 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
896 if doRestoreSubShapes:
897 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
898 theFindMethod, theInheritFirstArg, True )
900 print "addToStudy() failed"
902 return aShape.GetStudyEntry()
904 ## Publish in study aShape with name aName as sub-object of previously published aFather
905 # \param aFather previously published object
906 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
907 # \param aName the name for the shape
909 # \return study entry of the published shape in form of string
911 # @ingroup l1_publish_data
912 # @ref swig_all_addtostudyInFather "Example"
913 def addToStudyInFather(self, aFather, aShape, aName):
915 Publish in study aShape with name aName as sub-object of previously published aFather
918 aFather previously published object
919 aShape the shape to be published as sub-object of aFather
920 aName the name for the shape
923 study entry of the published shape in form of string
925 # Example: see GEOM_TestAll.py
927 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
928 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
930 print "addToStudyInFather() failed"
932 return aShape.GetStudyEntry()
934 ## Unpublish object in study
936 # \param obj the object to be unpublished
937 def hideInStudy(self, obj):
939 Unpublish object in study
942 obj the object to be unpublished
944 ior = salome.orb.object_to_string(obj)
945 aSObject = self.myStudy.FindObjectIOR(ior)
946 if aSObject is not None:
947 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
948 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
949 drwAttribute.SetDrawable(False)
950 # hide references if any
951 vso = self.myStudy.FindDependances(aSObject);
953 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
954 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
955 drwAttribute.SetDrawable(False)
959 # end of l1_geomBuilder_auxiliary
962 ## @addtogroup l3_restore_ss
965 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
966 # To be used from python scripts out of addToStudy() (non-default usage)
967 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
968 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
969 # If this list is empty, all operation arguments will be published
970 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
971 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
972 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
973 # Do not publish sub-shapes in place of arguments, but only
974 # in place of sub-shapes of the first argument,
975 # because the whole shape corresponds to the first argument.
976 # Mainly to be used after transformations, but it also can be
977 # usefull after partition with one object shape, and some other
978 # operations, where only the first argument has to be considered.
979 # If theObject has only one argument shape, this flag is automatically
980 # considered as True, not regarding really passed value.
981 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
982 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
983 # \return list of published sub-shapes
985 # @ref tui_restore_prs_params "Example"
986 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
987 theInheritFirstArg=False, theAddPrefix=True):
989 Publish sub-shapes, standing for arguments and sub-shapes of arguments
990 To be used from python scripts out of geompy.addToStudy (non-default usage)
993 theObject published GEOM.GEOM_Object, arguments of which will be published
994 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
995 If this list is empty, all operation arguments will be published
996 theFindMethod method to search sub-shapes, corresponding to arguments and
997 their sub-shapes. Value from enumeration GEOM.find_shape_method.
998 theInheritFirstArg set properties of the first argument for theObject.
999 Do not publish sub-shapes in place of arguments, but only
1000 in place of sub-shapes of the first argument,
1001 because the whole shape corresponds to the first argument.
1002 Mainly to be used after transformations, but it also can be
1003 usefull after partition with one object shape, and some other
1004 operations, where only the first argument has to be considered.
1005 If theObject has only one argument shape, this flag is automatically
1006 considered as True, not regarding really passed value.
1007 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1008 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1010 list of published sub-shapes
1012 # Example: see GEOM_TestAll.py
1013 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1014 theFindMethod, theInheritFirstArg, theAddPrefix)
1016 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1017 # To be used from python scripts out of addToStudy() (non-default usage)
1018 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1019 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1020 # If this list is empty, all operation arguments will be published
1021 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1022 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1023 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1024 # Do not publish sub-shapes in place of arguments, but only
1025 # in place of sub-shapes of the first argument,
1026 # because the whole shape corresponds to the first argument.
1027 # Mainly to be used after transformations, but it also can be
1028 # usefull after partition with one object shape, and some other
1029 # operations, where only the first argument has to be considered.
1030 # If theObject has only one argument shape, this flag is automatically
1031 # considered as True, not regarding really passed value.
1032 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1033 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1034 # \return list of published sub-shapes
1036 # @ref tui_restore_prs_params "Example"
1037 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1038 theInheritFirstArg=False, theAddPrefix=True):
1040 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1041 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1044 theObject published GEOM.GEOM_Object, arguments of which will be published
1045 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1046 If this list is empty, all operation arguments will be published
1047 theFindMethod method to search sub-shapes, corresponding to arguments and
1048 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1049 theInheritFirstArg set properties of the first argument for theObject.
1050 Do not publish sub-shapes in place of arguments, but only
1051 in place of sub-shapes of the first argument,
1052 because the whole shape corresponds to the first argument.
1053 Mainly to be used after transformations, but it also can be
1054 usefull after partition with one object shape, and some other
1055 operations, where only the first argument has to be considered.
1056 If theObject has only one argument shape, this flag is automatically
1057 considered as True, not regarding really passed value.
1058 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1059 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1062 list of published sub-shapes
1064 # Example: see GEOM_TestAll.py
1065 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1066 theFindMethod, theInheritFirstArg, theAddPrefix)
1068 # end of l3_restore_ss
1071 ## @addtogroup l3_basic_go
1074 ## Create point by three coordinates.
1075 # @param theX The X coordinate of the point.
1076 # @param theY The Y coordinate of the point.
1077 # @param theZ The Z coordinate of the point.
1078 # @param theName Object name; when specified, this parameter is used
1079 # for result publication in the study. Otherwise, if automatic
1080 # publication is switched on, default value is used for result name.
1082 # @return New GEOM.GEOM_Object, containing the created point.
1084 # @ref tui_creation_point "Example"
1085 @ManageTransactions("BasicOp")
1086 def MakeVertex(self, theX, theY, theZ, theName=None):
1088 Create point by three coordinates.
1091 theX The X coordinate of the point.
1092 theY The Y coordinate of the point.
1093 theZ The Z coordinate of the point.
1094 theName Object name; when specified, this parameter is used
1095 for result publication in the study. Otherwise, if automatic
1096 publication is switched on, default value is used for result name.
1099 New GEOM.GEOM_Object, containing the created point.
1101 # Example: see GEOM_TestAll.py
1102 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1103 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1104 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1105 anObj.SetParameters(Parameters)
1106 self._autoPublish(anObj, theName, "vertex")
1109 ## Create a point, distant from the referenced point
1110 # on the given distances along the coordinate axes.
1111 # @param theReference The referenced point.
1112 # @param theX Displacement from the referenced point along OX axis.
1113 # @param theY Displacement from the referenced point along OY axis.
1114 # @param theZ Displacement from the referenced point along OZ axis.
1115 # @param theName Object name; when specified, this parameter is used
1116 # for result publication in the study. Otherwise, if automatic
1117 # publication is switched on, default value is used for result name.
1119 # @return New GEOM.GEOM_Object, containing the created point.
1121 # @ref tui_creation_point "Example"
1122 @ManageTransactions("BasicOp")
1123 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1125 Create a point, distant from the referenced point
1126 on the given distances along the coordinate axes.
1129 theReference The referenced point.
1130 theX Displacement from the referenced point along OX axis.
1131 theY Displacement from the referenced point along OY axis.
1132 theZ Displacement from the referenced point along OZ axis.
1133 theName Object name; when specified, this parameter is used
1134 for result publication in the study. Otherwise, if automatic
1135 publication is switched on, default value is used for result name.
1138 New GEOM.GEOM_Object, containing the created point.
1140 # Example: see GEOM_TestAll.py
1141 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1142 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1143 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1144 anObj.SetParameters(Parameters)
1145 self._autoPublish(anObj, theName, "vertex")
1148 ## Create a point, corresponding to the given parameter on the given curve.
1149 # @param theRefCurve The referenced curve.
1150 # @param theParameter Value of parameter on the referenced curve.
1151 # @param theName Object name; when specified, this parameter is used
1152 # for result publication in the study. Otherwise, if automatic
1153 # publication is switched on, default value is used for result name.
1155 # @return New GEOM.GEOM_Object, containing the created point.
1157 # @ref tui_creation_point "Example"
1158 @ManageTransactions("BasicOp")
1159 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1161 Create a point, corresponding to the given parameter on the given curve.
1164 theRefCurve The referenced curve.
1165 theParameter Value of parameter on the referenced curve.
1166 theName Object name; when specified, this parameter is used
1167 for result publication in the study. Otherwise, if automatic
1168 publication is switched on, default value is used for result name.
1171 New GEOM.GEOM_Object, containing the created point.
1174 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1176 # Example: see GEOM_TestAll.py
1177 theParameter, Parameters = ParseParameters(theParameter)
1178 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1179 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1180 anObj.SetParameters(Parameters)
1181 self._autoPublish(anObj, theName, "vertex")
1184 ## Create a point by projection give coordinates on the given curve
1185 # @param theRefCurve The referenced curve.
1186 # @param theX X-coordinate in 3D space
1187 # @param theY Y-coordinate in 3D space
1188 # @param theZ Z-coordinate in 3D space
1189 # @param theName Object name; when specified, this parameter is used
1190 # for result publication in the study. Otherwise, if automatic
1191 # publication is switched on, default value is used for result name.
1193 # @return New GEOM.GEOM_Object, containing the created point.
1195 # @ref tui_creation_point "Example"
1196 @ManageTransactions("BasicOp")
1197 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1199 Create a point by projection give coordinates on the given curve
1202 theRefCurve The referenced curve.
1203 theX X-coordinate in 3D space
1204 theY Y-coordinate in 3D space
1205 theZ Z-coordinate in 3D space
1206 theName Object name; when specified, this parameter is used
1207 for result publication in the study. Otherwise, if automatic
1208 publication is switched on, default value is used for result name.
1211 New GEOM.GEOM_Object, containing the created point.
1214 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1216 # Example: see GEOM_TestAll.py
1217 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1218 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1219 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1220 anObj.SetParameters(Parameters)
1221 self._autoPublish(anObj, theName, "vertex")
1224 ## Create a point, corresponding to the given length on the given curve.
1225 # @param theRefCurve The referenced curve.
1226 # @param theLength Length on the referenced curve. It can be negative.
1227 # @param theStartPoint Point allowing to choose the direction for the calculation
1228 # of the length. If None, start from the first point of theRefCurve.
1229 # @param theName Object name; when specified, this parameter is used
1230 # for result publication in the study. Otherwise, if automatic
1231 # publication is switched on, default value is used for result name.
1233 # @return New GEOM.GEOM_Object, containing the created point.
1235 # @ref tui_creation_point "Example"
1236 @ManageTransactions("BasicOp")
1237 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1239 Create a point, corresponding to the given length on the given curve.
1242 theRefCurve The referenced curve.
1243 theLength Length on the referenced curve. It can be negative.
1244 theStartPoint Point allowing to choose the direction for the calculation
1245 of the length. If None, start from the first point of theRefCurve.
1246 theName Object name; when specified, this parameter is used
1247 for result publication in the study. Otherwise, if automatic
1248 publication is switched on, default value is used for result name.
1251 New GEOM.GEOM_Object, containing the created point.
1253 # Example: see GEOM_TestAll.py
1254 theLength, Parameters = ParseParameters(theLength)
1255 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1256 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1257 anObj.SetParameters(Parameters)
1258 self._autoPublish(anObj, theName, "vertex")
1261 ## Create a point, corresponding to the given parameters on the
1263 # @param theRefSurf The referenced surface.
1264 # @param theUParameter Value of U-parameter on the referenced surface.
1265 # @param theVParameter Value of V-parameter on the referenced surface.
1266 # @param theName Object name; when specified, this parameter is used
1267 # for result publication in the study. Otherwise, if automatic
1268 # publication is switched on, default value is used for result name.
1270 # @return New GEOM.GEOM_Object, containing the created point.
1272 # @ref swig_MakeVertexOnSurface "Example"
1273 @ManageTransactions("BasicOp")
1274 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1276 Create a point, corresponding to the given parameters on the
1280 theRefSurf The referenced surface.
1281 theUParameter Value of U-parameter on the referenced surface.
1282 theVParameter Value of V-parameter on the referenced surface.
1283 theName Object name; when specified, this parameter is used
1284 for result publication in the study. Otherwise, if automatic
1285 publication is switched on, default value is used for result name.
1288 New GEOM.GEOM_Object, containing the created point.
1291 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1293 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1294 # Example: see GEOM_TestAll.py
1295 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1296 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1297 anObj.SetParameters(Parameters);
1298 self._autoPublish(anObj, theName, "vertex")
1301 ## Create a point by projection give coordinates on the given surface
1302 # @param theRefSurf The referenced surface.
1303 # @param theX X-coordinate in 3D space
1304 # @param theY Y-coordinate in 3D space
1305 # @param theZ Z-coordinate in 3D space
1306 # @param theName Object name; when specified, this parameter is used
1307 # for result publication in the study. Otherwise, if automatic
1308 # publication is switched on, default value is used for result name.
1310 # @return New GEOM.GEOM_Object, containing the created point.
1312 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1313 @ManageTransactions("BasicOp")
1314 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1316 Create a point by projection give coordinates on the given surface
1319 theRefSurf The referenced surface.
1320 theX X-coordinate in 3D space
1321 theY Y-coordinate in 3D space
1322 theZ Z-coordinate in 3D space
1323 theName Object name; when specified, this parameter is used
1324 for result publication in the study. Otherwise, if automatic
1325 publication is switched on, default value is used for result name.
1328 New GEOM.GEOM_Object, containing the created point.
1331 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1333 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1334 # Example: see GEOM_TestAll.py
1335 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1336 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1337 anObj.SetParameters(Parameters);
1338 self._autoPublish(anObj, theName, "vertex")
1341 ## Create a point, which lays on the given face.
1342 # The point will lay in arbitrary place of the face.
1343 # The only condition on it is a non-zero distance to the face boundary.
1344 # Such point can be used to uniquely identify the face inside any
1345 # shape in case, when the shape does not contain overlapped faces.
1346 # @param theFace The referenced face.
1347 # @param theName Object name; when specified, this parameter is used
1348 # for result publication in the study. Otherwise, if automatic
1349 # publication is switched on, default value is used for result name.
1351 # @return New GEOM.GEOM_Object, containing the created point.
1353 # @ref swig_MakeVertexInsideFace "Example"
1354 @ManageTransactions("BasicOp")
1355 def MakeVertexInsideFace (self, theFace, theName=None):
1357 Create a point, which lays on the given face.
1358 The point will lay in arbitrary place of the face.
1359 The only condition on it is a non-zero distance to the face boundary.
1360 Such point can be used to uniquely identify the face inside any
1361 shape in case, when the shape does not contain overlapped faces.
1364 theFace The referenced face.
1365 theName Object name; when specified, this parameter is used
1366 for result publication in the study. Otherwise, if automatic
1367 publication is switched on, default value is used for result name.
1370 New GEOM.GEOM_Object, containing the created point.
1373 p_on_face = geompy.MakeVertexInsideFace(Face)
1375 # Example: see GEOM_TestAll.py
1376 anObj = self.BasicOp.MakePointOnFace(theFace)
1377 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1378 self._autoPublish(anObj, theName, "vertex")
1381 ## Create a point on intersection of two lines.
1382 # @param theRefLine1, theRefLine2 The referenced lines.
1383 # @param theName Object name; when specified, this parameter is used
1384 # for result publication in the study. Otherwise, if automatic
1385 # publication is switched on, default value is used for result name.
1387 # @return New GEOM.GEOM_Object, containing the created point.
1389 # @ref swig_MakeVertexOnLinesIntersection "Example"
1390 @ManageTransactions("BasicOp")
1391 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1393 Create a point on intersection of two lines.
1396 theRefLine1, theRefLine2 The referenced lines.
1397 theName Object name; when specified, this parameter is used
1398 for result publication in the study. Otherwise, if automatic
1399 publication is switched on, default value is used for result name.
1402 New GEOM.GEOM_Object, containing the created point.
1404 # Example: see GEOM_TestAll.py
1405 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1406 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1407 self._autoPublish(anObj, theName, "vertex")
1410 ## Create a tangent, corresponding to the given parameter on the given curve.
1411 # @param theRefCurve The referenced curve.
1412 # @param theParameter Value of parameter on the referenced curve.
1413 # @param theName Object name; when specified, this parameter is used
1414 # for result publication in the study. Otherwise, if automatic
1415 # publication is switched on, default value is used for result name.
1417 # @return New GEOM.GEOM_Object, containing the created tangent.
1419 # @ref swig_MakeTangentOnCurve "Example"
1420 @ManageTransactions("BasicOp")
1421 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1423 Create a tangent, corresponding to the given parameter on the given curve.
1426 theRefCurve The referenced curve.
1427 theParameter Value of parameter on the referenced curve.
1428 theName Object name; when specified, this parameter is used
1429 for result publication in the study. Otherwise, if automatic
1430 publication is switched on, default value is used for result name.
1433 New GEOM.GEOM_Object, containing the created tangent.
1436 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1438 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1439 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1440 self._autoPublish(anObj, theName, "tangent")
1443 ## Create a tangent plane, corresponding to the given parameter on the given face.
1444 # @param theFace The face for which tangent plane should be built.
1445 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1446 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1447 # @param theTrimSize the size of plane.
1448 # @param theName Object name; when specified, this parameter is used
1449 # for result publication in the study. Otherwise, if automatic
1450 # publication is switched on, default value is used for result name.
1452 # @return New GEOM.GEOM_Object, containing the created tangent.
1454 # @ref swig_MakeTangentPlaneOnFace "Example"
1455 @ManageTransactions("BasicOp")
1456 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1458 Create a tangent plane, corresponding to the given parameter on the given face.
1461 theFace The face for which tangent plane should be built.
1462 theParameterV vertical value of the center point (0.0 - 1.0).
1463 theParameterU horisontal value of the center point (0.0 - 1.0).
1464 theTrimSize the size of plane.
1465 theName Object name; when specified, this parameter is used
1466 for result publication in the study. Otherwise, if automatic
1467 publication is switched on, default value is used for result name.
1470 New GEOM.GEOM_Object, containing the created tangent.
1473 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1475 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1476 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1477 self._autoPublish(anObj, theName, "tangent")
1480 ## Create a vector with the given components.
1481 # @param theDX X component of the vector.
1482 # @param theDY Y component of the vector.
1483 # @param theDZ Z component of the vector.
1484 # @param theName Object name; when specified, this parameter is used
1485 # for result publication in the study. Otherwise, if automatic
1486 # publication is switched on, default value is used for result name.
1488 # @return New GEOM.GEOM_Object, containing the created vector.
1490 # @ref tui_creation_vector "Example"
1491 @ManageTransactions("BasicOp")
1492 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1494 Create a vector with the given components.
1497 theDX X component of the vector.
1498 theDY Y component of the vector.
1499 theDZ Z component of the vector.
1500 theName Object name; when specified, this parameter is used
1501 for result publication in the study. Otherwise, if automatic
1502 publication is switched on, default value is used for result name.
1505 New GEOM.GEOM_Object, containing the created vector.
1507 # Example: see GEOM_TestAll.py
1508 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1509 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1510 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1511 anObj.SetParameters(Parameters)
1512 self._autoPublish(anObj, theName, "vector")
1515 ## Create a vector between two points.
1516 # @param thePnt1 Start point for the vector.
1517 # @param thePnt2 End point for the vector.
1518 # @param theName Object name; when specified, this parameter is used
1519 # for result publication in the study. Otherwise, if automatic
1520 # publication is switched on, default value is used for result name.
1522 # @return New GEOM.GEOM_Object, containing the created vector.
1524 # @ref tui_creation_vector "Example"
1525 @ManageTransactions("BasicOp")
1526 def MakeVector(self, thePnt1, thePnt2, theName=None):
1528 Create a vector between two points.
1531 thePnt1 Start point for the vector.
1532 thePnt2 End point for the vector.
1533 theName Object name; when specified, this parameter is used
1534 for result publication in the study. Otherwise, if automatic
1535 publication is switched on, default value is used for result name.
1538 New GEOM.GEOM_Object, containing the created vector.
1540 # Example: see GEOM_TestAll.py
1541 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1542 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1543 self._autoPublish(anObj, theName, "vector")
1546 ## Create a line, passing through the given point
1547 # and parrallel to the given direction
1548 # @param thePnt Point. The resulting line will pass through it.
1549 # @param theDir Direction. The resulting line will be parallel to it.
1550 # @param theName Object name; when specified, this parameter is used
1551 # for result publication in the study. Otherwise, if automatic
1552 # publication is switched on, default value is used for result name.
1554 # @return New GEOM.GEOM_Object, containing the created line.
1556 # @ref tui_creation_line "Example"
1557 @ManageTransactions("BasicOp")
1558 def MakeLine(self, thePnt, theDir, theName=None):
1560 Create a line, passing through the given point
1561 and parrallel to the given direction
1564 thePnt Point. The resulting line will pass through it.
1565 theDir Direction. The resulting line will be parallel to it.
1566 theName Object name; when specified, this parameter is used
1567 for result publication in the study. Otherwise, if automatic
1568 publication is switched on, default value is used for result name.
1571 New GEOM.GEOM_Object, containing the created line.
1573 # Example: see GEOM_TestAll.py
1574 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1575 RaiseIfFailed("MakeLine", self.BasicOp)
1576 self._autoPublish(anObj, theName, "line")
1579 ## Create a line, passing through the given points
1580 # @param thePnt1 First of two points, defining the line.
1581 # @param thePnt2 Second of two points, defining the line.
1582 # @param theName Object name; when specified, this parameter is used
1583 # for result publication in the study. Otherwise, if automatic
1584 # publication is switched on, default value is used for result name.
1586 # @return New GEOM.GEOM_Object, containing the created line.
1588 # @ref tui_creation_line "Example"
1589 @ManageTransactions("BasicOp")
1590 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1592 Create a line, passing through the given points
1595 thePnt1 First of two points, defining the line.
1596 thePnt2 Second of two points, defining the line.
1597 theName Object name; when specified, this parameter is used
1598 for result publication in the study. Otherwise, if automatic
1599 publication is switched on, default value is used for result name.
1602 New GEOM.GEOM_Object, containing the created line.
1604 # Example: see GEOM_TestAll.py
1605 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1606 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1607 self._autoPublish(anObj, theName, "line")
1610 ## Create a line on two faces intersection.
1611 # @param theFace1 First of two faces, defining the line.
1612 # @param theFace2 Second of two faces, defining the line.
1613 # @param theName Object name; when specified, this parameter is used
1614 # for result publication in the study. Otherwise, if automatic
1615 # publication is switched on, default value is used for result name.
1617 # @return New GEOM.GEOM_Object, containing the created line.
1619 # @ref swig_MakeLineTwoFaces "Example"
1620 @ManageTransactions("BasicOp")
1621 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1623 Create a line on two faces intersection.
1626 theFace1 First of two faces, defining the line.
1627 theFace2 Second of two faces, defining the line.
1628 theName Object name; when specified, this parameter is used
1629 for result publication in the study. Otherwise, if automatic
1630 publication is switched on, default value is used for result name.
1633 New GEOM.GEOM_Object, containing the created line.
1635 # Example: see GEOM_TestAll.py
1636 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1637 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1638 self._autoPublish(anObj, theName, "line")
1641 ## Create a plane, passing through the given point
1642 # and normal to the given vector.
1643 # @param thePnt Point, the plane has to pass through.
1644 # @param theVec Vector, defining the plane normal direction.
1645 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1646 # @param theName Object name; when specified, this parameter is used
1647 # for result publication in the study. Otherwise, if automatic
1648 # publication is switched on, default value is used for result name.
1650 # @return New GEOM.GEOM_Object, containing the created plane.
1652 # @ref tui_creation_plane "Example"
1653 @ManageTransactions("BasicOp")
1654 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1656 Create a plane, passing through the given point
1657 and normal to the given vector.
1660 thePnt Point, the plane has to pass through.
1661 theVec Vector, defining the plane normal direction.
1662 theTrimSize Half size of a side of quadrangle face, representing the plane.
1663 theName Object name; when specified, this parameter is used
1664 for result publication in the study. Otherwise, if automatic
1665 publication is switched on, default value is used for result name.
1668 New GEOM.GEOM_Object, containing the created plane.
1670 # Example: see GEOM_TestAll.py
1671 theTrimSize, Parameters = ParseParameters(theTrimSize);
1672 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1673 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1674 anObj.SetParameters(Parameters)
1675 self._autoPublish(anObj, theName, "plane")
1678 ## Create a plane, passing through the three given points
1679 # @param thePnt1 First of three points, defining the plane.
1680 # @param thePnt2 Second of three points, defining the plane.
1681 # @param thePnt3 Fird of three points, defining the plane.
1682 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1683 # @param theName Object name; when specified, this parameter is used
1684 # for result publication in the study. Otherwise, if automatic
1685 # publication is switched on, default value is used for result name.
1687 # @return New GEOM.GEOM_Object, containing the created plane.
1689 # @ref tui_creation_plane "Example"
1690 @ManageTransactions("BasicOp")
1691 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1693 Create a plane, passing through the three given points
1696 thePnt1 First of three points, defining the plane.
1697 thePnt2 Second of three points, defining the plane.
1698 thePnt3 Fird of three points, defining the plane.
1699 theTrimSize Half size of a side of quadrangle face, representing the plane.
1700 theName Object name; when specified, this parameter is used
1701 for result publication in the study. Otherwise, if automatic
1702 publication is switched on, default value is used for result name.
1705 New GEOM.GEOM_Object, containing the created plane.
1707 # Example: see GEOM_TestAll.py
1708 theTrimSize, Parameters = ParseParameters(theTrimSize);
1709 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1710 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1711 anObj.SetParameters(Parameters)
1712 self._autoPublish(anObj, theName, "plane")
1715 ## Create a plane, similar to the existing one, but with another size of representing face.
1716 # @param theFace Referenced plane or LCS(Marker).
1717 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1718 # @param theName Object name; when specified, this parameter is used
1719 # for result publication in the study. Otherwise, if automatic
1720 # publication is switched on, default value is used for result name.
1722 # @return New GEOM.GEOM_Object, containing the created plane.
1724 # @ref tui_creation_plane "Example"
1725 @ManageTransactions("BasicOp")
1726 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1728 Create a plane, similar to the existing one, but with another size of representing face.
1731 theFace Referenced plane or LCS(Marker).
1732 theTrimSize New half size of a side of quadrangle face, representing the plane.
1733 theName Object name; when specified, this parameter is used
1734 for result publication in the study. Otherwise, if automatic
1735 publication is switched on, default value is used for result name.
1738 New GEOM.GEOM_Object, containing the created plane.
1740 # Example: see GEOM_TestAll.py
1741 theTrimSize, Parameters = ParseParameters(theTrimSize);
1742 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1743 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1744 anObj.SetParameters(Parameters)
1745 self._autoPublish(anObj, theName, "plane")
1748 ## Create a plane, passing through the 2 vectors
1749 # with center in a start point of the first vector.
1750 # @param theVec1 Vector, defining center point and plane direction.
1751 # @param theVec2 Vector, defining the plane normal direction.
1752 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1753 # @param theName Object name; when specified, this parameter is used
1754 # for result publication in the study. Otherwise, if automatic
1755 # publication is switched on, default value is used for result name.
1757 # @return New GEOM.GEOM_Object, containing the created plane.
1759 # @ref tui_creation_plane "Example"
1760 @ManageTransactions("BasicOp")
1761 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1763 Create a plane, passing through the 2 vectors
1764 with center in a start point of the first vector.
1767 theVec1 Vector, defining center point and plane direction.
1768 theVec2 Vector, defining the plane normal direction.
1769 theTrimSize Half size of a side of quadrangle face, representing the plane.
1770 theName Object name; when specified, this parameter is used
1771 for result publication in the study. Otherwise, if automatic
1772 publication is switched on, default value is used for result name.
1775 New GEOM.GEOM_Object, containing the created plane.
1777 # Example: see GEOM_TestAll.py
1778 theTrimSize, Parameters = ParseParameters(theTrimSize);
1779 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1780 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1781 anObj.SetParameters(Parameters)
1782 self._autoPublish(anObj, theName, "plane")
1785 ## Create a plane, based on a Local coordinate system.
1786 # @param theLCS coordinate system, defining plane.
1787 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1788 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1789 # @param theName Object name; when specified, this parameter is used
1790 # for result publication in the study. Otherwise, if automatic
1791 # publication is switched on, default value is used for result name.
1793 # @return New GEOM.GEOM_Object, containing the created plane.
1795 # @ref tui_creation_plane "Example"
1796 @ManageTransactions("BasicOp")
1797 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1799 Create a plane, based on a Local coordinate system.
1802 theLCS coordinate system, defining plane.
1803 theTrimSize Half size of a side of quadrangle face, representing the plane.
1804 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1805 theName Object name; when specified, this parameter is used
1806 for result publication in the study. Otherwise, if automatic
1807 publication is switched on, default value is used for result name.
1810 New GEOM.GEOM_Object, containing the created plane.
1812 # Example: see GEOM_TestAll.py
1813 theTrimSize, Parameters = ParseParameters(theTrimSize);
1814 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1815 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1816 anObj.SetParameters(Parameters)
1817 self._autoPublish(anObj, theName, "plane")
1820 ## Create a local coordinate system.
1821 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1822 # @param XDX,XDY,XDZ Three components of OX direction
1823 # @param YDX,YDY,YDZ Three components of OY direction
1824 # @param theName Object name; when specified, this parameter is used
1825 # for result publication in the study. Otherwise, if automatic
1826 # publication is switched on, default value is used for result name.
1828 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1830 # @ref swig_MakeMarker "Example"
1831 @ManageTransactions("BasicOp")
1832 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1834 Create a local coordinate system.
1837 OX,OY,OZ Three coordinates of coordinate system origin.
1838 XDX,XDY,XDZ Three components of OX direction
1839 YDX,YDY,YDZ Three components of OY direction
1840 theName Object name; when specified, this parameter is used
1841 for result publication in the study. Otherwise, if automatic
1842 publication is switched on, default value is used for result name.
1845 New GEOM.GEOM_Object, containing the created coordinate system.
1847 # Example: see GEOM_TestAll.py
1848 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1849 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1850 RaiseIfFailed("MakeMarker", self.BasicOp)
1851 anObj.SetParameters(Parameters)
1852 self._autoPublish(anObj, theName, "lcs")
1855 ## Create a local coordinate system from shape.
1856 # @param theShape The initial shape to detect the coordinate system.
1857 # @param theName Object name; when specified, this parameter is used
1858 # for result publication in the study. Otherwise, if automatic
1859 # publication is switched on, default value is used for result name.
1861 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1863 # @ref tui_creation_lcs "Example"
1864 @ManageTransactions("BasicOp")
1865 def MakeMarkerFromShape(self, theShape, theName=None):
1867 Create a local coordinate system from shape.
1870 theShape The initial shape to detect the coordinate system.
1871 theName Object name; when specified, this parameter is used
1872 for result publication in the study. Otherwise, if automatic
1873 publication is switched on, default value is used for result name.
1876 New GEOM.GEOM_Object, containing the created coordinate system.
1878 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1879 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1880 self._autoPublish(anObj, theName, "lcs")
1883 ## Create a local coordinate system from point and two vectors.
1884 # @param theOrigin Point of coordinate system origin.
1885 # @param theXVec Vector of X direction
1886 # @param theYVec Vector of Y direction
1887 # @param theName Object name; when specified, this parameter is used
1888 # for result publication in the study. Otherwise, if automatic
1889 # publication is switched on, default value is used for result name.
1891 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1893 # @ref tui_creation_lcs "Example"
1894 @ManageTransactions("BasicOp")
1895 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1897 Create a local coordinate system from point and two vectors.
1900 theOrigin Point of coordinate system origin.
1901 theXVec Vector of X direction
1902 theYVec Vector of Y direction
1903 theName Object name; when specified, this parameter is used
1904 for result publication in the study. Otherwise, if automatic
1905 publication is switched on, default value is used for result name.
1908 New GEOM.GEOM_Object, containing the created coordinate system.
1911 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1912 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1913 self._autoPublish(anObj, theName, "lcs")
1916 # end of l3_basic_go
1919 ## @addtogroup l4_curves
1922 ## Create an arc of circle, passing through three given points.
1923 # @param thePnt1 Start point of the arc.
1924 # @param thePnt2 Middle point of the arc.
1925 # @param thePnt3 End point of the arc.
1926 # @param theName Object name; when specified, this parameter is used
1927 # for result publication in the study. Otherwise, if automatic
1928 # publication is switched on, default value is used for result name.
1930 # @return New GEOM.GEOM_Object, containing the created arc.
1932 # @ref swig_MakeArc "Example"
1933 @ManageTransactions("CurvesOp")
1934 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1936 Create an arc of circle, passing through three given points.
1939 thePnt1 Start point of the arc.
1940 thePnt2 Middle point of the arc.
1941 thePnt3 End point of the arc.
1942 theName Object name; when specified, this parameter is used
1943 for result publication in the study. Otherwise, if automatic
1944 publication is switched on, default value is used for result name.
1947 New GEOM.GEOM_Object, containing the created arc.
1949 # Example: see GEOM_TestAll.py
1950 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1951 RaiseIfFailed("MakeArc", self.CurvesOp)
1952 self._autoPublish(anObj, theName, "arc")
1955 ## Create an arc of circle from a center and 2 points.
1956 # @param thePnt1 Center of the arc
1957 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1958 # @param thePnt3 End point of the arc (Gives also a direction)
1959 # @param theSense Orientation of the arc
1960 # @param theName Object name; when specified, this parameter is used
1961 # for result publication in the study. Otherwise, if automatic
1962 # publication is switched on, default value is used for result name.
1964 # @return New GEOM.GEOM_Object, containing the created arc.
1966 # @ref swig_MakeArc "Example"
1967 @ManageTransactions("CurvesOp")
1968 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1970 Create an arc of circle from a center and 2 points.
1973 thePnt1 Center of the arc
1974 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1975 thePnt3 End point of the arc (Gives also a direction)
1976 theSense Orientation of the arc
1977 theName Object name; when specified, this parameter is used
1978 for result publication in the study. Otherwise, if automatic
1979 publication is switched on, default value is used for result name.
1982 New GEOM.GEOM_Object, containing the created arc.
1984 # Example: see GEOM_TestAll.py
1985 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1986 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1987 self._autoPublish(anObj, theName, "arc")
1990 ## Create an arc of ellipse, of center and two points.
1991 # @param theCenter Center of the arc.
1992 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1993 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1994 # @param theName Object name; when specified, this parameter is used
1995 # for result publication in the study. Otherwise, if automatic
1996 # publication is switched on, default value is used for result name.
1998 # @return New GEOM.GEOM_Object, containing the created arc.
2000 # @ref swig_MakeArc "Example"
2001 @ManageTransactions("CurvesOp")
2002 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2004 Create an arc of ellipse, of center and two points.
2007 theCenter Center of the arc.
2008 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2009 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2010 theName Object name; when specified, this parameter is used
2011 for result publication in the study. Otherwise, if automatic
2012 publication is switched on, default value is used for result name.
2015 New GEOM.GEOM_Object, containing the created arc.
2017 # Example: see GEOM_TestAll.py
2018 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2019 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2020 self._autoPublish(anObj, theName, "arc")
2023 ## Create a circle with given center, normal vector and radius.
2024 # @param thePnt Circle center.
2025 # @param theVec Vector, normal to the plane of the circle.
2026 # @param theR Circle radius.
2027 # @param theName Object name; when specified, this parameter is used
2028 # for result publication in the study. Otherwise, if automatic
2029 # publication is switched on, default value is used for result name.
2031 # @return New GEOM.GEOM_Object, containing the created circle.
2033 # @ref tui_creation_circle "Example"
2034 @ManageTransactions("CurvesOp")
2035 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2037 Create a circle with given center, normal vector and radius.
2040 thePnt Circle center.
2041 theVec Vector, normal to the plane of the circle.
2043 theName Object name; when specified, this parameter is used
2044 for result publication in the study. Otherwise, if automatic
2045 publication is switched on, default value is used for result name.
2048 New GEOM.GEOM_Object, containing the created circle.
2050 # Example: see GEOM_TestAll.py
2051 theR, Parameters = ParseParameters(theR)
2052 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2053 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2054 anObj.SetParameters(Parameters)
2055 self._autoPublish(anObj, theName, "circle")
2058 ## Create a circle with given radius.
2059 # Center of the circle will be in the origin of global
2060 # coordinate system and normal vector will be codirected with Z axis
2061 # @param theR Circle radius.
2062 # @param theName Object name; when specified, this parameter is used
2063 # for result publication in the study. Otherwise, if automatic
2064 # publication is switched on, default value is used for result name.
2066 # @return New GEOM.GEOM_Object, containing the created circle.
2067 @ManageTransactions("CurvesOp")
2068 def MakeCircleR(self, theR, theName=None):
2070 Create a circle with given radius.
2071 Center of the circle will be in the origin of global
2072 coordinate system and normal vector will be codirected with Z axis
2076 theName Object name; when specified, this parameter is used
2077 for result publication in the study. Otherwise, if automatic
2078 publication is switched on, default value is used for result name.
2081 New GEOM.GEOM_Object, containing the created circle.
2083 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2084 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2085 self._autoPublish(anObj, theName, "circle")
2088 ## Create a circle, passing through three given points
2089 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2090 # @param theName Object name; when specified, this parameter is used
2091 # for result publication in the study. Otherwise, if automatic
2092 # publication is switched on, default value is used for result name.
2094 # @return New GEOM.GEOM_Object, containing the created circle.
2096 # @ref tui_creation_circle "Example"
2097 @ManageTransactions("CurvesOp")
2098 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2100 Create a circle, passing through three given points
2103 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2104 theName Object name; when specified, this parameter is used
2105 for result publication in the study. Otherwise, if automatic
2106 publication is switched on, default value is used for result name.
2109 New GEOM.GEOM_Object, containing the created circle.
2111 # Example: see GEOM_TestAll.py
2112 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2113 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2114 self._autoPublish(anObj, theName, "circle")
2117 ## Create a circle, with given point1 as center,
2118 # passing through the point2 as radius and laying in the plane,
2119 # defined by all three given points.
2120 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2121 # @param theName Object name; when specified, this parameter is used
2122 # for result publication in the study. Otherwise, if automatic
2123 # publication is switched on, default value is used for result name.
2125 # @return New GEOM.GEOM_Object, containing the created circle.
2127 # @ref swig_MakeCircle "Example"
2128 @ManageTransactions("CurvesOp")
2129 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2131 Create a circle, with given point1 as center,
2132 passing through the point2 as radius and laying in the plane,
2133 defined by all three given points.
2136 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2137 theName Object name; when specified, this parameter is used
2138 for result publication in the study. Otherwise, if automatic
2139 publication is switched on, default value is used for result name.
2142 New GEOM.GEOM_Object, containing the created circle.
2144 # Example: see GEOM_example6.py
2145 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2146 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2147 self._autoPublish(anObj, theName, "circle")
2150 ## Create an ellipse with given center, normal vector and radiuses.
2151 # @param thePnt Ellipse center.
2152 # @param theVec Vector, normal to the plane of the ellipse.
2153 # @param theRMajor Major ellipse radius.
2154 # @param theRMinor Minor ellipse radius.
2155 # @param theVecMaj Vector, direction of the ellipse's main axis.
2156 # @param theName Object name; when specified, this parameter is used
2157 # for result publication in the study. Otherwise, if automatic
2158 # publication is switched on, default value is used for result name.
2160 # @return New GEOM.GEOM_Object, containing the created ellipse.
2162 # @ref tui_creation_ellipse "Example"
2163 @ManageTransactions("CurvesOp")
2164 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2166 Create an ellipse with given center, normal vector and radiuses.
2169 thePnt Ellipse center.
2170 theVec Vector, normal to the plane of the ellipse.
2171 theRMajor Major ellipse radius.
2172 theRMinor Minor ellipse radius.
2173 theVecMaj Vector, direction of the ellipse's main axis.
2174 theName Object name; when specified, this parameter is used
2175 for result publication in the study. Otherwise, if automatic
2176 publication is switched on, default value is used for result name.
2179 New GEOM.GEOM_Object, containing the created ellipse.
2181 # Example: see GEOM_TestAll.py
2182 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2183 if theVecMaj is not None:
2184 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2186 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2188 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2189 anObj.SetParameters(Parameters)
2190 self._autoPublish(anObj, theName, "ellipse")
2193 ## Create an ellipse with given radiuses.
2194 # Center of the ellipse will be in the origin of global
2195 # coordinate system and normal vector will be codirected with Z axis
2196 # @param theRMajor Major ellipse radius.
2197 # @param theRMinor Minor ellipse radius.
2198 # @param theName Object name; when specified, this parameter is used
2199 # for result publication in the study. Otherwise, if automatic
2200 # publication is switched on, default value is used for result name.
2202 # @return New GEOM.GEOM_Object, containing the created ellipse.
2203 @ManageTransactions("CurvesOp")
2204 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2206 Create an ellipse with given radiuses.
2207 Center of the ellipse will be in the origin of global
2208 coordinate system and normal vector will be codirected with Z axis
2211 theRMajor Major ellipse radius.
2212 theRMinor Minor ellipse radius.
2213 theName Object name; when specified, this parameter is used
2214 for result publication in the study. Otherwise, if automatic
2215 publication is switched on, default value is used for result name.
2218 New GEOM.GEOM_Object, containing the created ellipse.
2220 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2221 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2222 self._autoPublish(anObj, theName, "ellipse")
2225 ## Create a polyline on the set of points.
2226 # @param thePoints Sequence of points for the polyline.
2227 # @param theIsClosed If True, build a closed wire.
2228 # @param theName Object name; when specified, this parameter is used
2229 # for result publication in the study. Otherwise, if automatic
2230 # publication is switched on, default value is used for result name.
2232 # @return New GEOM.GEOM_Object, containing the created polyline.
2234 # @ref tui_creation_curve "Example"
2235 @ManageTransactions("CurvesOp")
2236 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2238 Create a polyline on the set of points.
2241 thePoints Sequence of points for the polyline.
2242 theIsClosed If True, build a closed wire.
2243 theName Object name; when specified, this parameter is used
2244 for result publication in the study. Otherwise, if automatic
2245 publication is switched on, default value is used for result name.
2248 New GEOM.GEOM_Object, containing the created polyline.
2250 # Example: see GEOM_TestAll.py
2251 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2252 RaiseIfFailed("MakePolyline", self.CurvesOp)
2253 self._autoPublish(anObj, theName, "polyline")
2256 ## Create bezier curve on the set of points.
2257 # @param thePoints Sequence of points for the bezier curve.
2258 # @param theIsClosed If True, build a closed curve.
2259 # @param theName Object name; when specified, this parameter is used
2260 # for result publication in the study. Otherwise, if automatic
2261 # publication is switched on, default value is used for result name.
2263 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2265 # @ref tui_creation_curve "Example"
2266 @ManageTransactions("CurvesOp")
2267 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2269 Create bezier curve on the set of points.
2272 thePoints Sequence of points for the bezier curve.
2273 theIsClosed If True, build a closed curve.
2274 theName Object name; when specified, this parameter is used
2275 for result publication in the study. Otherwise, if automatic
2276 publication is switched on, default value is used for result name.
2279 New GEOM.GEOM_Object, containing the created bezier curve.
2281 # Example: see GEOM_TestAll.py
2282 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2283 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2284 self._autoPublish(anObj, theName, "bezier")
2287 ## Create B-Spline curve on the set of points.
2288 # @param thePoints Sequence of points for the B-Spline curve.
2289 # @param theIsClosed If True, build a closed curve.
2290 # @param theDoReordering If TRUE, the algo does not follow the order of
2291 # \a thePoints but searches for the closest vertex.
2292 # @param theName Object name; when specified, this parameter is used
2293 # for result publication in the study. Otherwise, if automatic
2294 # publication is switched on, default value is used for result name.
2296 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2298 # @ref tui_creation_curve "Example"
2299 @ManageTransactions("CurvesOp")
2300 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2302 Create B-Spline curve on the set of points.
2305 thePoints Sequence of points for the B-Spline curve.
2306 theIsClosed If True, build a closed curve.
2307 theDoReordering If True, the algo does not follow the order of
2308 thePoints but searches for the closest vertex.
2309 theName Object name; when specified, this parameter is used
2310 for result publication in the study. Otherwise, if automatic
2311 publication is switched on, default value is used for result name.
2314 New GEOM.GEOM_Object, containing the created B-Spline curve.
2316 # Example: see GEOM_TestAll.py
2317 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2318 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2319 self._autoPublish(anObj, theName, "bspline")
2322 ## Create B-Spline curve on the set of points.
2323 # @param thePoints Sequence of points for the B-Spline curve.
2324 # @param theFirstVec Vector object, defining the curve direction at its first point.
2325 # @param theLastVec Vector object, defining the curve direction at its last point.
2326 # @param theName Object name; when specified, this parameter is used
2327 # for result publication in the study. Otherwise, if automatic
2328 # publication is switched on, default value is used for result name.
2330 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2332 # @ref tui_creation_curve "Example"
2333 @ManageTransactions("CurvesOp")
2334 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2336 Create B-Spline curve on the set of points.
2339 thePoints Sequence of points for the B-Spline curve.
2340 theFirstVec Vector object, defining the curve direction at its first point.
2341 theLastVec Vector object, defining the curve direction at its last point.
2342 theName Object name; when specified, this parameter is used
2343 for result publication in the study. Otherwise, if automatic
2344 publication is switched on, default value is used for result name.
2347 New GEOM.GEOM_Object, containing the created B-Spline curve.
2349 # Example: see GEOM_TestAll.py
2350 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2351 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2352 self._autoPublish(anObj, theName, "bspline")
2355 ## Creates a curve using the parametric definition of the basic points.
2356 # @param thexExpr parametric equation of the coordinates X.
2357 # @param theyExpr parametric equation of the coordinates Y.
2358 # @param thezExpr parametric equation of the coordinates Z.
2359 # @param theParamMin the minimal value of the parameter.
2360 # @param theParamMax the maximum value of the parameter.
2361 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2362 # @param theCurveType the type of the curve,
2363 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2364 # @param theNewMethod flag for switching to the new method if the flag is set to false a deprecated method is used which can lead to a bug.
2365 # @param theName Object name; when specified, this parameter is used
2366 # for result publication in the study. Otherwise, if automatic
2367 # publication is switched on, default value is used for result name.
2369 # @return New GEOM.GEOM_Object, containing the created curve.
2371 # @ref tui_creation_curve "Example"
2372 @ManageTransactions("CurvesOp")
2373 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2374 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2376 Creates a curve using the parametric definition of the basic points.
2379 thexExpr parametric equation of the coordinates X.
2380 theyExpr parametric equation of the coordinates Y.
2381 thezExpr parametric equation of the coordinates Z.
2382 theParamMin the minimal value of the parameter.
2383 theParamMax the maximum value of the parameter.
2384 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2385 theCurveType the type of the curve,
2386 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2387 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2388 method is used which can lead to a bug.
2389 theName Object name; when specified, this parameter is used
2390 for result publication in the study. Otherwise, if automatic
2391 publication is switched on, default value is used for result name.
2394 New GEOM.GEOM_Object, containing the created curve.
2396 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2398 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2400 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2401 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2402 anObj.SetParameters(Parameters)
2403 self._autoPublish(anObj, theName, "curve")
2406 ## Create an isoline curve on a face.
2407 # @param theFace the face for which an isoline is created.
2408 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2410 # @param theParameter the U parameter for U-isoline or V parameter
2412 # @param theName Object name; when specified, this parameter is used
2413 # for result publication in the study. Otherwise, if automatic
2414 # publication is switched on, default value is used for result name.
2416 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2417 # a compound of edges.
2419 # @ref tui_creation_curve "Example"
2420 @ManageTransactions("CurvesOp")
2421 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2423 Create an isoline curve on a face.
2426 theFace the face for which an isoline is created.
2427 IsUIsoline True for U-isoline creation; False for V-isoline
2429 theParameter the U parameter for U-isoline or V parameter
2431 theName Object name; when specified, this parameter is used
2432 for result publication in the study. Otherwise, if automatic
2433 publication is switched on, default value is used for result name.
2436 New GEOM.GEOM_Object, containing the created isoline edge or a
2439 # Example: see GEOM_TestAll.py
2440 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2441 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2443 self._autoPublish(anObj, theName, "U-Isoline")
2445 self._autoPublish(anObj, theName, "V-Isoline")
2451 ## @addtogroup l3_sketcher
2454 ## Create a sketcher (wire or face), following the textual description,
2455 # passed through <VAR>theCommand</VAR> argument. \n
2456 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2457 # Format of the description string have to be the following:
2459 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2462 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2464 # - "R angle" : Set the direction by angle
2465 # - "D dx dy" : Set the direction by DX & DY
2468 # - "TT x y" : Create segment by point at X & Y
2469 # - "T dx dy" : Create segment by point with DX & DY
2470 # - "L length" : Create segment by direction & Length
2471 # - "IX x" : Create segment by direction & Intersect. X
2472 # - "IY y" : Create segment by direction & Intersect. Y
2475 # - "C radius length" : Create arc by direction, radius and length(in degree)
2476 # - "AA x y": Create arc by point at X & Y
2477 # - "A dx dy" : Create arc by point with DX & DY
2478 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2479 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2480 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2481 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2484 # - "WW" : Close Wire (to finish)
2485 # - "WF" : Close Wire and build face (to finish)
2488 # - Flag1 (= reverse) is 0 or 2 ...
2489 # - if 0 the drawn arc is the one of lower angle (< Pi)
2490 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2493 # - Flag2 (= control tolerance) is 0 or 1 ...
2494 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2495 # - if 1 the wire is built only if the end point is on the arc
2496 # with a tolerance of 10^-7 on the distance else the creation fails
2498 # @param theCommand String, defining the sketcher in local
2499 # coordinates of the working plane.
2500 # @param theWorkingPlane Nine double values, defining origin,
2501 # OZ and OX directions of the working plane.
2502 # @param theName Object name; when specified, this parameter is used
2503 # for result publication in the study. Otherwise, if automatic
2504 # publication is switched on, default value is used for result name.
2506 # @return New GEOM.GEOM_Object, containing the created wire.
2508 # @ref tui_sketcher_page "Example"
2509 @ManageTransactions("CurvesOp")
2510 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2512 Create a sketcher (wire or face), following the textual description, passed
2513 through theCommand argument.
2514 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2515 Format of the description string have to be the following:
2516 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2518 - x1, y1 are coordinates of the first sketcher point (zero by default),
2520 - "R angle" : Set the direction by angle
2521 - "D dx dy" : Set the direction by DX & DY
2523 - "TT x y" : Create segment by point at X & Y
2524 - "T dx dy" : Create segment by point with DX & DY
2525 - "L length" : Create segment by direction & Length
2526 - "IX x" : Create segment by direction & Intersect. X
2527 - "IY y" : Create segment by direction & Intersect. Y
2529 - "C radius length" : Create arc by direction, radius and length(in degree)
2530 - "AA x y": Create arc by point at X & Y
2531 - "A dx dy" : Create arc by point with DX & DY
2532 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2533 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2534 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2535 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2537 - "WW" : Close Wire (to finish)
2538 - "WF" : Close Wire and build face (to finish)
2540 - Flag1 (= reverse) is 0 or 2 ...
2541 - if 0 the drawn arc is the one of lower angle (< Pi)
2542 - if 2 the drawn arc ius the one of greater angle (> Pi)
2544 - Flag2 (= control tolerance) is 0 or 1 ...
2545 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2546 - if 1 the wire is built only if the end point is on the arc
2547 with a tolerance of 10^-7 on the distance else the creation fails
2550 theCommand String, defining the sketcher in local
2551 coordinates of the working plane.
2552 theWorkingPlane Nine double values, defining origin,
2553 OZ and OX directions of the working plane.
2554 theName Object name; when specified, this parameter is used
2555 for result publication in the study. Otherwise, if automatic
2556 publication is switched on, default value is used for result name.
2559 New GEOM.GEOM_Object, containing the created wire.
2561 # Example: see GEOM_TestAll.py
2562 theCommand,Parameters = ParseSketcherCommand(theCommand)
2563 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2564 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2565 anObj.SetParameters(Parameters)
2566 self._autoPublish(anObj, theName, "wire")
2569 ## Create a sketcher (wire or face), following the textual description,
2570 # passed through <VAR>theCommand</VAR> argument. \n
2571 # For format of the description string see MakeSketcher() method.\n
2572 # @param theCommand String, defining the sketcher in local
2573 # coordinates of the working plane.
2574 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2575 # @param theName Object name; when specified, this parameter is used
2576 # for result publication in the study. Otherwise, if automatic
2577 # publication is switched on, default value is used for result name.
2579 # @return New GEOM.GEOM_Object, containing the created wire.
2581 # @ref tui_sketcher_page "Example"
2582 @ManageTransactions("CurvesOp")
2583 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2585 Create a sketcher (wire or face), following the textual description,
2586 passed through theCommand argument.
2587 For format of the description string see geompy.MakeSketcher() method.
2590 theCommand String, defining the sketcher in local
2591 coordinates of the working plane.
2592 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2593 theName Object name; when specified, this parameter is used
2594 for result publication in the study. Otherwise, if automatic
2595 publication is switched on, default value is used for result name.
2598 New GEOM.GEOM_Object, containing the created wire.
2600 theCommand,Parameters = ParseSketcherCommand(theCommand)
2601 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2602 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2603 anObj.SetParameters(Parameters)
2604 self._autoPublish(anObj, theName, "wire")
2607 ## Obtain a 2D sketcher interface
2608 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2609 def Sketcher2D (self):
2611 Obtain a 2D sketcher interface.
2614 sk = geompy.Sketcher2D()
2616 sk.addSegmentRelative(15, 70)
2617 sk.addSegmentPerpY(50)
2618 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2619 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2620 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2622 Sketch_1 = sk.wire(geomObj_1)
2624 sk = Sketcher2D (self)
2627 ## Create a sketcher wire, following the numerical description,
2628 # passed through <VAR>theCoordinates</VAR> argument. \n
2629 # @param theCoordinates double values, defining points to create a wire,
2631 # @param theName Object name; when specified, this parameter is used
2632 # for result publication in the study. Otherwise, if automatic
2633 # publication is switched on, default value is used for result name.
2635 # @return New GEOM.GEOM_Object, containing the created wire.
2637 # @ref tui_3dsketcher_page "Example"
2638 @ManageTransactions("CurvesOp")
2639 def Make3DSketcher(self, theCoordinates, theName=None):
2641 Create a sketcher wire, following the numerical description,
2642 passed through theCoordinates argument.
2645 theCoordinates double values, defining points to create a wire,
2647 theName Object name; when specified, this parameter is used
2648 for result publication in the study. Otherwise, if automatic
2649 publication is switched on, default value is used for result name.
2652 New GEOM_Object, containing the created wire.
2654 theCoordinates,Parameters = ParseParameters(theCoordinates)
2655 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2656 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2657 anObj.SetParameters(Parameters)
2658 self._autoPublish(anObj, theName, "wire")
2661 ## Obtain a 3D sketcher interface
2662 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2664 # @ref tui_3dsketcher_page "Example"
2665 def Sketcher3D (self):
2667 Obtain a 3D sketcher interface.
2670 sk = geompy.Sketcher3D()
2671 sk.addPointsAbsolute(0,0,0, 70,0,0)
2672 sk.addPointsRelative(0, 0, 130)
2673 sk.addPointAnglesLength("OXY", 50, 0, 100)
2674 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2676 a3D_Sketcher_1 = sk.wire()
2678 sk = Sketcher3D (self)
2681 ## Obtain a 2D polyline creation interface
2682 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2684 # @ref tui_3dsketcher_page "Example"
2685 def Polyline2D (self):
2687 Obtain a 2D polyline creation interface.
2690 pl = geompy.Polyline2D()
2691 pl.addSection("section 1", GEOM.Polyline, True)
2692 pl.addPoints(0, 0, 10, 0, 10, 10)
2693 pl.addSection("section 2", GEOM.Interpolation, False)
2694 pl.addPoints(20, 0, 30, 0, 30, 10)
2695 resultObj = pl.result(WorkingPlane)
2697 pl = Polyline2D (self)
2700 # end of l3_sketcher
2703 ## @addtogroup l3_3d_primitives
2706 ## Create a box by coordinates of two opposite vertices.
2708 # @param x1,y1,z1 double values, defining first point it.
2709 # @param x2,y2,z2 double values, defining first point it.
2710 # @param theName Object name; when specified, this parameter is used
2711 # for result publication in the study. Otherwise, if automatic
2712 # publication is switched on, default value is used for result name.
2714 # @return New GEOM.GEOM_Object, containing the created box.
2716 # @ref tui_creation_box "Example"
2717 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2719 Create a box by coordinates of two opposite vertices.
2722 x1,y1,z1 double values, defining first point.
2723 x2,y2,z2 double values, defining second point.
2724 theName Object name; when specified, this parameter is used
2725 for result publication in the study. Otherwise, if automatic
2726 publication is switched on, default value is used for result name.
2729 New GEOM.GEOM_Object, containing the created box.
2731 # Example: see GEOM_TestAll.py
2732 pnt1 = self.MakeVertex(x1,y1,z1)
2733 pnt2 = self.MakeVertex(x2,y2,z2)
2734 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2735 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2737 ## Create a box with specified dimensions along the coordinate axes
2738 # and with edges, parallel to the coordinate axes.
2739 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2740 # @param theDX Length of Box edges, parallel to OX axis.
2741 # @param theDY Length of Box edges, parallel to OY axis.
2742 # @param theDZ Length of Box edges, parallel to OZ axis.
2743 # @param theName Object name; when specified, this parameter is used
2744 # for result publication in the study. Otherwise, if automatic
2745 # publication is switched on, default value is used for result name.
2747 # @return New GEOM.GEOM_Object, containing the created box.
2749 # @ref tui_creation_box "Example"
2750 @ManageTransactions("PrimOp")
2751 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2753 Create a box with specified dimensions along the coordinate axes
2754 and with edges, parallel to the coordinate axes.
2755 Center of the box will be at point (DX/2, DY/2, DZ/2).
2758 theDX Length of Box edges, parallel to OX axis.
2759 theDY Length of Box edges, parallel to OY axis.
2760 theDZ Length of Box edges, parallel to OZ axis.
2761 theName Object name; when specified, this parameter is used
2762 for result publication in the study. Otherwise, if automatic
2763 publication is switched on, default value is used for result name.
2766 New GEOM.GEOM_Object, containing the created box.
2768 # Example: see GEOM_TestAll.py
2769 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2770 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2771 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2772 anObj.SetParameters(Parameters)
2773 self._autoPublish(anObj, theName, "box")
2776 ## Create a box with two specified opposite vertices,
2777 # and with edges, parallel to the coordinate axes
2778 # @param thePnt1 First of two opposite vertices.
2779 # @param thePnt2 Second of two opposite vertices.
2780 # @param theName Object name; when specified, this parameter is used
2781 # for result publication in the study. Otherwise, if automatic
2782 # publication is switched on, default value is used for result name.
2784 # @return New GEOM.GEOM_Object, containing the created box.
2786 # @ref tui_creation_box "Example"
2787 @ManageTransactions("PrimOp")
2788 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2790 Create a box with two specified opposite vertices,
2791 and with edges, parallel to the coordinate axes
2794 thePnt1 First of two opposite vertices.
2795 thePnt2 Second of two opposite vertices.
2796 theName Object name; when specified, this parameter is used
2797 for result publication in the study. Otherwise, if automatic
2798 publication is switched on, default value is used for result name.
2801 New GEOM.GEOM_Object, containing the created box.
2803 # Example: see GEOM_TestAll.py
2804 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2805 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2806 self._autoPublish(anObj, theName, "box")
2809 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2810 # @param theH height of Face.
2811 # @param theW width of Face.
2812 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2813 # @param theName Object name; when specified, this parameter is used
2814 # for result publication in the study. Otherwise, if automatic
2815 # publication is switched on, default value is used for result name.
2817 # @return New GEOM.GEOM_Object, containing the created face.
2819 # @ref tui_creation_face "Example"
2820 @ManageTransactions("PrimOp")
2821 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2823 Create a face with specified dimensions with edges parallel to coordinate axes.
2826 theH height of Face.
2828 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2829 theName Object name; when specified, this parameter is used
2830 for result publication in the study. Otherwise, if automatic
2831 publication is switched on, default value is used for result name.
2834 New GEOM.GEOM_Object, containing the created face.
2836 # Example: see GEOM_TestAll.py
2837 theH,theW,Parameters = ParseParameters(theH, theW)
2838 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2839 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2840 anObj.SetParameters(Parameters)
2841 self._autoPublish(anObj, theName, "rectangle")
2844 ## Create a face from another plane and two sizes,
2845 # vertical size and horisontal size.
2846 # @param theObj Normale vector to the creating face or
2848 # @param theH Height (vertical size).
2849 # @param theW Width (horisontal size).
2850 # @param theName Object name; when specified, this parameter is used
2851 # for result publication in the study. Otherwise, if automatic
2852 # publication is switched on, default value is used for result name.
2854 # @return New GEOM.GEOM_Object, containing the created face.
2856 # @ref tui_creation_face "Example"
2857 @ManageTransactions("PrimOp")
2858 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2860 Create a face from another plane and two sizes,
2861 vertical size and horisontal size.
2864 theObj Normale vector to the creating face or
2866 theH Height (vertical size).
2867 theW Width (horisontal size).
2868 theName Object name; when specified, this parameter is used
2869 for result publication in the study. Otherwise, if automatic
2870 publication is switched on, default value is used for result name.
2873 New GEOM_Object, containing the created face.
2875 # Example: see GEOM_TestAll.py
2876 theH,theW,Parameters = ParseParameters(theH, theW)
2877 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2878 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2879 anObj.SetParameters(Parameters)
2880 self._autoPublish(anObj, theName, "rectangle")
2883 ## Create a disk with given center, normal vector and radius.
2884 # @param thePnt Disk center.
2885 # @param theVec Vector, normal to the plane of the disk.
2886 # @param theR Disk radius.
2887 # @param theName Object name; when specified, this parameter is used
2888 # for result publication in the study. Otherwise, if automatic
2889 # publication is switched on, default value is used for result name.
2891 # @return New GEOM.GEOM_Object, containing the created disk.
2893 # @ref tui_creation_disk "Example"
2894 @ManageTransactions("PrimOp")
2895 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2897 Create a disk with given center, normal vector and radius.
2901 theVec Vector, normal to the plane of the disk.
2903 theName Object name; when specified, this parameter is used
2904 for result publication in the study. Otherwise, if automatic
2905 publication is switched on, default value is used for result name.
2908 New GEOM.GEOM_Object, containing the created disk.
2910 # Example: see GEOM_TestAll.py
2911 theR,Parameters = ParseParameters(theR)
2912 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2913 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2914 anObj.SetParameters(Parameters)
2915 self._autoPublish(anObj, theName, "disk")
2918 ## Create a disk, passing through three given points
2919 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2920 # @param theName Object name; when specified, this parameter is used
2921 # for result publication in the study. Otherwise, if automatic
2922 # publication is switched on, default value is used for result name.
2924 # @return New GEOM.GEOM_Object, containing the created disk.
2926 # @ref tui_creation_disk "Example"
2927 @ManageTransactions("PrimOp")
2928 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2930 Create a disk, passing through three given points
2933 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2934 theName Object name; when specified, this parameter is used
2935 for result publication in the study. Otherwise, if automatic
2936 publication is switched on, default value is used for result name.
2939 New GEOM.GEOM_Object, containing the created disk.
2941 # Example: see GEOM_TestAll.py
2942 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2943 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2944 self._autoPublish(anObj, theName, "disk")
2947 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2948 # @param theR Radius of Face.
2949 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2950 # @param theName Object name; when specified, this parameter is used
2951 # for result publication in the study. Otherwise, if automatic
2952 # publication is switched on, default value is used for result name.
2954 # @return New GEOM.GEOM_Object, containing the created disk.
2956 # @ref tui_creation_face "Example"
2957 @ManageTransactions("PrimOp")
2958 def MakeDiskR(self, theR, theOrientation, theName=None):
2960 Create a disk with specified dimensions along OX-OY coordinate axes.
2963 theR Radius of Face.
2964 theOrientation set the orientation belong axis OXY or OYZ or OZX
2965 theName Object name; when specified, this parameter is used
2966 for result publication in the study. Otherwise, if automatic
2967 publication is switched on, default value is used for result name.
2970 New GEOM.GEOM_Object, containing the created disk.
2973 Disk3 = geompy.MakeDiskR(100., 1)
2975 # Example: see GEOM_TestAll.py
2976 theR,Parameters = ParseParameters(theR)
2977 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2978 RaiseIfFailed("MakeDiskR", self.PrimOp)
2979 anObj.SetParameters(Parameters)
2980 self._autoPublish(anObj, theName, "disk")
2983 ## Create a cylinder with given base point, axis, radius and height.
2984 # @param thePnt Central point of cylinder base.
2985 # @param theAxis Cylinder axis.
2986 # @param theR Cylinder radius.
2987 # @param theH Cylinder height.
2988 # @param theName Object name; when specified, this parameter is used
2989 # for result publication in the study. Otherwise, if automatic
2990 # publication is switched on, default value is used for result name.
2992 # @return New GEOM.GEOM_Object, containing the created cylinder.
2994 # @ref tui_creation_cylinder "Example"
2995 @ManageTransactions("PrimOp")
2996 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2998 Create a cylinder with given base point, axis, radius and height.
3001 thePnt Central point of cylinder base.
3002 theAxis Cylinder axis.
3003 theR Cylinder radius.
3004 theH Cylinder height.
3005 theName Object name; when specified, this parameter is used
3006 for result publication in the study. Otherwise, if automatic
3007 publication is switched on, default value is used for result name.
3010 New GEOM.GEOM_Object, containing the created cylinder.
3012 # Example: see GEOM_TestAll.py
3013 theR,theH,Parameters = ParseParameters(theR, theH)
3014 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3015 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3016 anObj.SetParameters(Parameters)
3017 self._autoPublish(anObj, theName, "cylinder")
3020 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3021 # @param thePnt Central point of cylinder base.
3022 # @param theAxis Cylinder axis.
3023 # @param theR Cylinder radius.
3024 # @param theH Cylinder height.
3025 # @param theA Cylinder angle in radians.
3026 # @param theName Object name; when specified, this parameter is used
3027 # for result publication in the study. Otherwise, if automatic
3028 # publication is switched on, default value is used for result name.
3030 # @return New GEOM.GEOM_Object, containing the created cylinder.
3032 # @ref tui_creation_cylinder "Example"
3033 @ManageTransactions("PrimOp")
3034 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3036 Create a portion of cylinder with given base point, axis, radius, height and angle.
3039 thePnt Central point of cylinder base.
3040 theAxis Cylinder axis.
3041 theR Cylinder radius.
3042 theH Cylinder height.
3043 theA Cylinder angle in radians.
3044 theName Object name; when specified, this parameter is used
3045 for result publication in the study. Otherwise, if automatic
3046 publication is switched on, default value is used for result name.
3049 New GEOM.GEOM_Object, containing the created cylinder.
3051 # Example: see GEOM_TestAll.py
3053 if isinstance(theA,str):
3055 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3057 theA = theA*math.pi/180.
3058 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3059 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3060 anObj.SetParameters(Parameters)
3061 self._autoPublish(anObj, theName, "cylinder")
3064 ## Create a cylinder with given radius and height at
3065 # the origin of coordinate system. Axis of the cylinder
3066 # will be collinear to the OZ axis of the coordinate system.
3067 # @param theR Cylinder radius.
3068 # @param theH Cylinder height.
3069 # @param theName Object name; when specified, this parameter is used
3070 # for result publication in the study. Otherwise, if automatic
3071 # publication is switched on, default value is used for result name.
3073 # @return New GEOM.GEOM_Object, containing the created cylinder.
3075 # @ref tui_creation_cylinder "Example"
3076 @ManageTransactions("PrimOp")
3077 def MakeCylinderRH(self, theR, theH, theName=None):
3079 Create a cylinder with given radius and height at
3080 the origin of coordinate system. Axis of the cylinder
3081 will be collinear to the OZ axis of the coordinate system.
3084 theR Cylinder radius.
3085 theH Cylinder height.
3086 theName Object name; when specified, this parameter is used
3087 for result publication in the study. Otherwise, if automatic
3088 publication is switched on, default value is used for result name.
3091 New GEOM.GEOM_Object, containing the created cylinder.
3093 # Example: see GEOM_TestAll.py
3094 theR,theH,Parameters = ParseParameters(theR, theH)
3095 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3096 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3097 anObj.SetParameters(Parameters)
3098 self._autoPublish(anObj, theName, "cylinder")
3101 ## Create a portion of cylinder with given radius, height and angle at
3102 # the origin of coordinate system. Axis of the cylinder
3103 # will be collinear to the OZ axis of the coordinate system.
3104 # @param theR Cylinder radius.
3105 # @param theH Cylinder height.
3106 # @param theA Cylinder angle in radians.
3107 # @param theName Object name; when specified, this parameter is used
3108 # for result publication in the study. Otherwise, if automatic
3109 # publication is switched on, default value is used for result name.
3111 # @return New GEOM.GEOM_Object, containing the created cylinder.
3113 # @ref tui_creation_cylinder "Example"
3114 @ManageTransactions("PrimOp")
3115 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3117 Create a portion of cylinder with given radius, height and angle at
3118 the origin of coordinate system. Axis of the cylinder
3119 will be collinear to the OZ axis of the coordinate system.
3122 theR Cylinder radius.
3123 theH Cylinder height.
3124 theA Cylinder angle in radians.
3125 theName Object name; when specified, this parameter is used
3126 for result publication in the study. Otherwise, if automatic
3127 publication is switched on, default value is used for result name.
3130 New GEOM.GEOM_Object, containing the created cylinder.
3132 # Example: see GEOM_TestAll.py
3134 if isinstance(theA,str):
3136 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3138 theA = theA*math.pi/180.
3139 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3140 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3141 anObj.SetParameters(Parameters)
3142 self._autoPublish(anObj, theName, "cylinder")
3145 ## Create a sphere with given center and radius.
3146 # @param thePnt Sphere center.
3147 # @param theR Sphere radius.
3148 # @param theName Object name; when specified, this parameter is used
3149 # for result publication in the study. Otherwise, if automatic
3150 # publication is switched on, default value is used for result name.
3152 # @return New GEOM.GEOM_Object, containing the created sphere.
3154 # @ref tui_creation_sphere "Example"
3155 @ManageTransactions("PrimOp")
3156 def MakeSpherePntR(self, thePnt, theR, theName=None):
3158 Create a sphere with given center and radius.
3161 thePnt Sphere center.
3163 theName Object name; when specified, this parameter is used
3164 for result publication in the study. Otherwise, if automatic
3165 publication is switched on, default value is used for result name.
3168 New GEOM.GEOM_Object, containing the created sphere.
3170 # Example: see GEOM_TestAll.py
3171 theR,Parameters = ParseParameters(theR)
3172 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3173 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3174 anObj.SetParameters(Parameters)
3175 self._autoPublish(anObj, theName, "sphere")
3178 ## Create a sphere with given center and radius.
3179 # @param x,y,z Coordinates of sphere center.
3180 # @param theR Sphere radius.
3181 # @param theName Object name; when specified, this parameter is used
3182 # for result publication in the study. Otherwise, if automatic
3183 # publication is switched on, default value is used for result name.
3185 # @return New GEOM.GEOM_Object, containing the created sphere.
3187 # @ref tui_creation_sphere "Example"
3188 def MakeSphere(self, x, y, z, theR, theName=None):
3190 Create a sphere with given center and radius.
3193 x,y,z Coordinates of sphere center.
3195 theName Object name; when specified, this parameter is used
3196 for result publication in the study. Otherwise, if automatic
3197 publication is switched on, default value is used for result name.
3200 New GEOM.GEOM_Object, containing the created sphere.
3202 # Example: see GEOM_TestAll.py
3203 point = self.MakeVertex(x, y, z)
3204 # note: auto-publishing is done in self.MakeSpherePntR()
3205 anObj = self.MakeSpherePntR(point, theR, theName)
3208 ## Create a sphere with given radius at the origin of coordinate system.
3209 # @param theR Sphere radius.
3210 # @param theName Object name; when specified, this parameter is used
3211 # for result publication in the study. Otherwise, if automatic
3212 # publication is switched on, default value is used for result name.
3214 # @return New GEOM.GEOM_Object, containing the created sphere.
3216 # @ref tui_creation_sphere "Example"
3217 @ManageTransactions("PrimOp")
3218 def MakeSphereR(self, theR, theName=None):
3220 Create a sphere with given radius at the origin of coordinate system.
3224 theName Object name; when specified, this parameter is used
3225 for result publication in the study. Otherwise, if automatic
3226 publication is switched on, default value is used for result name.
3229 New GEOM.GEOM_Object, containing the created sphere.
3231 # Example: see GEOM_TestAll.py
3232 theR,Parameters = ParseParameters(theR)
3233 anObj = self.PrimOp.MakeSphereR(theR)
3234 RaiseIfFailed("MakeSphereR", self.PrimOp)
3235 anObj.SetParameters(Parameters)
3236 self._autoPublish(anObj, theName, "sphere")
3239 ## Create a cone with given base point, axis, height and radiuses.
3240 # @param thePnt Central point of the first cone base.
3241 # @param theAxis Cone axis.
3242 # @param theR1 Radius of the first cone base.
3243 # @param theR2 Radius of the second cone base.
3244 # \note If both radiuses are non-zero, the cone will be truncated.
3245 # \note If the radiuses are equal, a cylinder will be created instead.
3246 # @param theH Cone height.
3247 # @param theName Object name; when specified, this parameter is used
3248 # for result publication in the study. Otherwise, if automatic
3249 # publication is switched on, default value is used for result name.
3251 # @return New GEOM.GEOM_Object, containing the created cone.
3253 # @ref tui_creation_cone "Example"
3254 @ManageTransactions("PrimOp")
3255 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3257 Create a cone with given base point, axis, height and radiuses.
3260 thePnt Central point of the first cone base.
3262 theR1 Radius of the first cone base.
3263 theR2 Radius of the second cone base.
3265 theName Object name; when specified, this parameter is used
3266 for result publication in the study. Otherwise, if automatic
3267 publication is switched on, default value is used for result name.
3270 If both radiuses are non-zero, the cone will be truncated.
3271 If the radiuses are equal, a cylinder will be created instead.
3274 New GEOM.GEOM_Object, containing the created cone.
3276 # Example: see GEOM_TestAll.py
3277 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3278 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3279 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3280 anObj.SetParameters(Parameters)
3281 self._autoPublish(anObj, theName, "cone")
3284 ## Create a cone with given height and radiuses at
3285 # the origin of coordinate system. Axis of the cone will
3286 # be collinear to the OZ axis of the coordinate system.
3287 # @param theR1 Radius of the first cone base.
3288 # @param theR2 Radius of the second cone base.
3289 # \note If both radiuses are non-zero, the cone will be truncated.
3290 # \note If the radiuses are equal, a cylinder will be created instead.
3291 # @param theH Cone height.
3292 # @param theName Object name; when specified, this parameter is used
3293 # for result publication in the study. Otherwise, if automatic
3294 # publication is switched on, default value is used for result name.
3296 # @return New GEOM.GEOM_Object, containing the created cone.
3298 # @ref tui_creation_cone "Example"
3299 @ManageTransactions("PrimOp")
3300 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3302 Create a cone with given height and radiuses at
3303 the origin of coordinate system. Axis of the cone will
3304 be collinear to the OZ axis of the coordinate system.
3307 theR1 Radius of the first cone base.
3308 theR2 Radius of the second cone base.
3310 theName Object name; when specified, this parameter is used
3311 for result publication in the study. Otherwise, if automatic
3312 publication is switched on, default value is used for result name.
3315 If both radiuses are non-zero, the cone will be truncated.
3316 If the radiuses are equal, a cylinder will be created instead.
3319 New GEOM.GEOM_Object, containing the created cone.
3321 # Example: see GEOM_TestAll.py
3322 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3323 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3324 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3325 anObj.SetParameters(Parameters)
3326 self._autoPublish(anObj, theName, "cone")
3329 ## Create a torus with given center, normal vector and radiuses.
3330 # @param thePnt Torus central point.
3331 # @param theVec Torus axis of symmetry.
3332 # @param theRMajor Torus major radius.
3333 # @param theRMinor Torus minor radius.
3334 # @param theName Object name; when specified, this parameter is used
3335 # for result publication in the study. Otherwise, if automatic
3336 # publication is switched on, default value is used for result name.
3338 # @return New GEOM.GEOM_Object, containing the created torus.
3340 # @ref tui_creation_torus "Example"
3341 @ManageTransactions("PrimOp")
3342 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3344 Create a torus with given center, normal vector and radiuses.
3347 thePnt Torus central point.
3348 theVec Torus axis of symmetry.
3349 theRMajor Torus major radius.
3350 theRMinor Torus minor radius.
3351 theName Object name; when specified, this parameter is used
3352 for result publication in the study. Otherwise, if automatic
3353 publication is switched on, default value is used for result name.
3356 New GEOM.GEOM_Object, containing the created torus.
3358 # Example: see GEOM_TestAll.py
3359 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3360 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3361 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3362 anObj.SetParameters(Parameters)
3363 self._autoPublish(anObj, theName, "torus")
3366 ## Create a torus with given radiuses at the origin of coordinate system.
3367 # @param theRMajor Torus major radius.
3368 # @param theRMinor Torus minor radius.
3369 # @param theName Object name; when specified, this parameter is used
3370 # for result publication in the study. Otherwise, if automatic
3371 # publication is switched on, default value is used for result name.
3373 # @return New GEOM.GEOM_Object, containing the created torus.
3375 # @ref tui_creation_torus "Example"
3376 @ManageTransactions("PrimOp")
3377 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3379 Create a torus with given radiuses at the origin of coordinate system.
3382 theRMajor Torus major radius.
3383 theRMinor Torus minor radius.
3384 theName Object name; when specified, this parameter is used
3385 for result publication in the study. Otherwise, if automatic
3386 publication is switched on, default value is used for result name.
3389 New GEOM.GEOM_Object, containing the created torus.
3391 # Example: see GEOM_TestAll.py
3392 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3393 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3394 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3395 anObj.SetParameters(Parameters)
3396 self._autoPublish(anObj, theName, "torus")
3399 # end of l3_3d_primitives
3402 ## @addtogroup l3_complex
3405 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3406 # @param theBase Base shape to be extruded.
3407 # @param thePoint1 First end of extrusion vector.
3408 # @param thePoint2 Second end of extrusion vector.
3409 # @param theScaleFactor Use it to make prism with scaled second base.
3410 # Nagative value means not scaled second base.
3411 # @param theName Object name; when specified, this parameter is used
3412 # for result publication in the study. Otherwise, if automatic
3413 # publication is switched on, default value is used for result name.
3415 # @return New GEOM.GEOM_Object, containing the created prism.
3417 # @ref tui_creation_prism "Example"
3418 @ManageTransactions("PrimOp")
3419 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3421 Create a shape by extrusion of the base shape along a vector, defined by two points.
3424 theBase Base shape to be extruded.
3425 thePoint1 First end of extrusion vector.
3426 thePoint2 Second end of extrusion vector.
3427 theScaleFactor Use it to make prism with scaled second base.
3428 Nagative value means not scaled second base.
3429 theName Object name; when specified, this parameter is used
3430 for result publication in the study. Otherwise, if automatic
3431 publication is switched on, default value is used for result name.
3434 New GEOM.GEOM_Object, containing the created prism.
3436 # Example: see GEOM_TestAll.py
3439 if theScaleFactor > 0:
3440 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3441 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3443 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3444 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3445 anObj.SetParameters(Parameters)
3446 self._autoPublish(anObj, theName, "prism")
3449 ## Create a shape by extrusion of the base shape along a
3450 # vector, defined by two points, in 2 Ways (forward/backward).
3451 # @param theBase Base shape to be extruded.
3452 # @param thePoint1 First end of extrusion vector.
3453 # @param thePoint2 Second end of extrusion vector.
3454 # @param theName Object name; when specified, this parameter is used
3455 # for result publication in the study. Otherwise, if automatic
3456 # publication is switched on, default value is used for result name.
3458 # @return New GEOM.GEOM_Object, containing the created prism.
3460 # @ref tui_creation_prism "Example"
3461 @ManageTransactions("PrimOp")
3462 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3464 Create a shape by extrusion of the base shape along a
3465 vector, defined by two points, in 2 Ways (forward/backward).
3468 theBase Base shape to be extruded.
3469 thePoint1 First end of extrusion vector.
3470 thePoint2 Second end of extrusion vector.
3471 theName Object name; when specified, this parameter is used
3472 for result publication in the study. Otherwise, if automatic
3473 publication is switched on, default value is used for result name.
3476 New GEOM.GEOM_Object, containing the created prism.
3478 # Example: see GEOM_TestAll.py
3479 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3480 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3481 self._autoPublish(anObj, theName, "prism")
3484 ## Create a shape by extrusion of the base shape along the vector,
3485 # i.e. all the space, transfixed by the base shape during its translation
3486 # along the vector on the given distance.
3487 # @param theBase Base shape to be extruded.
3488 # @param theVec Direction of extrusion.
3489 # @param theH Prism dimension along theVec.
3490 # @param theScaleFactor Use it to make prism with scaled second base.
3491 # Negative value means not scaled second base.
3492 # @param theName Object name; when specified, this parameter is used
3493 # for result publication in the study. Otherwise, if automatic
3494 # publication is switched on, default value is used for result name.
3496 # @return New GEOM.GEOM_Object, containing the created prism.
3498 # @ref tui_creation_prism "Example"
3499 @ManageTransactions("PrimOp")
3500 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3502 Create a shape by extrusion of the base shape along the vector,
3503 i.e. all the space, transfixed by the base shape during its translation
3504 along the vector on the given distance.
3507 theBase Base shape to be extruded.
3508 theVec Direction of extrusion.
3509 theH Prism dimension along theVec.
3510 theScaleFactor Use it to make prism with scaled second base.
3511 Negative value means not scaled second base.
3512 theName Object name; when specified, this parameter is used
3513 for result publication in the study. Otherwise, if automatic
3514 publication is switched on, default value is used for result name.
3517 New GEOM.GEOM_Object, containing the created prism.
3519 # Example: see GEOM_TestAll.py
3522 if theScaleFactor > 0:
3523 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3524 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3526 theH,Parameters = ParseParameters(theH)
3527 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3528 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3529 anObj.SetParameters(Parameters)
3530 self._autoPublish(anObj, theName, "prism")
3533 ## Create a shape by extrusion of the base shape along the vector,
3534 # i.e. all the space, transfixed by the base shape during its translation
3535 # along the vector on the given distance in 2 Ways (forward/backward).
3536 # @param theBase Base shape to be extruded.
3537 # @param theVec Direction of extrusion.
3538 # @param theH Prism dimension along theVec in forward direction.
3539 # @param theName Object name; when specified, this parameter is used
3540 # for result publication in the study. Otherwise, if automatic
3541 # publication is switched on, default value is used for result name.
3543 # @return New GEOM.GEOM_Object, containing the created prism.
3545 # @ref tui_creation_prism "Example"
3546 @ManageTransactions("PrimOp")
3547 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3549 Create a shape by extrusion of the base shape along the vector,
3550 i.e. all the space, transfixed by the base shape during its translation
3551 along the vector on the given distance in 2 Ways (forward/backward).
3554 theBase Base shape to be extruded.
3555 theVec Direction of extrusion.
3556 theH Prism dimension along theVec in forward direction.
3557 theName Object name; when specified, this parameter is used
3558 for result publication in the study. Otherwise, if automatic
3559 publication is switched on, default value is used for result name.
3562 New GEOM.GEOM_Object, containing the created prism.
3564 # Example: see GEOM_TestAll.py
3565 theH,Parameters = ParseParameters(theH)
3566 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3567 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3568 anObj.SetParameters(Parameters)
3569 self._autoPublish(anObj, theName, "prism")
3572 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3573 # @param theBase Base shape to be extruded.
3574 # @param theDX, theDY, theDZ Directions of extrusion.
3575 # @param theScaleFactor Use it to make prism with scaled second base.
3576 # Nagative value means not scaled second base.
3577 # @param theName Object name; when specified, this parameter is used
3578 # for result publication in the study. Otherwise, if automatic
3579 # publication is switched on, default value is used for result name.
3581 # @return New GEOM.GEOM_Object, containing the created prism.
3583 # @ref tui_creation_prism "Example"
3584 @ManageTransactions("PrimOp")
3585 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3587 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3590 theBase Base shape to be extruded.
3591 theDX, theDY, theDZ Directions of extrusion.
3592 theScaleFactor Use it to make prism with scaled second base.
3593 Nagative value means not scaled second base.
3594 theName Object name; when specified, this parameter is used
3595 for result publication in the study. Otherwise, if automatic
3596 publication is switched on, default value is used for result name.
3599 New GEOM.GEOM_Object, containing the created prism.
3601 # Example: see GEOM_TestAll.py
3604 if theScaleFactor > 0:
3605 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3606 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3608 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3609 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3610 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3611 anObj.SetParameters(Parameters)
3612 self._autoPublish(anObj, theName, "prism")
3615 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3616 # i.e. all the space, transfixed by the base shape during its translation
3617 # along the vector on the given distance in 2 Ways (forward/backward).
3618 # @param theBase Base shape to be extruded.
3619 # @param theDX, theDY, theDZ Directions of extrusion.
3620 # @param theName Object name; when specified, this parameter is used
3621 # for result publication in the study. Otherwise, if automatic
3622 # publication is switched on, default value is used for result name.
3624 # @return New GEOM.GEOM_Object, containing the created prism.
3626 # @ref tui_creation_prism "Example"
3627 @ManageTransactions("PrimOp")
3628 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3630 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3631 i.e. all the space, transfixed by the base shape during its translation
3632 along the vector on the given distance in 2 Ways (forward/backward).
3635 theBase Base shape to be extruded.
3636 theDX, theDY, theDZ Directions of extrusion.
3637 theName Object name; when specified, this parameter is used
3638 for result publication in the study. Otherwise, if automatic
3639 publication is switched on, default value is used for result name.
3642 New GEOM.GEOM_Object, containing the created prism.
3644 # Example: see GEOM_TestAll.py
3645 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3646 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3647 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3648 anObj.SetParameters(Parameters)
3649 self._autoPublish(anObj, theName, "prism")
3652 ## Create a shape by revolution of the base shape around the axis
3653 # on the given angle, i.e. all the space, transfixed by the base
3654 # shape during its rotation around the axis on the given angle.
3655 # @param theBase Base shape to be rotated.
3656 # @param theAxis Rotation axis.
3657 # @param theAngle Rotation angle in radians.
3658 # @param theName Object name; when specified, this parameter is used
3659 # for result publication in the study. Otherwise, if automatic
3660 # publication is switched on, default value is used for result name.
3662 # @return New GEOM.GEOM_Object, containing the created revolution.
3664 # @ref tui_creation_revolution "Example"
3665 @ManageTransactions("PrimOp")
3666 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3668 Create a shape by revolution of the base shape around the axis
3669 on the given angle, i.e. all the space, transfixed by the base
3670 shape during its rotation around the axis on the given angle.
3673 theBase Base shape to be rotated.
3674 theAxis Rotation axis.
3675 theAngle Rotation angle in radians.
3676 theName Object name; when specified, this parameter is used
3677 for result publication in the study. Otherwise, if automatic
3678 publication is switched on, default value is used for result name.
3681 New GEOM.GEOM_Object, containing the created revolution.
3683 # Example: see GEOM_TestAll.py
3684 theAngle,Parameters = ParseParameters(theAngle)
3685 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3686 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3687 anObj.SetParameters(Parameters)
3688 self._autoPublish(anObj, theName, "revolution")
3691 ## Create a shape by revolution of the base shape around the axis
3692 # on the given angle, i.e. all the space, transfixed by the base
3693 # shape during its rotation around the axis on the given angle in
3694 # both directions (forward/backward)
3695 # @param theBase Base shape to be rotated.
3696 # @param theAxis Rotation axis.
3697 # @param theAngle Rotation angle in radians.
3698 # @param theName Object name; when specified, this parameter is used
3699 # for result publication in the study. Otherwise, if automatic
3700 # publication is switched on, default value is used for result name.
3702 # @return New GEOM.GEOM_Object, containing the created revolution.
3704 # @ref tui_creation_revolution "Example"
3705 @ManageTransactions("PrimOp")
3706 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3708 Create a shape by revolution of the base shape around the axis
3709 on the given angle, i.e. all the space, transfixed by the base
3710 shape during its rotation around the axis on the given angle in
3711 both directions (forward/backward).
3714 theBase Base shape to be rotated.
3715 theAxis Rotation axis.
3716 theAngle Rotation angle in radians.
3717 theName Object name; when specified, this parameter is used
3718 for result publication in the study. Otherwise, if automatic
3719 publication is switched on, default value is used for result name.
3722 New GEOM.GEOM_Object, containing the created revolution.
3724 theAngle,Parameters = ParseParameters(theAngle)
3725 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3726 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3727 anObj.SetParameters(Parameters)
3728 self._autoPublish(anObj, theName, "revolution")
3731 ## Create a face from a given set of contours.
3732 # @param theContours either a list or a compound of edges/wires.
3733 # @param theMinDeg a minimal degree of BSpline surface to create.
3734 # @param theMaxDeg a maximal degree of BSpline surface to create.
3735 # @param theTol2D a 2d tolerance to be reached.
3736 # @param theTol3D a 3d tolerance to be reached.
3737 # @param theNbIter a number of iteration of approximation algorithm.
3738 # @param theMethod Kind of method to perform filling operation
3739 # (see GEOM.filling_oper_method enum).
3740 # @param isApprox if True, BSpline curves are generated in the process
3741 # of surface construction. By default it is False, that means
3742 # the surface is created using given curves. The usage of
3743 # Approximation makes the algorithm work slower, but allows
3744 # building the surface for rather complex cases.
3745 # @param theName Object name; when specified, this parameter is used
3746 # for result publication in the study. Otherwise, if automatic
3747 # publication is switched on, default value is used for result name.
3749 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3751 # @ref tui_creation_filling "Example"
3752 @ManageTransactions("PrimOp")
3753 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3754 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3756 Create a face from a given set of contours.
3759 theContours either a list or a compound of edges/wires.
3760 theMinDeg a minimal degree of BSpline surface to create.
3761 theMaxDeg a maximal degree of BSpline surface to create.
3762 theTol2D a 2d tolerance to be reached.
3763 theTol3D a 3d tolerance to be reached.
3764 theNbIter a number of iteration of approximation algorithm.
3765 theMethod Kind of method to perform filling operation
3766 (see GEOM.filling_oper_method enum).
3767 isApprox if True, BSpline curves are generated in the process
3768 of surface construction. By default it is False, that means
3769 the surface is created using given curves. The usage of
3770 Approximation makes the algorithm work slower, but allows
3771 building the surface for rather complex cases.
3772 theName Object name; when specified, this parameter is used
3773 for result publication in the study. Otherwise, if automatic
3774 publication is switched on, default value is used for result name.
3777 New GEOM.GEOM_Object (face), containing the created filling surface.
3780 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3782 # Example: see GEOM_TestAll.py
3783 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3784 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3785 theTol2D, theTol3D, theNbIter,
3786 theMethod, isApprox)
3787 RaiseIfFailed("MakeFilling", self.PrimOp)
3788 anObj.SetParameters(Parameters)
3789 self._autoPublish(anObj, theName, "filling")
3793 ## Create a face from a given set of contours.
3794 # This method corresponds to MakeFilling() with isApprox=True.
3795 # @param theContours either a list or a compound of edges/wires.
3796 # @param theMinDeg a minimal degree of BSpline surface to create.
3797 # @param theMaxDeg a maximal degree of BSpline surface to create.
3798 # @param theTol3D a 3d tolerance to be reached.
3799 # @param theName Object name; when specified, this parameter is used
3800 # for result publication in the study. Otherwise, if automatic
3801 # publication is switched on, default value is used for result name.
3803 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3805 # @ref tui_creation_filling "Example"
3806 @ManageTransactions("PrimOp")
3807 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3809 Create a filling from the given compound of contours.
3810 This method corresponds to MakeFilling() with isApprox=True.
3813 theContours either a list or a compound of edges/wires.
3814 theMinDeg a minimal degree of BSpline surface to create.
3815 theMaxDeg a maximal degree of BSpline surface to create.
3816 theTol3D a 3d tolerance to be reached.
3817 theName Object name; when specified, this parameter is used
3818 for result publication in the study. Otherwise, if automatic
3819 publication is switched on, default value is used for result name.
3822 New GEOM.GEOM_Object (face), containing the created filling surface.
3825 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3827 # Example: see GEOM_TestAll.py
3828 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3829 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3830 0, theTol3D, 0, GEOM.FOM_Default, True)
3831 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3832 anObj.SetParameters(Parameters)
3833 self._autoPublish(anObj, theName, "filling")
3836 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3837 # @param theSeqSections - set of specified sections.
3838 # @param theModeSolid - mode defining building solid or shell
3839 # @param thePreci - precision 3D used for smoothing
3840 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3841 # @param theName Object name; when specified, this parameter is used
3842 # for result publication in the study. Otherwise, if automatic
3843 # publication is switched on, default value is used for result name.
3845 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3847 # @ref swig_todo "Example"
3848 @ManageTransactions("PrimOp")
3849 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3851 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3854 theSeqSections - set of specified sections.
3855 theModeSolid - mode defining building solid or shell
3856 thePreci - precision 3D used for smoothing
3857 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3858 theName Object name; when specified, this parameter is used
3859 for result publication in the study. Otherwise, if automatic
3860 publication is switched on, default value is used for result name.
3863 New GEOM.GEOM_Object, containing the created shell or solid.
3865 # Example: see GEOM_TestAll.py
3866 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3867 RaiseIfFailed("MakeThruSections", self.PrimOp)
3868 self._autoPublish(anObj, theName, "filling")
3871 ## Create a shape by extrusion of the base shape along
3872 # the path shape. The path shape can be a wire or an edge.
3873 # @param theBase Base shape to be extruded.
3874 # @param thePath Path shape to extrude the base shape along it.
3875 # @param theName Object name; when specified, this parameter is used
3876 # for result publication in the study. Otherwise, if automatic
3877 # publication is switched on, default value is used for result name.
3879 # @return New GEOM.GEOM_Object, containing the created pipe.
3881 # @ref tui_creation_pipe "Example"
3882 @ManageTransactions("PrimOp")
3883 def MakePipe(self, theBase, thePath, theName=None):
3885 Create a shape by extrusion of the base shape along
3886 the path shape. The path shape can be a wire or an edge.
3889 theBase Base shape to be extruded.
3890 thePath Path shape to extrude the base shape along it.
3891 theName Object name; when specified, this parameter is used
3892 for result publication in the study. Otherwise, if automatic
3893 publication is switched on, default value is used for result name.
3896 New GEOM.GEOM_Object, containing the created pipe.
3898 # Example: see GEOM_TestAll.py
3899 anObj = self.PrimOp.MakePipe(theBase, thePath)
3900 RaiseIfFailed("MakePipe", self.PrimOp)
3901 self._autoPublish(anObj, theName, "pipe")
3904 ## Create a shape by extrusion of the profile shape along
3905 # the path shape. The path shape can be a wire or an edge.
3906 # the several profiles can be specified in the several locations of path.
3907 # @param theSeqBases - list of Bases shape to be extruded.
3908 # @param theLocations - list of locations on the path corresponding
3909 # specified list of the Bases shapes. Number of locations
3910 # should be equal to number of bases or list of locations can be empty.
3911 # @param thePath - Path shape to extrude the base shape along it.
3912 # @param theWithContact - the mode defining that the section is translated to be in
3913 # contact with the spine.
3914 # @param theWithCorrection - defining that the section is rotated to be
3915 # orthogonal to the spine tangent in the correspondent point
3916 # @param theName Object name; when specified, this parameter is used
3917 # for result publication in the study. Otherwise, if automatic
3918 # publication is switched on, default value is used for result name.
3920 # @return New GEOM.GEOM_Object, containing the created pipe.
3922 # @ref tui_creation_pipe_with_diff_sec "Example"
3923 @ManageTransactions("PrimOp")
3924 def MakePipeWithDifferentSections(self, theSeqBases,
3925 theLocations, thePath,
3926 theWithContact, theWithCorrection, theName=None):
3928 Create a shape by extrusion of the profile shape along
3929 the path shape. The path shape can be a wire or an edge.
3930 the several profiles can be specified in the several locations of path.
3933 theSeqBases - list of Bases shape to be extruded.
3934 theLocations - list of locations on the path corresponding
3935 specified list of the Bases shapes. Number of locations
3936 should be equal to number of bases or list of locations can be empty.
3937 thePath - Path shape to extrude the base shape along it.
3938 theWithContact - the mode defining that the section is translated to be in
3939 contact with the spine(0/1)
3940 theWithCorrection - defining that the section is rotated to be
3941 orthogonal to the spine tangent in the correspondent point (0/1)
3942 theName Object name; when specified, this parameter is used
3943 for result publication in the study. Otherwise, if automatic
3944 publication is switched on, default value is used for result name.
3947 New GEOM.GEOM_Object, containing the created pipe.
3949 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3950 theLocations, thePath,
3951 theWithContact, theWithCorrection)
3952 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3953 self._autoPublish(anObj, theName, "pipe")
3956 ## Create a shape by extrusion of the profile shape along
3957 # the path shape. The path shape can be a wire or a edge.
3958 # the several profiles can be specified in the several locations of path.
3959 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3960 # shell or face. If number of faces in neighbour sections
3961 # aren't coincided result solid between such sections will
3962 # be created using external boundaries of this shells.
3963 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3964 # This list is used for searching correspondences between
3965 # faces in the sections. Size of this list must be equal
3966 # to size of list of base shapes.
3967 # @param theLocations - list of locations on the path corresponding
3968 # specified list of the Bases shapes. Number of locations
3969 # should be equal to number of bases. First and last
3970 # locations must be coincided with first and last vertexes
3971 # of path correspondingly.
3972 # @param thePath - Path shape to extrude the base shape along it.
3973 # @param theWithContact - the mode defining that the section is translated to be in
3974 # contact with the spine.
3975 # @param theWithCorrection - defining that the section is rotated to be
3976 # orthogonal to the spine tangent in the correspondent point
3977 # @param theName Object name; when specified, this parameter is used
3978 # for result publication in the study. Otherwise, if automatic
3979 # publication is switched on, default value is used for result name.
3981 # @return New GEOM.GEOM_Object, containing the created solids.
3983 # @ref tui_creation_pipe_with_shell_sec "Example"
3984 @ManageTransactions("PrimOp")
3985 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3986 theLocations, thePath,
3987 theWithContact, theWithCorrection, theName=None):
3989 Create a shape by extrusion of the profile shape along
3990 the path shape. The path shape can be a wire or a edge.
3991 the several profiles can be specified in the several locations of path.
3994 theSeqBases - list of Bases shape to be extruded. Base shape must be
3995 shell or face. If number of faces in neighbour sections
3996 aren't coincided result solid between such sections will
3997 be created using external boundaries of this shells.
3998 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3999 This list is used for searching correspondences between
4000 faces in the sections. Size of this list must be equal
4001 to size of list of base shapes.
4002 theLocations - list of locations on the path corresponding
4003 specified list of the Bases shapes. Number of locations
4004 should be equal to number of bases. First and last
4005 locations must be coincided with first and last vertexes
4006 of path correspondingly.
4007 thePath - Path shape to extrude the base shape along it.
4008 theWithContact - the mode defining that the section is translated to be in
4009 contact with the spine (0/1)
4010 theWithCorrection - defining that the section is rotated to be
4011 orthogonal to the spine tangent in the correspondent point (0/1)
4012 theName Object name; when specified, this parameter is used
4013 for result publication in the study. Otherwise, if automatic
4014 publication is switched on, default value is used for result name.
4017 New GEOM.GEOM_Object, containing the created solids.
4019 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4020 theLocations, thePath,
4021 theWithContact, theWithCorrection)
4022 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4023 self._autoPublish(anObj, theName, "pipe")
4026 ## Create a shape by extrusion of the profile shape along
4027 # the path shape. This function is used only for debug pipe
4028 # functionality - it is a version of function MakePipeWithShellSections()
4029 # which give a possibility to recieve information about
4030 # creating pipe between each pair of sections step by step.
4031 @ManageTransactions("PrimOp")
4032 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4033 theLocations, thePath,
4034 theWithContact, theWithCorrection, theName=None):
4036 Create a shape by extrusion of the profile shape along
4037 the path shape. This function is used only for debug pipe
4038 functionality - it is a version of previous function
4039 geompy.MakePipeWithShellSections() which give a possibility to
4040 recieve information about creating pipe between each pair of
4041 sections step by step.
4044 nbsect = len(theSeqBases)
4045 nbsubsect = len(theSeqSubBases)
4046 #print "nbsect = ",nbsect
4047 for i in range(1,nbsect):
4049 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4050 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4052 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4053 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4054 tmpLocations, thePath,
4055 theWithContact, theWithCorrection)
4056 if self.PrimOp.IsDone() == 0:
4057 print "Problems with pipe creation between ",i," and ",i+1," sections"
4058 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4061 print "Pipe between ",i," and ",i+1," sections is OK"
4066 resc = self.MakeCompound(res)
4067 #resc = self.MakeSewing(res, 0.001)
4068 #print "resc: ",resc
4069 self._autoPublish(resc, theName, "pipe")
4072 ## Create solids between given sections
4073 # @param theSeqBases - list of sections (shell or face).
4074 # @param theLocations - list of corresponding vertexes
4075 # @param theName Object name; when specified, this parameter is used
4076 # for result publication in the study. Otherwise, if automatic
4077 # publication is switched on, default value is used for result name.
4079 # @return New GEOM.GEOM_Object, containing the created solids.
4081 # @ref tui_creation_pipe_without_path "Example"
4082 @ManageTransactions("PrimOp")
4083 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4085 Create solids between given sections
4088 theSeqBases - list of sections (shell or face).
4089 theLocations - list of corresponding vertexes
4090 theName Object name; when specified, this parameter is used
4091 for result publication in the study. Otherwise, if automatic
4092 publication is switched on, default value is used for result name.
4095 New GEOM.GEOM_Object, containing the created solids.
4097 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4098 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4099 self._autoPublish(anObj, theName, "pipe")
4102 ## Create a shape by extrusion of the base shape along
4103 # the path shape with constant bi-normal direction along the given vector.
4104 # The path shape can be a wire or an edge.
4105 # @param theBase Base shape to be extruded.
4106 # @param thePath Path shape to extrude the base shape along it.
4107 # @param theVec Vector defines a constant binormal direction to keep the
4108 # same angle beetween the direction and the sections
4109 # along the sweep surface.
4110 # @param theName Object name; when specified, this parameter is used
4111 # for result publication in the study. Otherwise, if automatic
4112 # publication is switched on, default value is used for result name.
4114 # @return New GEOM.GEOM_Object, containing the created pipe.
4116 # @ref tui_creation_pipe "Example"
4117 @ManageTransactions("PrimOp")
4118 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4120 Create a shape by extrusion of the base shape along
4121 the path shape with constant bi-normal direction along the given vector.
4122 The path shape can be a wire or an edge.
4125 theBase Base shape to be extruded.
4126 thePath Path shape to extrude the base shape along it.
4127 theVec Vector defines a constant binormal direction to keep the
4128 same angle beetween the direction and the sections
4129 along the sweep surface.
4130 theName Object name; when specified, this parameter is used
4131 for result publication in the study. Otherwise, if automatic
4132 publication is switched on, default value is used for result name.
4135 New GEOM.GEOM_Object, containing the created pipe.
4137 # Example: see GEOM_TestAll.py
4138 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4139 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4140 self._autoPublish(anObj, theName, "pipe")
4143 ## Makes a thick solid from a shape. If the input is a surface shape
4144 # (face or shell) the result is a thick solid. If an input shape is
4145 # a solid the result is a hollowed solid with removed faces.
4146 # @param theShape Face or Shell to get thick solid or solid to get
4148 # @param theThickness Thickness of the resulting solid
4149 # @param theFacesIDs the list of face IDs to be removed from the
4150 # result. It is ignored if \a theShape is a face or a shell.
4151 # It is empty by default.
4152 # @param theName Object name; when specified, this parameter is used
4153 # for result publication in the study. Otherwise, if automatic
4154 # publication is switched on, default value is used for result name.
4156 # @return New GEOM.GEOM_Object, containing the created solid
4158 # @ref tui_creation_thickness "Example"
4159 @ManageTransactions("PrimOp")
4160 def MakeThickSolid(self, theShape, theThickness,
4161 theFacesIDs=[], theName=None):
4163 Make a thick solid from a shape. If the input is a surface shape
4164 (face or shell) the result is a thick solid. If an input shape is
4165 a solid the result is a hollowed solid with removed faces.
4168 theShape Face or Shell to get thick solid or solid to get
4170 theThickness Thickness of the resulting solid
4171 theFacesIDs the list of face IDs to be removed from the
4172 result. It is ignored if theShape is a face or a
4173 shell. It is empty by default.
4174 theName Object name; when specified, this parameter is used
4175 for result publication in the study. Otherwise, if automatic
4176 publication is switched on, default value is used for result name.
4179 New GEOM.GEOM_Object, containing the created solid
4181 # Example: see GEOM_TestAll.py
4182 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4184 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4185 self._autoPublish(anObj, theName, "thickSolid")
4189 ## Modifies a shape to make it a thick solid. If the input is a surface
4190 # shape (face or shell) the result is a thick solid. If an input shape
4191 # is a solid the result is a hollowed solid with removed faces.
4192 # @param theShape Face or Shell to get thick solid or solid to get
4194 # @param theThickness Thickness of the resulting solid
4195 # @param theFacesIDs the list of face IDs to be removed from the
4196 # result. It is ignored if \a theShape is a face or a shell.
4197 # It is empty by default.
4199 # @return The modified shape
4201 # @ref tui_creation_thickness "Example"
4202 @ManageTransactions("PrimOp")
4203 def Thicken(self, theShape, theThickness, theFacesIDs=[]):
4205 Modifies a shape to make it a thick solid. If the input is a
4206 surface shape (face or shell) the result is a thick solid. If
4207 an input shape is a solid the result is a hollowed solid with
4211 theShape Face or Shell to get thick solid or solid to get
4213 theThickness Thickness of the resulting solid
4214 theFacesIDs the list of face IDs to be removed from the
4215 result. It is ignored if \a theShape is a face or
4216 a shell. It is empty by default.
4221 # Example: see GEOM_TestAll.py
4222 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4223 theThickness, False)
4224 RaiseIfFailed("Thicken", self.PrimOp)
4227 ## Build a middle path of a pipe-like shape.
4228 # The path shape can be a wire or an edge.
4229 # @param theShape It can be closed or unclosed pipe-like shell
4230 # or a pipe-like solid.
4231 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4232 # should be wires or faces of theShape.
4233 # @param theName Object name; when specified, this parameter is used
4234 # for result publication in the study. Otherwise, if automatic
4235 # publication is switched on, default value is used for result name.
4237 # @note It is not assumed that exact or approximate copy of theShape
4238 # can be obtained by applying existing Pipe operation on the
4239 # resulting "Path" wire taking theBase1 as the base - it is not
4240 # always possible; though in some particular cases it might work
4241 # it is not guaranteed. Thus, RestorePath function should not be
4242 # considered as an exact reverse operation of the Pipe.
4244 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4245 # source pipe's "path".
4247 # @ref tui_creation_pipe_path "Example"
4248 @ManageTransactions("PrimOp")
4249 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4251 Build a middle path of a pipe-like shape.
4252 The path shape can be a wire or an edge.
4255 theShape It can be closed or unclosed pipe-like shell
4256 or a pipe-like solid.
4257 theBase1, theBase2 Two bases of the supposed pipe. This
4258 should be wires or faces of theShape.
4259 theName Object name; when specified, this parameter is used
4260 for result publication in the study. Otherwise, if automatic
4261 publication is switched on, default value is used for result name.
4264 New GEOM_Object, containing an edge or wire that represent
4267 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4268 RaiseIfFailed("RestorePath", self.PrimOp)
4269 self._autoPublish(anObj, theName, "path")
4272 ## Build a middle path of a pipe-like shape.
4273 # The path shape can be a wire or an edge.
4274 # @param theShape It can be closed or unclosed pipe-like shell
4275 # or a pipe-like solid.
4276 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4277 # should be lists of edges of theShape.
4278 # @param theName Object name; when specified, this parameter is used
4279 # for result publication in the study. Otherwise, if automatic
4280 # publication is switched on, default value is used for result name.
4282 # @note It is not assumed that exact or approximate copy of theShape
4283 # can be obtained by applying existing Pipe operation on the
4284 # resulting "Path" wire taking theBase1 as the base - it is not
4285 # always possible; though in some particular cases it might work
4286 # it is not guaranteed. Thus, RestorePath function should not be
4287 # considered as an exact reverse operation of the Pipe.
4289 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4290 # source pipe's "path".
4292 # @ref tui_creation_pipe_path "Example"
4293 @ManageTransactions("PrimOp")
4294 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4296 Build a middle path of a pipe-like shape.
4297 The path shape can be a wire or an edge.
4300 theShape It can be closed or unclosed pipe-like shell
4301 or a pipe-like solid.
4302 listEdges1, listEdges2 Two bases of the supposed pipe. This
4303 should be lists of edges of theShape.
4304 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.
4309 New GEOM_Object, containing an edge or wire that represent
4312 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4313 RaiseIfFailed("RestorePath", self.PrimOp)
4314 self._autoPublish(anObj, theName, "path")
4320 ## @addtogroup l3_advanced
4323 ## Create a linear edge with specified ends.
4324 # @param thePnt1 Point for the first end of edge.
4325 # @param thePnt2 Point for the second end of edge.
4326 # @param theName Object name; when specified, this parameter is used
4327 # for result publication in the study. Otherwise, if automatic
4328 # publication is switched on, default value is used for result name.
4330 # @return New GEOM.GEOM_Object, containing the created edge.
4332 # @ref tui_creation_edge "Example"
4333 @ManageTransactions("ShapesOp")
4334 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4336 Create a linear edge with specified ends.
4339 thePnt1 Point for the first end of edge.
4340 thePnt2 Point for the second end of edge.
4341 theName Object name; when specified, this parameter is used
4342 for result publication in the study. Otherwise, if automatic
4343 publication is switched on, default value is used for result name.
4346 New GEOM.GEOM_Object, containing the created edge.
4348 # Example: see GEOM_TestAll.py
4349 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4350 RaiseIfFailed("MakeEdge", self.ShapesOp)
4351 self._autoPublish(anObj, theName, "edge")
4354 ## Create a new edge, corresponding to the given length on the given curve.
4355 # @param theRefCurve The referenced curve (edge).
4356 # @param theLength Length on the referenced curve. It can be negative.
4357 # @param theStartPoint Any point can be selected for it, the new edge will begin
4358 # at the end of \a theRefCurve, close to the selected point.
4359 # If None, start from the first point of \a theRefCurve.
4360 # @param theName Object name; when specified, this parameter is used
4361 # for result publication in the study. Otherwise, if automatic
4362 # publication is switched on, default value is used for result name.
4364 # @return New GEOM.GEOM_Object, containing the created edge.
4366 # @ref tui_creation_edge "Example"
4367 @ManageTransactions("ShapesOp")
4368 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4370 Create a new edge, corresponding to the given length on the given curve.
4373 theRefCurve The referenced curve (edge).
4374 theLength Length on the referenced curve. It can be negative.
4375 theStartPoint Any point can be selected for it, the new edge will begin
4376 at the end of theRefCurve, close to the selected point.
4377 If None, start from the first point of theRefCurve.
4378 theName Object name; when specified, this parameter is used
4379 for result publication in the study. Otherwise, if automatic
4380 publication is switched on, default value is used for result name.
4383 New GEOM.GEOM_Object, containing the created edge.
4385 # Example: see GEOM_TestAll.py
4386 theLength, Parameters = ParseParameters(theLength)
4387 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4388 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4389 anObj.SetParameters(Parameters)
4390 self._autoPublish(anObj, theName, "edge")
4393 ## Create an edge from specified wire.
4394 # @param theWire source Wire
4395 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4396 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4397 # @param theName Object name; when specified, this parameter is used
4398 # for result publication in the study. Otherwise, if automatic
4399 # publication is switched on, default value is used for result name.
4401 # @return New GEOM.GEOM_Object, containing the created edge.
4403 # @ref tui_creation_edge "Example"
4404 @ManageTransactions("ShapesOp")
4405 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4407 Create an edge from specified wire.
4411 theLinearTolerance linear tolerance value (default = 1e-07)
4412 theAngularTolerance angular tolerance value (default = 1e-12)
4413 theName Object name; when specified, this parameter is used
4414 for result publication in the study. Otherwise, if automatic
4415 publication is switched on, default value is used for result name.
4418 New GEOM.GEOM_Object, containing the created edge.
4420 # Example: see GEOM_TestAll.py
4421 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4422 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4423 self._autoPublish(anObj, theName, "edge")
4426 ## Create a wire from the set of edges and wires.
4427 # @param theEdgesAndWires List of edges and/or wires.
4428 # @param theTolerance Maximum distance between vertices, that will be merged.
4429 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4430 # @param theName Object name; when specified, this parameter is used
4431 # for result publication in the study. Otherwise, if automatic
4432 # publication is switched on, default value is used for result name.
4434 # @return New GEOM.GEOM_Object, containing the created wire.
4436 # @ref tui_creation_wire "Example"
4437 @ManageTransactions("ShapesOp")
4438 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4440 Create a wire from the set of edges and wires.
4443 theEdgesAndWires List of edges and/or wires.
4444 theTolerance Maximum distance between vertices, that will be merged.
4445 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4446 theName Object name; when specified, this parameter is used
4447 for result publication in the study. Otherwise, if automatic
4448 publication is switched on, default value is used for result name.
4451 New GEOM.GEOM_Object, containing the created wire.
4453 # Example: see GEOM_TestAll.py
4454 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4455 RaiseIfFailed("MakeWire", self.ShapesOp)
4456 self._autoPublish(anObj, theName, "wire")
4459 ## Create a face on the given wire.
4460 # @param theWire closed Wire or Edge to build the face on.
4461 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4462 # If the tolerance of the obtained planar face is less
4463 # than 1e-06, this face will be returned, otherwise the
4464 # algorithm tries to build any suitable face on the given
4465 # wire and prints a warning message.
4466 # @param theName Object name; when specified, this parameter is used
4467 # for result publication in the study. Otherwise, if automatic
4468 # publication is switched on, default value is used for result name.
4470 # @return New GEOM.GEOM_Object, containing the created face.
4472 # @ref tui_creation_face "Example"
4473 @ManageTransactions("ShapesOp")
4474 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4476 Create a face on the given wire.
4479 theWire closed Wire or Edge to build the face on.
4480 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4481 If the tolerance of the obtained planar face is less
4482 than 1e-06, this face will be returned, otherwise the
4483 algorithm tries to build any suitable face on the given
4484 wire and prints a warning message.
4485 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.
4490 New GEOM.GEOM_Object, containing the created face.
4492 # Example: see GEOM_TestAll.py
4493 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4494 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4495 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4497 RaiseIfFailed("MakeFace", self.ShapesOp)
4498 self._autoPublish(anObj, theName, "face")
4501 ## Create a face on the given wires set.
4502 # @param theWires List of closed wires or edges to build the face on.
4503 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4504 # If the tolerance of the obtained planar face is less
4505 # than 1e-06, this face will be returned, otherwise the
4506 # algorithm tries to build any suitable face on the given
4507 # wire and prints a warning message.
4508 # @param theName Object name; when specified, this parameter is used
4509 # for result publication in the study. Otherwise, if automatic
4510 # publication is switched on, default value is used for result name.
4512 # @return New GEOM.GEOM_Object, containing the created face.
4514 # @ref tui_creation_face "Example"
4515 @ManageTransactions("ShapesOp")
4516 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4518 Create a face on the given wires set.
4521 theWires List of closed wires or edges to build the face on.
4522 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4523 If the tolerance of the obtained planar face is less
4524 than 1e-06, this face will be returned, otherwise the
4525 algorithm tries to build any suitable face on the given
4526 wire and prints a warning message.
4527 theName Object name; when specified, this parameter is used
4528 for result publication in the study. Otherwise, if automatic
4529 publication is switched on, default value is used for result name.
4532 New GEOM.GEOM_Object, containing the created face.
4534 # Example: see GEOM_TestAll.py
4535 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4536 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4537 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4539 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4540 self._autoPublish(anObj, theName, "face")
4543 ## See MakeFaceWires() method for details.
4545 # @ref tui_creation_face "Example 1"
4546 # \n @ref swig_MakeFaces "Example 2"
4547 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4549 See geompy.MakeFaceWires() method for details.
4551 # Example: see GEOM_TestOthers.py
4552 # note: auto-publishing is done in self.MakeFaceWires()
4553 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4556 ## Create a face based on a surface from given face bounded
4558 # @param theFace the face whose surface is used to create a new face.
4559 # @param theWire the wire that will bound a new face.
4560 # @param theName Object name; when specified, this parameter is used
4561 # for result publication in the study. Otherwise, if automatic
4562 # publication is switched on, default value is used for result name.
4564 # @return New GEOM.GEOM_Object, containing the created face.
4566 # @ref tui_creation_face "Example"
4567 @ManageTransactions("ShapesOp")
4568 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4570 Create a face based on a surface from given face bounded
4574 theFace the face whose surface is used to create a new face.
4575 theWire the wire that will bound a new face.
4576 theName Object name; when specified, this parameter is used
4577 for result publication in the study. Otherwise, if automatic
4578 publication is switched on, default value is used for result name.
4581 New GEOM.GEOM_Object, containing the created face.
4583 # Example: see GEOM_TestAll.py
4584 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4585 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4586 self._autoPublish(anObj, theName, "face")
4589 ## Create a face from a set of edges with the given constraints.
4590 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4591 # - edges should form a closed wire;
4592 # - for each edge, constraint face is optional: if a constraint face is missing
4593 # for some edge, this means that there no constraint associated with this edge.
4594 # @param theName Object name; when specified, this parameter is used
4595 # for result publication in the study. Otherwise, if automatic
4596 # publication is switched on, default value is used for result name.
4598 # @return New GEOM.GEOM_Object, containing the created face.
4600 # @ref tui_creation_face "Example"
4601 @ManageTransactions("ShapesOp")
4602 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4604 Create a face from a set of edges with the given constraints.
4607 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4608 - edges should form a closed wire;
4609 - for each edge, constraint face is optional: if a constraint face is missing
4610 for some edge, this means that there no constraint associated with this edge.
4611 theName Object name; when specified, this parameter is used
4612 for result publication in the study. Otherwise, if automatic
4613 publication is switched on, default value is used for result name.
4616 New GEOM.GEOM_Object, containing the created face.
4618 # Example: see GEOM_TestAll.py
4619 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4621 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4622 self._autoPublish(anObj, theName, "face")
4625 ## Create a shell from the set of faces and shells.
4626 # @param theFacesAndShells List of faces and/or shells.
4627 # @param theName Object name; when specified, this parameter is used
4628 # for result publication in the study. Otherwise, if automatic
4629 # publication is switched on, default value is used for result name.
4631 # @return New GEOM.GEOM_Object, containing the created shell.
4633 # @ref tui_creation_shell "Example"
4634 @ManageTransactions("ShapesOp")
4635 def MakeShell(self, theFacesAndShells, theName=None):
4637 Create a shell from the set of faces and shells.
4640 theFacesAndShells List of faces and/or shells.
4641 theName Object name; when specified, this parameter is used
4642 for result publication in the study. Otherwise, if automatic
4643 publication is switched on, default value is used for result name.
4646 New GEOM.GEOM_Object, containing the created shell.
4648 # Example: see GEOM_TestAll.py
4649 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4650 RaiseIfFailed("MakeShell", self.ShapesOp)
4651 self._autoPublish(anObj, theName, "shell")
4654 ## Create a solid, bounded by the given shells.
4655 # @param theShells Sequence of bounding shells.
4656 # @param theName Object name; when specified, this parameter is used
4657 # for result publication in the study. Otherwise, if automatic
4658 # publication is switched on, default value is used for result name.
4660 # @return New GEOM.GEOM_Object, containing the created solid.
4662 # @ref tui_creation_solid "Example"
4663 @ManageTransactions("ShapesOp")
4664 def MakeSolid(self, theShells, theName=None):
4666 Create a solid, bounded by the given shells.
4669 theShells Sequence of bounding shells.
4670 theName Object name; when specified, this parameter is used
4671 for result publication in the study. Otherwise, if automatic
4672 publication is switched on, default value is used for result name.
4675 New GEOM.GEOM_Object, containing the created solid.
4677 # Example: see GEOM_TestAll.py
4678 theShells = ToList(theShells)
4679 if len(theShells) == 1:
4680 descr = self._IsGoodForSolid(theShells[0])
4682 # raise RuntimeError, "MakeSolidShells : " + descr
4683 if descr == "WRN_SHAPE_UNCLOSED":
4684 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4685 anObj = self.ShapesOp.MakeSolidShells(theShells)
4686 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4687 self._autoPublish(anObj, theName, "solid")
4690 ## Create a compound of the given shapes.
4691 # @param theShapes List of shapes to put in compound.
4692 # @param theName Object name; when specified, this parameter is used
4693 # for result publication in the study. Otherwise, if automatic
4694 # publication is switched on, default value is used for result name.
4696 # @return New GEOM.GEOM_Object, containing the created compound.
4698 # @ref tui_creation_compound "Example"
4699 @ManageTransactions("ShapesOp")
4700 def MakeCompound(self, theShapes, theName=None):
4702 Create a compound of the given shapes.
4705 theShapes List of shapes to put in compound.
4706 theName Object name; when specified, this parameter is used
4707 for result publication in the study. Otherwise, if automatic
4708 publication is switched on, default value is used for result name.
4711 New GEOM.GEOM_Object, containing the created compound.
4713 # Example: see GEOM_TestAll.py
4714 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4715 RaiseIfFailed("MakeCompound", self.ShapesOp)
4716 self._autoPublish(anObj, theName, "compound")
4719 ## Create a solid (or solids) from the set of faces and/or shells.
4720 # @param theFacesOrShells List of faces and/or shells.
4721 # @param isIntersect If TRUE, forces performing intersections
4722 # between arguments; otherwise (default) intersection is not performed.
4723 # @param theName Object name; when specified, this parameter is used
4724 # for result publication in the study. Otherwise, if automatic
4725 # publication is switched on, default value is used for result name.
4727 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4729 # @ref tui_creation_solid_from_faces "Example"
4730 @ManageTransactions("ShapesOp")
4731 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
4733 Create a solid (or solids) from the set of connected faces and/or shells.
4736 theFacesOrShells List of faces and/or shells.
4737 isIntersect If TRUE, forces performing intersections
4738 between arguments; otherwise (default) intersection is not performed
4739 theName Object name; when specified, this parameter is used.
4740 for result publication in the study. Otherwise, if automatic
4741 publication is switched on, default value is used for result name.
4744 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4746 # Example: see GEOM_TestAll.py
4747 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
4748 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
4749 self._autoPublish(anObj, theName, "solid")
4752 # end of l3_advanced
4755 ## @addtogroup l2_measure
4758 ## Gives quantity of faces in the given shape.
4759 # @param theShape Shape to count faces of.
4760 # @return Quantity of faces.
4762 # @ref swig_NumberOf "Example"
4763 @ManageTransactions("ShapesOp")
4764 def NumberOfFaces(self, theShape):
4766 Gives quantity of faces in the given shape.
4769 theShape Shape to count faces of.
4774 # Example: see GEOM_TestOthers.py
4775 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4776 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4779 ## Gives quantity of edges in the given shape.
4780 # @param theShape Shape to count edges of.
4781 # @return Quantity of edges.
4783 # @ref swig_NumberOf "Example"
4784 @ManageTransactions("ShapesOp")
4785 def NumberOfEdges(self, theShape):
4787 Gives quantity of edges in the given shape.
4790 theShape Shape to count edges of.
4795 # Example: see GEOM_TestOthers.py
4796 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4797 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4800 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4801 # @param theShape Shape to count sub-shapes of.
4802 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4803 # @return Quantity of sub-shapes of given type.
4805 # @ref swig_NumberOf "Example"
4806 @ManageTransactions("ShapesOp")
4807 def NumberOfSubShapes(self, theShape, theShapeType):
4809 Gives quantity of sub-shapes of type theShapeType in the given shape.
4812 theShape Shape to count sub-shapes of.
4813 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4816 Quantity of sub-shapes of given type.
4818 # Example: see GEOM_TestOthers.py
4819 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4820 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4823 ## Gives quantity of solids in the given shape.
4824 # @param theShape Shape to count solids in.
4825 # @return Quantity of solids.
4827 # @ref swig_NumberOf "Example"
4828 @ManageTransactions("ShapesOp")
4829 def NumberOfSolids(self, theShape):
4831 Gives quantity of solids in the given shape.
4834 theShape Shape to count solids in.
4839 # Example: see GEOM_TestOthers.py
4840 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4841 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4847 ## @addtogroup l3_healing
4850 ## Reverses an orientation the given shape.
4851 # @param theShape Shape to be reversed.
4852 # @param theName Object name; when specified, this parameter is used
4853 # for result publication in the study. Otherwise, if automatic
4854 # publication is switched on, default value is used for result name.
4856 # @return The reversed copy of theShape.
4858 # @ref swig_ChangeOrientation "Example"
4859 @ManageTransactions("ShapesOp")
4860 def ChangeOrientation(self, theShape, theName=None):
4862 Reverses an orientation the given shape.
4865 theShape Shape to be reversed.
4866 theName Object name; when specified, this parameter is used
4867 for result publication in the study. Otherwise, if automatic
4868 publication is switched on, default value is used for result name.
4871 The reversed copy of theShape.
4873 # Example: see GEOM_TestAll.py
4874 anObj = self.ShapesOp.ChangeOrientation(theShape)
4875 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4876 self._autoPublish(anObj, theName, "reversed")
4879 ## See ChangeOrientation() method for details.
4881 # @ref swig_OrientationChange "Example"
4882 def OrientationChange(self, theShape, theName=None):
4884 See geompy.ChangeOrientation method for details.
4886 # Example: see GEOM_TestOthers.py
4887 # note: auto-publishing is done in self.ChangeOrientation()
4888 anObj = self.ChangeOrientation(theShape, theName)
4894 ## @addtogroup l4_obtain
4897 ## Retrieve all free faces from the given shape.
4898 # Free face is a face, which is not shared between two shells of the shape.
4899 # @param theShape Shape to find free faces in.
4900 # @return List of IDs of all free faces, contained in theShape.
4902 # @ref tui_free_faces_page "Example"
4903 @ManageTransactions("ShapesOp")
4904 def GetFreeFacesIDs(self,theShape):
4906 Retrieve all free faces from the given shape.
4907 Free face is a face, which is not shared between two shells of the shape.
4910 theShape Shape to find free faces in.
4913 List of IDs of all free faces, contained in theShape.
4915 # Example: see GEOM_TestOthers.py
4916 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4917 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4920 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4921 # @param theShape1 Shape to find sub-shapes in.
4922 # @param theShape2 Shape to find shared sub-shapes with.
4923 # @param theShapeType Type of sub-shapes to be retrieved.
4924 # @param theName Object name; when specified, this parameter is used
4925 # for result publication in the study. Otherwise, if automatic
4926 # publication is switched on, default value is used for result name.
4928 # @return List of sub-shapes of theShape1, shared with theShape2.
4930 # @ref swig_GetSharedShapes "Example"
4931 @ManageTransactions("ShapesOp")
4932 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4934 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4937 theShape1 Shape to find sub-shapes in.
4938 theShape2 Shape to find shared sub-shapes with.
4939 theShapeType Type of sub-shapes to be retrieved.
4940 theName Object name; when specified, this parameter is used
4941 for result publication in the study. Otherwise, if automatic
4942 publication is switched on, default value is used for result name.
4945 List of sub-shapes of theShape1, shared with theShape2.
4947 # Example: see GEOM_TestOthers.py
4948 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4949 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4950 self._autoPublish(aList, theName, "shared")
4953 ## Get sub-shapes, shared by input shapes.
4954 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
4955 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
4956 # @param theMultiShare Specifies what type of shares should be checked:
4957 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
4958 # - @c False: causes to search sub-shapes shared between couples of input shapes.
4959 # @param theName Object name; when specified, this parameter is used
4960 # for result publication in the study. Otherwise, if automatic
4961 # publication is switched on, default value is used for result name.
4963 # @note If @a theShapes contains single compound, the shares between all possible couples of
4964 # its top-level shapes are returned; otherwise, only shares between 1st input shape
4965 # and all rest input shapes are returned.
4967 # @return List of all found sub-shapes.
4970 # - @ref tui_shared_shapes "Example 1"
4971 # - @ref swig_GetSharedShapes "Example 2"
4972 @ManageTransactions("ShapesOp")
4973 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
4975 Get sub-shapes, shared by input shapes.
4978 theShapes Either a list or compound of shapes to find common sub-shapes of.
4979 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
4980 theMultiShare Specifies what type of shares should be checked:
4981 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
4982 - False: causes to search sub-shapes shared between couples of input shapes.
4983 theName Object name; when specified, this parameter is used
4984 for result publication in the study. Otherwise, if automatic
4985 publication is switched on, default value is used for result name.
4987 Note: if theShapes contains single compound, the shares between all possible couples of
4988 its top-level shapes are returned; otherwise, only shares between 1st input shape
4989 and all rest input shapes are returned.
4992 List of all found sub-shapes.
4994 # Example: see GEOM_TestOthers.py
4995 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
4996 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4997 self._autoPublish(aList, theName, "shared")
5000 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5001 # situated relatively the specified plane by the certain way,
5002 # defined through <VAR>theState</VAR> parameter.
5003 # @param theShape Shape to find sub-shapes of.
5004 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5005 # @param theAx1 Vector (or line, or linear edge), specifying normal
5006 # direction and location of the plane to find shapes on.
5007 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5008 # @param theName Object name; when specified, this parameter is used
5009 # for result publication in the study. Otherwise, if automatic
5010 # publication is switched on, default value is used for result name.
5012 # @return List of all found sub-shapes.
5014 # @ref swig_GetShapesOnPlane "Example"
5015 @ManageTransactions("ShapesOp")
5016 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5018 Find in theShape all sub-shapes of type theShapeType,
5019 situated relatively the specified plane by the certain way,
5020 defined through theState parameter.
5023 theShape Shape to find sub-shapes of.
5024 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5025 theAx1 Vector (or line, or linear edge), specifying normal
5026 direction and location of the plane to find shapes on.
5027 theState The state of the sub-shapes to find (see GEOM::shape_state)
5028 theName Object name; when specified, this parameter is used
5029 for result publication in the study. Otherwise, if automatic
5030 publication is switched on, default value is used for result name.
5033 List of all found sub-shapes.
5035 # Example: see GEOM_TestOthers.py
5036 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5037 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5038 self._autoPublish(aList, theName, "shapeOnPlane")
5041 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5042 # situated relatively the specified plane by the certain way,
5043 # defined through <VAR>theState</VAR> parameter.
5044 # @param theShape Shape to find sub-shapes of.
5045 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5046 # @param theAx1 Vector (or line, or linear edge), specifying normal
5047 # direction and location of the plane to find shapes on.
5048 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5050 # @return List of all found sub-shapes indices.
5052 # @ref swig_GetShapesOnPlaneIDs "Example"
5053 @ManageTransactions("ShapesOp")
5054 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5056 Find in theShape all sub-shapes of type theShapeType,
5057 situated relatively the specified plane by the certain way,
5058 defined through theState parameter.
5061 theShape Shape to find sub-shapes of.
5062 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5063 theAx1 Vector (or line, or linear edge), specifying normal
5064 direction and location of the plane to find shapes on.
5065 theState The state of the sub-shapes to find (see GEOM::shape_state)
5068 List of all found sub-shapes indices.
5070 # Example: see GEOM_TestOthers.py
5071 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5072 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5075 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5076 # situated relatively the specified plane by the certain way,
5077 # defined through <VAR>theState</VAR> parameter.
5078 # @param theShape Shape to find sub-shapes of.
5079 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5080 # @param theAx1 Vector (or line, or linear edge), specifying normal
5081 # direction of the plane to find shapes on.
5082 # @param thePnt Point specifying location of the plane to find shapes on.
5083 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5084 # @param theName Object name; when specified, this parameter is used
5085 # for result publication in the study. Otherwise, if automatic
5086 # publication is switched on, default value is used for result name.
5088 # @return List of all found sub-shapes.
5090 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5091 @ManageTransactions("ShapesOp")
5092 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5094 Find in theShape all sub-shapes of type theShapeType,
5095 situated relatively the specified plane by the certain way,
5096 defined through theState parameter.
5099 theShape Shape to find sub-shapes of.
5100 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5101 theAx1 Vector (or line, or linear edge), specifying normal
5102 direction and location of the plane to find shapes on.
5103 thePnt Point specifying location of the plane to find shapes on.
5104 theState The state of the sub-shapes to find (see GEOM::shape_state)
5105 theName Object name; when specified, this parameter is used
5106 for result publication in the study. Otherwise, if automatic
5107 publication is switched on, default value is used for result name.
5110 List of all found sub-shapes.
5112 # Example: see GEOM_TestOthers.py
5113 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5114 theAx1, thePnt, theState)
5115 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5116 self._autoPublish(aList, theName, "shapeOnPlane")
5119 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5120 # situated relatively the specified plane by the certain way,
5121 # defined through <VAR>theState</VAR> parameter.
5122 # @param theShape Shape to find sub-shapes of.
5123 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5124 # @param theAx1 Vector (or line, or linear edge), specifying normal
5125 # direction of the plane to find shapes on.
5126 # @param thePnt Point specifying location of the plane to find shapes on.
5127 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5129 # @return List of all found sub-shapes indices.
5131 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5132 @ManageTransactions("ShapesOp")
5133 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5135 Find in theShape all sub-shapes of type theShapeType,
5136 situated relatively the specified plane by the certain way,
5137 defined through theState parameter.
5140 theShape Shape to find sub-shapes of.
5141 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5142 theAx1 Vector (or line, or linear edge), specifying normal
5143 direction and location of the plane to find shapes on.
5144 thePnt Point specifying location of the plane to find shapes on.
5145 theState The state of the sub-shapes to find (see GEOM::shape_state)
5148 List of all found sub-shapes indices.
5150 # Example: see GEOM_TestOthers.py
5151 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5152 theAx1, thePnt, theState)
5153 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5156 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5157 # the specified cylinder by the certain way, defined through \a theState parameter.
5158 # @param theShape Shape to find sub-shapes of.
5159 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5160 # @param theAxis Vector (or line, or linear edge), specifying
5161 # axis of the cylinder to find shapes on.
5162 # @param theRadius Radius of the cylinder to find shapes on.
5163 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5164 # @param theName Object name; when specified, this parameter is used
5165 # for result publication in the study. Otherwise, if automatic
5166 # publication is switched on, default value is used for result name.
5168 # @return List of all found sub-shapes.
5170 # @ref swig_GetShapesOnCylinder "Example"
5171 @ManageTransactions("ShapesOp")
5172 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5174 Find in theShape all sub-shapes of type theShapeType, situated relatively
5175 the specified cylinder by the certain way, defined through theState parameter.
5178 theShape Shape to find sub-shapes of.
5179 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5180 theAxis Vector (or line, or linear edge), specifying
5181 axis of the cylinder to find shapes on.
5182 theRadius Radius of the cylinder to find shapes on.
5183 theState The state of the sub-shapes to find (see GEOM::shape_state)
5184 theName Object name; when specified, this parameter is used
5185 for result publication in the study. Otherwise, if automatic
5186 publication is switched on, default value is used for result name.
5189 List of all found sub-shapes.
5191 # Example: see GEOM_TestOthers.py
5192 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5193 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5194 self._autoPublish(aList, theName, "shapeOnCylinder")
5197 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5198 # the specified cylinder by the certain way, defined through \a theState parameter.
5199 # @param theShape Shape to find sub-shapes of.
5200 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5201 # @param theAxis Vector (or line, or linear edge), specifying
5202 # axis of the cylinder to find shapes on.
5203 # @param theRadius Radius of the cylinder to find shapes on.
5204 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5206 # @return List of all found sub-shapes indices.
5208 # @ref swig_GetShapesOnCylinderIDs "Example"
5209 @ManageTransactions("ShapesOp")
5210 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5212 Find in theShape all sub-shapes of type theShapeType, situated relatively
5213 the specified cylinder by the certain way, defined through theState parameter.
5216 theShape Shape to find sub-shapes of.
5217 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5218 theAxis Vector (or line, or linear edge), specifying
5219 axis of the cylinder to find shapes on.
5220 theRadius Radius of the cylinder to find shapes on.
5221 theState The state of the sub-shapes to find (see GEOM::shape_state)
5224 List of all found sub-shapes indices.
5226 # Example: see GEOM_TestOthers.py
5227 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5228 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5231 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5232 # the specified cylinder by the certain way, defined through \a theState parameter.
5233 # @param theShape Shape to find sub-shapes of.
5234 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5235 # @param theAxis Vector (or line, or linear edge), specifying
5236 # axis of the cylinder to find shapes on.
5237 # @param thePnt Point specifying location of the bottom of the cylinder.
5238 # @param theRadius Radius of the cylinder to find shapes on.
5239 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5240 # @param theName Object name; when specified, this parameter is used
5241 # for result publication in the study. Otherwise, if automatic
5242 # publication is switched on, default value is used for result name.
5244 # @return List of all found sub-shapes.
5246 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5247 @ManageTransactions("ShapesOp")
5248 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5250 Find in theShape all sub-shapes of type theShapeType, situated relatively
5251 the specified cylinder by the certain way, defined through theState parameter.
5254 theShape Shape to find sub-shapes of.
5255 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5256 theAxis Vector (or line, or linear edge), specifying
5257 axis of the cylinder to find shapes on.
5258 theRadius Radius of the cylinder to find shapes on.
5259 theState The state of the sub-shapes to find (see GEOM::shape_state)
5260 theName Object name; when specified, this parameter is used
5261 for result publication in the study. Otherwise, if automatic
5262 publication is switched on, default value is used for result name.
5265 List of all found sub-shapes.
5267 # Example: see GEOM_TestOthers.py
5268 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5269 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5270 self._autoPublish(aList, theName, "shapeOnCylinder")
5273 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5274 # the specified cylinder by the certain way, defined through \a theState parameter.
5275 # @param theShape Shape to find sub-shapes of.
5276 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5277 # @param theAxis Vector (or line, or linear edge), specifying
5278 # axis of the cylinder to find shapes on.
5279 # @param thePnt Point specifying location of the bottom of the cylinder.
5280 # @param theRadius Radius of the cylinder to find shapes on.
5281 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5283 # @return List of all found sub-shapes indices
5285 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5286 @ManageTransactions("ShapesOp")
5287 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5289 Find in theShape all sub-shapes of type theShapeType, situated relatively
5290 the specified cylinder by the certain way, defined through theState parameter.
5293 theShape Shape to find sub-shapes of.
5294 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5295 theAxis Vector (or line, or linear edge), specifying
5296 axis of the cylinder to find shapes on.
5297 theRadius Radius of the cylinder to find shapes on.
5298 theState The state of the sub-shapes to find (see GEOM::shape_state)
5301 List of all found sub-shapes indices.
5303 # Example: see GEOM_TestOthers.py
5304 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5305 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5308 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5309 # the specified sphere by the certain way, defined through \a theState parameter.
5310 # @param theShape Shape to find sub-shapes of.
5311 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5312 # @param theCenter Point, specifying center of the sphere to find shapes on.
5313 # @param theRadius Radius of the sphere to find shapes on.
5314 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5315 # @param theName Object name; when specified, this parameter is used
5316 # for result publication in the study. Otherwise, if automatic
5317 # publication is switched on, default value is used for result name.
5319 # @return List of all found sub-shapes.
5321 # @ref swig_GetShapesOnSphere "Example"
5322 @ManageTransactions("ShapesOp")
5323 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5325 Find in theShape all sub-shapes of type theShapeType, situated relatively
5326 the specified sphere by the certain way, defined through theState parameter.
5329 theShape Shape to find sub-shapes of.
5330 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5331 theCenter Point, specifying center of the sphere to find shapes on.
5332 theRadius Radius of the sphere to find shapes on.
5333 theState The state of the sub-shapes to find (see GEOM::shape_state)
5334 theName Object name; when specified, this parameter is used
5335 for result publication in the study. Otherwise, if automatic
5336 publication is switched on, default value is used for result name.
5339 List of all found sub-shapes.
5341 # Example: see GEOM_TestOthers.py
5342 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5343 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5344 self._autoPublish(aList, theName, "shapeOnSphere")
5347 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5348 # the specified sphere by the certain way, defined through \a theState parameter.
5349 # @param theShape Shape to find sub-shapes of.
5350 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5351 # @param theCenter Point, specifying center of the sphere to find shapes on.
5352 # @param theRadius Radius of the sphere to find shapes on.
5353 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5355 # @return List of all found sub-shapes indices.
5357 # @ref swig_GetShapesOnSphereIDs "Example"
5358 @ManageTransactions("ShapesOp")
5359 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5361 Find in theShape all sub-shapes of type theShapeType, situated relatively
5362 the specified sphere by the certain way, defined through theState parameter.
5365 theShape Shape to find sub-shapes of.
5366 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5367 theCenter Point, specifying center of the sphere to find shapes on.
5368 theRadius Radius of the sphere to find shapes on.
5369 theState The state of the sub-shapes to find (see GEOM::shape_state)
5372 List of all found sub-shapes indices.
5374 # Example: see GEOM_TestOthers.py
5375 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5376 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5379 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5380 # the specified quadrangle by the certain way, defined through \a theState parameter.
5381 # @param theShape Shape to find sub-shapes of.
5382 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5383 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5384 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5385 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5386 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5387 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5388 # @param theName Object name; when specified, this parameter is used
5389 # for result publication in the study. Otherwise, if automatic
5390 # publication is switched on, default value is used for result name.
5392 # @return List of all found sub-shapes.
5394 # @ref swig_GetShapesOnQuadrangle "Example"
5395 @ManageTransactions("ShapesOp")
5396 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5397 theTopLeftPoint, theTopRigthPoint,
5398 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5400 Find in theShape all sub-shapes of type theShapeType, situated relatively
5401 the specified quadrangle by the certain way, defined through theState parameter.
5404 theShape Shape to find sub-shapes of.
5405 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5406 theTopLeftPoint Point, specifying top left corner of a quadrangle
5407 theTopRigthPoint Point, specifying top right corner of a quadrangle
5408 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5409 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5410 theState The state of the sub-shapes to find (see GEOM::shape_state)
5411 theName Object name; when specified, this parameter is used
5412 for result publication in the study. Otherwise, if automatic
5413 publication is switched on, default value is used for result name.
5416 List of all found sub-shapes.
5418 # Example: see GEOM_TestOthers.py
5419 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5420 theTopLeftPoint, theTopRigthPoint,
5421 theBottomLeftPoint, theBottomRigthPoint, theState)
5422 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5423 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5426 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5427 # the specified quadrangle by the certain way, defined through \a theState parameter.
5428 # @param theShape Shape to find sub-shapes of.
5429 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5430 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5431 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5432 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5433 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5434 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5436 # @return List of all found sub-shapes indices.
5438 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5439 @ManageTransactions("ShapesOp")
5440 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5441 theTopLeftPoint, theTopRigthPoint,
5442 theBottomLeftPoint, theBottomRigthPoint, theState):
5444 Find in theShape all sub-shapes of type theShapeType, situated relatively
5445 the specified quadrangle by the certain way, defined through theState parameter.
5448 theShape Shape to find sub-shapes of.
5449 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5450 theTopLeftPoint Point, specifying top left corner of a quadrangle
5451 theTopRigthPoint Point, specifying top right corner of a quadrangle
5452 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5453 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5454 theState The state of the sub-shapes to find (see GEOM::shape_state)
5457 List of all found sub-shapes indices.
5460 # Example: see GEOM_TestOthers.py
5461 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5462 theTopLeftPoint, theTopRigthPoint,
5463 theBottomLeftPoint, theBottomRigthPoint, theState)
5464 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5467 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5468 # the specified \a theBox by the certain way, defined through \a theState parameter.
5469 # @param theBox Shape for relative comparing.
5470 # @param theShape Shape to find sub-shapes of.
5471 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5472 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5473 # @param theName Object name; when specified, this parameter is used
5474 # for result publication in the study. Otherwise, if automatic
5475 # publication is switched on, default value is used for result name.
5477 # @return List of all found sub-shapes.
5479 # @ref swig_GetShapesOnBox "Example"
5480 @ManageTransactions("ShapesOp")
5481 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5483 Find in theShape all sub-shapes of type theShapeType, situated relatively
5484 the specified theBox by the certain way, defined through theState parameter.
5487 theBox Shape for relative comparing.
5488 theShape Shape to find sub-shapes of.
5489 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5490 theState The state of the sub-shapes to find (see GEOM::shape_state)
5491 theName Object name; when specified, this parameter is used
5492 for result publication in the study. Otherwise, if automatic
5493 publication is switched on, default value is used for result name.
5496 List of all found sub-shapes.
5498 # Example: see GEOM_TestOthers.py
5499 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5500 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5501 self._autoPublish(aList, theName, "shapeOnBox")
5504 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5505 # the specified \a theBox by the certain way, defined through \a theState parameter.
5506 # @param theBox Shape for relative comparing.
5507 # @param theShape Shape to find sub-shapes of.
5508 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5509 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5511 # @return List of all found sub-shapes indices.
5513 # @ref swig_GetShapesOnBoxIDs "Example"
5514 @ManageTransactions("ShapesOp")
5515 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5517 Find in theShape all sub-shapes of type theShapeType, situated relatively
5518 the specified theBox by the certain way, defined through theState parameter.
5521 theBox Shape for relative comparing.
5522 theShape Shape to find sub-shapes of.
5523 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5524 theState The state of the sub-shapes to find (see GEOM::shape_state)
5527 List of all found sub-shapes indices.
5529 # Example: see GEOM_TestOthers.py
5530 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5531 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5534 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5535 # situated relatively the specified \a theCheckShape by the
5536 # certain way, defined through \a theState parameter.
5537 # @param theCheckShape Shape for relative comparing. It must be a solid.
5538 # @param theShape Shape to find sub-shapes of.
5539 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5540 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5541 # @param theName Object name; when specified, this parameter is used
5542 # for result publication in the study. Otherwise, if automatic
5543 # publication is switched on, default value is used for result name.
5545 # @return List of all found sub-shapes.
5547 # @ref swig_GetShapesOnShape "Example"
5548 @ManageTransactions("ShapesOp")
5549 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5551 Find in theShape all sub-shapes of type theShapeType,
5552 situated relatively the specified theCheckShape by the
5553 certain way, defined through theState parameter.
5556 theCheckShape Shape for relative comparing. It must be a solid.
5557 theShape Shape to find sub-shapes of.
5558 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5559 theState The state of the sub-shapes to find (see GEOM::shape_state)
5560 theName Object name; when specified, this parameter is used
5561 for result publication in the study. Otherwise, if automatic
5562 publication is switched on, default value is used for result name.
5565 List of all found sub-shapes.
5567 # Example: see GEOM_TestOthers.py
5568 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5569 theShapeType, theState)
5570 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5571 self._autoPublish(aList, theName, "shapeOnShape")
5574 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5575 # situated relatively the specified \a theCheckShape by the
5576 # certain way, defined through \a theState parameter.
5577 # @param theCheckShape Shape for relative comparing. It must be a solid.
5578 # @param theShape Shape to find sub-shapes of.
5579 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5580 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5581 # @param theName Object name; when specified, this parameter is used
5582 # for result publication in the study. Otherwise, if automatic
5583 # publication is switched on, default value is used for result name.
5585 # @return All found sub-shapes as compound.
5587 # @ref swig_GetShapesOnShapeAsCompound "Example"
5588 @ManageTransactions("ShapesOp")
5589 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5591 Find in theShape all sub-shapes of type theShapeType,
5592 situated relatively the specified theCheckShape by the
5593 certain way, defined through theState parameter.
5596 theCheckShape Shape for relative comparing. It must be a solid.
5597 theShape Shape to find sub-shapes of.
5598 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5599 theState The state of the sub-shapes to find (see GEOM::shape_state)
5600 theName Object name; when specified, this parameter is used
5601 for result publication in the study. Otherwise, if automatic
5602 publication is switched on, default value is used for result name.
5605 All found sub-shapes as compound.
5607 # Example: see GEOM_TestOthers.py
5608 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5609 theShapeType, theState)
5610 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5611 self._autoPublish(anObj, theName, "shapeOnShape")
5614 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5615 # situated relatively the specified \a theCheckShape by the
5616 # certain way, defined through \a theState parameter.
5617 # @param theCheckShape Shape for relative comparing. It must be a solid.
5618 # @param theShape Shape to find sub-shapes of.
5619 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5620 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5622 # @return List of all found sub-shapes indices.
5624 # @ref swig_GetShapesOnShapeIDs "Example"
5625 @ManageTransactions("ShapesOp")
5626 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5628 Find in theShape all sub-shapes of type theShapeType,
5629 situated relatively the specified theCheckShape by the
5630 certain way, defined through theState parameter.
5633 theCheckShape Shape for relative comparing. It must be a solid.
5634 theShape Shape to find sub-shapes of.
5635 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5636 theState The state of the sub-shapes to find (see GEOM::shape_state)
5639 List of all found sub-shapes indices.
5641 # Example: see GEOM_TestOthers.py
5642 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5643 theShapeType, theState)
5644 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5647 ## Get sub-shape(s) of theShapeWhere, which are
5648 # coincident with \a theShapeWhat or could be a part of it.
5649 # @param theShapeWhere Shape to find sub-shapes of.
5650 # @param theShapeWhat Shape, specifying what to find.
5651 # @param isNewImplementation implementation of GetInPlace functionality
5652 # (default = False, old alghorithm based on shape properties)
5653 # @param theName Object name; when specified, this parameter is used
5654 # for result publication in the study. Otherwise, if automatic
5655 # publication is switched on, default value is used for result name.
5657 # @return Group of all found sub-shapes or a single found sub-shape.
5659 # @note This function has a restriction on argument shapes.
5660 # If \a theShapeWhere has curved parts with significantly
5661 # outstanding centres (i.e. the mass centre of a part is closer to
5662 # \a theShapeWhat than to the part), such parts will not be found.
5663 # @image html get_in_place_lost_part.png
5665 # @ref swig_GetInPlace "Example"
5666 @ManageTransactions("ShapesOp")
5667 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5669 Get sub-shape(s) of theShapeWhere, which are
5670 coincident with theShapeWhat or could be a part of it.
5673 theShapeWhere Shape to find sub-shapes of.
5674 theShapeWhat Shape, specifying what to find.
5675 isNewImplementation Implementation of GetInPlace functionality
5676 (default = False, old alghorithm based on shape properties)
5677 theName Object name; when specified, this parameter is used
5678 for result publication in the study. Otherwise, if automatic
5679 publication is switched on, default value is used for result name.
5682 Group of all found sub-shapes or a single found sub-shape.
5686 This function has a restriction on argument shapes.
5687 If theShapeWhere has curved parts with significantly
5688 outstanding centres (i.e. the mass centre of a part is closer to
5689 theShapeWhat than to the part), such parts will not be found.
5691 # Example: see GEOM_TestOthers.py
5693 if isNewImplementation:
5694 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5696 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5698 RaiseIfFailed("GetInPlace", self.ShapesOp)
5699 self._autoPublish(anObj, theName, "inplace")
5702 ## Get sub-shape(s) of \a theShapeWhere, which are
5703 # coincident with \a theShapeWhat or could be a part of it.
5705 # Implementation of this method is based on a saved history of an operation,
5706 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5707 # arguments (an argument shape or a sub-shape of an argument shape).
5708 # The operation could be the Partition or one of boolean operations,
5709 # performed on simple shapes (not on compounds).
5711 # @param theShapeWhere Shape to find sub-shapes of.
5712 # @param theShapeWhat Shape, specifying what to find (must be in the
5713 # building history of the ShapeWhere).
5714 # @param theName Object name; when specified, this parameter is used
5715 # for result publication in the study. Otherwise, if automatic
5716 # publication is switched on, default value is used for result name.
5718 # @return Group of all found sub-shapes or a single found sub-shape.
5720 # @ref swig_GetInPlace "Example"
5721 @ManageTransactions("ShapesOp")
5722 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5724 Implementation of this method is based on a saved history of an operation,
5725 produced theShapeWhere. The theShapeWhat must be among this operation's
5726 arguments (an argument shape or a sub-shape of an argument shape).
5727 The operation could be the Partition or one of boolean operations,
5728 performed on simple shapes (not on compounds).
5731 theShapeWhere Shape to find sub-shapes of.
5732 theShapeWhat Shape, specifying what to find (must be in the
5733 building history of the ShapeWhere).
5734 theName Object name; when specified, this parameter is used
5735 for result publication in the study. Otherwise, if automatic
5736 publication is switched on, default value is used for result name.
5739 Group of all found sub-shapes or a single found sub-shape.
5741 # Example: see GEOM_TestOthers.py
5742 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5743 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5744 self._autoPublish(anObj, theName, "inplace")
5747 ## Get sub-shape of theShapeWhere, which is
5748 # equal to \a theShapeWhat.
5749 # @param theShapeWhere Shape to find sub-shape of.
5750 # @param theShapeWhat Shape, specifying what to find.
5751 # @param theName Object name; when specified, this parameter is used
5752 # for result publication in the study. Otherwise, if automatic
5753 # publication is switched on, default value is used for result name.
5755 # @return New GEOM.GEOM_Object for found sub-shape.
5757 # @ref swig_GetSame "Example"
5758 @ManageTransactions("ShapesOp")
5759 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5761 Get sub-shape of theShapeWhere, which is
5762 equal to theShapeWhat.
5765 theShapeWhere Shape to find sub-shape of.
5766 theShapeWhat Shape, specifying what to find.
5767 theName Object name; when specified, this parameter is used
5768 for result publication in the study. Otherwise, if automatic
5769 publication is switched on, default value is used for result name.
5772 New GEOM.GEOM_Object for found sub-shape.
5774 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5775 RaiseIfFailed("GetSame", self.ShapesOp)
5776 self._autoPublish(anObj, theName, "sameShape")
5780 ## Get sub-shape indices of theShapeWhere, which is
5781 # equal to \a theShapeWhat.
5782 # @param theShapeWhere Shape to find sub-shape of.
5783 # @param theShapeWhat Shape, specifying what to find.
5784 # @return List of all found sub-shapes indices.
5786 # @ref swig_GetSame "Example"
5787 @ManageTransactions("ShapesOp")
5788 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5790 Get sub-shape indices of theShapeWhere, which is
5791 equal to theShapeWhat.
5794 theShapeWhere Shape to find sub-shape of.
5795 theShapeWhat Shape, specifying what to find.
5798 List of all found sub-shapes indices.
5800 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5801 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5804 ## Resize the input edge with the new Min and Max parameters.
5805 # The input edge parameters range is [0, 1]. If theMin parameter is
5806 # negative, the input edge is extended, otherwise it is shrinked by
5807 # theMin parameter. If theMax is greater than 1, the edge is extended,
5808 # otherwise it is shrinked by theMax parameter.
5809 # @param theEdge the input edge to be resized.
5810 # @param theMin the minimal parameter value.
5811 # @param theMax the maximal parameter value.
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.
5815 # @return New GEOM.GEOM_Object, containing the created edge.
5817 # @ref tui_extend "Example"
5818 @ManageTransactions("ShapesOp")
5819 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
5821 Resize the input edge with the new Min and Max parameters.
5822 The input edge parameters range is [0, 1]. If theMin parameter is
5823 negative, the input edge is extended, otherwise it is shrinked by
5824 theMin parameter. If theMax is greater than 1, the edge is extended,
5825 otherwise it is shrinked by theMax parameter.
5828 theEdge the input edge to be resized.
5829 theMin the minimal parameter value.
5830 theMax the maximal parameter value.
5831 theName Object name; when specified, this parameter is used
5832 for result publication in the study. Otherwise, if automatic
5833 publication is switched on, default value is used for result name.
5836 New GEOM.GEOM_Object, containing the created edge.
5838 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
5839 RaiseIfFailed("ExtendEdge", self.ShapesOp)
5840 self._autoPublish(anObj, theName, "edge")
5843 ## Resize the input face with the new UMin, UMax, VMin and VMax
5844 # parameters. The input face U and V parameters range is [0, 1]. If
5845 # theUMin parameter is negative, the input face is extended, otherwise
5846 # it is shrinked along U direction by theUMin parameter. If theUMax is
5847 # greater than 1, the face is extended, otherwise it is shrinked along
5848 # U direction by theUMax parameter. So as for theVMin, theVMax and
5849 # V direction of the input face.
5850 # @param theFace the input face to be resized.
5851 # @param theUMin the minimal U parameter value.
5852 # @param theUMax the maximal U parameter value.
5853 # @param theVMin the minimal V parameter value.
5854 # @param theVMax the maximal V parameter value.
5855 # @param theName Object name; when specified, this parameter is used
5856 # for result publication in the study. Otherwise, if automatic
5857 # publication is switched on, default value is used for result name.
5858 # @return New GEOM.GEOM_Object, containing the created face.
5860 # @ref tui_extend "Example"
5861 @ManageTransactions("ShapesOp")
5862 def ExtendFace(self, theFace, theUMin, theUMax,
5863 theVMin, theVMax, theName=None):
5865 Resize the input face with the new UMin, UMax, VMin and VMax
5866 parameters. The input face U and V parameters range is [0, 1]. If
5867 theUMin parameter is negative, the input face is extended, otherwise
5868 it is shrinked along U direction by theUMin parameter. If theUMax is
5869 greater than 1, the face is extended, otherwise it is shrinked along
5870 U direction by theUMax parameter. So as for theVMin, theVMax and
5871 V direction of the input face.
5874 theFace the input face to be resized.
5875 theUMin the minimal U parameter value.
5876 theUMax the maximal U parameter value.
5877 theVMin the minimal V parameter value.
5878 theVMax the maximal V parameter value.
5879 theName Object name; when specified, this parameter is used
5880 for result publication in the study. Otherwise, if automatic
5881 publication is switched on, default value is used for result name.
5884 New GEOM.GEOM_Object, containing the created face.
5886 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
5888 RaiseIfFailed("ExtendFace", self.ShapesOp)
5889 self._autoPublish(anObj, theName, "face")
5892 ## This function takes some face as input parameter and creates new
5893 # GEOM_Object, i.e. topological shape by extracting underlying surface
5894 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5895 # parameters of the source face (in the parametrical space).
5896 # @param theFace the input face.
5897 # @param theName Object name; when specified, this parameter is used
5898 # for result publication in the study. Otherwise, if automatic
5899 # publication is switched on, default value is used for result name.
5900 # @return New GEOM.GEOM_Object, containing the created face.
5902 # @ref tui_creation_surface "Example"
5903 @ManageTransactions("ShapesOp")
5904 def MakeSurfaceFromFace(self, theFace, theName=None):
5906 This function takes some face as input parameter and creates new
5907 GEOM_Object, i.e. topological shape by extracting underlying surface
5908 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5909 parameters of the source face (in the parametrical space).
5912 theFace the input face.
5913 theName Object name; when specified, this parameter is used
5914 for result publication in the study. Otherwise, if automatic
5915 publication is switched on, default value is used for result name.
5918 New GEOM.GEOM_Object, containing the created face.
5920 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
5921 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
5922 self._autoPublish(anObj, theName, "surface")
5928 ## @addtogroup l4_access
5931 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5932 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5933 # @param aShape Shape to get sub-shape of.
5934 # @param ListOfID List of sub-shapes indices.
5935 # @param theName Object name; when specified, this parameter is used
5936 # for result publication in the study. Otherwise, if automatic
5937 # publication is switched on, default value is used for result name.
5939 # @return Found sub-shape.
5941 # @ref swig_all_decompose "Example"
5942 def GetSubShape(self, aShape, ListOfID, theName=None):
5944 Obtain a composite sub-shape of aShape, composed from sub-shapes
5945 of aShape, selected by their unique IDs inside aShape
5948 aShape Shape to get sub-shape of.
5949 ListOfID List of sub-shapes indices.
5950 theName Object name; when specified, this parameter is used
5951 for result publication in the study. Otherwise, if automatic
5952 publication is switched on, default value is used for result name.
5957 # Example: see GEOM_TestAll.py
5958 anObj = self.AddSubShape(aShape,ListOfID)
5959 self._autoPublish(anObj, theName, "subshape")
5962 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5963 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5964 # @param aShape Shape to get sub-shape of.
5965 # @param aSubShape Sub-shapes of aShape.
5966 # @return ID of found sub-shape.
5968 # @ref swig_all_decompose "Example"
5969 @ManageTransactions("LocalOp")
5970 def GetSubShapeID(self, aShape, aSubShape):
5972 Obtain unique ID of sub-shape aSubShape inside aShape
5973 of aShape, selected by their unique IDs inside aShape
5976 aShape Shape to get sub-shape of.
5977 aSubShape Sub-shapes of aShape.
5980 ID of found sub-shape.
5982 # Example: see GEOM_TestAll.py
5983 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5984 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5987 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5988 # This function is provided for performance purpose. The complexity is O(n) with n
5989 # the number of subobjects of aShape
5990 # @param aShape Shape to get sub-shape of.
5991 # @param aSubShapes Sub-shapes of aShape.
5992 # @return list of IDs of found sub-shapes.
5994 # @ref swig_all_decompose "Example"
5995 @ManageTransactions("ShapesOp")
5996 def GetSubShapesIDs(self, aShape, aSubShapes):
5998 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5999 This function is provided for performance purpose. The complexity is O(n) with n
6000 the number of subobjects of aShape
6003 aShape Shape to get sub-shape of.
6004 aSubShapes Sub-shapes of aShape.
6007 List of IDs of found sub-shape.
6009 # Example: see GEOM_TestAll.py
6010 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6011 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6017 ## @addtogroup l4_decompose
6020 ## Get all sub-shapes and groups of \a theShape,
6021 # that were created already by any other methods.
6022 # @param theShape Any shape.
6023 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6024 # returned, else all found sub-shapes and groups.
6025 # @return List of existing sub-objects of \a theShape.
6027 # @ref swig_all_decompose "Example"
6028 @ManageTransactions("ShapesOp")
6029 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6031 Get all sub-shapes and groups of theShape,
6032 that were created already by any other methods.
6036 theGroupsOnly If this parameter is TRUE, only groups will be
6037 returned, else all found sub-shapes and groups.
6040 List of existing sub-objects of theShape.
6042 # Example: see GEOM_TestAll.py
6043 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6044 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6047 ## Get all groups of \a theShape,
6048 # that were created already by any other methods.
6049 # @param theShape Any shape.
6050 # @return List of existing groups of \a theShape.
6052 # @ref swig_all_decompose "Example"
6053 @ManageTransactions("ShapesOp")
6054 def GetGroups(self, theShape):
6056 Get all groups of theShape,
6057 that were created already by any other methods.
6063 List of existing groups of theShape.
6065 # Example: see GEOM_TestAll.py
6066 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6067 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6070 ## Explode a shape on sub-shapes of a given type.
6071 # If the shape itself matches the type, it is also returned.
6072 # @param aShape Shape to be exploded.
6073 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6074 # @param theName Object name; when specified, this parameter is used
6075 # for result publication in the study. Otherwise, if automatic
6076 # publication is switched on, default value is used for result name.
6078 # @return List of sub-shapes of type theShapeType, contained in theShape.
6080 # @ref swig_all_decompose "Example"
6081 @ManageTransactions("ShapesOp")
6082 def SubShapeAll(self, aShape, aType, theName=None):
6084 Explode a shape on sub-shapes of a given type.
6085 If the shape itself matches the type, it is also returned.
6088 aShape Shape to be exploded.
6089 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6090 theName Object name; when specified, this parameter is used
6091 for result publication in the study. Otherwise, if automatic
6092 publication is switched on, default value is used for result name.
6095 List of sub-shapes of type theShapeType, contained in theShape.
6097 # Example: see GEOM_TestAll.py
6098 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6099 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6100 self._autoPublish(ListObj, theName, "subshape")
6103 ## Explode a shape on sub-shapes of a given type.
6104 # @param aShape Shape to be exploded.
6105 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6106 # @return List of IDs of sub-shapes.
6108 # @ref swig_all_decompose "Example"
6109 @ManageTransactions("ShapesOp")
6110 def SubShapeAllIDs(self, aShape, aType):
6112 Explode a shape on sub-shapes of a given type.
6115 aShape Shape to be exploded (see geompy.ShapeType)
6116 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6119 List of IDs of sub-shapes.
6121 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6122 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6125 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6126 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6127 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6128 # @param aShape Shape to get sub-shape of.
6129 # @param ListOfInd List of sub-shapes indices.
6130 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6131 # @param theName Object name; when specified, this parameter is used
6132 # for result publication in the study. Otherwise, if automatic
6133 # publication is switched on, default value is used for result name.
6135 # @return A compound of sub-shapes of aShape.
6137 # @ref swig_all_decompose "Example"
6138 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6140 Obtain a compound of sub-shapes of aShape,
6141 selected by their indices in list of all sub-shapes of type aType.
6142 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6145 aShape Shape to get sub-shape of.
6146 ListOfID List of sub-shapes indices.
6147 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6148 theName Object name; when specified, this parameter is used
6149 for result publication in the study. Otherwise, if automatic
6150 publication is switched on, default value is used for result name.
6153 A compound of sub-shapes of aShape.
6155 # Example: see GEOM_TestAll.py
6157 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6158 for ind in ListOfInd:
6159 ListOfIDs.append(AllShapeIDsList[ind - 1])
6160 # note: auto-publishing is done in self.GetSubShape()
6161 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6164 ## Explode a shape on sub-shapes of a given type.
6165 # Sub-shapes will be sorted taking into account their gravity centers,
6166 # to provide stable order of sub-shapes.
6167 # If the shape itself matches the type, it is also returned.
6168 # @param aShape Shape to be exploded.
6169 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6170 # @param theName Object name; when specified, this parameter is used
6171 # for result publication in the study. Otherwise, if automatic
6172 # publication is switched on, default value is used for result name.
6174 # @return List of sub-shapes of type theShapeType, contained in theShape.
6176 # @ref swig_SubShapeAllSorted "Example"
6177 @ManageTransactions("ShapesOp")
6178 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6180 Explode a shape on sub-shapes of a given type.
6181 Sub-shapes will be sorted taking into account their gravity centers,
6182 to provide stable order of sub-shapes.
6183 If the shape itself matches the type, it is also returned.
6186 aShape Shape to be exploded.
6187 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6188 theName Object name; when specified, this parameter is used
6189 for result publication in the study. Otherwise, if automatic
6190 publication is switched on, default value is used for result name.
6193 List of sub-shapes of type theShapeType, contained in theShape.
6195 # Example: see GEOM_TestAll.py
6196 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6197 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6198 self._autoPublish(ListObj, theName, "subshape")
6201 ## Explode a shape on sub-shapes of a given type.
6202 # Sub-shapes will be sorted taking into account their gravity centers,
6203 # to provide stable order of sub-shapes.
6204 # @param aShape Shape to be exploded.
6205 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6206 # @return List of IDs of sub-shapes.
6208 # @ref swig_all_decompose "Example"
6209 @ManageTransactions("ShapesOp")
6210 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6212 Explode a shape on sub-shapes of a given type.
6213 Sub-shapes will be sorted taking into account their gravity centers,
6214 to provide stable order of sub-shapes.
6217 aShape Shape to be exploded.
6218 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6221 List of IDs of sub-shapes.
6223 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6224 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6227 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6228 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6229 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6230 # @param aShape Shape to get sub-shape of.
6231 # @param ListOfInd List of sub-shapes indices.
6232 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6233 # @param theName Object name; when specified, this parameter is used
6234 # for result publication in the study. Otherwise, if automatic
6235 # publication is switched on, default value is used for result name.
6237 # @return A compound of sub-shapes of aShape.
6239 # @ref swig_all_decompose "Example"
6240 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6242 Obtain a compound of sub-shapes of aShape,
6243 selected by they indices in sorted list of all sub-shapes of type aType.
6244 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6247 aShape Shape to get sub-shape of.
6248 ListOfID List of sub-shapes indices.
6249 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6250 theName Object name; when specified, this parameter is used
6251 for result publication in the study. Otherwise, if automatic
6252 publication is switched on, default value is used for result name.
6255 A compound of sub-shapes of aShape.
6257 # Example: see GEOM_TestAll.py
6259 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6260 for ind in ListOfInd:
6261 ListOfIDs.append(AllShapeIDsList[ind - 1])
6262 # note: auto-publishing is done in self.GetSubShape()
6263 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6266 ## Extract shapes (excluding the main shape) of given type.
6267 # @param aShape The shape.
6268 # @param aType The shape type (see ShapeType())
6269 # @param isSorted Boolean flag to switch sorting on/off.
6270 # @param theName Object name; when specified, this parameter is used
6271 # for result publication in the study. Otherwise, if automatic
6272 # publication is switched on, default value is used for result name.
6274 # @return List of sub-shapes of type aType, contained in aShape.
6276 # @ref swig_FilletChamfer "Example"
6277 @ManageTransactions("ShapesOp")
6278 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6280 Extract shapes (excluding the main shape) of given type.
6284 aType The shape type (see geompy.ShapeType)
6285 isSorted Boolean flag to switch sorting on/off.
6286 theName Object name; when specified, this parameter is used
6287 for result publication in the study. Otherwise, if automatic
6288 publication is switched on, default value is used for result name.
6291 List of sub-shapes of type aType, contained in aShape.
6293 # Example: see GEOM_TestAll.py
6294 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6295 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6296 self._autoPublish(ListObj, theName, "subshape")
6299 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6300 # @param aShape Main shape.
6301 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6302 # @param theName Object name; when specified, this parameter is used
6303 # for result publication in the study. Otherwise, if automatic
6304 # publication is switched on, default value is used for result name.
6305 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6307 # @ref swig_all_decompose "Example"
6308 @ManageTransactions("ShapesOp")
6309 def SubShapes(self, aShape, anIDs, theName=None):
6311 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6315 anIDs List of unique IDs of sub-shapes inside theMainShape.
6316 theName Object name; when specified, this parameter is used
6317 for result publication in the study. Otherwise, if automatic
6318 publication is switched on, default value is used for result name.
6321 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6323 # Example: see GEOM_TestAll.py
6324 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6325 RaiseIfFailed("SubShapes", self.ShapesOp)
6326 self._autoPublish(ListObj, theName, "subshape")
6329 ## Explode a shape into edges sorted in a row from a starting point.
6330 # @param theShape the shape to be exploded on edges.
6331 # @param theStartPoint the starting point.
6332 # @param theName Object name; when specified, this parameter is used
6333 # for result publication in the study. Otherwise, if automatic
6334 # publication is switched on, default value is used for result name.
6335 # @return List of GEOM.GEOM_Object that is actually an ordered list
6336 # of edges sorted in a row from a starting point.
6338 # @ref swig_GetSubShapeEdgeSorted "Example"
6339 @ManageTransactions("ShapesOp")
6340 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6342 Explode a shape into edges sorted in a row from a starting point.
6345 theShape the shape to be exploded on edges.
6346 theStartPoint the starting point.
6347 theName Object name; when specified, this parameter is used
6348 for result publication in the study. Otherwise, if automatic
6349 publication is switched on, default value is used for result name.
6352 List of GEOM.GEOM_Object that is actually an ordered list
6353 of edges sorted in a row from a starting point.
6355 # Example: see GEOM_TestAll.py
6356 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6357 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6358 self._autoPublish(ListObj, theName, "SortedEdges")
6361 ## Check if the object is a sub-object of another GEOM object.
6362 # @param aSubObject Checked sub-object (or its parent object, in case if
6363 # \a theSubObjectIndex is non-zero).
6364 # @param anObject An object that is checked for ownership (or its parent object,
6365 # in case if \a theObjectIndex is non-zero).
6366 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6367 # identifies a sub-object within its parent specified via \a theSubObject.
6368 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6369 # identifies an object within its parent specified via \a theObject.
6370 # @return TRUE, if the given object contains sub-object.
6371 @ManageTransactions("ShapesOp")
6372 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6374 Check if the object is a sub-object of another GEOM object.
6377 aSubObject Checked sub-object (or its parent object, in case if
6378 \a theSubObjectIndex is non-zero).
6379 anObject An object that is checked for ownership (or its parent object,
6380 in case if \a theObjectIndex is non-zero).
6381 aSubObjectIndex When non-zero, specifies a sub-shape index that
6382 identifies a sub-object within its parent specified via \a theSubObject.
6383 anObjectIndex When non-zero, specifies a sub-shape index that
6384 identifies an object within its parent specified via \a theObject.
6387 TRUE, if the given object contains sub-object.
6389 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6390 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6393 # end of l4_decompose
6396 ## @addtogroup l4_decompose_d
6399 ## Deprecated method
6400 # It works like SubShapeAllSortedCentres(), but wrongly
6401 # defines centres of faces, shells and solids.
6402 @ManageTransactions("ShapesOp")
6403 def SubShapeAllSorted(self, aShape, aType, theName=None):
6406 It works like geompy.SubShapeAllSortedCentres, but wrongly
6407 defines centres of faces, shells and solids.
6409 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6410 RaiseIfFailed("MakeExplode", self.ShapesOp)
6411 self._autoPublish(ListObj, theName, "subshape")
6414 ## Deprecated method
6415 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6416 # defines centres of faces, shells and solids.
6417 @ManageTransactions("ShapesOp")
6418 def SubShapeAllSortedIDs(self, aShape, aType):
6421 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6422 defines centres of faces, shells and solids.
6424 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6425 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6428 ## Deprecated method
6429 # It works like SubShapeSortedCentres(), but has a bug
6430 # (wrongly defines centres of faces, shells and solids).
6431 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6434 It works like geompy.SubShapeSortedCentres, but has a bug
6435 (wrongly defines centres of faces, shells and solids).
6438 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6439 for ind in ListOfInd:
6440 ListOfIDs.append(AllShapeIDsList[ind - 1])
6441 # note: auto-publishing is done in self.GetSubShape()
6442 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6445 # end of l4_decompose_d
6448 ## @addtogroup l3_healing
6451 ## Apply a sequence of Shape Healing operators to the given object.
6452 # @param theShape Shape to be processed.
6453 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6454 # @param theParameters List of names of parameters
6455 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6456 # @param theValues List of values of parameters, in the same order
6457 # as parameters are listed in <VAR>theParameters</VAR> list.
6458 # @param theName Object name; when specified, this parameter is used
6459 # for result publication in the study. Otherwise, if automatic
6460 # publication is switched on, default value is used for result name.
6462 # <b> Operators and Parameters: </b> \n
6464 # * \b FixShape - corrects invalid shapes. \n
6465 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6466 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6468 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6469 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6470 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6471 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6472 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6473 # - \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
6474 # - \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
6475 # - \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
6477 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6478 # surfaces in segments using a certain angle. \n
6479 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6480 # if Angle=180, four if Angle=90, etc). \n
6481 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6483 # * \b SplitClosedFaces - splits closed faces in segments.
6484 # The number of segments depends on the number of splitting points.\n
6485 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6487 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6488 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6489 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6490 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6491 # This and the previous parameters can take the following values:\n
6492 # \b Parametric \b Continuity \n
6493 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6494 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6495 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6496 # ruling out sharp edges).\n
6497 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6498 # are of the same magnitude).\n
6499 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6500 # or surfaces (d/du C(u)) are the same at junction. \n
6501 # \b Geometric \b Continuity \n
6502 # \b G1: first derivatives are proportional at junction.\n
6503 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6504 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6505 # \b G2: first and second derivatives are proportional at junction.
6506 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6507 # continuity requires that the underlying parameterization was continuous as well.
6508 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6510 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6511 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6512 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6513 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6514 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6515 # with the specified parameters.\n
6516 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6517 # with the specified parameters.\n
6518 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6519 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6520 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6521 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6523 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6524 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6525 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6526 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6527 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6529 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6530 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6533 # @return New GEOM.GEOM_Object, containing processed shape.
6535 # \n @ref tui_shape_processing "Example"
6536 @ManageTransactions("HealOp")
6537 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6539 Apply a sequence of Shape Healing operators to the given object.
6542 theShape Shape to be processed.
6543 theValues List of values of parameters, in the same order
6544 as parameters are listed in theParameters list.
6545 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6546 theParameters List of names of parameters
6547 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6548 theName Object name; when specified, this parameter is used
6549 for result publication in the study. Otherwise, if automatic
6550 publication is switched on, default value is used for result name.
6552 Operators and Parameters:
6554 * FixShape - corrects invalid shapes.
6555 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6556 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6557 * FixFaceSize - removes small faces, such as spots and strips.
6558 * FixFaceSize.Tolerance - defines minimum possible face size.
6559 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6560 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6561 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6562 * 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.
6563 * 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.
6564 * 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.
6566 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6567 in segments using a certain angle.
6568 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6569 if Angle=180, four if Angle=90, etc).
6570 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6571 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6573 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6574 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6575 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6576 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6577 * SplitContinuity.CurveContinuity - required continuity for curves.
6578 This and the previous parameters can take the following values:
6580 Parametric Continuity:
6581 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6582 coincidental. The curves or surfaces may still meet at an angle,
6583 giving rise to a sharp corner or edge).
6584 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6585 are parallel, ruling out sharp edges).
6586 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6587 or surfaces are of the same magnitude).
6588 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6589 curves or surfaces (d/du C(u)) are the same at junction.
6591 Geometric Continuity:
6592 G1: first derivatives are proportional at junction.
6593 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6594 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6595 G2: first and second derivatives are proportional at junction. As the names imply,
6596 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6597 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6598 geometric continuity of order n, but not vice-versa.
6599 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6600 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6601 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6602 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6603 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6604 the specified parameters.
6605 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6606 the specified parameters.
6607 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6608 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6609 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6610 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6611 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6612 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6613 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6614 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6615 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6616 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6617 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6620 New GEOM.GEOM_Object, containing processed shape.
6622 Note: For more information look through SALOME Geometry User's Guide->
6623 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6625 # Example: see GEOM_TestHealing.py
6626 theValues,Parameters = ParseList(theValues)
6627 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6628 # To avoid script failure in case of good argument shape
6629 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6631 RaiseIfFailed("ProcessShape", self.HealOp)
6632 for string in (theOperators + theParameters):
6633 Parameters = ":" + Parameters
6635 anObj.SetParameters(Parameters)
6636 self._autoPublish(anObj, theName, "healed")
6639 ## Remove faces from the given object (shape).
6640 # @param theObject Shape to be processed.
6641 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6642 # removes ALL faces of the given object.
6643 # @param theName Object name; when specified, this parameter is used
6644 # for result publication in the study. Otherwise, if automatic
6645 # publication is switched on, default value is used for result name.
6647 # @return New GEOM.GEOM_Object, containing processed shape.
6649 # @ref tui_suppress_faces "Example"
6650 @ManageTransactions("HealOp")
6651 def SuppressFaces(self, theObject, theFaces, theName=None):
6653 Remove faces from the given object (shape).
6656 theObject Shape to be processed.
6657 theFaces Indices of faces to be removed, if EMPTY then the method
6658 removes ALL faces of the given object.
6659 theName Object name; when specified, this parameter is used
6660 for result publication in the study. Otherwise, if automatic
6661 publication is switched on, default value is used for result name.
6664 New GEOM.GEOM_Object, containing processed shape.
6666 # Example: see GEOM_TestHealing.py
6667 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6668 RaiseIfFailed("SuppressFaces", self.HealOp)
6669 self._autoPublish(anObj, theName, "suppressFaces")
6672 ## Sewing of faces into a single shell.
6673 # @param ListShape Shapes to be processed.
6674 # @param theTolerance Required tolerance value.
6675 # @param AllowNonManifold Flag that allows non-manifold sewing.
6676 # @param theName Object name; when specified, this parameter is used
6677 # for result publication in the study. Otherwise, if automatic
6678 # publication is switched on, default value is used for result name.
6680 # @return New GEOM.GEOM_Object, containing a result shell.
6682 # @ref tui_sewing "Example"
6683 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6685 Sewing of faces into a single shell.
6688 ListShape Shapes to be processed.
6689 theTolerance Required tolerance value.
6690 AllowNonManifold Flag that allows non-manifold sewing.
6691 theName Object name; when specified, this parameter is used
6692 for result publication in the study. Otherwise, if automatic
6693 publication is switched on, default value is used for result name.
6696 New GEOM.GEOM_Object, containing containing a result shell.
6698 # Example: see GEOM_TestHealing.py
6699 # note: auto-publishing is done in self.Sew()
6700 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6703 ## Sewing of faces into a single shell.
6704 # @param ListShape Shapes to be processed.
6705 # @param theTolerance Required tolerance value.
6706 # @param AllowNonManifold Flag that allows non-manifold sewing.
6707 # @param theName Object name; when specified, this parameter is used
6708 # for result publication in the study. Otherwise, if automatic
6709 # publication is switched on, default value is used for result name.
6711 # @return New GEOM.GEOM_Object, containing a result shell.
6712 @ManageTransactions("HealOp")
6713 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6715 Sewing of faces into a single shell.
6718 ListShape Shapes to be processed.
6719 theTolerance Required tolerance value.
6720 AllowNonManifold Flag that allows non-manifold sewing.
6721 theName Object name; when specified, this parameter is used
6722 for result publication in the study. Otherwise, if automatic
6723 publication is switched on, default value is used for result name.
6726 New GEOM.GEOM_Object, containing a result shell.
6728 # Example: see MakeSewing() above
6729 theTolerance,Parameters = ParseParameters(theTolerance)
6730 if AllowNonManifold:
6731 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6733 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6734 # To avoid script failure in case of good argument shape
6735 # (Fix of test cases geom/bugs11/L7,L8)
6736 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6738 RaiseIfFailed("Sew", self.HealOp)
6739 anObj.SetParameters(Parameters)
6740 self._autoPublish(anObj, theName, "sewed")
6743 ## Rebuild the topology of theSolids by removing
6744 # the faces that are shared by several solids.
6745 # @param theSolids A compound or a list of solids to be processed.
6746 # @param theName Object name; when specified, this parameter is used
6747 # for result publication in the study. Otherwise, if automatic
6748 # publication is switched on, default value is used for result name.
6750 # @return New GEOM.GEOM_Object, containing processed shape.
6752 # @ref tui_remove_webs "Example"
6753 @ManageTransactions("HealOp")
6754 def RemoveInternalFaces (self, theSolids, theName=None):
6756 Rebuild the topology of theSolids by removing
6757 the faces that are shared by several solids.
6760 theSolids A compound or a list of solids to be processed.
6761 theName Object name; when specified, this parameter is used
6762 for result publication in the study. Otherwise, if automatic
6763 publication is switched on, default value is used for result name.
6766 New GEOM.GEOM_Object, containing processed shape.
6768 # Example: see GEOM_TestHealing.py
6769 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
6770 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6771 self._autoPublish(anObj, theName, "removeWebs")
6774 ## Remove internal wires and edges from the given object (face).
6775 # @param theObject Shape to be processed.
6776 # @param theWires Indices of wires to be removed, if EMPTY then the method
6777 # removes ALL internal wires of the given object.
6778 # @param theName Object name; when specified, this parameter is used
6779 # for result publication in the study. Otherwise, if automatic
6780 # publication is switched on, default value is used for result name.
6782 # @return New GEOM.GEOM_Object, containing processed shape.
6784 # @ref tui_suppress_internal_wires "Example"
6785 @ManageTransactions("HealOp")
6786 def SuppressInternalWires(self, theObject, theWires, theName=None):
6788 Remove internal wires and edges from the given object (face).
6791 theObject Shape to be processed.
6792 theWires Indices of wires to be removed, if EMPTY then the method
6793 removes ALL internal wires of the given object.
6794 theName Object name; when specified, this parameter is used
6795 for result publication in the study. Otherwise, if automatic
6796 publication is switched on, default value is used for result name.
6799 New GEOM.GEOM_Object, containing processed shape.
6801 # Example: see GEOM_TestHealing.py
6802 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6803 RaiseIfFailed("RemoveIntWires", self.HealOp)
6804 self._autoPublish(anObj, theName, "suppressWires")
6807 ## Remove internal closed contours (holes) from the given object.
6808 # @param theObject Shape to be processed.
6809 # @param theWires Indices of wires to be removed, if EMPTY then the method
6810 # removes ALL internal holes of the given object
6811 # @param theName Object name; when specified, this parameter is used
6812 # for result publication in the study. Otherwise, if automatic
6813 # publication is switched on, default value is used for result name.
6815 # @return New GEOM.GEOM_Object, containing processed shape.
6817 # @ref tui_suppress_holes "Example"
6818 @ManageTransactions("HealOp")
6819 def SuppressHoles(self, theObject, theWires, theName=None):
6821 Remove internal closed contours (holes) from the given object.
6824 theObject Shape to be processed.
6825 theWires Indices of wires to be removed, if EMPTY then the method
6826 removes ALL internal holes of the given object
6827 theName Object name; when specified, this parameter is used
6828 for result publication in the study. Otherwise, if automatic
6829 publication is switched on, default value is used for result name.
6832 New GEOM.GEOM_Object, containing processed shape.
6834 # Example: see GEOM_TestHealing.py
6835 anObj = self.HealOp.FillHoles(theObject, theWires)
6836 RaiseIfFailed("FillHoles", self.HealOp)
6837 self._autoPublish(anObj, theName, "suppressHoles")
6840 ## Close an open wire.
6841 # @param theObject Shape to be processed.
6842 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6843 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6844 # @param isCommonVertex If True : closure by creation of a common vertex,
6845 # If False : closure by creation of an edge between ends.
6846 # @param theName Object name; when specified, this parameter is used
6847 # for result publication in the study. Otherwise, if automatic
6848 # publication is switched on, default value is used for result name.
6850 # @return New GEOM.GEOM_Object, containing processed shape.
6852 # @ref tui_close_contour "Example"
6853 @ManageTransactions("HealOp")
6854 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6859 theObject Shape to be processed.
6860 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6861 if [ ], then theObject itself is a wire.
6862 isCommonVertex If True : closure by creation of a common vertex,
6863 If False : closure by creation of an edge between ends.
6864 theName Object name; when specified, this parameter is used
6865 for result publication in the study. Otherwise, if automatic
6866 publication is switched on, default value is used for result name.
6869 New GEOM.GEOM_Object, containing processed shape.
6871 # Example: see GEOM_TestHealing.py
6872 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6873 RaiseIfFailed("CloseContour", self.HealOp)
6874 self._autoPublish(anObj, theName, "closeContour")
6877 ## Addition of a point to a given edge object.
6878 # @param theObject Shape to be processed.
6879 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6880 # if -1, then theObject itself is the edge.
6881 # @param theValue Value of parameter on edge or length parameter,
6882 # depending on \a isByParameter.
6883 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6884 # if FALSE : \a theValue is treated as a length parameter [0..1]
6885 # @param theName Object name; when specified, this parameter is used
6886 # for result publication in the study. Otherwise, if automatic
6887 # publication is switched on, default value is used for result name.
6889 # @return New GEOM.GEOM_Object, containing processed shape.
6891 # @ref tui_add_point_on_edge "Example"
6892 @ManageTransactions("HealOp")
6893 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6895 Addition of a point to a given edge object.
6898 theObject Shape to be processed.
6899 theEdgeIndex Index of edge to be divided within theObject's shape,
6900 if -1, then theObject itself is the edge.
6901 theValue Value of parameter on edge or length parameter,
6902 depending on isByParameter.
6903 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6904 if FALSE : theValue is treated as a length parameter [0..1]
6905 theName Object name; when specified, this parameter is used
6906 for result publication in the study. Otherwise, if automatic
6907 publication is switched on, default value is used for result name.
6910 New GEOM.GEOM_Object, containing processed shape.
6912 # Example: see GEOM_TestHealing.py
6913 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6914 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6915 RaiseIfFailed("DivideEdge", self.HealOp)
6916 anObj.SetParameters(Parameters)
6917 self._autoPublish(anObj, theName, "divideEdge")
6920 ## Addition of points to a given edge of \a theObject by projecting
6921 # other points to the given edge.
6922 # @param theObject Shape to be processed.
6923 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6924 # if -1, then theObject itself is the edge.
6925 # @param thePoints List of points to project to theEdgeIndex-th edge.
6926 # @param theName Object name; when specified, this parameter is used
6927 # for result publication in the study. Otherwise, if automatic
6928 # publication is switched on, default value is used for result name.
6930 # @return New GEOM.GEOM_Object, containing processed shape.
6932 # @ref tui_add_point_on_edge "Example"
6933 @ManageTransactions("HealOp")
6934 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
6936 Addition of points to a given edge of \a theObject by projecting
6937 other points to the given edge.
6940 theObject Shape to be processed.
6941 theEdgeIndex The edge or its index to be divided within theObject's shape,
6942 if -1, then theObject itself is the edge.
6943 thePoints List of points to project to theEdgeIndex-th edge.
6944 theName Object name; when specified, this parameter is used
6945 for result publication in the study. Otherwise, if automatic
6946 publication is switched on, default value is used for result name.
6949 New GEOM.GEOM_Object, containing processed shape.
6951 # Example: see GEOM_TestHealing.py
6952 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
6953 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
6954 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
6955 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
6956 self._autoPublish(anObj, theName, "divideEdge")
6959 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6960 # @param theWire Wire to minimize the number of C1 continuous edges in.
6961 # @param theVertices A list of vertices to suppress. If the list
6962 # is empty, all vertices in a wire will be assumed.
6963 # @param theName Object name; when specified, this parameter is used
6964 # for result publication in the study. Otherwise, if automatic
6965 # publication is switched on, default value is used for result name.
6967 # @return New GEOM.GEOM_Object with modified wire.
6969 # @ref tui_fuse_collinear_edges "Example"
6970 @ManageTransactions("HealOp")
6971 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6973 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6976 theWire Wire to minimize the number of C1 continuous edges in.
6977 theVertices A list of vertices to suppress. If the list
6978 is empty, all vertices in a wire will be assumed.
6979 theName Object name; when specified, this parameter is used
6980 for result publication in the study. Otherwise, if automatic
6981 publication is switched on, default value is used for result name.
6984 New GEOM.GEOM_Object with modified wire.
6986 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6987 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6988 self._autoPublish(anObj, theName, "fuseEdges")
6991 ## Change orientation of the given object. Updates given shape.
6992 # @param theObject Shape to be processed.
6993 # @return Updated <var>theObject</var>
6995 # @ref swig_todo "Example"
6996 @ManageTransactions("HealOp")
6997 def ChangeOrientationShell(self,theObject):
6999 Change orientation of the given object. Updates given shape.
7002 theObject Shape to be processed.
7007 theObject = self.HealOp.ChangeOrientation(theObject)
7008 RaiseIfFailed("ChangeOrientation", self.HealOp)
7011 ## Change orientation of the given object.
7012 # @param theObject Shape to be processed.
7013 # @param theName Object name; when specified, this parameter is used
7014 # for result publication in the study. Otherwise, if automatic
7015 # publication is switched on, default value is used for result name.
7017 # @return New GEOM.GEOM_Object, containing processed shape.
7019 # @ref swig_todo "Example"
7020 @ManageTransactions("HealOp")
7021 def ChangeOrientationShellCopy(self, theObject, theName=None):
7023 Change orientation of the given object.
7026 theObject Shape to be processed.
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 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7035 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7036 self._autoPublish(anObj, theName, "reversed")
7039 ## Try to limit tolerance of the given object by value \a theTolerance.
7040 # @param theObject Shape to be processed.
7041 # @param theTolerance Required tolerance value.
7042 # @param theName Object name; when specified, this parameter is used
7043 # for result publication in the study. Otherwise, if automatic
7044 # publication is switched on, default value is used for result name.
7046 # @return New GEOM.GEOM_Object, containing processed shape.
7048 # @ref tui_limit_tolerance "Example"
7049 @ManageTransactions("HealOp")
7050 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7052 Try to limit tolerance of the given object by value theTolerance.
7055 theObject Shape to be processed.
7056 theTolerance Required tolerance value.
7057 theName Object name; when specified, this parameter is used
7058 for result publication in the study. Otherwise, if automatic
7059 publication is switched on, default value is used for result name.
7062 New GEOM.GEOM_Object, containing processed shape.
7064 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7065 RaiseIfFailed("LimitTolerance", self.HealOp)
7066 self._autoPublish(anObj, theName, "limitTolerance")
7069 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7070 # that constitute a free boundary of the given shape.
7071 # @param theObject Shape to get free boundary of.
7072 # @param theName Object name; when specified, this parameter is used
7073 # for result publication in the study. Otherwise, if automatic
7074 # publication is switched on, default value is used for result name.
7076 # @return [\a status, \a theClosedWires, \a theOpenWires]
7077 # \n \a status: FALSE, if an error(s) occured during the method execution.
7078 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7079 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7081 # @ref tui_free_boundaries_page "Example"
7082 @ManageTransactions("HealOp")
7083 def GetFreeBoundary(self, theObject, theName=None):
7085 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7086 that constitute a free boundary of the given shape.
7089 theObject Shape to get free boundary of.
7090 theName Object name; when specified, this parameter is used
7091 for result publication in the study. Otherwise, if automatic
7092 publication is switched on, default value is used for result name.
7095 [status, theClosedWires, theOpenWires]
7096 status: FALSE, if an error(s) occured during the method execution.
7097 theClosedWires: Closed wires on the free boundary of the given shape.
7098 theOpenWires: Open wires on the free boundary of the given shape.
7100 # Example: see GEOM_TestHealing.py
7101 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7102 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7103 self._autoPublish(anObj[1], theName, "closedWire")
7104 self._autoPublish(anObj[2], theName, "openWire")
7107 ## Replace coincident faces in \a theShapes by one face.
7108 # @param theShapes Initial shapes, either a list or compound of shapes.
7109 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7110 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7111 # otherwise all initial shapes.
7112 # @param theName Object name; when specified, this parameter is used
7113 # for result publication in the study. Otherwise, if automatic
7114 # publication is switched on, default value is used for result name.
7116 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7118 # @ref tui_glue_faces "Example"
7119 @ManageTransactions("ShapesOp")
7120 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7122 Replace coincident faces in theShapes by one face.
7125 theShapes Initial shapes, either a list or compound of shapes.
7126 theTolerance Maximum distance between faces, which can be considered as coincident.
7127 doKeepNonSolids If FALSE, only solids will present in the result,
7128 otherwise all initial shapes.
7129 theName Object name; when specified, this parameter is used
7130 for result publication in the study. Otherwise, if automatic
7131 publication is switched on, default value is used for result name.
7134 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7136 # Example: see GEOM_Spanner.py
7137 theTolerance,Parameters = ParseParameters(theTolerance)
7138 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7140 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
7141 anObj.SetParameters(Parameters)
7142 self._autoPublish(anObj, theName, "glueFaces")
7145 ## Find coincident faces in \a theShapes for possible gluing.
7146 # @param theShapes Initial shapes, either a list or compound of shapes.
7147 # @param theTolerance Maximum distance between faces,
7148 # which can be considered as coincident.
7149 # @param theName Object name; when specified, this parameter is used
7150 # for result publication in the study. Otherwise, if automatic
7151 # publication is switched on, default value is used for result name.
7153 # @return GEOM.ListOfGO
7155 # @ref tui_glue_faces "Example"
7156 @ManageTransactions("ShapesOp")
7157 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7159 Find coincident faces in theShapes for possible gluing.
7162 theShapes Initial shapes, either a list or compound of shapes.
7163 theTolerance Maximum distance between faces,
7164 which can be considered as coincident.
7165 theName Object name; when specified, this parameter is used
7166 for result publication in the study. Otherwise, if automatic
7167 publication is switched on, default value is used for result name.
7172 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7173 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7174 self._autoPublish(anObj, theName, "facesToGlue")
7177 ## Replace coincident faces in \a theShapes by one face
7178 # in compliance with given list of faces
7179 # @param theShapes Initial shapes, either a list or compound of shapes.
7180 # @param theTolerance Maximum distance between faces,
7181 # which can be considered as coincident.
7182 # @param theFaces List of faces for gluing.
7183 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7184 # otherwise all initial shapes.
7185 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7186 # will be glued, otherwise only the edges,
7187 # belonging to <VAR>theFaces</VAR>.
7188 # @param theName Object name; when specified, this parameter is used
7189 # for result publication in the study. Otherwise, if automatic
7190 # publication is switched on, default value is used for result name.
7192 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7194 # @ref tui_glue_faces "Example"
7195 @ManageTransactions("ShapesOp")
7196 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7197 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7199 Replace coincident faces in theShapes by one face
7200 in compliance with given list of faces
7203 theShapes theShapes Initial shapes, either a list or compound of shapes.
7204 theTolerance Maximum distance between faces,
7205 which can be considered as coincident.
7206 theFaces List of faces for gluing.
7207 doKeepNonSolids If FALSE, only solids will present in the result,
7208 otherwise all initial shapes.
7209 doGlueAllEdges If TRUE, all coincident edges of theShape
7210 will be glued, otherwise only the edges,
7211 belonging to theFaces.
7212 theName Object name; when specified, this parameter is used
7213 for result publication in the study. Otherwise, if automatic
7214 publication is switched on, default value is used for result name.
7217 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7219 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, theFaces,
7220 doKeepNonSolids, doGlueAllEdges)
7222 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
7223 self._autoPublish(anObj, theName, "glueFaces")
7226 ## Replace coincident edges in \a theShapes by one edge.
7227 # @param theShapes Initial shapes, either a list or compound of shapes.
7228 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7229 # @param theName Object name; when specified, this parameter is used
7230 # for result publication in the study. Otherwise, if automatic
7231 # publication is switched on, default value is used for result name.
7233 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7235 # @ref tui_glue_edges "Example"
7236 @ManageTransactions("ShapesOp")
7237 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7239 Replace coincident edges in theShapes by one edge.
7242 theShapes Initial shapes, either a list or compound of shapes.
7243 theTolerance Maximum distance between edges, which can be considered as coincident.
7244 theName Object name; when specified, this parameter is used
7245 for result publication in the study. Otherwise, if automatic
7246 publication is switched on, default value is used for result name.
7249 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7251 theTolerance,Parameters = ParseParameters(theTolerance)
7252 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7254 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
7255 anObj.SetParameters(Parameters)
7256 self._autoPublish(anObj, theName, "glueEdges")
7259 ## Find coincident edges in \a theShapes for possible gluing.
7260 # @param theShapes Initial shapes, either a list or compound of shapes.
7261 # @param theTolerance Maximum distance between edges,
7262 # which can be considered as coincident.
7263 # @param theName Object name; when specified, this parameter is used
7264 # for result publication in the study. Otherwise, if automatic
7265 # publication is switched on, default value is used for result name.
7267 # @return GEOM.ListOfGO
7269 # @ref tui_glue_edges "Example"
7270 @ManageTransactions("ShapesOp")
7271 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7273 Find coincident edges in theShapes for possible gluing.
7276 theShapes Initial shapes, either a list or compound of shapes.
7277 theTolerance Maximum distance between edges,
7278 which can be considered as coincident.
7279 theName Object name; when specified, this parameter is used
7280 for result publication in the study. Otherwise, if automatic
7281 publication is switched on, default value is used for result name.
7286 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7287 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7288 self._autoPublish(anObj, theName, "edgesToGlue")
7291 ## Replace coincident edges in theShapes by one edge
7292 # in compliance with given list of edges.
7293 # @param theShapes Initial shapes, either a list or compound of shapes.
7294 # @param theTolerance Maximum distance between edges,
7295 # which can be considered as coincident.
7296 # @param theEdges List of edges for gluing.
7297 # @param theName Object name; when specified, this parameter is used
7298 # for result publication in the study. Otherwise, if automatic
7299 # publication is switched on, default value is used for result name.
7301 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7303 # @ref tui_glue_edges "Example"
7304 @ManageTransactions("ShapesOp")
7305 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7307 Replace coincident edges in theShapes by one edge
7308 in compliance with given list of edges.
7311 theShapes Initial shapes, either a list or compound of shapes.
7312 theTolerance Maximum distance between edges,
7313 which can be considered as coincident.
7314 theEdges List of edges for gluing.
7315 theName Object name; when specified, this parameter is used
7316 for result publication in the study. Otherwise, if automatic
7317 publication is switched on, default value is used for result name.
7320 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7322 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7324 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
7325 self._autoPublish(anObj, theName, "glueEdges")
7331 ## @addtogroup l3_boolean Boolean Operations
7334 # -----------------------------------------------------------------------------
7335 # Boolean (Common, Cut, Fuse, Section)
7336 # -----------------------------------------------------------------------------
7338 ## Perform one of boolean operations on two given shapes.
7339 # @param theShape1 First argument for boolean operation.
7340 # @param theShape2 Second argument for boolean operation.
7341 # @param theOperation Indicates the operation to be done:\n
7342 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7343 # @param checkSelfInte The flag that tells if the arguments should
7344 # be checked for self-intersection prior to the operation.
7345 # @param theName Object name; when specified, this parameter is used
7346 # for result publication in the study. Otherwise, if automatic
7347 # publication is switched on, default value is used for result name.
7349 # @note This algorithm doesn't find all types of self-intersections.
7350 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7351 # vertex/face and edge/face intersections. Face/face
7352 # intersections detection is switched off as it is a
7353 # time-consuming operation that gives an impact on performance.
7354 # To find all self-intersections please use
7355 # CheckSelfIntersections() method.
7357 # @return New GEOM.GEOM_Object, containing the result shape.
7359 # @ref tui_fuse "Example"
7360 @ManageTransactions("BoolOp")
7361 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7363 Perform one of boolean operations on two given shapes.
7366 theShape1 First argument for boolean operation.
7367 theShape2 Second argument for boolean operation.
7368 theOperation Indicates the operation to be done:
7369 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7370 checkSelfInte The flag that tells if the arguments should
7371 be checked for self-intersection prior to
7373 theName Object name; when specified, this parameter is used
7374 for result publication in the study. Otherwise, if automatic
7375 publication is switched on, default value is used for result name.
7378 This algorithm doesn't find all types of self-intersections.
7379 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7380 vertex/face and edge/face intersections. Face/face
7381 intersections detection is switched off as it is a
7382 time-consuming operation that gives an impact on performance.
7383 To find all self-intersections please use
7384 CheckSelfIntersections() method.
7387 New GEOM.GEOM_Object, containing the result shape.
7389 # Example: see GEOM_TestAll.py
7390 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7391 RaiseIfFailed("MakeBoolean", self.BoolOp)
7392 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7393 self._autoPublish(anObj, theName, def_names[theOperation])
7396 ## Perform Common boolean operation on two given shapes.
7397 # @param theShape1 First argument for boolean operation.
7398 # @param theShape2 Second argument for boolean operation.
7399 # @param checkSelfInte The flag that tells if the arguments should
7400 # be checked for self-intersection prior to the operation.
7401 # @param theName Object name; when specified, this parameter is used
7402 # for result publication in the study. Otherwise, if automatic
7403 # publication is switched on, default value is used for result name.
7405 # @note This algorithm doesn't find all types of self-intersections.
7406 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7407 # vertex/face and edge/face intersections. Face/face
7408 # intersections detection is switched off as it is a
7409 # time-consuming operation that gives an impact on performance.
7410 # To find all self-intersections please use
7411 # CheckSelfIntersections() method.
7413 # @return New GEOM.GEOM_Object, containing the result shape.
7415 # @ref tui_common "Example 1"
7416 # \n @ref swig_MakeCommon "Example 2"
7417 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7419 Perform Common boolean operation on two given shapes.
7422 theShape1 First argument for boolean operation.
7423 theShape2 Second argument for boolean operation.
7424 checkSelfInte The flag that tells if the arguments should
7425 be checked for self-intersection prior to
7427 theName Object name; when specified, this parameter is used
7428 for result publication in the study. Otherwise, if automatic
7429 publication is switched on, default value is used for result name.
7432 This algorithm doesn't find all types of self-intersections.
7433 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7434 vertex/face and edge/face intersections. Face/face
7435 intersections detection is switched off as it is a
7436 time-consuming operation that gives an impact on performance.
7437 To find all self-intersections please use
7438 CheckSelfIntersections() method.
7441 New GEOM.GEOM_Object, containing the result shape.
7443 # Example: see GEOM_TestOthers.py
7444 # note: auto-publishing is done in self.MakeBoolean()
7445 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7447 ## Perform Cut boolean operation on two given shapes.
7448 # @param theShape1 First argument for boolean operation.
7449 # @param theShape2 Second argument for boolean operation.
7450 # @param checkSelfInte The flag that tells if the arguments should
7451 # be checked for self-intersection prior to the operation.
7452 # @param theName Object name; when specified, this parameter is used
7453 # for result publication in the study. Otherwise, if automatic
7454 # publication is switched on, default value is used for result name.
7456 # @note This algorithm doesn't find all types of self-intersections.
7457 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7458 # vertex/face and edge/face intersections. Face/face
7459 # intersections detection is switched off as it is a
7460 # time-consuming operation that gives an impact on performance.
7461 # To find all self-intersections please use
7462 # CheckSelfIntersections() method.
7464 # @return New GEOM.GEOM_Object, containing the result shape.
7466 # @ref tui_cut "Example 1"
7467 # \n @ref swig_MakeCommon "Example 2"
7468 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7470 Perform Cut boolean operation on two given shapes.
7473 theShape1 First argument for boolean operation.
7474 theShape2 Second argument for boolean operation.
7475 checkSelfInte The flag that tells if the arguments should
7476 be checked for self-intersection prior to
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 This algorithm doesn't find all types of self-intersections.
7484 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7485 vertex/face and edge/face intersections. Face/face
7486 intersections detection is switched off as it is a
7487 time-consuming operation that gives an impact on performance.
7488 To find all self-intersections please use
7489 CheckSelfIntersections() method.
7492 New GEOM.GEOM_Object, containing the result shape.
7495 # Example: see GEOM_TestOthers.py
7496 # note: auto-publishing is done in self.MakeBoolean()
7497 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7499 ## Perform Fuse boolean operation on two given shapes.
7500 # @param theShape1 First argument for boolean operation.
7501 # @param theShape2 Second argument for boolean operation.
7502 # @param checkSelfInte The flag that tells if the arguments should
7503 # be checked for self-intersection prior to the operation.
7504 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7505 # operation should be performed during the operation.
7506 # @param theName Object name; when specified, this parameter is used
7507 # for result publication in the study. Otherwise, if automatic
7508 # publication is switched on, default value is used for result name.
7510 # @note This algorithm doesn't find all types of self-intersections.
7511 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7512 # vertex/face and edge/face intersections. Face/face
7513 # intersections detection is switched off as it is a
7514 # time-consuming operation that gives an impact on performance.
7515 # To find all self-intersections please use
7516 # CheckSelfIntersections() method.
7518 # @return New GEOM.GEOM_Object, containing the result shape.
7520 # @ref tui_fuse "Example 1"
7521 # \n @ref swig_MakeCommon "Example 2"
7522 @ManageTransactions("BoolOp")
7523 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7524 rmExtraEdges=False, theName=None):
7526 Perform Fuse boolean operation on two given shapes.
7529 theShape1 First argument for boolean operation.
7530 theShape2 Second argument for boolean operation.
7531 checkSelfInte The flag that tells if the arguments should
7532 be checked for self-intersection prior to
7534 rmExtraEdges The flag that tells if Remove Extra Edges
7535 operation should be performed during the operation.
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.
7553 # Example: see GEOM_TestOthers.py
7554 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7555 checkSelfInte, rmExtraEdges)
7556 RaiseIfFailed("MakeFuse", self.BoolOp)
7557 self._autoPublish(anObj, theName, "fuse")
7560 ## Perform Section boolean operation on two given shapes.
7561 # @param theShape1 First argument for boolean operation.
7562 # @param theShape2 Second argument for boolean operation.
7563 # @param checkSelfInte The flag that tells if the arguments should
7564 # be checked for self-intersection prior to the operation.
7565 # If a self-intersection detected the operation fails.
7566 # @param theName Object name; when specified, this parameter is used
7567 # for result publication in the study. Otherwise, if automatic
7568 # publication is switched on, default value is used for result name.
7569 # @return New GEOM.GEOM_Object, containing the result shape.
7571 # @ref tui_section "Example 1"
7572 # \n @ref swig_MakeCommon "Example 2"
7573 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7575 Perform Section boolean operation on two given shapes.
7578 theShape1 First argument for boolean operation.
7579 theShape2 Second argument for boolean operation.
7580 checkSelfInte The flag that tells if the arguments should
7581 be checked for self-intersection prior to the operation.
7582 If a self-intersection detected the operation fails.
7583 theName Object name; when specified, this parameter is used
7584 for result publication in the study. Otherwise, if automatic
7585 publication is switched on, default value is used for result name.
7587 New GEOM.GEOM_Object, containing the result shape.
7590 # Example: see GEOM_TestOthers.py
7591 # note: auto-publishing is done in self.MakeBoolean()
7592 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7594 ## Perform Fuse boolean operation on the list of shapes.
7595 # @param theShapesList Shapes to be fused.
7596 # @param checkSelfInte The flag that tells if the arguments should
7597 # be checked for self-intersection prior to the operation.
7598 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7599 # operation should be performed during the operation.
7600 # @param theName Object name; when specified, this parameter is used
7601 # for result publication in the study. Otherwise, if automatic
7602 # publication is switched on, default value is used for result name.
7604 # @note This algorithm doesn't find all types of self-intersections.
7605 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7606 # vertex/face and edge/face intersections. Face/face
7607 # intersections detection is switched off as it is a
7608 # time-consuming operation that gives an impact on performance.
7609 # To find all self-intersections please use
7610 # CheckSelfIntersections() method.
7612 # @return New GEOM.GEOM_Object, containing the result shape.
7614 # @ref tui_fuse "Example 1"
7615 # \n @ref swig_MakeCommon "Example 2"
7616 @ManageTransactions("BoolOp")
7617 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7618 rmExtraEdges=False, theName=None):
7620 Perform Fuse boolean operation on the list of shapes.
7623 theShapesList Shapes to be fused.
7624 checkSelfInte The flag that tells if the arguments should
7625 be checked for self-intersection prior to
7627 rmExtraEdges The flag that tells if Remove Extra Edges
7628 operation should be performed during the operation.
7629 theName Object name; when specified, this parameter is used
7630 for result publication in the study. Otherwise, if automatic
7631 publication is switched on, default value is used for result name.
7634 This algorithm doesn't find all types of self-intersections.
7635 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7636 vertex/face and edge/face intersections. Face/face
7637 intersections detection is switched off as it is a
7638 time-consuming operation that gives an impact on performance.
7639 To find all self-intersections please use
7640 CheckSelfIntersections() method.
7643 New GEOM.GEOM_Object, containing the result shape.
7646 # Example: see GEOM_TestOthers.py
7647 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7649 RaiseIfFailed("MakeFuseList", self.BoolOp)
7650 self._autoPublish(anObj, theName, "fuse")
7653 ## Perform Common boolean operation on the list of shapes.
7654 # @param theShapesList Shapes for Common operation.
7655 # @param checkSelfInte The flag that tells if the arguments should
7656 # be checked for self-intersection prior to the operation.
7657 # @param theName Object name; when specified, this parameter is used
7658 # for result publication in the study. Otherwise, if automatic
7659 # publication is switched on, default value is used for result name.
7661 # @note This algorithm doesn't find all types of self-intersections.
7662 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7663 # vertex/face and edge/face intersections. Face/face
7664 # intersections detection is switched off as it is a
7665 # time-consuming operation that gives an impact on performance.
7666 # To find all self-intersections please use
7667 # CheckSelfIntersections() method.
7669 # @return New GEOM.GEOM_Object, containing the result shape.
7671 # @ref tui_common "Example 1"
7672 # \n @ref swig_MakeCommon "Example 2"
7673 @ManageTransactions("BoolOp")
7674 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7676 Perform Common boolean operation on the list of shapes.
7679 theShapesList Shapes for Common operation.
7680 checkSelfInte The flag that tells if the arguments should
7681 be checked for self-intersection prior to
7683 theName Object name; when specified, this parameter is used
7684 for result publication in the study. Otherwise, if automatic
7685 publication is switched on, default value is used for result name.
7688 This algorithm doesn't find all types of self-intersections.
7689 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7690 vertex/face and edge/face intersections. Face/face
7691 intersections detection is switched off as it is a
7692 time-consuming operation that gives an impact on performance.
7693 To find all self-intersections please use
7694 CheckSelfIntersections() method.
7697 New GEOM.GEOM_Object, containing the result shape.
7700 # Example: see GEOM_TestOthers.py
7701 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7702 RaiseIfFailed("MakeCommonList", self.BoolOp)
7703 self._autoPublish(anObj, theName, "common")
7706 ## Perform Cut boolean operation on one object and the list of tools.
7707 # @param theMainShape The object of the operation.
7708 # @param theShapesList The list of tools of the operation.
7709 # @param checkSelfInte The flag that tells if the arguments should
7710 # be checked for self-intersection prior to the operation.
7711 # @param theName Object name; when specified, this parameter is used
7712 # for result publication in the study. Otherwise, if automatic
7713 # publication is switched on, default value is used for result name.
7715 # @note This algorithm doesn't find all types of self-intersections.
7716 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7717 # vertex/face and edge/face intersections. Face/face
7718 # intersections detection is switched off as it is a
7719 # time-consuming operation that gives an impact on performance.
7720 # To find all self-intersections please use
7721 # CheckSelfIntersections() method.
7723 # @return New GEOM.GEOM_Object, containing the result shape.
7725 # @ref tui_cut "Example 1"
7726 # \n @ref swig_MakeCommon "Example 2"
7727 @ManageTransactions("BoolOp")
7728 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7730 Perform Cut boolean operation on one object and the list of tools.
7733 theMainShape The object of the operation.
7734 theShapesList The list of tools of the operation.
7735 checkSelfInte The flag that tells if the arguments should
7736 be checked for self-intersection prior to
7738 theName Object name; when specified, this parameter is used
7739 for result publication in the study. Otherwise, if automatic
7740 publication is switched on, default value is used for result name.
7743 This algorithm doesn't find all types of self-intersections.
7744 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7745 vertex/face and edge/face intersections. Face/face
7746 intersections detection is switched off as it is a
7747 time-consuming operation that gives an impact on performance.
7748 To find all self-intersections please use
7749 CheckSelfIntersections() method.
7752 New GEOM.GEOM_Object, containing the result shape.
7755 # Example: see GEOM_TestOthers.py
7756 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7757 RaiseIfFailed("MakeCutList", self.BoolOp)
7758 self._autoPublish(anObj, theName, "cut")
7764 ## @addtogroup l3_basic_op
7767 ## Perform partition operation.
7768 # @param ListShapes Shapes to be intersected.
7769 # @param ListTools Shapes to intersect theShapes.
7770 # @param Limit Type of resulting shapes (see ShapeType()).\n
7771 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7772 # type will be detected automatically.
7773 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7774 # target type (equal to Limit) are kept in the result,
7775 # else standalone shapes of lower dimension
7776 # are kept also (if they exist).
7778 # @param theName Object name; when specified, this parameter is used
7779 # for result publication in the study. Otherwise, if automatic
7780 # publication is switched on, default value is used for result name.
7782 # @note Each compound from ListShapes and ListTools will be exploded
7783 # in order to avoid possible intersection between shapes from this compound.
7785 # After implementation new version of PartitionAlgo (October 2006)
7786 # other parameters are ignored by current functionality. They are kept
7787 # in this function only for support old versions.
7788 # @param ListKeepInside Shapes, outside which the results will be deleted.
7789 # Each shape from theKeepInside must belong to theShapes also.
7790 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7791 # Each shape from theRemoveInside must belong to theShapes also.
7792 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7793 # @param ListMaterials Material indices for each shape. Make sence,
7794 # only if theRemoveWebs is TRUE.
7796 # @return New GEOM.GEOM_Object, containing the result shapes.
7798 # @ref tui_partition "Example"
7799 @ManageTransactions("BoolOp")
7800 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7801 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7802 KeepNonlimitShapes=0, theName=None):
7804 Perform partition operation.
7807 ListShapes Shapes to be intersected.
7808 ListTools Shapes to intersect theShapes.
7809 Limit Type of resulting shapes (see geompy.ShapeType)
7810 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7811 type will be detected automatically.
7812 KeepNonlimitShapes if this parameter == 0, then only shapes of
7813 target type (equal to Limit) are kept in the result,
7814 else standalone shapes of lower dimension
7815 are kept also (if they exist).
7817 theName Object name; when specified, this parameter is used
7818 for result publication in the study. Otherwise, if automatic
7819 publication is switched on, default value is used for result name.
7821 Each compound from ListShapes and ListTools will be exploded
7822 in order to avoid possible intersection between shapes from
7825 After implementation new version of PartitionAlgo (October 2006) other
7826 parameters are ignored by current functionality. They are kept in this
7827 function only for support old versions.
7830 ListKeepInside Shapes, outside which the results will be deleted.
7831 Each shape from theKeepInside must belong to theShapes also.
7832 ListRemoveInside Shapes, inside which the results will be deleted.
7833 Each shape from theRemoveInside must belong to theShapes also.
7834 RemoveWebs If TRUE, perform Glue 3D algorithm.
7835 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7838 New GEOM.GEOM_Object, containing the result shapes.
7840 # Example: see GEOM_TestAll.py
7841 if Limit == self.ShapeType["AUTO"]:
7842 # automatic detection of the most appropriate shape limit type
7844 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7845 Limit = EnumToLong(lim)
7847 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7848 ListKeepInside, ListRemoveInside,
7849 Limit, RemoveWebs, ListMaterials,
7850 KeepNonlimitShapes);
7851 RaiseIfFailed("MakePartition", self.BoolOp)
7852 self._autoPublish(anObj, theName, "partition")
7855 ## Perform partition operation.
7856 # This method may be useful if it is needed to make a partition for
7857 # compound contains nonintersected shapes. Performance will be better
7858 # since intersection between shapes from compound is not performed.
7860 # Description of all parameters as in previous method MakePartition().
7861 # One additional parameter is provided:
7862 # @param checkSelfInte The flag that tells if the arguments should
7863 # be checked for self-intersection prior to the operation.
7865 # @note This algorithm doesn't find all types of self-intersections.
7866 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7867 # vertex/face and edge/face intersections. Face/face
7868 # intersections detection is switched off as it is a
7869 # time-consuming operation that gives an impact on performance.
7870 # To find all self-intersections please use
7871 # CheckSelfIntersections() method.
7873 # @note Passed compounds (via ListShapes or via ListTools)
7874 # have to consist of nonintersecting shapes.
7876 # @return New GEOM.GEOM_Object, containing the result shapes.
7878 # @ref swig_todo "Example"
7879 @ManageTransactions("BoolOp")
7880 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7881 ListKeepInside=[], ListRemoveInside=[],
7882 Limit=ShapeType["AUTO"], RemoveWebs=0,
7883 ListMaterials=[], KeepNonlimitShapes=0,
7884 checkSelfInte=False, theName=None):
7886 Perform partition operation.
7887 This method may be useful if it is needed to make a partition for
7888 compound contains nonintersected shapes. Performance will be better
7889 since intersection between shapes from compound is not performed.
7892 Description of all parameters as in method geompy.MakePartition.
7893 One additional parameter is provided:
7894 checkSelfInte The flag that tells if the arguments should
7895 be checked for self-intersection prior to
7899 This algorithm doesn't find all types of self-intersections.
7900 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7901 vertex/face and edge/face intersections. Face/face
7902 intersections detection is switched off as it is a
7903 time-consuming operation that gives an impact on performance.
7904 To find all self-intersections please use
7905 CheckSelfIntersections() method.
7908 Passed compounds (via ListShapes or via ListTools)
7909 have to consist of nonintersecting shapes.
7912 New GEOM.GEOM_Object, containing the result shapes.
7914 if Limit == self.ShapeType["AUTO"]:
7915 # automatic detection of the most appropriate shape limit type
7917 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7918 Limit = EnumToLong(lim)
7920 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7921 ListKeepInside, ListRemoveInside,
7922 Limit, RemoveWebs, ListMaterials,
7923 KeepNonlimitShapes, checkSelfInte);
7924 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7925 self._autoPublish(anObj, theName, "partition")
7928 ## See method MakePartition() for more information.
7930 # @ref tui_partition "Example 1"
7931 # \n @ref swig_Partition "Example 2"
7932 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7933 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7934 KeepNonlimitShapes=0, theName=None):
7936 See method geompy.MakePartition for more information.
7938 # Example: see GEOM_TestOthers.py
7939 # note: auto-publishing is done in self.MakePartition()
7940 anObj = self.MakePartition(ListShapes, ListTools,
7941 ListKeepInside, ListRemoveInside,
7942 Limit, RemoveWebs, ListMaterials,
7943 KeepNonlimitShapes, theName);
7946 ## Perform partition of the Shape with the Plane
7947 # @param theShape Shape to be intersected.
7948 # @param thePlane Tool shape, to intersect theShape.
7949 # @param theName Object name; when specified, this parameter is used
7950 # for result publication in the study. Otherwise, if automatic
7951 # publication is switched on, default value is used for result name.
7953 # @return New GEOM.GEOM_Object, containing the result shape.
7955 # @note This operation is a shortcut to the more general @ref MakePartition
7956 # operation, where @a theShape specifies single "object" (shape being partitioned)
7957 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
7958 # @ref MakePartition operation have default values:
7959 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
7960 # - @a KeepNonlimitShapes: 0
7961 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
7962 # @a Materials (obsolete parameters): empty
7964 # @note I.e. the following two operations are equivalent:
7966 # Result = geompy.MakeHalfPartition(Object, Plane)
7967 # Result = geompy.MakePartition([Object], [Plane])
7970 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
7972 # @ref tui_partition "Example"
7973 @ManageTransactions("BoolOp")
7974 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7976 Perform partition of the Shape with the Plane
7979 theShape Shape to be intersected.
7980 thePlane Tool shape, to intersect theShape.
7981 theName Object name; when specified, this parameter is used
7982 for result publication in the study. Otherwise, if automatic
7983 publication is switched on, default value is used for result name.
7986 New GEOM.GEOM_Object, containing the result shape.
7988 Note: This operation is a shortcut to the more general MakePartition
7989 operation, where theShape specifies single "object" (shape being partitioned)
7990 and thePlane specifies single "tool" (intersector shape). Other parameters of
7991 MakePartition operation have default values:
7992 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
7993 - KeepNonlimitShapes: 0
7994 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
7996 I.e. the following two operations are equivalent:
7997 Result = geompy.MakeHalfPartition(Object, Plane)
7998 Result = geompy.MakePartition([Object], [Plane])
8000 # Example: see GEOM_TestAll.py
8001 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8002 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8003 self._autoPublish(anObj, theName, "partition")
8006 # end of l3_basic_op
8009 ## @addtogroup l3_transform
8012 ## Translate the given object along the vector, specified
8013 # by its end points.
8014 # @param theObject The object to be translated.
8015 # @param thePoint1 Start point of translation vector.
8016 # @param thePoint2 End point of translation vector.
8017 # @param theCopy Flag used to translate object itself or create a copy.
8018 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8019 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8020 @ManageTransactions("TrsfOp")
8021 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8023 Translate the given object along the vector, specified by its end points.
8026 theObject The object to be translated.
8027 thePoint1 Start point of translation vector.
8028 thePoint2 End point of translation vector.
8029 theCopy Flag used to translate object itself or create a copy.
8032 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8033 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8036 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8038 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8039 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8042 ## Translate the given object along the vector, specified
8043 # by its end points, creating its copy before the translation.
8044 # @param theObject The object to be translated.
8045 # @param thePoint1 Start point of translation vector.
8046 # @param thePoint2 End point of translation vector.
8047 # @param theName Object name; when specified, this parameter is used
8048 # for result publication in the study. Otherwise, if automatic
8049 # publication is switched on, default value is used for result name.
8051 # @return New GEOM.GEOM_Object, containing the translated object.
8053 # @ref tui_translation "Example 1"
8054 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8055 @ManageTransactions("TrsfOp")
8056 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8058 Translate the given object along the vector, specified
8059 by its end points, creating its copy before the translation.
8062 theObject The object to be translated.
8063 thePoint1 Start point of translation vector.
8064 thePoint2 End point of translation vector.
8065 theName Object name; when specified, this parameter is used
8066 for result publication in the study. Otherwise, if automatic
8067 publication is switched on, default value is used for result name.
8070 New GEOM.GEOM_Object, containing the translated object.
8072 # Example: see GEOM_TestAll.py
8073 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8074 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8075 self._autoPublish(anObj, theName, "translated")
8078 ## Translate the given object along the vector, specified by its components.
8079 # @param theObject The object to be translated.
8080 # @param theDX,theDY,theDZ Components of translation vector.
8081 # @param theCopy Flag used to translate object itself or create a copy.
8082 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8083 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8085 # @ref tui_translation "Example"
8086 @ManageTransactions("TrsfOp")
8087 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8089 Translate the given object along the vector, specified by its components.
8092 theObject The object to be translated.
8093 theDX,theDY,theDZ Components of translation vector.
8094 theCopy Flag used to translate object itself or create a copy.
8097 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8098 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8100 # Example: see GEOM_TestAll.py
8101 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8103 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8105 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8106 anObj.SetParameters(Parameters)
8107 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8110 ## Translate the given object along the vector, specified
8111 # by its components, creating its copy before the translation.
8112 # @param theObject The object to be translated.
8113 # @param theDX,theDY,theDZ Components of translation vector.
8114 # @param theName Object name; when specified, this parameter is used
8115 # for result publication in the study. Otherwise, if automatic
8116 # publication is switched on, default value is used for result name.
8118 # @return New GEOM.GEOM_Object, containing the translated object.
8120 # @ref tui_translation "Example"
8121 @ManageTransactions("TrsfOp")
8122 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8124 Translate the given object along the vector, specified
8125 by its components, creating its copy before the translation.
8128 theObject The object to be translated.
8129 theDX,theDY,theDZ Components of translation vector.
8130 theName Object name; when specified, this parameter is used
8131 for result publication in the study. Otherwise, if automatic
8132 publication is switched on, default value is used for result name.
8135 New GEOM.GEOM_Object, containing the translated object.
8137 # Example: see GEOM_TestAll.py
8138 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8139 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8140 anObj.SetParameters(Parameters)
8141 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8142 self._autoPublish(anObj, theName, "translated")
8145 ## Translate the given object along the given vector.
8146 # @param theObject The object to be translated.
8147 # @param theVector The translation vector.
8148 # @param theCopy Flag used to translate object itself or create a copy.
8149 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8150 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8151 @ManageTransactions("TrsfOp")
8152 def TranslateVector(self, theObject, theVector, theCopy=False):
8154 Translate the given object along the given vector.
8157 theObject The object to be translated.
8158 theVector The translation vector.
8159 theCopy Flag used to translate object itself or create a copy.
8162 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8163 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8166 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8168 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8169 RaiseIfFailed("TranslateVector", self.TrsfOp)
8172 ## Translate the given object along the given vector,
8173 # creating its copy before the translation.
8174 # @param theObject The object to be translated.
8175 # @param theVector The translation vector.
8176 # @param theName Object name; when specified, this parameter is used
8177 # for result publication in the study. Otherwise, if automatic
8178 # publication is switched on, default value is used for result name.
8180 # @return New GEOM.GEOM_Object, containing the translated object.
8182 # @ref tui_translation "Example"
8183 @ManageTransactions("TrsfOp")
8184 def MakeTranslationVector(self, theObject, theVector, theName=None):
8186 Translate the given object along the given vector,
8187 creating its copy before the translation.
8190 theObject The object to be translated.
8191 theVector The translation vector.
8192 theName Object name; when specified, this parameter is used
8193 for result publication in the study. Otherwise, if automatic
8194 publication is switched on, default value is used for result name.
8197 New GEOM.GEOM_Object, containing the translated object.
8199 # Example: see GEOM_TestAll.py
8200 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8201 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8202 self._autoPublish(anObj, theName, "translated")
8205 ## Translate the given object along the given vector on given distance.
8206 # @param theObject The object to be translated.
8207 # @param theVector The translation vector.
8208 # @param theDistance The translation distance.
8209 # @param theCopy Flag used to translate object itself or create a copy.
8210 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8211 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8213 # @ref tui_translation "Example"
8214 @ManageTransactions("TrsfOp")
8215 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8217 Translate the given object along the given vector on given distance.
8220 theObject The object to be translated.
8221 theVector The translation vector.
8222 theDistance The translation distance.
8223 theCopy Flag used to translate object itself or create a copy.
8226 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8227 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8229 # Example: see GEOM_TestAll.py
8230 theDistance,Parameters = ParseParameters(theDistance)
8231 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8232 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8233 anObj.SetParameters(Parameters)
8236 ## Translate the given object along the given vector on given distance,
8237 # creating its copy before the translation.
8238 # @param theObject The object to be translated.
8239 # @param theVector The translation vector.
8240 # @param theDistance The translation distance.
8241 # @param theName Object name; when specified, this parameter is used
8242 # for result publication in the study. Otherwise, if automatic
8243 # publication is switched on, default value is used for result name.
8245 # @return New GEOM.GEOM_Object, containing the translated object.
8247 # @ref tui_translation "Example"
8248 @ManageTransactions("TrsfOp")
8249 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8251 Translate the given object along the given vector on given distance,
8252 creating its copy before the translation.
8255 theObject The object to be translated.
8256 theVector The translation vector.
8257 theDistance The translation distance.
8258 theName Object name; when specified, this parameter is used
8259 for result publication in the study. Otherwise, if automatic
8260 publication is switched on, default value is used for result name.
8263 New GEOM.GEOM_Object, containing the translated object.
8265 # Example: see GEOM_TestAll.py
8266 theDistance,Parameters = ParseParameters(theDistance)
8267 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8268 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8269 anObj.SetParameters(Parameters)
8270 self._autoPublish(anObj, theName, "translated")
8273 ## Rotate the given object around the given axis on the given angle.
8274 # @param theObject The object to be rotated.
8275 # @param theAxis Rotation axis.
8276 # @param theAngle Rotation angle in radians.
8277 # @param theCopy Flag used to rotate object itself or create a copy.
8279 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8280 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8282 # @ref tui_rotation "Example"
8283 @ManageTransactions("TrsfOp")
8284 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8286 Rotate the given object around the given axis on the given angle.
8289 theObject The object to be rotated.
8290 theAxis Rotation axis.
8291 theAngle Rotation angle in radians.
8292 theCopy Flag used to rotate object itself or create a copy.
8295 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8296 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8298 # Example: see GEOM_TestAll.py
8300 if isinstance(theAngle,str):
8302 theAngle, Parameters = ParseParameters(theAngle)
8304 theAngle = theAngle*math.pi/180.0
8306 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8308 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8309 RaiseIfFailed("Rotate", self.TrsfOp)
8310 anObj.SetParameters(Parameters)
8313 ## Rotate the given object around the given axis
8314 # on the given angle, creating its copy before the rotation.
8315 # @param theObject The object to be rotated.
8316 # @param theAxis Rotation axis.
8317 # @param theAngle Rotation angle in radians.
8318 # @param theName Object name; when specified, this parameter is used
8319 # for result publication in the study. Otherwise, if automatic
8320 # publication is switched on, default value is used for result name.
8322 # @return New GEOM.GEOM_Object, containing the rotated object.
8324 # @ref tui_rotation "Example"
8325 @ManageTransactions("TrsfOp")
8326 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8328 Rotate the given object around the given axis
8329 on the given angle, creating its copy before the rotatation.
8332 theObject The object to be rotated.
8333 theAxis Rotation axis.
8334 theAngle Rotation angle in radians.
8335 theName Object name; when specified, this parameter is used
8336 for result publication in the study. Otherwise, if automatic
8337 publication is switched on, default value is used for result name.
8340 New GEOM.GEOM_Object, containing the rotated object.
8342 # Example: see GEOM_TestAll.py
8344 if isinstance(theAngle,str):
8346 theAngle, Parameters = ParseParameters(theAngle)
8348 theAngle = theAngle*math.pi/180.0
8349 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8350 RaiseIfFailed("RotateCopy", self.TrsfOp)
8351 anObj.SetParameters(Parameters)
8352 self._autoPublish(anObj, theName, "rotated")
8355 ## Rotate given object around vector perpendicular to plane
8356 # containing three points.
8357 # @param theObject The object to be rotated.
8358 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8359 # containing the three points.
8360 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8361 # @param theCopy Flag used to rotate object itself or create a copy.
8362 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8363 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8364 @ManageTransactions("TrsfOp")
8365 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8367 Rotate given object around vector perpendicular to plane
8368 containing three points.
8371 theObject The object to be rotated.
8372 theCentPoint central point the axis is the vector perpendicular to the plane
8373 containing the three points.
8374 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8375 theCopy Flag used to rotate object itself or create a copy.
8378 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8379 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8382 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8384 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8385 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8388 ## Rotate given object around vector perpendicular to plane
8389 # containing three points, creating its copy before the rotatation.
8390 # @param theObject The object to be rotated.
8391 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8392 # containing the three points.
8393 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8394 # @param theName Object name; when specified, this parameter is used
8395 # for result publication in the study. Otherwise, if automatic
8396 # publication is switched on, default value is used for result name.
8398 # @return New GEOM.GEOM_Object, containing the rotated object.
8400 # @ref tui_rotation "Example"
8401 @ManageTransactions("TrsfOp")
8402 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8404 Rotate given object around vector perpendicular to plane
8405 containing three points, creating its copy before the rotatation.
8408 theObject The object to be rotated.
8409 theCentPoint central point the axis is the vector perpendicular to the plane
8410 containing the three points.
8411 thePoint1,thePoint2 in a perpendicular plane of the axis.
8412 theName Object name; when specified, this parameter is used
8413 for result publication in the study. Otherwise, if automatic
8414 publication is switched on, default value is used for result name.
8417 New GEOM.GEOM_Object, containing the rotated object.
8419 # Example: see GEOM_TestAll.py
8420 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8421 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8422 self._autoPublish(anObj, theName, "rotated")
8425 ## Scale the given object by the specified factor.
8426 # @param theObject The object to be scaled.
8427 # @param thePoint Center point for scaling.
8428 # Passing None for it means scaling relatively the origin of global CS.
8429 # @param theFactor Scaling factor value.
8430 # @param theCopy Flag used to scale object itself or create a copy.
8431 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8432 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8433 @ManageTransactions("TrsfOp")
8434 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8436 Scale the given object by the specified factor.
8439 theObject The object to be scaled.
8440 thePoint Center point for scaling.
8441 Passing None for it means scaling relatively the origin of global CS.
8442 theFactor Scaling factor value.
8443 theCopy Flag used to scale object itself or create a copy.
8446 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8447 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8449 # Example: see GEOM_TestAll.py
8450 theFactor, Parameters = ParseParameters(theFactor)
8452 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8454 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8455 RaiseIfFailed("Scale", self.TrsfOp)
8456 anObj.SetParameters(Parameters)
8459 ## Scale the given object by the factor, creating its copy before the scaling.
8460 # @param theObject The object to be scaled.
8461 # @param thePoint Center point for scaling.
8462 # Passing None for it means scaling relatively the origin of global CS.
8463 # @param theFactor Scaling factor value.
8464 # @param theName Object name; when specified, this parameter is used
8465 # for result publication in the study. Otherwise, if automatic
8466 # publication is switched on, default value is used for result name.
8468 # @return New GEOM.GEOM_Object, containing the scaled shape.
8470 # @ref tui_scale "Example"
8471 @ManageTransactions("TrsfOp")
8472 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8474 Scale the given object by the factor, creating its copy before the scaling.
8477 theObject The object to be scaled.
8478 thePoint Center point for scaling.
8479 Passing None for it means scaling relatively the origin of global CS.
8480 theFactor Scaling factor value.
8481 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.
8486 New GEOM.GEOM_Object, containing the scaled shape.
8488 # Example: see GEOM_TestAll.py
8489 theFactor, Parameters = ParseParameters(theFactor)
8490 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8491 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8492 anObj.SetParameters(Parameters)
8493 self._autoPublish(anObj, theName, "scaled")
8496 ## Scale the given object by different factors along coordinate axes.
8497 # @param theObject The object to be scaled.
8498 # @param thePoint Center point for scaling.
8499 # Passing None for it means scaling relatively the origin of global CS.
8500 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8501 # @param theCopy Flag used to scale object itself or create a copy.
8502 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8503 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8504 @ManageTransactions("TrsfOp")
8505 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8507 Scale the given object by different factors along coordinate axes.
8510 theObject The object to be scaled.
8511 thePoint Center point for scaling.
8512 Passing None for it means scaling relatively the origin of global CS.
8513 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8514 theCopy Flag used to scale object itself or create a copy.
8517 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8518 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8520 # Example: see GEOM_TestAll.py
8521 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8523 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8524 theFactorX, theFactorY, theFactorZ)
8526 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8527 theFactorX, theFactorY, theFactorZ)
8528 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8529 anObj.SetParameters(Parameters)
8532 ## Scale the given object by different factors along coordinate axes,
8533 # creating its copy before the scaling.
8534 # @param theObject The object to be scaled.
8535 # @param thePoint Center point for scaling.
8536 # Passing None for it means scaling relatively the origin of global CS.
8537 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8538 # @param theName Object name; when specified, this parameter is used
8539 # for result publication in the study. Otherwise, if automatic
8540 # publication is switched on, default value is used for result name.
8542 # @return New GEOM.GEOM_Object, containing the scaled shape.
8544 # @ref swig_scale "Example"
8545 @ManageTransactions("TrsfOp")
8546 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8548 Scale the given object by different factors along coordinate axes,
8549 creating its copy before the scaling.
8552 theObject The object to be scaled.
8553 thePoint Center point for scaling.
8554 Passing None for it means scaling relatively the origin of global CS.
8555 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8556 theName Object name; when specified, this parameter is used
8557 for result publication in the study. Otherwise, if automatic
8558 publication is switched on, default value is used for result name.
8561 New GEOM.GEOM_Object, containing the scaled shape.
8563 # Example: see GEOM_TestAll.py
8564 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8565 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8566 theFactorX, theFactorY, theFactorZ)
8567 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8568 anObj.SetParameters(Parameters)
8569 self._autoPublish(anObj, theName, "scaled")
8572 ## Mirror an object relatively the given plane.
8573 # @param theObject The object to be mirrored.
8574 # @param thePlane Plane of symmetry.
8575 # @param theCopy Flag used to mirror object itself or create a copy.
8576 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8577 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8578 @ManageTransactions("TrsfOp")
8579 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8581 Mirror an object relatively the given plane.
8584 theObject The object to be mirrored.
8585 thePlane Plane of symmetry.
8586 theCopy Flag used to mirror object itself or create a copy.
8589 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8590 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8593 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8595 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8596 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8599 ## Create an object, symmetrical
8600 # to the given one relatively the given plane.
8601 # @param theObject The object to be mirrored.
8602 # @param thePlane Plane of symmetry.
8603 # @param theName Object name; when specified, this parameter is used
8604 # for result publication in the study. Otherwise, if automatic
8605 # publication is switched on, default value is used for result name.
8607 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8609 # @ref tui_mirror "Example"
8610 @ManageTransactions("TrsfOp")
8611 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8613 Create an object, symmetrical to the given one relatively the given plane.
8616 theObject The object to be mirrored.
8617 thePlane Plane of symmetry.
8618 theName Object name; when specified, this parameter is used
8619 for result publication in the study. Otherwise, if automatic
8620 publication is switched on, default value is used for result name.
8623 New GEOM.GEOM_Object, containing the mirrored shape.
8625 # Example: see GEOM_TestAll.py
8626 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8627 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8628 self._autoPublish(anObj, theName, "mirrored")
8631 ## Mirror an object relatively the given axis.
8632 # @param theObject The object to be mirrored.
8633 # @param theAxis Axis of symmetry.
8634 # @param theCopy Flag used to mirror object itself or create a copy.
8635 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8636 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8637 @ManageTransactions("TrsfOp")
8638 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8640 Mirror an object relatively the given axis.
8643 theObject The object to be mirrored.
8644 theAxis Axis of symmetry.
8645 theCopy Flag used to mirror object itself or create a copy.
8648 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8649 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8652 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8654 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8655 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8658 ## Create an object, symmetrical
8659 # to the given one relatively the given axis.
8660 # @param theObject The object to be mirrored.
8661 # @param theAxis Axis of symmetry.
8662 # @param theName Object name; when specified, this parameter is used
8663 # for result publication in the study. Otherwise, if automatic
8664 # publication is switched on, default value is used for result name.
8666 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8668 # @ref tui_mirror "Example"
8669 @ManageTransactions("TrsfOp")
8670 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8672 Create an object, symmetrical to the given one relatively the given axis.
8675 theObject The object to be mirrored.
8676 theAxis Axis of symmetry.
8677 theName Object name; when specified, this parameter is used
8678 for result publication in the study. Otherwise, if automatic
8679 publication is switched on, default value is used for result name.
8682 New GEOM.GEOM_Object, containing the mirrored shape.
8684 # Example: see GEOM_TestAll.py
8685 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8686 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8687 self._autoPublish(anObj, theName, "mirrored")
8690 ## Mirror an object relatively the given point.
8691 # @param theObject The object to be mirrored.
8692 # @param thePoint Point of symmetry.
8693 # @param theCopy Flag used to mirror object itself or create a copy.
8694 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8695 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8696 @ManageTransactions("TrsfOp")
8697 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8699 Mirror an object relatively the given point.
8702 theObject The object to be mirrored.
8703 thePoint Point of symmetry.
8704 theCopy Flag used to mirror object itself or create a copy.
8707 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8708 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8710 # Example: see GEOM_TestAll.py
8712 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8714 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8715 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8718 ## Create an object, symmetrical
8719 # to the given one relatively the given point.
8720 # @param theObject The object to be mirrored.
8721 # @param thePoint Point of symmetry.
8722 # @param theName Object name; when specified, this parameter is used
8723 # for result publication in the study. Otherwise, if automatic
8724 # publication is switched on, default value is used for result name.
8726 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8728 # @ref tui_mirror "Example"
8729 @ManageTransactions("TrsfOp")
8730 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8732 Create an object, symmetrical
8733 to the given one relatively the given point.
8736 theObject The object to be mirrored.
8737 thePoint Point of symmetry.
8738 theName Object name; when specified, this parameter is used
8739 for result publication in the study. Otherwise, if automatic
8740 publication is switched on, default value is used for result name.
8743 New GEOM.GEOM_Object, containing the mirrored shape.
8745 # Example: see GEOM_TestAll.py
8746 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8747 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8748 self._autoPublish(anObj, theName, "mirrored")
8751 ## Modify the location of the given object.
8752 # @param theObject The object to be displaced.
8753 # @param theStartLCS Coordinate system to perform displacement from it.\n
8754 # If \a theStartLCS is NULL, displacement
8755 # will be performed from global CS.\n
8756 # If \a theObject itself is used as \a theStartLCS,
8757 # its location will be changed to \a theEndLCS.
8758 # @param theEndLCS Coordinate system to perform displacement to it.
8759 # @param theCopy Flag used to displace object itself or create a copy.
8760 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8761 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8762 @ManageTransactions("TrsfOp")
8763 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8765 Modify the Location of the given object by LCS, creating its copy before the setting.
8768 theObject The object to be displaced.
8769 theStartLCS Coordinate system to perform displacement from it.
8770 If theStartLCS is NULL, displacement
8771 will be performed from global CS.
8772 If theObject itself is used as theStartLCS,
8773 its location will be changed to theEndLCS.
8774 theEndLCS Coordinate system to perform displacement to it.
8775 theCopy Flag used to displace object itself or create a copy.
8778 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8779 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8781 # Example: see GEOM_TestAll.py
8783 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8785 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8786 RaiseIfFailed("Displace", self.TrsfOp)
8789 ## Modify the Location of the given object by LCS,
8790 # creating its copy before the setting.
8791 # @param theObject The object to be displaced.
8792 # @param theStartLCS Coordinate system to perform displacement from it.\n
8793 # If \a theStartLCS is NULL, displacement
8794 # will be performed from global CS.\n
8795 # If \a theObject itself is used as \a theStartLCS,
8796 # its location will be changed to \a theEndLCS.
8797 # @param theEndLCS Coordinate system to perform displacement to it.
8798 # @param theName Object name; when specified, this parameter is used
8799 # for result publication in the study. Otherwise, if automatic
8800 # publication is switched on, default value is used for result name.
8802 # @return New GEOM.GEOM_Object, containing the displaced shape.
8804 # @ref tui_modify_location "Example"
8805 @ManageTransactions("TrsfOp")
8806 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8808 Modify the Location of the given object by LCS, creating its copy before the setting.
8811 theObject The object to be displaced.
8812 theStartLCS Coordinate system to perform displacement from it.
8813 If theStartLCS is NULL, displacement
8814 will be performed from global CS.
8815 If theObject itself is used as theStartLCS,
8816 its location will be changed to theEndLCS.
8817 theEndLCS Coordinate system to perform displacement to it.
8818 theName Object name; when specified, this parameter is used
8819 for result publication in the study. Otherwise, if automatic
8820 publication is switched on, default value is used for result name.
8823 New GEOM.GEOM_Object, containing the displaced shape.
8826 # create local coordinate systems
8827 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8828 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8829 # modify the location of the given object
8830 position = geompy.MakePosition(cylinder, cs1, cs2)
8832 # Example: see GEOM_TestAll.py
8833 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8834 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8835 self._autoPublish(anObj, theName, "displaced")
8838 ## Modify the Location of the given object by Path.
8839 # @param theObject The object to be displaced.
8840 # @param thePath Wire or Edge along that the object will be translated.
8841 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8842 # @param theCopy is to create a copy objects if true.
8843 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8844 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8845 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8847 # @ref tui_modify_location "Example"
8848 @ManageTransactions("TrsfOp")
8849 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8851 Modify the Location of the given object by Path.
8854 theObject The object to be displaced.
8855 thePath Wire or Edge along that the object will be translated.
8856 theDistance progress of Path (0 = start location, 1 = end of path location).
8857 theCopy is to create a copy objects if true.
8858 theReverse 0 - for usual direction, 1 - to reverse path direction.
8861 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8862 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8865 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8867 # Example: see GEOM_TestAll.py
8868 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8869 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8872 ## Modify the Location of the given object by Path, creating its copy before the operation.
8873 # @param theObject The object to be displaced.
8874 # @param thePath Wire or Edge along that the object will be translated.
8875 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8876 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8877 # @param theName Object name; when specified, this parameter is used
8878 # for result publication in the study. Otherwise, if automatic
8879 # publication is switched on, default value is used for result name.
8881 # @return New GEOM.GEOM_Object, containing the displaced shape.
8882 @ManageTransactions("TrsfOp")
8883 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8885 Modify the Location of the given object by Path, creating its copy before the operation.
8888 theObject The object to be displaced.
8889 thePath Wire or Edge along that the object will be translated.
8890 theDistance progress of Path (0 = start location, 1 = end of path location).
8891 theReverse 0 - for usual direction, 1 - to reverse path direction.
8892 theName Object name; when specified, this parameter is used
8893 for result publication in the study. Otherwise, if automatic
8894 publication is switched on, default value is used for result name.
8897 New GEOM.GEOM_Object, containing the displaced shape.
8899 # Example: see GEOM_TestAll.py
8900 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8901 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8902 self._autoPublish(anObj, theName, "displaced")
8905 ## Offset given shape.
8906 # @param theObject The base object for the offset.
8907 # @param theOffset Offset value.
8908 # @param theCopy Flag used to offset object itself or create a copy.
8909 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8910 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8911 @ManageTransactions("TrsfOp")
8912 def Offset(self, theObject, theOffset, theCopy=False):
8917 theObject The base object for the offset.
8918 theOffset Offset value.
8919 theCopy Flag used to offset object itself or create a copy.
8922 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8923 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8925 theOffset, Parameters = ParseParameters(theOffset)
8927 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8929 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8930 RaiseIfFailed("Offset", self.TrsfOp)
8931 anObj.SetParameters(Parameters)
8934 ## Create new object as offset of the given one.
8935 # @param theObject The base object for the offset.
8936 # @param theOffset Offset value.
8937 # @param theName Object name; when specified, this parameter is used
8938 # for result publication in the study. Otherwise, if automatic
8939 # publication is switched on, default value is used for result name.
8941 # @return New GEOM.GEOM_Object, containing the offset object.
8943 # @ref tui_offset "Example"
8944 @ManageTransactions("TrsfOp")
8945 def MakeOffset(self, theObject, theOffset, theName=None):
8947 Create new object as offset of the given one.
8950 theObject The base object for the offset.
8951 theOffset Offset value.
8952 theName Object name; when specified, this parameter is used
8953 for result publication in the study. Otherwise, if automatic
8954 publication is switched on, default value is used for result name.
8957 New GEOM.GEOM_Object, containing the offset object.
8960 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8961 # create a new object as offset of the given object
8962 offset = geompy.MakeOffset(box, 70.)
8964 # Example: see GEOM_TestAll.py
8965 theOffset, Parameters = ParseParameters(theOffset)
8966 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8967 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8968 anObj.SetParameters(Parameters)
8969 self._autoPublish(anObj, theName, "offset")
8972 ## Create new object as projection of the given one on another.
8973 # @param theSource The source object for the projection. It can be a point, edge or wire.
8974 # Edge and wire are acceptable if @a theTarget is a face.
8975 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
8976 # @param theName Object name; when specified, this parameter is used
8977 # for result publication in the study. Otherwise, if automatic
8978 # publication is switched on, default value is used for result name.
8980 # @return New GEOM.GEOM_Object, containing the projection.
8982 # @ref tui_projection "Example"
8983 @ManageTransactions("TrsfOp")
8984 def MakeProjection(self, theSource, theTarget, theName=None):
8986 Create new object as projection of the given one on another.
8989 theSource The source object for the projection. It can be a point, edge or wire.
8990 Edge and wire are acceptable if theTarget is a face.
8991 theTarget The target object. It can be planar or cylindrical face, edge or wire.
8992 theName Object name; when specified, this parameter is used
8993 for result publication in the study. Otherwise, if automatic
8994 publication is switched on, default value is used for result name.
8997 New GEOM.GEOM_Object, containing the projection.
8999 # Example: see GEOM_TestAll.py
9000 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9001 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9002 self._autoPublish(anObj, theName, "projection")
9005 ## Create a projection projection of the given point on a wire or an edge.
9006 # If there are no solutions or there are 2 or more solutions It throws an
9008 # @param thePoint the point to be projected.
9009 # @param theWire the wire. The edge is accepted as well.
9010 # @param theName Object name; when specified, this parameter is used
9011 # for result publication in the study. Otherwise, if automatic
9012 # publication is switched on, default value is used for result name.
9014 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9015 # \n \a u: The parameter of projection point on edge.
9016 # \n \a PointOnEdge: The projection point.
9017 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9019 # @ref tui_projection "Example"
9020 @ManageTransactions("TrsfOp")
9021 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9023 Create a projection projection of the given point on a wire or an edge.
9024 If there are no solutions or there are 2 or more solutions It throws an
9028 thePoint the point to be projected.
9029 theWire the wire. The edge is accepted as well.
9030 theName Object name; when specified, this parameter is used
9031 for result publication in the study. Otherwise, if automatic
9032 publication is switched on, default value is used for result name.
9035 [u, PointOnEdge, EdgeInWireIndex]
9036 u: The parameter of projection point on edge.
9037 PointOnEdge: The projection point.
9038 EdgeInWireIndex: The index of an edge in a wire.
9040 # Example: see GEOM_TestAll.py
9041 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9042 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9043 self._autoPublish(anObj[1], theName, "projection")
9046 # -----------------------------------------------------------------------------
9048 # -----------------------------------------------------------------------------
9050 ## Translate the given object along the given vector a given number times
9051 # @param theObject The object to be translated.
9052 # @param theVector Direction of the translation. DX if None.
9053 # @param theStep Distance to translate on.
9054 # @param theNbTimes Quantity of translations to be done.
9055 # @param 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.
9059 # @return New GEOM.GEOM_Object, containing compound of all
9060 # the shapes, obtained after each translation.
9062 # @ref tui_multi_translation "Example"
9063 @ManageTransactions("TrsfOp")
9064 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9066 Translate the given object along the given vector a given number times
9069 theObject The object to be translated.
9070 theVector Direction of the translation. DX if None.
9071 theStep Distance to translate on.
9072 theNbTimes Quantity of translations to be done.
9073 theName Object name; when specified, this parameter is used
9074 for result publication in the study. Otherwise, if automatic
9075 publication is switched on, default value is used for result name.
9078 New GEOM.GEOM_Object, containing compound of all
9079 the shapes, obtained after each translation.
9082 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9084 # Example: see GEOM_TestAll.py
9085 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9086 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9087 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9088 anObj.SetParameters(Parameters)
9089 self._autoPublish(anObj, theName, "multitranslation")
9092 ## Conseqently apply two specified translations to theObject specified number of times.
9093 # @param theObject The object to be translated.
9094 # @param theVector1 Direction of the first translation. DX if None.
9095 # @param theStep1 Step of the first translation.
9096 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9097 # @param theVector2 Direction of the second translation. DY if None.
9098 # @param theStep2 Step of the second translation.
9099 # @param theNbTimes2 Quantity of translations to be done along theVector2.
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 compound of all
9105 # the shapes, obtained after each translation.
9107 # @ref tui_multi_translation "Example"
9108 @ManageTransactions("TrsfOp")
9109 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9110 theVector2, theStep2, theNbTimes2, theName=None):
9112 Conseqently apply two specified translations to theObject specified number of times.
9115 theObject The object to be translated.
9116 theVector1 Direction of the first translation. DX if None.
9117 theStep1 Step of the first translation.
9118 theNbTimes1 Quantity of translations to be done along theVector1.
9119 theVector2 Direction of the second translation. DY if None.
9120 theStep2 Step of the second translation.
9121 theNbTimes2 Quantity of translations to be done along theVector2.
9122 theName Object name; when specified, this parameter is used
9123 for result publication in the study. Otherwise, if automatic
9124 publication is switched on, default value is used for result name.
9127 New GEOM.GEOM_Object, containing compound of all
9128 the shapes, obtained after each translation.
9131 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9133 # Example: see GEOM_TestAll.py
9134 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9135 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9136 theVector2, theStep2, theNbTimes2)
9137 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9138 anObj.SetParameters(Parameters)
9139 self._autoPublish(anObj, theName, "multitranslation")
9142 ## Rotate the given object around the given axis a given number times.
9143 # Rotation angle will be 2*PI/theNbTimes.
9144 # @param theObject The object to be rotated.
9145 # @param theAxis The rotation axis. DZ if None.
9146 # @param theNbTimes Quantity of rotations to be done.
9147 # @param theName Object name; when specified, this parameter is used
9148 # for result publication in the study. Otherwise, if automatic
9149 # publication is switched on, default value is used for result name.
9151 # @return New GEOM.GEOM_Object, containing compound of all the
9152 # shapes, obtained after each rotation.
9154 # @ref tui_multi_rotation "Example"
9155 @ManageTransactions("TrsfOp")
9156 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9158 Rotate the given object around the given axis a given number times.
9159 Rotation angle will be 2*PI/theNbTimes.
9162 theObject The object to be rotated.
9163 theAxis The rotation axis. DZ if None.
9164 theNbTimes Quantity of rotations to be done.
9165 theName Object name; when specified, this parameter is used
9166 for result publication in the study. Otherwise, if automatic
9167 publication is switched on, default value is used for result name.
9170 New GEOM.GEOM_Object, containing compound of all the
9171 shapes, obtained after each rotation.
9174 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9176 # Example: see GEOM_TestAll.py
9177 theNbTimes, Parameters = ParseParameters(theNbTimes)
9178 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9179 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9180 anObj.SetParameters(Parameters)
9181 self._autoPublish(anObj, theName, "multirotation")
9184 ## Rotate the given object around the given axis
9185 # a given number times on the given angle.
9186 # @param theObject The object to be rotated.
9187 # @param theAxis The rotation axis. DZ if None.
9188 # @param theAngleStep Rotation angle in radians.
9189 # @param theNbTimes Quantity of rotations to be done.
9190 # @param theName Object name; when specified, this parameter is used
9191 # for result publication in the study. Otherwise, if automatic
9192 # publication is switched on, default value is used for result name.
9194 # @return New GEOM.GEOM_Object, containing compound of all the
9195 # shapes, obtained after each rotation.
9197 # @ref tui_multi_rotation "Example"
9198 @ManageTransactions("TrsfOp")
9199 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9201 Rotate the given object around the given axis
9202 a given number times on the given angle.
9205 theObject The object to be rotated.
9206 theAxis The rotation axis. DZ if None.
9207 theAngleStep Rotation angle in radians.
9208 theNbTimes Quantity of rotations to be done.
9209 theName Object name; when specified, this parameter is used
9210 for result publication in the study. Otherwise, if automatic
9211 publication is switched on, default value is used for result name.
9214 New GEOM.GEOM_Object, containing compound of all the
9215 shapes, obtained after each rotation.
9218 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9220 # Example: see GEOM_TestAll.py
9221 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9222 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9223 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9224 anObj.SetParameters(Parameters)
9225 self._autoPublish(anObj, theName, "multirotation")
9228 ## Rotate the given object around the given axis a given
9229 # number times and multi-translate each rotation result.
9230 # Rotation angle will be 2*PI/theNbTimes1.
9231 # Translation direction passes through center of gravity
9232 # of rotated shape and its projection on the rotation axis.
9233 # @param theObject The object to be rotated.
9234 # @param theAxis Rotation axis. DZ if None.
9235 # @param theNbTimes1 Quantity of rotations to be done.
9236 # @param theRadialStep Translation distance.
9237 # @param theNbTimes2 Quantity of translations to be done.
9238 # @param theName Object name; when specified, this parameter is used
9239 # for result publication in the study. Otherwise, if automatic
9240 # publication is switched on, default value is used for result name.
9242 # @return New GEOM.GEOM_Object, containing compound of all the
9243 # shapes, obtained after each transformation.
9245 # @ref tui_multi_rotation "Example"
9246 @ManageTransactions("TrsfOp")
9247 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9249 Rotate the given object around the
9250 given axis on the given angle a given number
9251 times and multi-translate each rotation result.
9252 Translation direction passes through center of gravity
9253 of rotated shape and its projection on the rotation axis.
9256 theObject The object to be rotated.
9257 theAxis Rotation axis. DZ if None.
9258 theNbTimes1 Quantity of rotations to be done.
9259 theRadialStep Translation distance.
9260 theNbTimes2 Quantity of translations to be done.
9261 theName Object name; when specified, this parameter is used
9262 for result publication in the study. Otherwise, if automatic
9263 publication is switched on, default value is used for result name.
9266 New GEOM.GEOM_Object, containing compound of all the
9267 shapes, obtained after each transformation.
9270 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9272 # Example: see GEOM_TestAll.py
9273 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9274 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9275 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9276 anObj.SetParameters(Parameters)
9277 self._autoPublish(anObj, theName, "multirotation")
9280 ## Rotate the given object around the
9281 # given axis on the given angle a given number
9282 # times and multi-translate each rotation result.
9283 # Translation direction passes through center of gravity
9284 # of rotated shape and its projection on the rotation axis.
9285 # @param theObject The object to be rotated.
9286 # @param theAxis Rotation axis. DZ if None.
9287 # @param theAngleStep Rotation angle in radians.
9288 # @param theNbTimes1 Quantity of rotations to be done.
9289 # @param theRadialStep Translation distance.
9290 # @param theNbTimes2 Quantity of translations to be done.
9291 # @param theName Object name; when specified, this parameter is used
9292 # for result publication in the study. Otherwise, if automatic
9293 # publication is switched on, default value is used for result name.
9295 # @return New GEOM.GEOM_Object, containing compound of all the
9296 # shapes, obtained after each transformation.
9298 # @ref tui_multi_rotation "Example"
9299 @ManageTransactions("TrsfOp")
9300 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9302 Rotate the given object around the
9303 given axis on the given angle a given number
9304 times and multi-translate each rotation result.
9305 Translation direction passes through center of gravity
9306 of rotated shape and its projection on the rotation axis.
9309 theObject The object to be rotated.
9310 theAxis Rotation axis. DZ if None.
9311 theAngleStep Rotation angle in radians.
9312 theNbTimes1 Quantity of rotations to be done.
9313 theRadialStep Translation distance.
9314 theNbTimes2 Quantity of translations to be done.
9315 theName Object name; when specified, this parameter is used
9316 for result publication in the study. Otherwise, if automatic
9317 publication is switched on, default value is used for result name.
9320 New GEOM.GEOM_Object, containing compound of all the
9321 shapes, obtained after each transformation.
9324 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9326 # Example: see GEOM_TestAll.py
9327 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9328 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9329 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9330 anObj.SetParameters(Parameters)
9331 self._autoPublish(anObj, theName, "multirotation")
9334 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9336 # @ref swig_MakeMultiRotation "Example"
9337 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9339 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9342 pz = geompy.MakeVertex(0, 0, 100)
9343 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9344 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9346 # Example: see GEOM_TestOthers.py
9347 aVec = self.MakeLine(aPoint,aDir)
9348 # note: auto-publishing is done in self.MultiRotate1D()
9349 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9352 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9354 # @ref swig_MakeMultiRotation "Example"
9355 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9357 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9360 pz = geompy.MakeVertex(0, 0, 100)
9361 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9362 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9364 # Example: see GEOM_TestOthers.py
9365 aVec = self.MakeLine(aPoint,aDir)
9366 # note: auto-publishing is done in self.MultiRotate1D()
9367 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9370 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9372 # @ref swig_MakeMultiRotation "Example"
9373 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9375 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9378 pz = geompy.MakeVertex(0, 0, 100)
9379 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9380 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9382 # Example: see GEOM_TestOthers.py
9383 aVec = self.MakeLine(aPoint,aDir)
9384 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9385 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9388 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9390 # @ref swig_MakeMultiRotation "Example"
9391 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9393 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9396 pz = geompy.MakeVertex(0, 0, 100)
9397 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9398 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9400 # Example: see GEOM_TestOthers.py
9401 aVec = self.MakeLine(aPoint,aDir)
9402 # note: auto-publishing is done in self.MultiRotate2D()
9403 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9407 # Compute a wire or a face that represents a projection of the source
9408 # shape onto cylinder. The cylinder's coordinate system is the same
9409 # as the global coordinate system.
9411 # @param theObject The object to be projected. It can be either
9412 # a planar wire or a face.
9413 # @param theRadius The radius of the cylinder.
9414 # @param theStartAngle The starting angle in radians from
9415 # the cylinder's X axis around Z axis. The angle from which
9416 # the projection is started.
9417 # @param theAngleLength The projection length angle in radians.
9418 # The angle in which to project the total length of the wire.
9419 # If it is negative the projection is not scaled and natural
9420 # wire length is kept for the projection.
9421 # @param theName Object name; when specified, this parameter is used
9422 # for result publication in the study. Otherwise, if automatic
9423 # publication is switched on, default value is used for result name.
9425 # @return New GEOM.GEOM_Object, containing the result shape. The result
9426 # represents a wire or a face that represents a projection of
9427 # the source shape onto a cylinder.
9429 # @ref tui_projection "Example"
9430 def MakeProjectionOnCylinder (self, theObject, theRadius,
9431 theStartAngle=0.0, theAngleLength=-1.0,
9434 Compute a wire or a face that represents a projection of the source
9435 shape onto cylinder. The cylinder's coordinate system is the same
9436 as the global coordinate system.
9439 theObject The object to be projected. It can be either
9440 a planar wire or a face.
9441 theRadius The radius of the cylinder.
9442 theStartAngle The starting angle in radians from the cylinder's X axis
9443 around Z axis. The angle from which the projection is started.
9444 theAngleLength The projection length angle in radians. The angle in which
9445 to project the total length of the wire. If it is negative the
9446 projection is not scaled and natural wire length is kept for
9448 theName Object name; when specified, this parameter is used
9449 for result publication in the study. Otherwise, if automatic
9450 publication is switched on, default value is used for result name.
9453 New GEOM.GEOM_Object, containing the result shape. The result
9454 represents a wire or a face that represents a projection of
9455 the source shape onto a cylinder.
9457 # Example: see GEOM_TestAll.py
9458 theRadius, theStartAngle, theAngleLength, Parameters = ParseParameters(
9459 theRadius, theStartAngle, theAngleLength)
9460 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9461 theStartAngle, theAngleLength)
9462 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9463 anObj.SetParameters(Parameters)
9464 self._autoPublish(anObj, theName, "projection")
9467 # end of l3_transform
9470 ## @addtogroup l3_transform_d
9473 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9474 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9476 Deprecated method. Use MultiRotate1DNbTimes instead.
9478 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9479 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9481 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9482 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9483 @ManageTransactions("TrsfOp")
9484 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9486 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9487 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9490 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9492 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9493 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9494 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9495 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9496 anObj.SetParameters(Parameters)
9497 self._autoPublish(anObj, theName, "multirotation")
9500 ## The same, as MultiRotate1D(), but axis is given by direction and point
9501 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9502 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9504 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9505 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9508 pz = geompy.MakeVertex(0, 0, 100)
9509 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9510 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9512 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9513 aVec = self.MakeLine(aPoint,aDir)
9514 # note: auto-publishing is done in self.MultiRotate1D()
9515 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9518 ## The same, as MultiRotate2D(), but axis is given by direction and point
9519 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9520 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9522 The same, as MultiRotate2D(), but axis is given by direction and point
9523 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9526 pz = geompy.MakeVertex(0, 0, 100)
9527 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9528 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9530 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9531 aVec = self.MakeLine(aPoint,aDir)
9532 # note: auto-publishing is done in self.MultiRotate2D()
9533 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9536 # end of l3_transform_d
9539 ## @addtogroup l3_local
9542 ## Perform a fillet on all edges of the given shape.
9543 # @param theShape Shape, to perform fillet on.
9544 # @param theR Fillet radius.
9545 # @param theName Object name; when specified, this parameter is used
9546 # for result publication in the study. Otherwise, if automatic
9547 # publication is switched on, default value is used for result name.
9549 # @return New GEOM.GEOM_Object, containing the result shape.
9551 # @ref tui_fillet "Example 1"
9552 # \n @ref swig_MakeFilletAll "Example 2"
9553 @ManageTransactions("LocalOp")
9554 def MakeFilletAll(self, theShape, theR, theName=None):
9556 Perform a fillet on all edges of the given shape.
9559 theShape Shape, to perform fillet on.
9561 theName Object name; when specified, this parameter is used
9562 for result publication in the study. Otherwise, if automatic
9563 publication is switched on, default value is used for result name.
9566 New GEOM.GEOM_Object, containing the result shape.
9569 filletall = geompy.MakeFilletAll(prism, 10.)
9571 # Example: see GEOM_TestOthers.py
9572 theR,Parameters = ParseParameters(theR)
9573 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9574 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9575 anObj.SetParameters(Parameters)
9576 self._autoPublish(anObj, theName, "fillet")
9579 ## Perform a fillet on the specified edges/faces of the given shape
9580 # @param theShape Shape, to perform fillet on.
9581 # @param theR Fillet radius.
9582 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9583 # @param theListShapes Global indices of edges/faces to perform fillet on.
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 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9590 # @return New GEOM.GEOM_Object, containing the result shape.
9592 # @ref tui_fillet "Example"
9593 @ManageTransactions("LocalOp")
9594 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9596 Perform a fillet on the specified edges/faces of the given shape
9599 theShape Shape, to perform fillet on.
9601 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9602 theListShapes Global indices of edges/faces to perform fillet on.
9603 theName Object name; when specified, this parameter is used
9604 for result publication in the study. Otherwise, if automatic
9605 publication is switched on, default value is used for result name.
9608 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9611 New GEOM.GEOM_Object, containing the result shape.
9614 # get the list of IDs (IDList) for the fillet
9615 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9617 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9618 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9619 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9620 # make a fillet on the specified edges of the given shape
9621 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9623 # Example: see GEOM_TestAll.py
9624 theR,Parameters = ParseParameters(theR)
9626 if theShapeType == self.ShapeType["EDGE"]:
9627 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9628 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9630 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9631 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9632 anObj.SetParameters(Parameters)
9633 self._autoPublish(anObj, theName, "fillet")
9636 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9637 @ManageTransactions("LocalOp")
9638 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9640 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9643 # get the list of IDs (IDList) for the fillet
9644 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9646 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9647 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9648 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9649 # make a fillet on the specified edges of the given shape
9650 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9652 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9654 if theShapeType == self.ShapeType["EDGE"]:
9655 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9656 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9658 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9659 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9660 anObj.SetParameters(Parameters)
9661 self._autoPublish(anObj, theName, "fillet")
9664 ## Perform a fillet on the specified edges of the given shape
9665 # @param theShape Wire Shape to perform fillet on.
9666 # @param theR Fillet radius.
9667 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9668 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9669 # \note The list of vertices could be empty,
9670 # in this case fillet will done done at all vertices in wire
9671 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9672 # by the length of the edges, nearest to the fillet vertex.
9673 # But sometimes the next edge is C1 continuous with the one, nearest to
9674 # the fillet point, and such two (or more) edges can be united to allow
9675 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9676 # thus ignoring the secant vertex (vertices).
9677 # @param theName Object name; when specified, this parameter is used
9678 # for result publication in the study. Otherwise, if automatic
9679 # publication is switched on, default value is used for result name.
9681 # @return New GEOM.GEOM_Object, containing the result shape.
9683 # @ref tui_fillet2d "Example"
9684 @ManageTransactions("LocalOp")
9685 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9687 Perform a fillet on the specified edges of the given shape
9690 theShape Wire Shape to perform fillet on.
9692 theListOfVertexes Global indices of vertexes to perform fillet on.
9693 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9694 by the length of the edges, nearest to the fillet vertex.
9695 But sometimes the next edge is C1 continuous with the one, nearest to
9696 the fillet point, and such two (or more) edges can be united to allow
9697 bigger radius. Set this flag to TRUE to allow collinear edges union,
9698 thus ignoring the secant vertex (vertices).
9699 theName Object name; when specified, this parameter is used
9700 for result publication in the study. Otherwise, if automatic
9701 publication is switched on, default value is used for result name.
9703 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9705 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9708 New GEOM.GEOM_Object, containing the result shape.
9712 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9713 # make fillet at given wire vertices with giver radius
9714 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9716 # Example: see GEOM_TestAll.py
9717 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9718 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9719 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9720 anObj.SetParameters(Parameters)
9721 self._autoPublish(anObj, theName, "fillet")
9724 ## Perform a fillet at the specified vertices of the given face/shell.
9725 # @param theShape Face or Shell shape to perform fillet on.
9726 # @param theR Fillet radius.
9727 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9728 # @param theName Object name; when specified, this parameter is used
9729 # for result publication in the study. Otherwise, if automatic
9730 # publication is switched on, default value is used for result name.
9732 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9734 # @return New GEOM.GEOM_Object, containing the result shape.
9736 # @ref tui_fillet2d "Example"
9737 @ManageTransactions("LocalOp")
9738 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9740 Perform a fillet at the specified vertices of the given face/shell.
9743 theShape Face or Shell shape to perform fillet on.
9745 theListOfVertexes Global indices of vertexes to perform fillet on.
9746 theName Object name; when specified, this parameter is used
9747 for result publication in the study. Otherwise, if automatic
9748 publication is switched on, default value is used for result name.
9750 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9753 New GEOM.GEOM_Object, containing the result shape.
9756 face = geompy.MakeFaceHW(100, 100, 1)
9757 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9759 # Example: see GEOM_TestAll.py
9760 theR,Parameters = ParseParameters(theR)
9761 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9762 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9763 anObj.SetParameters(Parameters)
9764 self._autoPublish(anObj, theName, "fillet")
9767 ## Perform a symmetric chamfer on all edges of the given shape.
9768 # @param theShape Shape, to perform chamfer on.
9769 # @param theD Chamfer size along each face.
9770 # @param theName Object name; when specified, this parameter is used
9771 # for result publication in the study. Otherwise, if automatic
9772 # publication is switched on, default value is used for result name.
9774 # @return New GEOM.GEOM_Object, containing the result shape.
9776 # @ref tui_chamfer "Example 1"
9777 # \n @ref swig_MakeChamferAll "Example 2"
9778 @ManageTransactions("LocalOp")
9779 def MakeChamferAll(self, theShape, theD, theName=None):
9781 Perform a symmetric chamfer on all edges of the given shape.
9784 theShape Shape, to perform chamfer on.
9785 theD Chamfer size along each face.
9786 theName Object name; when specified, this parameter is used
9787 for result publication in the study. Otherwise, if automatic
9788 publication is switched on, default value is used for result name.
9791 New GEOM.GEOM_Object, containing the result shape.
9794 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9796 # Example: see GEOM_TestOthers.py
9797 theD,Parameters = ParseParameters(theD)
9798 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9799 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9800 anObj.SetParameters(Parameters)
9801 self._autoPublish(anObj, theName, "chamfer")
9804 ## Perform a chamfer on edges, common to the specified faces,
9805 # with distance D1 on the Face1
9806 # @param theShape Shape, to perform chamfer on.
9807 # @param theD1 Chamfer size along \a theFace1.
9808 # @param theD2 Chamfer size along \a theFace2.
9809 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9810 # @param theName Object name; when specified, this parameter is used
9811 # for result publication in the study. Otherwise, if automatic
9812 # publication is switched on, default value is used for result name.
9814 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9816 # @return New GEOM.GEOM_Object, containing the result shape.
9818 # @ref tui_chamfer "Example"
9819 @ManageTransactions("LocalOp")
9820 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9822 Perform a chamfer on edges, common to the specified faces,
9823 with distance D1 on the Face1
9826 theShape Shape, to perform chamfer on.
9827 theD1 Chamfer size along theFace1.
9828 theD2 Chamfer size along theFace2.
9829 theFace1,theFace2 Global indices of two faces of theShape.
9830 theName Object name; when specified, this parameter is used
9831 for result publication in the study. Otherwise, if automatic
9832 publication is switched on, default value is used for result name.
9835 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9838 New GEOM.GEOM_Object, containing the result shape.
9841 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9842 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9843 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9844 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9846 # Example: see GEOM_TestAll.py
9847 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9848 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9849 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9850 anObj.SetParameters(Parameters)
9851 self._autoPublish(anObj, theName, "chamfer")
9854 ## Perform a chamfer on edges
9855 # @param theShape Shape, to perform chamfer on.
9856 # @param theD Chamfer length
9857 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9858 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9859 # @param theName Object name; when specified, this parameter is used
9860 # for result publication in the study. Otherwise, if automatic
9861 # publication is switched on, default value is used for result name.
9863 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9865 # @return New GEOM.GEOM_Object, containing the result shape.
9866 @ManageTransactions("LocalOp")
9867 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9869 Perform a chamfer on edges
9872 theShape Shape, to perform chamfer on.
9873 theD1 Chamfer size along theFace1.
9874 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9875 theFace1,theFace2 Global indices of two faces of theShape.
9876 theName Object name; when specified, this parameter is used
9877 for result publication in the study. Otherwise, if automatic
9878 publication is switched on, default value is used for result name.
9881 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9884 New GEOM.GEOM_Object, containing the result shape.
9887 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9888 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9889 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9891 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9894 if isinstance(theAngle,str):
9896 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9898 theAngle = theAngle*math.pi/180.0
9899 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9900 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9901 anObj.SetParameters(Parameters)
9902 self._autoPublish(anObj, theName, "chamfer")
9905 ## Perform a chamfer on all edges of the specified faces,
9906 # with distance D1 on the first specified face (if several for one edge)
9907 # @param theShape Shape, to perform chamfer on.
9908 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9909 # connected to the edge, are in \a theFaces, \a theD1
9910 # will be get along face, which is nearer to \a theFaces beginning.
9911 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9912 # @param theFaces Sequence of global indices of faces of \a theShape.
9913 # @param theName Object name; when specified, this parameter is used
9914 # for result publication in the study. Otherwise, if automatic
9915 # publication is switched on, default value is used for result name.
9917 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9919 # @return New GEOM.GEOM_Object, containing the result shape.
9921 # @ref tui_chamfer "Example"
9922 @ManageTransactions("LocalOp")
9923 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9925 Perform a chamfer on all edges of the specified faces,
9926 with distance D1 on the first specified face (if several for one edge)
9929 theShape Shape, to perform chamfer on.
9930 theD1 Chamfer size along face from theFaces. If both faces,
9931 connected to the edge, are in theFaces, theD1
9932 will be get along face, which is nearer to theFaces beginning.
9933 theD2 Chamfer size along another of two faces, connected to the edge.
9934 theFaces Sequence of global indices of faces of theShape.
9935 theName Object name; when specified, this parameter is used
9936 for result publication in the study. Otherwise, if automatic
9937 publication is switched on, default value is used for result name.
9939 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9942 New GEOM.GEOM_Object, containing the result shape.
9944 # Example: see GEOM_TestAll.py
9945 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9946 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9947 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9948 anObj.SetParameters(Parameters)
9949 self._autoPublish(anObj, theName, "chamfer")
9952 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9953 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9955 # @ref swig_FilletChamfer "Example"
9956 @ManageTransactions("LocalOp")
9957 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9959 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9960 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9963 if isinstance(theAngle,str):
9965 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9967 theAngle = theAngle*math.pi/180.0
9968 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9969 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9970 anObj.SetParameters(Parameters)
9971 self._autoPublish(anObj, theName, "chamfer")
9974 ## Perform a chamfer on edges,
9975 # with distance D1 on the first specified face (if several for one edge)
9976 # @param theShape Shape, to perform chamfer on.
9977 # @param theD1,theD2 Chamfer size
9978 # @param theEdges Sequence of edges of \a theShape.
9979 # @param theName Object name; when specified, this parameter is used
9980 # for result publication in the study. Otherwise, if automatic
9981 # publication is switched on, default value is used for result name.
9983 # @return New GEOM.GEOM_Object, containing the result shape.
9985 # @ref swig_FilletChamfer "Example"
9986 @ManageTransactions("LocalOp")
9987 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9989 Perform a chamfer on edges,
9990 with distance D1 on the first specified face (if several for one edge)
9993 theShape Shape, to perform chamfer on.
9994 theD1,theD2 Chamfer size
9995 theEdges Sequence of edges of theShape.
9996 theName Object name; when specified, this parameter is used
9997 for result publication in the study. Otherwise, if automatic
9998 publication is switched on, default value is used for result name.
10001 New GEOM.GEOM_Object, containing the result shape.
10003 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10004 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10005 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10006 anObj.SetParameters(Parameters)
10007 self._autoPublish(anObj, theName, "chamfer")
10010 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
10011 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10012 @ManageTransactions("LocalOp")
10013 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10015 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
10016 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10019 if isinstance(theAngle,str):
10021 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10023 theAngle = theAngle*math.pi/180.0
10024 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10025 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10026 anObj.SetParameters(Parameters)
10027 self._autoPublish(anObj, theName, "chamfer")
10030 ## @sa MakeChamferEdge(), MakeChamferFaces()
10032 # @ref swig_MakeChamfer "Example"
10033 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10035 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10037 # Example: see GEOM_TestOthers.py
10039 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10040 if aShapeType == self.ShapeType["EDGE"]:
10041 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10043 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10046 ## Remove material from a solid by extrusion of the base shape on the given distance.
10047 # @param theInit Shape to remove material from. It must be a solid or
10048 # a compound made of a single solid.
10049 # @param theBase Closed edge or wire defining the base shape to be extruded.
10050 # @param theH Prism dimension along the normal to theBase
10051 # @param theAngle Draft angle in degrees.
10052 # @param theName Object name; when specified, this parameter is used
10053 # for result publication in the study. Otherwise, if automatic
10054 # publication is switched on, default value is used for result name.
10056 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10058 # @ref tui_creation_prism "Example"
10059 @ManageTransactions("PrimOp")
10060 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
10062 Add material to a solid by extrusion of the base shape on the given distance.
10065 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10066 theBase Closed edge or wire defining the base shape to be extruded.
10067 theH Prism dimension along the normal to theBase
10068 theAngle Draft angle in degrees.
10069 theName Object name; when specified, this parameter is used
10070 for result publication in the study. Otherwise, if automatic
10071 publication is switched on, default value is used for result name.
10074 New GEOM.GEOM_Object, containing the initial shape with removed material.
10076 # Example: see GEOM_TestAll.py
10077 #theH,Parameters = ParseParameters(theH)
10078 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
10079 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10080 #anObj.SetParameters(Parameters)
10081 self._autoPublish(anObj, theName, "extrudedCut")
10084 ## Add material to a solid by extrusion of the base shape on the given distance.
10085 # @param theInit Shape to add material to. It must be a solid or
10086 # a compound made of a single solid.
10087 # @param theBase Closed edge or wire defining the base shape to be extruded.
10088 # @param theH Prism dimension along the normal to theBase
10089 # @param theAngle Draft angle in degrees.
10090 # @param theName Object name; when specified, this parameter is used
10091 # for result publication in the study. Otherwise, if automatic
10092 # publication is switched on, default value is used for result name.
10094 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10096 # @ref tui_creation_prism "Example"
10097 @ManageTransactions("PrimOp")
10098 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
10100 Add material to a solid by extrusion of the base shape on the given distance.
10103 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10104 theBase Closed edge or wire defining the base shape to be extruded.
10105 theH Prism dimension along the normal to theBase
10106 theAngle Draft angle in degrees.
10107 theName Object name; when specified, this parameter is used
10108 for result publication in the study. Otherwise, if automatic
10109 publication is switched on, default value is used for result name.
10112 New GEOM.GEOM_Object, containing the initial shape with added material.
10114 # Example: see GEOM_TestAll.py
10115 #theH,Parameters = ParseParameters(theH)
10116 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
10117 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10118 #anObj.SetParameters(Parameters)
10119 self._autoPublish(anObj, theName, "extrudedBoss")
10125 ## @addtogroup l3_basic_op
10128 ## Perform an Archimde operation on the given shape with given parameters.
10129 # The object presenting the resulting face is returned.
10130 # @param theShape Shape to be put in water.
10131 # @param theWeight Weight of the shape.
10132 # @param theWaterDensity Density of the water.
10133 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10134 # @param theName Object name; when specified, this parameter is used
10135 # for result publication in the study. Otherwise, if automatic
10136 # publication is switched on, default value is used for result name.
10138 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10139 # by a plane, corresponding to water level.
10141 # @ref tui_archimede "Example"
10142 @ManageTransactions("LocalOp")
10143 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10145 Perform an Archimde operation on the given shape with given parameters.
10146 The object presenting the resulting face is returned.
10149 theShape Shape to be put in water.
10150 theWeight Weight of the shape.
10151 theWaterDensity Density of the water.
10152 theMeshDeflection Deflection of the mesh, using to compute the section.
10153 theName Object name; when specified, this parameter is used
10154 for result publication in the study. Otherwise, if automatic
10155 publication is switched on, default value is used for result name.
10158 New GEOM.GEOM_Object, containing a section of theShape
10159 by a plane, corresponding to water level.
10161 # Example: see GEOM_TestAll.py
10162 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10163 theWeight,theWaterDensity,theMeshDeflection)
10164 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10165 RaiseIfFailed("MakeArchimede", self.LocalOp)
10166 anObj.SetParameters(Parameters)
10167 self._autoPublish(anObj, theName, "archimede")
10170 # end of l3_basic_op
10173 ## @addtogroup l2_measure
10176 ## Get point coordinates
10177 # @return [x, y, z]
10179 # @ref tui_point_coordinates_page "Example"
10180 @ManageTransactions("MeasuOp")
10181 def PointCoordinates(self,Point):
10183 Get point coordinates
10188 # Example: see GEOM_TestMeasures.py
10189 aTuple = self.MeasuOp.PointCoordinates(Point)
10190 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10193 ## Get vector coordinates
10194 # @return [x, y, z]
10196 # @ref tui_measurement_tools_page "Example"
10197 def VectorCoordinates(self,Vector):
10199 Get vector coordinates
10205 p1=self.GetFirstVertex(Vector)
10206 p2=self.GetLastVertex(Vector)
10208 X1=self.PointCoordinates(p1)
10209 X2=self.PointCoordinates(p2)
10211 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10214 ## Compute cross product
10215 # @return vector w=u^v
10217 # @ref tui_measurement_tools_page "Example"
10218 def CrossProduct(self, Vector1, Vector2):
10220 Compute cross product
10222 Returns: vector w=u^v
10224 u=self.VectorCoordinates(Vector1)
10225 v=self.VectorCoordinates(Vector2)
10226 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])
10230 ## Compute cross product
10231 # @return dot product p=u.v
10233 # @ref tui_measurement_tools_page "Example"
10234 def DotProduct(self, Vector1, Vector2):
10236 Compute cross product
10238 Returns: dot product p=u.v
10240 u=self.VectorCoordinates(Vector1)
10241 v=self.VectorCoordinates(Vector2)
10242 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10247 ## Get summarized length of all wires,
10248 # area of surface and volume of the given shape.
10249 # @param theShape Shape to define properties of.
10250 # @return [theLength, theSurfArea, theVolume]\n
10251 # theLength: Summarized length of all wires of the given shape.\n
10252 # theSurfArea: Area of surface of the given shape.\n
10253 # theVolume: Volume of the given shape.
10255 # @ref tui_basic_properties_page "Example"
10256 @ManageTransactions("MeasuOp")
10257 def BasicProperties(self,theShape):
10259 Get summarized length of all wires,
10260 area of surface and volume of the given shape.
10263 theShape Shape to define properties of.
10266 [theLength, theSurfArea, theVolume]
10267 theLength: Summarized length of all wires of the given shape.
10268 theSurfArea: Area of surface of the given shape.
10269 theVolume: Volume of the given shape.
10271 # Example: see GEOM_TestMeasures.py
10272 aTuple = self.MeasuOp.GetBasicProperties(theShape)
10273 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10276 ## Get parameters of bounding box of the given shape
10277 # @param theShape Shape to obtain bounding box of.
10278 # @param precise TRUE for precise computation; FALSE for fast one.
10279 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10280 # Xmin,Xmax: Limits of shape along OX axis.
10281 # Ymin,Ymax: Limits of shape along OY axis.
10282 # Zmin,Zmax: Limits of shape along OZ axis.
10284 # @ref tui_bounding_box_page "Example"
10285 @ManageTransactions("MeasuOp")
10286 def BoundingBox (self, theShape, precise=False):
10288 Get parameters of bounding box of the given shape
10291 theShape Shape to obtain bounding box of.
10292 precise TRUE for precise computation; FALSE for fast one.
10295 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10296 Xmin,Xmax: Limits of shape along OX axis.
10297 Ymin,Ymax: Limits of shape along OY axis.
10298 Zmin,Zmax: Limits of shape along OZ axis.
10300 # Example: see GEOM_TestMeasures.py
10301 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10302 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10305 ## Get bounding box of the given shape
10306 # @param theShape Shape to obtain bounding box of.
10307 # @param precise TRUE for precise computation; FALSE for fast one.
10308 # @param theName Object name; when specified, this parameter is used
10309 # for result publication in the study. Otherwise, if automatic
10310 # publication is switched on, default value is used for result name.
10312 # @return New GEOM.GEOM_Object, containing the created box.
10314 # @ref tui_bounding_box_page "Example"
10315 @ManageTransactions("MeasuOp")
10316 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10318 Get bounding box of the given shape
10321 theShape Shape to obtain bounding box of.
10322 precise TRUE for precise computation; FALSE for fast one.
10323 theName Object name; when specified, this parameter is used
10324 for result publication in the study. Otherwise, if automatic
10325 publication is switched on, default value is used for result name.
10328 New GEOM.GEOM_Object, containing the created box.
10330 # Example: see GEOM_TestMeasures.py
10331 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10332 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10333 self._autoPublish(anObj, theName, "bndbox")
10336 ## Get inertia matrix and moments of inertia of theShape.
10337 # @param theShape Shape to calculate inertia of.
10338 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10339 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10340 # Ix,Iy,Iz: Moments of inertia of the given shape.
10342 # @ref tui_inertia_page "Example"
10343 @ManageTransactions("MeasuOp")
10344 def Inertia(self,theShape):
10346 Get inertia matrix and moments of inertia of theShape.
10349 theShape Shape to calculate inertia of.
10352 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10353 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10354 Ix,Iy,Iz: Moments of inertia of the given shape.
10356 # Example: see GEOM_TestMeasures.py
10357 aTuple = self.MeasuOp.GetInertia(theShape)
10358 RaiseIfFailed("GetInertia", self.MeasuOp)
10361 ## Get if coords are included in the shape (ST_IN or ST_ON)
10362 # @param theShape Shape
10363 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10364 # @param tolerance to be used (default is 1.0e-7)
10365 # @return list_of_boolean = [res1, res2, ...]
10366 @ManageTransactions("MeasuOp")
10367 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10369 Get if coords are included in the shape (ST_IN or ST_ON)
10373 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10374 tolerance to be used (default is 1.0e-7)
10377 list_of_boolean = [res1, res2, ...]
10379 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10381 ## Get minimal distance between the given shapes.
10382 # @param theShape1,theShape2 Shapes to find minimal distance between.
10383 # @return Value of the minimal distance between the given shapes.
10385 # @ref tui_min_distance_page "Example"
10386 @ManageTransactions("MeasuOp")
10387 def MinDistance(self, theShape1, theShape2):
10389 Get minimal distance between the given shapes.
10392 theShape1,theShape2 Shapes to find minimal distance between.
10395 Value of the minimal distance between the given shapes.
10397 # Example: see GEOM_TestMeasures.py
10398 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10399 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10402 ## Get minimal distance between the given shapes.
10403 # @param theShape1,theShape2 Shapes to find minimal distance between.
10404 # @return Value of the minimal distance between the given shapes, in form of list
10405 # [Distance, DX, DY, DZ].
10407 # @ref tui_min_distance_page "Example"
10408 @ManageTransactions("MeasuOp")
10409 def MinDistanceComponents(self, theShape1, theShape2):
10411 Get minimal distance between the given shapes.
10414 theShape1,theShape2 Shapes to find minimal distance between.
10417 Value of the minimal distance between the given shapes, in form of list
10418 [Distance, DX, DY, DZ]
10420 # Example: see GEOM_TestMeasures.py
10421 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10422 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10423 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10426 ## Get closest points of the given shapes.
10427 # @param theShape1,theShape2 Shapes to find closest points of.
10428 # @return The number of found solutions (-1 in case of infinite number of
10429 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10431 # @ref tui_min_distance_page "Example"
10432 @ManageTransactions("MeasuOp")
10433 def ClosestPoints (self, theShape1, theShape2):
10435 Get closest points of the given shapes.
10438 theShape1,theShape2 Shapes to find closest points of.
10441 The number of found solutions (-1 in case of infinite number of
10442 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10444 # Example: see GEOM_TestMeasures.py
10445 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10446 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10449 ## Get angle between the given shapes in degrees.
10450 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10451 # @note If both arguments are vectors, the angle is computed in accordance
10452 # with their orientations, otherwise the minimum angle is computed.
10453 # @return Value of the angle between the given shapes in degrees.
10455 # @ref tui_angle_page "Example"
10456 @ManageTransactions("MeasuOp")
10457 def GetAngle(self, theShape1, theShape2):
10459 Get angle between the given shapes in degrees.
10462 theShape1,theShape2 Lines or linear edges to find angle between.
10465 If both arguments are vectors, the angle is computed in accordance
10466 with their orientations, otherwise the minimum angle is computed.
10469 Value of the angle between the given shapes in degrees.
10471 # Example: see GEOM_TestMeasures.py
10472 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10473 RaiseIfFailed("GetAngle", self.MeasuOp)
10476 ## Get angle between the given shapes in radians.
10477 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10478 # @note If both arguments are vectors, the angle is computed in accordance
10479 # with their orientations, otherwise the minimum angle is computed.
10480 # @return Value of the angle between the given shapes in radians.
10482 # @ref tui_angle_page "Example"
10483 @ManageTransactions("MeasuOp")
10484 def GetAngleRadians(self, theShape1, theShape2):
10486 Get angle between the given shapes in radians.
10489 theShape1,theShape2 Lines or linear edges to find angle between.
10493 If both arguments are vectors, the angle is computed in accordance
10494 with their orientations, otherwise the minimum angle is computed.
10497 Value of the angle between the given shapes in radians.
10499 # Example: see GEOM_TestMeasures.py
10500 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10501 RaiseIfFailed("GetAngle", self.MeasuOp)
10504 ## Get angle between the given vectors in degrees.
10505 # @param theShape1,theShape2 Vectors to find angle between.
10506 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10507 # if False, the opposite vector to the normal vector is used.
10508 # @return Value of the angle between the given vectors in degrees.
10510 # @ref tui_angle_page "Example"
10511 @ManageTransactions("MeasuOp")
10512 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10514 Get angle between the given vectors in degrees.
10517 theShape1,theShape2 Vectors to find angle between.
10518 theFlag If True, the normal vector is defined by the two vectors cross,
10519 if False, the opposite vector to the normal vector is used.
10522 Value of the angle between the given vectors in degrees.
10524 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10526 anAngle = 360. - anAngle
10527 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10530 ## The same as GetAngleVectors, but the result is in radians.
10531 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10533 Get angle between the given vectors in radians.
10536 theShape1,theShape2 Vectors to find angle between.
10537 theFlag If True, the normal vector is defined by the two vectors cross,
10538 if False, the opposite vector to the normal vector is used.
10541 Value of the angle between the given vectors in radians.
10543 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10546 ## @name Curve Curvature Measurement
10547 # Methods for receiving radius of curvature of curves
10548 # in the given point
10551 ## Measure curvature of a curve at a point, set by parameter.
10552 # @param theCurve a curve.
10553 # @param theParam parameter.
10554 # @return radius of curvature of \a theCurve.
10556 # @ref swig_todo "Example"
10557 @ManageTransactions("MeasuOp")
10558 def CurveCurvatureByParam(self, theCurve, theParam):
10560 Measure curvature of a curve at a point, set by parameter.
10564 theParam parameter.
10567 radius of curvature of theCurve.
10569 # Example: see GEOM_TestMeasures.py
10570 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10571 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10574 ## Measure curvature of a curve at a point.
10575 # @param theCurve a curve.
10576 # @param thePoint given point.
10577 # @return radius of curvature of \a theCurve.
10579 # @ref swig_todo "Example"
10580 @ManageTransactions("MeasuOp")
10581 def CurveCurvatureByPoint(self, theCurve, thePoint):
10583 Measure curvature of a curve at a point.
10587 thePoint given point.
10590 radius of curvature of theCurve.
10592 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10593 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10597 ## @name Surface Curvature Measurement
10598 # Methods for receiving max and min radius of curvature of surfaces
10599 # in the given point
10602 ## Measure max radius of curvature of surface.
10603 # @param theSurf the given surface.
10604 # @param theUParam Value of U-parameter on the referenced surface.
10605 # @param theVParam Value of V-parameter on the referenced surface.
10606 # @return max radius of curvature of theSurf.
10608 ## @ref swig_todo "Example"
10609 @ManageTransactions("MeasuOp")
10610 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10612 Measure max radius of curvature of surface.
10615 theSurf the given surface.
10616 theUParam Value of U-parameter on the referenced surface.
10617 theVParam Value of V-parameter on the referenced surface.
10620 max radius of curvature of theSurf.
10622 # Example: see GEOM_TestMeasures.py
10623 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10624 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10627 ## Measure max radius of curvature of surface in the given point
10628 # @param theSurf the given surface.
10629 # @param thePoint given point.
10630 # @return max radius of curvature of theSurf.
10632 ## @ref swig_todo "Example"
10633 @ManageTransactions("MeasuOp")
10634 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10636 Measure max radius of curvature of surface in the given point.
10639 theSurf the given surface.
10640 thePoint given point.
10643 max radius of curvature of theSurf.
10645 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10646 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10649 ## Measure min radius of curvature of surface.
10650 # @param theSurf the given surface.
10651 # @param theUParam Value of U-parameter on the referenced surface.
10652 # @param theVParam Value of V-parameter on the referenced surface.
10653 # @return min radius of curvature of theSurf.
10655 ## @ref swig_todo "Example"
10656 @ManageTransactions("MeasuOp")
10657 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10659 Measure min radius of curvature of surface.
10662 theSurf the given surface.
10663 theUParam Value of U-parameter on the referenced surface.
10664 theVParam Value of V-parameter on the referenced surface.
10667 Min radius of curvature of theSurf.
10669 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10670 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10673 ## Measure min radius of curvature of surface in the given point
10674 # @param theSurf the given surface.
10675 # @param thePoint given point.
10676 # @return min radius of curvature of theSurf.
10678 ## @ref swig_todo "Example"
10679 @ManageTransactions("MeasuOp")
10680 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10682 Measure min radius of curvature of surface in the given point.
10685 theSurf the given surface.
10686 thePoint given point.
10689 Min radius of curvature of theSurf.
10691 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10692 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10696 ## Get min and max tolerances of sub-shapes of theShape
10697 # @param theShape Shape, to get tolerances of.
10698 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10699 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10700 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10701 # VertMin,VertMax: Min and max tolerances of the vertices.
10703 # @ref tui_tolerance_page "Example"
10704 @ManageTransactions("MeasuOp")
10705 def Tolerance(self,theShape):
10707 Get min and max tolerances of sub-shapes of theShape
10710 theShape Shape, to get tolerances of.
10713 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10714 FaceMin,FaceMax: Min and max tolerances of the faces.
10715 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10716 VertMin,VertMax: Min and max tolerances of the vertices.
10718 # Example: see GEOM_TestMeasures.py
10719 aTuple = self.MeasuOp.GetTolerance(theShape)
10720 RaiseIfFailed("GetTolerance", self.MeasuOp)
10723 ## Obtain description of the given shape (number of sub-shapes of each type)
10724 # @param theShape Shape to be described.
10725 # @return Description of the given shape.
10727 # @ref tui_whatis_page "Example"
10728 @ManageTransactions("MeasuOp")
10729 def WhatIs(self,theShape):
10731 Obtain description of the given shape (number of sub-shapes of each type)
10734 theShape Shape to be described.
10737 Description of the given shape.
10739 # Example: see GEOM_TestMeasures.py
10740 aDescr = self.MeasuOp.WhatIs(theShape)
10741 RaiseIfFailed("WhatIs", self.MeasuOp)
10744 ## Obtain quantity of shapes of the given type in \a theShape.
10745 # If \a theShape is of type \a theType, it is also counted.
10746 # @param theShape Shape to be described.
10747 # @param theType the given ShapeType().
10748 # @return Quantity of shapes of type \a theType in \a theShape.
10750 # @ref tui_measurement_tools_page "Example"
10751 def NbShapes (self, theShape, theType):
10753 Obtain quantity of shapes of the given type in theShape.
10754 If theShape is of type theType, it is also counted.
10757 theShape Shape to be described.
10758 theType the given geompy.ShapeType
10761 Quantity of shapes of type theType in theShape.
10763 # Example: see GEOM_TestMeasures.py
10764 listSh = self.SubShapeAllIDs(theShape, theType)
10768 ## Obtain quantity of shapes of each type in \a theShape.
10769 # The \a theShape is also counted.
10770 # @param theShape Shape to be described.
10771 # @return Dictionary of ShapeType() with bound quantities of shapes.
10773 # @ref tui_measurement_tools_page "Example"
10774 def ShapeInfo (self, theShape):
10776 Obtain quantity of shapes of each type in theShape.
10777 The theShape is also counted.
10780 theShape Shape to be described.
10783 Dictionary of geompy.ShapeType with bound quantities of shapes.
10785 # Example: see GEOM_TestMeasures.py
10787 for typeSh in self.ShapeType:
10788 if typeSh in ( "AUTO", "SHAPE" ): continue
10789 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10795 def GetCreationInformation(self, theShape):
10796 info = theShape.GetCreationInformation()
10798 opName = info.operationName
10799 if not opName: opName = "no info available"
10800 res = "Operation: " + opName
10802 for parVal in info.params:
10803 res += " \n %s = %s" % ( parVal.name, parVal.value )
10806 ## Get a point, situated at the centre of mass of theShape.
10807 # @param theShape Shape to define centre of mass of.
10808 # @param theName Object name; when specified, this parameter is used
10809 # for result publication in the study. Otherwise, if automatic
10810 # publication is switched on, default value is used for result name.
10812 # @return New GEOM.GEOM_Object, containing the created point.
10814 # @ref tui_center_of_mass_page "Example"
10815 @ManageTransactions("MeasuOp")
10816 def MakeCDG(self, theShape, theName=None):
10818 Get a point, situated at the centre of mass of theShape.
10821 theShape Shape to define centre of mass of.
10822 theName Object name; when specified, this parameter is used
10823 for result publication in the study. Otherwise, if automatic
10824 publication is switched on, default value is used for result name.
10827 New GEOM.GEOM_Object, containing the created point.
10829 # Example: see GEOM_TestMeasures.py
10830 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10831 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10832 self._autoPublish(anObj, theName, "centerOfMass")
10835 ## Get a vertex sub-shape by index depended with orientation.
10836 # @param theShape Shape to find sub-shape.
10837 # @param theIndex Index to find vertex by this index (starting from zero)
10838 # @param theName Object name; when specified, this parameter is used
10839 # for result publication in the study. Otherwise, if automatic
10840 # publication is switched on, default value is used for result name.
10842 # @return New GEOM.GEOM_Object, containing the created vertex.
10844 # @ref tui_measurement_tools_page "Example"
10845 @ManageTransactions("MeasuOp")
10846 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10848 Get a vertex sub-shape by index depended with orientation.
10851 theShape Shape to find sub-shape.
10852 theIndex Index to find vertex by this index (starting from zero)
10853 theName Object name; when specified, this parameter is used
10854 for result publication in the study. Otherwise, if automatic
10855 publication is switched on, default value is used for result name.
10858 New GEOM.GEOM_Object, containing the created vertex.
10860 # Example: see GEOM_TestMeasures.py
10861 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10862 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10863 self._autoPublish(anObj, theName, "vertex")
10866 ## Get the first vertex of wire/edge depended orientation.
10867 # @param theShape Shape to find first vertex.
10868 # @param theName Object name; when specified, this parameter is used
10869 # for result publication in the study. Otherwise, if automatic
10870 # publication is switched on, default value is used for result name.
10872 # @return New GEOM.GEOM_Object, containing the created vertex.
10874 # @ref tui_measurement_tools_page "Example"
10875 def GetFirstVertex(self, theShape, theName=None):
10877 Get the first vertex of wire/edge depended orientation.
10880 theShape Shape to find first vertex.
10881 theName Object name; when specified, this parameter is used
10882 for result publication in the study. Otherwise, if automatic
10883 publication is switched on, default value is used for result name.
10886 New GEOM.GEOM_Object, containing the created vertex.
10888 # Example: see GEOM_TestMeasures.py
10889 # note: auto-publishing is done in self.GetVertexByIndex()
10890 return self.GetVertexByIndex(theShape, 0, theName)
10892 ## Get the last vertex of wire/edge depended orientation.
10893 # @param theShape Shape to find last vertex.
10894 # @param theName Object name; when specified, this parameter is used
10895 # for result publication in the study. Otherwise, if automatic
10896 # publication is switched on, default value is used for result name.
10898 # @return New GEOM.GEOM_Object, containing the created vertex.
10900 # @ref tui_measurement_tools_page "Example"
10901 def GetLastVertex(self, theShape, theName=None):
10903 Get the last vertex of wire/edge depended orientation.
10906 theShape Shape to find last vertex.
10907 theName Object name; when specified, this parameter is used
10908 for result publication in the study. Otherwise, if automatic
10909 publication is switched on, default value is used for result name.
10912 New GEOM.GEOM_Object, containing the created vertex.
10914 # Example: see GEOM_TestMeasures.py
10915 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10916 # note: auto-publishing is done in self.GetVertexByIndex()
10917 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10919 ## Get a normale to the given face. If the point is not given,
10920 # the normale is calculated at the center of mass.
10921 # @param theFace Face to define normale of.
10922 # @param theOptionalPoint Point to compute the normale at.
10923 # @param theName Object name; when specified, this parameter is used
10924 # for result publication in the study. Otherwise, if automatic
10925 # publication is switched on, default value is used for result name.
10927 # @return New GEOM.GEOM_Object, containing the created vector.
10929 # @ref swig_todo "Example"
10930 @ManageTransactions("MeasuOp")
10931 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10933 Get a normale to the given face. If the point is not given,
10934 the normale is calculated at the center of mass.
10937 theFace Face to define normale of.
10938 theOptionalPoint Point to compute the normale at.
10939 theName Object name; when specified, this parameter is used
10940 for result publication in the study. Otherwise, if automatic
10941 publication is switched on, default value is used for result name.
10944 New GEOM.GEOM_Object, containing the created vector.
10946 # Example: see GEOM_TestMeasures.py
10947 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10948 RaiseIfFailed("GetNormal", self.MeasuOp)
10949 self._autoPublish(anObj, theName, "normal")
10952 ## Print shape errors obtained from CheckShape.
10953 # @param theShape Shape that was checked.
10954 # @param theShapeErrors the shape errors obtained by CheckShape.
10955 # @param theReturnStatus If 0 the description of problem is printed.
10956 # If 1 the description of problem is returned.
10957 # @return If theReturnStatus is equal to 1 the description is returned.
10958 # Otherwise doesn't return anything.
10960 # @ref tui_check_shape_page "Example"
10961 @ManageTransactions("MeasuOp")
10962 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10964 Print shape errors obtained from CheckShape.
10967 theShape Shape that was checked.
10968 theShapeErrors the shape errors obtained by CheckShape.
10969 theReturnStatus If 0 the description of problem is printed.
10970 If 1 the description of problem is returned.
10973 If theReturnStatus is equal to 1 the description is returned.
10974 Otherwise doesn't return anything.
10976 # Example: see GEOM_TestMeasures.py
10977 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10978 if theReturnStatus == 1:
10983 ## Check a topology of the given shape.
10984 # @param theShape Shape to check validity of.
10985 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10986 # if TRUE, the shape's geometry will be checked also.
10987 # @param theReturnStatus If 0 and if theShape is invalid, a description
10988 # of problem is printed.
10989 # If 1 isValid flag and the description of
10990 # problem is returned.
10991 # If 2 isValid flag and the list of error data
10993 # @return TRUE, if the shape "seems to be valid".
10994 # If theShape is invalid, prints a description of problem.
10995 # If theReturnStatus is equal to 1 the description is returned
10996 # along with IsValid flag.
10997 # If theReturnStatus is equal to 2 the list of error data is
10998 # returned along with IsValid flag.
11000 # @ref tui_check_shape_page "Example"
11001 @ManageTransactions("MeasuOp")
11002 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11004 Check a topology of the given shape.
11007 theShape Shape to check validity of.
11008 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11009 if TRUE, the shape's geometry will be checked also.
11010 theReturnStatus If 0 and if theShape is invalid, a description
11011 of problem is printed.
11012 If 1 IsValid flag and the description of
11013 problem is returned.
11014 If 2 IsValid flag and the list of error data
11018 TRUE, if the shape "seems to be valid".
11019 If theShape is invalid, prints a description of problem.
11020 If theReturnStatus is equal to 1 the description is returned
11021 along with IsValid flag.
11022 If theReturnStatus is equal to 2 the list of error data is
11023 returned along with IsValid flag.
11025 # Example: see GEOM_TestMeasures.py
11027 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11028 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11030 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11031 RaiseIfFailed("CheckShape", self.MeasuOp)
11033 if theReturnStatus == 0:
11034 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11036 if theReturnStatus == 1:
11037 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11038 return (IsValid, Descr)
11039 elif theReturnStatus == 2:
11040 return (IsValid, ShapeErrors)
11043 ## Detect self-intersections in the given shape.
11044 # @param theShape Shape to check.
11045 # @param theCheckLevel is the level of self-intersection check.
11046 # Possible input values are:
11047 # - GEOM.SI_V_V(0) - only V/V interferences
11048 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11049 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11050 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11051 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11052 # - GEOM.SI_ALL(5) - all interferences.
11053 # @return TRUE, if the shape contains no self-intersections.
11055 # @ref tui_check_self_intersections_page "Example"
11056 @ManageTransactions("MeasuOp")
11057 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11059 Detect self-intersections in the given shape.
11062 theShape Shape to check.
11063 theCheckLevel is the level of self-intersection check.
11064 Possible input values are:
11065 - GEOM.SI_V_V(0) - only V/V interferences
11066 - GEOM.SI_V_E(1) - V/V and V/E interferences
11067 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11068 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11069 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11070 - GEOM.SI_ALL(5) - all interferences.
11073 TRUE, if the shape contains no self-intersections.
11075 # Example: see GEOM_TestMeasures.py
11076 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11077 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11080 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11081 # @param theShape1 First source object
11082 # @param theShape2 Second source object
11083 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11084 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11085 # - if \a theTolerance > 0, algorithm detects gaps
11086 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
11087 # - if \a theDeflection <= 0, default deflection 0.001 is used
11088 # @return TRUE, if there are intersections (gaps) between source shapes
11089 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11090 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11092 # @ref tui_fast_intersection_page "Example"
11093 @ManageTransactions("MeasuOp")
11094 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11096 Detect intersections of the given shapes with algorithm based on mesh intersections.
11099 theShape1 First source object
11100 theShape2 Second source object
11101 theTolerance Specifies a distance between shapes used for detecting gaps:
11102 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11103 - if theTolerance > 0, algorithm detects gaps
11104 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11105 - if theDeflection <= 0, default deflection 0.001 is used
11108 TRUE, if there are intersections (gaps) between source shapes
11109 List of sub-shapes IDs from 1st shape that localize intersection.
11110 List of sub-shapes IDs from 2nd shape that localize intersection.
11112 # Example: see GEOM_TestMeasures.py
11113 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11114 RaiseIfFailed("FastIntersect", self.MeasuOp)
11115 return IsOk, Res1, Res2
11117 ## Get position (LCS) of theShape.
11119 # Origin of the LCS is situated at the shape's center of mass.
11120 # Axes of the LCS are obtained from shape's location or,
11121 # if the shape is a planar face, from position of its plane.
11123 # @param theShape Shape to calculate position of.
11124 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11125 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11126 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11127 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11129 # @ref swig_todo "Example"
11130 @ManageTransactions("MeasuOp")
11131 def GetPosition(self,theShape):
11133 Get position (LCS) of theShape.
11134 Origin of the LCS is situated at the shape's center of mass.
11135 Axes of the LCS are obtained from shape's location or,
11136 if the shape is a planar face, from position of its plane.
11139 theShape Shape to calculate position of.
11142 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11143 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11144 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11145 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11147 # Example: see GEOM_TestMeasures.py
11148 aTuple = self.MeasuOp.GetPosition(theShape)
11149 RaiseIfFailed("GetPosition", self.MeasuOp)
11152 ## Get kind of theShape.
11154 # @param theShape Shape to get a kind of.
11155 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11156 # and a list of parameters, describing the shape.
11157 # @note Concrete meaning of each value, returned via \a theIntegers
11158 # or \a theDoubles list depends on the kind() of the shape.
11160 # @ref swig_todo "Example"
11161 @ManageTransactions("MeasuOp")
11162 def KindOfShape(self,theShape):
11164 Get kind of theShape.
11167 theShape Shape to get a kind of.
11170 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11171 and a list of parameters, describing the shape.
11173 Concrete meaning of each value, returned via theIntegers
11174 or theDoubles list depends on the geompy.kind of the shape
11176 # Example: see GEOM_TestMeasures.py
11177 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11178 RaiseIfFailed("KindOfShape", self.MeasuOp)
11180 aKind = aRoughTuple[0]
11181 anInts = aRoughTuple[1]
11182 aDbls = aRoughTuple[2]
11184 # Now there is no exception from this rule:
11185 aKindTuple = [aKind] + aDbls + anInts
11187 # If they are we will regroup parameters for such kind of shape.
11189 #if aKind == kind.SOME_KIND:
11190 # # SOME_KIND int int double int double double
11191 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11195 ## Returns the string that describes if the shell is good for solid.
11196 # This is a support method for MakeSolid.
11198 # @param theShell the shell to be checked.
11199 # @return Returns a string that describes the shell validity for
11200 # solid construction.
11201 @ManageTransactions("MeasuOp")
11202 def _IsGoodForSolid(self, theShell):
11204 Returns the string that describes if the shell is good for solid.
11205 This is a support method for MakeSolid.
11208 theShell the shell to be checked.
11211 Returns a string that describes the shell validity for
11212 solid construction.
11214 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11217 # end of l2_measure
11220 ## @addtogroup l2_import_export
11223 ## Import a shape from the BREP, IGES, STEP or other file
11224 # (depends on given format) with given name.
11226 # Note: this function is deprecated, it is kept for backward compatibility only
11227 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11229 # @param theFileName The file, containing the shape.
11230 # @param theFormatName Specify format for the file reading.
11231 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11232 # If format 'IGES_SCALE' is used instead of 'IGES' or
11233 # format 'STEP_SCALE' is used instead of 'STEP',
11234 # length unit will be set to 'meter' and result model will be scaled.
11235 # @param theName Object name; when specified, this parameter is used
11236 # for result publication in the study. Otherwise, if automatic
11237 # publication is switched on, default value is used for result name.
11239 # @return New GEOM.GEOM_Object, containing the imported shape.
11240 # If material names are imported it returns the list of
11241 # objects. The first one is the imported object followed by
11243 # @note Auto publishing is allowed for the shape itself. Imported
11244 # material groups are not automatically published.
11246 # @ref swig_Import_Export "Example"
11247 @ManageTransactions("InsertOp")
11248 def ImportFile(self, theFileName, theFormatName, theName=None):
11250 Import a shape from the BREP, IGES, STEP or other file
11251 (depends on given format) with given name.
11253 Note: this function is deprecated, it is kept for backward compatibility only
11254 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11257 theFileName The file, containing the shape.
11258 theFormatName Specify format for the file reading.
11259 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11260 If format 'IGES_SCALE' is used instead of 'IGES' or
11261 format 'STEP_SCALE' is used instead of 'STEP',
11262 length unit will be set to 'meter' and result model will be scaled.
11263 theName Object name; when specified, this parameter is used
11264 for result publication in the study. Otherwise, if automatic
11265 publication is switched on, default value is used for result name.
11268 New GEOM.GEOM_Object, containing the imported shape.
11269 If material names are imported it returns the list of
11270 objects. The first one is the imported object followed by
11273 Auto publishing is allowed for the shape itself. Imported
11274 material groups are not automatically published.
11276 # Example: see GEOM_TestOthers.py
11278 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11279 where <FormatName> is a name of desirable format for importing.
11281 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11282 RaiseIfFailed("ImportFile", self.InsertOp)
11283 aNbObj = len(aListObj)
11285 self._autoPublish(aListObj[0], theName, "imported")
11290 ## Deprecated analog of ImportFile()
11291 def Import(self, theFileName, theFormatName, theName=None):
11293 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11295 # note: auto-publishing is done in self.ImportFile()
11296 return self.ImportFile(theFileName, theFormatName, theName)
11298 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11299 # @note This method will not be dumped to the python script by DumpStudy functionality.
11300 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
11301 # @param theStream The BRep binary stream.
11302 # @param theName Object name; when specified, this parameter is used
11303 # for result publication in the study. Otherwise, if automatic
11304 # publication is switched on, default value is used for result name.
11306 # @return New GEOM_Object, containing the shape, read from theStream.
11308 # @ref swig_Import_Export "Example"
11309 @ManageTransactions("InsertOp")
11310 def RestoreShape (self, theStream, theName=None):
11312 Read a shape from the binary stream, containing its bounding representation (BRep).
11315 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11318 theStream The BRep binary stream.
11319 theName Object name; when specified, this parameter is used
11320 for result publication in the study. Otherwise, if automatic
11321 publication is switched on, default value is used for result name.
11324 New GEOM_Object, containing the shape, read from theStream.
11326 # Example: see GEOM_TestOthers.py
11327 anObj = self.InsertOp.RestoreShape(theStream)
11328 RaiseIfFailed("RestoreShape", self.InsertOp)
11329 self._autoPublish(anObj, theName, "restored")
11332 ## Export the given shape into a file with given name.
11334 # Note: this function is deprecated, it is kept for backward compatibility only
11335 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11337 # @param theObject Shape to be stored in the file.
11338 # @param theFileName Name of the file to store the given shape in.
11339 # @param theFormatName Specify format for the shape storage.
11340 # Available formats can be obtained with
11341 # geompy.InsertOp.ExportTranslators()[0] method.
11343 # @ref swig_Import_Export "Example"
11344 @ManageTransactions("InsertOp")
11345 def Export(self, theObject, theFileName, theFormatName):
11347 Export the given shape into a file with given name.
11349 Note: this function is deprecated, it is kept for backward compatibility only
11350 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11353 theObject Shape to be stored in the file.
11354 theFileName Name of the file to store the given shape in.
11355 theFormatName Specify format for the shape storage.
11356 Available formats can be obtained with
11357 geompy.InsertOp.ExportTranslators()[0] method.
11359 # Example: see GEOM_TestOthers.py
11361 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11362 where <FormatName> is a name of desirable format for exporting.
11364 self.InsertOp.Export(theObject, theFileName, theFormatName)
11365 if self.InsertOp.IsDone() == 0:
11366 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
11370 # end of l2_import_export
11373 ## @addtogroup l3_blocks
11376 ## Create a quadrangle face from four edges. Order of Edges is not
11377 # important. It is not necessary that edges share the same vertex.
11378 # @param E1,E2,E3,E4 Edges for the face bound.
11379 # @param theName Object name; when specified, this parameter is used
11380 # for result publication in the study. Otherwise, if automatic
11381 # publication is switched on, default value is used for result name.
11383 # @return New GEOM.GEOM_Object, containing the created face.
11385 # @ref tui_building_by_blocks_page "Example"
11386 @ManageTransactions("BlocksOp")
11387 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11389 Create a quadrangle face from four edges. Order of Edges is not
11390 important. It is not necessary that edges share the same vertex.
11393 E1,E2,E3,E4 Edges for the face bound.
11394 theName Object name; when specified, this parameter is used
11395 for result publication in the study. Otherwise, if automatic
11396 publication is switched on, default value is used for result name.
11399 New GEOM.GEOM_Object, containing the created face.
11402 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11404 # Example: see GEOM_Spanner.py
11405 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11406 RaiseIfFailed("MakeQuad", self.BlocksOp)
11407 self._autoPublish(anObj, theName, "quad")
11410 ## Create a quadrangle face on two edges.
11411 # The missing edges will be built by creating the shortest ones.
11412 # @param E1,E2 Two opposite edges for the face.
11413 # @param theName Object name; when specified, this parameter is used
11414 # for result publication in the study. Otherwise, if automatic
11415 # publication is switched on, default value is used for result name.
11417 # @return New GEOM.GEOM_Object, containing the created face.
11419 # @ref tui_building_by_blocks_page "Example"
11420 @ManageTransactions("BlocksOp")
11421 def MakeQuad2Edges(self, E1, E2, theName=None):
11423 Create a quadrangle face on two edges.
11424 The missing edges will be built by creating the shortest ones.
11427 E1,E2 Two opposite edges for the face.
11428 theName Object name; when specified, this parameter is used
11429 for result publication in the study. Otherwise, if automatic
11430 publication is switched on, default value is used for result name.
11433 New GEOM.GEOM_Object, containing the created face.
11437 p1 = geompy.MakeVertex( 0., 0., 0.)
11438 p2 = geompy.MakeVertex(150., 30., 0.)
11439 p3 = geompy.MakeVertex( 0., 120., 50.)
11440 p4 = geompy.MakeVertex( 0., 40., 70.)
11442 edge1 = geompy.MakeEdge(p1, p2)
11443 edge2 = geompy.MakeEdge(p3, p4)
11444 # create a quadrangle face from two edges
11445 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11447 # Example: see GEOM_Spanner.py
11448 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11449 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11450 self._autoPublish(anObj, theName, "quad")
11453 ## Create a quadrangle face with specified corners.
11454 # The missing edges will be built by creating the shortest ones.
11455 # @param V1,V2,V3,V4 Corner vertices for the face.
11456 # @param theName Object name; when specified, this parameter is used
11457 # for result publication in the study. Otherwise, if automatic
11458 # publication is switched on, default value is used for result name.
11460 # @return New GEOM.GEOM_Object, containing the created face.
11462 # @ref tui_building_by_blocks_page "Example 1"
11463 # \n @ref swig_MakeQuad4Vertices "Example 2"
11464 @ManageTransactions("BlocksOp")
11465 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11467 Create a quadrangle face with specified corners.
11468 The missing edges will be built by creating the shortest ones.
11471 V1,V2,V3,V4 Corner vertices for the face.
11472 theName Object name; when specified, this parameter is used
11473 for result publication in the study. Otherwise, if automatic
11474 publication is switched on, default value is used for result name.
11477 New GEOM.GEOM_Object, containing the created face.
11481 p1 = geompy.MakeVertex( 0., 0., 0.)
11482 p2 = geompy.MakeVertex(150., 30., 0.)
11483 p3 = geompy.MakeVertex( 0., 120., 50.)
11484 p4 = geompy.MakeVertex( 0., 40., 70.)
11485 # create a quadrangle from four points in its corners
11486 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11488 # Example: see GEOM_Spanner.py
11489 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11490 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11491 self._autoPublish(anObj, theName, "quad")
11494 ## Create a hexahedral solid, bounded by the six given faces. Order of
11495 # faces is not important. It is not necessary that Faces share the same edge.
11496 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11497 # @param theName Object name; when specified, this parameter is used
11498 # for result publication in the study. Otherwise, if automatic
11499 # publication is switched on, default value is used for result name.
11501 # @return New GEOM.GEOM_Object, containing the created solid.
11503 # @ref tui_building_by_blocks_page "Example 1"
11504 # \n @ref swig_MakeHexa "Example 2"
11505 @ManageTransactions("BlocksOp")
11506 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11508 Create a hexahedral solid, bounded by the six given faces. Order of
11509 faces is not important. It is not necessary that Faces share the same edge.
11512 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11513 theName Object name; when specified, this parameter is used
11514 for result publication in the study. Otherwise, if automatic
11515 publication is switched on, default value is used for result name.
11518 New GEOM.GEOM_Object, containing the created solid.
11521 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11523 # Example: see GEOM_Spanner.py
11524 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11525 RaiseIfFailed("MakeHexa", self.BlocksOp)
11526 self._autoPublish(anObj, theName, "hexa")
11529 ## Create a hexahedral solid between two given faces.
11530 # The missing faces will be built by creating the smallest ones.
11531 # @param F1,F2 Two opposite faces for the hexahedral solid.
11532 # @param theName Object name; when specified, this parameter is used
11533 # for result publication in the study. Otherwise, if automatic
11534 # publication is switched on, default value is used for result name.
11536 # @return New GEOM.GEOM_Object, containing the created solid.
11538 # @ref tui_building_by_blocks_page "Example 1"
11539 # \n @ref swig_MakeHexa2Faces "Example 2"
11540 @ManageTransactions("BlocksOp")
11541 def MakeHexa2Faces(self, F1, F2, theName=None):
11543 Create a hexahedral solid between two given faces.
11544 The missing faces will be built by creating the smallest ones.
11547 F1,F2 Two opposite faces for the hexahedral solid.
11548 theName Object name; when specified, this parameter is used
11549 for result publication in the study. Otherwise, if automatic
11550 publication is switched on, default value is used for result name.
11553 New GEOM.GEOM_Object, containing the created solid.
11556 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11558 # Example: see GEOM_Spanner.py
11559 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11560 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11561 self._autoPublish(anObj, theName, "hexa")
11567 ## @addtogroup l3_blocks_op
11570 ## Get a vertex, found in the given shape by its coordinates.
11571 # @param theShape Block or a compound of blocks.
11572 # @param theX,theY,theZ Coordinates of the sought vertex.
11573 # @param theEpsilon Maximum allowed distance between the resulting
11574 # vertex and point with the given coordinates.
11575 # @param theName Object name; when specified, this parameter is used
11576 # for result publication in the study. Otherwise, if automatic
11577 # publication is switched on, default value is used for result name.
11579 # @return New GEOM.GEOM_Object, containing the found vertex.
11581 # @ref swig_GetPoint "Example"
11582 @ManageTransactions("BlocksOp")
11583 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11585 Get a vertex, found in the given shape by its coordinates.
11588 theShape Block or a compound of blocks.
11589 theX,theY,theZ Coordinates of the sought vertex.
11590 theEpsilon Maximum allowed distance between the resulting
11591 vertex and point with the given coordinates.
11592 theName Object name; when specified, this parameter is used
11593 for result publication in the study. Otherwise, if automatic
11594 publication is switched on, default value is used for result name.
11597 New GEOM.GEOM_Object, containing the found vertex.
11600 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11602 # Example: see GEOM_TestOthers.py
11603 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11604 RaiseIfFailed("GetPoint", self.BlocksOp)
11605 self._autoPublish(anObj, theName, "vertex")
11608 ## Find a vertex of the given shape, which has minimal distance to the given point.
11609 # @param theShape Any shape.
11610 # @param thePoint Point, close to the desired vertex.
11611 # @param theName Object name; when specified, this parameter is used
11612 # for result publication in the study. Otherwise, if automatic
11613 # publication is switched on, default value is used for result name.
11615 # @return New GEOM.GEOM_Object, containing the found vertex.
11617 # @ref swig_GetVertexNearPoint "Example"
11618 @ManageTransactions("BlocksOp")
11619 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11621 Find a vertex of the given shape, which has minimal distance to the given point.
11624 theShape Any shape.
11625 thePoint Point, close to the desired vertex.
11626 theName Object name; when specified, this parameter is used
11627 for result publication in the study. Otherwise, if automatic
11628 publication is switched on, default value is used for result name.
11631 New GEOM.GEOM_Object, containing the found vertex.
11634 pmidle = geompy.MakeVertex(50, 0, 50)
11635 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11637 # Example: see GEOM_TestOthers.py
11638 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11639 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11640 self._autoPublish(anObj, theName, "vertex")
11643 ## Get an edge, found in the given shape by two given vertices.
11644 # @param theShape Block or a compound of blocks.
11645 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11646 # @param theName Object name; when specified, this parameter is used
11647 # for result publication in the study. Otherwise, if automatic
11648 # publication is switched on, default value is used for result name.
11650 # @return New GEOM.GEOM_Object, containing the found edge.
11652 # @ref swig_GetEdge "Example"
11653 @ManageTransactions("BlocksOp")
11654 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11656 Get an edge, found in the given shape by two given vertices.
11659 theShape Block or a compound of blocks.
11660 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11661 theName Object name; when specified, this parameter is used
11662 for result publication in the study. Otherwise, if automatic
11663 publication is switched on, default value is used for result name.
11666 New GEOM.GEOM_Object, containing the found edge.
11668 # Example: see GEOM_Spanner.py
11669 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11670 RaiseIfFailed("GetEdge", self.BlocksOp)
11671 self._autoPublish(anObj, theName, "edge")
11674 ## Find an edge of the given shape, which has minimal distance to the given point.
11675 # @param theShape Block or a compound of blocks.
11676 # @param thePoint Point, close to the desired edge.
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 found edge.
11683 # @ref swig_GetEdgeNearPoint "Example"
11684 @ManageTransactions("BlocksOp")
11685 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11687 Find an edge of the given shape, which has minimal distance to the given point.
11690 theShape Block or a compound of blocks.
11691 thePoint Point, close to the desired edge.
11692 theName Object name; when specified, this parameter is used
11693 for result publication in the study. Otherwise, if automatic
11694 publication is switched on, default value is used for result name.
11697 New GEOM.GEOM_Object, containing the found edge.
11699 # Example: see GEOM_TestOthers.py
11700 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11701 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11702 self._autoPublish(anObj, theName, "edge")
11705 ## Returns a face, found in the given shape by four given corner vertices.
11706 # @param theShape Block or a compound of blocks.
11707 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11708 # @param theName Object name; when specified, this parameter is used
11709 # for result publication in the study. Otherwise, if automatic
11710 # publication is switched on, default value is used for result name.
11712 # @return New GEOM.GEOM_Object, containing the found face.
11714 # @ref swig_todo "Example"
11715 @ManageTransactions("BlocksOp")
11716 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11718 Returns a face, found in the given shape by four given corner vertices.
11721 theShape Block or a compound of blocks.
11722 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11723 theName Object name; when specified, this parameter is used
11724 for result publication in the study. Otherwise, if automatic
11725 publication is switched on, default value is used for result name.
11728 New GEOM.GEOM_Object, containing the found face.
11730 # Example: see GEOM_Spanner.py
11731 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11732 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11733 self._autoPublish(anObj, theName, "face")
11736 ## Get a face of block, found in the given shape by two given edges.
11737 # @param theShape Block or a compound of blocks.
11738 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11739 # @param theName Object name; when specified, this parameter is used
11740 # for result publication in the study. Otherwise, if automatic
11741 # publication is switched on, default value is used for result name.
11743 # @return New GEOM.GEOM_Object, containing the found face.
11745 # @ref swig_todo "Example"
11746 @ManageTransactions("BlocksOp")
11747 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11749 Get a face of block, found in the given shape by two given edges.
11752 theShape Block or a compound of blocks.
11753 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11754 theName Object name; when specified, this parameter is used
11755 for result publication in the study. Otherwise, if automatic
11756 publication is switched on, default value is used for result name.
11759 New GEOM.GEOM_Object, containing the found face.
11761 # Example: see GEOM_Spanner.py
11762 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11763 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11764 self._autoPublish(anObj, theName, "face")
11767 ## Find a face, opposite to the given one in the given block.
11768 # @param theBlock Must be a hexahedral solid.
11769 # @param theFace Face of \a theBlock, opposite to the desired face.
11770 # @param theName Object name; when specified, this parameter is used
11771 # for result publication in the study. Otherwise, if automatic
11772 # publication is switched on, default value is used for result name.
11774 # @return New GEOM.GEOM_Object, containing the found face.
11776 # @ref swig_GetOppositeFace "Example"
11777 @ManageTransactions("BlocksOp")
11778 def GetOppositeFace(self, theBlock, theFace, theName=None):
11780 Find a face, opposite to the given one in the given block.
11783 theBlock Must be a hexahedral solid.
11784 theFace Face of theBlock, opposite to the desired face.
11785 theName Object name; when specified, this parameter is used
11786 for result publication in the study. Otherwise, if automatic
11787 publication is switched on, default value is used for result name.
11790 New GEOM.GEOM_Object, containing the found face.
11792 # Example: see GEOM_Spanner.py
11793 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11794 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11795 self._autoPublish(anObj, theName, "face")
11798 ## Find a face of the given shape, which has minimal distance to the given point.
11799 # @param theShape Block or a compound of blocks.
11800 # @param thePoint Point, close to the desired face.
11801 # @param theName Object name; when specified, this parameter is used
11802 # for result publication in the study. Otherwise, if automatic
11803 # publication is switched on, default value is used for result name.
11805 # @return New GEOM.GEOM_Object, containing the found face.
11807 # @ref swig_GetFaceNearPoint "Example"
11808 @ManageTransactions("BlocksOp")
11809 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11811 Find a face of the given shape, which has minimal distance to the given point.
11814 theShape Block or a compound of blocks.
11815 thePoint Point, close to the desired face.
11816 theName Object name; when specified, this parameter is used
11817 for result publication in the study. Otherwise, if automatic
11818 publication is switched on, default value is used for result name.
11821 New GEOM.GEOM_Object, containing the found face.
11823 # Example: see GEOM_Spanner.py
11824 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11825 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11826 self._autoPublish(anObj, theName, "face")
11829 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11830 # @param theBlock Block or a compound of blocks.
11831 # @param theVector Vector, close to the normale of the desired face.
11832 # @param theName Object name; when specified, this parameter is used
11833 # for result publication in the study. Otherwise, if automatic
11834 # publication is switched on, default value is used for result name.
11836 # @return New GEOM.GEOM_Object, containing the found face.
11838 # @ref swig_todo "Example"
11839 @ManageTransactions("BlocksOp")
11840 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11842 Find a face of block, whose outside normale has minimal angle with the given vector.
11845 theBlock Block or a compound of blocks.
11846 theVector Vector, close to the normale of the desired face.
11847 theName Object name; when specified, this parameter is used
11848 for result publication in the study. Otherwise, if automatic
11849 publication is switched on, default value is used for result name.
11852 New GEOM.GEOM_Object, containing the found face.
11854 # Example: see GEOM_Spanner.py
11855 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11856 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11857 self._autoPublish(anObj, theName, "face")
11860 ## Find all sub-shapes of type \a theShapeType of the given shape,
11861 # which have minimal distance to the given point.
11862 # @param theShape Any shape.
11863 # @param thePoint Point, close to the desired shape.
11864 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11865 # @param theTolerance The tolerance for distances comparison. All shapes
11866 # with distances to the given point in interval
11867 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11868 # @param theName Object name; when specified, this parameter is used
11869 # for result publication in the study. Otherwise, if automatic
11870 # publication is switched on, default value is used for result name.
11872 # @return New GEOM_Object, containing a group of all found shapes.
11874 # @ref swig_GetShapesNearPoint "Example"
11875 @ManageTransactions("BlocksOp")
11876 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11878 Find all sub-shapes of type theShapeType of the given shape,
11879 which have minimal distance to the given point.
11882 theShape Any shape.
11883 thePoint Point, close to the desired shape.
11884 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11885 theTolerance The tolerance for distances comparison. All shapes
11886 with distances to the given point in interval
11887 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11888 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.
11893 New GEOM_Object, containing a group of all found shapes.
11895 # Example: see GEOM_TestOthers.py
11896 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11897 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11898 self._autoPublish(anObj, theName, "group")
11901 # end of l3_blocks_op
11904 ## @addtogroup l4_blocks_measure
11907 ## Check, if the compound of blocks is given.
11908 # To be considered as a compound of blocks, the
11909 # given shape must satisfy the following conditions:
11910 # - Each element of the compound should be a Block (6 faces).
11911 # - Each face should be a quadrangle, i.e. it should have only 1 wire
11912 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
11913 # there are more than 4 edges in the only wire of a face,
11914 # this face is considered to be quadrangle if it has 4 bounds
11915 # (1 or more edge) of C1 continuity.
11916 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11917 # - The compound should be connexe.
11918 # - The glue between two quadrangle faces should be applied.
11919 # @param theCompound The compound to check.
11920 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
11921 # taking into account C1 continuity.
11922 # @param theAngTolerance the angular tolerance to check if two neighbor
11923 # edges are codirectional in the common vertex with this
11924 # tolerance. This parameter is used only if
11925 # <VAR>theIsUseC1</VAR> is set to True.
11926 # @return TRUE, if the given shape is a compound of blocks.
11927 # If theCompound is not valid, prints all discovered errors.
11929 # @ref tui_check_compound_of_blocks_page "Example 1"
11930 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11931 @ManageTransactions("BlocksOp")
11932 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
11933 theAngTolerance = 1.e-12):
11935 Check, if the compound of blocks is given.
11936 To be considered as a compound of blocks, the
11937 given shape must satisfy the following conditions:
11938 - Each element of the compound should be a Block (6 faces).
11939 - Each face should be a quadrangle, i.e. it should have only 1 wire
11940 with 4 edges. If theIsUseC1 is set to True and
11941 there are more than 4 edges in the only wire of a face,
11942 this face is considered to be quadrangle if it has 4 bounds
11943 (1 or more edge) of C1 continuity.
11944 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11945 - The compound should be connexe.
11946 - The glue between two quadrangle faces should be applied.
11949 theCompound The compound to check.
11950 theIsUseC1 Flag to check if there are 4 bounds on a face
11951 taking into account C1 continuity.
11952 theAngTolerance the angular tolerance to check if two neighbor
11953 edges are codirectional in the common vertex with this
11954 tolerance. This parameter is used only if
11955 theIsUseC1 is set to True.
11958 TRUE, if the given shape is a compound of blocks.
11959 If theCompound is not valid, prints all discovered errors.
11961 # Example: see GEOM_Spanner.py
11964 aTolerance = theAngTolerance
11965 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
11966 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11968 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11972 ## Retrieve all non blocks solids and faces from \a theShape.
11973 # @param theShape The shape to explore.
11974 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
11975 # taking into account C1 continuity.
11976 # @param theAngTolerance the angular tolerance to check if two neighbor
11977 # edges are codirectional in the common vertex with this
11978 # tolerance. This parameter is used only if
11979 # <VAR>theIsUseC1</VAR> is set to True.
11980 # @param theName Object name; when specified, this parameter is used
11981 # for result publication in the study. Otherwise, if automatic
11982 # publication is switched on, default value is used for result name.
11984 # @return A tuple of two GEOM_Objects. The first object is a group of all
11985 # non block solids (= not 6 faces, or with 6 faces, but with the
11986 # presence of non-quadrangular faces). The second object is a
11987 # group of all non quadrangular faces (= faces with more then
11988 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
11989 # with 1 wire with not 4 edges that do not form 4 bounds of
11992 # @ref tui_get_non_blocks_page "Example 1"
11993 # \n @ref swig_GetNonBlocks "Example 2"
11994 @ManageTransactions("BlocksOp")
11995 def GetNonBlocks (self, theShape, theIsUseC1 = False,
11996 theAngTolerance = 1.e-12, theName=None):
11998 Retrieve all non blocks solids and faces from theShape.
12001 theShape The shape to explore.
12002 theIsUseC1 Flag to check if there are 4 bounds on a face
12003 taking into account C1 continuity.
12004 theAngTolerance the angular tolerance to check if two neighbor
12005 edges are codirectional in the common vertex with this
12006 tolerance. This parameter is used only if
12007 theIsUseC1 is set to True.
12008 theName Object name; when specified, this parameter is used
12009 for result publication in the study. Otherwise, if automatic
12010 publication is switched on, default value is used for result name.
12013 A tuple of two GEOM_Objects. The first object is a group of all
12014 non block solids (= not 6 faces, or with 6 faces, but with the
12015 presence of non-quadrangular faces). The second object is a
12016 group of all non quadrangular faces (= faces with more then
12017 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12018 with 1 wire with not 4 edges that do not form 4 bounds of
12022 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12024 # Example: see GEOM_Spanner.py
12027 aTolerance = theAngTolerance
12028 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12029 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12030 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12033 ## Remove all seam and degenerated edges from \a theShape.
12034 # Unite faces and edges, sharing one surface. It means that
12035 # this faces must have references to one C++ surface object (handle).
12036 # @param theShape The compound or single solid to remove irregular edges from.
12037 # @param doUnionFaces If True, then unite faces. If False (the default value),
12038 # do not unite faces.
12039 # @param theName Object name; when specified, this parameter is used
12040 # for result publication in the study. Otherwise, if automatic
12041 # publication is switched on, default value is used for result name.
12043 # @return Improved shape.
12045 # @ref swig_RemoveExtraEdges "Example"
12046 @ManageTransactions("BlocksOp")
12047 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12049 Remove all seam and degenerated edges from theShape.
12050 Unite faces and edges, sharing one surface. It means that
12051 this faces must have references to one C++ surface object (handle).
12054 theShape The compound or single solid to remove irregular edges from.
12055 doUnionFaces If True, then unite faces. If False (the default value),
12056 do not unite faces.
12057 theName Object name; when specified, this parameter is used
12058 for result publication in the study. Otherwise, if automatic
12059 publication is switched on, default value is used for result name.
12064 # Example: see GEOM_TestOthers.py
12065 nbFacesOptimum = -1 # -1 means do not unite faces
12066 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12067 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12068 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12069 self._autoPublish(anObj, theName, "removeExtraEdges")
12072 ## Performs union faces of \a theShape
12073 # Unite faces sharing one surface. It means that
12074 # these faces must have references to one C++ surface object (handle).
12075 # @param theShape The compound or single solid that contains faces
12076 # to perform union.
12077 # @param theName Object name; when specified, this parameter is used
12078 # for result publication in the study. Otherwise, if automatic
12079 # publication is switched on, default value is used for result name.
12081 # @return Improved shape.
12083 # @ref swig_UnionFaces "Example"
12084 @ManageTransactions("BlocksOp")
12085 def UnionFaces(self, theShape, theName=None):
12087 Performs union faces of theShape.
12088 Unite faces sharing one surface. It means that
12089 these faces must have references to one C++ surface object (handle).
12092 theShape The compound or single solid that contains faces
12094 theName Object name; when specified, this parameter is used
12095 for result publication in the study. Otherwise, if automatic
12096 publication is switched on, default value is used for result name.
12101 # Example: see GEOM_TestOthers.py
12102 anObj = self.BlocksOp.UnionFaces(theShape)
12103 RaiseIfFailed("UnionFaces", self.BlocksOp)
12104 self._autoPublish(anObj, theName, "unionFaces")
12107 ## Check, if the given shape is a blocks compound.
12108 # Fix all detected errors.
12109 # \note Single block can be also fixed by this method.
12110 # @param theShape The compound to check and improve.
12111 # @param theName Object name; when specified, this parameter is used
12112 # for result publication in the study. Otherwise, if automatic
12113 # publication is switched on, default value is used for result name.
12115 # @return Improved compound.
12117 # @ref swig_CheckAndImprove "Example"
12118 @ManageTransactions("BlocksOp")
12119 def CheckAndImprove(self, theShape, theName=None):
12121 Check, if the given shape is a blocks compound.
12122 Fix all detected errors.
12125 Single block can be also fixed by this method.
12128 theShape The compound to check and improve.
12129 theName Object name; when specified, this parameter is used
12130 for result publication in the study. Otherwise, if automatic
12131 publication is switched on, default value is used for result name.
12136 # Example: see GEOM_TestOthers.py
12137 anObj = self.BlocksOp.CheckAndImprove(theShape)
12138 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12139 self._autoPublish(anObj, theName, "improved")
12142 # end of l4_blocks_measure
12145 ## @addtogroup l3_blocks_op
12148 ## Get all the blocks, contained in the given compound.
12149 # @param theCompound The compound to explode.
12150 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12151 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12152 # @param theName Object name; when specified, this parameter is used
12153 # for result publication in the study. Otherwise, if automatic
12154 # publication is switched on, default value is used for result name.
12156 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12158 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12160 # @ref tui_explode_on_blocks "Example 1"
12161 # \n @ref swig_MakeBlockExplode "Example 2"
12162 @ManageTransactions("BlocksOp")
12163 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12165 Get all the blocks, contained in the given compound.
12168 theCompound The compound to explode.
12169 theMinNbFaces If solid has lower number of faces, it is not a block.
12170 theMaxNbFaces If solid has higher number of faces, it is not a block.
12171 theName Object name; when specified, this parameter is used
12172 for result publication in the study. Otherwise, if automatic
12173 publication is switched on, default value is used for result name.
12176 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12179 List of GEOM.GEOM_Object, containing the retrieved blocks.
12181 # Example: see GEOM_TestOthers.py
12182 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12183 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12184 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12185 for anObj in aList:
12186 anObj.SetParameters(Parameters)
12188 self._autoPublish(aList, theName, "block")
12191 ## Find block, containing the given point inside its volume or on boundary.
12192 # @param theCompound Compound, to find block in.
12193 # @param thePoint Point, close to the desired block. If the point lays on
12194 # boundary between some blocks, we return block with nearest center.
12195 # @param theName Object name; when specified, this parameter is used
12196 # for result publication in the study. Otherwise, if automatic
12197 # publication is switched on, default value is used for result name.
12199 # @return New GEOM.GEOM_Object, containing the found block.
12201 # @ref swig_todo "Example"
12202 @ManageTransactions("BlocksOp")
12203 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12205 Find block, containing the given point inside its volume or on boundary.
12208 theCompound Compound, to find block in.
12209 thePoint Point, close to the desired block. If the point lays on
12210 boundary between some blocks, we return block with nearest center.
12211 theName Object name; when specified, this parameter is used
12212 for result publication in the study. Otherwise, if automatic
12213 publication is switched on, default value is used for result name.
12216 New GEOM.GEOM_Object, containing the found block.
12218 # Example: see GEOM_Spanner.py
12219 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12220 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12221 self._autoPublish(anObj, theName, "block")
12224 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12225 # @param theCompound Compound, to find block in.
12226 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12227 # @param theName Object name; when specified, this parameter is used
12228 # for result publication in the study. Otherwise, if automatic
12229 # publication is switched on, default value is used for result name.
12231 # @return New GEOM.GEOM_Object, containing the found block.
12233 # @ref swig_GetBlockByParts "Example"
12234 @ManageTransactions("BlocksOp")
12235 def GetBlockByParts(self, theCompound, theParts, theName=None):
12237 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12240 theCompound Compound, to find block in.
12241 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12242 theName Object name; when specified, this parameter is used
12243 for result publication in the study. Otherwise, if automatic
12244 publication is switched on, default value is used for result name.
12247 New GEOM_Object, containing the found block.
12249 # Example: see GEOM_TestOthers.py
12250 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12251 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12252 self._autoPublish(anObj, theName, "block")
12255 ## Return all blocks, containing all the elements, passed as the parts.
12256 # @param theCompound Compound, to find blocks in.
12257 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12258 # @param theName Object name; when specified, this parameter is used
12259 # for result publication in the study. Otherwise, if automatic
12260 # publication is switched on, default value is used for result name.
12262 # @return List of GEOM.GEOM_Object, containing the found blocks.
12264 # @ref swig_todo "Example"
12265 @ManageTransactions("BlocksOp")
12266 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12268 Return all blocks, containing all the elements, passed as the parts.
12271 theCompound Compound, to find blocks in.
12272 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12273 theName Object name; when specified, this parameter is used
12274 for result publication in the study. Otherwise, if automatic
12275 publication is switched on, default value is used for result name.
12278 List of GEOM.GEOM_Object, containing the found blocks.
12280 # Example: see GEOM_Spanner.py
12281 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12282 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12283 self._autoPublish(aList, theName, "block")
12286 ## Multi-transformate block and glue the result.
12287 # Transformation is defined so, as to superpose direction faces.
12288 # @param Block Hexahedral solid to be multi-transformed.
12289 # @param DirFace1 ID of First direction face.
12290 # @param DirFace2 ID of Second direction face.
12291 # @param NbTimes Quantity of transformations to be done.
12292 # @param theName Object name; when specified, this parameter is used
12293 # for result publication in the study. Otherwise, if automatic
12294 # publication is switched on, default value is used for result name.
12296 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12298 # @return New GEOM.GEOM_Object, containing the result shape.
12300 # @ref tui_multi_transformation "Example"
12301 @ManageTransactions("BlocksOp")
12302 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12304 Multi-transformate block and glue the result.
12305 Transformation is defined so, as to superpose direction faces.
12308 Block Hexahedral solid to be multi-transformed.
12309 DirFace1 ID of First direction face.
12310 DirFace2 ID of Second direction face.
12311 NbTimes Quantity of transformations to be done.
12312 theName Object name; when specified, this parameter is used
12313 for result publication in the study. Otherwise, if automatic
12314 publication is switched on, default value is used for result name.
12317 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12320 New GEOM.GEOM_Object, containing the result shape.
12322 # Example: see GEOM_Spanner.py
12323 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12324 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12325 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12326 anObj.SetParameters(Parameters)
12327 self._autoPublish(anObj, theName, "transformed")
12330 ## Multi-transformate block and glue the result.
12331 # @param Block Hexahedral solid to be multi-transformed.
12332 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12333 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12334 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12335 # @param theName Object name; when specified, this parameter is used
12336 # for result publication in the study. Otherwise, if automatic
12337 # publication is switched on, default value is used for result name.
12339 # @return New GEOM.GEOM_Object, containing the result shape.
12341 # @ref tui_multi_transformation "Example"
12342 @ManageTransactions("BlocksOp")
12343 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12344 DirFace1V, DirFace2V, NbTimesV, theName=None):
12346 Multi-transformate block and glue the result.
12349 Block Hexahedral solid to be multi-transformed.
12350 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12351 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12352 NbTimesU,NbTimesV Quantity of transformations to be done.
12353 theName Object name; when specified, this parameter is used
12354 for result publication in the study. Otherwise, if automatic
12355 publication is switched on, default value is used for result name.
12358 New GEOM.GEOM_Object, containing the result shape.
12360 # Example: see GEOM_Spanner.py
12361 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12362 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12363 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12364 DirFace1V, DirFace2V, NbTimesV)
12365 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12366 anObj.SetParameters(Parameters)
12367 self._autoPublish(anObj, theName, "transformed")
12370 ## Build all possible propagation groups.
12371 # Propagation group is a set of all edges, opposite to one (main)
12372 # edge of this group directly or through other opposite edges.
12373 # Notion of Opposite Edge make sence only on quadrangle face.
12374 # @param theShape Shape to build propagation groups on.
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 List of GEOM.GEOM_Object, each of them is a propagation group.
12381 # @ref swig_Propagate "Example"
12382 @ManageTransactions("BlocksOp")
12383 def Propagate(self, theShape, theName=None):
12385 Build all possible propagation groups.
12386 Propagation group is a set of all edges, opposite to one (main)
12387 edge of this group directly or through other opposite edges.
12388 Notion of Opposite Edge make sence only on quadrangle face.
12391 theShape Shape to build propagation groups on.
12392 theName Object name; when specified, this parameter is used
12393 for result publication in the study. Otherwise, if automatic
12394 publication is switched on, default value is used for result name.
12397 List of GEOM.GEOM_Object, each of them is a propagation group.
12399 # Example: see GEOM_TestOthers.py
12400 listChains = self.BlocksOp.Propagate(theShape)
12401 RaiseIfFailed("Propagate", self.BlocksOp)
12402 self._autoPublish(listChains, theName, "propagate")
12405 # end of l3_blocks_op
12408 ## @addtogroup l3_groups
12411 ## Creates a new group which will store sub-shapes of theMainShape
12412 # @param theMainShape is a GEOM object on which the group is selected
12413 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12414 # @param theName Object name; when specified, this parameter is used
12415 # for result publication in the study. Otherwise, if automatic
12416 # publication is switched on, default value is used for result name.
12418 # @return a newly created GEOM group (GEOM.GEOM_Object)
12420 # @ref tui_working_with_groups_page "Example 1"
12421 # \n @ref swig_CreateGroup "Example 2"
12422 @ManageTransactions("GroupOp")
12423 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12425 Creates a new group which will store sub-shapes of theMainShape
12428 theMainShape is a GEOM object on which the group is selected
12429 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12430 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12431 theName Object name; when specified, this parameter is used
12432 for result publication in the study. Otherwise, if automatic
12433 publication is switched on, default value is used for result name.
12436 a newly created GEOM group
12439 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12442 # Example: see GEOM_TestOthers.py
12443 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12444 RaiseIfFailed("CreateGroup", self.GroupOp)
12445 self._autoPublish(anObj, theName, "group")
12448 ## Adds a sub-object with ID theSubShapeId to the group
12449 # @param theGroup is a GEOM group to which the new sub-shape is added
12450 # @param theSubShapeID is a sub-shape ID in the main object.
12451 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12453 # @ref tui_working_with_groups_page "Example"
12454 @ManageTransactions("GroupOp")
12455 def AddObject(self,theGroup, theSubShapeID):
12457 Adds a sub-object with ID theSubShapeId to the group
12460 theGroup is a GEOM group to which the new sub-shape is added
12461 theSubShapeID is a sub-shape ID in the main object.
12464 Use method GetSubShapeID() to get an unique ID of the sub-shape
12466 # Example: see GEOM_TestOthers.py
12467 self.GroupOp.AddObject(theGroup, theSubShapeID)
12468 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12469 RaiseIfFailed("AddObject", self.GroupOp)
12473 ## Removes a sub-object with ID \a theSubShapeId from the group
12474 # @param theGroup is a GEOM group from which the new sub-shape is removed
12475 # @param theSubShapeID is a sub-shape ID in the main object.
12476 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12478 # @ref tui_working_with_groups_page "Example"
12479 @ManageTransactions("GroupOp")
12480 def RemoveObject(self,theGroup, theSubShapeID):
12482 Removes a sub-object with ID theSubShapeId from the group
12485 theGroup is a GEOM group from which the new sub-shape is removed
12486 theSubShapeID is a sub-shape ID in the main object.
12489 Use method GetSubShapeID() to get an unique ID of the sub-shape
12491 # Example: see GEOM_TestOthers.py
12492 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12493 RaiseIfFailed("RemoveObject", self.GroupOp)
12496 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12497 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12498 # @param theSubShapes is a list of sub-shapes to be added.
12500 # @ref tui_working_with_groups_page "Example"
12501 @ManageTransactions("GroupOp")
12502 def UnionList (self,theGroup, theSubShapes):
12504 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12507 theGroup is a GEOM group to which the new sub-shapes are added.
12508 theSubShapes is a list of sub-shapes to be added.
12510 # Example: see GEOM_TestOthers.py
12511 self.GroupOp.UnionList(theGroup, theSubShapes)
12512 RaiseIfFailed("UnionList", self.GroupOp)
12515 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12516 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12517 # @param theSubShapes is a list of indices of sub-shapes to be added.
12519 # @ref swig_UnionIDs "Example"
12520 @ManageTransactions("GroupOp")
12521 def UnionIDs(self,theGroup, theSubShapes):
12523 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12526 theGroup is a GEOM group to which the new sub-shapes are added.
12527 theSubShapes is a list of indices of sub-shapes to be added.
12529 # Example: see GEOM_TestOthers.py
12530 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12531 RaiseIfFailed("UnionIDs", self.GroupOp)
12534 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12535 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12536 # @param theSubShapes is a list of sub-shapes to be removed.
12538 # @ref tui_working_with_groups_page "Example"
12539 @ManageTransactions("GroupOp")
12540 def DifferenceList (self,theGroup, theSubShapes):
12542 Removes from the group all the given shapes. No errors, if some shapes are not included.
12545 theGroup is a GEOM group from which the sub-shapes are removed.
12546 theSubShapes is a list of sub-shapes to be removed.
12548 # Example: see GEOM_TestOthers.py
12549 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12550 RaiseIfFailed("DifferenceList", self.GroupOp)
12553 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12554 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12555 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12557 # @ref swig_DifferenceIDs "Example"
12558 @ManageTransactions("GroupOp")
12559 def DifferenceIDs(self,theGroup, theSubShapes):
12561 Removes from the group all the given shapes. No errors, if some shapes are not included.
12564 theGroup is a GEOM group from which the sub-shapes are removed.
12565 theSubShapes is a list of indices of sub-shapes to be removed.
12567 # Example: see GEOM_TestOthers.py
12568 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12569 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12572 ## Union of two groups.
12573 # New group is created. It will contain all entities
12574 # which are present in groups theGroup1 and theGroup2.
12575 # @param theGroup1, theGroup2 are the initial GEOM groups
12576 # to create the united group from.
12577 # @param theName Object name; when specified, this parameter is used
12578 # for result publication in the study. Otherwise, if automatic
12579 # publication is switched on, default value is used for result name.
12581 # @return a newly created GEOM group.
12583 # @ref tui_union_groups_anchor "Example"
12584 @ManageTransactions("GroupOp")
12585 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12587 Union of two groups.
12588 New group is created. It will contain all entities
12589 which are present in groups theGroup1 and theGroup2.
12592 theGroup1, theGroup2 are the initial GEOM groups
12593 to create the united group from.
12594 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.
12599 a newly created GEOM group.
12601 # Example: see GEOM_TestOthers.py
12602 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12603 RaiseIfFailed("UnionGroups", self.GroupOp)
12604 self._autoPublish(aGroup, theName, "group")
12607 ## Intersection of two groups.
12608 # New group is created. It will contain only those entities
12609 # which are present in both groups theGroup1 and theGroup2.
12610 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12611 # @param 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.
12615 # @return a newly created GEOM group.
12617 # @ref tui_intersect_groups_anchor "Example"
12618 @ManageTransactions("GroupOp")
12619 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12621 Intersection of two groups.
12622 New group is created. It will contain only those entities
12623 which are present in both groups theGroup1 and theGroup2.
12626 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12627 theName Object name; when specified, this parameter is used
12628 for result publication in the study. Otherwise, if automatic
12629 publication is switched on, default value is used for result name.
12632 a newly created GEOM group.
12634 # Example: see GEOM_TestOthers.py
12635 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12636 RaiseIfFailed("IntersectGroups", self.GroupOp)
12637 self._autoPublish(aGroup, theName, "group")
12640 ## Cut of two groups.
12641 # New group is created. It will contain entities which are
12642 # present in group theGroup1 but are not present in group theGroup2.
12643 # @param theGroup1 is a GEOM group to include elements of.
12644 # @param theGroup2 is a GEOM group to exclude elements of.
12645 # @param theName Object name; when specified, this parameter is used
12646 # for result publication in the study. Otherwise, if automatic
12647 # publication is switched on, default value is used for result name.
12649 # @return a newly created GEOM group.
12651 # @ref tui_cut_groups_anchor "Example"
12652 @ManageTransactions("GroupOp")
12653 def CutGroups (self, theGroup1, theGroup2, theName=None):
12656 New group is created. It will contain entities which are
12657 present in group theGroup1 but are not present in group theGroup2.
12660 theGroup1 is a GEOM group to include elements of.
12661 theGroup2 is a GEOM group to exclude elements of.
12662 theName Object name; when specified, this parameter is used
12663 for result publication in the study. Otherwise, if automatic
12664 publication is switched on, default value is used for result name.
12667 a newly created GEOM group.
12669 # Example: see GEOM_TestOthers.py
12670 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12671 RaiseIfFailed("CutGroups", self.GroupOp)
12672 self._autoPublish(aGroup, theName, "group")
12675 ## Union of list of groups.
12676 # New group is created. It will contain all entities that are
12677 # present in groups listed in theGList.
12678 # @param theGList is a list of GEOM groups to create the united group from.
12679 # @param theName Object name; when specified, this parameter is used
12680 # for result publication in the study. Otherwise, if automatic
12681 # publication is switched on, default value is used for result name.
12683 # @return a newly created GEOM group.
12685 # @ref tui_union_groups_anchor "Example"
12686 @ManageTransactions("GroupOp")
12687 def UnionListOfGroups (self, theGList, theName=None):
12689 Union of list of groups.
12690 New group is created. It will contain all entities that are
12691 present in groups listed in theGList.
12694 theGList is a list of GEOM groups to create the united group from.
12695 theName Object name; when specified, this parameter is used
12696 for result publication in the study. Otherwise, if automatic
12697 publication is switched on, default value is used for result name.
12700 a newly created GEOM group.
12702 # Example: see GEOM_TestOthers.py
12703 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12704 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12705 self._autoPublish(aGroup, theName, "group")
12708 ## Cut of lists of groups.
12709 # New group is created. It will contain only entities
12710 # which are present in groups listed in theGList.
12711 # @param theGList is a list of GEOM groups to include elements of.
12712 # @param theName Object name; when specified, this parameter is used
12713 # for result publication in the study. Otherwise, if automatic
12714 # publication is switched on, default value is used for result name.
12716 # @return a newly created GEOM group.
12718 # @ref tui_intersect_groups_anchor "Example"
12719 @ManageTransactions("GroupOp")
12720 def IntersectListOfGroups (self, theGList, theName=None):
12722 Cut of lists of groups.
12723 New group is created. It will contain only entities
12724 which are present in groups listed in theGList.
12727 theGList is a list of GEOM groups to include elements of.
12728 theName Object name; when specified, this parameter is used
12729 for result publication in the study. Otherwise, if automatic
12730 publication is switched on, default value is used for result name.
12733 a newly created GEOM group.
12735 # Example: see GEOM_TestOthers.py
12736 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12737 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12738 self._autoPublish(aGroup, theName, "group")
12741 ## Cut of lists of groups.
12742 # New group is created. It will contain only entities
12743 # which are present in groups listed in theGList1 but
12744 # are not present in groups from theGList2.
12745 # @param theGList1 is a list of GEOM groups to include elements of.
12746 # @param theGList2 is a list of GEOM groups to exclude elements of.
12747 # @param theName Object name; when specified, this parameter is used
12748 # for result publication in the study. Otherwise, if automatic
12749 # publication is switched on, default value is used for result name.
12751 # @return a newly created GEOM group.
12753 # @ref tui_cut_groups_anchor "Example"
12754 @ManageTransactions("GroupOp")
12755 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12757 Cut of lists of groups.
12758 New group is created. It will contain only entities
12759 which are present in groups listed in theGList1 but
12760 are not present in groups from theGList2.
12763 theGList1 is a list of GEOM groups to include elements of.
12764 theGList2 is a list of GEOM groups to exclude elements of.
12765 theName Object name; when specified, this parameter is used
12766 for result publication in the study. Otherwise, if automatic
12767 publication is switched on, default value is used for result name.
12770 a newly created GEOM group.
12772 # Example: see GEOM_TestOthers.py
12773 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12774 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12775 self._autoPublish(aGroup, theName, "group")
12778 ## Returns a list of sub-objects ID stored in the group
12779 # @param theGroup is a GEOM group for which a list of IDs is requested
12781 # @ref swig_GetObjectIDs "Example"
12782 @ManageTransactions("GroupOp")
12783 def GetObjectIDs(self,theGroup):
12785 Returns a list of sub-objects ID stored in the group
12788 theGroup is a GEOM group for which a list of IDs is requested
12790 # Example: see GEOM_TestOthers.py
12791 ListIDs = self.GroupOp.GetObjects(theGroup)
12792 RaiseIfFailed("GetObjects", self.GroupOp)
12795 ## Returns a type of sub-objects stored in the group
12796 # @param theGroup is a GEOM group which type is returned.
12798 # @ref swig_GetType "Example"
12799 @ManageTransactions("GroupOp")
12800 def GetType(self,theGroup):
12802 Returns a type of sub-objects stored in the group
12805 theGroup is a GEOM group which type is returned.
12807 # Example: see GEOM_TestOthers.py
12808 aType = self.GroupOp.GetType(theGroup)
12809 RaiseIfFailed("GetType", self.GroupOp)
12812 ## Convert a type of geom object from id to string value
12813 # @param theId is a GEOM obect type id.
12814 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12815 # @ref swig_GetType "Example"
12816 def ShapeIdToType(self, theId):
12818 Convert a type of geom object from id to string value
12821 theId is a GEOM obect type id.
12824 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12851 return "REVOLUTION"
12899 return "FREE_BOUNDS"
12907 return "THRUSECTIONS"
12909 return "COMPOUNDFILTER"
12911 return "SHAPES_ON_SHAPE"
12913 return "ELLIPSE_ARC"
12915 return "3DSKETCHER"
12921 return "PIPETSHAPE"
12922 return "Shape Id not exist."
12924 ## Returns a main shape associated with the group
12925 # @param theGroup is a GEOM group for which a main shape object is requested
12926 # @return a GEOM object which is a main shape for theGroup
12928 # @ref swig_GetMainShape "Example"
12929 @ManageTransactions("GroupOp")
12930 def GetMainShape(self,theGroup):
12932 Returns a main shape associated with the group
12935 theGroup is a GEOM group for which a main shape object is requested
12938 a GEOM object which is a main shape for theGroup
12940 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12942 # Example: see GEOM_TestOthers.py
12943 anObj = self.GroupOp.GetMainShape(theGroup)
12944 RaiseIfFailed("GetMainShape", self.GroupOp)
12947 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12948 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12949 # @param theShape given shape (see GEOM.GEOM_Object)
12950 # @param min_length minimum length of edges of theShape
12951 # @param max_length maximum length of edges of theShape
12952 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12953 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12954 # @param theName Object name; when specified, this parameter is used
12955 # for result publication in the study. Otherwise, if automatic
12956 # publication is switched on, default value is used for result name.
12958 # @return a newly created GEOM group of edges
12960 # @@ref swig_todo "Example"
12961 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12963 Create group of edges of theShape, whose length is in range [min_length, max_length].
12964 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12967 theShape given shape
12968 min_length minimum length of edges of theShape
12969 max_length maximum length of edges of theShape
12970 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12971 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12972 theName Object name; when specified, this parameter is used
12973 for result publication in the study. Otherwise, if automatic
12974 publication is switched on, default value is used for result name.
12977 a newly created GEOM group of edges.
12979 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12980 edges_in_range = []
12982 Props = self.BasicProperties(edge)
12983 if min_length <= Props[0] and Props[0] <= max_length:
12984 if (not include_min) and (min_length == Props[0]):
12987 if (not include_max) and (Props[0] == max_length):
12990 edges_in_range.append(edge)
12992 if len(edges_in_range) <= 0:
12993 print "No edges found by given criteria"
12996 # note: auto-publishing is done in self.CreateGroup()
12997 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12998 self.UnionList(group_edges, edges_in_range)
13002 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13003 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13004 # @param min_length minimum length of edges of selected shape
13005 # @param max_length maximum length of edges of selected shape
13006 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13007 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13008 # @return a newly created GEOM group of edges
13009 # @ref swig_todo "Example"
13010 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13012 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13013 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13016 min_length minimum length of edges of selected shape
13017 max_length maximum length of edges of selected shape
13018 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13019 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13022 a newly created GEOM group of edges.
13024 nb_selected = sg.SelectedCount()
13025 if nb_selected < 1:
13026 print "Select a shape before calling this function, please."
13028 if nb_selected > 1:
13029 print "Only one shape must be selected"
13032 id_shape = sg.getSelected(0)
13033 shape = IDToObject( id_shape )
13035 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13039 if include_min: left_str = " <= "
13040 if include_max: right_str = " <= "
13042 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
13043 + left_str + "length" + right_str + `max_length`)
13045 sg.updateObjBrowser(1)
13052 #@@ insert new functions before this line @@ do not remove this line @@#
13054 ## Create a copy of the given object
13056 # @param theOriginal geometry object for copy
13057 # @param theName Object name; when specified, this parameter is used
13058 # for result publication in the study. Otherwise, if automatic
13059 # publication is switched on, default value is used for result name.
13061 # @return New GEOM_Object, containing the copied shape.
13063 # @ingroup l1_geomBuilder_auxiliary
13064 # @ref swig_MakeCopy "Example"
13065 @ManageTransactions("InsertOp")
13066 def MakeCopy(self, theOriginal, theName=None):
13068 Create a copy of the given object
13071 theOriginal geometry object for copy
13072 theName Object name; when specified, this parameter is used
13073 for result publication in the study. Otherwise, if automatic
13074 publication is switched on, default value is used for result name.
13077 New GEOM_Object, containing the copied shape.
13079 Example of usage: Copy = geompy.MakeCopy(Box)
13081 # Example: see GEOM_TestAll.py
13082 anObj = self.InsertOp.MakeCopy(theOriginal)
13083 RaiseIfFailed("MakeCopy", self.InsertOp)
13084 self._autoPublish(anObj, theName, "copy")
13087 ## Add Path to load python scripts from
13088 # @param Path a path to load python scripts from
13089 # @ingroup l1_geomBuilder_auxiliary
13090 def addPath(self,Path):
13092 Add Path to load python scripts from
13095 Path a path to load python scripts from
13097 if (sys.path.count(Path) < 1):
13098 sys.path.append(Path)
13102 ## Load marker texture from the file
13103 # @param Path a path to the texture file
13104 # @return unique texture identifier
13105 # @ingroup l1_geomBuilder_auxiliary
13106 @ManageTransactions("InsertOp")
13107 def LoadTexture(self, Path):
13109 Load marker texture from the file
13112 Path a path to the texture file
13115 unique texture identifier
13117 # Example: see GEOM_TestAll.py
13118 ID = self.InsertOp.LoadTexture(Path)
13119 RaiseIfFailed("LoadTexture", self.InsertOp)
13122 ## Get internal name of the object based on its study entry
13123 # @note This method does not provide an unique identifier of the geometry object.
13124 # @note This is internal function of GEOM component, though it can be used outside it for
13125 # appropriate reason (e.g. for identification of geometry object).
13126 # @param obj geometry object
13127 # @return unique object identifier
13128 # @ingroup l1_geomBuilder_auxiliary
13129 def getObjectID(self, obj):
13131 Get internal name of the object based on its study entry.
13132 Note: this method does not provide an unique identifier of the geometry object.
13133 It is an internal function of GEOM component, though it can be used outside GEOM for
13134 appropriate reason (e.g. for identification of geometry object).
13137 obj geometry object
13140 unique object identifier
13143 entry = salome.ObjectToID(obj)
13144 if entry is not None:
13145 lst = entry.split(":")
13147 ID = lst[-1] # -1 means last item in the list
13148 return "GEOM_" + ID
13153 ## Add marker texture. @a Width and @a Height parameters
13154 # specify width and height of the texture in pixels.
13155 # If @a RowData is @c True, @a Texture parameter should represent texture data
13156 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13157 # parameter should be unpacked string, in which '1' symbols represent opaque
13158 # pixels and '0' represent transparent pixels of the texture bitmap.
13160 # @param Width texture width in pixels
13161 # @param Height texture height in pixels
13162 # @param Texture texture data
13163 # @param RowData if @c True, @a Texture data are packed in the byte stream
13164 # @return unique texture identifier
13165 # @ingroup l1_geomBuilder_auxiliary
13166 @ManageTransactions("InsertOp")
13167 def AddTexture(self, Width, Height, Texture, RowData=False):
13169 Add marker texture. Width and Height parameters
13170 specify width and height of the texture in pixels.
13171 If RowData is True, Texture parameter should represent texture data
13172 packed into the byte array. If RowData is False (default), Texture
13173 parameter should be unpacked string, in which '1' symbols represent opaque
13174 pixels and '0' represent transparent pixels of the texture bitmap.
13177 Width texture width in pixels
13178 Height texture height in pixels
13179 Texture texture data
13180 RowData if True, Texture data are packed in the byte stream
13183 return unique texture identifier
13185 if not RowData: Texture = PackData(Texture)
13186 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13187 RaiseIfFailed("AddTexture", self.InsertOp)
13190 ## Transfer not topological data from one GEOM object to another.
13192 # @param theObjectFrom the source object of non-topological data
13193 # @param theObjectTo the destination object of non-topological data
13194 # @param theFindMethod method to search sub-shapes of theObjectFrom
13195 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13196 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13197 # Other values of GEOM.find_shape_method are not supported.
13199 # @return True in case of success; False otherwise.
13201 # @ingroup l1_geomBuilder_auxiliary
13203 # @ref swig_TransferData "Example"
13204 @ManageTransactions("InsertOp")
13205 def TransferData(self, theObjectFrom, theObjectTo,
13206 theFindMethod=GEOM.FSM_GetInPlace):
13208 Transfer not topological data from one GEOM object to another.
13211 theObjectFrom the source object of non-topological data
13212 theObjectTo the destination object of non-topological data
13213 theFindMethod method to search sub-shapes of theObjectFrom
13214 in shape theObjectTo. Possible values are:
13215 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13216 and GEOM.FSM_GetInPlace_Old. Other values of
13217 GEOM.find_shape_method are not supported.
13220 True in case of success; False otherwise.
13222 # Example: see GEOM_TestOthers.py
13224 # Example: see GEOM_TestAll.py
13225 isOk = self.InsertOp.TransferData(theObjectFrom,
13226 theObjectTo, theFindMethod)
13227 RaiseIfFailed("TransferData", self.InsertOp)
13230 ## Creates a new folder object. It is a container for any GEOM objects.
13231 # @param Name name of the container
13232 # @param Father parent object. If None,
13233 # folder under 'Geometry' root object will be created.
13234 # @return a new created folder
13235 # @ingroup l1_publish_data
13236 def NewFolder(self, Name, Father=None):
13238 Create a new folder object. It is an auxiliary container for any GEOM objects.
13241 Name name of the container
13242 Father parent object. If None,
13243 folder under 'Geometry' root object will be created.
13246 a new created folder
13248 if not Father: Father = self.father
13249 return self.CreateFolder(Name, Father)
13251 ## Move object to the specified folder
13252 # @param Object object to move
13253 # @param Folder target folder
13254 # @ingroup l1_publish_data
13255 def PutToFolder(self, Object, Folder):
13257 Move object to the specified folder
13260 Object object to move
13261 Folder target folder
13263 self.MoveToFolder(Object, Folder)
13266 ## Move list of objects to the specified folder
13267 # @param ListOfSO list of objects to move
13268 # @param Folder target folder
13269 # @ingroup l1_publish_data
13270 def PutListToFolder(self, ListOfSO, Folder):
13272 Move list of objects to the specified folder
13275 ListOfSO list of objects to move
13276 Folder target folder
13278 self.MoveListToFolder(ListOfSO, Folder)
13281 ## @addtogroup l2_field
13285 # @param shape the shape the field lies on
13286 # @param name the field name
13287 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13288 # @param dimension dimension of the shape the field lies on
13289 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13290 # @param componentNames names of components
13291 # @return a created field
13292 @ManageTransactions("FieldOp")
13293 def CreateField(self, shape, name, type, dimension, componentNames):
13298 shape the shape the field lies on
13299 name the field name
13300 type type of field data
13301 dimension dimension of the shape the field lies on
13302 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13303 componentNames names of components
13308 if isinstance( type, int ):
13309 if type < 0 or type > 3:
13310 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13311 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13313 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13314 RaiseIfFailed("CreateField", self.FieldOp)
13316 geom._autoPublish( f, "", name)
13319 ## Removes a field from the GEOM component
13320 # @param field the field to remove
13321 def RemoveField(self, field):
13322 "Removes a field from the GEOM component"
13324 if isinstance( field, GEOM._objref_GEOM_Field ):
13325 geom.RemoveObject( field )
13326 elif isinstance( field, geomField ):
13327 geom.RemoveObject( field.field )
13329 raise RuntimeError, "RemoveField() : the object is not a field"
13332 ## Returns number of fields on a shape
13333 @ManageTransactions("FieldOp")
13334 def CountFields(self, shape):
13335 "Returns number of fields on a shape"
13336 nb = self.FieldOp.CountFields( shape )
13337 RaiseIfFailed("CountFields", self.FieldOp)
13340 ## Returns all fields on a shape
13341 @ManageTransactions("FieldOp")
13342 def GetFields(self, shape):
13343 "Returns all fields on a shape"
13344 ff = self.FieldOp.GetFields( shape )
13345 RaiseIfFailed("GetFields", self.FieldOp)
13348 ## Returns a field on a shape by its name
13349 @ManageTransactions("FieldOp")
13350 def GetField(self, shape, name):
13351 "Returns a field on a shape by its name"
13352 f = self.FieldOp.GetField( shape, name )
13353 RaiseIfFailed("GetField", self.FieldOp)
13361 # Register the new proxy for GEOM_Gen
13362 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13365 ## Field on Geometry
13366 # @ingroup l2_field
13367 class geomField( GEOM._objref_GEOM_Field ):
13369 def __init__(self):
13370 GEOM._objref_GEOM_Field.__init__(self)
13371 self.field = GEOM._objref_GEOM_Field
13374 ## Returns the shape the field lies on
13375 def getShape(self):
13376 "Returns the shape the field lies on"
13377 return self.field.GetShape(self)
13379 ## Returns the field name
13381 "Returns the field name"
13382 return self.field.GetName(self)
13384 ## Returns type of field data as integer [0-3]
13386 "Returns type of field data"
13387 return self.field.GetDataType(self)._v
13389 ## Returns type of field data:
13390 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13391 def getTypeEnum(self):
13392 "Returns type of field data"
13393 return self.field.GetDataType(self)
13395 ## Returns dimension of the shape the field lies on:
13396 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13397 def getDimension(self):
13398 """Returns dimension of the shape the field lies on:
13399 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13400 return self.field.GetDimension(self)
13402 ## Returns names of components
13403 def getComponents(self):
13404 "Returns names of components"
13405 return self.field.GetComponents(self)
13407 ## Adds a time step to the field
13408 # @param step the time step number further used as the step identifier
13409 # @param stamp the time step time
13410 # @param values the values of the time step
13411 def addStep(self, step, stamp, values):
13412 "Adds a time step to the field"
13413 stp = self.field.AddStep( self, step, stamp )
13415 raise RuntimeError, \
13416 "Field.addStep() : Error: step %s already exists in this field"%step
13418 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13419 self.setValues( step, values )
13422 ## Remove a time step from the field
13423 def removeStep(self,step):
13424 "Remove a time step from the field"
13427 stepObj = self.field.GetStep( self, step )
13429 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13432 #traceback.print_exc()
13434 self.field.RemoveStep( self, step )
13436 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13439 ## Returns number of time steps in the field
13440 def countSteps(self):
13441 "Returns number of time steps in the field"
13442 return self.field.CountSteps(self)
13444 ## Returns a list of time step IDs in the field
13445 def getSteps(self):
13446 "Returns a list of time step IDs in the field"
13447 return self.field.GetSteps(self)
13449 ## Returns a time step by its ID
13450 def getStep(self,step):
13451 "Returns a time step by its ID"
13452 stp = self.field.GetStep(self, step)
13454 raise RuntimeError, "Step %s is missing from this field"%step
13457 ## Returns the time of the field step
13458 def getStamp(self,step):
13459 "Returns the time of the field step"
13460 return self.getStep(step).GetStamp()
13462 ## Changes the time of the field step
13463 def setStamp(self, step, stamp):
13464 "Changes the time of the field step"
13465 return self.getStep(step).SetStamp(stamp)
13467 ## Returns values of the field step
13468 def getValues(self, step):
13469 "Returns values of the field step"
13470 return self.getStep(step).GetValues()
13472 ## Changes values of the field step
13473 def setValues(self, step, values):
13474 "Changes values of the field step"
13475 stp = self.getStep(step)
13476 errBeg = "Field.setValues(values) : Error: "
13478 ok = stp.SetValues( values )
13479 except Exception, e:
13481 if excStr.find("WrongPythonType") > 0:
13482 raise RuntimeError, errBeg +\
13483 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13484 raise RuntimeError, errBeg + str(e)
13486 nbOK = self.field.GetArraySize(self)
13489 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13491 raise RuntimeError, errBeg + "failed"
13494 pass # end of class geomField
13496 # Register the new proxy for GEOM_Field
13497 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13500 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13501 # interface to GEOM operations.
13506 # salome.salome_init()
13507 # from salome.geom import geomBuilder
13508 # geompy = geomBuilder.New(salome.myStudy)
13510 # @param study SALOME study, generally obtained by salome.myStudy.
13511 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13512 # @return geomBuilder instance
13513 def New( study, instance=None):
13515 Create a new geomBuilder instance.The geomBuilder class provides the Python
13516 interface to GEOM operations.
13520 salome.salome_init()
13521 from salome.geom import geomBuilder
13522 geompy = geomBuilder.New(salome.myStudy)
13525 study SALOME study, generally obtained by salome.myStudy.
13526 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13528 geomBuilder instance
13530 #print "New geomBuilder ", study, instance
13537 geom = geomBuilder()
13538 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13539 geom.init_geom(study)
13543 # Register methods from the plug-ins in the geomBuilder class
13544 plugins_var = os.environ.get( "GEOM_PluginsList" )
13547 if plugins_var is not None:
13548 plugins = plugins_var.split( ":" )
13549 plugins=filter(lambda x: len(x)>0, plugins)
13550 if plugins is not None:
13551 for pluginName in plugins:
13552 pluginBuilderName = pluginName + "Builder"
13554 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
13555 except Exception, e:
13556 from salome_utils import verbose
13557 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
13559 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
13560 plugin = eval( pluginBuilderName )
13562 # add methods from plugin module to the geomBuilder class
13563 for k in dir( plugin ):
13564 if k[0] == '_': continue
13565 method = getattr( plugin, k )
13566 if type( method ).__name__ == 'function':
13567 if not hasattr( geomBuilder, k ):
13568 setattr( geomBuilder, k, method )