1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, 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}
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)
790 def GetPluginOperations(self, studyID, libraryName):
791 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
794 ## Enable / disable results auto-publishing
796 # The automatic publishing is managed in the following way:
797 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
798 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
799 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
800 # value passed as parameter has the same effect.
801 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
802 # maximum number of sub-shapes allowed for publishing is set to specified value.
804 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
805 # @ingroup l1_publish_data
806 def addToStudyAuto(self, maxNbSubShapes=-1):
808 Enable / disable results auto-publishing
810 The automatic publishing is managed in the following way:
811 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
812 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
813 maximum number of sub-shapes allowed for publishing is unlimited; any negative
814 value passed as parameter has the same effect.
815 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
816 maximum number of sub-shapes allowed for publishing is set to this value.
819 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
822 geompy.addToStudyAuto() # enable auto-publishing
823 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
824 geompy.addToStudyAuto(0) # disable auto-publishing
826 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
829 ## Dump component to the Python script
830 # This method overrides IDL function to allow default values for the parameters.
831 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
833 Dump component to the Python script
834 This method overrides IDL function to allow default values for the parameters.
836 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
838 ## Get name for sub-shape aSubObj of shape aMainObj
840 # @ref swig_SubShapeName "Example"
841 @ManageTransactions("ShapesOp")
842 def SubShapeName(self,aSubObj, aMainObj):
844 Get name for sub-shape aSubObj of shape aMainObj
846 # Example: see GEOM_TestAll.py
848 #aSubId = orb.object_to_string(aSubObj)
849 #aMainId = orb.object_to_string(aMainObj)
850 #index = gg.getIndexTopology(aSubId, aMainId)
851 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
852 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
853 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
856 ## Publish in study aShape with name aName
858 # \param aShape the shape to be published
859 # \param aName the name for the shape
860 # \param doRestoreSubShapes if True, finds and publishes also
861 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
862 # and published sub-shapes of arguments
863 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
864 # these arguments description
865 # \return study entry of the published shape in form of string
867 # @ingroup l1_publish_data
868 # @ref swig_all_addtostudy "Example"
869 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
870 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
872 Publish in study aShape with name aName
875 aShape the shape to be published
876 aName the name for the shape
877 doRestoreSubShapes if True, finds and publishes also
878 sub-shapes of aShape, corresponding to its arguments
879 and published sub-shapes of arguments
880 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
881 these arguments description
884 study entry of the published shape in form of string
887 id_block1 = geompy.addToStudy(Block1, "Block 1")
889 # Example: see GEOM_TestAll.py
891 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
892 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
893 if doRestoreSubShapes:
894 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
895 theFindMethod, theInheritFirstArg, True )
897 print "addToStudy() failed"
899 return aShape.GetStudyEntry()
901 ## Publish in study aShape with name aName as sub-object of previously published aFather
902 # \param aFather previously published object
903 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
904 # \param aName the name for the shape
906 # \return study entry of the published shape in form of string
908 # @ingroup l1_publish_data
909 # @ref swig_all_addtostudyInFather "Example"
910 def addToStudyInFather(self, aFather, aShape, aName):
912 Publish in study aShape with name aName as sub-object of previously published aFather
915 aFather previously published object
916 aShape the shape to be published as sub-object of aFather
917 aName the name for the shape
920 study entry of the published shape in form of string
922 # Example: see GEOM_TestAll.py
924 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
925 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
927 print "addToStudyInFather() failed"
929 return aShape.GetStudyEntry()
931 ## Unpublish object in study
933 # \param obj the object to be unpublished
934 def hideInStudy(self, obj):
936 Unpublish object in study
939 obj the object to be unpublished
941 ior = salome.orb.object_to_string(obj)
942 aSObject = self.myStudy.FindObjectIOR(ior)
943 if aSObject is not None:
944 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
945 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
946 drwAttribute.SetDrawable(False)
947 # hide references if any
948 vso = self.myStudy.FindDependances(aSObject);
950 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
951 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
952 drwAttribute.SetDrawable(False)
956 # end of l1_geomBuilder_auxiliary
959 ## @addtogroup l3_restore_ss
962 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
963 # To be used from python scripts out of addToStudy() (non-default usage)
964 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
965 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
966 # If this list is empty, all operation arguments will be published
967 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
968 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
969 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
970 # Do not publish sub-shapes in place of arguments, but only
971 # in place of sub-shapes of the first argument,
972 # because the whole shape corresponds to the first argument.
973 # Mainly to be used after transformations, but it also can be
974 # usefull after partition with one object shape, and some other
975 # operations, where only the first argument has to be considered.
976 # If theObject has only one argument shape, this flag is automatically
977 # considered as True, not regarding really passed value.
978 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
979 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
980 # \return list of published sub-shapes
982 # @ref tui_restore_prs_params "Example"
983 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
984 theInheritFirstArg=False, theAddPrefix=True):
986 Publish sub-shapes, standing for arguments and sub-shapes of arguments
987 To be used from python scripts out of geompy.addToStudy (non-default usage)
990 theObject published GEOM.GEOM_Object, arguments of which will be published
991 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
992 If this list is empty, all operation arguments will be published
993 theFindMethod method to search sub-shapes, corresponding to arguments and
994 their sub-shapes. Value from enumeration GEOM.find_shape_method.
995 theInheritFirstArg set properties of the first argument for theObject.
996 Do not publish sub-shapes in place of arguments, but only
997 in place of sub-shapes of the first argument,
998 because the whole shape corresponds to the first argument.
999 Mainly to be used after transformations, but it also can be
1000 usefull after partition with one object shape, and some other
1001 operations, where only the first argument has to be considered.
1002 If theObject has only one argument shape, this flag is automatically
1003 considered as True, not regarding really passed value.
1004 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1005 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1007 list of published sub-shapes
1009 # Example: see GEOM_TestAll.py
1010 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1011 theFindMethod, theInheritFirstArg, theAddPrefix)
1013 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1014 # To be used from python scripts out of addToStudy() (non-default usage)
1015 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1016 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1017 # If this list is empty, all operation arguments will be published
1018 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1019 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1020 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1021 # Do not publish sub-shapes in place of arguments, but only
1022 # in place of sub-shapes of the first argument,
1023 # because the whole shape corresponds to the first argument.
1024 # Mainly to be used after transformations, but it also can be
1025 # usefull after partition with one object shape, and some other
1026 # operations, where only the first argument has to be considered.
1027 # If theObject has only one argument shape, this flag is automatically
1028 # considered as True, not regarding really passed value.
1029 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1030 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1031 # \return list of published sub-shapes
1033 # @ref tui_restore_prs_params "Example"
1034 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1035 theInheritFirstArg=False, theAddPrefix=True):
1037 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1038 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1041 theObject published GEOM.GEOM_Object, arguments of which will be published
1042 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1043 If this list is empty, all operation arguments will be published
1044 theFindMethod method to search sub-shapes, corresponding to arguments and
1045 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1046 theInheritFirstArg set properties of the first argument for theObject.
1047 Do not publish sub-shapes in place of arguments, but only
1048 in place of sub-shapes of the first argument,
1049 because the whole shape corresponds to the first argument.
1050 Mainly to be used after transformations, but it also can be
1051 usefull after partition with one object shape, and some other
1052 operations, where only the first argument has to be considered.
1053 If theObject has only one argument shape, this flag is automatically
1054 considered as True, not regarding really passed value.
1055 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1056 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1059 list of published sub-shapes
1061 # Example: see GEOM_TestAll.py
1062 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1063 theFindMethod, theInheritFirstArg, theAddPrefix)
1065 # end of l3_restore_ss
1068 ## @addtogroup l3_basic_go
1071 ## Create point by three coordinates.
1072 # @param theX The X coordinate of the point.
1073 # @param theY The Y coordinate of the point.
1074 # @param theZ The Z coordinate of the point.
1075 # @param theName Object name; when specified, this parameter is used
1076 # for result publication in the study. Otherwise, if automatic
1077 # publication is switched on, default value is used for result name.
1079 # @return New GEOM.GEOM_Object, containing the created point.
1081 # @ref tui_creation_point "Example"
1082 @ManageTransactions("BasicOp")
1083 def MakeVertex(self, theX, theY, theZ, theName=None):
1085 Create point by three coordinates.
1088 theX The X coordinate of the point.
1089 theY The Y coordinate of the point.
1090 theZ The Z coordinate of the point.
1091 theName Object name; when specified, this parameter is used
1092 for result publication in the study. Otherwise, if automatic
1093 publication is switched on, default value is used for result name.
1096 New GEOM.GEOM_Object, containing the created point.
1098 # Example: see GEOM_TestAll.py
1099 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1100 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1101 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1102 anObj.SetParameters(Parameters)
1103 self._autoPublish(anObj, theName, "vertex")
1106 ## Create a point, distant from the referenced point
1107 # on the given distances along the coordinate axes.
1108 # @param theReference The referenced point.
1109 # @param theX Displacement from the referenced point along OX axis.
1110 # @param theY Displacement from the referenced point along OY axis.
1111 # @param theZ Displacement from the referenced point along OZ axis.
1112 # @param theName Object name; when specified, this parameter is used
1113 # for result publication in the study. Otherwise, if automatic
1114 # publication is switched on, default value is used for result name.
1116 # @return New GEOM.GEOM_Object, containing the created point.
1118 # @ref tui_creation_point "Example"
1119 @ManageTransactions("BasicOp")
1120 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1122 Create a point, distant from the referenced point
1123 on the given distances along the coordinate axes.
1126 theReference The referenced point.
1127 theX Displacement from the referenced point along OX axis.
1128 theY Displacement from the referenced point along OY axis.
1129 theZ Displacement from the referenced point along OZ axis.
1130 theName Object name; when specified, this parameter is used
1131 for result publication in the study. Otherwise, if automatic
1132 publication is switched on, default value is used for result name.
1135 New GEOM.GEOM_Object, containing the created point.
1137 # Example: see GEOM_TestAll.py
1138 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1139 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1140 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1141 anObj.SetParameters(Parameters)
1142 self._autoPublish(anObj, theName, "vertex")
1145 ## Create a point, corresponding to the given parameter on the given curve.
1146 # @param theRefCurve The referenced curve.
1147 # @param theParameter Value of parameter on the referenced curve.
1148 # @param theName Object name; when specified, this parameter is used
1149 # for result publication in the study. Otherwise, if automatic
1150 # publication is switched on, default value is used for result name.
1152 # @return New GEOM.GEOM_Object, containing the created point.
1154 # @ref tui_creation_point "Example"
1155 @ManageTransactions("BasicOp")
1156 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1158 Create a point, corresponding to the given parameter on the given curve.
1161 theRefCurve The referenced curve.
1162 theParameter Value of parameter on the referenced curve.
1163 theName Object name; when specified, this parameter is used
1164 for result publication in the study. Otherwise, if automatic
1165 publication is switched on, default value is used for result name.
1168 New GEOM.GEOM_Object, containing the created point.
1171 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1173 # Example: see GEOM_TestAll.py
1174 theParameter, Parameters = ParseParameters(theParameter)
1175 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1176 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1177 anObj.SetParameters(Parameters)
1178 self._autoPublish(anObj, theName, "vertex")
1181 ## Create a point by projection give coordinates on the given curve
1182 # @param theRefCurve The referenced curve.
1183 # @param theX X-coordinate in 3D space
1184 # @param theY Y-coordinate in 3D space
1185 # @param theZ Z-coordinate in 3D space
1186 # @param theName Object name; when specified, this parameter is used
1187 # for result publication in the study. Otherwise, if automatic
1188 # publication is switched on, default value is used for result name.
1190 # @return New GEOM.GEOM_Object, containing the created point.
1192 # @ref tui_creation_point "Example"
1193 @ManageTransactions("BasicOp")
1194 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1196 Create a point by projection give coordinates on the given curve
1199 theRefCurve The referenced curve.
1200 theX X-coordinate in 3D space
1201 theY Y-coordinate in 3D space
1202 theZ Z-coordinate in 3D space
1203 theName Object name; when specified, this parameter is used
1204 for result publication in the study. Otherwise, if automatic
1205 publication is switched on, default value is used for result name.
1208 New GEOM.GEOM_Object, containing the created point.
1211 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1213 # Example: see GEOM_TestAll.py
1214 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1215 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1216 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1217 anObj.SetParameters(Parameters)
1218 self._autoPublish(anObj, theName, "vertex")
1221 ## Create a point, corresponding to the given length on the given curve.
1222 # @param theRefCurve The referenced curve.
1223 # @param theLength Length on the referenced curve. It can be negative.
1224 # @param theStartPoint Point allowing to choose the direction for the calculation
1225 # of the length. If None, start from the first point of theRefCurve.
1226 # @param theName Object name; when specified, this parameter is used
1227 # for result publication in the study. Otherwise, if automatic
1228 # publication is switched on, default value is used for result name.
1230 # @return New GEOM.GEOM_Object, containing the created point.
1232 # @ref tui_creation_point "Example"
1233 @ManageTransactions("BasicOp")
1234 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1236 Create a point, corresponding to the given length on the given curve.
1239 theRefCurve The referenced curve.
1240 theLength Length on the referenced curve. It can be negative.
1241 theStartPoint Point allowing to choose the direction for the calculation
1242 of the length. If None, start from the first point of theRefCurve.
1243 theName Object name; when specified, this parameter is used
1244 for result publication in the study. Otherwise, if automatic
1245 publication is switched on, default value is used for result name.
1248 New GEOM.GEOM_Object, containing the created point.
1250 # Example: see GEOM_TestAll.py
1251 theLength, Parameters = ParseParameters(theLength)
1252 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1253 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1254 anObj.SetParameters(Parameters)
1255 self._autoPublish(anObj, theName, "vertex")
1258 ## Create a point, corresponding to the given parameters on the
1260 # @param theRefSurf The referenced surface.
1261 # @param theUParameter Value of U-parameter on the referenced surface.
1262 # @param theVParameter Value of V-parameter on the referenced surface.
1263 # @param theName Object name; when specified, this parameter is used
1264 # for result publication in the study. Otherwise, if automatic
1265 # publication is switched on, default value is used for result name.
1267 # @return New GEOM.GEOM_Object, containing the created point.
1269 # @ref swig_MakeVertexOnSurface "Example"
1270 @ManageTransactions("BasicOp")
1271 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1273 Create a point, corresponding to the given parameters on the
1277 theRefSurf The referenced surface.
1278 theUParameter Value of U-parameter on the referenced surface.
1279 theVParameter Value of V-parameter on the referenced surface.
1280 theName Object name; when specified, this parameter is used
1281 for result publication in the study. Otherwise, if automatic
1282 publication is switched on, default value is used for result name.
1285 New GEOM.GEOM_Object, containing the created point.
1288 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1290 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1291 # Example: see GEOM_TestAll.py
1292 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1293 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1294 anObj.SetParameters(Parameters);
1295 self._autoPublish(anObj, theName, "vertex")
1298 ## Create a point by projection give coordinates on the given surface
1299 # @param theRefSurf The referenced surface.
1300 # @param theX X-coordinate in 3D space
1301 # @param theY Y-coordinate in 3D space
1302 # @param theZ Z-coordinate in 3D space
1303 # @param theName Object name; when specified, this parameter is used
1304 # for result publication in the study. Otherwise, if automatic
1305 # publication is switched on, default value is used for result name.
1307 # @return New GEOM.GEOM_Object, containing the created point.
1309 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1310 @ManageTransactions("BasicOp")
1311 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1313 Create a point by projection give coordinates on the given surface
1316 theRefSurf The referenced surface.
1317 theX X-coordinate in 3D space
1318 theY Y-coordinate in 3D space
1319 theZ Z-coordinate in 3D space
1320 theName Object name; when specified, this parameter is used
1321 for result publication in the study. Otherwise, if automatic
1322 publication is switched on, default value is used for result name.
1325 New GEOM.GEOM_Object, containing the created point.
1328 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1330 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1331 # Example: see GEOM_TestAll.py
1332 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1333 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1334 anObj.SetParameters(Parameters);
1335 self._autoPublish(anObj, theName, "vertex")
1338 ## Create a point, which lays on the given face.
1339 # The point will lay in arbitrary place of the face.
1340 # The only condition on it is a non-zero distance to the face boundary.
1341 # Such point can be used to uniquely identify the face inside any
1342 # shape in case, when the shape does not contain overlapped faces.
1343 # @param theFace The referenced face.
1344 # @param theName Object name; when specified, this parameter is used
1345 # for result publication in the study. Otherwise, if automatic
1346 # publication is switched on, default value is used for result name.
1348 # @return New GEOM.GEOM_Object, containing the created point.
1350 # @ref swig_MakeVertexInsideFace "Example"
1351 @ManageTransactions("BasicOp")
1352 def MakeVertexInsideFace (self, theFace, theName=None):
1354 Create a point, which lays on the given face.
1355 The point will lay in arbitrary place of the face.
1356 The only condition on it is a non-zero distance to the face boundary.
1357 Such point can be used to uniquely identify the face inside any
1358 shape in case, when the shape does not contain overlapped faces.
1361 theFace The referenced face.
1362 theName Object name; when specified, this parameter is used
1363 for result publication in the study. Otherwise, if automatic
1364 publication is switched on, default value is used for result name.
1367 New GEOM.GEOM_Object, containing the created point.
1370 p_on_face = geompy.MakeVertexInsideFace(Face)
1372 # Example: see GEOM_TestAll.py
1373 anObj = self.BasicOp.MakePointOnFace(theFace)
1374 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1375 self._autoPublish(anObj, theName, "vertex")
1378 ## Create a point on intersection of two lines.
1379 # @param theRefLine1, theRefLine2 The referenced lines.
1380 # @param theName Object name; when specified, this parameter is used
1381 # for result publication in the study. Otherwise, if automatic
1382 # publication is switched on, default value is used for result name.
1384 # @return New GEOM.GEOM_Object, containing the created point.
1386 # @ref swig_MakeVertexOnLinesIntersection "Example"
1387 @ManageTransactions("BasicOp")
1388 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1390 Create a point on intersection of two lines.
1393 theRefLine1, theRefLine2 The referenced lines.
1394 theName Object name; when specified, this parameter is used
1395 for result publication in the study. Otherwise, if automatic
1396 publication is switched on, default value is used for result name.
1399 New GEOM.GEOM_Object, containing the created point.
1401 # Example: see GEOM_TestAll.py
1402 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1403 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1404 self._autoPublish(anObj, theName, "vertex")
1407 ## Create a tangent, corresponding to the given parameter on the given curve.
1408 # @param theRefCurve The referenced curve.
1409 # @param theParameter Value of parameter on the referenced curve.
1410 # @param theName Object name; when specified, this parameter is used
1411 # for result publication in the study. Otherwise, if automatic
1412 # publication is switched on, default value is used for result name.
1414 # @return New GEOM.GEOM_Object, containing the created tangent.
1416 # @ref swig_MakeTangentOnCurve "Example"
1417 @ManageTransactions("BasicOp")
1418 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1420 Create a tangent, corresponding to the given parameter on the given curve.
1423 theRefCurve The referenced curve.
1424 theParameter Value of parameter on the referenced curve.
1425 theName Object name; when specified, this parameter is used
1426 for result publication in the study. Otherwise, if automatic
1427 publication is switched on, default value is used for result name.
1430 New GEOM.GEOM_Object, containing the created tangent.
1433 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1435 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1436 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1437 self._autoPublish(anObj, theName, "tangent")
1440 ## Create a tangent plane, corresponding to the given parameter on the given face.
1441 # @param theFace The face for which tangent plane should be built.
1442 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1443 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1444 # @param theTrimSize the size of plane.
1445 # @param theName Object name; when specified, this parameter is used
1446 # for result publication in the study. Otherwise, if automatic
1447 # publication is switched on, default value is used for result name.
1449 # @return New GEOM.GEOM_Object, containing the created tangent.
1451 # @ref swig_MakeTangentPlaneOnFace "Example"
1452 @ManageTransactions("BasicOp")
1453 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1455 Create a tangent plane, corresponding to the given parameter on the given face.
1458 theFace The face for which tangent plane should be built.
1459 theParameterV vertical value of the center point (0.0 - 1.0).
1460 theParameterU horisontal value of the center point (0.0 - 1.0).
1461 theTrimSize the size of plane.
1462 theName Object name; when specified, this parameter is used
1463 for result publication in the study. Otherwise, if automatic
1464 publication is switched on, default value is used for result name.
1467 New GEOM.GEOM_Object, containing the created tangent.
1470 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1472 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1473 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1474 self._autoPublish(anObj, theName, "tangent")
1477 ## Create a vector with the given components.
1478 # @param theDX X component of the vector.
1479 # @param theDY Y component of the vector.
1480 # @param theDZ Z component of the vector.
1481 # @param theName Object name; when specified, this parameter is used
1482 # for result publication in the study. Otherwise, if automatic
1483 # publication is switched on, default value is used for result name.
1485 # @return New GEOM.GEOM_Object, containing the created vector.
1487 # @ref tui_creation_vector "Example"
1488 @ManageTransactions("BasicOp")
1489 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1491 Create a vector with the given components.
1494 theDX X component of the vector.
1495 theDY Y component of the vector.
1496 theDZ Z component of the vector.
1497 theName Object name; when specified, this parameter is used
1498 for result publication in the study. Otherwise, if automatic
1499 publication is switched on, default value is used for result name.
1502 New GEOM.GEOM_Object, containing the created vector.
1504 # Example: see GEOM_TestAll.py
1505 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1506 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1507 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1508 anObj.SetParameters(Parameters)
1509 self._autoPublish(anObj, theName, "vector")
1512 ## Create a vector between two points.
1513 # @param thePnt1 Start point for the vector.
1514 # @param thePnt2 End point for the vector.
1515 # @param theName Object name; when specified, this parameter is used
1516 # for result publication in the study. Otherwise, if automatic
1517 # publication is switched on, default value is used for result name.
1519 # @return New GEOM.GEOM_Object, containing the created vector.
1521 # @ref tui_creation_vector "Example"
1522 @ManageTransactions("BasicOp")
1523 def MakeVector(self, thePnt1, thePnt2, theName=None):
1525 Create a vector between two points.
1528 thePnt1 Start point for the vector.
1529 thePnt2 End point for the vector.
1530 theName Object name; when specified, this parameter is used
1531 for result publication in the study. Otherwise, if automatic
1532 publication is switched on, default value is used for result name.
1535 New GEOM.GEOM_Object, containing the created vector.
1537 # Example: see GEOM_TestAll.py
1538 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1539 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1540 self._autoPublish(anObj, theName, "vector")
1543 ## Create a line, passing through the given point
1544 # and parrallel to the given direction
1545 # @param thePnt Point. The resulting line will pass through it.
1546 # @param theDir Direction. The resulting line will be parallel to it.
1547 # @param theName Object name; when specified, this parameter is used
1548 # for result publication in the study. Otherwise, if automatic
1549 # publication is switched on, default value is used for result name.
1551 # @return New GEOM.GEOM_Object, containing the created line.
1553 # @ref tui_creation_line "Example"
1554 @ManageTransactions("BasicOp")
1555 def MakeLine(self, thePnt, theDir, theName=None):
1557 Create a line, passing through the given point
1558 and parrallel to the given direction
1561 thePnt Point. The resulting line will pass through it.
1562 theDir Direction. The resulting line will be parallel to it.
1563 theName Object name; when specified, this parameter is used
1564 for result publication in the study. Otherwise, if automatic
1565 publication is switched on, default value is used for result name.
1568 New GEOM.GEOM_Object, containing the created line.
1570 # Example: see GEOM_TestAll.py
1571 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1572 RaiseIfFailed("MakeLine", self.BasicOp)
1573 self._autoPublish(anObj, theName, "line")
1576 ## Create a line, passing through the given points
1577 # @param thePnt1 First of two points, defining the line.
1578 # @param thePnt2 Second of two points, defining the line.
1579 # @param theName Object name; when specified, this parameter is used
1580 # for result publication in the study. Otherwise, if automatic
1581 # publication is switched on, default value is used for result name.
1583 # @return New GEOM.GEOM_Object, containing the created line.
1585 # @ref tui_creation_line "Example"
1586 @ManageTransactions("BasicOp")
1587 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1589 Create a line, passing through the given points
1592 thePnt1 First of two points, defining the line.
1593 thePnt2 Second of two points, defining the line.
1594 theName Object name; when specified, this parameter is used
1595 for result publication in the study. Otherwise, if automatic
1596 publication is switched on, default value is used for result name.
1599 New GEOM.GEOM_Object, containing the created line.
1601 # Example: see GEOM_TestAll.py
1602 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1603 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1604 self._autoPublish(anObj, theName, "line")
1607 ## Create a line on two faces intersection.
1608 # @param theFace1 First of two faces, defining the line.
1609 # @param theFace2 Second of two faces, defining the line.
1610 # @param theName Object name; when specified, this parameter is used
1611 # for result publication in the study. Otherwise, if automatic
1612 # publication is switched on, default value is used for result name.
1614 # @return New GEOM.GEOM_Object, containing the created line.
1616 # @ref swig_MakeLineTwoFaces "Example"
1617 @ManageTransactions("BasicOp")
1618 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1620 Create a line on two faces intersection.
1623 theFace1 First of two faces, defining the line.
1624 theFace2 Second of two faces, defining the line.
1625 theName Object name; when specified, this parameter is used
1626 for result publication in the study. Otherwise, if automatic
1627 publication is switched on, default value is used for result name.
1630 New GEOM.GEOM_Object, containing the created line.
1632 # Example: see GEOM_TestAll.py
1633 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1634 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1635 self._autoPublish(anObj, theName, "line")
1638 ## Create a plane, passing through the given point
1639 # and normal to the given vector.
1640 # @param thePnt Point, the plane has to pass through.
1641 # @param theVec Vector, defining the plane normal direction.
1642 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1643 # @param theName Object name; when specified, this parameter is used
1644 # for result publication in the study. Otherwise, if automatic
1645 # publication is switched on, default value is used for result name.
1647 # @return New GEOM.GEOM_Object, containing the created plane.
1649 # @ref tui_creation_plane "Example"
1650 @ManageTransactions("BasicOp")
1651 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1653 Create a plane, passing through the given point
1654 and normal to the given vector.
1657 thePnt Point, the plane has to pass through.
1658 theVec Vector, defining the plane normal direction.
1659 theTrimSize Half size of a side of quadrangle face, representing the plane.
1660 theName Object name; when specified, this parameter is used
1661 for result publication in the study. Otherwise, if automatic
1662 publication is switched on, default value is used for result name.
1665 New GEOM.GEOM_Object, containing the created plane.
1667 # Example: see GEOM_TestAll.py
1668 theTrimSize, Parameters = ParseParameters(theTrimSize);
1669 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1670 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1671 anObj.SetParameters(Parameters)
1672 self._autoPublish(anObj, theName, "plane")
1675 ## Create a plane, passing through the three given points
1676 # @param thePnt1 First of three points, defining the plane.
1677 # @param thePnt2 Second of three points, defining the plane.
1678 # @param thePnt3 Fird of three points, defining the plane.
1679 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1680 # @param theName Object name; when specified, this parameter is used
1681 # for result publication in the study. Otherwise, if automatic
1682 # publication is switched on, default value is used for result name.
1684 # @return New GEOM.GEOM_Object, containing the created plane.
1686 # @ref tui_creation_plane "Example"
1687 @ManageTransactions("BasicOp")
1688 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1690 Create a plane, passing through the three given points
1693 thePnt1 First of three points, defining the plane.
1694 thePnt2 Second of three points, defining the plane.
1695 thePnt3 Fird of three points, defining the plane.
1696 theTrimSize Half size of a side of quadrangle face, representing the plane.
1697 theName Object name; when specified, this parameter is used
1698 for result publication in the study. Otherwise, if automatic
1699 publication is switched on, default value is used for result name.
1702 New GEOM.GEOM_Object, containing the created plane.
1704 # Example: see GEOM_TestAll.py
1705 theTrimSize, Parameters = ParseParameters(theTrimSize);
1706 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1707 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1708 anObj.SetParameters(Parameters)
1709 self._autoPublish(anObj, theName, "plane")
1712 ## Create a plane, similar to the existing one, but with another size of representing face.
1713 # @param theFace Referenced plane or LCS(Marker).
1714 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1715 # @param theName Object name; when specified, this parameter is used
1716 # for result publication in the study. Otherwise, if automatic
1717 # publication is switched on, default value is used for result name.
1719 # @return New GEOM.GEOM_Object, containing the created plane.
1721 # @ref tui_creation_plane "Example"
1722 @ManageTransactions("BasicOp")
1723 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1725 Create a plane, similar to the existing one, but with another size of representing face.
1728 theFace Referenced plane or LCS(Marker).
1729 theTrimSize New half size of a side of quadrangle face, representing the plane.
1730 theName Object name; when specified, this parameter is used
1731 for result publication in the study. Otherwise, if automatic
1732 publication is switched on, default value is used for result name.
1735 New GEOM.GEOM_Object, containing the created plane.
1737 # Example: see GEOM_TestAll.py
1738 theTrimSize, Parameters = ParseParameters(theTrimSize);
1739 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1740 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1741 anObj.SetParameters(Parameters)
1742 self._autoPublish(anObj, theName, "plane")
1745 ## Create a plane, passing through the 2 vectors
1746 # with center in a start point of the first vector.
1747 # @param theVec1 Vector, defining center point and plane direction.
1748 # @param theVec2 Vector, defining the plane normal direction.
1749 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1750 # @param theName Object name; when specified, this parameter is used
1751 # for result publication in the study. Otherwise, if automatic
1752 # publication is switched on, default value is used for result name.
1754 # @return New GEOM.GEOM_Object, containing the created plane.
1756 # @ref tui_creation_plane "Example"
1757 @ManageTransactions("BasicOp")
1758 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1760 Create a plane, passing through the 2 vectors
1761 with center in a start point of the first vector.
1764 theVec1 Vector, defining center point and plane direction.
1765 theVec2 Vector, defining the plane normal direction.
1766 theTrimSize Half size of a side of quadrangle face, representing the plane.
1767 theName Object name; when specified, this parameter is used
1768 for result publication in the study. Otherwise, if automatic
1769 publication is switched on, default value is used for result name.
1772 New GEOM.GEOM_Object, containing the created plane.
1774 # Example: see GEOM_TestAll.py
1775 theTrimSize, Parameters = ParseParameters(theTrimSize);
1776 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1777 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1778 anObj.SetParameters(Parameters)
1779 self._autoPublish(anObj, theName, "plane")
1782 ## Create a plane, based on a Local coordinate system.
1783 # @param theLCS coordinate system, defining plane.
1784 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1785 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1786 # @param theName Object name; when specified, this parameter is used
1787 # for result publication in the study. Otherwise, if automatic
1788 # publication is switched on, default value is used for result name.
1790 # @return New GEOM.GEOM_Object, containing the created plane.
1792 # @ref tui_creation_plane "Example"
1793 @ManageTransactions("BasicOp")
1794 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1796 Create a plane, based on a Local coordinate system.
1799 theLCS coordinate system, defining plane.
1800 theTrimSize Half size of a side of quadrangle face, representing the plane.
1801 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1802 theName Object name; when specified, this parameter is used
1803 for result publication in the study. Otherwise, if automatic
1804 publication is switched on, default value is used for result name.
1807 New GEOM.GEOM_Object, containing the created plane.
1809 # Example: see GEOM_TestAll.py
1810 theTrimSize, Parameters = ParseParameters(theTrimSize);
1811 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1812 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1813 anObj.SetParameters(Parameters)
1814 self._autoPublish(anObj, theName, "plane")
1817 ## Create a local coordinate system.
1818 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1819 # @param XDX,XDY,XDZ Three components of OX direction
1820 # @param YDX,YDY,YDZ Three components of OY direction
1821 # @param theName Object name; when specified, this parameter is used
1822 # for result publication in the study. Otherwise, if automatic
1823 # publication is switched on, default value is used for result name.
1825 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1827 # @ref swig_MakeMarker "Example"
1828 @ManageTransactions("BasicOp")
1829 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1831 Create a local coordinate system.
1834 OX,OY,OZ Three coordinates of coordinate system origin.
1835 XDX,XDY,XDZ Three components of OX direction
1836 YDX,YDY,YDZ Three components of OY direction
1837 theName Object name; when specified, this parameter is used
1838 for result publication in the study. Otherwise, if automatic
1839 publication is switched on, default value is used for result name.
1842 New GEOM.GEOM_Object, containing the created coordinate system.
1844 # Example: see GEOM_TestAll.py
1845 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1846 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1847 RaiseIfFailed("MakeMarker", self.BasicOp)
1848 anObj.SetParameters(Parameters)
1849 self._autoPublish(anObj, theName, "lcs")
1852 ## Create a local coordinate system from shape.
1853 # @param theShape The initial shape to detect the coordinate system.
1854 # @param theName Object name; when specified, this parameter is used
1855 # for result publication in the study. Otherwise, if automatic
1856 # publication is switched on, default value is used for result name.
1858 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1860 # @ref tui_creation_lcs "Example"
1861 @ManageTransactions("BasicOp")
1862 def MakeMarkerFromShape(self, theShape, theName=None):
1864 Create a local coordinate system from shape.
1867 theShape The initial shape to detect the coordinate system.
1868 theName Object name; when specified, this parameter is used
1869 for result publication in the study. Otherwise, if automatic
1870 publication is switched on, default value is used for result name.
1873 New GEOM.GEOM_Object, containing the created coordinate system.
1875 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1876 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1877 self._autoPublish(anObj, theName, "lcs")
1880 ## Create a local coordinate system from point and two vectors.
1881 # @param theOrigin Point of coordinate system origin.
1882 # @param theXVec Vector of X direction
1883 # @param theYVec Vector of Y direction
1884 # @param theName Object name; when specified, this parameter is used
1885 # for result publication in the study. Otherwise, if automatic
1886 # publication is switched on, default value is used for result name.
1888 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1890 # @ref tui_creation_lcs "Example"
1891 @ManageTransactions("BasicOp")
1892 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1894 Create a local coordinate system from point and two vectors.
1897 theOrigin Point of coordinate system origin.
1898 theXVec Vector of X direction
1899 theYVec Vector of Y direction
1900 theName Object name; when specified, this parameter is used
1901 for result publication in the study. Otherwise, if automatic
1902 publication is switched on, default value is used for result name.
1905 New GEOM.GEOM_Object, containing the created coordinate system.
1908 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1909 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1910 self._autoPublish(anObj, theName, "lcs")
1913 # end of l3_basic_go
1916 ## @addtogroup l4_curves
1919 ## Create an arc of circle, passing through three given points.
1920 # @param thePnt1 Start point of the arc.
1921 # @param thePnt2 Middle point of the arc.
1922 # @param thePnt3 End point of the arc.
1923 # @param theName Object name; when specified, this parameter is used
1924 # for result publication in the study. Otherwise, if automatic
1925 # publication is switched on, default value is used for result name.
1927 # @return New GEOM.GEOM_Object, containing the created arc.
1929 # @ref swig_MakeArc "Example"
1930 @ManageTransactions("CurvesOp")
1931 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1933 Create an arc of circle, passing through three given points.
1936 thePnt1 Start point of the arc.
1937 thePnt2 Middle point of the arc.
1938 thePnt3 End point of the arc.
1939 theName Object name; when specified, this parameter is used
1940 for result publication in the study. Otherwise, if automatic
1941 publication is switched on, default value is used for result name.
1944 New GEOM.GEOM_Object, containing the created arc.
1946 # Example: see GEOM_TestAll.py
1947 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1948 RaiseIfFailed("MakeArc", self.CurvesOp)
1949 self._autoPublish(anObj, theName, "arc")
1952 ## Create an arc of circle from a center and 2 points.
1953 # @param thePnt1 Center of the arc
1954 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1955 # @param thePnt3 End point of the arc (Gives also a direction)
1956 # @param theSense Orientation of the arc
1957 # @param theName Object name; when specified, this parameter is used
1958 # for result publication in the study. Otherwise, if automatic
1959 # publication is switched on, default value is used for result name.
1961 # @return New GEOM.GEOM_Object, containing the created arc.
1963 # @ref swig_MakeArc "Example"
1964 @ManageTransactions("CurvesOp")
1965 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1967 Create an arc of circle from a center and 2 points.
1970 thePnt1 Center of the arc
1971 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1972 thePnt3 End point of the arc (Gives also a direction)
1973 theSense Orientation of the arc
1974 theName Object name; when specified, this parameter is used
1975 for result publication in the study. Otherwise, if automatic
1976 publication is switched on, default value is used for result name.
1979 New GEOM.GEOM_Object, containing the created arc.
1981 # Example: see GEOM_TestAll.py
1982 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1983 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1984 self._autoPublish(anObj, theName, "arc")
1987 ## Create an arc of ellipse, of center and two points.
1988 # @param theCenter Center of the arc.
1989 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1990 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1991 # @param theName Object name; when specified, this parameter is used
1992 # for result publication in the study. Otherwise, if automatic
1993 # publication is switched on, default value is used for result name.
1995 # @return New GEOM.GEOM_Object, containing the created arc.
1997 # @ref swig_MakeArc "Example"
1998 @ManageTransactions("CurvesOp")
1999 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2001 Create an arc of ellipse, of center and two points.
2004 theCenter Center of the arc.
2005 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2006 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2007 theName Object name; when specified, this parameter is used
2008 for result publication in the study. Otherwise, if automatic
2009 publication is switched on, default value is used for result name.
2012 New GEOM.GEOM_Object, containing the created arc.
2014 # Example: see GEOM_TestAll.py
2015 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2016 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2017 self._autoPublish(anObj, theName, "arc")
2020 ## Create a circle with given center, normal vector and radius.
2021 # @param thePnt Circle center.
2022 # @param theVec Vector, normal to the plane of the circle.
2023 # @param theR Circle radius.
2024 # @param theName Object name; when specified, this parameter is used
2025 # for result publication in the study. Otherwise, if automatic
2026 # publication is switched on, default value is used for result name.
2028 # @return New GEOM.GEOM_Object, containing the created circle.
2030 # @ref tui_creation_circle "Example"
2031 @ManageTransactions("CurvesOp")
2032 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2034 Create a circle with given center, normal vector and radius.
2037 thePnt Circle center.
2038 theVec Vector, normal to the plane of the circle.
2040 theName Object name; when specified, this parameter is used
2041 for result publication in the study. Otherwise, if automatic
2042 publication is switched on, default value is used for result name.
2045 New GEOM.GEOM_Object, containing the created circle.
2047 # Example: see GEOM_TestAll.py
2048 theR, Parameters = ParseParameters(theR)
2049 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2050 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2051 anObj.SetParameters(Parameters)
2052 self._autoPublish(anObj, theName, "circle")
2055 ## Create a circle with given radius.
2056 # Center of the circle will be in the origin of global
2057 # coordinate system and normal vector will be codirected with Z axis
2058 # @param theR Circle radius.
2059 # @param theName Object name; when specified, this parameter is used
2060 # for result publication in the study. Otherwise, if automatic
2061 # publication is switched on, default value is used for result name.
2063 # @return New GEOM.GEOM_Object, containing the created circle.
2064 @ManageTransactions("CurvesOp")
2065 def MakeCircleR(self, theR, theName=None):
2067 Create a circle with given radius.
2068 Center of the circle will be in the origin of global
2069 coordinate system and normal vector will be codirected with Z axis
2073 theName Object name; when specified, this parameter is used
2074 for result publication in the study. Otherwise, if automatic
2075 publication is switched on, default value is used for result name.
2078 New GEOM.GEOM_Object, containing the created circle.
2080 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2081 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2082 self._autoPublish(anObj, theName, "circle")
2085 ## Create a circle, passing through three given points
2086 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2087 # @param theName Object name; when specified, this parameter is used
2088 # for result publication in the study. Otherwise, if automatic
2089 # publication is switched on, default value is used for result name.
2091 # @return New GEOM.GEOM_Object, containing the created circle.
2093 # @ref tui_creation_circle "Example"
2094 @ManageTransactions("CurvesOp")
2095 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2097 Create a circle, passing through three given points
2100 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2101 theName Object name; when specified, this parameter is used
2102 for result publication in the study. Otherwise, if automatic
2103 publication is switched on, default value is used for result name.
2106 New GEOM.GEOM_Object, containing the created circle.
2108 # Example: see GEOM_TestAll.py
2109 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2110 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2111 self._autoPublish(anObj, theName, "circle")
2114 ## Create a circle, with given point1 as center,
2115 # passing through the point2 as radius and laying in the plane,
2116 # defined by all three given points.
2117 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2118 # @param theName Object name; when specified, this parameter is used
2119 # for result publication in the study. Otherwise, if automatic
2120 # publication is switched on, default value is used for result name.
2122 # @return New GEOM.GEOM_Object, containing the created circle.
2124 # @ref swig_MakeCircle "Example"
2125 @ManageTransactions("CurvesOp")
2126 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2128 Create a circle, with given point1 as center,
2129 passing through the point2 as radius and laying in the plane,
2130 defined by all three given points.
2133 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2134 theName Object name; when specified, this parameter is used
2135 for result publication in the study. Otherwise, if automatic
2136 publication is switched on, default value is used for result name.
2139 New GEOM.GEOM_Object, containing the created circle.
2141 # Example: see GEOM_example6.py
2142 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2143 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2144 self._autoPublish(anObj, theName, "circle")
2147 ## Create an ellipse with given center, normal vector and radiuses.
2148 # @param thePnt Ellipse center.
2149 # @param theVec Vector, normal to the plane of the ellipse.
2150 # @param theRMajor Major ellipse radius.
2151 # @param theRMinor Minor ellipse radius.
2152 # @param theVecMaj Vector, direction of the ellipse's main axis.
2153 # @param theName Object name; when specified, this parameter is used
2154 # for result publication in the study. Otherwise, if automatic
2155 # publication is switched on, default value is used for result name.
2157 # @return New GEOM.GEOM_Object, containing the created ellipse.
2159 # @ref tui_creation_ellipse "Example"
2160 @ManageTransactions("CurvesOp")
2161 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2163 Create an ellipse with given center, normal vector and radiuses.
2166 thePnt Ellipse center.
2167 theVec Vector, normal to the plane of the ellipse.
2168 theRMajor Major ellipse radius.
2169 theRMinor Minor ellipse radius.
2170 theVecMaj Vector, direction of the ellipse's main axis.
2171 theName Object name; when specified, this parameter is used
2172 for result publication in the study. Otherwise, if automatic
2173 publication is switched on, default value is used for result name.
2176 New GEOM.GEOM_Object, containing the created ellipse.
2178 # Example: see GEOM_TestAll.py
2179 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2180 if theVecMaj is not None:
2181 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2183 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2185 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2186 anObj.SetParameters(Parameters)
2187 self._autoPublish(anObj, theName, "ellipse")
2190 ## Create an ellipse with given radiuses.
2191 # Center of the ellipse will be in the origin of global
2192 # coordinate system and normal vector will be codirected with Z axis
2193 # @param theRMajor Major ellipse radius.
2194 # @param theRMinor Minor ellipse radius.
2195 # @param theName Object name; when specified, this parameter is used
2196 # for result publication in the study. Otherwise, if automatic
2197 # publication is switched on, default value is used for result name.
2199 # @return New GEOM.GEOM_Object, containing the created ellipse.
2200 @ManageTransactions("CurvesOp")
2201 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2203 Create an ellipse with given radiuses.
2204 Center of the ellipse will be in the origin of global
2205 coordinate system and normal vector will be codirected with Z axis
2208 theRMajor Major ellipse radius.
2209 theRMinor Minor ellipse radius.
2210 theName Object name; when specified, this parameter is used
2211 for result publication in the study. Otherwise, if automatic
2212 publication is switched on, default value is used for result name.
2215 New GEOM.GEOM_Object, containing the created ellipse.
2217 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2218 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2219 self._autoPublish(anObj, theName, "ellipse")
2222 ## Create a polyline on the set of points.
2223 # @param thePoints Sequence of points for the polyline.
2224 # @param theIsClosed If True, build a closed wire.
2225 # @param theName Object name; when specified, this parameter is used
2226 # for result publication in the study. Otherwise, if automatic
2227 # publication is switched on, default value is used for result name.
2229 # @return New GEOM.GEOM_Object, containing the created polyline.
2231 # @ref tui_creation_curve "Example"
2232 @ManageTransactions("CurvesOp")
2233 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2235 Create a polyline on the set of points.
2238 thePoints Sequence of points for the polyline.
2239 theIsClosed If True, build a closed wire.
2240 theName Object name; when specified, this parameter is used
2241 for result publication in the study. Otherwise, if automatic
2242 publication is switched on, default value is used for result name.
2245 New GEOM.GEOM_Object, containing the created polyline.
2247 # Example: see GEOM_TestAll.py
2248 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2249 RaiseIfFailed("MakePolyline", self.CurvesOp)
2250 self._autoPublish(anObj, theName, "polyline")
2253 ## Create bezier curve on the set of points.
2254 # @param thePoints Sequence of points for the bezier curve.
2255 # @param theIsClosed If True, build a closed curve.
2256 # @param theName Object name; when specified, this parameter is used
2257 # for result publication in the study. Otherwise, if automatic
2258 # publication is switched on, default value is used for result name.
2260 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2262 # @ref tui_creation_curve "Example"
2263 @ManageTransactions("CurvesOp")
2264 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2266 Create bezier curve on the set of points.
2269 thePoints Sequence of points for the bezier curve.
2270 theIsClosed If True, build a closed curve.
2271 theName Object name; when specified, this parameter is used
2272 for result publication in the study. Otherwise, if automatic
2273 publication is switched on, default value is used for result name.
2276 New GEOM.GEOM_Object, containing the created bezier curve.
2278 # Example: see GEOM_TestAll.py
2279 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2280 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2281 self._autoPublish(anObj, theName, "bezier")
2284 ## Create B-Spline curve on the set of points.
2285 # @param thePoints Sequence of points for the B-Spline curve.
2286 # @param theIsClosed If True, build a closed curve.
2287 # @param theDoReordering If TRUE, the algo does not follow the order of
2288 # \a thePoints but searches for the closest vertex.
2289 # @param theName Object name; when specified, this parameter is used
2290 # for result publication in the study. Otherwise, if automatic
2291 # publication is switched on, default value is used for result name.
2293 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2295 # @ref tui_creation_curve "Example"
2296 @ManageTransactions("CurvesOp")
2297 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2299 Create B-Spline curve on the set of points.
2302 thePoints Sequence of points for the B-Spline curve.
2303 theIsClosed If True, build a closed curve.
2304 theDoReordering If True, the algo does not follow the order of
2305 thePoints but searches for the closest vertex.
2306 theName Object name; when specified, this parameter is used
2307 for result publication in the study. Otherwise, if automatic
2308 publication is switched on, default value is used for result name.
2311 New GEOM.GEOM_Object, containing the created B-Spline curve.
2313 # Example: see GEOM_TestAll.py
2314 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2315 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2316 self._autoPublish(anObj, theName, "bspline")
2319 ## Create B-Spline curve on the set of points.
2320 # @param thePoints Sequence of points for the B-Spline curve.
2321 # @param theFirstVec Vector object, defining the curve direction at its first point.
2322 # @param theLastVec Vector object, defining the curve direction at its last point.
2323 # @param theName Object name; when specified, this parameter is used
2324 # for result publication in the study. Otherwise, if automatic
2325 # publication is switched on, default value is used for result name.
2327 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2329 # @ref tui_creation_curve "Example"
2330 @ManageTransactions("CurvesOp")
2331 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2333 Create B-Spline curve on the set of points.
2336 thePoints Sequence of points for the B-Spline curve.
2337 theFirstVec Vector object, defining the curve direction at its first point.
2338 theLastVec Vector object, defining the curve direction at its last point.
2339 theName Object name; when specified, this parameter is used
2340 for result publication in the study. Otherwise, if automatic
2341 publication is switched on, default value is used for result name.
2344 New GEOM.GEOM_Object, containing the created B-Spline curve.
2346 # Example: see GEOM_TestAll.py
2347 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2348 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2349 self._autoPublish(anObj, theName, "bspline")
2352 ## Creates a curve using the parametric definition of the basic points.
2353 # @param thexExpr parametric equation of the coordinates X.
2354 # @param theyExpr parametric equation of the coordinates Y.
2355 # @param thezExpr parametric equation of the coordinates Z.
2356 # @param theParamMin the minimal value of the parameter.
2357 # @param theParamMax the maximum value of the parameter.
2358 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2359 # @param theCurveType the type of the curve,
2360 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2361 # @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.
2362 # @param theName Object name; when specified, this parameter is used
2363 # for result publication in the study. Otherwise, if automatic
2364 # publication is switched on, default value is used for result name.
2366 # @return New GEOM.GEOM_Object, containing the created curve.
2368 # @ref tui_creation_curve "Example"
2369 @ManageTransactions("CurvesOp")
2370 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2371 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2373 Creates a curve using the parametric definition of the basic points.
2376 thexExpr parametric equation of the coordinates X.
2377 theyExpr parametric equation of the coordinates Y.
2378 thezExpr parametric equation of the coordinates Z.
2379 theParamMin the minimal value of the parameter.
2380 theParamMax the maximum value of the parameter.
2381 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2382 theCurveType the type of the curve,
2383 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2384 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2385 method is used which can lead to a bug.
2386 theName Object name; when specified, this parameter is used
2387 for result publication in the study. Otherwise, if automatic
2388 publication is switched on, default value is used for result name.
2391 New GEOM.GEOM_Object, containing the created curve.
2393 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2395 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2397 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2398 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2399 anObj.SetParameters(Parameters)
2400 self._autoPublish(anObj, theName, "curve")
2403 ## Create an isoline curve on a face.
2404 # @param theFace the face for which an isoline is created.
2405 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2407 # @param theParameter the U parameter for U-isoline or V parameter
2409 # @param theName Object name; when specified, this parameter is used
2410 # for result publication in the study. Otherwise, if automatic
2411 # publication is switched on, default value is used for result name.
2413 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2414 # a compound of edges.
2416 # @ref tui_creation_curve "Example"
2417 @ManageTransactions("CurvesOp")
2418 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2420 Create an isoline curve on a face.
2423 theFace the face for which an isoline is created.
2424 IsUIsoline True for U-isoline creation; False for V-isoline
2426 theParameter the U parameter for U-isoline or V parameter
2428 theName Object name; when specified, this parameter is used
2429 for result publication in the study. Otherwise, if automatic
2430 publication is switched on, default value is used for result name.
2433 New GEOM.GEOM_Object, containing the created isoline edge or a
2436 # Example: see GEOM_TestAll.py
2437 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2438 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2440 self._autoPublish(anObj, theName, "U-Isoline")
2442 self._autoPublish(anObj, theName, "V-Isoline")
2448 ## @addtogroup l3_sketcher
2451 ## Create a sketcher (wire or face), following the textual description,
2452 # passed through <VAR>theCommand</VAR> argument. \n
2453 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2454 # Format of the description string have to be the following:
2456 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2459 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2461 # - "R angle" : Set the direction by angle
2462 # - "D dx dy" : Set the direction by DX & DY
2465 # - "TT x y" : Create segment by point at X & Y
2466 # - "T dx dy" : Create segment by point with DX & DY
2467 # - "L length" : Create segment by direction & Length
2468 # - "IX x" : Create segment by direction & Intersect. X
2469 # - "IY y" : Create segment by direction & Intersect. Y
2472 # - "C radius length" : Create arc by direction, radius and length(in degree)
2473 # - "AA x y": Create arc by point at X & Y
2474 # - "A dx dy" : Create arc by point with DX & DY
2475 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2476 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2477 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2478 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2481 # - "WW" : Close Wire (to finish)
2482 # - "WF" : Close Wire and build face (to finish)
2485 # - Flag1 (= reverse) is 0 or 2 ...
2486 # - if 0 the drawn arc is the one of lower angle (< Pi)
2487 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2490 # - Flag2 (= control tolerance) is 0 or 1 ...
2491 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2492 # - if 1 the wire is built only if the end point is on the arc
2493 # with a tolerance of 10^-7 on the distance else the creation fails
2495 # @param theCommand String, defining the sketcher in local
2496 # coordinates of the working plane.
2497 # @param theWorkingPlane Nine double values, defining origin,
2498 # OZ and OX directions of the working plane.
2499 # @param theName Object name; when specified, this parameter is used
2500 # for result publication in the study. Otherwise, if automatic
2501 # publication is switched on, default value is used for result name.
2503 # @return New GEOM.GEOM_Object, containing the created wire.
2505 # @ref tui_sketcher_page "Example"
2506 @ManageTransactions("CurvesOp")
2507 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2509 Create a sketcher (wire or face), following the textual description, passed
2510 through theCommand argument.
2511 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2512 Format of the description string have to be the following:
2513 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2515 - x1, y1 are coordinates of the first sketcher point (zero by default),
2517 - "R angle" : Set the direction by angle
2518 - "D dx dy" : Set the direction by DX & DY
2520 - "TT x y" : Create segment by point at X & Y
2521 - "T dx dy" : Create segment by point with DX & DY
2522 - "L length" : Create segment by direction & Length
2523 - "IX x" : Create segment by direction & Intersect. X
2524 - "IY y" : Create segment by direction & Intersect. Y
2526 - "C radius length" : Create arc by direction, radius and length(in degree)
2527 - "AA x y": Create arc by point at X & Y
2528 - "A dx dy" : Create arc by point with DX & DY
2529 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2530 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2531 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2532 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2534 - "WW" : Close Wire (to finish)
2535 - "WF" : Close Wire and build face (to finish)
2537 - Flag1 (= reverse) is 0 or 2 ...
2538 - if 0 the drawn arc is the one of lower angle (< Pi)
2539 - if 2 the drawn arc ius the one of greater angle (> Pi)
2541 - Flag2 (= control tolerance) is 0 or 1 ...
2542 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2543 - if 1 the wire is built only if the end point is on the arc
2544 with a tolerance of 10^-7 on the distance else the creation fails
2547 theCommand String, defining the sketcher in local
2548 coordinates of the working plane.
2549 theWorkingPlane Nine double values, defining origin,
2550 OZ and OX directions of the working plane.
2551 theName Object name; when specified, this parameter is used
2552 for result publication in the study. Otherwise, if automatic
2553 publication is switched on, default value is used for result name.
2556 New GEOM.GEOM_Object, containing the created wire.
2558 # Example: see GEOM_TestAll.py
2559 theCommand,Parameters = ParseSketcherCommand(theCommand)
2560 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2561 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2562 anObj.SetParameters(Parameters)
2563 self._autoPublish(anObj, theName, "wire")
2566 ## Create a sketcher (wire or face), following the textual description,
2567 # passed through <VAR>theCommand</VAR> argument. \n
2568 # For format of the description string see MakeSketcher() method.\n
2569 # @param theCommand String, defining the sketcher in local
2570 # coordinates of the working plane.
2571 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2572 # @param theName Object name; when specified, this parameter is used
2573 # for result publication in the study. Otherwise, if automatic
2574 # publication is switched on, default value is used for result name.
2576 # @return New GEOM.GEOM_Object, containing the created wire.
2578 # @ref tui_sketcher_page "Example"
2579 @ManageTransactions("CurvesOp")
2580 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2582 Create a sketcher (wire or face), following the textual description,
2583 passed through theCommand argument.
2584 For format of the description string see geompy.MakeSketcher() method.
2587 theCommand String, defining the sketcher in local
2588 coordinates of the working plane.
2589 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2590 theName Object name; when specified, this parameter is used
2591 for result publication in the study. Otherwise, if automatic
2592 publication is switched on, default value is used for result name.
2595 New GEOM.GEOM_Object, containing the created wire.
2597 theCommand,Parameters = ParseSketcherCommand(theCommand)
2598 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2599 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2600 anObj.SetParameters(Parameters)
2601 self._autoPublish(anObj, theName, "wire")
2604 ## Obtain a 2D sketcher interface
2605 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2606 def Sketcher2D (self):
2608 Obtain a 2D sketcher interface.
2611 sk = geompy.Sketcher2D()
2613 sk.addSegmentRelative(15, 70)
2614 sk.addSegmentPerpY(50)
2615 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2616 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2617 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2619 Sketch_1 = sk.wire(geomObj_1)
2621 sk = Sketcher2D (self)
2624 ## Create a sketcher wire, following the numerical description,
2625 # passed through <VAR>theCoordinates</VAR> argument. \n
2626 # @param theCoordinates double values, defining points to create a wire,
2628 # @param theName Object name; when specified, this parameter is used
2629 # for result publication in the study. Otherwise, if automatic
2630 # publication is switched on, default value is used for result name.
2632 # @return New GEOM.GEOM_Object, containing the created wire.
2634 # @ref tui_3dsketcher_page "Example"
2635 @ManageTransactions("CurvesOp")
2636 def Make3DSketcher(self, theCoordinates, theName=None):
2638 Create a sketcher wire, following the numerical description,
2639 passed through theCoordinates argument.
2642 theCoordinates double values, defining points to create a wire,
2644 theName Object name; when specified, this parameter is used
2645 for result publication in the study. Otherwise, if automatic
2646 publication is switched on, default value is used for result name.
2649 New GEOM_Object, containing the created wire.
2651 theCoordinates,Parameters = ParseParameters(theCoordinates)
2652 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2653 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2654 anObj.SetParameters(Parameters)
2655 self._autoPublish(anObj, theName, "wire")
2658 ## Obtain a 3D sketcher interface
2659 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2661 # @ref tui_3dsketcher_page "Example"
2662 def Sketcher3D (self):
2664 Obtain a 3D sketcher interface.
2667 sk = geompy.Sketcher3D()
2668 sk.addPointsAbsolute(0,0,0, 70,0,0)
2669 sk.addPointsRelative(0, 0, 130)
2670 sk.addPointAnglesLength("OXY", 50, 0, 100)
2671 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2673 a3D_Sketcher_1 = sk.wire()
2675 sk = Sketcher3D (self)
2678 ## Obtain a 2D polyline creation interface
2679 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2681 # @ref tui_3dsketcher_page "Example"
2682 def Polyline2D (self):
2684 Obtain a 2D polyline creation interface.
2687 pl = geompy.Polyline2D()
2688 pl.addSection("section 1", GEOM.Polyline, True)
2689 pl.addPoints(0, 0, 10, 0, 10, 10)
2690 pl.addSection("section 2", GEOM.Interpolation, False)
2691 pl.addPoints(20, 0, 30, 0, 30, 10)
2692 resultObj = pl.result(WorkingPlane)
2694 pl = Polyline2D (self)
2697 # end of l3_sketcher
2700 ## @addtogroup l3_3d_primitives
2703 ## Create a box by coordinates of two opposite vertices.
2705 # @param x1,y1,z1 double values, defining first point it.
2706 # @param x2,y2,z2 double values, defining first point it.
2707 # @param theName Object name; when specified, this parameter is used
2708 # for result publication in the study. Otherwise, if automatic
2709 # publication is switched on, default value is used for result name.
2711 # @return New GEOM.GEOM_Object, containing the created box.
2713 # @ref tui_creation_box "Example"
2714 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2716 Create a box by coordinates of two opposite vertices.
2719 x1,y1,z1 double values, defining first point.
2720 x2,y2,z2 double values, defining second point.
2721 theName Object name; when specified, this parameter is used
2722 for result publication in the study. Otherwise, if automatic
2723 publication is switched on, default value is used for result name.
2726 New GEOM.GEOM_Object, containing the created box.
2728 # Example: see GEOM_TestAll.py
2729 pnt1 = self.MakeVertex(x1,y1,z1)
2730 pnt2 = self.MakeVertex(x2,y2,z2)
2731 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2732 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2734 ## Create a box with specified dimensions along the coordinate axes
2735 # and with edges, parallel to the coordinate axes.
2736 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2737 # @param theDX Length of Box edges, parallel to OX axis.
2738 # @param theDY Length of Box edges, parallel to OY axis.
2739 # @param theDZ Length of Box edges, parallel to OZ axis.
2740 # @param theName Object name; when specified, this parameter is used
2741 # for result publication in the study. Otherwise, if automatic
2742 # publication is switched on, default value is used for result name.
2744 # @return New GEOM.GEOM_Object, containing the created box.
2746 # @ref tui_creation_box "Example"
2747 @ManageTransactions("PrimOp")
2748 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2750 Create a box with specified dimensions along the coordinate axes
2751 and with edges, parallel to the coordinate axes.
2752 Center of the box will be at point (DX/2, DY/2, DZ/2).
2755 theDX Length of Box edges, parallel to OX axis.
2756 theDY Length of Box edges, parallel to OY axis.
2757 theDZ Length of Box edges, parallel to OZ axis.
2758 theName Object name; when specified, this parameter is used
2759 for result publication in the study. Otherwise, if automatic
2760 publication is switched on, default value is used for result name.
2763 New GEOM.GEOM_Object, containing the created box.
2765 # Example: see GEOM_TestAll.py
2766 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2767 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2768 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2769 anObj.SetParameters(Parameters)
2770 self._autoPublish(anObj, theName, "box")
2773 ## Create a box with two specified opposite vertices,
2774 # and with edges, parallel to the coordinate axes
2775 # @param thePnt1 First of two opposite vertices.
2776 # @param thePnt2 Second of two opposite vertices.
2777 # @param theName Object name; when specified, this parameter is used
2778 # for result publication in the study. Otherwise, if automatic
2779 # publication is switched on, default value is used for result name.
2781 # @return New GEOM.GEOM_Object, containing the created box.
2783 # @ref tui_creation_box "Example"
2784 @ManageTransactions("PrimOp")
2785 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2787 Create a box with two specified opposite vertices,
2788 and with edges, parallel to the coordinate axes
2791 thePnt1 First of two opposite vertices.
2792 thePnt2 Second of two opposite vertices.
2793 theName Object name; when specified, this parameter is used
2794 for result publication in the study. Otherwise, if automatic
2795 publication is switched on, default value is used for result name.
2798 New GEOM.GEOM_Object, containing the created box.
2800 # Example: see GEOM_TestAll.py
2801 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2802 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2803 self._autoPublish(anObj, theName, "box")
2806 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2807 # @param theH height of Face.
2808 # @param theW width of Face.
2809 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2810 # @param theName Object name; when specified, this parameter is used
2811 # for result publication in the study. Otherwise, if automatic
2812 # publication is switched on, default value is used for result name.
2814 # @return New GEOM.GEOM_Object, containing the created face.
2816 # @ref tui_creation_face "Example"
2817 @ManageTransactions("PrimOp")
2818 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2820 Create a face with specified dimensions with edges parallel to coordinate axes.
2823 theH height of Face.
2825 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2826 theName Object name; when specified, this parameter is used
2827 for result publication in the study. Otherwise, if automatic
2828 publication is switched on, default value is used for result name.
2831 New GEOM.GEOM_Object, containing the created face.
2833 # Example: see GEOM_TestAll.py
2834 theH,theW,Parameters = ParseParameters(theH, theW)
2835 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2836 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2837 anObj.SetParameters(Parameters)
2838 self._autoPublish(anObj, theName, "rectangle")
2841 ## Create a face from another plane and two sizes,
2842 # vertical size and horisontal size.
2843 # @param theObj Normale vector to the creating face or
2845 # @param theH Height (vertical size).
2846 # @param theW Width (horisontal size).
2847 # @param theName Object name; when specified, this parameter is used
2848 # for result publication in the study. Otherwise, if automatic
2849 # publication is switched on, default value is used for result name.
2851 # @return New GEOM.GEOM_Object, containing the created face.
2853 # @ref tui_creation_face "Example"
2854 @ManageTransactions("PrimOp")
2855 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2857 Create a face from another plane and two sizes,
2858 vertical size and horisontal size.
2861 theObj Normale vector to the creating face or
2863 theH Height (vertical size).
2864 theW Width (horisontal size).
2865 theName Object name; when specified, this parameter is used
2866 for result publication in the study. Otherwise, if automatic
2867 publication is switched on, default value is used for result name.
2870 New GEOM_Object, containing the created face.
2872 # Example: see GEOM_TestAll.py
2873 theH,theW,Parameters = ParseParameters(theH, theW)
2874 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2875 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2876 anObj.SetParameters(Parameters)
2877 self._autoPublish(anObj, theName, "rectangle")
2880 ## Create a disk with given center, normal vector and radius.
2881 # @param thePnt Disk center.
2882 # @param theVec Vector, normal to the plane of the disk.
2883 # @param theR Disk radius.
2884 # @param theName Object name; when specified, this parameter is used
2885 # for result publication in the study. Otherwise, if automatic
2886 # publication is switched on, default value is used for result name.
2888 # @return New GEOM.GEOM_Object, containing the created disk.
2890 # @ref tui_creation_disk "Example"
2891 @ManageTransactions("PrimOp")
2892 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2894 Create a disk with given center, normal vector and radius.
2898 theVec Vector, normal to the plane of the disk.
2900 theName Object name; when specified, this parameter is used
2901 for result publication in the study. Otherwise, if automatic
2902 publication is switched on, default value is used for result name.
2905 New GEOM.GEOM_Object, containing the created disk.
2907 # Example: see GEOM_TestAll.py
2908 theR,Parameters = ParseParameters(theR)
2909 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2910 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2911 anObj.SetParameters(Parameters)
2912 self._autoPublish(anObj, theName, "disk")
2915 ## Create a disk, passing through three given points
2916 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2917 # @param theName Object name; when specified, this parameter is used
2918 # for result publication in the study. Otherwise, if automatic
2919 # publication is switched on, default value is used for result name.
2921 # @return New GEOM.GEOM_Object, containing the created disk.
2923 # @ref tui_creation_disk "Example"
2924 @ManageTransactions("PrimOp")
2925 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2927 Create a disk, passing through three given points
2930 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2931 theName Object name; when specified, this parameter is used
2932 for result publication in the study. Otherwise, if automatic
2933 publication is switched on, default value is used for result name.
2936 New GEOM.GEOM_Object, containing the created disk.
2938 # Example: see GEOM_TestAll.py
2939 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2940 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2941 self._autoPublish(anObj, theName, "disk")
2944 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2945 # @param theR Radius of Face.
2946 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2947 # @param theName Object name; when specified, this parameter is used
2948 # for result publication in the study. Otherwise, if automatic
2949 # publication is switched on, default value is used for result name.
2951 # @return New GEOM.GEOM_Object, containing the created disk.
2953 # @ref tui_creation_face "Example"
2954 @ManageTransactions("PrimOp")
2955 def MakeDiskR(self, theR, theOrientation, theName=None):
2957 Create a disk with specified dimensions along OX-OY coordinate axes.
2960 theR Radius of Face.
2961 theOrientation set the orientation belong axis OXY or OYZ or OZX
2962 theName Object name; when specified, this parameter is used
2963 for result publication in the study. Otherwise, if automatic
2964 publication is switched on, default value is used for result name.
2967 New GEOM.GEOM_Object, containing the created disk.
2970 Disk3 = geompy.MakeDiskR(100., 1)
2972 # Example: see GEOM_TestAll.py
2973 theR,Parameters = ParseParameters(theR)
2974 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2975 RaiseIfFailed("MakeDiskR", self.PrimOp)
2976 anObj.SetParameters(Parameters)
2977 self._autoPublish(anObj, theName, "disk")
2980 ## Create a cylinder with given base point, axis, radius and height.
2981 # @param thePnt Central point of cylinder base.
2982 # @param theAxis Cylinder axis.
2983 # @param theR Cylinder radius.
2984 # @param theH Cylinder height.
2985 # @param theName Object name; when specified, this parameter is used
2986 # for result publication in the study. Otherwise, if automatic
2987 # publication is switched on, default value is used for result name.
2989 # @return New GEOM.GEOM_Object, containing the created cylinder.
2991 # @ref tui_creation_cylinder "Example"
2992 @ManageTransactions("PrimOp")
2993 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2995 Create a cylinder with given base point, axis, radius and height.
2998 thePnt Central point of cylinder base.
2999 theAxis Cylinder axis.
3000 theR Cylinder radius.
3001 theH Cylinder height.
3002 theName Object name; when specified, this parameter is used
3003 for result publication in the study. Otherwise, if automatic
3004 publication is switched on, default value is used for result name.
3007 New GEOM.GEOM_Object, containing the created cylinder.
3009 # Example: see GEOM_TestAll.py
3010 theR,theH,Parameters = ParseParameters(theR, theH)
3011 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3012 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3013 anObj.SetParameters(Parameters)
3014 self._autoPublish(anObj, theName, "cylinder")
3017 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3018 # @param thePnt Central point of cylinder base.
3019 # @param theAxis Cylinder axis.
3020 # @param theR Cylinder radius.
3021 # @param theH Cylinder height.
3022 # @param theA Cylinder angle in radians.
3023 # @param theName Object name; when specified, this parameter is used
3024 # for result publication in the study. Otherwise, if automatic
3025 # publication is switched on, default value is used for result name.
3027 # @return New GEOM.GEOM_Object, containing the created cylinder.
3029 # @ref tui_creation_cylinder "Example"
3030 @ManageTransactions("PrimOp")
3031 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3033 Create a portion of cylinder with given base point, axis, radius, height and angle.
3036 thePnt Central point of cylinder base.
3037 theAxis Cylinder axis.
3038 theR Cylinder radius.
3039 theH Cylinder height.
3040 theA Cylinder angle in radians.
3041 theName Object name; when specified, this parameter is used
3042 for result publication in the study. Otherwise, if automatic
3043 publication is switched on, default value is used for result name.
3046 New GEOM.GEOM_Object, containing the created cylinder.
3048 # Example: see GEOM_TestAll.py
3050 if isinstance(theA,str):
3052 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3054 theA = theA*math.pi/180.
3055 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3056 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3057 anObj.SetParameters(Parameters)
3058 self._autoPublish(anObj, theName, "cylinder")
3061 ## Create a cylinder with given radius and height at
3062 # the origin of coordinate system. Axis of the cylinder
3063 # will be collinear to the OZ axis of the coordinate system.
3064 # @param theR Cylinder radius.
3065 # @param theH Cylinder height.
3066 # @param theName Object name; when specified, this parameter is used
3067 # for result publication in the study. Otherwise, if automatic
3068 # publication is switched on, default value is used for result name.
3070 # @return New GEOM.GEOM_Object, containing the created cylinder.
3072 # @ref tui_creation_cylinder "Example"
3073 @ManageTransactions("PrimOp")
3074 def MakeCylinderRH(self, theR, theH, theName=None):
3076 Create a cylinder with given radius and height at
3077 the origin of coordinate system. Axis of the cylinder
3078 will be collinear to the OZ axis of the coordinate system.
3081 theR Cylinder radius.
3082 theH Cylinder height.
3083 theName Object name; when specified, this parameter is used
3084 for result publication in the study. Otherwise, if automatic
3085 publication is switched on, default value is used for result name.
3088 New GEOM.GEOM_Object, containing the created cylinder.
3090 # Example: see GEOM_TestAll.py
3091 theR,theH,Parameters = ParseParameters(theR, theH)
3092 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3093 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3094 anObj.SetParameters(Parameters)
3095 self._autoPublish(anObj, theName, "cylinder")
3098 ## Create a portion of cylinder with given radius, height and angle at
3099 # the origin of coordinate system. Axis of the cylinder
3100 # will be collinear to the OZ axis of the coordinate system.
3101 # @param theR Cylinder radius.
3102 # @param theH Cylinder height.
3103 # @param theA Cylinder angle in radians.
3104 # @param theName Object name; when specified, this parameter is used
3105 # for result publication in the study. Otherwise, if automatic
3106 # publication is switched on, default value is used for result name.
3108 # @return New GEOM.GEOM_Object, containing the created cylinder.
3110 # @ref tui_creation_cylinder "Example"
3111 @ManageTransactions("PrimOp")
3112 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3114 Create a portion of cylinder with given radius, height and angle at
3115 the origin of coordinate system. Axis of the cylinder
3116 will be collinear to the OZ axis of the coordinate system.
3119 theR Cylinder radius.
3120 theH Cylinder height.
3121 theA Cylinder angle in radians.
3122 theName Object name; when specified, this parameter is used
3123 for result publication in the study. Otherwise, if automatic
3124 publication is switched on, default value is used for result name.
3127 New GEOM.GEOM_Object, containing the created cylinder.
3129 # Example: see GEOM_TestAll.py
3131 if isinstance(theA,str):
3133 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3135 theA = theA*math.pi/180.
3136 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3137 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3138 anObj.SetParameters(Parameters)
3139 self._autoPublish(anObj, theName, "cylinder")
3142 ## Create a sphere with given center and radius.
3143 # @param thePnt Sphere center.
3144 # @param theR Sphere radius.
3145 # @param theName Object name; when specified, this parameter is used
3146 # for result publication in the study. Otherwise, if automatic
3147 # publication is switched on, default value is used for result name.
3149 # @return New GEOM.GEOM_Object, containing the created sphere.
3151 # @ref tui_creation_sphere "Example"
3152 @ManageTransactions("PrimOp")
3153 def MakeSpherePntR(self, thePnt, theR, theName=None):
3155 Create a sphere with given center and radius.
3158 thePnt Sphere center.
3160 theName Object name; when specified, this parameter is used
3161 for result publication in the study. Otherwise, if automatic
3162 publication is switched on, default value is used for result name.
3165 New GEOM.GEOM_Object, containing the created sphere.
3167 # Example: see GEOM_TestAll.py
3168 theR,Parameters = ParseParameters(theR)
3169 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3170 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3171 anObj.SetParameters(Parameters)
3172 self._autoPublish(anObj, theName, "sphere")
3175 ## Create a sphere with given center and radius.
3176 # @param x,y,z Coordinates of sphere center.
3177 # @param theR Sphere radius.
3178 # @param theName Object name; when specified, this parameter is used
3179 # for result publication in the study. Otherwise, if automatic
3180 # publication is switched on, default value is used for result name.
3182 # @return New GEOM.GEOM_Object, containing the created sphere.
3184 # @ref tui_creation_sphere "Example"
3185 def MakeSphere(self, x, y, z, theR, theName=None):
3187 Create a sphere with given center and radius.
3190 x,y,z Coordinates of sphere center.
3192 theName Object name; when specified, this parameter is used
3193 for result publication in the study. Otherwise, if automatic
3194 publication is switched on, default value is used for result name.
3197 New GEOM.GEOM_Object, containing the created sphere.
3199 # Example: see GEOM_TestAll.py
3200 point = self.MakeVertex(x, y, z)
3201 # note: auto-publishing is done in self.MakeSpherePntR()
3202 anObj = self.MakeSpherePntR(point, theR, theName)
3205 ## Create a sphere with given radius at the origin of coordinate system.
3206 # @param theR Sphere radius.
3207 # @param theName Object name; when specified, this parameter is used
3208 # for result publication in the study. Otherwise, if automatic
3209 # publication is switched on, default value is used for result name.
3211 # @return New GEOM.GEOM_Object, containing the created sphere.
3213 # @ref tui_creation_sphere "Example"
3214 @ManageTransactions("PrimOp")
3215 def MakeSphereR(self, theR, theName=None):
3217 Create a sphere with given radius at the origin of coordinate system.
3221 theName Object name; when specified, this parameter is used
3222 for result publication in the study. Otherwise, if automatic
3223 publication is switched on, default value is used for result name.
3226 New GEOM.GEOM_Object, containing the created sphere.
3228 # Example: see GEOM_TestAll.py
3229 theR,Parameters = ParseParameters(theR)
3230 anObj = self.PrimOp.MakeSphereR(theR)
3231 RaiseIfFailed("MakeSphereR", self.PrimOp)
3232 anObj.SetParameters(Parameters)
3233 self._autoPublish(anObj, theName, "sphere")
3236 ## Create a cone with given base point, axis, height and radiuses.
3237 # @param thePnt Central point of the first cone base.
3238 # @param theAxis Cone axis.
3239 # @param theR1 Radius of the first cone base.
3240 # @param theR2 Radius of the second cone base.
3241 # \note If both radiuses are non-zero, the cone will be truncated.
3242 # \note If the radiuses are equal, a cylinder will be created instead.
3243 # @param theH Cone height.
3244 # @param theName Object name; when specified, this parameter is used
3245 # for result publication in the study. Otherwise, if automatic
3246 # publication is switched on, default value is used for result name.
3248 # @return New GEOM.GEOM_Object, containing the created cone.
3250 # @ref tui_creation_cone "Example"
3251 @ManageTransactions("PrimOp")
3252 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3254 Create a cone with given base point, axis, height and radiuses.
3257 thePnt Central point of the first cone base.
3259 theR1 Radius of the first cone base.
3260 theR2 Radius of the second cone base.
3262 theName Object name; when specified, this parameter is used
3263 for result publication in the study. Otherwise, if automatic
3264 publication is switched on, default value is used for result name.
3267 If both radiuses are non-zero, the cone will be truncated.
3268 If the radiuses are equal, a cylinder will be created instead.
3271 New GEOM.GEOM_Object, containing the created cone.
3273 # Example: see GEOM_TestAll.py
3274 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3275 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3276 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3277 anObj.SetParameters(Parameters)
3278 self._autoPublish(anObj, theName, "cone")
3281 ## Create a cone with given height and radiuses at
3282 # the origin of coordinate system. Axis of the cone will
3283 # be collinear to the OZ axis of the coordinate system.
3284 # @param theR1 Radius of the first cone base.
3285 # @param theR2 Radius of the second cone base.
3286 # \note If both radiuses are non-zero, the cone will be truncated.
3287 # \note If the radiuses are equal, a cylinder will be created instead.
3288 # @param theH Cone height.
3289 # @param theName Object name; when specified, this parameter is used
3290 # for result publication in the study. Otherwise, if automatic
3291 # publication is switched on, default value is used for result name.
3293 # @return New GEOM.GEOM_Object, containing the created cone.
3295 # @ref tui_creation_cone "Example"
3296 @ManageTransactions("PrimOp")
3297 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3299 Create a cone with given height and radiuses at
3300 the origin of coordinate system. Axis of the cone will
3301 be collinear to the OZ axis of the coordinate system.
3304 theR1 Radius of the first cone base.
3305 theR2 Radius of the second cone base.
3307 theName Object name; when specified, this parameter is used
3308 for result publication in the study. Otherwise, if automatic
3309 publication is switched on, default value is used for result name.
3312 If both radiuses are non-zero, the cone will be truncated.
3313 If the radiuses are equal, a cylinder will be created instead.
3316 New GEOM.GEOM_Object, containing the created cone.
3318 # Example: see GEOM_TestAll.py
3319 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3320 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3321 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3322 anObj.SetParameters(Parameters)
3323 self._autoPublish(anObj, theName, "cone")
3326 ## Create a torus with given center, normal vector and radiuses.
3327 # @param thePnt Torus central point.
3328 # @param theVec Torus axis of symmetry.
3329 # @param theRMajor Torus major radius.
3330 # @param theRMinor Torus minor radius.
3331 # @param theName Object name; when specified, this parameter is used
3332 # for result publication in the study. Otherwise, if automatic
3333 # publication is switched on, default value is used for result name.
3335 # @return New GEOM.GEOM_Object, containing the created torus.
3337 # @ref tui_creation_torus "Example"
3338 @ManageTransactions("PrimOp")
3339 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3341 Create a torus with given center, normal vector and radiuses.
3344 thePnt Torus central point.
3345 theVec Torus axis of symmetry.
3346 theRMajor Torus major radius.
3347 theRMinor Torus minor radius.
3348 theName Object name; when specified, this parameter is used
3349 for result publication in the study. Otherwise, if automatic
3350 publication is switched on, default value is used for result name.
3353 New GEOM.GEOM_Object, containing the created torus.
3355 # Example: see GEOM_TestAll.py
3356 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3357 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3358 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3359 anObj.SetParameters(Parameters)
3360 self._autoPublish(anObj, theName, "torus")
3363 ## Create a torus with given radiuses at the origin of coordinate system.
3364 # @param theRMajor Torus major radius.
3365 # @param theRMinor Torus minor radius.
3366 # @param theName Object name; when specified, this parameter is used
3367 # for result publication in the study. Otherwise, if automatic
3368 # publication is switched on, default value is used for result name.
3370 # @return New GEOM.GEOM_Object, containing the created torus.
3372 # @ref tui_creation_torus "Example"
3373 @ManageTransactions("PrimOp")
3374 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3376 Create a torus with given radiuses at the origin of coordinate system.
3379 theRMajor Torus major radius.
3380 theRMinor Torus minor radius.
3381 theName Object name; when specified, this parameter is used
3382 for result publication in the study. Otherwise, if automatic
3383 publication is switched on, default value is used for result name.
3386 New GEOM.GEOM_Object, containing the created torus.
3388 # Example: see GEOM_TestAll.py
3389 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3390 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3391 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3392 anObj.SetParameters(Parameters)
3393 self._autoPublish(anObj, theName, "torus")
3396 # end of l3_3d_primitives
3399 ## @addtogroup l3_complex
3402 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3403 # @param theBase Base shape to be extruded.
3404 # @param thePoint1 First end of extrusion vector.
3405 # @param thePoint2 Second end of extrusion vector.
3406 # @param theScaleFactor Use it to make prism with scaled second base.
3407 # Nagative value means not scaled second base.
3408 # @param theName Object name; when specified, this parameter is used
3409 # for result publication in the study. Otherwise, if automatic
3410 # publication is switched on, default value is used for result name.
3412 # @return New GEOM.GEOM_Object, containing the created prism.
3414 # @ref tui_creation_prism "Example"
3415 @ManageTransactions("PrimOp")
3416 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3418 Create a shape by extrusion of the base shape along a vector, defined by two points.
3421 theBase Base shape to be extruded.
3422 thePoint1 First end of extrusion vector.
3423 thePoint2 Second end of extrusion vector.
3424 theScaleFactor Use it to make prism with scaled second base.
3425 Nagative value means not scaled second base.
3426 theName Object name; when specified, this parameter is used
3427 for result publication in the study. Otherwise, if automatic
3428 publication is switched on, default value is used for result name.
3431 New GEOM.GEOM_Object, containing the created prism.
3433 # Example: see GEOM_TestAll.py
3436 if theScaleFactor > 0:
3437 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3438 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3440 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3441 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3442 anObj.SetParameters(Parameters)
3443 self._autoPublish(anObj, theName, "prism")
3446 ## Create a shape by extrusion of the base shape along a
3447 # vector, defined by two points, in 2 Ways (forward/backward).
3448 # @param theBase Base shape to be extruded.
3449 # @param thePoint1 First end of extrusion vector.
3450 # @param thePoint2 Second end of extrusion vector.
3451 # @param theName Object name; when specified, this parameter is used
3452 # for result publication in the study. Otherwise, if automatic
3453 # publication is switched on, default value is used for result name.
3455 # @return New GEOM.GEOM_Object, containing the created prism.
3457 # @ref tui_creation_prism "Example"
3458 @ManageTransactions("PrimOp")
3459 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3461 Create a shape by extrusion of the base shape along a
3462 vector, defined by two points, in 2 Ways (forward/backward).
3465 theBase Base shape to be extruded.
3466 thePoint1 First end of extrusion vector.
3467 thePoint2 Second end of extrusion vector.
3468 theName Object name; when specified, this parameter is used
3469 for result publication in the study. Otherwise, if automatic
3470 publication is switched on, default value is used for result name.
3473 New GEOM.GEOM_Object, containing the created prism.
3475 # Example: see GEOM_TestAll.py
3476 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3477 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3478 self._autoPublish(anObj, theName, "prism")
3481 ## Create a shape by extrusion of the base shape along the vector,
3482 # i.e. all the space, transfixed by the base shape during its translation
3483 # along the vector on the given distance.
3484 # @param theBase Base shape to be extruded.
3485 # @param theVec Direction of extrusion.
3486 # @param theH Prism dimension along theVec.
3487 # @param theScaleFactor Use it to make prism with scaled second base.
3488 # Negative value means not scaled second base.
3489 # @param theName Object name; when specified, this parameter is used
3490 # for result publication in the study. Otherwise, if automatic
3491 # publication is switched on, default value is used for result name.
3493 # @return New GEOM.GEOM_Object, containing the created prism.
3495 # @ref tui_creation_prism "Example"
3496 @ManageTransactions("PrimOp")
3497 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3499 Create a shape by extrusion of the base shape along the vector,
3500 i.e. all the space, transfixed by the base shape during its translation
3501 along the vector on the given distance.
3504 theBase Base shape to be extruded.
3505 theVec Direction of extrusion.
3506 theH Prism dimension along theVec.
3507 theScaleFactor Use it to make prism with scaled second base.
3508 Negative value means not scaled second base.
3509 theName Object name; when specified, this parameter is used
3510 for result publication in the study. Otherwise, if automatic
3511 publication is switched on, default value is used for result name.
3514 New GEOM.GEOM_Object, containing the created prism.
3516 # Example: see GEOM_TestAll.py
3519 if theScaleFactor > 0:
3520 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3521 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3523 theH,Parameters = ParseParameters(theH)
3524 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3525 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3526 anObj.SetParameters(Parameters)
3527 self._autoPublish(anObj, theName, "prism")
3530 ## Create a shape by extrusion of the base shape along the vector,
3531 # i.e. all the space, transfixed by the base shape during its translation
3532 # along the vector on the given distance in 2 Ways (forward/backward).
3533 # @param theBase Base shape to be extruded.
3534 # @param theVec Direction of extrusion.
3535 # @param theH Prism dimension along theVec in forward direction.
3536 # @param theName Object name; when specified, this parameter is used
3537 # for result publication in the study. Otherwise, if automatic
3538 # publication is switched on, default value is used for result name.
3540 # @return New GEOM.GEOM_Object, containing the created prism.
3542 # @ref tui_creation_prism "Example"
3543 @ManageTransactions("PrimOp")
3544 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3546 Create a shape by extrusion of the base shape along the vector,
3547 i.e. all the space, transfixed by the base shape during its translation
3548 along the vector on the given distance in 2 Ways (forward/backward).
3551 theBase Base shape to be extruded.
3552 theVec Direction of extrusion.
3553 theH Prism dimension along theVec in forward direction.
3554 theName Object name; when specified, this parameter is used
3555 for result publication in the study. Otherwise, if automatic
3556 publication is switched on, default value is used for result name.
3559 New GEOM.GEOM_Object, containing the created prism.
3561 # Example: see GEOM_TestAll.py
3562 theH,Parameters = ParseParameters(theH)
3563 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3564 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3565 anObj.SetParameters(Parameters)
3566 self._autoPublish(anObj, theName, "prism")
3569 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3570 # @param theBase Base shape to be extruded.
3571 # @param theDX, theDY, theDZ Directions of extrusion.
3572 # @param theScaleFactor Use it to make prism with scaled second base.
3573 # Nagative value means not scaled second base.
3574 # @param theName Object name; when specified, this parameter is used
3575 # for result publication in the study. Otherwise, if automatic
3576 # publication is switched on, default value is used for result name.
3578 # @return New GEOM.GEOM_Object, containing the created prism.
3580 # @ref tui_creation_prism "Example"
3581 @ManageTransactions("PrimOp")
3582 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3584 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3587 theBase Base shape to be extruded.
3588 theDX, theDY, theDZ Directions of extrusion.
3589 theScaleFactor Use it to make prism with scaled second base.
3590 Nagative value means not scaled second base.
3591 theName Object name; when specified, this parameter is used
3592 for result publication in the study. Otherwise, if automatic
3593 publication is switched on, default value is used for result name.
3596 New GEOM.GEOM_Object, containing the created prism.
3598 # Example: see GEOM_TestAll.py
3601 if theScaleFactor > 0:
3602 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3603 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3605 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3606 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3607 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3608 anObj.SetParameters(Parameters)
3609 self._autoPublish(anObj, theName, "prism")
3612 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3613 # i.e. all the space, transfixed by the base shape during its translation
3614 # along the vector on the given distance in 2 Ways (forward/backward).
3615 # @param theBase Base shape to be extruded.
3616 # @param theDX, theDY, theDZ Directions of extrusion.
3617 # @param theName Object name; when specified, this parameter is used
3618 # for result publication in the study. Otherwise, if automatic
3619 # publication is switched on, default value is used for result name.
3621 # @return New GEOM.GEOM_Object, containing the created prism.
3623 # @ref tui_creation_prism "Example"
3624 @ManageTransactions("PrimOp")
3625 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3627 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3628 i.e. all the space, transfixed by the base shape during its translation
3629 along the vector on the given distance in 2 Ways (forward/backward).
3632 theBase Base shape to be extruded.
3633 theDX, theDY, theDZ Directions of extrusion.
3634 theName Object name; when specified, this parameter is used
3635 for result publication in the study. Otherwise, if automatic
3636 publication is switched on, default value is used for result name.
3639 New GEOM.GEOM_Object, containing the created prism.
3641 # Example: see GEOM_TestAll.py
3642 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3643 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3644 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3645 anObj.SetParameters(Parameters)
3646 self._autoPublish(anObj, theName, "prism")
3649 ## Create a shape by revolution of the base shape around the axis
3650 # on the given angle, i.e. all the space, transfixed by the base
3651 # shape during its rotation around the axis on the given angle.
3652 # @param theBase Base shape to be rotated.
3653 # @param theAxis Rotation axis.
3654 # @param theAngle Rotation angle in radians.
3655 # @param theName Object name; when specified, this parameter is used
3656 # for result publication in the study. Otherwise, if automatic
3657 # publication is switched on, default value is used for result name.
3659 # @return New GEOM.GEOM_Object, containing the created revolution.
3661 # @ref tui_creation_revolution "Example"
3662 @ManageTransactions("PrimOp")
3663 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3665 Create a shape by revolution of the base shape around the axis
3666 on the given angle, i.e. all the space, transfixed by the base
3667 shape during its rotation around the axis on the given angle.
3670 theBase Base shape to be rotated.
3671 theAxis Rotation axis.
3672 theAngle Rotation angle in radians.
3673 theName Object name; when specified, this parameter is used
3674 for result publication in the study. Otherwise, if automatic
3675 publication is switched on, default value is used for result name.
3678 New GEOM.GEOM_Object, containing the created revolution.
3680 # Example: see GEOM_TestAll.py
3681 theAngle,Parameters = ParseParameters(theAngle)
3682 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3683 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3684 anObj.SetParameters(Parameters)
3685 self._autoPublish(anObj, theName, "revolution")
3688 ## Create a shape by revolution of the base shape around the axis
3689 # on the given angle, i.e. all the space, transfixed by the base
3690 # shape during its rotation around the axis on the given angle in
3691 # both directions (forward/backward)
3692 # @param theBase Base shape to be rotated.
3693 # @param theAxis Rotation axis.
3694 # @param theAngle Rotation angle in radians.
3695 # @param theName Object name; when specified, this parameter is used
3696 # for result publication in the study. Otherwise, if automatic
3697 # publication is switched on, default value is used for result name.
3699 # @return New GEOM.GEOM_Object, containing the created revolution.
3701 # @ref tui_creation_revolution "Example"
3702 @ManageTransactions("PrimOp")
3703 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3705 Create a shape by revolution of the base shape around the axis
3706 on the given angle, i.e. all the space, transfixed by the base
3707 shape during its rotation around the axis on the given angle in
3708 both directions (forward/backward).
3711 theBase Base shape to be rotated.
3712 theAxis Rotation axis.
3713 theAngle Rotation angle in radians.
3714 theName Object name; when specified, this parameter is used
3715 for result publication in the study. Otherwise, if automatic
3716 publication is switched on, default value is used for result name.
3719 New GEOM.GEOM_Object, containing the created revolution.
3721 theAngle,Parameters = ParseParameters(theAngle)
3722 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3723 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3724 anObj.SetParameters(Parameters)
3725 self._autoPublish(anObj, theName, "revolution")
3728 ## Create a face from a given set of contours.
3729 # @param theContours either a list or a compound of edges/wires.
3730 # @param theMinDeg a minimal degree of BSpline surface to create.
3731 # @param theMaxDeg a maximal degree of BSpline surface to create.
3732 # @param theTol2D a 2d tolerance to be reached.
3733 # @param theTol3D a 3d tolerance to be reached.
3734 # @param theNbIter a number of iteration of approximation algorithm.
3735 # @param theMethod Kind of method to perform filling operation
3736 # (see GEOM.filling_oper_method enum).
3737 # @param isApprox if True, BSpline curves are generated in the process
3738 # of surface construction. By default it is False, that means
3739 # the surface is created using given curves. The usage of
3740 # Approximation makes the algorithm work slower, but allows
3741 # building the surface for rather complex cases.
3742 # @param theName Object name; when specified, this parameter is used
3743 # for result publication in the study. Otherwise, if automatic
3744 # publication is switched on, default value is used for result name.
3746 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3748 # @ref tui_creation_filling "Example"
3749 @ManageTransactions("PrimOp")
3750 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3751 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3753 Create a face from a given set of contours.
3756 theContours either a list or a compound of edges/wires.
3757 theMinDeg a minimal degree of BSpline surface to create.
3758 theMaxDeg a maximal degree of BSpline surface to create.
3759 theTol2D a 2d tolerance to be reached.
3760 theTol3D a 3d tolerance to be reached.
3761 theNbIter a number of iteration of approximation algorithm.
3762 theMethod Kind of method to perform filling operation
3763 (see GEOM.filling_oper_method enum).
3764 isApprox if True, BSpline curves are generated in the process
3765 of surface construction. By default it is False, that means
3766 the surface is created using given curves. The usage of
3767 Approximation makes the algorithm work slower, but allows
3768 building the surface for rather complex cases.
3769 theName Object name; when specified, this parameter is used
3770 for result publication in the study. Otherwise, if automatic
3771 publication is switched on, default value is used for result name.
3774 New GEOM.GEOM_Object (face), containing the created filling surface.
3777 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3779 # Example: see GEOM_TestAll.py
3780 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3781 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3782 theTol2D, theTol3D, theNbIter,
3783 theMethod, isApprox)
3784 RaiseIfFailed("MakeFilling", self.PrimOp)
3785 anObj.SetParameters(Parameters)
3786 self._autoPublish(anObj, theName, "filling")
3790 ## Create a face from a given set of contours.
3791 # This method corresponds to MakeFilling() with isApprox=True.
3792 # @param theContours either a list or a compound of edges/wires.
3793 # @param theMinDeg a minimal degree of BSpline surface to create.
3794 # @param theMaxDeg a maximal degree of BSpline surface to create.
3795 # @param theTol3D a 3d tolerance to be reached.
3796 # @param theName Object name; when specified, this parameter is used
3797 # for result publication in the study. Otherwise, if automatic
3798 # publication is switched on, default value is used for result name.
3800 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3802 # @ref tui_creation_filling "Example"
3803 @ManageTransactions("PrimOp")
3804 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3806 Create a filling from the given compound of contours.
3807 This method corresponds to MakeFilling() with isApprox=True.
3810 theContours either a list or a compound of edges/wires.
3811 theMinDeg a minimal degree of BSpline surface to create.
3812 theMaxDeg a maximal degree of BSpline surface to create.
3813 theTol3D a 3d tolerance to be reached.
3814 theName Object name; when specified, this parameter is used
3815 for result publication in the study. Otherwise, if automatic
3816 publication is switched on, default value is used for result name.
3819 New GEOM.GEOM_Object (face), containing the created filling surface.
3822 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3824 # Example: see GEOM_TestAll.py
3825 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3826 anObj = self.PrimOp.MakeFilling(theContours, theMinDeg, theMaxDeg,
3827 0, theTol3D, 0, GEOM.FOM_Default, True)
3828 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3829 anObj.SetParameters(Parameters)
3830 self._autoPublish(anObj, theName, "filling")
3833 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3834 # @param theSeqSections - set of specified sections.
3835 # @param theModeSolid - mode defining building solid or shell
3836 # @param thePreci - precision 3D used for smoothing
3837 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3838 # @param theName Object name; when specified, this parameter is used
3839 # for result publication in the study. Otherwise, if automatic
3840 # publication is switched on, default value is used for result name.
3842 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3844 # @ref swig_todo "Example"
3845 @ManageTransactions("PrimOp")
3846 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3848 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3851 theSeqSections - set of specified sections.
3852 theModeSolid - mode defining building solid or shell
3853 thePreci - precision 3D used for smoothing
3854 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3855 theName Object name; when specified, this parameter is used
3856 for result publication in the study. Otherwise, if automatic
3857 publication is switched on, default value is used for result name.
3860 New GEOM.GEOM_Object, containing the created shell or solid.
3862 # Example: see GEOM_TestAll.py
3863 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3864 RaiseIfFailed("MakeThruSections", self.PrimOp)
3865 self._autoPublish(anObj, theName, "filling")
3868 ## Create a shape by extrusion of the base shape along
3869 # the path shape. The path shape can be a wire or an edge.
3870 # @param theBase Base shape to be extruded.
3871 # @param thePath Path shape to extrude the base shape along it.
3872 # @param theName Object name; when specified, this parameter is used
3873 # for result publication in the study. Otherwise, if automatic
3874 # publication is switched on, default value is used for result name.
3876 # @return New GEOM.GEOM_Object, containing the created pipe.
3878 # @ref tui_creation_pipe "Example"
3879 @ManageTransactions("PrimOp")
3880 def MakePipe(self, theBase, thePath, theName=None):
3882 Create a shape by extrusion of the base shape along
3883 the path shape. The path shape can be a wire or an edge.
3886 theBase Base shape to be extruded.
3887 thePath Path shape to extrude the base shape along it.
3888 theName Object name; when specified, this parameter is used
3889 for result publication in the study. Otherwise, if automatic
3890 publication is switched on, default value is used for result name.
3893 New GEOM.GEOM_Object, containing the created pipe.
3895 # Example: see GEOM_TestAll.py
3896 anObj = self.PrimOp.MakePipe(theBase, thePath)
3897 RaiseIfFailed("MakePipe", self.PrimOp)
3898 self._autoPublish(anObj, theName, "pipe")
3901 ## Create a shape by extrusion of the profile shape along
3902 # the path shape. The path shape can be a wire or an edge.
3903 # the several profiles can be specified in the several locations of path.
3904 # @param theSeqBases - list of Bases shape to be extruded.
3905 # @param theLocations - list of locations on the path corresponding
3906 # specified list of the Bases shapes. Number of locations
3907 # should be equal to number of bases or list of locations can be empty.
3908 # @param thePath - Path shape to extrude the base shape along it.
3909 # @param theWithContact - the mode defining that the section is translated to be in
3910 # contact with the spine.
3911 # @param theWithCorrection - defining that the section is rotated to be
3912 # orthogonal to the spine tangent in the correspondent point
3913 # @param theName Object name; when specified, this parameter is used
3914 # for result publication in the study. Otherwise, if automatic
3915 # publication is switched on, default value is used for result name.
3917 # @return New GEOM.GEOM_Object, containing the created pipe.
3919 # @ref tui_creation_pipe_with_diff_sec "Example"
3920 @ManageTransactions("PrimOp")
3921 def MakePipeWithDifferentSections(self, theSeqBases,
3922 theLocations, thePath,
3923 theWithContact, theWithCorrection, theName=None):
3925 Create a shape by extrusion of the profile shape along
3926 the path shape. The path shape can be a wire or an edge.
3927 the several profiles can be specified in the several locations of path.
3930 theSeqBases - list of Bases shape to be extruded.
3931 theLocations - list of locations on the path corresponding
3932 specified list of the Bases shapes. Number of locations
3933 should be equal to number of bases or list of locations can be empty.
3934 thePath - Path shape to extrude the base shape along it.
3935 theWithContact - the mode defining that the section is translated to be in
3936 contact with the spine(0/1)
3937 theWithCorrection - defining that the section is rotated to be
3938 orthogonal to the spine tangent in the correspondent point (0/1)
3939 theName Object name; when specified, this parameter is used
3940 for result publication in the study. Otherwise, if automatic
3941 publication is switched on, default value is used for result name.
3944 New GEOM.GEOM_Object, containing the created pipe.
3946 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3947 theLocations, thePath,
3948 theWithContact, theWithCorrection)
3949 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3950 self._autoPublish(anObj, theName, "pipe")
3953 ## Create a shape by extrusion of the profile shape along
3954 # the path shape. The path shape can be a wire or a edge.
3955 # the several profiles can be specified in the several locations of path.
3956 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3957 # shell or face. If number of faces in neighbour sections
3958 # aren't coincided result solid between such sections will
3959 # be created using external boundaries of this shells.
3960 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3961 # This list is used for searching correspondences between
3962 # faces in the sections. Size of this list must be equal
3963 # to size of list of base shapes.
3964 # @param theLocations - list of locations on the path corresponding
3965 # specified list of the Bases shapes. Number of locations
3966 # should be equal to number of bases. First and last
3967 # locations must be coincided with first and last vertexes
3968 # of path correspondingly.
3969 # @param thePath - Path shape to extrude the base shape along it.
3970 # @param theWithContact - the mode defining that the section is translated to be in
3971 # contact with the spine.
3972 # @param theWithCorrection - defining that the section is rotated to be
3973 # orthogonal to the spine tangent in the correspondent point
3974 # @param theName Object name; when specified, this parameter is used
3975 # for result publication in the study. Otherwise, if automatic
3976 # publication is switched on, default value is used for result name.
3978 # @return New GEOM.GEOM_Object, containing the created solids.
3980 # @ref tui_creation_pipe_with_shell_sec "Example"
3981 @ManageTransactions("PrimOp")
3982 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3983 theLocations, thePath,
3984 theWithContact, theWithCorrection, theName=None):
3986 Create a shape by extrusion of the profile shape along
3987 the path shape. The path shape can be a wire or a edge.
3988 the several profiles can be specified in the several locations of path.
3991 theSeqBases - list of Bases shape to be extruded. Base shape must be
3992 shell or face. If number of faces in neighbour sections
3993 aren't coincided result solid between such sections will
3994 be created using external boundaries of this shells.
3995 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3996 This list is used for searching correspondences between
3997 faces in the sections. Size of this list must be equal
3998 to size of list of base shapes.
3999 theLocations - list of locations on the path corresponding
4000 specified list of the Bases shapes. Number of locations
4001 should be equal to number of bases. First and last
4002 locations must be coincided with first and last vertexes
4003 of path correspondingly.
4004 thePath - Path shape to extrude the base shape along it.
4005 theWithContact - the mode defining that the section is translated to be in
4006 contact with the spine (0/1)
4007 theWithCorrection - defining that the section is rotated to be
4008 orthogonal to the spine tangent in the correspondent point (0/1)
4009 theName Object name; when specified, this parameter is used
4010 for result publication in the study. Otherwise, if automatic
4011 publication is switched on, default value is used for result name.
4014 New GEOM.GEOM_Object, containing the created solids.
4016 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4017 theLocations, thePath,
4018 theWithContact, theWithCorrection)
4019 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4020 self._autoPublish(anObj, theName, "pipe")
4023 ## Create a shape by extrusion of the profile shape along
4024 # the path shape. This function is used only for debug pipe
4025 # functionality - it is a version of function MakePipeWithShellSections()
4026 # which give a possibility to recieve information about
4027 # creating pipe between each pair of sections step by step.
4028 @ManageTransactions("PrimOp")
4029 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4030 theLocations, thePath,
4031 theWithContact, theWithCorrection, theName=None):
4033 Create a shape by extrusion of the profile shape along
4034 the path shape. This function is used only for debug pipe
4035 functionality - it is a version of previous function
4036 geompy.MakePipeWithShellSections() which give a possibility to
4037 recieve information about creating pipe between each pair of
4038 sections step by step.
4041 nbsect = len(theSeqBases)
4042 nbsubsect = len(theSeqSubBases)
4043 #print "nbsect = ",nbsect
4044 for i in range(1,nbsect):
4046 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4047 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4049 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4050 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4051 tmpLocations, thePath,
4052 theWithContact, theWithCorrection)
4053 if self.PrimOp.IsDone() == 0:
4054 print "Problems with pipe creation between ",i," and ",i+1," sections"
4055 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4058 print "Pipe between ",i," and ",i+1," sections is OK"
4063 resc = self.MakeCompound(res)
4064 #resc = self.MakeSewing(res, 0.001)
4065 #print "resc: ",resc
4066 self._autoPublish(resc, theName, "pipe")
4069 ## Create solids between given sections
4070 # @param theSeqBases - list of sections (shell or face).
4071 # @param theLocations - list of corresponding vertexes
4072 # @param theName Object name; when specified, this parameter is used
4073 # for result publication in the study. Otherwise, if automatic
4074 # publication is switched on, default value is used for result name.
4076 # @return New GEOM.GEOM_Object, containing the created solids.
4078 # @ref tui_creation_pipe_without_path "Example"
4079 @ManageTransactions("PrimOp")
4080 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4082 Create solids between given sections
4085 theSeqBases - list of sections (shell or face).
4086 theLocations - list of corresponding vertexes
4087 theName Object name; when specified, this parameter is used
4088 for result publication in the study. Otherwise, if automatic
4089 publication is switched on, default value is used for result name.
4092 New GEOM.GEOM_Object, containing the created solids.
4094 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4095 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4096 self._autoPublish(anObj, theName, "pipe")
4099 ## Create a shape by extrusion of the base shape along
4100 # the path shape with constant bi-normal direction along the given vector.
4101 # The path shape can be a wire or an edge.
4102 # @param theBase Base shape to be extruded.
4103 # @param thePath Path shape to extrude the base shape along it.
4104 # @param theVec Vector defines a constant binormal direction to keep the
4105 # same angle beetween the direction and the sections
4106 # along the sweep surface.
4107 # @param theName Object name; when specified, this parameter is used
4108 # for result publication in the study. Otherwise, if automatic
4109 # publication is switched on, default value is used for result name.
4111 # @return New GEOM.GEOM_Object, containing the created pipe.
4113 # @ref tui_creation_pipe "Example"
4114 @ManageTransactions("PrimOp")
4115 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4117 Create a shape by extrusion of the base shape along
4118 the path shape with constant bi-normal direction along the given vector.
4119 The path shape can be a wire or an edge.
4122 theBase Base shape to be extruded.
4123 thePath Path shape to extrude the base shape along it.
4124 theVec Vector defines a constant binormal direction to keep the
4125 same angle beetween the direction and the sections
4126 along the sweep surface.
4127 theName Object name; when specified, this parameter is used
4128 for result publication in the study. Otherwise, if automatic
4129 publication is switched on, default value is used for result name.
4132 New GEOM.GEOM_Object, containing the created pipe.
4134 # Example: see GEOM_TestAll.py
4135 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4136 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4137 self._autoPublish(anObj, theName, "pipe")
4140 ## Makes a thick solid from a face or a shell
4141 # @param theShape Face or Shell to be thicken
4142 # @param theThickness Thickness of the resulting solid
4143 # @param theName Object name; when specified, this parameter is used
4144 # for result publication in the study. Otherwise, if automatic
4145 # publication is switched on, default value is used for result name.
4147 # @return New GEOM.GEOM_Object, containing the created solid
4149 @ManageTransactions("PrimOp")
4150 def MakeThickSolid(self, theShape, theThickness, theName=None):
4152 Make a thick solid from a face or a shell
4155 theShape Face or Shell to be thicken
4156 theThickness Thickness of the resulting solid
4157 theName Object name; when specified, this parameter is used
4158 for result publication in the study. Otherwise, if automatic
4159 publication is switched on, default value is used for result name.
4162 New GEOM.GEOM_Object, containing the created solid
4164 # Example: see GEOM_TestAll.py
4165 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4166 RaiseIfFailed("MakeThickening", self.PrimOp)
4167 self._autoPublish(anObj, theName, "pipe")
4171 ## Modifies a face or a shell to make it a thick solid
4172 # @param theShape Face or Shell to be thicken
4173 # @param theThickness Thickness of the resulting solid
4175 # @return The modified shape
4177 @ManageTransactions("PrimOp")
4178 def Thicken(self, theShape, theThickness):
4180 Modifies a face or a shell to make it a thick solid
4183 theBase Base shape to be extruded.
4184 thePath Path shape to extrude the base shape along it.
4185 theName Object name; when specified, this parameter is used
4186 for result publication in the study. Otherwise, if automatic
4187 publication is switched on, default value is used for result name.
4192 # Example: see GEOM_TestAll.py
4193 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4194 RaiseIfFailed("MakeThickening", self.PrimOp)
4197 ## Build a middle path of a pipe-like shape.
4198 # The path shape can be a wire or an edge.
4199 # @param theShape It can be closed or unclosed pipe-like shell
4200 # or a pipe-like solid.
4201 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4202 # should be wires or faces of theShape.
4203 # @param theName Object name; when specified, this parameter is used
4204 # for result publication in the study. Otherwise, if automatic
4205 # publication is switched on, default value is used for result name.
4207 # @note It is not assumed that exact or approximate copy of theShape
4208 # can be obtained by applying existing Pipe operation on the
4209 # resulting "Path" wire taking theBase1 as the base - it is not
4210 # always possible; though in some particular cases it might work
4211 # it is not guaranteed. Thus, RestorePath function should not be
4212 # considered as an exact reverse operation of the Pipe.
4214 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4215 # source pipe's "path".
4217 # @ref tui_creation_pipe_path "Example"
4218 @ManageTransactions("PrimOp")
4219 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4221 Build a middle path of a pipe-like shape.
4222 The path shape can be a wire or an edge.
4225 theShape It can be closed or unclosed pipe-like shell
4226 or a pipe-like solid.
4227 theBase1, theBase2 Two bases of the supposed pipe. This
4228 should be wires or faces of theShape.
4229 theName Object name; when specified, this parameter is used
4230 for result publication in the study. Otherwise, if automatic
4231 publication is switched on, default value is used for result name.
4234 New GEOM_Object, containing an edge or wire that represent
4237 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4238 RaiseIfFailed("RestorePath", self.PrimOp)
4239 self._autoPublish(anObj, theName, "path")
4242 ## Build a middle path of a pipe-like shape.
4243 # The path shape can be a wire or an edge.
4244 # @param theShape It can be closed or unclosed pipe-like shell
4245 # or a pipe-like solid.
4246 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4247 # should be lists of edges of theShape.
4248 # @param theName Object name; when specified, this parameter is used
4249 # for result publication in the study. Otherwise, if automatic
4250 # publication is switched on, default value is used for result name.
4252 # @note It is not assumed that exact or approximate copy of theShape
4253 # can be obtained by applying existing Pipe operation on the
4254 # resulting "Path" wire taking theBase1 as the base - it is not
4255 # always possible; though in some particular cases it might work
4256 # it is not guaranteed. Thus, RestorePath function should not be
4257 # considered as an exact reverse operation of the Pipe.
4259 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4260 # source pipe's "path".
4262 # @ref tui_creation_pipe_path "Example"
4263 @ManageTransactions("PrimOp")
4264 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4266 Build a middle path of a pipe-like shape.
4267 The path shape can be a wire or an edge.
4270 theShape It can be closed or unclosed pipe-like shell
4271 or a pipe-like solid.
4272 listEdges1, listEdges2 Two bases of the supposed pipe. This
4273 should be lists of edges of theShape.
4274 theName Object name; when specified, this parameter is used
4275 for result publication in the study. Otherwise, if automatic
4276 publication is switched on, default value is used for result name.
4279 New GEOM_Object, containing an edge or wire that represent
4282 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4283 RaiseIfFailed("RestorePath", self.PrimOp)
4284 self._autoPublish(anObj, theName, "path")
4290 ## @addtogroup l3_advanced
4293 ## Create a linear edge with specified ends.
4294 # @param thePnt1 Point for the first end of edge.
4295 # @param thePnt2 Point for the second end of edge.
4296 # @param theName Object name; when specified, this parameter is used
4297 # for result publication in the study. Otherwise, if automatic
4298 # publication is switched on, default value is used for result name.
4300 # @return New GEOM.GEOM_Object, containing the created edge.
4302 # @ref tui_creation_edge "Example"
4303 @ManageTransactions("ShapesOp")
4304 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4306 Create a linear edge with specified ends.
4309 thePnt1 Point for the first end of edge.
4310 thePnt2 Point for the second end of edge.
4311 theName Object name; when specified, this parameter is used
4312 for result publication in the study. Otherwise, if automatic
4313 publication is switched on, default value is used for result name.
4316 New GEOM.GEOM_Object, containing the created edge.
4318 # Example: see GEOM_TestAll.py
4319 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4320 RaiseIfFailed("MakeEdge", self.ShapesOp)
4321 self._autoPublish(anObj, theName, "edge")
4324 ## Create a new edge, corresponding to the given length on the given curve.
4325 # @param theRefCurve The referenced curve (edge).
4326 # @param theLength Length on the referenced curve. It can be negative.
4327 # @param theStartPoint Any point can be selected for it, the new edge will begin
4328 # at the end of \a theRefCurve, close to the selected point.
4329 # If None, start from the first point of \a theRefCurve.
4330 # @param theName Object name; when specified, this parameter is used
4331 # for result publication in the study. Otherwise, if automatic
4332 # publication is switched on, default value is used for result name.
4334 # @return New GEOM.GEOM_Object, containing the created edge.
4336 # @ref tui_creation_edge "Example"
4337 @ManageTransactions("ShapesOp")
4338 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4340 Create a new edge, corresponding to the given length on the given curve.
4343 theRefCurve The referenced curve (edge).
4344 theLength Length on the referenced curve. It can be negative.
4345 theStartPoint Any point can be selected for it, the new edge will begin
4346 at the end of theRefCurve, close to the selected point.
4347 If None, start from the first point of theRefCurve.
4348 theName Object name; when specified, this parameter is used
4349 for result publication in the study. Otherwise, if automatic
4350 publication is switched on, default value is used for result name.
4353 New GEOM.GEOM_Object, containing the created edge.
4355 # Example: see GEOM_TestAll.py
4356 theLength, Parameters = ParseParameters(theLength)
4357 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4358 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4359 anObj.SetParameters(Parameters)
4360 self._autoPublish(anObj, theName, "edge")
4363 ## Create an edge from specified wire.
4364 # @param theWire source Wire
4365 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4366 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4367 # @param theName Object name; when specified, this parameter is used
4368 # for result publication in the study. Otherwise, if automatic
4369 # publication is switched on, default value is used for result name.
4371 # @return New GEOM.GEOM_Object, containing the created edge.
4373 # @ref tui_creation_edge "Example"
4374 @ManageTransactions("ShapesOp")
4375 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4377 Create an edge from specified wire.
4381 theLinearTolerance linear tolerance value (default = 1e-07)
4382 theAngularTolerance angular tolerance value (default = 1e-12)
4383 theName Object name; when specified, this parameter is used
4384 for result publication in the study. Otherwise, if automatic
4385 publication is switched on, default value is used for result name.
4388 New GEOM.GEOM_Object, containing the created edge.
4390 # Example: see GEOM_TestAll.py
4391 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4392 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4393 self._autoPublish(anObj, theName, "edge")
4396 ## Create a wire from the set of edges and wires.
4397 # @param theEdgesAndWires List of edges and/or wires.
4398 # @param theTolerance Maximum distance between vertices, that will be merged.
4399 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4400 # @param theName Object name; when specified, this parameter is used
4401 # for result publication in the study. Otherwise, if automatic
4402 # publication is switched on, default value is used for result name.
4404 # @return New GEOM.GEOM_Object, containing the created wire.
4406 # @ref tui_creation_wire "Example"
4407 @ManageTransactions("ShapesOp")
4408 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4410 Create a wire from the set of edges and wires.
4413 theEdgesAndWires List of edges and/or wires.
4414 theTolerance Maximum distance between vertices, that will be merged.
4415 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4416 theName Object name; when specified, this parameter is used
4417 for result publication in the study. Otherwise, if automatic
4418 publication is switched on, default value is used for result name.
4421 New GEOM.GEOM_Object, containing the created wire.
4423 # Example: see GEOM_TestAll.py
4424 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4425 RaiseIfFailed("MakeWire", self.ShapesOp)
4426 self._autoPublish(anObj, theName, "wire")
4429 ## Create a face on the given wire.
4430 # @param theWire closed Wire or Edge to build the face on.
4431 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4432 # If the tolerance of the obtained planar face is less
4433 # than 1e-06, this face will be returned, otherwise the
4434 # algorithm tries to build any suitable face on the given
4435 # wire and prints a warning message.
4436 # @param theName Object name; when specified, this parameter is used
4437 # for result publication in the study. Otherwise, if automatic
4438 # publication is switched on, default value is used for result name.
4440 # @return New GEOM.GEOM_Object, containing the created face.
4442 # @ref tui_creation_face "Example"
4443 @ManageTransactions("ShapesOp")
4444 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4446 Create a face on the given wire.
4449 theWire closed Wire or Edge to build the face on.
4450 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4451 If the tolerance of the obtained planar face is less
4452 than 1e-06, this face will be returned, otherwise the
4453 algorithm tries to build any suitable face on the given
4454 wire and prints a warning message.
4455 theName Object name; when specified, this parameter is used
4456 for result publication in the study. Otherwise, if automatic
4457 publication is switched on, default value is used for result name.
4460 New GEOM.GEOM_Object, containing the created face.
4462 # Example: see GEOM_TestAll.py
4463 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4464 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4465 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4467 RaiseIfFailed("MakeFace", self.ShapesOp)
4468 self._autoPublish(anObj, theName, "face")
4471 ## Create a face on the given wires set.
4472 # @param theWires List of closed wires or edges to build the face on.
4473 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4474 # If the tolerance of the obtained planar face is less
4475 # than 1e-06, this face will be returned, otherwise the
4476 # algorithm tries to build any suitable face on the given
4477 # wire and prints a warning message.
4478 # @param theName Object name; when specified, this parameter is used
4479 # for result publication in the study. Otherwise, if automatic
4480 # publication is switched on, default value is used for result name.
4482 # @return New GEOM.GEOM_Object, containing the created face.
4484 # @ref tui_creation_face "Example"
4485 @ManageTransactions("ShapesOp")
4486 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4488 Create a face on the given wires set.
4491 theWires List of closed wires or edges to build the face on.
4492 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4493 If the tolerance of the obtained planar face is less
4494 than 1e-06, this face will be returned, otherwise the
4495 algorithm tries to build any suitable face on the given
4496 wire and prints a warning message.
4497 theName Object name; when specified, this parameter is used
4498 for result publication in the study. Otherwise, if automatic
4499 publication is switched on, default value is used for result name.
4502 New GEOM.GEOM_Object, containing the created face.
4504 # Example: see GEOM_TestAll.py
4505 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4506 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4507 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4509 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4510 self._autoPublish(anObj, theName, "face")
4513 ## See MakeFaceWires() method for details.
4515 # @ref tui_creation_face "Example 1"
4516 # \n @ref swig_MakeFaces "Example 2"
4517 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4519 See geompy.MakeFaceWires() method for details.
4521 # Example: see GEOM_TestOthers.py
4522 # note: auto-publishing is done in self.MakeFaceWires()
4523 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4526 ## Create a shell from the set of faces and shells.
4527 # @param theFacesAndShells List of faces and/or shells.
4528 # @param theName Object name; when specified, this parameter is used
4529 # for result publication in the study. Otherwise, if automatic
4530 # publication is switched on, default value is used for result name.
4532 # @return New GEOM.GEOM_Object, containing the created shell.
4534 # @ref tui_creation_shell "Example"
4535 @ManageTransactions("ShapesOp")
4536 def MakeShell(self, theFacesAndShells, theName=None):
4538 Create a shell from the set of faces and shells.
4541 theFacesAndShells List of faces and/or shells.
4542 theName Object name; when specified, this parameter is used
4543 for result publication in the study. Otherwise, if automatic
4544 publication is switched on, default value is used for result name.
4547 New GEOM.GEOM_Object, containing the created shell.
4549 # Example: see GEOM_TestAll.py
4550 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4551 RaiseIfFailed("MakeShell", self.ShapesOp)
4552 self._autoPublish(anObj, theName, "shell")
4555 ## Create a solid, bounded by the given shells.
4556 # @param theShells Sequence of bounding shells.
4557 # @param theName Object name; when specified, this parameter is used
4558 # for result publication in the study. Otherwise, if automatic
4559 # publication is switched on, default value is used for result name.
4561 # @return New GEOM.GEOM_Object, containing the created solid.
4563 # @ref tui_creation_solid "Example"
4564 @ManageTransactions("ShapesOp")
4565 def MakeSolid(self, theShells, theName=None):
4567 Create a solid, bounded by the given shells.
4570 theShells Sequence of bounding shells.
4571 theName Object name; when specified, this parameter is used
4572 for result publication in the study. Otherwise, if automatic
4573 publication is switched on, default value is used for result name.
4576 New GEOM.GEOM_Object, containing the created solid.
4578 # Example: see GEOM_TestAll.py
4579 theShells = ToList(theShells)
4580 if len(theShells) == 1:
4581 descr = self._IsGoodForSolid(theShells[0])
4583 # raise RuntimeError, "MakeSolidShells : " + descr
4584 if descr == "WRN_SHAPE_UNCLOSED":
4585 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4586 anObj = self.ShapesOp.MakeSolidShells(theShells)
4587 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4588 self._autoPublish(anObj, theName, "solid")
4591 ## Create a compound of the given shapes.
4592 # @param theShapes List of shapes to put in compound.
4593 # @param theName Object name; when specified, this parameter is used
4594 # for result publication in the study. Otherwise, if automatic
4595 # publication is switched on, default value is used for result name.
4597 # @return New GEOM.GEOM_Object, containing the created compound.
4599 # @ref tui_creation_compound "Example"
4600 @ManageTransactions("ShapesOp")
4601 def MakeCompound(self, theShapes, theName=None):
4603 Create a compound of the given shapes.
4606 theShapes List of shapes to put in compound.
4607 theName Object name; when specified, this parameter is used
4608 for result publication in the study. Otherwise, if automatic
4609 publication is switched on, default value is used for result name.
4612 New GEOM.GEOM_Object, containing the created compound.
4614 # Example: see GEOM_TestAll.py
4615 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4616 RaiseIfFailed("MakeCompound", self.ShapesOp)
4617 self._autoPublish(anObj, theName, "compound")
4620 # end of l3_advanced
4623 ## @addtogroup l2_measure
4626 ## Gives quantity of faces in the given shape.
4627 # @param theShape Shape to count faces of.
4628 # @return Quantity of faces.
4630 # @ref swig_NumberOf "Example"
4631 @ManageTransactions("ShapesOp")
4632 def NumberOfFaces(self, theShape):
4634 Gives quantity of faces in the given shape.
4637 theShape Shape to count faces of.
4642 # Example: see GEOM_TestOthers.py
4643 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4644 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4647 ## Gives quantity of edges in the given shape.
4648 # @param theShape Shape to count edges of.
4649 # @return Quantity of edges.
4651 # @ref swig_NumberOf "Example"
4652 @ManageTransactions("ShapesOp")
4653 def NumberOfEdges(self, theShape):
4655 Gives quantity of edges in the given shape.
4658 theShape Shape to count edges of.
4663 # Example: see GEOM_TestOthers.py
4664 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4665 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4668 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4669 # @param theShape Shape to count sub-shapes of.
4670 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4671 # @return Quantity of sub-shapes of given type.
4673 # @ref swig_NumberOf "Example"
4674 @ManageTransactions("ShapesOp")
4675 def NumberOfSubShapes(self, theShape, theShapeType):
4677 Gives quantity of sub-shapes of type theShapeType in the given shape.
4680 theShape Shape to count sub-shapes of.
4681 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4684 Quantity of sub-shapes of given type.
4686 # Example: see GEOM_TestOthers.py
4687 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4688 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4691 ## Gives quantity of solids in the given shape.
4692 # @param theShape Shape to count solids in.
4693 # @return Quantity of solids.
4695 # @ref swig_NumberOf "Example"
4696 @ManageTransactions("ShapesOp")
4697 def NumberOfSolids(self, theShape):
4699 Gives quantity of solids in the given shape.
4702 theShape Shape to count solids in.
4707 # Example: see GEOM_TestOthers.py
4708 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4709 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4715 ## @addtogroup l3_healing
4718 ## Reverses an orientation the given shape.
4719 # @param theShape Shape to be reversed.
4720 # @param theName Object name; when specified, this parameter is used
4721 # for result publication in the study. Otherwise, if automatic
4722 # publication is switched on, default value is used for result name.
4724 # @return The reversed copy of theShape.
4726 # @ref swig_ChangeOrientation "Example"
4727 @ManageTransactions("ShapesOp")
4728 def ChangeOrientation(self, theShape, theName=None):
4730 Reverses an orientation the given shape.
4733 theShape Shape to be reversed.
4734 theName Object name; when specified, this parameter is used
4735 for result publication in the study. Otherwise, if automatic
4736 publication is switched on, default value is used for result name.
4739 The reversed copy of theShape.
4741 # Example: see GEOM_TestAll.py
4742 anObj = self.ShapesOp.ChangeOrientation(theShape)
4743 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4744 self._autoPublish(anObj, theName, "reversed")
4747 ## See ChangeOrientation() method for details.
4749 # @ref swig_OrientationChange "Example"
4750 def OrientationChange(self, theShape, theName=None):
4752 See geompy.ChangeOrientation method for details.
4754 # Example: see GEOM_TestOthers.py
4755 # note: auto-publishing is done in self.ChangeOrientation()
4756 anObj = self.ChangeOrientation(theShape, theName)
4762 ## @addtogroup l4_obtain
4765 ## Retrieve all free faces from the given shape.
4766 # Free face is a face, which is not shared between two shells of the shape.
4767 # @param theShape Shape to find free faces in.
4768 # @return List of IDs of all free faces, contained in theShape.
4770 # @ref tui_measurement_tools_page "Example"
4771 @ManageTransactions("ShapesOp")
4772 def GetFreeFacesIDs(self,theShape):
4774 Retrieve all free faces from the given shape.
4775 Free face is a face, which is not shared between two shells of the shape.
4778 theShape Shape to find free faces in.
4781 List of IDs of all free faces, contained in theShape.
4783 # Example: see GEOM_TestOthers.py
4784 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4785 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4788 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4789 # @param theShape1 Shape to find sub-shapes in.
4790 # @param theShape2 Shape to find shared sub-shapes with.
4791 # @param theShapeType Type of sub-shapes to be retrieved.
4792 # @param theName Object name; when specified, this parameter is used
4793 # for result publication in the study. Otherwise, if automatic
4794 # publication is switched on, default value is used for result name.
4796 # @return List of sub-shapes of theShape1, shared with theShape2.
4798 # @ref swig_GetSharedShapes "Example"
4799 @ManageTransactions("ShapesOp")
4800 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4802 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4805 theShape1 Shape to find sub-shapes in.
4806 theShape2 Shape to find shared sub-shapes with.
4807 theShapeType Type of sub-shapes to be retrieved.
4808 theName Object name; when specified, this parameter is used
4809 for result publication in the study. Otherwise, if automatic
4810 publication is switched on, default value is used for result name.
4813 List of sub-shapes of theShape1, shared with theShape2.
4815 # Example: see GEOM_TestOthers.py
4816 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4817 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4818 self._autoPublish(aList, theName, "shared")
4821 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4822 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
4823 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4824 # @param theName Object name; when specified, this parameter is used
4825 # for result publication in the study. Otherwise, if automatic
4826 # publication is switched on, default value is used for result name.
4828 # @return List of objects, that are sub-shapes of all given shapes.
4830 # @ref swig_GetSharedShapes "Example"
4831 @ManageTransactions("ShapesOp")
4832 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4834 Get all sub-shapes, shared by all shapes in the list theShapes.
4837 theShapes Either a list or compound of shapes to find common sub-shapes of.
4838 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4839 theName Object name; when specified, this parameter is used
4840 for result publication in the study. Otherwise, if automatic
4841 publication is switched on, default value is used for result name.
4844 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4846 # Example: see GEOM_TestOthers.py
4847 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType)
4848 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4849 self._autoPublish(aList, theName, "shared")
4852 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4853 # situated relatively the specified plane by the certain way,
4854 # defined through <VAR>theState</VAR> parameter.
4855 # @param theShape Shape to find sub-shapes of.
4856 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4857 # @param theAx1 Vector (or line, or linear edge), specifying normal
4858 # direction and location of the plane to find shapes on.
4859 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4860 # @param theName Object name; when specified, this parameter is used
4861 # for result publication in the study. Otherwise, if automatic
4862 # publication is switched on, default value is used for result name.
4864 # @return List of all found sub-shapes.
4866 # @ref swig_GetShapesOnPlane "Example"
4867 @ManageTransactions("ShapesOp")
4868 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4870 Find in theShape all sub-shapes of type theShapeType,
4871 situated relatively the specified plane by the certain way,
4872 defined through theState parameter.
4875 theShape Shape to find sub-shapes of.
4876 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4877 theAx1 Vector (or line, or linear edge), specifying normal
4878 direction and location of the plane to find shapes on.
4879 theState The state of the sub-shapes to find (see GEOM::shape_state)
4880 theName Object name; when specified, this parameter is used
4881 for result publication in the study. Otherwise, if automatic
4882 publication is switched on, default value is used for result name.
4885 List of all found sub-shapes.
4887 # Example: see GEOM_TestOthers.py
4888 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4889 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4890 self._autoPublish(aList, theName, "shapeOnPlane")
4893 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4894 # situated relatively the specified plane by the certain way,
4895 # defined through <VAR>theState</VAR> parameter.
4896 # @param theShape Shape to find sub-shapes of.
4897 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4898 # @param theAx1 Vector (or line, or linear edge), specifying normal
4899 # direction and location of the plane to find shapes on.
4900 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4902 # @return List of all found sub-shapes indices.
4904 # @ref swig_GetShapesOnPlaneIDs "Example"
4905 @ManageTransactions("ShapesOp")
4906 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4908 Find in theShape all sub-shapes of type theShapeType,
4909 situated relatively the specified plane by the certain way,
4910 defined through theState parameter.
4913 theShape Shape to find sub-shapes of.
4914 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4915 theAx1 Vector (or line, or linear edge), specifying normal
4916 direction and location of the plane to find shapes on.
4917 theState The state of the sub-shapes to find (see GEOM::shape_state)
4920 List of all found sub-shapes indices.
4922 # Example: see GEOM_TestOthers.py
4923 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4924 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4927 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4928 # situated relatively the specified plane by the certain way,
4929 # defined through <VAR>theState</VAR> parameter.
4930 # @param theShape Shape to find sub-shapes of.
4931 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4932 # @param theAx1 Vector (or line, or linear edge), specifying normal
4933 # direction of the plane to find shapes on.
4934 # @param thePnt Point specifying location of the plane to find shapes on.
4935 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4936 # @param theName Object name; when specified, this parameter is used
4937 # for result publication in the study. Otherwise, if automatic
4938 # publication is switched on, default value is used for result name.
4940 # @return List of all found sub-shapes.
4942 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4943 @ManageTransactions("ShapesOp")
4944 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4946 Find in theShape all sub-shapes of type theShapeType,
4947 situated relatively the specified plane by the certain way,
4948 defined through theState parameter.
4951 theShape Shape to find sub-shapes of.
4952 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4953 theAx1 Vector (or line, or linear edge), specifying normal
4954 direction and location of the plane to find shapes on.
4955 thePnt Point specifying location of the plane to find shapes on.
4956 theState The state of the sub-shapes to find (see GEOM::shape_state)
4957 theName Object name; when specified, this parameter is used
4958 for result publication in the study. Otherwise, if automatic
4959 publication is switched on, default value is used for result name.
4962 List of all found sub-shapes.
4964 # Example: see GEOM_TestOthers.py
4965 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4966 theAx1, thePnt, theState)
4967 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4968 self._autoPublish(aList, theName, "shapeOnPlane")
4971 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4972 # situated relatively the specified plane by the certain way,
4973 # defined through <VAR>theState</VAR> parameter.
4974 # @param theShape Shape to find sub-shapes of.
4975 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4976 # @param theAx1 Vector (or line, or linear edge), specifying normal
4977 # direction of the plane to find shapes on.
4978 # @param thePnt Point specifying location of the plane to find shapes on.
4979 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4981 # @return List of all found sub-shapes indices.
4983 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4984 @ManageTransactions("ShapesOp")
4985 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4987 Find in theShape all sub-shapes of type theShapeType,
4988 situated relatively the specified plane by the certain way,
4989 defined through theState parameter.
4992 theShape Shape to find sub-shapes of.
4993 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4994 theAx1 Vector (or line, or linear edge), specifying normal
4995 direction and location of the plane to find shapes on.
4996 thePnt Point specifying location of the plane to find shapes on.
4997 theState The state of the sub-shapes to find (see GEOM::shape_state)
5000 List of all found sub-shapes indices.
5002 # Example: see GEOM_TestOthers.py
5003 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5004 theAx1, thePnt, theState)
5005 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5008 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5009 # the specified cylinder by the certain way, defined through \a theState parameter.
5010 # @param theShape Shape to find sub-shapes of.
5011 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5012 # @param theAxis Vector (or line, or linear edge), specifying
5013 # axis of the cylinder to find shapes on.
5014 # @param theRadius Radius of the cylinder to find shapes on.
5015 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5016 # @param theName Object name; when specified, this parameter is used
5017 # for result publication in the study. Otherwise, if automatic
5018 # publication is switched on, default value is used for result name.
5020 # @return List of all found sub-shapes.
5022 # @ref swig_GetShapesOnCylinder "Example"
5023 @ManageTransactions("ShapesOp")
5024 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5026 Find in theShape all sub-shapes of type theShapeType, situated relatively
5027 the specified cylinder by the certain way, defined through theState parameter.
5030 theShape Shape to find sub-shapes of.
5031 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5032 theAxis Vector (or line, or linear edge), specifying
5033 axis of the cylinder to find shapes on.
5034 theRadius Radius of the cylinder to find shapes on.
5035 theState The state of the sub-shapes to find (see GEOM::shape_state)
5036 theName Object name; when specified, this parameter is used
5037 for result publication in the study. Otherwise, if automatic
5038 publication is switched on, default value is used for result name.
5041 List of all found sub-shapes.
5043 # Example: see GEOM_TestOthers.py
5044 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5045 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5046 self._autoPublish(aList, theName, "shapeOnCylinder")
5049 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5050 # the specified cylinder by the certain way, defined through \a theState parameter.
5051 # @param theShape Shape to find sub-shapes of.
5052 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5053 # @param theAxis Vector (or line, or linear edge), specifying
5054 # axis of the cylinder to find shapes on.
5055 # @param theRadius Radius of the cylinder to find shapes on.
5056 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5058 # @return List of all found sub-shapes indices.
5060 # @ref swig_GetShapesOnCylinderIDs "Example"
5061 @ManageTransactions("ShapesOp")
5062 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5064 Find in theShape all sub-shapes of type theShapeType, situated relatively
5065 the specified cylinder by the certain way, defined through theState parameter.
5068 theShape Shape to find sub-shapes of.
5069 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5070 theAxis Vector (or line, or linear edge), specifying
5071 axis of the cylinder to find shapes on.
5072 theRadius Radius of the cylinder to find shapes on.
5073 theState The state of the sub-shapes to find (see GEOM::shape_state)
5076 List of all found sub-shapes indices.
5078 # Example: see GEOM_TestOthers.py
5079 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5080 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5083 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5084 # the specified cylinder by the certain way, defined through \a theState parameter.
5085 # @param theShape Shape to find sub-shapes of.
5086 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5087 # @param theAxis Vector (or line, or linear edge), specifying
5088 # axis of the cylinder to find shapes on.
5089 # @param thePnt Point specifying location of the bottom of the cylinder.
5090 # @param theRadius Radius of the cylinder to find shapes on.
5091 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5092 # @param theName Object name; when specified, this parameter is used
5093 # for result publication in the study. Otherwise, if automatic
5094 # publication is switched on, default value is used for result name.
5096 # @return List of all found sub-shapes.
5098 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5099 @ManageTransactions("ShapesOp")
5100 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5102 Find in theShape all sub-shapes of type theShapeType, situated relatively
5103 the specified cylinder by the certain way, defined through theState parameter.
5106 theShape Shape to find sub-shapes of.
5107 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5108 theAxis Vector (or line, or linear edge), specifying
5109 axis of the cylinder to find shapes on.
5110 theRadius Radius of the cylinder to find shapes on.
5111 theState The state of the sub-shapes to find (see GEOM::shape_state)
5112 theName Object name; when specified, this parameter is used
5113 for result publication in the study. Otherwise, if automatic
5114 publication is switched on, default value is used for result name.
5117 List of all found sub-shapes.
5119 # Example: see GEOM_TestOthers.py
5120 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5121 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5122 self._autoPublish(aList, theName, "shapeOnCylinder")
5125 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5126 # the specified cylinder by the certain way, defined through \a theState parameter.
5127 # @param theShape Shape to find sub-shapes of.
5128 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5129 # @param theAxis Vector (or line, or linear edge), specifying
5130 # axis of the cylinder to find shapes on.
5131 # @param thePnt Point specifying location of the bottom of the cylinder.
5132 # @param theRadius Radius of the cylinder to find shapes on.
5133 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5135 # @return List of all found sub-shapes indices
5137 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5138 @ManageTransactions("ShapesOp")
5139 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5141 Find in theShape all sub-shapes of type theShapeType, situated relatively
5142 the specified cylinder by the certain way, defined through theState parameter.
5145 theShape Shape to find sub-shapes of.
5146 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5147 theAxis Vector (or line, or linear edge), specifying
5148 axis of the cylinder to find shapes on.
5149 theRadius Radius of the cylinder to find shapes on.
5150 theState The state of the sub-shapes to find (see GEOM::shape_state)
5153 List of all found sub-shapes indices.
5155 # Example: see GEOM_TestOthers.py
5156 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5157 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5160 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5161 # the specified sphere by the certain way, defined through \a theState parameter.
5162 # @param theShape Shape to find sub-shapes of.
5163 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5164 # @param theCenter Point, specifying center of the sphere to find shapes on.
5165 # @param theRadius Radius of the sphere to find shapes on.
5166 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5167 # @param theName Object name; when specified, this parameter is used
5168 # for result publication in the study. Otherwise, if automatic
5169 # publication is switched on, default value is used for result name.
5171 # @return List of all found sub-shapes.
5173 # @ref swig_GetShapesOnSphere "Example"
5174 @ManageTransactions("ShapesOp")
5175 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5177 Find in theShape all sub-shapes of type theShapeType, situated relatively
5178 the specified sphere by the certain way, defined through theState parameter.
5181 theShape Shape to find sub-shapes of.
5182 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5183 theCenter Point, specifying center of the sphere to find shapes on.
5184 theRadius Radius of the sphere to find shapes on.
5185 theState The state of the sub-shapes to find (see GEOM::shape_state)
5186 theName Object name; when specified, this parameter is used
5187 for result publication in the study. Otherwise, if automatic
5188 publication is switched on, default value is used for result name.
5191 List of all found sub-shapes.
5193 # Example: see GEOM_TestOthers.py
5194 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5195 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5196 self._autoPublish(aList, theName, "shapeOnSphere")
5199 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5200 # the specified sphere by the certain way, defined through \a theState parameter.
5201 # @param theShape Shape to find sub-shapes of.
5202 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5203 # @param theCenter Point, specifying center of the sphere to find shapes on.
5204 # @param theRadius Radius of the sphere to find shapes on.
5205 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5207 # @return List of all found sub-shapes indices.
5209 # @ref swig_GetShapesOnSphereIDs "Example"
5210 @ManageTransactions("ShapesOp")
5211 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5213 Find in theShape all sub-shapes of type theShapeType, situated relatively
5214 the specified sphere by the certain way, defined through theState parameter.
5217 theShape Shape to find sub-shapes of.
5218 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5219 theCenter Point, specifying center of the sphere to find shapes on.
5220 theRadius Radius of the sphere 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.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5228 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5231 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5232 # the specified quadrangle 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 theTopLeftPoint Point, specifying top left corner of a quadrangle
5236 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5237 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5238 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
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_GetShapesOnQuadrangle "Example"
5247 @ManageTransactions("ShapesOp")
5248 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5249 theTopLeftPoint, theTopRigthPoint,
5250 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5252 Find in theShape all sub-shapes of type theShapeType, situated relatively
5253 the specified quadrangle by the certain way, defined through theState parameter.
5256 theShape Shape to find sub-shapes of.
5257 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5258 theTopLeftPoint Point, specifying top left corner of a quadrangle
5259 theTopRigthPoint Point, specifying top right corner of a quadrangle
5260 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5261 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5262 theState The state of the sub-shapes to find (see GEOM::shape_state)
5263 theName Object name; when specified, this parameter is used
5264 for result publication in the study. Otherwise, if automatic
5265 publication is switched on, default value is used for result name.
5268 List of all found sub-shapes.
5270 # Example: see GEOM_TestOthers.py
5271 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5272 theTopLeftPoint, theTopRigthPoint,
5273 theBottomLeftPoint, theBottomRigthPoint, theState)
5274 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5275 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5278 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5279 # the specified quadrangle by the certain way, defined through \a theState parameter.
5280 # @param theShape Shape to find sub-shapes of.
5281 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5282 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5283 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5284 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5285 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5286 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5288 # @return List of all found sub-shapes indices.
5290 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5291 @ManageTransactions("ShapesOp")
5292 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5293 theTopLeftPoint, theTopRigthPoint,
5294 theBottomLeftPoint, theBottomRigthPoint, theState):
5296 Find in theShape all sub-shapes of type theShapeType, situated relatively
5297 the specified quadrangle by the certain way, defined through theState parameter.
5300 theShape Shape to find sub-shapes of.
5301 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5302 theTopLeftPoint Point, specifying top left corner of a quadrangle
5303 theTopRigthPoint Point, specifying top right corner of a quadrangle
5304 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5305 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5306 theState The state of the sub-shapes to find (see GEOM::shape_state)
5309 List of all found sub-shapes indices.
5312 # Example: see GEOM_TestOthers.py
5313 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5314 theTopLeftPoint, theTopRigthPoint,
5315 theBottomLeftPoint, theBottomRigthPoint, theState)
5316 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5319 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5320 # the specified \a theBox by the certain way, defined through \a theState parameter.
5321 # @param theBox Shape for relative comparing.
5322 # @param theShape Shape to find sub-shapes of.
5323 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5324 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5325 # @param theName Object name; when specified, this parameter is used
5326 # for result publication in the study. Otherwise, if automatic
5327 # publication is switched on, default value is used for result name.
5329 # @return List of all found sub-shapes.
5331 # @ref swig_GetShapesOnBox "Example"
5332 @ManageTransactions("ShapesOp")
5333 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5335 Find in theShape all sub-shapes of type theShapeType, situated relatively
5336 the specified theBox by the certain way, defined through theState parameter.
5339 theBox Shape for relative comparing.
5340 theShape Shape to find sub-shapes of.
5341 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5342 theState The state of the sub-shapes to find (see GEOM::shape_state)
5343 theName Object name; when specified, this parameter is used
5344 for result publication in the study. Otherwise, if automatic
5345 publication is switched on, default value is used for result name.
5348 List of all found sub-shapes.
5350 # Example: see GEOM_TestOthers.py
5351 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5352 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5353 self._autoPublish(aList, theName, "shapeOnBox")
5356 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5357 # the specified \a theBox by the certain way, defined through \a theState parameter.
5358 # @param theBox Shape for relative comparing.
5359 # @param theShape Shape to find sub-shapes of.
5360 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5361 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5363 # @return List of all found sub-shapes indices.
5365 # @ref swig_GetShapesOnBoxIDs "Example"
5366 @ManageTransactions("ShapesOp")
5367 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5369 Find in theShape all sub-shapes of type theShapeType, situated relatively
5370 the specified theBox by the certain way, defined through theState parameter.
5373 theBox Shape for relative comparing.
5374 theShape Shape to find sub-shapes of.
5375 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5376 theState The state of the sub-shapes to find (see GEOM::shape_state)
5379 List of all found sub-shapes indices.
5381 # Example: see GEOM_TestOthers.py
5382 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5383 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5386 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5387 # situated relatively the specified \a theCheckShape by the
5388 # certain way, defined through \a theState parameter.
5389 # @param theCheckShape Shape for relative comparing. It must be a solid.
5390 # @param theShape Shape to find sub-shapes of.
5391 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5392 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5393 # @param theName Object name; when specified, this parameter is used
5394 # for result publication in the study. Otherwise, if automatic
5395 # publication is switched on, default value is used for result name.
5397 # @return List of all found sub-shapes.
5399 # @ref swig_GetShapesOnShape "Example"
5400 @ManageTransactions("ShapesOp")
5401 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5403 Find in theShape all sub-shapes of type theShapeType,
5404 situated relatively the specified theCheckShape by the
5405 certain way, defined through theState parameter.
5408 theCheckShape Shape for relative comparing. It must be a solid.
5409 theShape Shape to find sub-shapes of.
5410 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5411 theState The state of the sub-shapes to find (see GEOM::shape_state)
5412 theName Object name; when specified, this parameter is used
5413 for result publication in the study. Otherwise, if automatic
5414 publication is switched on, default value is used for result name.
5417 List of all found sub-shapes.
5419 # Example: see GEOM_TestOthers.py
5420 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5421 theShapeType, theState)
5422 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5423 self._autoPublish(aList, theName, "shapeOnShape")
5426 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5427 # situated relatively the specified \a theCheckShape by the
5428 # certain way, defined through \a theState parameter.
5429 # @param theCheckShape Shape for relative comparing. It must be a solid.
5430 # @param theShape Shape to find sub-shapes of.
5431 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5432 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5433 # @param theName Object name; when specified, this parameter is used
5434 # for result publication in the study. Otherwise, if automatic
5435 # publication is switched on, default value is used for result name.
5437 # @return All found sub-shapes as compound.
5439 # @ref swig_GetShapesOnShapeAsCompound "Example"
5440 @ManageTransactions("ShapesOp")
5441 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5443 Find in theShape all sub-shapes of type theShapeType,
5444 situated relatively the specified theCheckShape by the
5445 certain way, defined through theState parameter.
5448 theCheckShape Shape for relative comparing. It must be a solid.
5449 theShape Shape to find sub-shapes of.
5450 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5451 theState The state of the sub-shapes to find (see GEOM::shape_state)
5452 theName Object name; when specified, this parameter is used
5453 for result publication in the study. Otherwise, if automatic
5454 publication is switched on, default value is used for result name.
5457 All found sub-shapes as compound.
5459 # Example: see GEOM_TestOthers.py
5460 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5461 theShapeType, theState)
5462 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5463 self._autoPublish(anObj, theName, "shapeOnShape")
5466 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5467 # situated relatively the specified \a theCheckShape by the
5468 # certain way, defined through \a theState parameter.
5469 # @param theCheckShape Shape for relative comparing. It must be a solid.
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)
5474 # @return List of all found sub-shapes indices.
5476 # @ref swig_GetShapesOnShapeIDs "Example"
5477 @ManageTransactions("ShapesOp")
5478 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5480 Find in theShape all sub-shapes of type theShapeType,
5481 situated relatively the specified theCheckShape by the
5482 certain way, defined through theState parameter.
5485 theCheckShape Shape for relative comparing. It must be a solid.
5486 theShape Shape to find sub-shapes of.
5487 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5488 theState The state of the sub-shapes to find (see GEOM::shape_state)
5491 List of all found sub-shapes indices.
5493 # Example: see GEOM_TestOthers.py
5494 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5495 theShapeType, theState)
5496 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5499 ## Get sub-shape(s) of theShapeWhere, which are
5500 # coincident with \a theShapeWhat or could be a part of it.
5501 # @param theShapeWhere Shape to find sub-shapes of.
5502 # @param theShapeWhat Shape, specifying what to find.
5503 # @param isNewImplementation implementation of GetInPlace functionality
5504 # (default = False, old alghorithm based on shape properties)
5505 # @param theName Object name; when specified, this parameter is used
5506 # for result publication in the study. Otherwise, if automatic
5507 # publication is switched on, default value is used for result name.
5509 # @return Group of all found sub-shapes or a single found sub-shape.
5511 # @note This function has a restriction on argument shapes.
5512 # If \a theShapeWhere has curved parts with significantly
5513 # outstanding centres (i.e. the mass centre of a part is closer to
5514 # \a theShapeWhat than to the part), such parts will not be found.
5515 # @image html get_in_place_lost_part.png
5517 # @ref swig_GetInPlace "Example"
5518 @ManageTransactions("ShapesOp")
5519 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5521 Get sub-shape(s) of theShapeWhere, which are
5522 coincident with theShapeWhat or could be a part of it.
5525 theShapeWhere Shape to find sub-shapes of.
5526 theShapeWhat Shape, specifying what to find.
5527 isNewImplementation Implementation of GetInPlace functionality
5528 (default = False, old alghorithm based on shape properties)
5529 theName Object name; when specified, this parameter is used
5530 for result publication in the study. Otherwise, if automatic
5531 publication is switched on, default value is used for result name.
5534 Group of all found sub-shapes or a single found sub-shape.
5538 This function has a restriction on argument shapes.
5539 If theShapeWhere has curved parts with significantly
5540 outstanding centres (i.e. the mass centre of a part is closer to
5541 theShapeWhat than to the part), such parts will not be found.
5543 # Example: see GEOM_TestOthers.py
5545 if isNewImplementation:
5546 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5548 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5550 RaiseIfFailed("GetInPlace", self.ShapesOp)
5551 self._autoPublish(anObj, theName, "inplace")
5554 ## Get sub-shape(s) of \a theShapeWhere, which are
5555 # coincident with \a theShapeWhat or could be a part of it.
5557 # Implementation of this method is based on a saved history of an operation,
5558 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5559 # arguments (an argument shape or a sub-shape of an argument shape).
5560 # The operation could be the Partition or one of boolean operations,
5561 # performed on simple shapes (not on compounds).
5563 # @param theShapeWhere Shape to find sub-shapes of.
5564 # @param theShapeWhat Shape, specifying what to find (must be in the
5565 # building history of the ShapeWhere).
5566 # @param theName Object name; when specified, this parameter is used
5567 # for result publication in the study. Otherwise, if automatic
5568 # publication is switched on, default value is used for result name.
5570 # @return Group of all found sub-shapes or a single found sub-shape.
5572 # @ref swig_GetInPlace "Example"
5573 @ManageTransactions("ShapesOp")
5574 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5576 Implementation of this method is based on a saved history of an operation,
5577 produced theShapeWhere. The theShapeWhat must be among this operation's
5578 arguments (an argument shape or a sub-shape of an argument shape).
5579 The operation could be the Partition or one of boolean operations,
5580 performed on simple shapes (not on compounds).
5583 theShapeWhere Shape to find sub-shapes of.
5584 theShapeWhat Shape, specifying what to find (must be in the
5585 building history of the ShapeWhere).
5586 theName Object name; when specified, this parameter is used
5587 for result publication in the study. Otherwise, if automatic
5588 publication is switched on, default value is used for result name.
5591 Group of all found sub-shapes or a single found sub-shape.
5593 # Example: see GEOM_TestOthers.py
5594 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5595 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5596 self._autoPublish(anObj, theName, "inplace")
5599 ## Get sub-shape of theShapeWhere, which is
5600 # equal to \a theShapeWhat.
5601 # @param theShapeWhere Shape to find sub-shape of.
5602 # @param theShapeWhat Shape, specifying what to find.
5603 # @param theName Object name; when specified, this parameter is used
5604 # for result publication in the study. Otherwise, if automatic
5605 # publication is switched on, default value is used for result name.
5607 # @return New GEOM.GEOM_Object for found sub-shape.
5609 # @ref swig_GetSame "Example"
5610 @ManageTransactions("ShapesOp")
5611 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5613 Get sub-shape of theShapeWhere, which is
5614 equal to theShapeWhat.
5617 theShapeWhere Shape to find sub-shape of.
5618 theShapeWhat Shape, specifying what to find.
5619 theName Object name; when specified, this parameter is used
5620 for result publication in the study. Otherwise, if automatic
5621 publication is switched on, default value is used for result name.
5624 New GEOM.GEOM_Object for found sub-shape.
5626 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5627 RaiseIfFailed("GetSame", self.ShapesOp)
5628 self._autoPublish(anObj, theName, "sameShape")
5632 ## Get sub-shape indices of theShapeWhere, which is
5633 # equal to \a theShapeWhat.
5634 # @param theShapeWhere Shape to find sub-shape of.
5635 # @param theShapeWhat Shape, specifying what to find.
5636 # @return List of all found sub-shapes indices.
5638 # @ref swig_GetSame "Example"
5639 @ManageTransactions("ShapesOp")
5640 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5642 Get sub-shape indices of theShapeWhere, which is
5643 equal to theShapeWhat.
5646 theShapeWhere Shape to find sub-shape of.
5647 theShapeWhat Shape, specifying what to find.
5650 List of all found sub-shapes indices.
5652 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5653 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5660 ## @addtogroup l4_access
5663 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5664 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5665 # @param aShape Shape to get sub-shape of.
5666 # @param ListOfID List of sub-shapes indices.
5667 # @param theName Object name; when specified, this parameter is used
5668 # for result publication in the study. Otherwise, if automatic
5669 # publication is switched on, default value is used for result name.
5671 # @return Found sub-shape.
5673 # @ref swig_all_decompose "Example"
5674 def GetSubShape(self, aShape, ListOfID, theName=None):
5676 Obtain a composite sub-shape of aShape, composed from sub-shapes
5677 of aShape, selected by their unique IDs inside aShape
5680 aShape Shape to get sub-shape of.
5681 ListOfID List of sub-shapes indices.
5682 theName Object name; when specified, this parameter is used
5683 for result publication in the study. Otherwise, if automatic
5684 publication is switched on, default value is used for result name.
5689 # Example: see GEOM_TestAll.py
5690 anObj = self.AddSubShape(aShape,ListOfID)
5691 self._autoPublish(anObj, theName, "subshape")
5694 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5695 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5696 # @param aShape Shape to get sub-shape of.
5697 # @param aSubShape Sub-shapes of aShape.
5698 # @return ID of found sub-shape.
5700 # @ref swig_all_decompose "Example"
5701 @ManageTransactions("LocalOp")
5702 def GetSubShapeID(self, aShape, aSubShape):
5704 Obtain unique ID of sub-shape aSubShape inside aShape
5705 of aShape, selected by their unique IDs inside aShape
5708 aShape Shape to get sub-shape of.
5709 aSubShape Sub-shapes of aShape.
5712 ID of found sub-shape.
5714 # Example: see GEOM_TestAll.py
5715 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5716 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5719 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5720 # This function is provided for performance purpose. The complexity is O(n) with n
5721 # the number of subobjects of aShape
5722 # @param aShape Shape to get sub-shape of.
5723 # @param aSubShapes Sub-shapes of aShape.
5724 # @return list of IDs of found sub-shapes.
5726 # @ref swig_all_decompose "Example"
5727 @ManageTransactions("ShapesOp")
5728 def GetSubShapesIDs(self, aShape, aSubShapes):
5730 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5731 This function is provided for performance purpose. The complexity is O(n) with n
5732 the number of subobjects of aShape
5735 aShape Shape to get sub-shape of.
5736 aSubShapes Sub-shapes of aShape.
5739 List of IDs of found sub-shape.
5741 # Example: see GEOM_TestAll.py
5742 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5743 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5749 ## @addtogroup l4_decompose
5752 ## Get all sub-shapes and groups of \a theShape,
5753 # that were created already by any other methods.
5754 # @param theShape Any shape.
5755 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5756 # returned, else all found sub-shapes and groups.
5757 # @return List of existing sub-objects of \a theShape.
5759 # @ref swig_all_decompose "Example"
5760 @ManageTransactions("ShapesOp")
5761 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5763 Get all sub-shapes and groups of theShape,
5764 that were created already by any other methods.
5768 theGroupsOnly If this parameter is TRUE, only groups will be
5769 returned, else all found sub-shapes and groups.
5772 List of existing sub-objects of theShape.
5774 # Example: see GEOM_TestAll.py
5775 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5776 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5779 ## Get all groups of \a theShape,
5780 # that were created already by any other methods.
5781 # @param theShape Any shape.
5782 # @return List of existing groups of \a theShape.
5784 # @ref swig_all_decompose "Example"
5785 @ManageTransactions("ShapesOp")
5786 def GetGroups(self, theShape):
5788 Get all groups of theShape,
5789 that were created already by any other methods.
5795 List of existing groups of theShape.
5797 # Example: see GEOM_TestAll.py
5798 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5799 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5802 ## Explode a shape on sub-shapes of a given type.
5803 # If the shape itself matches the type, it is also returned.
5804 # @param aShape Shape to be exploded.
5805 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5806 # @param theName Object name; when specified, this parameter is used
5807 # for result publication in the study. Otherwise, if automatic
5808 # publication is switched on, default value is used for result name.
5810 # @return List of sub-shapes of type theShapeType, contained in theShape.
5812 # @ref swig_all_decompose "Example"
5813 @ManageTransactions("ShapesOp")
5814 def SubShapeAll(self, aShape, aType, theName=None):
5816 Explode a shape on sub-shapes of a given type.
5817 If the shape itself matches the type, it is also returned.
5820 aShape Shape to be exploded.
5821 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5822 theName Object name; when specified, this parameter is used
5823 for result publication in the study. Otherwise, if automatic
5824 publication is switched on, default value is used for result name.
5827 List of sub-shapes of type theShapeType, contained in theShape.
5829 # Example: see GEOM_TestAll.py
5830 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5831 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5832 self._autoPublish(ListObj, theName, "subshape")
5835 ## Explode a shape on sub-shapes of a given type.
5836 # @param aShape Shape to be exploded.
5837 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5838 # @return List of IDs of sub-shapes.
5840 # @ref swig_all_decompose "Example"
5841 @ManageTransactions("ShapesOp")
5842 def SubShapeAllIDs(self, aShape, aType):
5844 Explode a shape on sub-shapes of a given type.
5847 aShape Shape to be exploded (see geompy.ShapeType)
5848 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5851 List of IDs of sub-shapes.
5853 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5854 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5857 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5858 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5859 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5860 # @param aShape Shape to get sub-shape of.
5861 # @param ListOfInd List of sub-shapes indices.
5862 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5863 # @param theName Object name; when specified, this parameter is used
5864 # for result publication in the study. Otherwise, if automatic
5865 # publication is switched on, default value is used for result name.
5867 # @return A compound of sub-shapes of aShape.
5869 # @ref swig_all_decompose "Example"
5870 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5872 Obtain a compound of sub-shapes of aShape,
5873 selected by their indices in list of all sub-shapes of type aType.
5874 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5877 aShape Shape to get sub-shape of.
5878 ListOfID List of sub-shapes indices.
5879 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5880 theName Object name; when specified, this parameter is used
5881 for result publication in the study. Otherwise, if automatic
5882 publication is switched on, default value is used for result name.
5885 A compound of sub-shapes of aShape.
5887 # Example: see GEOM_TestAll.py
5889 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5890 for ind in ListOfInd:
5891 ListOfIDs.append(AllShapeIDsList[ind - 1])
5892 # note: auto-publishing is done in self.GetSubShape()
5893 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5896 ## Explode a shape on sub-shapes of a given type.
5897 # Sub-shapes will be sorted taking into account their gravity centers,
5898 # to provide stable order of sub-shapes.
5899 # If the shape itself matches the type, it is also returned.
5900 # @param aShape Shape to be exploded.
5901 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5902 # @param theName Object name; when specified, this parameter is used
5903 # for result publication in the study. Otherwise, if automatic
5904 # publication is switched on, default value is used for result name.
5906 # @return List of sub-shapes of type theShapeType, contained in theShape.
5908 # @ref swig_SubShapeAllSorted "Example"
5909 @ManageTransactions("ShapesOp")
5910 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5912 Explode a shape on sub-shapes of a given type.
5913 Sub-shapes will be sorted taking into account their gravity centers,
5914 to provide stable order of sub-shapes.
5915 If the shape itself matches the type, it is also returned.
5918 aShape Shape to be exploded.
5919 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5920 theName Object name; when specified, this parameter is used
5921 for result publication in the study. Otherwise, if automatic
5922 publication is switched on, default value is used for result name.
5925 List of sub-shapes of type theShapeType, contained in theShape.
5927 # Example: see GEOM_TestAll.py
5928 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5929 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5930 self._autoPublish(ListObj, theName, "subshape")
5933 ## Explode a shape on sub-shapes of a given type.
5934 # Sub-shapes will be sorted taking into account their gravity centers,
5935 # to provide stable order of sub-shapes.
5936 # @param aShape Shape to be exploded.
5937 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5938 # @return List of IDs of sub-shapes.
5940 # @ref swig_all_decompose "Example"
5941 @ManageTransactions("ShapesOp")
5942 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5944 Explode a shape on sub-shapes of a given type.
5945 Sub-shapes will be sorted taking into account their gravity centers,
5946 to provide stable order of sub-shapes.
5949 aShape Shape to be exploded.
5950 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5953 List of IDs of sub-shapes.
5955 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5956 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5959 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5960 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5961 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5962 # @param aShape Shape to get sub-shape of.
5963 # @param ListOfInd List of sub-shapes indices.
5964 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5965 # @param theName Object name; when specified, this parameter is used
5966 # for result publication in the study. Otherwise, if automatic
5967 # publication is switched on, default value is used for result name.
5969 # @return A compound of sub-shapes of aShape.
5971 # @ref swig_all_decompose "Example"
5972 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5974 Obtain a compound of sub-shapes of aShape,
5975 selected by they indices in sorted list of all sub-shapes of type aType.
5976 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5979 aShape Shape to get sub-shape of.
5980 ListOfID List of sub-shapes indices.
5981 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5982 theName Object name; when specified, this parameter is used
5983 for result publication in the study. Otherwise, if automatic
5984 publication is switched on, default value is used for result name.
5987 A compound of sub-shapes of aShape.
5989 # Example: see GEOM_TestAll.py
5991 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5992 for ind in ListOfInd:
5993 ListOfIDs.append(AllShapeIDsList[ind - 1])
5994 # note: auto-publishing is done in self.GetSubShape()
5995 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5998 ## Extract shapes (excluding the main shape) of given type.
5999 # @param aShape The shape.
6000 # @param aType The shape type (see ShapeType())
6001 # @param isSorted Boolean flag to switch sorting on/off.
6002 # @param theName Object name; when specified, this parameter is used
6003 # for result publication in the study. Otherwise, if automatic
6004 # publication is switched on, default value is used for result name.
6006 # @return List of sub-shapes of type aType, contained in aShape.
6008 # @ref swig_FilletChamfer "Example"
6009 @ManageTransactions("ShapesOp")
6010 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6012 Extract shapes (excluding the main shape) of given type.
6016 aType The shape type (see geompy.ShapeType)
6017 isSorted Boolean flag to switch sorting on/off.
6018 theName Object name; when specified, this parameter is used
6019 for result publication in the study. Otherwise, if automatic
6020 publication is switched on, default value is used for result name.
6023 List of sub-shapes of type aType, contained in aShape.
6025 # Example: see GEOM_TestAll.py
6026 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6027 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6028 self._autoPublish(ListObj, theName, "subshape")
6031 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6032 # @param aShape Main shape.
6033 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6034 # @param theName Object name; when specified, this parameter is used
6035 # for result publication in the study. Otherwise, if automatic
6036 # publication is switched on, default value is used for result name.
6037 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6039 # @ref swig_all_decompose "Example"
6040 @ManageTransactions("ShapesOp")
6041 def SubShapes(self, aShape, anIDs, theName=None):
6043 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6047 anIDs List of unique IDs of sub-shapes inside theMainShape.
6048 theName Object name; when specified, this parameter is used
6049 for result publication in the study. Otherwise, if automatic
6050 publication is switched on, default value is used for result name.
6053 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6055 # Example: see GEOM_TestAll.py
6056 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6057 RaiseIfFailed("SubShapes", self.ShapesOp)
6058 self._autoPublish(ListObj, theName, "subshape")
6061 # end of l4_decompose
6064 ## @addtogroup l4_decompose_d
6067 ## Deprecated method
6068 # It works like SubShapeAllSortedCentres(), but wrongly
6069 # defines centres of faces, shells and solids.
6070 @ManageTransactions("ShapesOp")
6071 def SubShapeAllSorted(self, aShape, aType, theName=None):
6074 It works like geompy.SubShapeAllSortedCentres, but wrongly
6075 defines centres of faces, shells and solids.
6077 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6078 RaiseIfFailed("MakeExplode", self.ShapesOp)
6079 self._autoPublish(ListObj, theName, "subshape")
6082 ## Deprecated method
6083 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6084 # defines centres of faces, shells and solids.
6085 @ManageTransactions("ShapesOp")
6086 def SubShapeAllSortedIDs(self, aShape, aType):
6089 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6090 defines centres of faces, shells and solids.
6092 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6093 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6096 ## Deprecated method
6097 # It works like SubShapeSortedCentres(), but has a bug
6098 # (wrongly defines centres of faces, shells and solids).
6099 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6102 It works like geompy.SubShapeSortedCentres, but has a bug
6103 (wrongly defines centres of faces, shells and solids).
6106 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6107 for ind in ListOfInd:
6108 ListOfIDs.append(AllShapeIDsList[ind - 1])
6109 # note: auto-publishing is done in self.GetSubShape()
6110 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6113 # end of l4_decompose_d
6116 ## @addtogroup l3_healing
6119 ## Apply a sequence of Shape Healing operators to the given object.
6120 # @param theShape Shape to be processed.
6121 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6122 # @param theParameters List of names of parameters
6123 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6124 # @param theValues List of values of parameters, in the same order
6125 # as parameters are listed in <VAR>theParameters</VAR> list.
6126 # @param theName Object name; when specified, this parameter is used
6127 # for result publication in the study. Otherwise, if automatic
6128 # publication is switched on, default value is used for result name.
6130 # <b> Operators and Parameters: </b> \n
6132 # * \b FixShape - corrects invalid shapes. \n
6133 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6134 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6136 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6137 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6138 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6139 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6141 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6142 # surfaces in segments using a certain angle. \n
6143 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6144 # if Angle=180, four if Angle=90, etc). \n
6145 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6147 # * \b SplitClosedFaces - splits closed faces in segments.
6148 # The number of segments depends on the number of splitting points.\n
6149 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6151 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6152 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6153 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6154 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6155 # This and the previous parameters can take the following values:\n
6156 # \b Parametric \b Continuity \n
6157 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6158 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6159 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6160 # ruling out sharp edges).\n
6161 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6162 # are of the same magnitude).\n
6163 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6164 # or surfaces (d/du C(u)) are the same at junction. \n
6165 # \b Geometric \b Continuity \n
6166 # \b G1: first derivatives are proportional at junction.\n
6167 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6168 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6169 # \b G2: first and second derivatives are proportional at junction.
6170 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6171 # continuity requires that the underlying parameterization was continuous as well.
6172 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6174 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6175 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6176 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6177 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6178 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6179 # with the specified parameters.\n
6180 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6181 # with the specified parameters.\n
6182 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6183 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6184 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6185 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6187 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6188 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6189 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6190 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6191 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6193 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6194 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6197 # @return New GEOM.GEOM_Object, containing processed shape.
6199 # \n @ref tui_shape_processing "Example"
6200 @ManageTransactions("HealOp")
6201 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6203 Apply a sequence of Shape Healing operators to the given object.
6206 theShape Shape to be processed.
6207 theValues List of values of parameters, in the same order
6208 as parameters are listed in theParameters list.
6209 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6210 theParameters List of names of parameters
6211 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6212 theName Object name; when specified, this parameter is used
6213 for result publication in the study. Otherwise, if automatic
6214 publication is switched on, default value is used for result name.
6216 Operators and Parameters:
6218 * FixShape - corrects invalid shapes.
6219 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6220 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6221 * FixFaceSize - removes small faces, such as spots and strips.
6222 * FixFaceSize.Tolerance - defines minimum possible face size.
6223 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6224 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6225 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6226 in segments using a certain angle.
6227 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6228 if Angle=180, four if Angle=90, etc).
6229 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6230 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6232 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6233 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6234 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6235 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6236 * SplitContinuity.CurveContinuity - required continuity for curves.
6237 This and the previous parameters can take the following values:
6239 Parametric Continuity:
6240 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6241 coincidental. The curves or surfaces may still meet at an angle,
6242 giving rise to a sharp corner or edge).
6243 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6244 are parallel, ruling out sharp edges).
6245 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6246 or surfaces are of the same magnitude).
6247 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6248 curves or surfaces (d/du C(u)) are the same at junction.
6250 Geometric Continuity:
6251 G1: first derivatives are proportional at junction.
6252 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6253 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6254 G2: first and second derivatives are proportional at junction. As the names imply,
6255 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6256 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6257 geometric continuity of order n, but not vice-versa.
6258 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6259 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6260 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6261 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6262 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6263 the specified parameters.
6264 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6265 the specified parameters.
6266 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6267 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6268 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6269 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6270 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6271 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6272 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6273 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6274 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6275 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6276 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6279 New GEOM.GEOM_Object, containing processed shape.
6281 Note: For more information look through SALOME Geometry User's Guide->
6282 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6284 # Example: see GEOM_TestHealing.py
6285 theValues,Parameters = ParseList(theValues)
6286 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6287 # To avoid script failure in case of good argument shape
6288 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6290 RaiseIfFailed("ProcessShape", self.HealOp)
6291 for string in (theOperators + theParameters):
6292 Parameters = ":" + Parameters
6294 anObj.SetParameters(Parameters)
6295 self._autoPublish(anObj, theName, "healed")
6298 ## Remove faces from the given object (shape).
6299 # @param theObject Shape to be processed.
6300 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6301 # removes ALL faces of the given object.
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.
6306 # @return New GEOM.GEOM_Object, containing processed shape.
6308 # @ref tui_suppress_faces "Example"
6309 @ManageTransactions("HealOp")
6310 def SuppressFaces(self, theObject, theFaces, theName=None):
6312 Remove faces from the given object (shape).
6315 theObject Shape to be processed.
6316 theFaces Indices of faces to be removed, if EMPTY then the method
6317 removes ALL faces of the given object.
6318 theName Object name; when specified, this parameter is used
6319 for result publication in the study. Otherwise, if automatic
6320 publication is switched on, default value is used for result name.
6323 New GEOM.GEOM_Object, containing processed shape.
6325 # Example: see GEOM_TestHealing.py
6326 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6327 RaiseIfFailed("SuppressFaces", self.HealOp)
6328 self._autoPublish(anObj, theName, "suppressFaces")
6331 ## Sewing of faces into a single shell.
6332 # @param ListShape Shapes to be processed.
6333 # @param theTolerance Required tolerance value.
6334 # @param AllowNonManifold Flag that allows non-manifold sewing.
6335 # @param theName Object name; when specified, this parameter is used
6336 # for result publication in the study. Otherwise, if automatic
6337 # publication is switched on, default value is used for result name.
6339 # @return New GEOM.GEOM_Object, containing a result shell.
6341 # @ref tui_sewing "Example"
6342 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6344 Sewing of faces into a single shell.
6347 ListShape Shapes to be processed.
6348 theTolerance Required tolerance value.
6349 AllowNonManifold Flag that allows non-manifold sewing.
6350 theName Object name; when specified, this parameter is used
6351 for result publication in the study. Otherwise, if automatic
6352 publication is switched on, default value is used for result name.
6355 New GEOM.GEOM_Object, containing containing a result shell.
6357 # Example: see GEOM_TestHealing.py
6358 # note: auto-publishing is done in self.Sew()
6359 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6362 ## Sewing of faces into a single shell.
6363 # @param ListShape Shapes to be processed.
6364 # @param theTolerance Required tolerance value.
6365 # @param AllowNonManifold Flag that allows non-manifold sewing.
6366 # @param theName Object name; when specified, this parameter is used
6367 # for result publication in the study. Otherwise, if automatic
6368 # publication is switched on, default value is used for result name.
6370 # @return New GEOM.GEOM_Object, containing a result shell.
6371 @ManageTransactions("HealOp")
6372 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6374 Sewing of faces into a single shell.
6377 ListShape Shapes to be processed.
6378 theTolerance Required tolerance value.
6379 AllowNonManifold Flag that allows non-manifold sewing.
6380 theName Object name; when specified, this parameter is used
6381 for result publication in the study. Otherwise, if automatic
6382 publication is switched on, default value is used for result name.
6385 New GEOM.GEOM_Object, containing a result shell.
6387 # Example: see MakeSewing() above
6388 theTolerance,Parameters = ParseParameters(theTolerance)
6389 if AllowNonManifold:
6390 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6392 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6393 # To avoid script failure in case of good argument shape
6394 # (Fix of test cases geom/bugs11/L7,L8)
6395 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6397 RaiseIfFailed("Sew", self.HealOp)
6398 anObj.SetParameters(Parameters)
6399 self._autoPublish(anObj, theName, "sewed")
6402 ## Rebuild the topology of theSolids by removing
6403 # the faces that are shared by several solids.
6404 # @param theSolids A compound or a list of solids to be processed.
6405 # @param theName Object name; when specified, this parameter is used
6406 # for result publication in the study. Otherwise, if automatic
6407 # publication is switched on, default value is used for result name.
6409 # @return New GEOM.GEOM_Object, containing processed shape.
6411 # @ref tui_remove_webs "Example"
6412 @ManageTransactions("HealOp")
6413 def RemoveInternalFaces (self, theSolids, theName=None):
6415 Rebuild the topology of theSolids by removing
6416 the faces that are shared by several solids.
6419 theSolids A compound or a list of solids to be processed.
6420 theName Object name; when specified, this parameter is used
6421 for result publication in the study. Otherwise, if automatic
6422 publication is switched on, default value is used for result name.
6425 New GEOM.GEOM_Object, containing processed shape.
6427 # Example: see GEOM_TestHealing.py
6428 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
6429 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6430 self._autoPublish(anObj, theName, "removeWebs")
6433 ## Remove internal wires and edges from the given object (face).
6434 # @param theObject Shape to be processed.
6435 # @param theWires Indices of wires to be removed, if EMPTY then the method
6436 # removes ALL internal wires of the given object.
6437 # @param theName Object name; when specified, this parameter is used
6438 # for result publication in the study. Otherwise, if automatic
6439 # publication is switched on, default value is used for result name.
6441 # @return New GEOM.GEOM_Object, containing processed shape.
6443 # @ref tui_suppress_internal_wires "Example"
6444 @ManageTransactions("HealOp")
6445 def SuppressInternalWires(self, theObject, theWires, theName=None):
6447 Remove internal wires and edges from the given object (face).
6450 theObject Shape to be processed.
6451 theWires Indices of wires to be removed, if EMPTY then the method
6452 removes ALL internal wires of the given object.
6453 theName Object name; when specified, this parameter is used
6454 for result publication in the study. Otherwise, if automatic
6455 publication is switched on, default value is used for result name.
6458 New GEOM.GEOM_Object, containing processed shape.
6460 # Example: see GEOM_TestHealing.py
6461 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6462 RaiseIfFailed("RemoveIntWires", self.HealOp)
6463 self._autoPublish(anObj, theName, "suppressWires")
6466 ## Remove internal closed contours (holes) from the given object.
6467 # @param theObject Shape to be processed.
6468 # @param theWires Indices of wires to be removed, if EMPTY then the method
6469 # removes ALL internal holes of the given object
6470 # @param theName Object name; when specified, this parameter is used
6471 # for result publication in the study. Otherwise, if automatic
6472 # publication is switched on, default value is used for result name.
6474 # @return New GEOM.GEOM_Object, containing processed shape.
6476 # @ref tui_suppress_holes "Example"
6477 @ManageTransactions("HealOp")
6478 def SuppressHoles(self, theObject, theWires, theName=None):
6480 Remove internal closed contours (holes) from the given object.
6483 theObject Shape to be processed.
6484 theWires Indices of wires to be removed, if EMPTY then the method
6485 removes ALL internal holes of the given object
6486 theName Object name; when specified, this parameter is used
6487 for result publication in the study. Otherwise, if automatic
6488 publication is switched on, default value is used for result name.
6491 New GEOM.GEOM_Object, containing processed shape.
6493 # Example: see GEOM_TestHealing.py
6494 anObj = self.HealOp.FillHoles(theObject, theWires)
6495 RaiseIfFailed("FillHoles", self.HealOp)
6496 self._autoPublish(anObj, theName, "suppressHoles")
6499 ## Close an open wire.
6500 # @param theObject Shape to be processed.
6501 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6502 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6503 # @param isCommonVertex If True : closure by creation of a common vertex,
6504 # If False : closure by creation of an edge between ends.
6505 # @param theName Object name; when specified, this parameter is used
6506 # for result publication in the study. Otherwise, if automatic
6507 # publication is switched on, default value is used for result name.
6509 # @return New GEOM.GEOM_Object, containing processed shape.
6511 # @ref tui_close_contour "Example"
6512 @ManageTransactions("HealOp")
6513 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6518 theObject Shape to be processed.
6519 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6520 if [ ], then theObject itself is a wire.
6521 isCommonVertex If True : closure by creation of a common vertex,
6522 If False : closure by creation of an edge between ends.
6523 theName Object name; when specified, this parameter is used
6524 for result publication in the study. Otherwise, if automatic
6525 publication is switched on, default value is used for result name.
6528 New GEOM.GEOM_Object, containing processed shape.
6530 # Example: see GEOM_TestHealing.py
6531 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6532 RaiseIfFailed("CloseContour", self.HealOp)
6533 self._autoPublish(anObj, theName, "closeContour")
6536 ## Addition of a point to a given edge object.
6537 # @param theObject Shape to be processed.
6538 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6539 # if -1, then theObject itself is the edge.
6540 # @param theValue Value of parameter on edge or length parameter,
6541 # depending on \a isByParameter.
6542 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6543 # if FALSE : \a theValue is treated as a length parameter [0..1]
6544 # @param theName Object name; when specified, this parameter is used
6545 # for result publication in the study. Otherwise, if automatic
6546 # publication is switched on, default value is used for result name.
6548 # @return New GEOM.GEOM_Object, containing processed shape.
6550 # @ref tui_add_point_on_edge "Example"
6551 @ManageTransactions("HealOp")
6552 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6554 Addition of a point to a given edge object.
6557 theObject Shape to be processed.
6558 theEdgeIndex Index of edge to be divided within theObject's shape,
6559 if -1, then theObject itself is the edge.
6560 theValue Value of parameter on edge or length parameter,
6561 depending on isByParameter.
6562 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6563 if FALSE : theValue is treated as a length parameter [0..1]
6564 theName Object name; when specified, this parameter is used
6565 for result publication in the study. Otherwise, if automatic
6566 publication is switched on, default value is used for result name.
6569 New GEOM.GEOM_Object, containing processed shape.
6571 # Example: see GEOM_TestHealing.py
6572 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6573 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6574 RaiseIfFailed("DivideEdge", self.HealOp)
6575 anObj.SetParameters(Parameters)
6576 self._autoPublish(anObj, theName, "divideEdge")
6579 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6580 # @param theWire Wire to minimize the number of C1 continuous edges in.
6581 # @param theVertices A list of vertices to suppress. If the list
6582 # is empty, all vertices in a wire will be assumed.
6583 # @param theName Object name; when specified, this parameter is used
6584 # for result publication in the study. Otherwise, if automatic
6585 # publication is switched on, default value is used for result name.
6587 # @return New GEOM.GEOM_Object with modified wire.
6589 # @ref tui_fuse_collinear_edges "Example"
6590 @ManageTransactions("HealOp")
6591 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6593 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6596 theWire Wire to minimize the number of C1 continuous edges in.
6597 theVertices A list of vertices to suppress. If the list
6598 is empty, all vertices in a wire will be assumed.
6599 theName Object name; when specified, this parameter is used
6600 for result publication in the study. Otherwise, if automatic
6601 publication is switched on, default value is used for result name.
6604 New GEOM.GEOM_Object with modified wire.
6606 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6607 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6608 self._autoPublish(anObj, theName, "fuseEdges")
6611 ## Change orientation of the given object. Updates given shape.
6612 # @param theObject Shape to be processed.
6613 # @return Updated <var>theObject</var>
6615 # @ref swig_todo "Example"
6616 @ManageTransactions("HealOp")
6617 def ChangeOrientationShell(self,theObject):
6619 Change orientation of the given object. Updates given shape.
6622 theObject Shape to be processed.
6627 theObject = self.HealOp.ChangeOrientation(theObject)
6628 RaiseIfFailed("ChangeOrientation", self.HealOp)
6631 ## Change orientation of the given object.
6632 # @param theObject Shape to be processed.
6633 # @param theName Object name; when specified, this parameter is used
6634 # for result publication in the study. Otherwise, if automatic
6635 # publication is switched on, default value is used for result name.
6637 # @return New GEOM.GEOM_Object, containing processed shape.
6639 # @ref swig_todo "Example"
6640 @ManageTransactions("HealOp")
6641 def ChangeOrientationShellCopy(self, theObject, theName=None):
6643 Change orientation of the given object.
6646 theObject Shape to be processed.
6647 theName Object name; when specified, this parameter is used
6648 for result publication in the study. Otherwise, if automatic
6649 publication is switched on, default value is used for result name.
6652 New GEOM.GEOM_Object, containing processed shape.
6654 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6655 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6656 self._autoPublish(anObj, theName, "reversed")
6659 ## Try to limit tolerance of the given object by value \a theTolerance.
6660 # @param theObject Shape to be processed.
6661 # @param theTolerance Required tolerance value.
6662 # @param theName Object name; when specified, this parameter is used
6663 # for result publication in the study. Otherwise, if automatic
6664 # publication is switched on, default value is used for result name.
6666 # @return New GEOM.GEOM_Object, containing processed shape.
6668 # @ref tui_limit_tolerance "Example"
6669 @ManageTransactions("HealOp")
6670 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6672 Try to limit tolerance of the given object by value theTolerance.
6675 theObject Shape to be processed.
6676 theTolerance Required tolerance value.
6677 theName Object name; when specified, this parameter is used
6678 for result publication in the study. Otherwise, if automatic
6679 publication is switched on, default value is used for result name.
6682 New GEOM.GEOM_Object, containing processed shape.
6684 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6685 RaiseIfFailed("LimitTolerance", self.HealOp)
6686 self._autoPublish(anObj, theName, "limitTolerance")
6689 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6690 # that constitute a free boundary of the given shape.
6691 # @param theObject Shape to get free boundary of.
6692 # @param theName Object name; when specified, this parameter is used
6693 # for result publication in the study. Otherwise, if automatic
6694 # publication is switched on, default value is used for result name.
6696 # @return [\a status, \a theClosedWires, \a theOpenWires]
6697 # \n \a status: FALSE, if an error(s) occured during the method execution.
6698 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6699 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6701 # @ref tui_measurement_tools_page "Example"
6702 @ManageTransactions("HealOp")
6703 def GetFreeBoundary(self, theObject, theName=None):
6705 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6706 that constitute a free boundary of the given shape.
6709 theObject Shape to get free boundary of.
6710 theName Object name; when specified, this parameter is used
6711 for result publication in the study. Otherwise, if automatic
6712 publication is switched on, default value is used for result name.
6715 [status, theClosedWires, theOpenWires]
6716 status: FALSE, if an error(s) occured during the method execution.
6717 theClosedWires: Closed wires on the free boundary of the given shape.
6718 theOpenWires: Open wires on the free boundary of the given shape.
6720 # Example: see GEOM_TestHealing.py
6721 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
6722 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6723 self._autoPublish(anObj[1], theName, "closedWire")
6724 self._autoPublish(anObj[2], theName, "openWire")
6727 ## Replace coincident faces in \a theShapes by one face.
6728 # @param theShapes Initial shapes, either a list or compound of shapes.
6729 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6730 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6731 # otherwise all initial shapes.
6732 # @param theName Object name; when specified, this parameter is used
6733 # for result publication in the study. Otherwise, if automatic
6734 # publication is switched on, default value is used for result name.
6736 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6738 # @ref tui_glue_faces "Example"
6739 @ManageTransactions("ShapesOp")
6740 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
6742 Replace coincident faces in theShapes by one face.
6745 theShapes Initial shapes, either a list or compound of shapes.
6746 theTolerance Maximum distance between faces, which can be considered as coincident.
6747 doKeepNonSolids If FALSE, only solids will present in the result,
6748 otherwise all initial shapes.
6749 theName Object name; when specified, this parameter is used
6750 for result publication in the study. Otherwise, if automatic
6751 publication is switched on, default value is used for result name.
6754 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6756 # Example: see GEOM_Spanner.py
6757 theTolerance,Parameters = ParseParameters(theTolerance)
6758 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
6760 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6761 anObj.SetParameters(Parameters)
6762 self._autoPublish(anObj, theName, "glueFaces")
6765 ## Find coincident faces in \a theShapes for possible gluing.
6766 # @param theShapes Initial shapes, either a list or compound of shapes.
6767 # @param theTolerance Maximum distance between faces,
6768 # which can be considered as coincident.
6769 # @param theName Object name; when specified, this parameter is used
6770 # for result publication in the study. Otherwise, if automatic
6771 # publication is switched on, default value is used for result name.
6773 # @return GEOM.ListOfGO
6775 # @ref tui_glue_faces "Example"
6776 @ManageTransactions("ShapesOp")
6777 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
6779 Find coincident faces in theShapes for possible gluing.
6782 theShapes Initial shapes, either a list or compound of shapes.
6783 theTolerance Maximum distance between faces,
6784 which can be considered as coincident.
6785 theName Object name; when specified, this parameter is used
6786 for result publication in the study. Otherwise, if automatic
6787 publication is switched on, default value is used for result name.
6792 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
6793 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6794 self._autoPublish(anObj, theName, "facesToGlue")
6797 ## Replace coincident faces in \a theShapes by one face
6798 # in compliance with given list of faces
6799 # @param theShapes Initial shapes, either a list or compound of shapes.
6800 # @param theTolerance Maximum distance between faces,
6801 # which can be considered as coincident.
6802 # @param theFaces List of faces for gluing.
6803 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6804 # otherwise all initial shapes.
6805 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6806 # will be glued, otherwise only the edges,
6807 # belonging to <VAR>theFaces</VAR>.
6808 # @param theName Object name; when specified, this parameter is used
6809 # for result publication in the study. Otherwise, if automatic
6810 # publication is switched on, default value is used for result name.
6812 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6814 # @ref tui_glue_faces "Example"
6815 @ManageTransactions("ShapesOp")
6816 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
6817 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6819 Replace coincident faces in theShapes by one face
6820 in compliance with given list of faces
6823 theShapes theShapes Initial shapes, either a list or compound of shapes.
6824 theTolerance Maximum distance between faces,
6825 which can be considered as coincident.
6826 theFaces List of faces for gluing.
6827 doKeepNonSolids If FALSE, only solids will present in the result,
6828 otherwise all initial shapes.
6829 doGlueAllEdges If TRUE, all coincident edges of theShape
6830 will be glued, otherwise only the edges,
6831 belonging to theFaces.
6832 theName Object name; when specified, this parameter is used
6833 for result publication in the study. Otherwise, if automatic
6834 publication is switched on, default value is used for result name.
6837 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
6839 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, theFaces,
6840 doKeepNonSolids, doGlueAllEdges)
6842 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6843 self._autoPublish(anObj, theName, "glueFaces")
6846 ## Replace coincident edges in \a theShapes by one edge.
6847 # @param theShapes Initial shapes, either a list or compound of shapes.
6848 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6849 # @param theName Object name; when specified, this parameter is used
6850 # for result publication in the study. Otherwise, if automatic
6851 # publication is switched on, default value is used for result name.
6853 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
6855 # @ref tui_glue_edges "Example"
6856 @ManageTransactions("ShapesOp")
6857 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
6859 Replace coincident edges in theShapes by one edge.
6862 theShapes Initial shapes, either a list or compound of shapes.
6863 theTolerance Maximum distance between edges, which can be considered as coincident.
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 copies of theShapes without coincident edges.
6871 theTolerance,Parameters = ParseParameters(theTolerance)
6872 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
6874 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6875 anObj.SetParameters(Parameters)
6876 self._autoPublish(anObj, theName, "glueEdges")
6879 ## Find coincident edges in \a theShapes for possible gluing.
6880 # @param theShapes Initial shapes, either a list or compound of shapes.
6881 # @param theTolerance Maximum distance between edges,
6882 # which can be considered as coincident.
6883 # @param theName Object name; when specified, this parameter is used
6884 # for result publication in the study. Otherwise, if automatic
6885 # publication is switched on, default value is used for result name.
6887 # @return GEOM.ListOfGO
6889 # @ref tui_glue_edges "Example"
6890 @ManageTransactions("ShapesOp")
6891 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
6893 Find coincident edges in theShapes for possible gluing.
6896 theShapes Initial shapes, either a list or compound of shapes.
6897 theTolerance Maximum distance between edges,
6898 which can be considered as coincident.
6899 theName Object name; when specified, this parameter is used
6900 for result publication in the study. Otherwise, if automatic
6901 publication is switched on, default value is used for result name.
6906 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
6907 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6908 self._autoPublish(anObj, theName, "edgesToGlue")
6911 ## Replace coincident edges in theShapes by one edge
6912 # in compliance with given list of edges.
6913 # @param theShapes Initial shapes, either a list or compound of shapes.
6914 # @param theTolerance Maximum distance between edges,
6915 # which can be considered as coincident.
6916 # @param theEdges List of edges for gluing.
6917 # @param theName Object name; when specified, this parameter is used
6918 # for result publication in the study. Otherwise, if automatic
6919 # publication is switched on, default value is used for result name.
6921 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
6923 # @ref tui_glue_edges "Example"
6924 @ManageTransactions("ShapesOp")
6925 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
6927 Replace coincident edges in theShapes by one edge
6928 in compliance with given list of edges.
6931 theShapes Initial shapes, either a list or compound of shapes.
6932 theTolerance Maximum distance between edges,
6933 which can be considered as coincident.
6934 theEdges List of edges for gluing.
6935 theName Object name; when specified, this parameter is used
6936 for result publication in the study. Otherwise, if automatic
6937 publication is switched on, default value is used for result name.
6940 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
6942 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
6944 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6945 self._autoPublish(anObj, theName, "glueEdges")
6951 ## @addtogroup l3_boolean Boolean Operations
6954 # -----------------------------------------------------------------------------
6955 # Boolean (Common, Cut, Fuse, Section)
6956 # -----------------------------------------------------------------------------
6958 ## Perform one of boolean operations on two given shapes.
6959 # @param theShape1 First argument for boolean operation.
6960 # @param theShape2 Second argument for boolean operation.
6961 # @param theOperation Indicates the operation to be done:\n
6962 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6963 # @param checkSelfInte The flag that tells if the arguments should
6964 # be checked for self-intersection prior to the operation.
6965 # @param theName Object name; when specified, this parameter is used
6966 # for result publication in the study. Otherwise, if automatic
6967 # publication is switched on, default value is used for result name.
6969 # @note This algorithm doesn't find all types of self-intersections.
6970 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6971 # vertex/face and edge/face intersections. Face/face
6972 # intersections detection is switched off as it is a
6973 # time-consuming operation that gives an impact on performance.
6974 # To find all self-intersections please use
6975 # CheckSelfIntersections() method.
6977 # @return New GEOM.GEOM_Object, containing the result shape.
6979 # @ref tui_fuse "Example"
6980 @ManageTransactions("BoolOp")
6981 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6983 Perform one of boolean operations on two given shapes.
6986 theShape1 First argument for boolean operation.
6987 theShape2 Second argument for boolean operation.
6988 theOperation Indicates the operation to be done:
6989 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6990 checkSelfInte The flag that tells if the arguments should
6991 be checked for self-intersection prior to
6993 theName Object name; when specified, this parameter is used
6994 for result publication in the study. Otherwise, if automatic
6995 publication is switched on, default value is used for result name.
6998 This algorithm doesn't find all types of self-intersections.
6999 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7000 vertex/face and edge/face intersections. Face/face
7001 intersections detection is switched off as it is a
7002 time-consuming operation that gives an impact on performance.
7003 To find all self-intersections please use
7004 CheckSelfIntersections() method.
7007 New GEOM.GEOM_Object, containing the result shape.
7009 # Example: see GEOM_TestAll.py
7010 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7011 RaiseIfFailed("MakeBoolean", self.BoolOp)
7012 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7013 self._autoPublish(anObj, theName, def_names[theOperation])
7016 ## Perform Common boolean operation on two given shapes.
7017 # @param theShape1 First argument for boolean operation.
7018 # @param theShape2 Second argument for boolean operation.
7019 # @param checkSelfInte The flag that tells if the arguments should
7020 # be checked for self-intersection prior to the operation.
7021 # @param theName Object name; when specified, this parameter is used
7022 # for result publication in the study. Otherwise, if automatic
7023 # publication is switched on, default value is used for result name.
7025 # @note This algorithm doesn't find all types of self-intersections.
7026 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7027 # vertex/face and edge/face intersections. Face/face
7028 # intersections detection is switched off as it is a
7029 # time-consuming operation that gives an impact on performance.
7030 # To find all self-intersections please use
7031 # CheckSelfIntersections() method.
7033 # @return New GEOM.GEOM_Object, containing the result shape.
7035 # @ref tui_common "Example 1"
7036 # \n @ref swig_MakeCommon "Example 2"
7037 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7039 Perform Common boolean operation on two given shapes.
7042 theShape1 First argument for boolean operation.
7043 theShape2 Second argument for boolean operation.
7044 checkSelfInte The flag that tells if the arguments should
7045 be checked for self-intersection prior to
7047 theName Object name; when specified, this parameter is used
7048 for result publication in the study. Otherwise, if automatic
7049 publication is switched on, default value is used for result name.
7052 This algorithm doesn't find all types of self-intersections.
7053 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7054 vertex/face and edge/face intersections. Face/face
7055 intersections detection is switched off as it is a
7056 time-consuming operation that gives an impact on performance.
7057 To find all self-intersections please use
7058 CheckSelfIntersections() method.
7061 New GEOM.GEOM_Object, containing the result shape.
7063 # Example: see GEOM_TestOthers.py
7064 # note: auto-publishing is done in self.MakeBoolean()
7065 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7067 ## Perform Cut boolean operation on two given shapes.
7068 # @param theShape1 First argument for boolean operation.
7069 # @param theShape2 Second argument for boolean operation.
7070 # @param checkSelfInte The flag that tells if the arguments should
7071 # be checked for self-intersection prior to the operation.
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 # @note This algorithm doesn't find all types of self-intersections.
7077 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7078 # vertex/face and edge/face intersections. Face/face
7079 # intersections detection is switched off as it is a
7080 # time-consuming operation that gives an impact on performance.
7081 # To find all self-intersections please use
7082 # CheckSelfIntersections() method.
7084 # @return New GEOM.GEOM_Object, containing the result shape.
7086 # @ref tui_cut "Example 1"
7087 # \n @ref swig_MakeCommon "Example 2"
7088 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7090 Perform Cut boolean operation on two given shapes.
7093 theShape1 First argument for boolean operation.
7094 theShape2 Second argument for boolean operation.
7095 checkSelfInte The flag that tells if the arguments should
7096 be checked for self-intersection prior to
7098 theName Object name; when specified, this parameter is used
7099 for result publication in the study. Otherwise, if automatic
7100 publication is switched on, default value is used for result name.
7103 This algorithm doesn't find all types of self-intersections.
7104 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7105 vertex/face and edge/face intersections. Face/face
7106 intersections detection is switched off as it is a
7107 time-consuming operation that gives an impact on performance.
7108 To find all self-intersections please use
7109 CheckSelfIntersections() method.
7112 New GEOM.GEOM_Object, containing the result shape.
7115 # Example: see GEOM_TestOthers.py
7116 # note: auto-publishing is done in self.MakeBoolean()
7117 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7119 ## Perform Fuse boolean operation on two given shapes.
7120 # @param theShape1 First argument for boolean operation.
7121 # @param theShape2 Second argument for boolean operation.
7122 # @param checkSelfInte The flag that tells if the arguments should
7123 # be checked for self-intersection prior to the operation.
7124 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7125 # operation should be performed during the operation.
7126 # @param theName Object name; when specified, this parameter is used
7127 # for result publication in the study. Otherwise, if automatic
7128 # publication is switched on, default value is used for result name.
7130 # @note This algorithm doesn't find all types of self-intersections.
7131 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7132 # vertex/face and edge/face intersections. Face/face
7133 # intersections detection is switched off as it is a
7134 # time-consuming operation that gives an impact on performance.
7135 # To find all self-intersections please use
7136 # CheckSelfIntersections() method.
7138 # @return New GEOM.GEOM_Object, containing the result shape.
7140 # @ref tui_fuse "Example 1"
7141 # \n @ref swig_MakeCommon "Example 2"
7142 @ManageTransactions("BoolOp")
7143 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7144 rmExtraEdges=False, theName=None):
7146 Perform Fuse boolean operation on two given shapes.
7149 theShape1 First argument for boolean operation.
7150 theShape2 Second argument for boolean operation.
7151 checkSelfInte The flag that tells if the arguments should
7152 be checked for self-intersection prior to
7154 rmExtraEdges The flag that tells if Remove Extra Edges
7155 operation should be performed during the operation.
7156 theName Object name; when specified, this parameter is used
7157 for result publication in the study. Otherwise, if automatic
7158 publication is switched on, default value is used for result name.
7161 This algorithm doesn't find all types of self-intersections.
7162 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7163 vertex/face and edge/face intersections. Face/face
7164 intersections detection is switched off as it is a
7165 time-consuming operation that gives an impact on performance.
7166 To find all self-intersections please use
7167 CheckSelfIntersections() method.
7170 New GEOM.GEOM_Object, containing the result shape.
7173 # Example: see GEOM_TestOthers.py
7174 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7175 checkSelfInte, rmExtraEdges)
7176 RaiseIfFailed("MakeFuse", self.BoolOp)
7177 self._autoPublish(anObj, theName, "fuse")
7180 ## Perform Section boolean operation on two given shapes.
7181 # @param theShape1 First argument for boolean operation.
7182 # @param theShape2 Second argument for boolean operation.
7183 # @param checkSelfInte The flag that tells if the arguments should
7184 # be checked for self-intersection prior to the operation.
7185 # @param theName Object name; when specified, this parameter is used
7186 # for result publication in the study. Otherwise, if automatic
7187 # publication is switched on, default value is used for result name.
7189 # @note This algorithm doesn't find all types of self-intersections.
7190 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7191 # vertex/face and edge/face intersections. Face/face
7192 # intersections detection is switched off as it is a
7193 # time-consuming operation that gives an impact on performance.
7194 # To find all self-intersections please use
7195 # CheckSelfIntersections() method.
7197 # @return New GEOM.GEOM_Object, containing the result shape.
7199 # @ref tui_section "Example 1"
7200 # \n @ref swig_MakeCommon "Example 2"
7201 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7203 Perform Section boolean operation on two given shapes.
7206 theShape1 First argument for boolean operation.
7207 theShape2 Second argument for boolean operation.
7208 checkSelfInte The flag that tells if the arguments should
7209 be checked for self-intersection prior to
7211 theName Object name; when specified, this parameter is used
7212 for result publication in the study. Otherwise, if automatic
7213 publication is switched on, default value is used for result name.
7216 This algorithm doesn't find all types of self-intersections.
7217 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7218 vertex/face and edge/face intersections. Face/face
7219 intersections detection is switched off as it is a
7220 time-consuming operation that gives an impact on performance.
7221 To find all self-intersections please use
7222 CheckSelfIntersections() method.
7225 New GEOM.GEOM_Object, containing the result shape.
7228 # Example: see GEOM_TestOthers.py
7229 # note: auto-publishing is done in self.MakeBoolean()
7230 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7232 ## Perform Fuse boolean operation on the list of shapes.
7233 # @param theShapesList Shapes to be fused.
7234 # @param checkSelfInte The flag that tells if the arguments should
7235 # be checked for self-intersection prior to the operation.
7236 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7237 # operation should be performed during the operation.
7238 # @param theName Object name; when specified, this parameter is used
7239 # for result publication in the study. Otherwise, if automatic
7240 # publication is switched on, default value is used for result name.
7242 # @note This algorithm doesn't find all types of self-intersections.
7243 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7244 # vertex/face and edge/face intersections. Face/face
7245 # intersections detection is switched off as it is a
7246 # time-consuming operation that gives an impact on performance.
7247 # To find all self-intersections please use
7248 # CheckSelfIntersections() method.
7250 # @return New GEOM.GEOM_Object, containing the result shape.
7252 # @ref tui_fuse "Example 1"
7253 # \n @ref swig_MakeCommon "Example 2"
7254 @ManageTransactions("BoolOp")
7255 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7256 rmExtraEdges=False, theName=None):
7258 Perform Fuse boolean operation on the list of shapes.
7261 theShapesList Shapes to be fused.
7262 checkSelfInte The flag that tells if the arguments should
7263 be checked for self-intersection prior to
7265 rmExtraEdges The flag that tells if Remove Extra Edges
7266 operation should be performed during the operation.
7267 theName Object name; when specified, this parameter is used
7268 for result publication in the study. Otherwise, if automatic
7269 publication is switched on, default value is used for result name.
7272 This algorithm doesn't find all types of self-intersections.
7273 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7274 vertex/face and edge/face intersections. Face/face
7275 intersections detection is switched off as it is a
7276 time-consuming operation that gives an impact on performance.
7277 To find all self-intersections please use
7278 CheckSelfIntersections() method.
7281 New GEOM.GEOM_Object, containing the result shape.
7284 # Example: see GEOM_TestOthers.py
7285 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7287 RaiseIfFailed("MakeFuseList", self.BoolOp)
7288 self._autoPublish(anObj, theName, "fuse")
7291 ## Perform Common boolean operation on the list of shapes.
7292 # @param theShapesList Shapes for Common operation.
7293 # @param checkSelfInte The flag that tells if the arguments should
7294 # be checked for self-intersection prior to the operation.
7295 # @param theName Object name; when specified, this parameter is used
7296 # for result publication in the study. Otherwise, if automatic
7297 # publication is switched on, default value is used for result name.
7299 # @note This algorithm doesn't find all types of self-intersections.
7300 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7301 # vertex/face and edge/face intersections. Face/face
7302 # intersections detection is switched off as it is a
7303 # time-consuming operation that gives an impact on performance.
7304 # To find all self-intersections please use
7305 # CheckSelfIntersections() method.
7307 # @return New GEOM.GEOM_Object, containing the result shape.
7309 # @ref tui_common "Example 1"
7310 # \n @ref swig_MakeCommon "Example 2"
7311 @ManageTransactions("BoolOp")
7312 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7314 Perform Common boolean operation on the list of shapes.
7317 theShapesList Shapes for Common operation.
7318 checkSelfInte The flag that tells if the arguments should
7319 be checked for self-intersection prior to
7321 theName Object name; when specified, this parameter is used
7322 for result publication in the study. Otherwise, if automatic
7323 publication is switched on, default value is used for result name.
7326 This algorithm doesn't find all types of self-intersections.
7327 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7328 vertex/face and edge/face intersections. Face/face
7329 intersections detection is switched off as it is a
7330 time-consuming operation that gives an impact on performance.
7331 To find all self-intersections please use
7332 CheckSelfIntersections() method.
7335 New GEOM.GEOM_Object, containing the result shape.
7338 # Example: see GEOM_TestOthers.py
7339 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7340 RaiseIfFailed("MakeCommonList", self.BoolOp)
7341 self._autoPublish(anObj, theName, "common")
7344 ## Perform Cut boolean operation on one object and the list of tools.
7345 # @param theMainShape The object of the operation.
7346 # @param theShapesList The list of tools of the operation.
7347 # @param checkSelfInte The flag that tells if the arguments should
7348 # be checked for self-intersection prior to the operation.
7349 # @param theName Object name; when specified, this parameter is used
7350 # for result publication in the study. Otherwise, if automatic
7351 # publication is switched on, default value is used for result name.
7353 # @note This algorithm doesn't find all types of self-intersections.
7354 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7355 # vertex/face and edge/face intersections. Face/face
7356 # intersections detection is switched off as it is a
7357 # time-consuming operation that gives an impact on performance.
7358 # To find all self-intersections please use
7359 # CheckSelfIntersections() method.
7361 # @return New GEOM.GEOM_Object, containing the result shape.
7363 # @ref tui_cut "Example 1"
7364 # \n @ref swig_MakeCommon "Example 2"
7365 @ManageTransactions("BoolOp")
7366 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7368 Perform Cut boolean operation on one object and the list of tools.
7371 theMainShape The object of the operation.
7372 theShapesList The list of tools of the operation.
7373 checkSelfInte The flag that tells if the arguments should
7374 be checked for self-intersection prior to
7376 theName Object name; when specified, this parameter is used
7377 for result publication in the study. Otherwise, if automatic
7378 publication is switched on, default value is used for result name.
7381 This algorithm doesn't find all types of self-intersections.
7382 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7383 vertex/face and edge/face intersections. Face/face
7384 intersections detection is switched off as it is a
7385 time-consuming operation that gives an impact on performance.
7386 To find all self-intersections please use
7387 CheckSelfIntersections() method.
7390 New GEOM.GEOM_Object, containing the result shape.
7393 # Example: see GEOM_TestOthers.py
7394 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7395 RaiseIfFailed("MakeCutList", self.BoolOp)
7396 self._autoPublish(anObj, theName, "cut")
7402 ## @addtogroup l3_basic_op
7405 ## Perform partition operation.
7406 # @param ListShapes Shapes to be intersected.
7407 # @param ListTools Shapes to intersect theShapes.
7408 # @param Limit Type of resulting shapes (see ShapeType()).\n
7409 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7410 # type will be detected automatically.
7411 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7412 # target type (equal to Limit) are kept in the result,
7413 # else standalone shapes of lower dimension
7414 # are kept also (if they exist).
7416 # @param theName Object name; when specified, this parameter is used
7417 # for result publication in the study. Otherwise, if automatic
7418 # publication is switched on, default value is used for result name.
7420 # @note Each compound from ListShapes and ListTools will be exploded
7421 # in order to avoid possible intersection between shapes from this compound.
7423 # After implementation new version of PartitionAlgo (October 2006)
7424 # other parameters are ignored by current functionality. They are kept
7425 # in this function only for support old versions.
7426 # @param ListKeepInside Shapes, outside which the results will be deleted.
7427 # Each shape from theKeepInside must belong to theShapes also.
7428 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7429 # Each shape from theRemoveInside must belong to theShapes also.
7430 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7431 # @param ListMaterials Material indices for each shape. Make sence,
7432 # only if theRemoveWebs is TRUE.
7434 # @return New GEOM.GEOM_Object, containing the result shapes.
7436 # @ref tui_partition "Example"
7437 @ManageTransactions("BoolOp")
7438 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7439 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7440 KeepNonlimitShapes=0, theName=None):
7442 Perform partition operation.
7445 ListShapes Shapes to be intersected.
7446 ListTools Shapes to intersect theShapes.
7447 Limit Type of resulting shapes (see geompy.ShapeType)
7448 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7449 type will be detected automatically.
7450 KeepNonlimitShapes if this parameter == 0, then only shapes of
7451 target type (equal to Limit) are kept in the result,
7452 else standalone shapes of lower dimension
7453 are kept also (if they exist).
7455 theName Object name; when specified, this parameter is used
7456 for result publication in the study. Otherwise, if automatic
7457 publication is switched on, default value is used for result name.
7459 Each compound from ListShapes and ListTools will be exploded
7460 in order to avoid possible intersection between shapes from
7463 After implementation new version of PartitionAlgo (October 2006) other
7464 parameters are ignored by current functionality. They are kept in this
7465 function only for support old versions.
7468 ListKeepInside Shapes, outside which the results will be deleted.
7469 Each shape from theKeepInside must belong to theShapes also.
7470 ListRemoveInside Shapes, inside which the results will be deleted.
7471 Each shape from theRemoveInside must belong to theShapes also.
7472 RemoveWebs If TRUE, perform Glue 3D algorithm.
7473 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7476 New GEOM.GEOM_Object, containing the result shapes.
7478 # Example: see GEOM_TestAll.py
7479 if Limit == self.ShapeType["AUTO"]:
7480 # automatic detection of the most appropriate shape limit type
7482 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7483 Limit = EnumToLong(lim)
7485 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7486 ListKeepInside, ListRemoveInside,
7487 Limit, RemoveWebs, ListMaterials,
7488 KeepNonlimitShapes);
7489 RaiseIfFailed("MakePartition", self.BoolOp)
7490 self._autoPublish(anObj, theName, "partition")
7493 ## Perform partition operation.
7494 # This method may be useful if it is needed to make a partition for
7495 # compound contains nonintersected shapes. Performance will be better
7496 # since intersection between shapes from compound is not performed.
7498 # Description of all parameters as in previous method MakePartition().
7499 # One additional parameter is provided:
7500 # @param checkSelfInte The flag that tells if the arguments should
7501 # be checked for self-intersection prior to the operation.
7503 # @note This algorithm doesn't find all types of self-intersections.
7504 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7505 # vertex/face and edge/face intersections. Face/face
7506 # intersections detection is switched off as it is a
7507 # time-consuming operation that gives an impact on performance.
7508 # To find all self-intersections please use
7509 # CheckSelfIntersections() method.
7511 # @note Passed compounds (via ListShapes or via ListTools)
7512 # have to consist of nonintersecting shapes.
7514 # @return New GEOM.GEOM_Object, containing the result shapes.
7516 # @ref swig_todo "Example"
7517 @ManageTransactions("BoolOp")
7518 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7519 ListKeepInside=[], ListRemoveInside=[],
7520 Limit=ShapeType["AUTO"], RemoveWebs=0,
7521 ListMaterials=[], KeepNonlimitShapes=0,
7522 checkSelfInte=False, theName=None):
7524 Perform partition operation.
7525 This method may be useful if it is needed to make a partition for
7526 compound contains nonintersected shapes. Performance will be better
7527 since intersection between shapes from compound is not performed.
7530 Description of all parameters as in method geompy.MakePartition.
7531 One additional parameter is provided:
7532 checkSelfInte The flag that tells if the arguments should
7533 be checked for self-intersection prior to
7537 This algorithm doesn't find all types of self-intersections.
7538 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7539 vertex/face and edge/face intersections. Face/face
7540 intersections detection is switched off as it is a
7541 time-consuming operation that gives an impact on performance.
7542 To find all self-intersections please use
7543 CheckSelfIntersections() method.
7546 Passed compounds (via ListShapes or via ListTools)
7547 have to consist of nonintersecting shapes.
7550 New GEOM.GEOM_Object, containing the result shapes.
7552 if Limit == self.ShapeType["AUTO"]:
7553 # automatic detection of the most appropriate shape limit type
7555 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7556 Limit = EnumToLong(lim)
7558 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7559 ListKeepInside, ListRemoveInside,
7560 Limit, RemoveWebs, ListMaterials,
7561 KeepNonlimitShapes, checkSelfInte);
7562 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7563 self._autoPublish(anObj, theName, "partition")
7566 ## See method MakePartition() for more information.
7568 # @ref tui_partition "Example 1"
7569 # \n @ref swig_Partition "Example 2"
7570 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7571 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7572 KeepNonlimitShapes=0, theName=None):
7574 See method geompy.MakePartition for more information.
7576 # Example: see GEOM_TestOthers.py
7577 # note: auto-publishing is done in self.MakePartition()
7578 anObj = self.MakePartition(ListShapes, ListTools,
7579 ListKeepInside, ListRemoveInside,
7580 Limit, RemoveWebs, ListMaterials,
7581 KeepNonlimitShapes, theName);
7584 ## Perform partition of the Shape with the Plane
7585 # @param theShape Shape to be intersected.
7586 # @param thePlane Tool shape, to intersect theShape.
7587 # @param theName Object name; when specified, this parameter is used
7588 # for result publication in the study. Otherwise, if automatic
7589 # publication is switched on, default value is used for result name.
7591 # @return New GEOM.GEOM_Object, containing the result shape.
7593 # @ref tui_partition "Example"
7594 @ManageTransactions("BoolOp")
7595 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7597 Perform partition of the Shape with the Plane
7600 theShape Shape to be intersected.
7601 thePlane Tool shape, to intersect theShape.
7602 theName Object name; when specified, this parameter is used
7603 for result publication in the study. Otherwise, if automatic
7604 publication is switched on, default value is used for result name.
7607 New GEOM.GEOM_Object, containing the result shape.
7609 # Example: see GEOM_TestAll.py
7610 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7611 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7612 self._autoPublish(anObj, theName, "partition")
7615 # end of l3_basic_op
7618 ## @addtogroup l3_transform
7621 ## Translate the given object along the vector, specified
7622 # by its end points.
7623 # @param theObject The object to be translated.
7624 # @param thePoint1 Start point of translation vector.
7625 # @param thePoint2 End point of translation vector.
7626 # @param theCopy Flag used to translate object itself or create a copy.
7627 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7628 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7629 @ManageTransactions("TrsfOp")
7630 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7632 Translate the given object along the vector, specified by its end points.
7635 theObject The object to be translated.
7636 thePoint1 Start point of translation vector.
7637 thePoint2 End point of translation vector.
7638 theCopy Flag used to translate object itself or create a copy.
7641 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7642 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7645 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7647 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7648 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7651 ## Translate the given object along the vector, specified
7652 # by its end points, creating its copy before the translation.
7653 # @param theObject The object to be translated.
7654 # @param thePoint1 Start point of translation vector.
7655 # @param thePoint2 End point of translation vector.
7656 # @param theName Object name; when specified, this parameter is used
7657 # for result publication in the study. Otherwise, if automatic
7658 # publication is switched on, default value is used for result name.
7660 # @return New GEOM.GEOM_Object, containing the translated object.
7662 # @ref tui_translation "Example 1"
7663 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7664 @ManageTransactions("TrsfOp")
7665 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7667 Translate the given object along the vector, specified
7668 by its end points, creating its copy before the translation.
7671 theObject The object to be translated.
7672 thePoint1 Start point of translation vector.
7673 thePoint2 End point of translation vector.
7674 theName Object name; when specified, this parameter is used
7675 for result publication in the study. Otherwise, if automatic
7676 publication is switched on, default value is used for result name.
7679 New GEOM.GEOM_Object, containing the translated object.
7681 # Example: see GEOM_TestAll.py
7682 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7683 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7684 self._autoPublish(anObj, theName, "translated")
7687 ## Translate the given object along the vector, specified by its components.
7688 # @param theObject The object to be translated.
7689 # @param theDX,theDY,theDZ Components of translation vector.
7690 # @param theCopy Flag used to translate object itself or create a copy.
7691 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7692 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7694 # @ref tui_translation "Example"
7695 @ManageTransactions("TrsfOp")
7696 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7698 Translate the given object along the vector, specified by its components.
7701 theObject The object to be translated.
7702 theDX,theDY,theDZ Components of translation vector.
7703 theCopy Flag used to translate object itself or create a copy.
7706 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7707 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7709 # Example: see GEOM_TestAll.py
7710 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7712 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7714 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7715 anObj.SetParameters(Parameters)
7716 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7719 ## Translate the given object along the vector, specified
7720 # by its components, creating its copy before the translation.
7721 # @param theObject The object to be translated.
7722 # @param theDX,theDY,theDZ Components of translation vector.
7723 # @param theName Object name; when specified, this parameter is used
7724 # for result publication in the study. Otherwise, if automatic
7725 # publication is switched on, default value is used for result name.
7727 # @return New GEOM.GEOM_Object, containing the translated object.
7729 # @ref tui_translation "Example"
7730 @ManageTransactions("TrsfOp")
7731 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7733 Translate the given object along the vector, specified
7734 by its components, creating its copy before the translation.
7737 theObject The object to be translated.
7738 theDX,theDY,theDZ Components of translation vector.
7739 theName Object name; when specified, this parameter is used
7740 for result publication in the study. Otherwise, if automatic
7741 publication is switched on, default value is used for result name.
7744 New GEOM.GEOM_Object, containing the translated object.
7746 # Example: see GEOM_TestAll.py
7747 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7748 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7749 anObj.SetParameters(Parameters)
7750 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7751 self._autoPublish(anObj, theName, "translated")
7754 ## Translate the given object along the given vector.
7755 # @param theObject The object to be translated.
7756 # @param theVector The translation vector.
7757 # @param theCopy Flag used to translate object itself or create a copy.
7758 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7759 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7760 @ManageTransactions("TrsfOp")
7761 def TranslateVector(self, theObject, theVector, theCopy=False):
7763 Translate the given object along the given vector.
7766 theObject The object to be translated.
7767 theVector The translation vector.
7768 theCopy Flag used to translate object itself or create a copy.
7771 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7772 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7775 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7777 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7778 RaiseIfFailed("TranslateVector", self.TrsfOp)
7781 ## Translate the given object along the given vector,
7782 # creating its copy before the translation.
7783 # @param theObject The object to be translated.
7784 # @param theVector The translation vector.
7785 # @param theName Object name; when specified, this parameter is used
7786 # for result publication in the study. Otherwise, if automatic
7787 # publication is switched on, default value is used for result name.
7789 # @return New GEOM.GEOM_Object, containing the translated object.
7791 # @ref tui_translation "Example"
7792 @ManageTransactions("TrsfOp")
7793 def MakeTranslationVector(self, theObject, theVector, theName=None):
7795 Translate the given object along the given vector,
7796 creating its copy before the translation.
7799 theObject The object to be translated.
7800 theVector The translation vector.
7801 theName Object name; when specified, this parameter is used
7802 for result publication in the study. Otherwise, if automatic
7803 publication is switched on, default value is used for result name.
7806 New GEOM.GEOM_Object, containing the translated object.
7808 # Example: see GEOM_TestAll.py
7809 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7810 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7811 self._autoPublish(anObj, theName, "translated")
7814 ## Translate the given object along the given vector on given distance.
7815 # @param theObject The object to be translated.
7816 # @param theVector The translation vector.
7817 # @param theDistance The translation distance.
7818 # @param theCopy Flag used to translate object itself or create a copy.
7819 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7820 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7822 # @ref tui_translation "Example"
7823 @ManageTransactions("TrsfOp")
7824 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7826 Translate the given object along the given vector on given distance.
7829 theObject The object to be translated.
7830 theVector The translation vector.
7831 theDistance The translation distance.
7832 theCopy Flag used to translate object itself or create a copy.
7835 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7836 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7838 # Example: see GEOM_TestAll.py
7839 theDistance,Parameters = ParseParameters(theDistance)
7840 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7841 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7842 anObj.SetParameters(Parameters)
7845 ## Translate the given object along the given vector on given distance,
7846 # creating its copy before the translation.
7847 # @param theObject The object to be translated.
7848 # @param theVector The translation vector.
7849 # @param theDistance The translation distance.
7850 # @param theName Object name; when specified, this parameter is used
7851 # for result publication in the study. Otherwise, if automatic
7852 # publication is switched on, default value is used for result name.
7854 # @return New GEOM.GEOM_Object, containing the translated object.
7856 # @ref tui_translation "Example"
7857 @ManageTransactions("TrsfOp")
7858 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7860 Translate the given object along the given vector on given distance,
7861 creating its copy before the translation.
7864 theObject The object to be translated.
7865 theVector The translation vector.
7866 theDistance The translation distance.
7867 theName Object name; when specified, this parameter is used
7868 for result publication in the study. Otherwise, if automatic
7869 publication is switched on, default value is used for result name.
7872 New GEOM.GEOM_Object, containing the translated object.
7874 # Example: see GEOM_TestAll.py
7875 theDistance,Parameters = ParseParameters(theDistance)
7876 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7877 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7878 anObj.SetParameters(Parameters)
7879 self._autoPublish(anObj, theName, "translated")
7882 ## Rotate the given object around the given axis on the given angle.
7883 # @param theObject The object to be rotated.
7884 # @param theAxis Rotation axis.
7885 # @param theAngle Rotation angle in radians.
7886 # @param theCopy Flag used to rotate object itself or create a copy.
7888 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7889 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7891 # @ref tui_rotation "Example"
7892 @ManageTransactions("TrsfOp")
7893 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7895 Rotate the given object around the given axis on the given angle.
7898 theObject The object to be rotated.
7899 theAxis Rotation axis.
7900 theAngle Rotation angle in radians.
7901 theCopy Flag used to rotate object itself or create a copy.
7904 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7905 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7907 # Example: see GEOM_TestAll.py
7909 if isinstance(theAngle,str):
7911 theAngle, Parameters = ParseParameters(theAngle)
7913 theAngle = theAngle*math.pi/180.0
7915 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7917 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7918 RaiseIfFailed("Rotate", self.TrsfOp)
7919 anObj.SetParameters(Parameters)
7922 ## Rotate the given object around the given axis
7923 # on the given angle, creating its copy before the rotation.
7924 # @param theObject The object to be rotated.
7925 # @param theAxis Rotation axis.
7926 # @param theAngle Rotation angle in radians.
7927 # @param theName Object name; when specified, this parameter is used
7928 # for result publication in the study. Otherwise, if automatic
7929 # publication is switched on, default value is used for result name.
7931 # @return New GEOM.GEOM_Object, containing the rotated object.
7933 # @ref tui_rotation "Example"
7934 @ManageTransactions("TrsfOp")
7935 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7937 Rotate the given object around the given axis
7938 on the given angle, creating its copy before the rotatation.
7941 theObject The object to be rotated.
7942 theAxis Rotation axis.
7943 theAngle Rotation angle in radians.
7944 theName Object name; when specified, this parameter is used
7945 for result publication in the study. Otherwise, if automatic
7946 publication is switched on, default value is used for result name.
7949 New GEOM.GEOM_Object, containing the rotated object.
7951 # Example: see GEOM_TestAll.py
7953 if isinstance(theAngle,str):
7955 theAngle, Parameters = ParseParameters(theAngle)
7957 theAngle = theAngle*math.pi/180.0
7958 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7959 RaiseIfFailed("RotateCopy", self.TrsfOp)
7960 anObj.SetParameters(Parameters)
7961 self._autoPublish(anObj, theName, "rotated")
7964 ## Rotate given object around vector perpendicular to plane
7965 # containing three points.
7966 # @param theObject The object to be rotated.
7967 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7968 # containing the three points.
7969 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7970 # @param theCopy Flag used to rotate object itself or create a copy.
7971 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7972 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7973 @ManageTransactions("TrsfOp")
7974 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7976 Rotate given object around vector perpendicular to plane
7977 containing three points.
7980 theObject The object to be rotated.
7981 theCentPoint central point the axis is the vector perpendicular to the plane
7982 containing the three points.
7983 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7984 theCopy Flag used to rotate object itself or create a copy.
7987 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7988 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7991 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7993 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7994 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7997 ## Rotate given object around vector perpendicular to plane
7998 # containing three points, creating its copy before the rotatation.
7999 # @param theObject The object to be rotated.
8000 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8001 # containing the three points.
8002 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8003 # @param theName Object name; when specified, this parameter is used
8004 # for result publication in the study. Otherwise, if automatic
8005 # publication is switched on, default value is used for result name.
8007 # @return New GEOM.GEOM_Object, containing the rotated object.
8009 # @ref tui_rotation "Example"
8010 @ManageTransactions("TrsfOp")
8011 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8013 Rotate given object around vector perpendicular to plane
8014 containing three points, creating its copy before the rotatation.
8017 theObject The object to be rotated.
8018 theCentPoint central point the axis is the vector perpendicular to the plane
8019 containing the three points.
8020 thePoint1,thePoint2 in a perpendicular plane of the axis.
8021 theName Object name; when specified, this parameter is used
8022 for result publication in the study. Otherwise, if automatic
8023 publication is switched on, default value is used for result name.
8026 New GEOM.GEOM_Object, containing the rotated object.
8028 # Example: see GEOM_TestAll.py
8029 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8030 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8031 self._autoPublish(anObj, theName, "rotated")
8034 ## Scale the given object by the specified factor.
8035 # @param theObject The object to be scaled.
8036 # @param thePoint Center point for scaling.
8037 # Passing None for it means scaling relatively the origin of global CS.
8038 # @param theFactor Scaling factor value.
8039 # @param theCopy Flag used to scale object itself or create a copy.
8040 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8041 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8042 @ManageTransactions("TrsfOp")
8043 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8045 Scale the given object by the specified factor.
8048 theObject The object to be scaled.
8049 thePoint Center point for scaling.
8050 Passing None for it means scaling relatively the origin of global CS.
8051 theFactor Scaling factor value.
8052 theCopy Flag used to scale object itself or create a copy.
8055 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8056 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8058 # Example: see GEOM_TestAll.py
8059 theFactor, Parameters = ParseParameters(theFactor)
8061 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8063 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8064 RaiseIfFailed("Scale", self.TrsfOp)
8065 anObj.SetParameters(Parameters)
8068 ## Scale the given object by the factor, creating its copy before the scaling.
8069 # @param theObject The object to be scaled.
8070 # @param thePoint Center point for scaling.
8071 # Passing None for it means scaling relatively the origin of global CS.
8072 # @param theFactor Scaling factor value.
8073 # @param theName Object name; when specified, this parameter is used
8074 # for result publication in the study. Otherwise, if automatic
8075 # publication is switched on, default value is used for result name.
8077 # @return New GEOM.GEOM_Object, containing the scaled shape.
8079 # @ref tui_scale "Example"
8080 @ManageTransactions("TrsfOp")
8081 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8083 Scale the given object by the factor, creating its copy before the scaling.
8086 theObject The object to be scaled.
8087 thePoint Center point for scaling.
8088 Passing None for it means scaling relatively the origin of global CS.
8089 theFactor Scaling factor value.
8090 theName Object name; when specified, this parameter is used
8091 for result publication in the study. Otherwise, if automatic
8092 publication is switched on, default value is used for result name.
8095 New GEOM.GEOM_Object, containing the scaled shape.
8097 # Example: see GEOM_TestAll.py
8098 theFactor, Parameters = ParseParameters(theFactor)
8099 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8100 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8101 anObj.SetParameters(Parameters)
8102 self._autoPublish(anObj, theName, "scaled")
8105 ## Scale the given object by different factors along coordinate axes.
8106 # @param theObject The object to be scaled.
8107 # @param thePoint Center point for scaling.
8108 # Passing None for it means scaling relatively the origin of global CS.
8109 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8110 # @param theCopy Flag used to scale object itself or create a copy.
8111 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8112 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8113 @ManageTransactions("TrsfOp")
8114 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8116 Scale the given object by different factors along coordinate axes.
8119 theObject The object to be scaled.
8120 thePoint Center point for scaling.
8121 Passing None for it means scaling relatively the origin of global CS.
8122 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8123 theCopy Flag used to scale object itself or create a copy.
8126 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8127 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8129 # Example: see GEOM_TestAll.py
8130 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8132 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8133 theFactorX, theFactorY, theFactorZ)
8135 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8136 theFactorX, theFactorY, theFactorZ)
8137 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8138 anObj.SetParameters(Parameters)
8141 ## Scale the given object by different factors along coordinate axes,
8142 # creating its copy before the scaling.
8143 # @param theObject The object to be scaled.
8144 # @param thePoint Center point for scaling.
8145 # Passing None for it means scaling relatively the origin of global CS.
8146 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8147 # @param theName Object name; when specified, this parameter is used
8148 # for result publication in the study. Otherwise, if automatic
8149 # publication is switched on, default value is used for result name.
8151 # @return New GEOM.GEOM_Object, containing the scaled shape.
8153 # @ref swig_scale "Example"
8154 @ManageTransactions("TrsfOp")
8155 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8157 Scale the given object by different factors along coordinate axes,
8158 creating its copy before the scaling.
8161 theObject The object to be scaled.
8162 thePoint Center point for scaling.
8163 Passing None for it means scaling relatively the origin of global CS.
8164 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8165 theName Object name; when specified, this parameter is used
8166 for result publication in the study. Otherwise, if automatic
8167 publication is switched on, default value is used for result name.
8170 New GEOM.GEOM_Object, containing the scaled shape.
8172 # Example: see GEOM_TestAll.py
8173 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8174 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8175 theFactorX, theFactorY, theFactorZ)
8176 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8177 anObj.SetParameters(Parameters)
8178 self._autoPublish(anObj, theName, "scaled")
8181 ## Mirror an object relatively the given plane.
8182 # @param theObject The object to be mirrored.
8183 # @param thePlane Plane of symmetry.
8184 # @param theCopy Flag used to mirror object itself or create a copy.
8185 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8186 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8187 @ManageTransactions("TrsfOp")
8188 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8190 Mirror an object relatively the given plane.
8193 theObject The object to be mirrored.
8194 thePlane Plane of symmetry.
8195 theCopy Flag used to mirror object itself or create a copy.
8198 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8199 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8202 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8204 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8205 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8208 ## Create an object, symmetrical
8209 # to the given one relatively the given plane.
8210 # @param theObject The object to be mirrored.
8211 # @param thePlane Plane of symmetry.
8212 # @param theName Object name; when specified, this parameter is used
8213 # for result publication in the study. Otherwise, if automatic
8214 # publication is switched on, default value is used for result name.
8216 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8218 # @ref tui_mirror "Example"
8219 @ManageTransactions("TrsfOp")
8220 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8222 Create an object, symmetrical to the given one relatively the given plane.
8225 theObject The object to be mirrored.
8226 thePlane Plane of symmetry.
8227 theName Object name; when specified, this parameter is used
8228 for result publication in the study. Otherwise, if automatic
8229 publication is switched on, default value is used for result name.
8232 New GEOM.GEOM_Object, containing the mirrored shape.
8234 # Example: see GEOM_TestAll.py
8235 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8236 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8237 self._autoPublish(anObj, theName, "mirrored")
8240 ## Mirror an object relatively the given axis.
8241 # @param theObject The object to be mirrored.
8242 # @param theAxis Axis of symmetry.
8243 # @param theCopy Flag used to mirror object itself or create a copy.
8244 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8245 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8246 @ManageTransactions("TrsfOp")
8247 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8249 Mirror an object relatively the given axis.
8252 theObject The object to be mirrored.
8253 theAxis Axis of symmetry.
8254 theCopy Flag used to mirror object itself or create a copy.
8257 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8258 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8261 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8263 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8264 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8267 ## Create an object, symmetrical
8268 # to the given one relatively the given axis.
8269 # @param theObject The object to be mirrored.
8270 # @param theAxis Axis of symmetry.
8271 # @param theName Object name; when specified, this parameter is used
8272 # for result publication in the study. Otherwise, if automatic
8273 # publication is switched on, default value is used for result name.
8275 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8277 # @ref tui_mirror "Example"
8278 @ManageTransactions("TrsfOp")
8279 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8281 Create an object, symmetrical to the given one relatively the given axis.
8284 theObject The object to be mirrored.
8285 theAxis Axis of symmetry.
8286 theName Object name; when specified, this parameter is used
8287 for result publication in the study. Otherwise, if automatic
8288 publication is switched on, default value is used for result name.
8291 New GEOM.GEOM_Object, containing the mirrored shape.
8293 # Example: see GEOM_TestAll.py
8294 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8295 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8296 self._autoPublish(anObj, theName, "mirrored")
8299 ## Mirror an object relatively the given point.
8300 # @param theObject The object to be mirrored.
8301 # @param thePoint Point of symmetry.
8302 # @param theCopy Flag used to mirror object itself or create a copy.
8303 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8304 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8305 @ManageTransactions("TrsfOp")
8306 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8308 Mirror an object relatively the given point.
8311 theObject The object to be mirrored.
8312 thePoint Point of symmetry.
8313 theCopy Flag used to mirror object itself or create a copy.
8316 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8317 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8319 # Example: see GEOM_TestAll.py
8321 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8323 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8324 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8327 ## Create an object, symmetrical
8328 # to the given one relatively the given point.
8329 # @param theObject The object to be mirrored.
8330 # @param thePoint Point of symmetry.
8331 # @param theName Object name; when specified, this parameter is used
8332 # for result publication in the study. Otherwise, if automatic
8333 # publication is switched on, default value is used for result name.
8335 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8337 # @ref tui_mirror "Example"
8338 @ManageTransactions("TrsfOp")
8339 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8341 Create an object, symmetrical
8342 to the given one relatively the given point.
8345 theObject The object to be mirrored.
8346 thePoint Point of symmetry.
8347 theName Object name; when specified, this parameter is used
8348 for result publication in the study. Otherwise, if automatic
8349 publication is switched on, default value is used for result name.
8352 New GEOM.GEOM_Object, containing the mirrored shape.
8354 # Example: see GEOM_TestAll.py
8355 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8356 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8357 self._autoPublish(anObj, theName, "mirrored")
8360 ## Modify the location of the given object.
8361 # @param theObject The object to be displaced.
8362 # @param theStartLCS Coordinate system to perform displacement from it.\n
8363 # If \a theStartLCS is NULL, displacement
8364 # will be performed from global CS.\n
8365 # If \a theObject itself is used as \a theStartLCS,
8366 # its location will be changed to \a theEndLCS.
8367 # @param theEndLCS Coordinate system to perform displacement to it.
8368 # @param theCopy Flag used to displace object itself or create a copy.
8369 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8370 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8371 @ManageTransactions("TrsfOp")
8372 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8374 Modify the Location of the given object by LCS, creating its copy before the setting.
8377 theObject The object to be displaced.
8378 theStartLCS Coordinate system to perform displacement from it.
8379 If theStartLCS is NULL, displacement
8380 will be performed from global CS.
8381 If theObject itself is used as theStartLCS,
8382 its location will be changed to theEndLCS.
8383 theEndLCS Coordinate system to perform displacement to it.
8384 theCopy Flag used to displace object itself or create a copy.
8387 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8388 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8390 # Example: see GEOM_TestAll.py
8392 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8394 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8395 RaiseIfFailed("Displace", self.TrsfOp)
8398 ## Modify the Location of the given object by LCS,
8399 # creating its copy before the setting.
8400 # @param theObject The object to be displaced.
8401 # @param theStartLCS Coordinate system to perform displacement from it.\n
8402 # If \a theStartLCS is NULL, displacement
8403 # will be performed from global CS.\n
8404 # If \a theObject itself is used as \a theStartLCS,
8405 # its location will be changed to \a theEndLCS.
8406 # @param theEndLCS Coordinate system to perform displacement to it.
8407 # @param theName Object name; when specified, this parameter is used
8408 # for result publication in the study. Otherwise, if automatic
8409 # publication is switched on, default value is used for result name.
8411 # @return New GEOM.GEOM_Object, containing the displaced shape.
8413 # @ref tui_modify_location "Example"
8414 @ManageTransactions("TrsfOp")
8415 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8417 Modify the Location of the given object by LCS, creating its copy before the setting.
8420 theObject The object to be displaced.
8421 theStartLCS Coordinate system to perform displacement from it.
8422 If theStartLCS is NULL, displacement
8423 will be performed from global CS.
8424 If theObject itself is used as theStartLCS,
8425 its location will be changed to theEndLCS.
8426 theEndLCS Coordinate system to perform displacement to it.
8427 theName Object name; when specified, this parameter is used
8428 for result publication in the study. Otherwise, if automatic
8429 publication is switched on, default value is used for result name.
8432 New GEOM.GEOM_Object, containing the displaced shape.
8435 # create local coordinate systems
8436 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8437 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8438 # modify the location of the given object
8439 position = geompy.MakePosition(cylinder, cs1, cs2)
8441 # Example: see GEOM_TestAll.py
8442 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8443 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8444 self._autoPublish(anObj, theName, "displaced")
8447 ## Modify the Location of the given object by Path.
8448 # @param theObject The object to be displaced.
8449 # @param thePath Wire or Edge along that the object will be translated.
8450 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8451 # @param theCopy is to create a copy objects if true.
8452 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8453 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8454 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8456 # @ref tui_modify_location "Example"
8457 @ManageTransactions("TrsfOp")
8458 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8460 Modify the Location of the given object by Path.
8463 theObject The object to be displaced.
8464 thePath Wire or Edge along that the object will be translated.
8465 theDistance progress of Path (0 = start location, 1 = end of path location).
8466 theCopy is to create a copy objects if true.
8467 theReverse 0 - for usual direction, 1 - to reverse path direction.
8470 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8471 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8474 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8476 # Example: see GEOM_TestAll.py
8477 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8478 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8481 ## Modify the Location of the given object by Path, creating its copy before the operation.
8482 # @param theObject The object to be displaced.
8483 # @param thePath Wire or Edge along that the object will be translated.
8484 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8485 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8486 # @param theName Object name; when specified, this parameter is used
8487 # for result publication in the study. Otherwise, if automatic
8488 # publication is switched on, default value is used for result name.
8490 # @return New GEOM.GEOM_Object, containing the displaced shape.
8491 @ManageTransactions("TrsfOp")
8492 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8494 Modify the Location of the given object by Path, creating its copy before the operation.
8497 theObject The object to be displaced.
8498 thePath Wire or Edge along that the object will be translated.
8499 theDistance progress of Path (0 = start location, 1 = end of path location).
8500 theReverse 0 - for usual direction, 1 - to reverse path direction.
8501 theName Object name; when specified, this parameter is used
8502 for result publication in the study. Otherwise, if automatic
8503 publication is switched on, default value is used for result name.
8506 New GEOM.GEOM_Object, containing the displaced shape.
8508 # Example: see GEOM_TestAll.py
8509 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8510 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8511 self._autoPublish(anObj, theName, "displaced")
8514 ## Offset given shape.
8515 # @param theObject The base object for the offset.
8516 # @param theOffset Offset value.
8517 # @param theCopy Flag used to offset object itself or create a copy.
8518 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8519 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8520 @ManageTransactions("TrsfOp")
8521 def Offset(self, theObject, theOffset, theCopy=False):
8526 theObject The base object for the offset.
8527 theOffset Offset value.
8528 theCopy Flag used to offset object itself or create a copy.
8531 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8532 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8534 theOffset, Parameters = ParseParameters(theOffset)
8536 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8538 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8539 RaiseIfFailed("Offset", self.TrsfOp)
8540 anObj.SetParameters(Parameters)
8543 ## Create new object as offset of the given one.
8544 # @param theObject The base object for the offset.
8545 # @param theOffset Offset value.
8546 # @param theName Object name; when specified, this parameter is used
8547 # for result publication in the study. Otherwise, if automatic
8548 # publication is switched on, default value is used for result name.
8550 # @return New GEOM.GEOM_Object, containing the offset object.
8552 # @ref tui_offset "Example"
8553 @ManageTransactions("TrsfOp")
8554 def MakeOffset(self, theObject, theOffset, theName=None):
8556 Create new object as offset of the given one.
8559 theObject The base object for the offset.
8560 theOffset Offset value.
8561 theName Object name; when specified, this parameter is used
8562 for result publication in the study. Otherwise, if automatic
8563 publication is switched on, default value is used for result name.
8566 New GEOM.GEOM_Object, containing the offset object.
8569 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8570 # create a new object as offset of the given object
8571 offset = geompy.MakeOffset(box, 70.)
8573 # Example: see GEOM_TestAll.py
8574 theOffset, Parameters = ParseParameters(theOffset)
8575 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8576 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8577 anObj.SetParameters(Parameters)
8578 self._autoPublish(anObj, theName, "offset")
8581 ## Create new object as projection of the given one on a 2D surface.
8582 # @param theSource The source object for the projection. It can be a point, edge or wire.
8583 # @param theTarget The target object. It can be planar or cylindrical face.
8584 # @param theName Object name; when specified, this parameter is used
8585 # for result publication in the study. Otherwise, if automatic
8586 # publication is switched on, default value is used for result name.
8588 # @return New GEOM.GEOM_Object, containing the projection.
8590 # @ref tui_projection "Example"
8591 @ManageTransactions("TrsfOp")
8592 def MakeProjection(self, theSource, theTarget, theName=None):
8594 Create new object as projection of the given one on a 2D surface.
8597 theSource The source object for the projection. It can be a point, edge or wire.
8598 theTarget The target object. It can be planar or cylindrical face.
8599 theName Object name; when specified, this parameter is used
8600 for result publication in the study. Otherwise, if automatic
8601 publication is switched on, default value is used for result name.
8604 New GEOM.GEOM_Object, containing the projection.
8606 # Example: see GEOM_TestAll.py
8607 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8608 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8609 self._autoPublish(anObj, theName, "projection")
8612 ## Create a projection projection of the given point on a wire or an edge.
8613 # If there are no solutions or there are 2 or more solutions It throws an
8615 # @param thePoint the point to be projected.
8616 # @param theWire the wire. The edge is accepted as well.
8617 # @param theName Object name; when specified, this parameter is used
8618 # for result publication in the study. Otherwise, if automatic
8619 # publication is switched on, default value is used for result name.
8621 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8622 # \n \a u: The parameter of projection point on edge.
8623 # \n \a PointOnEdge: The projection point.
8624 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8626 # @ref tui_projection "Example"
8627 @ManageTransactions("TrsfOp")
8628 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8630 Create a projection projection of the given point on a wire or an edge.
8631 If there are no solutions or there are 2 or more solutions It throws an
8635 thePoint the point to be projected.
8636 theWire the wire. The edge is accepted as well.
8637 theName Object name; when specified, this parameter is used
8638 for result publication in the study. Otherwise, if automatic
8639 publication is switched on, default value is used for result name.
8642 [u, PointOnEdge, EdgeInWireIndex]
8643 u: The parameter of projection point on edge.
8644 PointOnEdge: The projection point.
8645 EdgeInWireIndex: The index of an edge in a wire.
8647 # Example: see GEOM_TestAll.py
8648 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8649 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8650 self._autoPublish(anObj[1], theName, "projection")
8653 # -----------------------------------------------------------------------------
8655 # -----------------------------------------------------------------------------
8657 ## Translate the given object along the given vector a given number times
8658 # @param theObject The object to be translated.
8659 # @param theVector Direction of the translation. DX if None.
8660 # @param theStep Distance to translate on.
8661 # @param theNbTimes Quantity of translations to be done.
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 compound of all
8667 # the shapes, obtained after each translation.
8669 # @ref tui_multi_translation "Example"
8670 @ManageTransactions("TrsfOp")
8671 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8673 Translate the given object along the given vector a given number times
8676 theObject The object to be translated.
8677 theVector Direction of the translation. DX if None.
8678 theStep Distance to translate on.
8679 theNbTimes Quantity of translations to be done.
8680 theName Object name; when specified, this parameter is used
8681 for result publication in the study. Otherwise, if automatic
8682 publication is switched on, default value is used for result name.
8685 New GEOM.GEOM_Object, containing compound of all
8686 the shapes, obtained after each translation.
8689 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8691 # Example: see GEOM_TestAll.py
8692 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8693 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8694 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8695 anObj.SetParameters(Parameters)
8696 self._autoPublish(anObj, theName, "multitranslation")
8699 ## Conseqently apply two specified translations to theObject specified number of times.
8700 # @param theObject The object to be translated.
8701 # @param theVector1 Direction of the first translation. DX if None.
8702 # @param theStep1 Step of the first translation.
8703 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8704 # @param theVector2 Direction of the second translation. DY if None.
8705 # @param theStep2 Step of the second translation.
8706 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8707 # @param theName Object name; when specified, this parameter is used
8708 # for result publication in the study. Otherwise, if automatic
8709 # publication is switched on, default value is used for result name.
8711 # @return New GEOM.GEOM_Object, containing compound of all
8712 # the shapes, obtained after each translation.
8714 # @ref tui_multi_translation "Example"
8715 @ManageTransactions("TrsfOp")
8716 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8717 theVector2, theStep2, theNbTimes2, theName=None):
8719 Conseqently apply two specified translations to theObject specified number of times.
8722 theObject The object to be translated.
8723 theVector1 Direction of the first translation. DX if None.
8724 theStep1 Step of the first translation.
8725 theNbTimes1 Quantity of translations to be done along theVector1.
8726 theVector2 Direction of the second translation. DY if None.
8727 theStep2 Step of the second translation.
8728 theNbTimes2 Quantity of translations to be done along theVector2.
8729 theName Object name; when specified, this parameter is used
8730 for result publication in the study. Otherwise, if automatic
8731 publication is switched on, default value is used for result name.
8734 New GEOM.GEOM_Object, containing compound of all
8735 the shapes, obtained after each translation.
8738 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8740 # Example: see GEOM_TestAll.py
8741 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8742 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8743 theVector2, theStep2, theNbTimes2)
8744 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8745 anObj.SetParameters(Parameters)
8746 self._autoPublish(anObj, theName, "multitranslation")
8749 ## Rotate the given object around the given axis a given number times.
8750 # Rotation angle will be 2*PI/theNbTimes.
8751 # @param theObject The object to be rotated.
8752 # @param theAxis The rotation axis. DZ if None.
8753 # @param theNbTimes Quantity of rotations to be done.
8754 # @param theName Object name; when specified, this parameter is used
8755 # for result publication in the study. Otherwise, if automatic
8756 # publication is switched on, default value is used for result name.
8758 # @return New GEOM.GEOM_Object, containing compound of all the
8759 # shapes, obtained after each rotation.
8761 # @ref tui_multi_rotation "Example"
8762 @ManageTransactions("TrsfOp")
8763 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8765 Rotate the given object around the given axis a given number times.
8766 Rotation angle will be 2*PI/theNbTimes.
8769 theObject The object to be rotated.
8770 theAxis The rotation axis. DZ if None.
8771 theNbTimes Quantity of rotations to be done.
8772 theName Object name; when specified, this parameter is used
8773 for result publication in the study. Otherwise, if automatic
8774 publication is switched on, default value is used for result name.
8777 New GEOM.GEOM_Object, containing compound of all the
8778 shapes, obtained after each rotation.
8781 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8783 # Example: see GEOM_TestAll.py
8784 theNbTimes, Parameters = ParseParameters(theNbTimes)
8785 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8786 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8787 anObj.SetParameters(Parameters)
8788 self._autoPublish(anObj, theName, "multirotation")
8791 ## Rotate the given object around the given axis
8792 # a given number times on the given angle.
8793 # @param theObject The object to be rotated.
8794 # @param theAxis The rotation axis. DZ if None.
8795 # @param theAngleStep Rotation angle in radians.
8796 # @param theNbTimes Quantity of rotations to be done.
8797 # @param theName Object name; when specified, this parameter is used
8798 # for result publication in the study. Otherwise, if automatic
8799 # publication is switched on, default value is used for result name.
8801 # @return New GEOM.GEOM_Object, containing compound of all the
8802 # shapes, obtained after each rotation.
8804 # @ref tui_multi_rotation "Example"
8805 @ManageTransactions("TrsfOp")
8806 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8808 Rotate the given object around the given axis
8809 a given number times on the given angle.
8812 theObject The object to be rotated.
8813 theAxis The rotation axis. DZ if None.
8814 theAngleStep Rotation angle in radians.
8815 theNbTimes Quantity of rotations to be done.
8816 theName Object name; when specified, this parameter is used
8817 for result publication in the study. Otherwise, if automatic
8818 publication is switched on, default value is used for result name.
8821 New GEOM.GEOM_Object, containing compound of all the
8822 shapes, obtained after each rotation.
8825 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8827 # Example: see GEOM_TestAll.py
8828 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8829 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8830 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8831 anObj.SetParameters(Parameters)
8832 self._autoPublish(anObj, theName, "multirotation")
8835 ## Rotate the given object around the given axis a given
8836 # number times and multi-translate each rotation result.
8837 # Rotation angle will be 2*PI/theNbTimes1.
8838 # Translation direction passes through center of gravity
8839 # of rotated shape and its projection on the rotation axis.
8840 # @param theObject The object to be rotated.
8841 # @param theAxis Rotation axis. DZ if None.
8842 # @param theNbTimes1 Quantity of rotations to be done.
8843 # @param theRadialStep Translation distance.
8844 # @param theNbTimes2 Quantity of translations to be done.
8845 # @param theName Object name; when specified, this parameter is used
8846 # for result publication in the study. Otherwise, if automatic
8847 # publication is switched on, default value is used for result name.
8849 # @return New GEOM.GEOM_Object, containing compound of all the
8850 # shapes, obtained after each transformation.
8852 # @ref tui_multi_rotation "Example"
8853 @ManageTransactions("TrsfOp")
8854 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8856 Rotate the given object around the
8857 given axis on the given angle a given number
8858 times and multi-translate each rotation result.
8859 Translation direction passes through center of gravity
8860 of rotated shape and its projection on the rotation axis.
8863 theObject The object to be rotated.
8864 theAxis Rotation axis. DZ if None.
8865 theNbTimes1 Quantity of rotations to be done.
8866 theRadialStep Translation distance.
8867 theNbTimes2 Quantity of translations to be done.
8868 theName Object name; when specified, this parameter is used
8869 for result publication in the study. Otherwise, if automatic
8870 publication is switched on, default value is used for result name.
8873 New GEOM.GEOM_Object, containing compound of all the
8874 shapes, obtained after each transformation.
8877 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8879 # Example: see GEOM_TestAll.py
8880 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8881 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8882 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8883 anObj.SetParameters(Parameters)
8884 self._autoPublish(anObj, theName, "multirotation")
8887 ## Rotate the given object around the
8888 # given axis on the given angle a given number
8889 # times and multi-translate each rotation result.
8890 # Translation direction passes through center of gravity
8891 # of rotated shape and its projection on the rotation axis.
8892 # @param theObject The object to be rotated.
8893 # @param theAxis Rotation axis. DZ if None.
8894 # @param theAngleStep Rotation angle in radians.
8895 # @param theNbTimes1 Quantity of rotations to be done.
8896 # @param theRadialStep Translation distance.
8897 # @param theNbTimes2 Quantity of translations to be done.
8898 # @param theName Object name; when specified, this parameter is used
8899 # for result publication in the study. Otherwise, if automatic
8900 # publication is switched on, default value is used for result name.
8902 # @return New GEOM.GEOM_Object, containing compound of all the
8903 # shapes, obtained after each transformation.
8905 # @ref tui_multi_rotation "Example"
8906 @ManageTransactions("TrsfOp")
8907 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8909 Rotate the given object around the
8910 given axis on the given angle a given number
8911 times and multi-translate each rotation result.
8912 Translation direction passes through center of gravity
8913 of rotated shape and its projection on the rotation axis.
8916 theObject The object to be rotated.
8917 theAxis Rotation axis. DZ if None.
8918 theAngleStep Rotation angle in radians.
8919 theNbTimes1 Quantity of rotations to be done.
8920 theRadialStep Translation distance.
8921 theNbTimes2 Quantity of translations to be done.
8922 theName Object name; when specified, this parameter is used
8923 for result publication in the study. Otherwise, if automatic
8924 publication is switched on, default value is used for result name.
8927 New GEOM.GEOM_Object, containing compound of all the
8928 shapes, obtained after each transformation.
8931 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8933 # Example: see GEOM_TestAll.py
8934 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8935 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8936 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8937 anObj.SetParameters(Parameters)
8938 self._autoPublish(anObj, theName, "multirotation")
8941 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8943 # @ref swig_MakeMultiRotation "Example"
8944 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8946 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8949 pz = geompy.MakeVertex(0, 0, 100)
8950 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8951 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8953 # Example: see GEOM_TestOthers.py
8954 aVec = self.MakeLine(aPoint,aDir)
8955 # note: auto-publishing is done in self.MultiRotate1D()
8956 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8959 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8961 # @ref swig_MakeMultiRotation "Example"
8962 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8964 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8967 pz = geompy.MakeVertex(0, 0, 100)
8968 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8969 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8971 # Example: see GEOM_TestOthers.py
8972 aVec = self.MakeLine(aPoint,aDir)
8973 # note: auto-publishing is done in self.MultiRotate1D()
8974 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8977 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8979 # @ref swig_MakeMultiRotation "Example"
8980 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8982 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8985 pz = geompy.MakeVertex(0, 0, 100)
8986 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8987 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8989 # Example: see GEOM_TestOthers.py
8990 aVec = self.MakeLine(aPoint,aDir)
8991 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8992 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8995 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8997 # @ref swig_MakeMultiRotation "Example"
8998 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9000 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9003 pz = geompy.MakeVertex(0, 0, 100)
9004 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9005 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9007 # Example: see GEOM_TestOthers.py
9008 aVec = self.MakeLine(aPoint,aDir)
9009 # note: auto-publishing is done in self.MultiRotate2D()
9010 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9013 # end of l3_transform
9016 ## @addtogroup l3_transform_d
9019 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9020 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9022 Deprecated method. Use MultiRotate1DNbTimes instead.
9024 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9025 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9027 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9028 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9029 @ManageTransactions("TrsfOp")
9030 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9032 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9033 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9036 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9038 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9039 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9040 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9041 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9042 anObj.SetParameters(Parameters)
9043 self._autoPublish(anObj, theName, "multirotation")
9046 ## The same, as MultiRotate1D(), but axis is given by direction and point
9047 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9048 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9050 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9051 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9054 pz = geompy.MakeVertex(0, 0, 100)
9055 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9056 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9058 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9059 aVec = self.MakeLine(aPoint,aDir)
9060 # note: auto-publishing is done in self.MultiRotate1D()
9061 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9064 ## The same, as MultiRotate2D(), but axis is given by direction and point
9065 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9066 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9068 The same, as MultiRotate2D(), but axis is given by direction and point
9069 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9072 pz = geompy.MakeVertex(0, 0, 100)
9073 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9074 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9076 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9077 aVec = self.MakeLine(aPoint,aDir)
9078 # note: auto-publishing is done in self.MultiRotate2D()
9079 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9082 # end of l3_transform_d
9085 ## @addtogroup l3_local
9088 ## Perform a fillet on all edges of the given shape.
9089 # @param theShape Shape, to perform fillet on.
9090 # @param theR Fillet radius.
9091 # @param theName Object name; when specified, this parameter is used
9092 # for result publication in the study. Otherwise, if automatic
9093 # publication is switched on, default value is used for result name.
9095 # @return New GEOM.GEOM_Object, containing the result shape.
9097 # @ref tui_fillet "Example 1"
9098 # \n @ref swig_MakeFilletAll "Example 2"
9099 @ManageTransactions("LocalOp")
9100 def MakeFilletAll(self, theShape, theR, theName=None):
9102 Perform a fillet on all edges of the given shape.
9105 theShape Shape, to perform fillet on.
9107 theName Object name; when specified, this parameter is used
9108 for result publication in the study. Otherwise, if automatic
9109 publication is switched on, default value is used for result name.
9112 New GEOM.GEOM_Object, containing the result shape.
9115 filletall = geompy.MakeFilletAll(prism, 10.)
9117 # Example: see GEOM_TestOthers.py
9118 theR,Parameters = ParseParameters(theR)
9119 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9120 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9121 anObj.SetParameters(Parameters)
9122 self._autoPublish(anObj, theName, "fillet")
9125 ## Perform a fillet on the specified edges/faces of the given shape
9126 # @param theShape Shape, to perform fillet on.
9127 # @param theR Fillet radius.
9128 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9129 # @param theListShapes Global indices of edges/faces to perform fillet on.
9130 # @param theName Object name; when specified, this parameter is used
9131 # for result publication in the study. Otherwise, if automatic
9132 # publication is switched on, default value is used for result name.
9134 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9136 # @return New GEOM.GEOM_Object, containing the result shape.
9138 # @ref tui_fillet "Example"
9139 @ManageTransactions("LocalOp")
9140 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9142 Perform a fillet on the specified edges/faces of the given shape
9145 theShape Shape, to perform fillet on.
9147 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9148 theListShapes Global indices of edges/faces to perform fillet on.
9149 theName Object name; when specified, this parameter is used
9150 for result publication in the study. Otherwise, if automatic
9151 publication is switched on, default value is used for result name.
9154 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9157 New GEOM.GEOM_Object, containing the result shape.
9160 # get the list of IDs (IDList) for the fillet
9161 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9163 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9164 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9165 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9166 # make a fillet on the specified edges of the given shape
9167 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9169 # Example: see GEOM_TestAll.py
9170 theR,Parameters = ParseParameters(theR)
9172 if theShapeType == self.ShapeType["EDGE"]:
9173 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9174 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9176 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9177 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9178 anObj.SetParameters(Parameters)
9179 self._autoPublish(anObj, theName, "fillet")
9182 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9183 @ManageTransactions("LocalOp")
9184 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9186 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9189 # get the list of IDs (IDList) for the fillet
9190 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9192 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9193 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9194 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9195 # make a fillet on the specified edges of the given shape
9196 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9198 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9200 if theShapeType == self.ShapeType["EDGE"]:
9201 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9202 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9204 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9205 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9206 anObj.SetParameters(Parameters)
9207 self._autoPublish(anObj, theName, "fillet")
9210 ## Perform a fillet on the specified edges of the given shape
9211 # @param theShape Wire Shape to perform fillet on.
9212 # @param theR Fillet radius.
9213 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9214 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9215 # \note The list of vertices could be empty,
9216 # in this case fillet will done done at all vertices in wire
9217 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9218 # by the length of the edges, nearest to the fillet vertex.
9219 # But sometimes the next edge is C1 continuous with the one, nearest to
9220 # the fillet point, and such two (or more) edges can be united to allow
9221 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9222 # thus ignoring the secant vertex (vertices).
9223 # @param theName Object name; when specified, this parameter is used
9224 # for result publication in the study. Otherwise, if automatic
9225 # publication is switched on, default value is used for result name.
9227 # @return New GEOM.GEOM_Object, containing the result shape.
9229 # @ref tui_fillet2d "Example"
9230 @ManageTransactions("LocalOp")
9231 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9233 Perform a fillet on the specified edges of the given shape
9236 theShape Wire Shape to perform fillet on.
9238 theListOfVertexes Global indices of vertexes to perform fillet on.
9239 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9240 by the length of the edges, nearest to the fillet vertex.
9241 But sometimes the next edge is C1 continuous with the one, nearest to
9242 the fillet point, and such two (or more) edges can be united to allow
9243 bigger radius. Set this flag to TRUE to allow collinear edges union,
9244 thus ignoring the secant vertex (vertices).
9245 theName Object name; when specified, this parameter is used
9246 for result publication in the study. Otherwise, if automatic
9247 publication is switched on, default value is used for result name.
9249 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9251 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9254 New GEOM.GEOM_Object, containing the result shape.
9258 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9259 # make fillet at given wire vertices with giver radius
9260 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9262 # Example: see GEOM_TestAll.py
9263 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9264 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9265 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9266 anObj.SetParameters(Parameters)
9267 self._autoPublish(anObj, theName, "fillet")
9270 ## Perform a fillet at the specified vertices of the given face/shell.
9271 # @param theShape Face or Shell shape to perform fillet on.
9272 # @param theR Fillet radius.
9273 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9274 # @param theName Object name; when specified, this parameter is used
9275 # for result publication in the study. Otherwise, if automatic
9276 # publication is switched on, default value is used for result name.
9278 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9280 # @return New GEOM.GEOM_Object, containing the result shape.
9282 # @ref tui_fillet2d "Example"
9283 @ManageTransactions("LocalOp")
9284 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9286 Perform a fillet at the specified vertices of the given face/shell.
9289 theShape Face or Shell shape to perform fillet on.
9291 theListOfVertexes Global indices of vertexes to perform fillet on.
9292 theName Object name; when specified, this parameter is used
9293 for result publication in the study. Otherwise, if automatic
9294 publication is switched on, default value is used for result name.
9296 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9299 New GEOM.GEOM_Object, containing the result shape.
9302 face = geompy.MakeFaceHW(100, 100, 1)
9303 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9305 # Example: see GEOM_TestAll.py
9306 theR,Parameters = ParseParameters(theR)
9307 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9308 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9309 anObj.SetParameters(Parameters)
9310 self._autoPublish(anObj, theName, "fillet")
9313 ## Perform a symmetric chamfer on all edges of the given shape.
9314 # @param theShape Shape, to perform chamfer on.
9315 # @param theD Chamfer size along each face.
9316 # @param theName Object name; when specified, this parameter is used
9317 # for result publication in the study. Otherwise, if automatic
9318 # publication is switched on, default value is used for result name.
9320 # @return New GEOM.GEOM_Object, containing the result shape.
9322 # @ref tui_chamfer "Example 1"
9323 # \n @ref swig_MakeChamferAll "Example 2"
9324 @ManageTransactions("LocalOp")
9325 def MakeChamferAll(self, theShape, theD, theName=None):
9327 Perform a symmetric chamfer on all edges of the given shape.
9330 theShape Shape, to perform chamfer on.
9331 theD Chamfer size along each face.
9332 theName Object name; when specified, this parameter is used
9333 for result publication in the study. Otherwise, if automatic
9334 publication is switched on, default value is used for result name.
9337 New GEOM.GEOM_Object, containing the result shape.
9340 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9342 # Example: see GEOM_TestOthers.py
9343 theD,Parameters = ParseParameters(theD)
9344 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9345 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9346 anObj.SetParameters(Parameters)
9347 self._autoPublish(anObj, theName, "chamfer")
9350 ## Perform a chamfer on edges, common to the specified faces,
9351 # with distance D1 on the Face1
9352 # @param theShape Shape, to perform chamfer on.
9353 # @param theD1 Chamfer size along \a theFace1.
9354 # @param theD2 Chamfer size along \a theFace2.
9355 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9356 # @param theName Object name; when specified, this parameter is used
9357 # for result publication in the study. Otherwise, if automatic
9358 # publication is switched on, default value is used for result name.
9360 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9362 # @return New GEOM.GEOM_Object, containing the result shape.
9364 # @ref tui_chamfer "Example"
9365 @ManageTransactions("LocalOp")
9366 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9368 Perform a chamfer on edges, common to the specified faces,
9369 with distance D1 on the Face1
9372 theShape Shape, to perform chamfer on.
9373 theD1 Chamfer size along theFace1.
9374 theD2 Chamfer size along theFace2.
9375 theFace1,theFace2 Global indices of two faces of theShape.
9376 theName Object name; when specified, this parameter is used
9377 for result publication in the study. Otherwise, if automatic
9378 publication is switched on, default value is used for result name.
9381 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9384 New GEOM.GEOM_Object, containing the result shape.
9387 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9388 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9389 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9390 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9392 # Example: see GEOM_TestAll.py
9393 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9394 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9395 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9396 anObj.SetParameters(Parameters)
9397 self._autoPublish(anObj, theName, "chamfer")
9400 ## Perform a chamfer on edges
9401 # @param theShape Shape, to perform chamfer on.
9402 # @param theD Chamfer length
9403 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9404 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9405 # @param theName Object name; when specified, this parameter is used
9406 # for result publication in the study. Otherwise, if automatic
9407 # publication is switched on, default value is used for result name.
9409 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9411 # @return New GEOM.GEOM_Object, containing the result shape.
9412 @ManageTransactions("LocalOp")
9413 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9415 Perform a chamfer on edges
9418 theShape Shape, to perform chamfer on.
9419 theD1 Chamfer size along theFace1.
9420 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9421 theFace1,theFace2 Global indices of two faces of theShape.
9422 theName Object name; when specified, this parameter is used
9423 for result publication in the study. Otherwise, if automatic
9424 publication is switched on, default value is used for result name.
9427 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9430 New GEOM.GEOM_Object, containing the result shape.
9433 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9434 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9435 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9437 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9440 if isinstance(theAngle,str):
9442 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9444 theAngle = theAngle*math.pi/180.0
9445 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9446 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9447 anObj.SetParameters(Parameters)
9448 self._autoPublish(anObj, theName, "chamfer")
9451 ## Perform a chamfer on all edges of the specified faces,
9452 # with distance D1 on the first specified face (if several for one edge)
9453 # @param theShape Shape, to perform chamfer on.
9454 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9455 # connected to the edge, are in \a theFaces, \a theD1
9456 # will be get along face, which is nearer to \a theFaces beginning.
9457 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9458 # @param theFaces Sequence of global indices of faces of \a theShape.
9459 # @param theName Object name; when specified, this parameter is used
9460 # for result publication in the study. Otherwise, if automatic
9461 # publication is switched on, default value is used for result name.
9463 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9465 # @return New GEOM.GEOM_Object, containing the result shape.
9467 # @ref tui_chamfer "Example"
9468 @ManageTransactions("LocalOp")
9469 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9471 Perform a chamfer on all edges of the specified faces,
9472 with distance D1 on the first specified face (if several for one edge)
9475 theShape Shape, to perform chamfer on.
9476 theD1 Chamfer size along face from theFaces. If both faces,
9477 connected to the edge, are in theFaces, theD1
9478 will be get along face, which is nearer to theFaces beginning.
9479 theD2 Chamfer size along another of two faces, connected to the edge.
9480 theFaces Sequence of global indices of faces of theShape.
9481 theName Object name; when specified, this parameter is used
9482 for result publication in the study. Otherwise, if automatic
9483 publication is switched on, default value is used for result name.
9485 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9488 New GEOM.GEOM_Object, containing the result shape.
9490 # Example: see GEOM_TestAll.py
9491 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9492 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9493 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9494 anObj.SetParameters(Parameters)
9495 self._autoPublish(anObj, theName, "chamfer")
9498 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9499 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9501 # @ref swig_FilletChamfer "Example"
9502 @ManageTransactions("LocalOp")
9503 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9505 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9506 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9509 if isinstance(theAngle,str):
9511 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9513 theAngle = theAngle*math.pi/180.0
9514 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9515 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9516 anObj.SetParameters(Parameters)
9517 self._autoPublish(anObj, theName, "chamfer")
9520 ## Perform a chamfer on edges,
9521 # with distance D1 on the first specified face (if several for one edge)
9522 # @param theShape Shape, to perform chamfer on.
9523 # @param theD1,theD2 Chamfer size
9524 # @param theEdges Sequence of edges of \a theShape.
9525 # @param theName Object name; when specified, this parameter is used
9526 # for result publication in the study. Otherwise, if automatic
9527 # publication is switched on, default value is used for result name.
9529 # @return New GEOM.GEOM_Object, containing the result shape.
9531 # @ref swig_FilletChamfer "Example"
9532 @ManageTransactions("LocalOp")
9533 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9535 Perform a chamfer on edges,
9536 with distance D1 on the first specified face (if several for one edge)
9539 theShape Shape, to perform chamfer on.
9540 theD1,theD2 Chamfer size
9541 theEdges Sequence of edges of theShape.
9542 theName Object name; when specified, this parameter is used
9543 for result publication in the study. Otherwise, if automatic
9544 publication is switched on, default value is used for result name.
9547 New GEOM.GEOM_Object, containing the result shape.
9549 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9550 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9551 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9552 anObj.SetParameters(Parameters)
9553 self._autoPublish(anObj, theName, "chamfer")
9556 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9557 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9558 @ManageTransactions("LocalOp")
9559 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9561 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9562 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9565 if isinstance(theAngle,str):
9567 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9569 theAngle = theAngle*math.pi/180.0
9570 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9571 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9572 anObj.SetParameters(Parameters)
9573 self._autoPublish(anObj, theName, "chamfer")
9576 ## @sa MakeChamferEdge(), MakeChamferFaces()
9578 # @ref swig_MakeChamfer "Example"
9579 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9581 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9583 # Example: see GEOM_TestOthers.py
9585 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9586 if aShapeType == self.ShapeType["EDGE"]:
9587 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9589 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9592 ## Remove material from a solid by extrusion of the base shape on the given distance.
9593 # @param theInit Shape to remove material from. It must be a solid or
9594 # a compound made of a single solid.
9595 # @param theBase Closed edge or wire defining the base shape to be extruded.
9596 # @param theH Prism dimension along the normal to theBase
9597 # @param theAngle Draft angle in degrees.
9598 # @param theName Object name; when specified, this parameter is used
9599 # for result publication in the study. Otherwise, if automatic
9600 # publication is switched on, default value is used for result name.
9602 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9604 # @ref tui_creation_prism "Example"
9605 @ManageTransactions("PrimOp")
9606 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9608 Add material to a solid by extrusion of the base shape on the given distance.
9611 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9612 theBase Closed edge or wire defining the base shape to be extruded.
9613 theH Prism dimension along the normal to theBase
9614 theAngle Draft angle in degrees.
9615 theName Object name; when specified, this parameter is used
9616 for result publication in the study. Otherwise, if automatic
9617 publication is switched on, default value is used for result name.
9620 New GEOM.GEOM_Object, containing the initial shape with removed material.
9622 # Example: see GEOM_TestAll.py
9623 #theH,Parameters = ParseParameters(theH)
9624 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9625 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9626 #anObj.SetParameters(Parameters)
9627 self._autoPublish(anObj, theName, "extrudedCut")
9630 ## Add material to a solid by extrusion of the base shape on the given distance.
9631 # @param theInit Shape to add material to. It must be a solid or
9632 # a compound made of a single solid.
9633 # @param theBase Closed edge or wire defining the base shape to be extruded.
9634 # @param theH Prism dimension along the normal to theBase
9635 # @param theAngle Draft angle in degrees.
9636 # @param theName Object name; when specified, this parameter is used
9637 # for result publication in the study. Otherwise, if automatic
9638 # publication is switched on, default value is used for result name.
9640 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9642 # @ref tui_creation_prism "Example"
9643 @ManageTransactions("PrimOp")
9644 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9646 Add material to a solid by extrusion of the base shape on the given distance.
9649 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9650 theBase Closed edge or wire defining the base shape to be extruded.
9651 theH Prism dimension along the normal to theBase
9652 theAngle Draft angle in degrees.
9653 theName Object name; when specified, this parameter is used
9654 for result publication in the study. Otherwise, if automatic
9655 publication is switched on, default value is used for result name.
9658 New GEOM.GEOM_Object, containing the initial shape with added material.
9660 # Example: see GEOM_TestAll.py
9661 #theH,Parameters = ParseParameters(theH)
9662 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9663 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9664 #anObj.SetParameters(Parameters)
9665 self._autoPublish(anObj, theName, "extrudedBoss")
9671 ## @addtogroup l3_basic_op
9674 ## Perform an Archimde operation on the given shape with given parameters.
9675 # The object presenting the resulting face is returned.
9676 # @param theShape Shape to be put in water.
9677 # @param theWeight Weight og the shape.
9678 # @param theWaterDensity Density of the water.
9679 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9680 # @param theName Object name; when specified, this parameter is used
9681 # for result publication in the study. Otherwise, if automatic
9682 # publication is switched on, default value is used for result name.
9684 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9685 # by a plane, corresponding to water level.
9687 # @ref tui_archimede "Example"
9688 @ManageTransactions("LocalOp")
9689 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9691 Perform an Archimde operation on the given shape with given parameters.
9692 The object presenting the resulting face is returned.
9695 theShape Shape to be put in water.
9696 theWeight Weight og the shape.
9697 theWaterDensity Density of the water.
9698 theMeshDeflection Deflection of the mesh, using to compute the section.
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.
9704 New GEOM.GEOM_Object, containing a section of theShape
9705 by a plane, corresponding to water level.
9707 # Example: see GEOM_TestAll.py
9708 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9709 theWeight,theWaterDensity,theMeshDeflection)
9710 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9711 RaiseIfFailed("MakeArchimede", self.LocalOp)
9712 anObj.SetParameters(Parameters)
9713 self._autoPublish(anObj, theName, "archimede")
9716 # end of l3_basic_op
9719 ## @addtogroup l2_measure
9722 ## Get point coordinates
9725 # @ref tui_measurement_tools_page "Example"
9726 @ManageTransactions("MeasuOp")
9727 def PointCoordinates(self,Point):
9729 Get point coordinates
9734 # Example: see GEOM_TestMeasures.py
9735 aTuple = self.MeasuOp.PointCoordinates(Point)
9736 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9739 ## Get vector coordinates
9742 # @ref tui_measurement_tools_page "Example"
9743 def VectorCoordinates(self,Vector):
9745 Get vector coordinates
9751 p1=self.GetFirstVertex(Vector)
9752 p2=self.GetLastVertex(Vector)
9754 X1=self.PointCoordinates(p1)
9755 X2=self.PointCoordinates(p2)
9757 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9760 ## Compute cross product
9761 # @return vector w=u^v
9763 # @ref tui_measurement_tools_page "Example"
9764 def CrossProduct(self, Vector1, Vector2):
9766 Compute cross product
9768 Returns: vector w=u^v
9770 u=self.VectorCoordinates(Vector1)
9771 v=self.VectorCoordinates(Vector2)
9772 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])
9776 ## Compute cross product
9777 # @return dot product p=u.v
9779 # @ref tui_measurement_tools_page "Example"
9780 def DotProduct(self, Vector1, Vector2):
9782 Compute cross product
9784 Returns: dot product p=u.v
9786 u=self.VectorCoordinates(Vector1)
9787 v=self.VectorCoordinates(Vector2)
9788 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9793 ## Get summarized length of all wires,
9794 # area of surface and volume of the given shape.
9795 # @param theShape Shape to define properties of.
9796 # @return [theLength, theSurfArea, theVolume]\n
9797 # theLength: Summarized length of all wires of the given shape.\n
9798 # theSurfArea: Area of surface of the given shape.\n
9799 # theVolume: Volume of the given shape.
9801 # @ref tui_measurement_tools_page "Example"
9802 @ManageTransactions("MeasuOp")
9803 def BasicProperties(self,theShape):
9805 Get summarized length of all wires,
9806 area of surface and volume of the given shape.
9809 theShape Shape to define properties of.
9812 [theLength, theSurfArea, theVolume]
9813 theLength: Summarized length of all wires of the given shape.
9814 theSurfArea: Area of surface of the given shape.
9815 theVolume: Volume of the given shape.
9817 # Example: see GEOM_TestMeasures.py
9818 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9819 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9822 ## Get parameters of bounding box of the given shape
9823 # @param theShape Shape to obtain bounding box of.
9824 # @param precise TRUE for precise computation; FALSE for fast one.
9825 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9826 # Xmin,Xmax: Limits of shape along OX axis.
9827 # Ymin,Ymax: Limits of shape along OY axis.
9828 # Zmin,Zmax: Limits of shape along OZ axis.
9830 # @ref tui_measurement_tools_page "Example"
9831 @ManageTransactions("MeasuOp")
9832 def BoundingBox (self, theShape, precise=False):
9834 Get parameters of bounding box of the given shape
9837 theShape Shape to obtain bounding box of.
9838 precise TRUE for precise computation; FALSE for fast one.
9841 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9842 Xmin,Xmax: Limits of shape along OX axis.
9843 Ymin,Ymax: Limits of shape along OY axis.
9844 Zmin,Zmax: Limits of shape along OZ axis.
9846 # Example: see GEOM_TestMeasures.py
9847 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9848 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9851 ## Get bounding box of the given shape
9852 # @param theShape Shape to obtain bounding box of.
9853 # @param precise TRUE for precise computation; FALSE for fast one.
9854 # @param theName Object name; when specified, this parameter is used
9855 # for result publication in the study. Otherwise, if automatic
9856 # publication is switched on, default value is used for result name.
9858 # @return New GEOM.GEOM_Object, containing the created box.
9860 # @ref tui_measurement_tools_page "Example"
9861 @ManageTransactions("MeasuOp")
9862 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9864 Get bounding box of the given shape
9867 theShape Shape to obtain bounding box of.
9868 precise TRUE for precise computation; FALSE for fast one.
9869 theName Object name; when specified, this parameter is used
9870 for result publication in the study. Otherwise, if automatic
9871 publication is switched on, default value is used for result name.
9874 New GEOM.GEOM_Object, containing the created box.
9876 # Example: see GEOM_TestMeasures.py
9877 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9878 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9879 self._autoPublish(anObj, theName, "bndbox")
9882 ## Get inertia matrix and moments of inertia of theShape.
9883 # @param theShape Shape to calculate inertia of.
9884 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9885 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9886 # Ix,Iy,Iz: Moments of inertia of the given shape.
9888 # @ref tui_measurement_tools_page "Example"
9889 @ManageTransactions("MeasuOp")
9890 def Inertia(self,theShape):
9892 Get inertia matrix and moments of inertia of theShape.
9895 theShape Shape to calculate inertia of.
9898 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9899 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9900 Ix,Iy,Iz: Moments of inertia of the given shape.
9902 # Example: see GEOM_TestMeasures.py
9903 aTuple = self.MeasuOp.GetInertia(theShape)
9904 RaiseIfFailed("GetInertia", self.MeasuOp)
9907 ## Get if coords are included in the shape (ST_IN or ST_ON)
9908 # @param theShape Shape
9909 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9910 # @param tolerance to be used (default is 1.0e-7)
9911 # @return list_of_boolean = [res1, res2, ...]
9912 @ManageTransactions("MeasuOp")
9913 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9915 Get if coords are included in the shape (ST_IN or ST_ON)
9919 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9920 tolerance to be used (default is 1.0e-7)
9923 list_of_boolean = [res1, res2, ...]
9925 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9927 ## Get minimal distance between the given shapes.
9928 # @param theShape1,theShape2 Shapes to find minimal distance between.
9929 # @return Value of the minimal distance between the given shapes.
9931 # @ref tui_measurement_tools_page "Example"
9932 @ManageTransactions("MeasuOp")
9933 def MinDistance(self, theShape1, theShape2):
9935 Get minimal distance between the given shapes.
9938 theShape1,theShape2 Shapes to find minimal distance between.
9941 Value of the minimal distance between the given shapes.
9943 # Example: see GEOM_TestMeasures.py
9944 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9945 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9948 ## Get minimal distance between the given shapes.
9949 # @param theShape1,theShape2 Shapes to find minimal distance between.
9950 # @return Value of the minimal distance between the given shapes, in form of list
9951 # [Distance, DX, DY, DZ].
9953 # @ref swig_all_measure "Example"
9954 @ManageTransactions("MeasuOp")
9955 def MinDistanceComponents(self, theShape1, theShape2):
9957 Get minimal distance between the given shapes.
9960 theShape1,theShape2 Shapes to find minimal distance between.
9963 Value of the minimal distance between the given shapes, in form of list
9964 [Distance, DX, DY, DZ]
9966 # Example: see GEOM_TestMeasures.py
9967 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9968 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9969 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9972 ## Get closest points of the given shapes.
9973 # @param theShape1,theShape2 Shapes to find closest points of.
9974 # @return The number of found solutions (-1 in case of infinite number of
9975 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9977 # @ref tui_measurement_tools_page "Example"
9978 @ManageTransactions("MeasuOp")
9979 def ClosestPoints (self, theShape1, theShape2):
9981 Get closest points of the given shapes.
9984 theShape1,theShape2 Shapes to find closest points of.
9987 The number of found solutions (-1 in case of infinite number of
9988 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9990 # Example: see GEOM_TestMeasures.py
9991 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9992 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9995 ## Get angle between the given shapes in degrees.
9996 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9997 # @note If both arguments are vectors, the angle is computed in accordance
9998 # with their orientations, otherwise the minimum angle is computed.
9999 # @return Value of the angle between the given shapes in degrees.
10001 # @ref tui_measurement_tools_page "Example"
10002 @ManageTransactions("MeasuOp")
10003 def GetAngle(self, theShape1, theShape2):
10005 Get angle between the given shapes in degrees.
10008 theShape1,theShape2 Lines or linear edges to find angle between.
10011 If both arguments are vectors, the angle is computed in accordance
10012 with their orientations, otherwise the minimum angle is computed.
10015 Value of the angle between the given shapes in degrees.
10017 # Example: see GEOM_TestMeasures.py
10018 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10019 RaiseIfFailed("GetAngle", self.MeasuOp)
10022 ## Get angle between the given shapes in radians.
10023 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10024 # @note If both arguments are vectors, the angle is computed in accordance
10025 # with their orientations, otherwise the minimum angle is computed.
10026 # @return Value of the angle between the given shapes in radians.
10028 # @ref tui_measurement_tools_page "Example"
10029 @ManageTransactions("MeasuOp")
10030 def GetAngleRadians(self, theShape1, theShape2):
10032 Get angle between the given shapes in radians.
10035 theShape1,theShape2 Lines or linear edges to find angle between.
10039 If both arguments are vectors, the angle is computed in accordance
10040 with their orientations, otherwise the minimum angle is computed.
10043 Value of the angle between the given shapes in radians.
10045 # Example: see GEOM_TestMeasures.py
10046 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10047 RaiseIfFailed("GetAngle", self.MeasuOp)
10050 ## Get angle between the given vectors in degrees.
10051 # @param theShape1,theShape2 Vectors to find angle between.
10052 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10053 # if False, the opposite vector to the normal vector is used.
10054 # @return Value of the angle between the given vectors in degrees.
10056 # @ref tui_measurement_tools_page "Example"
10057 @ManageTransactions("MeasuOp")
10058 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10060 Get angle between the given vectors in degrees.
10063 theShape1,theShape2 Vectors to find angle between.
10064 theFlag If True, the normal vector is defined by the two vectors cross,
10065 if False, the opposite vector to the normal vector is used.
10068 Value of the angle between the given vectors in degrees.
10070 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10072 anAngle = 360. - anAngle
10073 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10076 ## The same as GetAngleVectors, but the result is in radians.
10077 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10079 Get angle between the given vectors in radians.
10082 theShape1,theShape2 Vectors to find angle between.
10083 theFlag If True, the normal vector is defined by the two vectors cross,
10084 if False, the opposite vector to the normal vector is used.
10087 Value of the angle between the given vectors in radians.
10089 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10092 ## @name Curve Curvature Measurement
10093 # Methods for receiving radius of curvature of curves
10094 # in the given point
10097 ## Measure curvature of a curve at a point, set by parameter.
10098 # @param theCurve a curve.
10099 # @param theParam parameter.
10100 # @return radius of curvature of \a theCurve.
10102 # @ref swig_todo "Example"
10103 @ManageTransactions("MeasuOp")
10104 def CurveCurvatureByParam(self, theCurve, theParam):
10106 Measure curvature of a curve at a point, set by parameter.
10110 theParam parameter.
10113 radius of curvature of theCurve.
10115 # Example: see GEOM_TestMeasures.py
10116 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10117 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10120 ## Measure curvature of a curve at a point.
10121 # @param theCurve a curve.
10122 # @param thePoint given point.
10123 # @return radius of curvature of \a theCurve.
10125 # @ref swig_todo "Example"
10126 @ManageTransactions("MeasuOp")
10127 def CurveCurvatureByPoint(self, theCurve, thePoint):
10129 Measure curvature of a curve at a point.
10133 thePoint given point.
10136 radius of curvature of theCurve.
10138 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10139 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10143 ## @name Surface Curvature Measurement
10144 # Methods for receiving max and min radius of curvature of surfaces
10145 # in the given point
10148 ## Measure max radius of curvature of surface.
10149 # @param theSurf the given surface.
10150 # @param theUParam Value of U-parameter on the referenced surface.
10151 # @param theVParam Value of V-parameter on the referenced surface.
10152 # @return max radius of curvature of theSurf.
10154 ## @ref swig_todo "Example"
10155 @ManageTransactions("MeasuOp")
10156 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10158 Measure max radius of curvature of surface.
10161 theSurf the given surface.
10162 theUParam Value of U-parameter on the referenced surface.
10163 theVParam Value of V-parameter on the referenced surface.
10166 max radius of curvature of theSurf.
10168 # Example: see GEOM_TestMeasures.py
10169 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10170 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10173 ## Measure max radius of curvature of surface in the given point
10174 # @param theSurf the given surface.
10175 # @param thePoint given point.
10176 # @return max radius of curvature of theSurf.
10178 ## @ref swig_todo "Example"
10179 @ManageTransactions("MeasuOp")
10180 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10182 Measure max radius of curvature of surface in the given point.
10185 theSurf the given surface.
10186 thePoint given point.
10189 max radius of curvature of theSurf.
10191 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10192 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10195 ## Measure min radius of curvature of surface.
10196 # @param theSurf the given surface.
10197 # @param theUParam Value of U-parameter on the referenced surface.
10198 # @param theVParam Value of V-parameter on the referenced surface.
10199 # @return min radius of curvature of theSurf.
10201 ## @ref swig_todo "Example"
10202 @ManageTransactions("MeasuOp")
10203 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10205 Measure min radius of curvature of surface.
10208 theSurf the given surface.
10209 theUParam Value of U-parameter on the referenced surface.
10210 theVParam Value of V-parameter on the referenced surface.
10213 Min radius of curvature of theSurf.
10215 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10216 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10219 ## Measure min radius of curvature of surface in the given point
10220 # @param theSurf the given surface.
10221 # @param thePoint given point.
10222 # @return min radius of curvature of theSurf.
10224 ## @ref swig_todo "Example"
10225 @ManageTransactions("MeasuOp")
10226 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10228 Measure min radius of curvature of surface in the given point.
10231 theSurf the given surface.
10232 thePoint given point.
10235 Min radius of curvature of theSurf.
10237 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10238 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10242 ## Get min and max tolerances of sub-shapes of theShape
10243 # @param theShape Shape, to get tolerances of.
10244 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10245 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10246 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10247 # VertMin,VertMax: Min and max tolerances of the vertices.
10249 # @ref tui_measurement_tools_page "Example"
10250 @ManageTransactions("MeasuOp")
10251 def Tolerance(self,theShape):
10253 Get min and max tolerances of sub-shapes of theShape
10256 theShape Shape, to get tolerances of.
10259 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10260 FaceMin,FaceMax: Min and max tolerances of the faces.
10261 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10262 VertMin,VertMax: Min and max tolerances of the vertices.
10264 # Example: see GEOM_TestMeasures.py
10265 aTuple = self.MeasuOp.GetTolerance(theShape)
10266 RaiseIfFailed("GetTolerance", self.MeasuOp)
10269 ## Obtain description of the given shape (number of sub-shapes of each type)
10270 # @param theShape Shape to be described.
10271 # @return Description of the given shape.
10273 # @ref tui_measurement_tools_page "Example"
10274 @ManageTransactions("MeasuOp")
10275 def WhatIs(self,theShape):
10277 Obtain description of the given shape (number of sub-shapes of each type)
10280 theShape Shape to be described.
10283 Description of the given shape.
10285 # Example: see GEOM_TestMeasures.py
10286 aDescr = self.MeasuOp.WhatIs(theShape)
10287 RaiseIfFailed("WhatIs", self.MeasuOp)
10290 ## Obtain quantity of shapes of the given type in \a theShape.
10291 # If \a theShape is of type \a theType, it is also counted.
10292 # @param theShape Shape to be described.
10293 # @param theType the given ShapeType().
10294 # @return Quantity of shapes of type \a theType in \a theShape.
10296 # @ref tui_measurement_tools_page "Example"
10297 def NbShapes (self, theShape, theType):
10299 Obtain quantity of shapes of the given type in theShape.
10300 If theShape is of type theType, it is also counted.
10303 theShape Shape to be described.
10304 theType the given geompy.ShapeType
10307 Quantity of shapes of type theType in theShape.
10309 # Example: see GEOM_TestMeasures.py
10310 listSh = self.SubShapeAllIDs(theShape, theType)
10314 ## Obtain quantity of shapes of each type in \a theShape.
10315 # The \a theShape is also counted.
10316 # @param theShape Shape to be described.
10317 # @return Dictionary of ShapeType() with bound quantities of shapes.
10319 # @ref tui_measurement_tools_page "Example"
10320 def ShapeInfo (self, theShape):
10322 Obtain quantity of shapes of each type in theShape.
10323 The theShape is also counted.
10326 theShape Shape to be described.
10329 Dictionary of geompy.ShapeType with bound quantities of shapes.
10331 # Example: see GEOM_TestMeasures.py
10333 for typeSh in self.ShapeType:
10334 if typeSh in ( "AUTO", "SHAPE" ): continue
10335 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10341 def GetCreationInformation(self, theShape):
10342 info = theShape.GetCreationInformation()
10344 opName = info.operationName
10345 if not opName: opName = "no info available"
10346 res = "Operation: " + opName
10348 for parVal in info.params:
10349 res += " \n %s = %s" % ( parVal.name, parVal.value )
10352 ## Get a point, situated at the centre of mass of theShape.
10353 # @param theShape Shape to define centre of mass of.
10354 # @param theName Object name; when specified, this parameter is used
10355 # for result publication in the study. Otherwise, if automatic
10356 # publication is switched on, default value is used for result name.
10358 # @return New GEOM.GEOM_Object, containing the created point.
10360 # @ref tui_measurement_tools_page "Example"
10361 @ManageTransactions("MeasuOp")
10362 def MakeCDG(self, theShape, theName=None):
10364 Get a point, situated at the centre of mass of theShape.
10367 theShape Shape to define centre of mass of.
10368 theName Object name; when specified, this parameter is used
10369 for result publication in the study. Otherwise, if automatic
10370 publication is switched on, default value is used for result name.
10373 New GEOM.GEOM_Object, containing the created point.
10375 # Example: see GEOM_TestMeasures.py
10376 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10377 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10378 self._autoPublish(anObj, theName, "centerOfMass")
10381 ## Get a vertex sub-shape by index depended with orientation.
10382 # @param theShape Shape to find sub-shape.
10383 # @param theIndex Index to find vertex by this index (starting from zero)
10384 # @param theName Object name; when specified, this parameter is used
10385 # for result publication in the study. Otherwise, if automatic
10386 # publication is switched on, default value is used for result name.
10388 # @return New GEOM.GEOM_Object, containing the created vertex.
10390 # @ref tui_measurement_tools_page "Example"
10391 @ManageTransactions("MeasuOp")
10392 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10394 Get a vertex sub-shape by index depended with orientation.
10397 theShape Shape to find sub-shape.
10398 theIndex Index to find vertex by this index (starting from zero)
10399 theName Object name; when specified, this parameter is used
10400 for result publication in the study. Otherwise, if automatic
10401 publication is switched on, default value is used for result name.
10404 New GEOM.GEOM_Object, containing the created vertex.
10406 # Example: see GEOM_TestMeasures.py
10407 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10408 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10409 self._autoPublish(anObj, theName, "vertex")
10412 ## Get the first vertex of wire/edge depended orientation.
10413 # @param theShape Shape to find first vertex.
10414 # @param theName Object name; when specified, this parameter is used
10415 # for result publication in the study. Otherwise, if automatic
10416 # publication is switched on, default value is used for result name.
10418 # @return New GEOM.GEOM_Object, containing the created vertex.
10420 # @ref tui_measurement_tools_page "Example"
10421 def GetFirstVertex(self, theShape, theName=None):
10423 Get the first vertex of wire/edge depended orientation.
10426 theShape Shape to find first vertex.
10427 theName Object name; when specified, this parameter is used
10428 for result publication in the study. Otherwise, if automatic
10429 publication is switched on, default value is used for result name.
10432 New GEOM.GEOM_Object, containing the created vertex.
10434 # Example: see GEOM_TestMeasures.py
10435 # note: auto-publishing is done in self.GetVertexByIndex()
10436 return self.GetVertexByIndex(theShape, 0, theName)
10438 ## Get the last vertex of wire/edge depended orientation.
10439 # @param theShape Shape to find last vertex.
10440 # @param theName Object name; when specified, this parameter is used
10441 # for result publication in the study. Otherwise, if automatic
10442 # publication is switched on, default value is used for result name.
10444 # @return New GEOM.GEOM_Object, containing the created vertex.
10446 # @ref tui_measurement_tools_page "Example"
10447 def GetLastVertex(self, theShape, theName=None):
10449 Get the last vertex of wire/edge depended orientation.
10452 theShape Shape to find last vertex.
10453 theName Object name; when specified, this parameter is used
10454 for result publication in the study. Otherwise, if automatic
10455 publication is switched on, default value is used for result name.
10458 New GEOM.GEOM_Object, containing the created vertex.
10460 # Example: see GEOM_TestMeasures.py
10461 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10462 # note: auto-publishing is done in self.GetVertexByIndex()
10463 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10465 ## Get a normale to the given face. If the point is not given,
10466 # the normale is calculated at the center of mass.
10467 # @param theFace Face to define normale of.
10468 # @param theOptionalPoint Point to compute the normale at.
10469 # @param theName Object name; when specified, this parameter is used
10470 # for result publication in the study. Otherwise, if automatic
10471 # publication is switched on, default value is used for result name.
10473 # @return New GEOM.GEOM_Object, containing the created vector.
10475 # @ref swig_todo "Example"
10476 @ManageTransactions("MeasuOp")
10477 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10479 Get a normale to the given face. If the point is not given,
10480 the normale is calculated at the center of mass.
10483 theFace Face to define normale of.
10484 theOptionalPoint Point to compute the normale at.
10485 theName Object name; when specified, this parameter is used
10486 for result publication in the study. Otherwise, if automatic
10487 publication is switched on, default value is used for result name.
10490 New GEOM.GEOM_Object, containing the created vector.
10492 # Example: see GEOM_TestMeasures.py
10493 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10494 RaiseIfFailed("GetNormal", self.MeasuOp)
10495 self._autoPublish(anObj, theName, "normal")
10498 ## Print shape errors obtained from CheckShape.
10499 # @param theShape Shape that was checked.
10500 # @param theShapeErrors the shape errors obtained by CheckShape.
10501 # @param theReturnStatus If 0 the description of problem is printed.
10502 # If 1 the description of problem is returned.
10503 # @return If theReturnStatus is equal to 1 the description is returned.
10504 # Otherwise doesn't return anything.
10506 # @ref tui_measurement_tools_page "Example"
10507 @ManageTransactions("MeasuOp")
10508 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10510 Print shape errors obtained from CheckShape.
10513 theShape Shape that was checked.
10514 theShapeErrors the shape errors obtained by CheckShape.
10515 theReturnStatus If 0 the description of problem is printed.
10516 If 1 the description of problem is returned.
10519 If theReturnStatus is equal to 1 the description is returned.
10520 Otherwise doesn't return anything.
10522 # Example: see GEOM_TestMeasures.py
10523 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10524 if theReturnStatus == 1:
10529 ## Check a topology of the given shape.
10530 # @param theShape Shape to check validity of.
10531 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10532 # if TRUE, the shape's geometry will be checked also.
10533 # @param theReturnStatus If 0 and if theShape is invalid, a description
10534 # of problem is printed.
10535 # If 1 isValid flag and the description of
10536 # problem is returned.
10537 # If 2 isValid flag and the list of error data
10539 # @return TRUE, if the shape "seems to be valid".
10540 # If theShape is invalid, prints a description of problem.
10541 # If theReturnStatus is equal to 1 the description is returned
10542 # along with IsValid flag.
10543 # If theReturnStatus is equal to 2 the list of error data is
10544 # returned along with IsValid flag.
10546 # @ref tui_measurement_tools_page "Example"
10547 @ManageTransactions("MeasuOp")
10548 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10550 Check a topology of the given shape.
10553 theShape Shape to check validity of.
10554 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10555 if TRUE, the shape's geometry will be checked also.
10556 theReturnStatus If 0 and if theShape is invalid, a description
10557 of problem is printed.
10558 If 1 IsValid flag and the description of
10559 problem is returned.
10560 If 2 IsValid flag and the list of error data
10564 TRUE, if the shape "seems to be valid".
10565 If theShape is invalid, prints a description of problem.
10566 If theReturnStatus is equal to 1 the description is returned
10567 along with IsValid flag.
10568 If theReturnStatus is equal to 2 the list of error data is
10569 returned along with IsValid flag.
10571 # Example: see GEOM_TestMeasures.py
10573 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10574 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10576 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10577 RaiseIfFailed("CheckShape", self.MeasuOp)
10579 if theReturnStatus == 0:
10580 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10582 if theReturnStatus == 1:
10583 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10584 return (IsValid, Descr)
10585 elif theReturnStatus == 2:
10586 return (IsValid, ShapeErrors)
10589 ## Detect self-intersections in the given shape.
10590 # @param theShape Shape to check.
10591 # @param theCheckLevel is the level of self-intersection check.
10592 # Possible input values are:
10593 # - GEOM.SI_V_V(0) - only V/V interferences
10594 # - GEOM.SI_V_E(1) - V/V and V/E interferences
10595 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10596 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10597 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10598 # - GEOM.SI_ALL(5) - all interferences.
10599 # @return TRUE, if the shape contains no self-intersections.
10601 # @ref tui_measurement_tools_page "Example"
10602 @ManageTransactions("MeasuOp")
10603 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
10605 Detect self-intersections in the given shape.
10608 theShape Shape to check.
10609 theCheckLevel is the level of self-intersection check.
10610 Possible input values are:
10611 - GEOM.SI_V_V(0) - only V/V interferences
10612 - GEOM.SI_V_E(1) - V/V and V/E interferences
10613 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10614 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10615 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10616 - GEOM.SI_ALL(5) - all interferences.
10619 TRUE, if the shape contains no self-intersections.
10621 # Example: see GEOM_TestMeasures.py
10622 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
10623 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10626 ## Get position (LCS) of theShape.
10628 # Origin of the LCS is situated at the shape's center of mass.
10629 # Axes of the LCS are obtained from shape's location or,
10630 # if the shape is a planar face, from position of its plane.
10632 # @param theShape Shape to calculate position of.
10633 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10634 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10635 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10636 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10638 # @ref swig_todo "Example"
10639 @ManageTransactions("MeasuOp")
10640 def GetPosition(self,theShape):
10642 Get position (LCS) of theShape.
10643 Origin of the LCS is situated at the shape's center of mass.
10644 Axes of the LCS are obtained from shape's location or,
10645 if the shape is a planar face, from position of its plane.
10648 theShape Shape to calculate position of.
10651 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10652 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10653 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10654 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10656 # Example: see GEOM_TestMeasures.py
10657 aTuple = self.MeasuOp.GetPosition(theShape)
10658 RaiseIfFailed("GetPosition", self.MeasuOp)
10661 ## Get kind of theShape.
10663 # @param theShape Shape to get a kind of.
10664 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10665 # and a list of parameters, describing the shape.
10666 # @note Concrete meaning of each value, returned via \a theIntegers
10667 # or \a theDoubles list depends on the kind() of the shape.
10669 # @ref swig_todo "Example"
10670 @ManageTransactions("MeasuOp")
10671 def KindOfShape(self,theShape):
10673 Get kind of theShape.
10676 theShape Shape to get a kind of.
10679 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10680 and a list of parameters, describing the shape.
10682 Concrete meaning of each value, returned via theIntegers
10683 or theDoubles list depends on the geompy.kind of the shape
10685 # Example: see GEOM_TestMeasures.py
10686 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10687 RaiseIfFailed("KindOfShape", self.MeasuOp)
10689 aKind = aRoughTuple[0]
10690 anInts = aRoughTuple[1]
10691 aDbls = aRoughTuple[2]
10693 # Now there is no exception from this rule:
10694 aKindTuple = [aKind] + aDbls + anInts
10696 # If they are we will regroup parameters for such kind of shape.
10698 #if aKind == kind.SOME_KIND:
10699 # # SOME_KIND int int double int double double
10700 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10704 ## Returns the string that describes if the shell is good for solid.
10705 # This is a support method for MakeSolid.
10707 # @param theShell the shell to be checked.
10708 # @return Returns a string that describes the shell validity for
10709 # solid construction.
10710 @ManageTransactions("MeasuOp")
10711 def _IsGoodForSolid(self, theShell):
10713 Returns the string that describes if the shell is good for solid.
10714 This is a support method for MakeSolid.
10717 theShell the shell to be checked.
10720 Returns a string that describes the shell validity for
10721 solid construction.
10723 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10726 # end of l2_measure
10729 ## @addtogroup l2_import_export
10732 ## Import a shape from the BREP, IGES, STEP or other file
10733 # (depends on given format) with given name.
10735 # Note: this function is deprecated, it is kept for backward compatibility only
10736 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10738 # @param theFileName The file, containing the shape.
10739 # @param theFormatName Specify format for the file reading.
10740 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10741 # If format 'IGES_SCALE' is used instead of 'IGES' or
10742 # format 'STEP_SCALE' is used instead of 'STEP',
10743 # length unit will be set to 'meter' and result model will be scaled.
10744 # @param theName Object name; when specified, this parameter is used
10745 # for result publication in the study. Otherwise, if automatic
10746 # publication is switched on, default value is used for result name.
10748 # @return New GEOM.GEOM_Object, containing the imported shape.
10749 # If material names are imported it returns the list of
10750 # objects. The first one is the imported object followed by
10752 # @note Auto publishing is allowed for the shape itself. Imported
10753 # material groups are not automatically published.
10755 # @ref swig_Import_Export "Example"
10756 @ManageTransactions("InsertOp")
10757 def ImportFile(self, theFileName, theFormatName, theName=None):
10759 Import a shape from the BREP, IGES, STEP or other file
10760 (depends on given format) with given name.
10762 Note: this function is deprecated, it is kept for backward compatibility only
10763 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10766 theFileName The file, containing the shape.
10767 theFormatName Specify format for the file reading.
10768 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10769 If format 'IGES_SCALE' is used instead of 'IGES' or
10770 format 'STEP_SCALE' is used instead of 'STEP',
10771 length unit will be set to 'meter' and result model will be scaled.
10772 theName Object name; when specified, this parameter is used
10773 for result publication in the study. Otherwise, if automatic
10774 publication is switched on, default value is used for result name.
10777 New GEOM.GEOM_Object, containing the imported shape.
10778 If material names are imported it returns the list of
10779 objects. The first one is the imported object followed by
10782 Auto publishing is allowed for the shape itself. Imported
10783 material groups are not automatically published.
10785 # Example: see GEOM_TestOthers.py
10787 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10788 where <FormatName> is a name of desirable format for importing.
10790 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10791 RaiseIfFailed("ImportFile", self.InsertOp)
10792 aNbObj = len(aListObj)
10794 self._autoPublish(aListObj[0], theName, "imported")
10799 ## Deprecated analog of ImportFile()
10800 def Import(self, theFileName, theFormatName, theName=None):
10802 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10804 # note: auto-publishing is done in self.ImportFile()
10805 return self.ImportFile(theFileName, theFormatName, theName)
10807 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10808 # @note This method will not be dumped to the python script by DumpStudy functionality.
10809 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10810 # @param theStream The BRep binary stream.
10811 # @param theName Object name; when specified, this parameter is used
10812 # for result publication in the study. Otherwise, if automatic
10813 # publication is switched on, default value is used for result name.
10815 # @return New GEOM_Object, containing the shape, read from theStream.
10817 # @ref swig_Import_Export "Example"
10818 @ManageTransactions("InsertOp")
10819 def RestoreShape (self, theStream, theName=None):
10821 Read a shape from the binary stream, containing its bounding representation (BRep).
10824 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10827 theStream The BRep binary stream.
10828 theName Object name; when specified, this parameter is used
10829 for result publication in the study. Otherwise, if automatic
10830 publication is switched on, default value is used for result name.
10833 New GEOM_Object, containing the shape, read from theStream.
10835 # Example: see GEOM_TestOthers.py
10836 anObj = self.InsertOp.RestoreShape(theStream)
10837 RaiseIfFailed("RestoreShape", self.InsertOp)
10838 self._autoPublish(anObj, theName, "restored")
10841 ## Export the given shape into a file with given name.
10843 # Note: this function is deprecated, it is kept for backward compatibility only
10844 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10846 # @param theObject Shape to be stored in the file.
10847 # @param theFileName Name of the file to store the given shape in.
10848 # @param theFormatName Specify format for the shape storage.
10849 # Available formats can be obtained with
10850 # geompy.InsertOp.ExportTranslators()[0] method.
10852 # @ref swig_Import_Export "Example"
10853 @ManageTransactions("InsertOp")
10854 def Export(self, theObject, theFileName, theFormatName):
10856 Export the given shape into a file with given name.
10858 Note: this function is deprecated, it is kept for backward compatibility only
10859 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10862 theObject Shape to be stored in the file.
10863 theFileName Name of the file to store the given shape in.
10864 theFormatName Specify format for the shape storage.
10865 Available formats can be obtained with
10866 geompy.InsertOp.ExportTranslators()[0] method.
10868 # Example: see GEOM_TestOthers.py
10870 WARNING: Function Export is deprecated, use Export<FormatName> instead,
10871 where <FormatName> is a name of desirable format for exporting.
10873 self.InsertOp.Export(theObject, theFileName, theFormatName)
10874 if self.InsertOp.IsDone() == 0:
10875 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10879 # end of l2_import_export
10882 ## @addtogroup l3_blocks
10885 ## Create a quadrangle face from four edges. Order of Edges is not
10886 # important. It is not necessary that edges share the same vertex.
10887 # @param E1,E2,E3,E4 Edges for the face bound.
10888 # @param theName Object name; when specified, this parameter is used
10889 # for result publication in the study. Otherwise, if automatic
10890 # publication is switched on, default value is used for result name.
10892 # @return New GEOM.GEOM_Object, containing the created face.
10894 # @ref tui_building_by_blocks_page "Example"
10895 @ManageTransactions("BlocksOp")
10896 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10898 Create a quadrangle face from four edges. Order of Edges is not
10899 important. It is not necessary that edges share the same vertex.
10902 E1,E2,E3,E4 Edges for the face bound.
10903 theName Object name; when specified, this parameter is used
10904 for result publication in the study. Otherwise, if automatic
10905 publication is switched on, default value is used for result name.
10908 New GEOM.GEOM_Object, containing the created face.
10911 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10913 # Example: see GEOM_Spanner.py
10914 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10915 RaiseIfFailed("MakeQuad", self.BlocksOp)
10916 self._autoPublish(anObj, theName, "quad")
10919 ## Create a quadrangle face on two edges.
10920 # The missing edges will be built by creating the shortest ones.
10921 # @param E1,E2 Two opposite edges for the face.
10922 # @param theName Object name; when specified, this parameter is used
10923 # for result publication in the study. Otherwise, if automatic
10924 # publication is switched on, default value is used for result name.
10926 # @return New GEOM.GEOM_Object, containing the created face.
10928 # @ref tui_building_by_blocks_page "Example"
10929 @ManageTransactions("BlocksOp")
10930 def MakeQuad2Edges(self, E1, E2, theName=None):
10932 Create a quadrangle face on two edges.
10933 The missing edges will be built by creating the shortest ones.
10936 E1,E2 Two opposite edges for the face.
10937 theName Object name; when specified, this parameter is used
10938 for result publication in the study. Otherwise, if automatic
10939 publication is switched on, default value is used for result name.
10942 New GEOM.GEOM_Object, containing the created face.
10946 p1 = geompy.MakeVertex( 0., 0., 0.)
10947 p2 = geompy.MakeVertex(150., 30., 0.)
10948 p3 = geompy.MakeVertex( 0., 120., 50.)
10949 p4 = geompy.MakeVertex( 0., 40., 70.)
10951 edge1 = geompy.MakeEdge(p1, p2)
10952 edge2 = geompy.MakeEdge(p3, p4)
10953 # create a quadrangle face from two edges
10954 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10956 # Example: see GEOM_Spanner.py
10957 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10958 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10959 self._autoPublish(anObj, theName, "quad")
10962 ## Create a quadrangle face with specified corners.
10963 # The missing edges will be built by creating the shortest ones.
10964 # @param V1,V2,V3,V4 Corner vertices for the face.
10965 # @param theName Object name; when specified, this parameter is used
10966 # for result publication in the study. Otherwise, if automatic
10967 # publication is switched on, default value is used for result name.
10969 # @return New GEOM.GEOM_Object, containing the created face.
10971 # @ref tui_building_by_blocks_page "Example 1"
10972 # \n @ref swig_MakeQuad4Vertices "Example 2"
10973 @ManageTransactions("BlocksOp")
10974 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10976 Create a quadrangle face with specified corners.
10977 The missing edges will be built by creating the shortest ones.
10980 V1,V2,V3,V4 Corner vertices for the face.
10981 theName Object name; when specified, this parameter is used
10982 for result publication in the study. Otherwise, if automatic
10983 publication is switched on, default value is used for result name.
10986 New GEOM.GEOM_Object, containing the created face.
10990 p1 = geompy.MakeVertex( 0., 0., 0.)
10991 p2 = geompy.MakeVertex(150., 30., 0.)
10992 p3 = geompy.MakeVertex( 0., 120., 50.)
10993 p4 = geompy.MakeVertex( 0., 40., 70.)
10994 # create a quadrangle from four points in its corners
10995 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10997 # Example: see GEOM_Spanner.py
10998 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10999 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11000 self._autoPublish(anObj, theName, "quad")
11003 ## Create a hexahedral solid, bounded by the six given faces. Order of
11004 # faces is not important. It is not necessary that Faces share the same edge.
11005 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11006 # @param theName Object name; when specified, this parameter is used
11007 # for result publication in the study. Otherwise, if automatic
11008 # publication is switched on, default value is used for result name.
11010 # @return New GEOM.GEOM_Object, containing the created solid.
11012 # @ref tui_building_by_blocks_page "Example 1"
11013 # \n @ref swig_MakeHexa "Example 2"
11014 @ManageTransactions("BlocksOp")
11015 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11017 Create a hexahedral solid, bounded by the six given faces. Order of
11018 faces is not important. It is not necessary that Faces share the same edge.
11021 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11022 theName Object name; when specified, this parameter is used
11023 for result publication in the study. Otherwise, if automatic
11024 publication is switched on, default value is used for result name.
11027 New GEOM.GEOM_Object, containing the created solid.
11030 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11032 # Example: see GEOM_Spanner.py
11033 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11034 RaiseIfFailed("MakeHexa", self.BlocksOp)
11035 self._autoPublish(anObj, theName, "hexa")
11038 ## Create a hexahedral solid between two given faces.
11039 # The missing faces will be built by creating the smallest ones.
11040 # @param F1,F2 Two opposite faces for the hexahedral solid.
11041 # @param theName Object name; when specified, this parameter is used
11042 # for result publication in the study. Otherwise, if automatic
11043 # publication is switched on, default value is used for result name.
11045 # @return New GEOM.GEOM_Object, containing the created solid.
11047 # @ref tui_building_by_blocks_page "Example 1"
11048 # \n @ref swig_MakeHexa2Faces "Example 2"
11049 @ManageTransactions("BlocksOp")
11050 def MakeHexa2Faces(self, F1, F2, theName=None):
11052 Create a hexahedral solid between two given faces.
11053 The missing faces will be built by creating the smallest ones.
11056 F1,F2 Two opposite faces for the hexahedral solid.
11057 theName Object name; when specified, this parameter is used
11058 for result publication in the study. Otherwise, if automatic
11059 publication is switched on, default value is used for result name.
11062 New GEOM.GEOM_Object, containing the created solid.
11065 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11067 # Example: see GEOM_Spanner.py
11068 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11069 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11070 self._autoPublish(anObj, theName, "hexa")
11076 ## @addtogroup l3_blocks_op
11079 ## Get a vertex, found in the given shape by its coordinates.
11080 # @param theShape Block or a compound of blocks.
11081 # @param theX,theY,theZ Coordinates of the sought vertex.
11082 # @param theEpsilon Maximum allowed distance between the resulting
11083 # vertex and point with the given coordinates.
11084 # @param theName Object name; when specified, this parameter is used
11085 # for result publication in the study. Otherwise, if automatic
11086 # publication is switched on, default value is used for result name.
11088 # @return New GEOM.GEOM_Object, containing the found vertex.
11090 # @ref swig_GetPoint "Example"
11091 @ManageTransactions("BlocksOp")
11092 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11094 Get a vertex, found in the given shape by its coordinates.
11097 theShape Block or a compound of blocks.
11098 theX,theY,theZ Coordinates of the sought vertex.
11099 theEpsilon Maximum allowed distance between the resulting
11100 vertex and point with the given coordinates.
11101 theName Object name; when specified, this parameter is used
11102 for result publication in the study. Otherwise, if automatic
11103 publication is switched on, default value is used for result name.
11106 New GEOM.GEOM_Object, containing the found vertex.
11109 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11111 # Example: see GEOM_TestOthers.py
11112 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11113 RaiseIfFailed("GetPoint", self.BlocksOp)
11114 self._autoPublish(anObj, theName, "vertex")
11117 ## Find a vertex of the given shape, which has minimal distance to the given point.
11118 # @param theShape Any shape.
11119 # @param thePoint Point, close to the desired vertex.
11120 # @param theName Object name; when specified, this parameter is used
11121 # for result publication in the study. Otherwise, if automatic
11122 # publication is switched on, default value is used for result name.
11124 # @return New GEOM.GEOM_Object, containing the found vertex.
11126 # @ref swig_GetVertexNearPoint "Example"
11127 @ManageTransactions("BlocksOp")
11128 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11130 Find a vertex of the given shape, which has minimal distance to the given point.
11133 theShape Any shape.
11134 thePoint Point, close to the desired vertex.
11135 theName Object name; when specified, this parameter is used
11136 for result publication in the study. Otherwise, if automatic
11137 publication is switched on, default value is used for result name.
11140 New GEOM.GEOM_Object, containing the found vertex.
11143 pmidle = geompy.MakeVertex(50, 0, 50)
11144 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11146 # Example: see GEOM_TestOthers.py
11147 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11148 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11149 self._autoPublish(anObj, theName, "vertex")
11152 ## Get an edge, found in the given shape by two given vertices.
11153 # @param theShape Block or a compound of blocks.
11154 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11155 # @param theName Object name; when specified, this parameter is used
11156 # for result publication in the study. Otherwise, if automatic
11157 # publication is switched on, default value is used for result name.
11159 # @return New GEOM.GEOM_Object, containing the found edge.
11161 # @ref swig_GetEdge "Example"
11162 @ManageTransactions("BlocksOp")
11163 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11165 Get an edge, found in the given shape by two given vertices.
11168 theShape Block or a compound of blocks.
11169 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11170 theName Object name; when specified, this parameter is used
11171 for result publication in the study. Otherwise, if automatic
11172 publication is switched on, default value is used for result name.
11175 New GEOM.GEOM_Object, containing the found edge.
11177 # Example: see GEOM_Spanner.py
11178 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11179 RaiseIfFailed("GetEdge", self.BlocksOp)
11180 self._autoPublish(anObj, theName, "edge")
11183 ## Find an edge of the given shape, which has minimal distance to the given point.
11184 # @param theShape Block or a compound of blocks.
11185 # @param thePoint Point, close to the desired edge.
11186 # @param theName Object name; when specified, this parameter is used
11187 # for result publication in the study. Otherwise, if automatic
11188 # publication is switched on, default value is used for result name.
11190 # @return New GEOM.GEOM_Object, containing the found edge.
11192 # @ref swig_GetEdgeNearPoint "Example"
11193 @ManageTransactions("BlocksOp")
11194 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11196 Find an edge of the given shape, which has minimal distance to the given point.
11199 theShape Block or a compound of blocks.
11200 thePoint Point, close to the desired edge.
11201 theName Object name; when specified, this parameter is used
11202 for result publication in the study. Otherwise, if automatic
11203 publication is switched on, default value is used for result name.
11206 New GEOM.GEOM_Object, containing the found edge.
11208 # Example: see GEOM_TestOthers.py
11209 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11210 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11211 self._autoPublish(anObj, theName, "edge")
11214 ## Returns a face, found in the given shape by four given corner vertices.
11215 # @param theShape Block or a compound of blocks.
11216 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11217 # @param theName Object name; when specified, this parameter is used
11218 # for result publication in the study. Otherwise, if automatic
11219 # publication is switched on, default value is used for result name.
11221 # @return New GEOM.GEOM_Object, containing the found face.
11223 # @ref swig_todo "Example"
11224 @ManageTransactions("BlocksOp")
11225 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11227 Returns a face, found in the given shape by four given corner vertices.
11230 theShape Block or a compound of blocks.
11231 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11232 theName Object name; when specified, this parameter is used
11233 for result publication in the study. Otherwise, if automatic
11234 publication is switched on, default value is used for result name.
11237 New GEOM.GEOM_Object, containing the found face.
11239 # Example: see GEOM_Spanner.py
11240 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11241 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11242 self._autoPublish(anObj, theName, "face")
11245 ## Get a face of block, found in the given shape by two given edges.
11246 # @param theShape Block or a compound of blocks.
11247 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11248 # @param theName Object name; when specified, this parameter is used
11249 # for result publication in the study. Otherwise, if automatic
11250 # publication is switched on, default value is used for result name.
11252 # @return New GEOM.GEOM_Object, containing the found face.
11254 # @ref swig_todo "Example"
11255 @ManageTransactions("BlocksOp")
11256 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11258 Get a face of block, found in the given shape by two given edges.
11261 theShape Block or a compound of blocks.
11262 theEdge1,theEdge2 Edges, close to the edges of the desired face.
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 found face.
11270 # Example: see GEOM_Spanner.py
11271 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11272 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11273 self._autoPublish(anObj, theName, "face")
11276 ## Find a face, opposite to the given one in the given block.
11277 # @param theBlock Must be a hexahedral solid.
11278 # @param theFace Face of \a theBlock, opposite to the desired face.
11279 # @param theName Object name; when specified, this parameter is used
11280 # for result publication in the study. Otherwise, if automatic
11281 # publication is switched on, default value is used for result name.
11283 # @return New GEOM.GEOM_Object, containing the found face.
11285 # @ref swig_GetOppositeFace "Example"
11286 @ManageTransactions("BlocksOp")
11287 def GetOppositeFace(self, theBlock, theFace, theName=None):
11289 Find a face, opposite to the given one in the given block.
11292 theBlock Must be a hexahedral solid.
11293 theFace Face of theBlock, opposite to the desired face.
11294 theName Object name; when specified, this parameter is used
11295 for result publication in the study. Otherwise, if automatic
11296 publication is switched on, default value is used for result name.
11299 New GEOM.GEOM_Object, containing the found face.
11301 # Example: see GEOM_Spanner.py
11302 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11303 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11304 self._autoPublish(anObj, theName, "face")
11307 ## Find a face of the given shape, which has minimal distance to the given point.
11308 # @param theShape Block or a compound of blocks.
11309 # @param thePoint Point, close to the desired face.
11310 # @param theName Object name; when specified, this parameter is used
11311 # for result publication in the study. Otherwise, if automatic
11312 # publication is switched on, default value is used for result name.
11314 # @return New GEOM.GEOM_Object, containing the found face.
11316 # @ref swig_GetFaceNearPoint "Example"
11317 @ManageTransactions("BlocksOp")
11318 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11320 Find a face of the given shape, which has minimal distance to the given point.
11323 theShape Block or a compound of blocks.
11324 thePoint Point, close to the desired face.
11325 theName Object name; when specified, this parameter is used
11326 for result publication in the study. Otherwise, if automatic
11327 publication is switched on, default value is used for result name.
11330 New GEOM.GEOM_Object, containing the found face.
11332 # Example: see GEOM_Spanner.py
11333 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11334 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11335 self._autoPublish(anObj, theName, "face")
11338 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11339 # @param theBlock Block or a compound of blocks.
11340 # @param theVector Vector, close to the normale of the desired face.
11341 # @param theName Object name; when specified, this parameter is used
11342 # for result publication in the study. Otherwise, if automatic
11343 # publication is switched on, default value is used for result name.
11345 # @return New GEOM.GEOM_Object, containing the found face.
11347 # @ref swig_todo "Example"
11348 @ManageTransactions("BlocksOp")
11349 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11351 Find a face of block, whose outside normale has minimal angle with the given vector.
11354 theBlock Block or a compound of blocks.
11355 theVector Vector, close to the normale of the desired face.
11356 theName Object name; when specified, this parameter is used
11357 for result publication in the study. Otherwise, if automatic
11358 publication is switched on, default value is used for result name.
11361 New GEOM.GEOM_Object, containing the found face.
11363 # Example: see GEOM_Spanner.py
11364 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11365 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11366 self._autoPublish(anObj, theName, "face")
11369 ## Find all sub-shapes of type \a theShapeType of the given shape,
11370 # which have minimal distance to the given point.
11371 # @param theShape Any shape.
11372 # @param thePoint Point, close to the desired shape.
11373 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11374 # @param theTolerance The tolerance for distances comparison. All shapes
11375 # with distances to the given point in interval
11376 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11377 # @param theName Object name; when specified, this parameter is used
11378 # for result publication in the study. Otherwise, if automatic
11379 # publication is switched on, default value is used for result name.
11381 # @return New GEOM_Object, containing a group of all found shapes.
11383 # @ref swig_GetShapesNearPoint "Example"
11384 @ManageTransactions("BlocksOp")
11385 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11387 Find all sub-shapes of type theShapeType of the given shape,
11388 which have minimal distance to the given point.
11391 theShape Any shape.
11392 thePoint Point, close to the desired shape.
11393 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11394 theTolerance The tolerance for distances comparison. All shapes
11395 with distances to the given point in interval
11396 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11397 theName Object name; when specified, this parameter is used
11398 for result publication in the study. Otherwise, if automatic
11399 publication is switched on, default value is used for result name.
11402 New GEOM_Object, containing a group of all found shapes.
11404 # Example: see GEOM_TestOthers.py
11405 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11406 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11407 self._autoPublish(anObj, theName, "group")
11410 # end of l3_blocks_op
11413 ## @addtogroup l4_blocks_measure
11416 ## Check, if the compound of blocks is given.
11417 # To be considered as a compound of blocks, the
11418 # given shape must satisfy the following conditions:
11419 # - Each element of the compound should be a Block (6 faces and 12 edges).
11420 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11421 # - The compound should be connexe.
11422 # - The glue between two quadrangle faces should be applied.
11423 # @param theCompound The compound to check.
11424 # @return TRUE, if the given shape is a compound of blocks.
11425 # If theCompound is not valid, prints all discovered errors.
11427 # @ref tui_measurement_tools_page "Example 1"
11428 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11429 @ManageTransactions("BlocksOp")
11430 def CheckCompoundOfBlocks(self,theCompound):
11432 Check, if the compound of blocks is given.
11433 To be considered as a compound of blocks, the
11434 given shape must satisfy the following conditions:
11435 - Each element of the compound should be a Block (6 faces and 12 edges).
11436 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11437 - The compound should be connexe.
11438 - The glue between two quadrangle faces should be applied.
11441 theCompound The compound to check.
11444 TRUE, if the given shape is a compound of blocks.
11445 If theCompound is not valid, prints all discovered errors.
11447 # Example: see GEOM_Spanner.py
11448 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11449 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11451 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11455 ## Retrieve all non blocks solids and faces from \a theShape.
11456 # @param theShape The shape to explore.
11457 # @param theName Object name; when specified, this parameter is used
11458 # for result publication in the study. Otherwise, if automatic
11459 # publication is switched on, default value is used for result name.
11461 # @return A tuple of two GEOM_Objects. The first object is a group of all
11462 # non block solids (= not 6 faces, or with 6 faces, but with the
11463 # presence of non-quadrangular faces). The second object is a
11464 # group of all non quadrangular faces.
11466 # @ref tui_measurement_tools_page "Example 1"
11467 # \n @ref swig_GetNonBlocks "Example 2"
11468 @ManageTransactions("BlocksOp")
11469 def GetNonBlocks (self, theShape, theName=None):
11471 Retrieve all non blocks solids and faces from theShape.
11474 theShape The shape to explore.
11475 theName Object name; when specified, this parameter is used
11476 for result publication in the study. Otherwise, if automatic
11477 publication is switched on, default value is used for result name.
11480 A tuple of two GEOM_Objects. The first object is a group of all
11481 non block solids (= not 6 faces, or with 6 faces, but with the
11482 presence of non-quadrangular faces). The second object is a
11483 group of all non quadrangular faces.
11486 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11488 # Example: see GEOM_Spanner.py
11489 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11490 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11491 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11494 ## Remove all seam and degenerated edges from \a theShape.
11495 # Unite faces and edges, sharing one surface. It means that
11496 # this faces must have references to one C++ surface object (handle).
11497 # @param theShape The compound or single solid to remove irregular edges from.
11498 # @param doUnionFaces If True, then unite faces. If False (the default value),
11499 # do not unite faces.
11500 # @param theName Object name; when specified, this parameter is used
11501 # for result publication in the study. Otherwise, if automatic
11502 # publication is switched on, default value is used for result name.
11504 # @return Improved shape.
11506 # @ref swig_RemoveExtraEdges "Example"
11507 @ManageTransactions("BlocksOp")
11508 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11510 Remove all seam and degenerated edges from theShape.
11511 Unite faces and edges, sharing one surface. It means that
11512 this faces must have references to one C++ surface object (handle).
11515 theShape The compound or single solid to remove irregular edges from.
11516 doUnionFaces If True, then unite faces. If False (the default value),
11517 do not unite faces.
11518 theName Object name; when specified, this parameter is used
11519 for result publication in the study. Otherwise, if automatic
11520 publication is switched on, default value is used for result name.
11525 # Example: see GEOM_TestOthers.py
11526 nbFacesOptimum = -1 # -1 means do not unite faces
11527 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11528 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11529 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11530 self._autoPublish(anObj, theName, "removeExtraEdges")
11533 ## Performs union faces of \a theShape
11534 # Unite faces sharing one surface. It means that
11535 # these faces must have references to one C++ surface object (handle).
11536 # @param theShape The compound or single solid that contains faces
11537 # to perform union.
11538 # @param theName Object name; when specified, this parameter is used
11539 # for result publication in the study. Otherwise, if automatic
11540 # publication is switched on, default value is used for result name.
11542 # @return Improved shape.
11544 # @ref swig_UnionFaces "Example"
11545 @ManageTransactions("BlocksOp")
11546 def UnionFaces(self, theShape, theName=None):
11548 Performs union faces of theShape.
11549 Unite faces sharing one surface. It means that
11550 these faces must have references to one C++ surface object (handle).
11553 theShape The compound or single solid that contains faces
11555 theName Object name; when specified, this parameter is used
11556 for result publication in the study. Otherwise, if automatic
11557 publication is switched on, default value is used for result name.
11562 # Example: see GEOM_TestOthers.py
11563 anObj = self.BlocksOp.UnionFaces(theShape)
11564 RaiseIfFailed("UnionFaces", self.BlocksOp)
11565 self._autoPublish(anObj, theName, "unionFaces")
11568 ## Check, if the given shape is a blocks compound.
11569 # Fix all detected errors.
11570 # \note Single block can be also fixed by this method.
11571 # @param theShape The compound to check and improve.
11572 # @param theName Object name; when specified, this parameter is used
11573 # for result publication in the study. Otherwise, if automatic
11574 # publication is switched on, default value is used for result name.
11576 # @return Improved compound.
11578 # @ref swig_CheckAndImprove "Example"
11579 @ManageTransactions("BlocksOp")
11580 def CheckAndImprove(self, theShape, theName=None):
11582 Check, if the given shape is a blocks compound.
11583 Fix all detected errors.
11586 Single block can be also fixed by this method.
11589 theShape The compound to check and improve.
11590 theName Object name; when specified, this parameter is used
11591 for result publication in the study. Otherwise, if automatic
11592 publication is switched on, default value is used for result name.
11597 # Example: see GEOM_TestOthers.py
11598 anObj = self.BlocksOp.CheckAndImprove(theShape)
11599 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11600 self._autoPublish(anObj, theName, "improved")
11603 # end of l4_blocks_measure
11606 ## @addtogroup l3_blocks_op
11609 ## Get all the blocks, contained in the given compound.
11610 # @param theCompound The compound to explode.
11611 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11612 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11613 # @param theName Object name; when specified, this parameter is used
11614 # for result publication in the study. Otherwise, if automatic
11615 # publication is switched on, default value is used for result name.
11617 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11619 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11621 # @ref tui_explode_on_blocks "Example 1"
11622 # \n @ref swig_MakeBlockExplode "Example 2"
11623 @ManageTransactions("BlocksOp")
11624 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11626 Get all the blocks, contained in the given compound.
11629 theCompound The compound to explode.
11630 theMinNbFaces If solid has lower number of faces, it is not a block.
11631 theMaxNbFaces If solid has higher number of faces, it is not a block.
11632 theName Object name; when specified, this parameter is used
11633 for result publication in the study. Otherwise, if automatic
11634 publication is switched on, default value is used for result name.
11637 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11640 List of GEOM.GEOM_Object, containing the retrieved blocks.
11642 # Example: see GEOM_TestOthers.py
11643 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11644 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11645 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11646 for anObj in aList:
11647 anObj.SetParameters(Parameters)
11649 self._autoPublish(aList, theName, "block")
11652 ## Find block, containing the given point inside its volume or on boundary.
11653 # @param theCompound Compound, to find block in.
11654 # @param thePoint Point, close to the desired block. If the point lays on
11655 # boundary between some blocks, we return block with nearest center.
11656 # @param theName Object name; when specified, this parameter is used
11657 # for result publication in the study. Otherwise, if automatic
11658 # publication is switched on, default value is used for result name.
11660 # @return New GEOM.GEOM_Object, containing the found block.
11662 # @ref swig_todo "Example"
11663 @ManageTransactions("BlocksOp")
11664 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11666 Find block, containing the given point inside its volume or on boundary.
11669 theCompound Compound, to find block in.
11670 thePoint Point, close to the desired block. If the point lays on
11671 boundary between some blocks, we return block with nearest center.
11672 theName Object name; when specified, this parameter is used
11673 for result publication in the study. Otherwise, if automatic
11674 publication is switched on, default value is used for result name.
11677 New GEOM.GEOM_Object, containing the found block.
11679 # Example: see GEOM_Spanner.py
11680 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11681 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11682 self._autoPublish(anObj, theName, "block")
11685 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11686 # @param theCompound Compound, to find block in.
11687 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11688 # @param theName Object name; when specified, this parameter is used
11689 # for result publication in the study. Otherwise, if automatic
11690 # publication is switched on, default value is used for result name.
11692 # @return New GEOM.GEOM_Object, containing the found block.
11694 # @ref swig_GetBlockByParts "Example"
11695 @ManageTransactions("BlocksOp")
11696 def GetBlockByParts(self, theCompound, theParts, theName=None):
11698 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11701 theCompound Compound, to find block in.
11702 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11703 theName Object name; when specified, this parameter is used
11704 for result publication in the study. Otherwise, if automatic
11705 publication is switched on, default value is used for result name.
11708 New GEOM_Object, containing the found block.
11710 # Example: see GEOM_TestOthers.py
11711 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11712 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11713 self._autoPublish(anObj, theName, "block")
11716 ## Return all blocks, containing all the elements, passed as the parts.
11717 # @param theCompound Compound, to find blocks in.
11718 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11719 # @param theName Object name; when specified, this parameter is used
11720 # for result publication in the study. Otherwise, if automatic
11721 # publication is switched on, default value is used for result name.
11723 # @return List of GEOM.GEOM_Object, containing the found blocks.
11725 # @ref swig_todo "Example"
11726 @ManageTransactions("BlocksOp")
11727 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11729 Return all blocks, containing all the elements, passed as the parts.
11732 theCompound Compound, to find blocks in.
11733 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11734 theName Object name; when specified, this parameter is used
11735 for result publication in the study. Otherwise, if automatic
11736 publication is switched on, default value is used for result name.
11739 List of GEOM.GEOM_Object, containing the found blocks.
11741 # Example: see GEOM_Spanner.py
11742 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11743 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11744 self._autoPublish(aList, theName, "block")
11747 ## Multi-transformate block and glue the result.
11748 # Transformation is defined so, as to superpose direction faces.
11749 # @param Block Hexahedral solid to be multi-transformed.
11750 # @param DirFace1 ID of First direction face.
11751 # @param DirFace2 ID of Second direction face.
11752 # @param NbTimes Quantity of transformations to be done.
11753 # @param theName Object name; when specified, this parameter is used
11754 # for result publication in the study. Otherwise, if automatic
11755 # publication is switched on, default value is used for result name.
11757 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11759 # @return New GEOM.GEOM_Object, containing the result shape.
11761 # @ref tui_multi_transformation "Example"
11762 @ManageTransactions("BlocksOp")
11763 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11765 Multi-transformate block and glue the result.
11766 Transformation is defined so, as to superpose direction faces.
11769 Block Hexahedral solid to be multi-transformed.
11770 DirFace1 ID of First direction face.
11771 DirFace2 ID of Second direction face.
11772 NbTimes Quantity of transformations to be done.
11773 theName Object name; when specified, this parameter is used
11774 for result publication in the study. Otherwise, if automatic
11775 publication is switched on, default value is used for result name.
11778 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11781 New GEOM.GEOM_Object, containing the result shape.
11783 # Example: see GEOM_Spanner.py
11784 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11785 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11786 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11787 anObj.SetParameters(Parameters)
11788 self._autoPublish(anObj, theName, "transformed")
11791 ## Multi-transformate block and glue the result.
11792 # @param Block Hexahedral solid to be multi-transformed.
11793 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11794 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11795 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11796 # @param theName Object name; when specified, this parameter is used
11797 # for result publication in the study. Otherwise, if automatic
11798 # publication is switched on, default value is used for result name.
11800 # @return New GEOM.GEOM_Object, containing the result shape.
11802 # @ref tui_multi_transformation "Example"
11803 @ManageTransactions("BlocksOp")
11804 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11805 DirFace1V, DirFace2V, NbTimesV, theName=None):
11807 Multi-transformate block and glue the result.
11810 Block Hexahedral solid to be multi-transformed.
11811 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11812 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11813 NbTimesU,NbTimesV Quantity of transformations to be done.
11814 theName Object name; when specified, this parameter is used
11815 for result publication in the study. Otherwise, if automatic
11816 publication is switched on, default value is used for result name.
11819 New GEOM.GEOM_Object, containing the result shape.
11821 # Example: see GEOM_Spanner.py
11822 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11823 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11824 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11825 DirFace1V, DirFace2V, NbTimesV)
11826 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11827 anObj.SetParameters(Parameters)
11828 self._autoPublish(anObj, theName, "transformed")
11831 ## Build all possible propagation groups.
11832 # Propagation group is a set of all edges, opposite to one (main)
11833 # edge of this group directly or through other opposite edges.
11834 # Notion of Opposite Edge make sence only on quadrangle face.
11835 # @param theShape Shape to build propagation groups on.
11836 # @param theName Object name; when specified, this parameter is used
11837 # for result publication in the study. Otherwise, if automatic
11838 # publication is switched on, default value is used for result name.
11840 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11842 # @ref swig_Propagate "Example"
11843 @ManageTransactions("BlocksOp")
11844 def Propagate(self, theShape, theName=None):
11846 Build all possible propagation groups.
11847 Propagation group is a set of all edges, opposite to one (main)
11848 edge of this group directly or through other opposite edges.
11849 Notion of Opposite Edge make sence only on quadrangle face.
11852 theShape Shape to build propagation groups on.
11853 theName Object name; when specified, this parameter is used
11854 for result publication in the study. Otherwise, if automatic
11855 publication is switched on, default value is used for result name.
11858 List of GEOM.GEOM_Object, each of them is a propagation group.
11860 # Example: see GEOM_TestOthers.py
11861 listChains = self.BlocksOp.Propagate(theShape)
11862 RaiseIfFailed("Propagate", self.BlocksOp)
11863 self._autoPublish(listChains, theName, "propagate")
11866 # end of l3_blocks_op
11869 ## @addtogroup l3_groups
11872 ## Creates a new group which will store sub-shapes of theMainShape
11873 # @param theMainShape is a GEOM object on which the group is selected
11874 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11875 # @param theName Object name; when specified, this parameter is used
11876 # for result publication in the study. Otherwise, if automatic
11877 # publication is switched on, default value is used for result name.
11879 # @return a newly created GEOM group (GEOM.GEOM_Object)
11881 # @ref tui_working_with_groups_page "Example 1"
11882 # \n @ref swig_CreateGroup "Example 2"
11883 @ManageTransactions("GroupOp")
11884 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11886 Creates a new group which will store sub-shapes of theMainShape
11889 theMainShape is a GEOM object on which the group is selected
11890 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11891 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11892 theName Object name; when specified, this parameter is used
11893 for result publication in the study. Otherwise, if automatic
11894 publication is switched on, default value is used for result name.
11897 a newly created GEOM group
11900 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11903 # Example: see GEOM_TestOthers.py
11904 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11905 RaiseIfFailed("CreateGroup", self.GroupOp)
11906 self._autoPublish(anObj, theName, "group")
11909 ## Adds a sub-object with ID theSubShapeId to the group
11910 # @param theGroup is a GEOM group to which the new sub-shape is added
11911 # @param theSubShapeID is a sub-shape ID in the main object.
11912 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11914 # @ref tui_working_with_groups_page "Example"
11915 @ManageTransactions("GroupOp")
11916 def AddObject(self,theGroup, theSubShapeID):
11918 Adds a sub-object with ID theSubShapeId to the group
11921 theGroup is a GEOM group to which the new sub-shape is added
11922 theSubShapeID is a sub-shape ID in the main object.
11925 Use method GetSubShapeID() to get an unique ID of the sub-shape
11927 # Example: see GEOM_TestOthers.py
11928 self.GroupOp.AddObject(theGroup, theSubShapeID)
11929 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11930 RaiseIfFailed("AddObject", self.GroupOp)
11934 ## Removes a sub-object with ID \a theSubShapeId from the group
11935 # @param theGroup is a GEOM group from which the new sub-shape is removed
11936 # @param theSubShapeID is a sub-shape ID in the main object.
11937 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11939 # @ref tui_working_with_groups_page "Example"
11940 @ManageTransactions("GroupOp")
11941 def RemoveObject(self,theGroup, theSubShapeID):
11943 Removes a sub-object with ID theSubShapeId from the group
11946 theGroup is a GEOM group from which the new sub-shape is removed
11947 theSubShapeID is a sub-shape ID in the main object.
11950 Use method GetSubShapeID() to get an unique ID of the sub-shape
11952 # Example: see GEOM_TestOthers.py
11953 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11954 RaiseIfFailed("RemoveObject", self.GroupOp)
11957 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11958 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11959 # @param theSubShapes is a list of sub-shapes to be added.
11961 # @ref tui_working_with_groups_page "Example"
11962 @ManageTransactions("GroupOp")
11963 def UnionList (self,theGroup, theSubShapes):
11965 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11968 theGroup is a GEOM group to which the new sub-shapes are added.
11969 theSubShapes is a list of sub-shapes to be added.
11971 # Example: see GEOM_TestOthers.py
11972 self.GroupOp.UnionList(theGroup, theSubShapes)
11973 RaiseIfFailed("UnionList", self.GroupOp)
11976 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11977 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11978 # @param theSubShapes is a list of indices of sub-shapes to be added.
11980 # @ref swig_UnionIDs "Example"
11981 @ManageTransactions("GroupOp")
11982 def UnionIDs(self,theGroup, theSubShapes):
11984 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11987 theGroup is a GEOM group to which the new sub-shapes are added.
11988 theSubShapes is a list of indices of sub-shapes to be added.
11990 # Example: see GEOM_TestOthers.py
11991 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11992 RaiseIfFailed("UnionIDs", self.GroupOp)
11995 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11996 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11997 # @param theSubShapes is a list of sub-shapes to be removed.
11999 # @ref tui_working_with_groups_page "Example"
12000 @ManageTransactions("GroupOp")
12001 def DifferenceList (self,theGroup, theSubShapes):
12003 Removes from the group all the given shapes. No errors, if some shapes are not included.
12006 theGroup is a GEOM group from which the sub-shapes are removed.
12007 theSubShapes is a list of sub-shapes to be removed.
12009 # Example: see GEOM_TestOthers.py
12010 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12011 RaiseIfFailed("DifferenceList", self.GroupOp)
12014 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12015 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12016 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12018 # @ref swig_DifferenceIDs "Example"
12019 @ManageTransactions("GroupOp")
12020 def DifferenceIDs(self,theGroup, theSubShapes):
12022 Removes from the group all the given shapes. No errors, if some shapes are not included.
12025 theGroup is a GEOM group from which the sub-shapes are removed.
12026 theSubShapes is a list of indices of sub-shapes to be removed.
12028 # Example: see GEOM_TestOthers.py
12029 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12030 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12033 ## Union of two groups.
12034 # New group is created. It will contain all entities
12035 # which are present in groups theGroup1 and theGroup2.
12036 # @param theGroup1, theGroup2 are the initial GEOM groups
12037 # to create the united group from.
12038 # @param theName Object name; when specified, this parameter is used
12039 # for result publication in the study. Otherwise, if automatic
12040 # publication is switched on, default value is used for result name.
12042 # @return a newly created GEOM group.
12044 # @ref tui_union_groups_anchor "Example"
12045 @ManageTransactions("GroupOp")
12046 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12048 Union of two groups.
12049 New group is created. It will contain all entities
12050 which are present in groups theGroup1 and theGroup2.
12053 theGroup1, theGroup2 are the initial GEOM groups
12054 to create the united group from.
12055 theName Object name; when specified, this parameter is used
12056 for result publication in the study. Otherwise, if automatic
12057 publication is switched on, default value is used for result name.
12060 a newly created GEOM group.
12062 # Example: see GEOM_TestOthers.py
12063 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12064 RaiseIfFailed("UnionGroups", self.GroupOp)
12065 self._autoPublish(aGroup, theName, "group")
12068 ## Intersection of two groups.
12069 # New group is created. It will contain only those entities
12070 # which are present in both groups theGroup1 and theGroup2.
12071 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12072 # @param theName Object name; when specified, this parameter is used
12073 # for result publication in the study. Otherwise, if automatic
12074 # publication is switched on, default value is used for result name.
12076 # @return a newly created GEOM group.
12078 # @ref tui_intersect_groups_anchor "Example"
12079 @ManageTransactions("GroupOp")
12080 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12082 Intersection of two groups.
12083 New group is created. It will contain only those entities
12084 which are present in both groups theGroup1 and theGroup2.
12087 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12088 theName Object name; when specified, this parameter is used
12089 for result publication in the study. Otherwise, if automatic
12090 publication is switched on, default value is used for result name.
12093 a newly created GEOM group.
12095 # Example: see GEOM_TestOthers.py
12096 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12097 RaiseIfFailed("IntersectGroups", self.GroupOp)
12098 self._autoPublish(aGroup, theName, "group")
12101 ## Cut of two groups.
12102 # New group is created. It will contain entities which are
12103 # present in group theGroup1 but are not present in group theGroup2.
12104 # @param theGroup1 is a GEOM group to include elements of.
12105 # @param theGroup2 is a GEOM group to exclude elements of.
12106 # @param theName Object name; when specified, this parameter is used
12107 # for result publication in the study. Otherwise, if automatic
12108 # publication is switched on, default value is used for result name.
12110 # @return a newly created GEOM group.
12112 # @ref tui_cut_groups_anchor "Example"
12113 @ManageTransactions("GroupOp")
12114 def CutGroups (self, theGroup1, theGroup2, theName=None):
12117 New group is created. It will contain entities which are
12118 present in group theGroup1 but are not present in group theGroup2.
12121 theGroup1 is a GEOM group to include elements of.
12122 theGroup2 is a GEOM group to exclude elements of.
12123 theName Object name; when specified, this parameter is used
12124 for result publication in the study. Otherwise, if automatic
12125 publication is switched on, default value is used for result name.
12128 a newly created GEOM group.
12130 # Example: see GEOM_TestOthers.py
12131 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12132 RaiseIfFailed("CutGroups", self.GroupOp)
12133 self._autoPublish(aGroup, theName, "group")
12136 ## Union of list of groups.
12137 # New group is created. It will contain all entities that are
12138 # present in groups listed in theGList.
12139 # @param theGList is a list of GEOM groups to create the united group from.
12140 # @param theName Object name; when specified, this parameter is used
12141 # for result publication in the study. Otherwise, if automatic
12142 # publication is switched on, default value is used for result name.
12144 # @return a newly created GEOM group.
12146 # @ref tui_union_groups_anchor "Example"
12147 @ManageTransactions("GroupOp")
12148 def UnionListOfGroups (self, theGList, theName=None):
12150 Union of list of groups.
12151 New group is created. It will contain all entities that are
12152 present in groups listed in theGList.
12155 theGList is a list of GEOM groups to create the united group from.
12156 theName Object name; when specified, this parameter is used
12157 for result publication in the study. Otherwise, if automatic
12158 publication is switched on, default value is used for result name.
12161 a newly created GEOM group.
12163 # Example: see GEOM_TestOthers.py
12164 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12165 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12166 self._autoPublish(aGroup, theName, "group")
12169 ## Cut of lists of groups.
12170 # New group is created. It will contain only entities
12171 # which are present in groups listed in theGList.
12172 # @param theGList is a list of GEOM groups to include elements of.
12173 # @param theName Object name; when specified, this parameter is used
12174 # for result publication in the study. Otherwise, if automatic
12175 # publication is switched on, default value is used for result name.
12177 # @return a newly created GEOM group.
12179 # @ref tui_intersect_groups_anchor "Example"
12180 @ManageTransactions("GroupOp")
12181 def IntersectListOfGroups (self, theGList, theName=None):
12183 Cut of lists of groups.
12184 New group is created. It will contain only entities
12185 which are present in groups listed in theGList.
12188 theGList is a list of GEOM groups to include elements of.
12189 theName Object name; when specified, this parameter is used
12190 for result publication in the study. Otherwise, if automatic
12191 publication is switched on, default value is used for result name.
12194 a newly created GEOM group.
12196 # Example: see GEOM_TestOthers.py
12197 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12198 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12199 self._autoPublish(aGroup, theName, "group")
12202 ## Cut of lists of groups.
12203 # New group is created. It will contain only entities
12204 # which are present in groups listed in theGList1 but
12205 # are not present in groups from theGList2.
12206 # @param theGList1 is a list of GEOM groups to include elements of.
12207 # @param theGList2 is a list of GEOM groups to exclude elements of.
12208 # @param theName Object name; when specified, this parameter is used
12209 # for result publication in the study. Otherwise, if automatic
12210 # publication is switched on, default value is used for result name.
12212 # @return a newly created GEOM group.
12214 # @ref tui_cut_groups_anchor "Example"
12215 @ManageTransactions("GroupOp")
12216 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12218 Cut of lists of groups.
12219 New group is created. It will contain only entities
12220 which are present in groups listed in theGList1 but
12221 are not present in groups from theGList2.
12224 theGList1 is a list of GEOM groups to include elements of.
12225 theGList2 is a list of GEOM groups to exclude elements of.
12226 theName Object name; when specified, this parameter is used
12227 for result publication in the study. Otherwise, if automatic
12228 publication is switched on, default value is used for result name.
12231 a newly created GEOM group.
12233 # Example: see GEOM_TestOthers.py
12234 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12235 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12236 self._autoPublish(aGroup, theName, "group")
12239 ## Returns a list of sub-objects ID stored in the group
12240 # @param theGroup is a GEOM group for which a list of IDs is requested
12242 # @ref swig_GetObjectIDs "Example"
12243 @ManageTransactions("GroupOp")
12244 def GetObjectIDs(self,theGroup):
12246 Returns a list of sub-objects ID stored in the group
12249 theGroup is a GEOM group for which a list of IDs is requested
12251 # Example: see GEOM_TestOthers.py
12252 ListIDs = self.GroupOp.GetObjects(theGroup)
12253 RaiseIfFailed("GetObjects", self.GroupOp)
12256 ## Returns a type of sub-objects stored in the group
12257 # @param theGroup is a GEOM group which type is returned.
12259 # @ref swig_GetType "Example"
12260 @ManageTransactions("GroupOp")
12261 def GetType(self,theGroup):
12263 Returns a type of sub-objects stored in the group
12266 theGroup is a GEOM group which type is returned.
12268 # Example: see GEOM_TestOthers.py
12269 aType = self.GroupOp.GetType(theGroup)
12270 RaiseIfFailed("GetType", self.GroupOp)
12273 ## Convert a type of geom object from id to string value
12274 # @param theId is a GEOM obect type id.
12275 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12276 # @ref swig_GetType "Example"
12277 def ShapeIdToType(self, theId):
12279 Convert a type of geom object from id to string value
12282 theId is a GEOM obect type id.
12285 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12312 return "REVOLUTION"
12360 return "FREE_BOUNDS"
12368 return "THRUSECTIONS"
12370 return "COMPOUNDFILTER"
12372 return "SHAPES_ON_SHAPE"
12374 return "ELLIPSE_ARC"
12376 return "3DSKETCHER"
12382 return "PIPETSHAPE"
12383 return "Shape Id not exist."
12385 ## Returns a main shape associated with the group
12386 # @param theGroup is a GEOM group for which a main shape object is requested
12387 # @return a GEOM object which is a main shape for theGroup
12389 # @ref swig_GetMainShape "Example"
12390 @ManageTransactions("GroupOp")
12391 def GetMainShape(self,theGroup):
12393 Returns a main shape associated with the group
12396 theGroup is a GEOM group for which a main shape object is requested
12399 a GEOM object which is a main shape for theGroup
12401 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12403 # Example: see GEOM_TestOthers.py
12404 anObj = self.GroupOp.GetMainShape(theGroup)
12405 RaiseIfFailed("GetMainShape", self.GroupOp)
12408 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12409 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12410 # @param theShape given shape (see GEOM.GEOM_Object)
12411 # @param min_length minimum length of edges of theShape
12412 # @param max_length maximum length of edges of theShape
12413 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12414 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12415 # @param theName Object name; when specified, this parameter is used
12416 # for result publication in the study. Otherwise, if automatic
12417 # publication is switched on, default value is used for result name.
12419 # @return a newly created GEOM group of edges
12421 # @@ref swig_todo "Example"
12422 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12424 Create group of edges of theShape, whose length is in range [min_length, max_length].
12425 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12428 theShape given shape
12429 min_length minimum length of edges of theShape
12430 max_length maximum length of edges of theShape
12431 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12432 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12433 theName Object name; when specified, this parameter is used
12434 for result publication in the study. Otherwise, if automatic
12435 publication is switched on, default value is used for result name.
12438 a newly created GEOM group of edges.
12440 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12441 edges_in_range = []
12443 Props = self.BasicProperties(edge)
12444 if min_length <= Props[0] and Props[0] <= max_length:
12445 if (not include_min) and (min_length == Props[0]):
12448 if (not include_max) and (Props[0] == max_length):
12451 edges_in_range.append(edge)
12453 if len(edges_in_range) <= 0:
12454 print "No edges found by given criteria"
12457 # note: auto-publishing is done in self.CreateGroup()
12458 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12459 self.UnionList(group_edges, edges_in_range)
12463 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12464 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12465 # @param min_length minimum length of edges of selected shape
12466 # @param max_length maximum length of edges of selected shape
12467 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12468 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12469 # @return a newly created GEOM group of edges
12470 # @ref swig_todo "Example"
12471 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12473 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12474 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12477 min_length minimum length of edges of selected shape
12478 max_length maximum length of edges of selected shape
12479 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12480 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12483 a newly created GEOM group of edges.
12485 nb_selected = sg.SelectedCount()
12486 if nb_selected < 1:
12487 print "Select a shape before calling this function, please."
12489 if nb_selected > 1:
12490 print "Only one shape must be selected"
12493 id_shape = sg.getSelected(0)
12494 shape = IDToObject( id_shape )
12496 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12500 if include_min: left_str = " <= "
12501 if include_max: right_str = " <= "
12503 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12504 + left_str + "length" + right_str + `max_length`)
12506 sg.updateObjBrowser(1)
12513 #@@ insert new functions before this line @@ do not remove this line @@#
12515 ## Create a copy of the given object
12517 # @param theOriginal geometry object for copy
12518 # @param theName Object name; when specified, this parameter is used
12519 # for result publication in the study. Otherwise, if automatic
12520 # publication is switched on, default value is used for result name.
12522 # @return New GEOM_Object, containing the copied shape.
12524 # @ingroup l1_geomBuilder_auxiliary
12525 # @ref swig_MakeCopy "Example"
12526 @ManageTransactions("InsertOp")
12527 def MakeCopy(self, theOriginal, theName=None):
12529 Create a copy of the given object
12532 theOriginal geometry object for copy
12533 theName Object name; when specified, this parameter is used
12534 for result publication in the study. Otherwise, if automatic
12535 publication is switched on, default value is used for result name.
12538 New GEOM_Object, containing the copied shape.
12540 Example of usage: Copy = geompy.MakeCopy(Box)
12542 # Example: see GEOM_TestAll.py
12543 anObj = self.InsertOp.MakeCopy(theOriginal)
12544 RaiseIfFailed("MakeCopy", self.InsertOp)
12545 self._autoPublish(anObj, theName, "copy")
12548 ## Add Path to load python scripts from
12549 # @param Path a path to load python scripts from
12550 # @ingroup l1_geomBuilder_auxiliary
12551 def addPath(self,Path):
12553 Add Path to load python scripts from
12556 Path a path to load python scripts from
12558 if (sys.path.count(Path) < 1):
12559 sys.path.append(Path)
12563 ## Load marker texture from the file
12564 # @param Path a path to the texture file
12565 # @return unique texture identifier
12566 # @ingroup l1_geomBuilder_auxiliary
12567 @ManageTransactions("InsertOp")
12568 def LoadTexture(self, Path):
12570 Load marker texture from the file
12573 Path a path to the texture file
12576 unique texture identifier
12578 # Example: see GEOM_TestAll.py
12579 ID = self.InsertOp.LoadTexture(Path)
12580 RaiseIfFailed("LoadTexture", self.InsertOp)
12583 ## Get internal name of the object based on its study entry
12584 # @note This method does not provide an unique identifier of the geometry object.
12585 # @note This is internal function of GEOM component, though it can be used outside it for
12586 # appropriate reason (e.g. for identification of geometry object).
12587 # @param obj geometry object
12588 # @return unique object identifier
12589 # @ingroup l1_geomBuilder_auxiliary
12590 def getObjectID(self, obj):
12592 Get internal name of the object based on its study entry.
12593 Note: this method does not provide an unique identifier of the geometry object.
12594 It is an internal function of GEOM component, though it can be used outside GEOM for
12595 appropriate reason (e.g. for identification of geometry object).
12598 obj geometry object
12601 unique object identifier
12604 entry = salome.ObjectToID(obj)
12605 if entry is not None:
12606 lst = entry.split(":")
12608 ID = lst[-1] # -1 means last item in the list
12609 return "GEOM_" + ID
12614 ## Add marker texture. @a Width and @a Height parameters
12615 # specify width and height of the texture in pixels.
12616 # If @a RowData is @c True, @a Texture parameter should represent texture data
12617 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12618 # parameter should be unpacked string, in which '1' symbols represent opaque
12619 # pixels and '0' represent transparent pixels of the texture bitmap.
12621 # @param Width texture width in pixels
12622 # @param Height texture height in pixels
12623 # @param Texture texture data
12624 # @param RowData if @c True, @a Texture data are packed in the byte stream
12625 # @return unique texture identifier
12626 # @ingroup l1_geomBuilder_auxiliary
12627 @ManageTransactions("InsertOp")
12628 def AddTexture(self, Width, Height, Texture, RowData=False):
12630 Add marker texture. Width and Height parameters
12631 specify width and height of the texture in pixels.
12632 If RowData is True, Texture parameter should represent texture data
12633 packed into the byte array. If RowData is False (default), Texture
12634 parameter should be unpacked string, in which '1' symbols represent opaque
12635 pixels and '0' represent transparent pixels of the texture bitmap.
12638 Width texture width in pixels
12639 Height texture height in pixels
12640 Texture texture data
12641 RowData if True, Texture data are packed in the byte stream
12644 return unique texture identifier
12646 if not RowData: Texture = PackData(Texture)
12647 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12648 RaiseIfFailed("AddTexture", self.InsertOp)
12651 ## Creates a new folder object. It is a container for any GEOM objects.
12652 # @param Name name of the container
12653 # @param Father parent object. If None,
12654 # folder under 'Geometry' root object will be created.
12655 # @return a new created folder
12656 # @ingroup l1_publish_data
12657 def NewFolder(self, Name, Father=None):
12659 Create a new folder object. It is an auxiliary container for any GEOM objects.
12662 Name name of the container
12663 Father parent object. If None,
12664 folder under 'Geometry' root object will be created.
12667 a new created folder
12669 if not Father: Father = self.father
12670 return self.CreateFolder(Name, Father)
12672 ## Move object to the specified folder
12673 # @param Object object to move
12674 # @param Folder target folder
12675 # @ingroup l1_publish_data
12676 def PutToFolder(self, Object, Folder):
12678 Move object to the specified folder
12681 Object object to move
12682 Folder target folder
12684 self.MoveToFolder(Object, Folder)
12687 ## Move list of objects to the specified folder
12688 # @param ListOfSO list of objects to move
12689 # @param Folder target folder
12690 # @ingroup l1_publish_data
12691 def PutListToFolder(self, ListOfSO, Folder):
12693 Move list of objects to the specified folder
12696 ListOfSO list of objects to move
12697 Folder target folder
12699 self.MoveListToFolder(ListOfSO, Folder)
12702 ## @addtogroup l2_field
12706 # @param shape the shape the field lies on
12707 # @param name the field name
12708 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12709 # @param dimension dimension of the shape the field lies on
12710 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12711 # @param componentNames names of components
12712 # @return a created field
12713 @ManageTransactions("FieldOp")
12714 def CreateField(self, shape, name, type, dimension, componentNames):
12719 shape the shape the field lies on
12720 name the field name
12721 type type of field data
12722 dimension dimension of the shape the field lies on
12723 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12724 componentNames names of components
12729 if isinstance( type, int ):
12730 if type < 0 or type > 3:
12731 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12732 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12734 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12735 RaiseIfFailed("CreateField", self.FieldOp)
12737 geom._autoPublish( f, "", name)
12740 ## Removes a field from the GEOM component
12741 # @param field the field to remove
12742 def RemoveField(self, field):
12743 "Removes a field from the GEOM component"
12745 if isinstance( field, GEOM._objref_GEOM_Field ):
12746 geom.RemoveObject( field )
12747 elif isinstance( field, geomField ):
12748 geom.RemoveObject( field.field )
12750 raise RuntimeError, "RemoveField() : the object is not a field"
12753 ## Returns number of fields on a shape
12754 @ManageTransactions("FieldOp")
12755 def CountFields(self, shape):
12756 "Returns number of fields on a shape"
12757 nb = self.FieldOp.CountFields( shape )
12758 RaiseIfFailed("CountFields", self.FieldOp)
12761 ## Returns all fields on a shape
12762 @ManageTransactions("FieldOp")
12763 def GetFields(self, shape):
12764 "Returns all fields on a shape"
12765 ff = self.FieldOp.GetFields( shape )
12766 RaiseIfFailed("GetFields", self.FieldOp)
12769 ## Returns a field on a shape by its name
12770 @ManageTransactions("FieldOp")
12771 def GetField(self, shape, name):
12772 "Returns a field on a shape by its name"
12773 f = self.FieldOp.GetField( shape, name )
12774 RaiseIfFailed("GetField", self.FieldOp)
12782 # Register the new proxy for GEOM_Gen
12783 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12786 ## Field on Geometry
12787 # @ingroup l2_field
12788 class geomField( GEOM._objref_GEOM_Field ):
12790 def __init__(self):
12791 GEOM._objref_GEOM_Field.__init__(self)
12792 self.field = GEOM._objref_GEOM_Field
12795 ## Returns the shape the field lies on
12796 def getShape(self):
12797 "Returns the shape the field lies on"
12798 return self.field.GetShape(self)
12800 ## Returns the field name
12802 "Returns the field name"
12803 return self.field.GetName(self)
12805 ## Returns type of field data as integer [0-3]
12807 "Returns type of field data"
12808 return self.field.GetDataType(self)._v
12810 ## Returns type of field data:
12811 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12812 def getTypeEnum(self):
12813 "Returns type of field data"
12814 return self.field.GetDataType(self)
12816 ## Returns dimension of the shape the field lies on:
12817 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12818 def getDimension(self):
12819 """Returns dimension of the shape the field lies on:
12820 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12821 return self.field.GetDimension(self)
12823 ## Returns names of components
12824 def getComponents(self):
12825 "Returns names of components"
12826 return self.field.GetComponents(self)
12828 ## Adds a time step to the field
12829 # @param step the time step number further used as the step identifier
12830 # @param stamp the time step time
12831 # @param values the values of the time step
12832 def addStep(self, step, stamp, values):
12833 "Adds a time step to the field"
12834 stp = self.field.AddStep( self, step, stamp )
12836 raise RuntimeError, \
12837 "Field.addStep() : Error: step %s already exists in this field"%step
12839 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12840 self.setValues( step, values )
12843 ## Remove a time step from the field
12844 def removeStep(self,step):
12845 "Remove a time step from the field"
12848 stepObj = self.field.GetStep( self, step )
12850 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12853 #traceback.print_exc()
12855 self.field.RemoveStep( self, step )
12857 geom.myBuilder.RemoveObjectWithChildren( stepSO )
12860 ## Returns number of time steps in the field
12861 def countSteps(self):
12862 "Returns number of time steps in the field"
12863 return self.field.CountSteps(self)
12865 ## Returns a list of time step IDs in the field
12866 def getSteps(self):
12867 "Returns a list of time step IDs in the field"
12868 return self.field.GetSteps(self)
12870 ## Returns a time step by its ID
12871 def getStep(self,step):
12872 "Returns a time step by its ID"
12873 stp = self.field.GetStep(self, step)
12875 raise RuntimeError, "Step %s is missing from this field"%step
12878 ## Returns the time of the field step
12879 def getStamp(self,step):
12880 "Returns the time of the field step"
12881 return self.getStep(step).GetStamp()
12883 ## Changes the time of the field step
12884 def setStamp(self, step, stamp):
12885 "Changes the time of the field step"
12886 return self.getStep(step).SetStamp(stamp)
12888 ## Returns values of the field step
12889 def getValues(self, step):
12890 "Returns values of the field step"
12891 return self.getStep(step).GetValues()
12893 ## Changes values of the field step
12894 def setValues(self, step, values):
12895 "Changes values of the field step"
12896 stp = self.getStep(step)
12897 errBeg = "Field.setValues(values) : Error: "
12899 ok = stp.SetValues( values )
12900 except Exception, e:
12902 if excStr.find("WrongPythonType") > 0:
12903 raise RuntimeError, errBeg +\
12904 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12905 raise RuntimeError, errBeg + str(e)
12907 nbOK = self.field.GetArraySize(self)
12910 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12912 raise RuntimeError, errBeg + "failed"
12915 pass # end of class geomField
12917 # Register the new proxy for GEOM_Field
12918 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12921 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12922 # interface to GEOM operations.
12927 # salome.salome_init()
12928 # from salome.geom import geomBuilder
12929 # geompy = geomBuilder.New(salome.myStudy)
12931 # @param study SALOME study, generally obtained by salome.myStudy.
12932 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12933 # @return geomBuilder instance
12934 def New( study, instance=None):
12936 Create a new geomBuilder instance.The geomBuilder class provides the Python
12937 interface to GEOM operations.
12941 salome.salome_init()
12942 from salome.geom import geomBuilder
12943 geompy = geomBuilder.New(salome.myStudy)
12946 study SALOME study, generally obtained by salome.myStudy.
12947 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12949 geomBuilder instance
12951 #print "New geomBuilder ", study, instance
12958 geom = geomBuilder()
12959 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12960 geom.init_geom(study)
12964 # Register methods from the plug-ins in the geomBuilder class
12965 plugins_var = os.environ.get( "GEOM_PluginsList" )
12968 if plugins_var is not None:
12969 plugins = plugins_var.split( ":" )
12970 plugins=filter(lambda x: len(x)>0, plugins)
12971 if plugins is not None:
12972 for pluginName in plugins:
12973 pluginBuilderName = pluginName + "Builder"
12975 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12976 except Exception, e:
12977 from salome_utils import verbose
12978 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12980 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12981 plugin = eval( pluginBuilderName )
12983 # add methods from plugin module to the geomBuilder class
12984 for k in dir( plugin ):
12985 if k[0] == '_': continue
12986 method = getattr( plugin, k )
12987 if type( method ).__name__ == 'function':
12988 if not hasattr( geomBuilder, k ):
12989 setattr( geomBuilder, k, method )