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 ## Information about closed/unclosed state of shell or wire
521 # @ingroup l1_geomBuilder_auxiliary
524 Information about closed/unclosed state of shell or wire
530 ## Private class used to bind calls of plugin operations to geomBuilder
531 class PluginOperation:
532 def __init__(self, operation, function):
533 self.operation = operation
534 self.function = function
537 @ManageTransactions("operation")
538 def __call__(self, *args):
539 res = self.function(self.operation, *args)
540 RaiseIfFailed(self.function.__name__, self.operation)
543 # Warning: geom is a singleton
549 class geomBuilder(object, GEOM._objref_GEOM_Gen):
551 ## Enumeration ShapeType as a dictionary. \n
552 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
553 # @ingroup l1_geomBuilder_auxiliary
554 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
556 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
557 # and a list of parameters, describing the shape.
558 # List of parameters, describing the shape:
559 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
560 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
562 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
564 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
566 # - SPHERE: [xc yc zc R]
567 # - CYLINDER: [xb yb zb dx dy dz R H]
568 # - BOX: [xc yc zc ax ay az]
569 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
570 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
571 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
572 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
573 # - SOLID: [nb_faces nb_edges nb_vertices]
575 # - SPHERE2D: [xc yc zc R]
576 # - CYLINDER2D: [xb yb zb dx dy dz R H]
577 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
578 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
579 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
580 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
581 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
582 # - PLANE: [xo yo zo dx dy dz]
583 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
584 # - FACE: [nb_edges nb_vertices]
586 # - CIRCLE: [xc yc zc dx dy dz R]
587 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
588 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
589 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
590 # - LINE: [xo yo zo dx dy dz]
591 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
592 # - EDGE: [nb_vertices]
595 # @ingroup l1_geomBuilder_auxiliary
596 kind = GEOM.GEOM_IKindOfShape
603 #print "==== __new__ ", engine, geom, doLcc, created
605 # geom engine is either retrieved from engine, or created
607 # Following test avoids a recursive loop
610 # geom engine not created: existing engine found
612 if doLcc and not created:
614 # FindOrLoadComponent called:
615 # 1. CORBA resolution of server
616 # 2. the __new__ method is called again
617 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
618 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
621 # FindOrLoadComponent not called
623 # geomBuilder instance is created from lcc.FindOrLoadComponent
624 #print "==== super ", engine, geom, doLcc, created
625 geom = super(geomBuilder,cls).__new__(cls)
628 # geom engine not created: existing engine found
629 #print "==== existing ", engine, geom, doLcc, created
631 #print "return geom 1 ", geom
634 #print "return geom 2 ", geom
639 #print "-------- geomBuilder __init__ --- ", created, self
642 GEOM._objref_GEOM_Gen.__init__(self)
643 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
644 self.myBuilder = None
663 ## Process object publication in the study, as follows:
664 # - if @a theName is specified (not None), the object is published in the study
665 # with this name, not taking into account "auto-publishing" option;
666 # - if @a theName is NOT specified, the object is published in the study
667 # (using default name, which can be customized using @a theDefaultName parameter)
668 # only if auto-publishing is switched on.
670 # @param theObj object, a subject for publishing
671 # @param theName object name for study
672 # @param theDefaultName default name for the auto-publishing
674 # @sa addToStudyAuto()
675 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
677 def _item_name(_names, _defname, _idx=-1):
678 if not _names: _names = _defname
679 if type(_names) in [types.ListType, types.TupleType]:
681 if _idx >= len(_names) or not _names[_idx]:
682 if type(_defname) not in [types.ListType, types.TupleType]:
683 _name = "%s_%d"%(_defname, _idx+1)
684 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
685 _name = _defname[_idx]
687 _name = "%noname_%d"%(dn, _idx+1)
693 # must be wrong usage
698 _name = "%s_%d"%(_names, _idx+1)
704 def _publish( _name, _obj ):
706 if isinstance( _obj, GEOM._objref_GEOM_Field ):
707 fatherObj = _obj.GetShape()
708 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
709 fatherObj = _obj.GetField()
710 elif not _obj.IsMainShape():
711 fatherObj = _obj.GetMainShape()
713 if fatherObj and fatherObj.GetStudyEntry():
714 self.addToStudyInFather(fatherObj, _obj, _name)
716 self.addToStudy(_obj, _name)
722 if not theName and not self.myMaxNbSubShapesAllowed:
723 return # nothing to do: auto-publishing is disabled
724 if not theName and not theDefaultName:
725 return # neither theName nor theDefaultName is given
727 if type(theObj) in [types.ListType, types.TupleType]:
728 # list of objects is being published
731 if not obj: continue # bad object
732 name = _item_name(theName, theDefaultName, idx)
733 _publish( name, obj )
735 if not theName and idx == self.myMaxNbSubShapesAllowed: break
739 # single object is published
740 name = _item_name(theName, theDefaultName)
741 _publish( name, theObj )
744 ## @addtogroup l1_geomBuilder_auxiliary
746 def init_geom(self,theStudy):
747 self.myStudy = theStudy
748 self.myStudyId = self.myStudy._get_StudyId()
749 self.myBuilder = self.myStudy.NewBuilder()
750 self.father = self.myStudy.FindComponent("GEOM")
751 notebook.myStudy = theStudy
752 if self.father is None:
753 self.father = self.myBuilder.NewComponent("GEOM")
754 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
755 FName = A1._narrow(SALOMEDS.AttributeName)
756 FName.SetValue("Geometry")
757 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
758 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
759 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
760 self.myBuilder.DefineComponentInstance(self.father,self)
762 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
763 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
764 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
765 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
766 self.HealOp = self.GetIHealingOperations (self.myStudyId)
767 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
768 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
769 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
770 self.LocalOp = self.GetILocalOperations (self.myStudyId)
771 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
772 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
773 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
774 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
776 # set GEOM as root in the use case tree
777 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
778 self.myUseCaseBuilder.SetRootCurrent()
779 self.myUseCaseBuilder.Append(self.father)
782 def GetPluginOperations(self, studyID, libraryName):
783 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
786 ## Enable / disable results auto-publishing
788 # The automatic publishing is managed in the following way:
789 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
790 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
791 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
792 # value passed as parameter has the same effect.
793 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
794 # maximum number of sub-shapes allowed for publishing is set to specified value.
796 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
797 # @ingroup l1_publish_data
798 def addToStudyAuto(self, maxNbSubShapes=-1):
800 Enable / disable results auto-publishing
802 The automatic publishing is managed in the following way:
803 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
804 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
805 maximum number of sub-shapes allowed for publishing is unlimited; any negative
806 value passed as parameter has the same effect.
807 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
808 maximum number of sub-shapes allowed for publishing is set to this value.
811 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
814 geompy.addToStudyAuto() # enable auto-publishing
815 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
816 geompy.addToStudyAuto(0) # disable auto-publishing
818 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
821 ## Dump component to the Python script
822 # This method overrides IDL function to allow default values for the parameters.
823 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
825 Dump component to the Python script
826 This method overrides IDL function to allow default values for the parameters.
828 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
830 ## Get name for sub-shape aSubObj of shape aMainObj
832 # @ref swig_SubShapeName "Example"
833 @ManageTransactions("ShapesOp")
834 def SubShapeName(self,aSubObj, aMainObj):
836 Get name for sub-shape aSubObj of shape aMainObj
838 # Example: see GEOM_TestAll.py
840 #aSubId = orb.object_to_string(aSubObj)
841 #aMainId = orb.object_to_string(aMainObj)
842 #index = gg.getIndexTopology(aSubId, aMainId)
843 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
844 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
845 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
848 ## Publish in study aShape with name aName
850 # \param aShape the shape to be published
851 # \param aName the name for the shape
852 # \param doRestoreSubShapes if True, finds and publishes also
853 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
854 # and published sub-shapes of arguments
855 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
856 # these arguments description
857 # \return study entry of the published shape in form of string
859 # @ingroup l1_publish_data
860 # @ref swig_all_addtostudy "Example"
861 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
862 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
864 Publish in study aShape with name aName
867 aShape the shape to be published
868 aName the name for the shape
869 doRestoreSubShapes if True, finds and publishes also
870 sub-shapes of aShape, corresponding to its arguments
871 and published sub-shapes of arguments
872 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
873 these arguments description
876 study entry of the published shape in form of string
879 id_block1 = geompy.addToStudy(Block1, "Block 1")
881 # Example: see GEOM_TestAll.py
883 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
884 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
885 if doRestoreSubShapes:
886 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
887 theFindMethod, theInheritFirstArg, True )
889 print "addToStudy() failed"
891 return aShape.GetStudyEntry()
893 ## Publish in study aShape with name aName as sub-object of previously published aFather
894 # \param aFather previously published object
895 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
896 # \param aName the name for the shape
898 # \return study entry of the published shape in form of string
900 # @ingroup l1_publish_data
901 # @ref swig_all_addtostudyInFather "Example"
902 def addToStudyInFather(self, aFather, aShape, aName):
904 Publish in study aShape with name aName as sub-object of previously published aFather
907 aFather previously published object
908 aShape the shape to be published as sub-object of aFather
909 aName the name for the shape
912 study entry of the published shape in form of string
914 # Example: see GEOM_TestAll.py
916 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
917 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
919 print "addToStudyInFather() failed"
921 return aShape.GetStudyEntry()
923 ## Unpublish object in study
925 # \param obj the object to be unpublished
926 def hideInStudy(self, obj):
928 Unpublish object in study
931 obj the object to be unpublished
933 ior = salome.orb.object_to_string(obj)
934 aSObject = self.myStudy.FindObjectIOR(ior)
935 if aSObject is not None:
936 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
937 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
938 drwAttribute.SetDrawable(False)
939 # hide references if any
940 vso = self.myStudy.FindDependances(aSObject);
942 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
943 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
944 drwAttribute.SetDrawable(False)
948 # end of l1_geomBuilder_auxiliary
951 ## @addtogroup l3_restore_ss
954 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
955 # To be used from python scripts out of addToStudy() (non-default usage)
956 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
957 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
958 # If this list is empty, all operation arguments will be published
959 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
960 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
961 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
962 # Do not publish sub-shapes in place of arguments, but only
963 # in place of sub-shapes of the first argument,
964 # because the whole shape corresponds to the first argument.
965 # Mainly to be used after transformations, but it also can be
966 # usefull after partition with one object shape, and some other
967 # operations, where only the first argument has to be considered.
968 # If theObject has only one argument shape, this flag is automatically
969 # considered as True, not regarding really passed value.
970 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
971 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
972 # \return list of published sub-shapes
974 # @ref tui_restore_prs_params "Example"
975 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
976 theInheritFirstArg=False, theAddPrefix=True):
978 Publish sub-shapes, standing for arguments and sub-shapes of arguments
979 To be used from python scripts out of geompy.addToStudy (non-default usage)
982 theObject published GEOM.GEOM_Object, arguments of which will be published
983 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
984 If this list is empty, all operation arguments will be published
985 theFindMethod method to search sub-shapes, corresponding to arguments and
986 their sub-shapes. Value from enumeration GEOM.find_shape_method.
987 theInheritFirstArg set properties of the first argument for theObject.
988 Do not publish sub-shapes in place of arguments, but only
989 in place of sub-shapes of the first argument,
990 because the whole shape corresponds to the first argument.
991 Mainly to be used after transformations, but it also can be
992 usefull after partition with one object shape, and some other
993 operations, where only the first argument has to be considered.
994 If theObject has only one argument shape, this flag is automatically
995 considered as True, not regarding really passed value.
996 theAddPrefix add prefix "from_" to names of restored sub-shapes,
997 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
999 list of published sub-shapes
1001 # Example: see GEOM_TestAll.py
1002 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1003 theFindMethod, theInheritFirstArg, theAddPrefix)
1005 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1006 # To be used from python scripts out of addToStudy() (non-default usage)
1007 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1008 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1009 # If this list is empty, all operation arguments will be published
1010 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1011 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1012 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1013 # Do not publish sub-shapes in place of arguments, but only
1014 # in place of sub-shapes of the first argument,
1015 # because the whole shape corresponds to the first argument.
1016 # Mainly to be used after transformations, but it also can be
1017 # usefull after partition with one object shape, and some other
1018 # operations, where only the first argument has to be considered.
1019 # If theObject has only one argument shape, this flag is automatically
1020 # considered as True, not regarding really passed value.
1021 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1022 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1023 # \return list of published sub-shapes
1025 # @ref tui_restore_prs_params "Example"
1026 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1027 theInheritFirstArg=False, theAddPrefix=True):
1029 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1030 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1033 theObject published GEOM.GEOM_Object, arguments of which will be published
1034 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1035 If this list is empty, all operation arguments will be published
1036 theFindMethod method to search sub-shapes, corresponding to arguments and
1037 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1038 theInheritFirstArg set properties of the first argument for theObject.
1039 Do not publish sub-shapes in place of arguments, but only
1040 in place of sub-shapes of the first argument,
1041 because the whole shape corresponds to the first argument.
1042 Mainly to be used after transformations, but it also can be
1043 usefull after partition with one object shape, and some other
1044 operations, where only the first argument has to be considered.
1045 If theObject has only one argument shape, this flag is automatically
1046 considered as True, not regarding really passed value.
1047 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1048 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1051 list of published sub-shapes
1053 # Example: see GEOM_TestAll.py
1054 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1055 theFindMethod, theInheritFirstArg, theAddPrefix)
1057 # end of l3_restore_ss
1060 ## @addtogroup l3_basic_go
1063 ## Create point by three coordinates.
1064 # @param theX The X coordinate of the point.
1065 # @param theY The Y coordinate of the point.
1066 # @param theZ The Z coordinate of the point.
1067 # @param theName Object name; when specified, this parameter is used
1068 # for result publication in the study. Otherwise, if automatic
1069 # publication is switched on, default value is used for result name.
1071 # @return New GEOM.GEOM_Object, containing the created point.
1073 # @ref tui_creation_point "Example"
1074 @ManageTransactions("BasicOp")
1075 def MakeVertex(self, theX, theY, theZ, theName=None):
1077 Create point by three coordinates.
1080 theX The X coordinate of the point.
1081 theY The Y coordinate of the point.
1082 theZ The Z coordinate of the point.
1083 theName Object name; when specified, this parameter is used
1084 for result publication in the study. Otherwise, if automatic
1085 publication is switched on, default value is used for result name.
1088 New GEOM.GEOM_Object, containing the created point.
1090 # Example: see GEOM_TestAll.py
1091 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1092 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1093 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1094 anObj.SetParameters(Parameters)
1095 self._autoPublish(anObj, theName, "vertex")
1098 ## Create a point, distant from the referenced point
1099 # on the given distances along the coordinate axes.
1100 # @param theReference The referenced point.
1101 # @param theX Displacement from the referenced point along OX axis.
1102 # @param theY Displacement from the referenced point along OY axis.
1103 # @param theZ Displacement from the referenced point along OZ axis.
1104 # @param theName Object name; when specified, this parameter is used
1105 # for result publication in the study. Otherwise, if automatic
1106 # publication is switched on, default value is used for result name.
1108 # @return New GEOM.GEOM_Object, containing the created point.
1110 # @ref tui_creation_point "Example"
1111 @ManageTransactions("BasicOp")
1112 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1114 Create a point, distant from the referenced point
1115 on the given distances along the coordinate axes.
1118 theReference The referenced point.
1119 theX Displacement from the referenced point along OX axis.
1120 theY Displacement from the referenced point along OY axis.
1121 theZ Displacement from the referenced point along OZ axis.
1122 theName Object name; when specified, this parameter is used
1123 for result publication in the study. Otherwise, if automatic
1124 publication is switched on, default value is used for result name.
1127 New GEOM.GEOM_Object, containing the created point.
1129 # Example: see GEOM_TestAll.py
1130 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1131 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1132 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1133 anObj.SetParameters(Parameters)
1134 self._autoPublish(anObj, theName, "vertex")
1137 ## Create a point, corresponding to the given parameter on the given curve.
1138 # @param theRefCurve The referenced curve.
1139 # @param theParameter Value of parameter on the referenced curve.
1140 # @param theName Object name; when specified, this parameter is used
1141 # for result publication in the study. Otherwise, if automatic
1142 # publication is switched on, default value is used for result name.
1144 # @return New GEOM.GEOM_Object, containing the created point.
1146 # @ref tui_creation_point "Example"
1147 @ManageTransactions("BasicOp")
1148 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1150 Create a point, corresponding to the given parameter on the given curve.
1153 theRefCurve The referenced curve.
1154 theParameter Value of parameter on the referenced curve.
1155 theName Object name; when specified, this parameter is used
1156 for result publication in the study. Otherwise, if automatic
1157 publication is switched on, default value is used for result name.
1160 New GEOM.GEOM_Object, containing the created point.
1163 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1165 # Example: see GEOM_TestAll.py
1166 theParameter, Parameters = ParseParameters(theParameter)
1167 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1168 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1169 anObj.SetParameters(Parameters)
1170 self._autoPublish(anObj, theName, "vertex")
1173 ## Create a point by projection give coordinates on the given curve
1174 # @param theRefCurve The referenced curve.
1175 # @param theX X-coordinate in 3D space
1176 # @param theY Y-coordinate in 3D space
1177 # @param theZ Z-coordinate in 3D space
1178 # @param theName Object name; when specified, this parameter is used
1179 # for result publication in the study. Otherwise, if automatic
1180 # publication is switched on, default value is used for result name.
1182 # @return New GEOM.GEOM_Object, containing the created point.
1184 # @ref tui_creation_point "Example"
1185 @ManageTransactions("BasicOp")
1186 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1188 Create a point by projection give coordinates on the given curve
1191 theRefCurve The referenced curve.
1192 theX X-coordinate in 3D space
1193 theY Y-coordinate in 3D space
1194 theZ Z-coordinate in 3D space
1195 theName Object name; when specified, this parameter is used
1196 for result publication in the study. Otherwise, if automatic
1197 publication is switched on, default value is used for result name.
1200 New GEOM.GEOM_Object, containing the created point.
1203 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1205 # Example: see GEOM_TestAll.py
1206 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1207 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1208 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1209 anObj.SetParameters(Parameters)
1210 self._autoPublish(anObj, theName, "vertex")
1213 ## Create a point, corresponding to the given length on the given curve.
1214 # @param theRefCurve The referenced curve.
1215 # @param theLength Length on the referenced curve. It can be negative.
1216 # @param theStartPoint Point allowing to choose the direction for the calculation
1217 # of the length. If None, start from the first point of theRefCurve.
1218 # @param theName Object name; when specified, this parameter is used
1219 # for result publication in the study. Otherwise, if automatic
1220 # publication is switched on, default value is used for result name.
1222 # @return New GEOM.GEOM_Object, containing the created point.
1224 # @ref tui_creation_point "Example"
1225 @ManageTransactions("BasicOp")
1226 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1228 Create a point, corresponding to the given length on the given curve.
1231 theRefCurve The referenced curve.
1232 theLength Length on the referenced curve. It can be negative.
1233 theStartPoint Point allowing to choose the direction for the calculation
1234 of the length. If None, start from the first point of theRefCurve.
1235 theName Object name; when specified, this parameter is used
1236 for result publication in the study. Otherwise, if automatic
1237 publication is switched on, default value is used for result name.
1240 New GEOM.GEOM_Object, containing the created point.
1242 # Example: see GEOM_TestAll.py
1243 theLength, Parameters = ParseParameters(theLength)
1244 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1245 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1246 anObj.SetParameters(Parameters)
1247 self._autoPublish(anObj, theName, "vertex")
1250 ## Create a point, corresponding to the given parameters on the
1252 # @param theRefSurf The referenced surface.
1253 # @param theUParameter Value of U-parameter on the referenced surface.
1254 # @param theVParameter Value of V-parameter on the referenced surface.
1255 # @param theName Object name; when specified, this parameter is used
1256 # for result publication in the study. Otherwise, if automatic
1257 # publication is switched on, default value is used for result name.
1259 # @return New GEOM.GEOM_Object, containing the created point.
1261 # @ref swig_MakeVertexOnSurface "Example"
1262 @ManageTransactions("BasicOp")
1263 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1265 Create a point, corresponding to the given parameters on the
1269 theRefSurf The referenced surface.
1270 theUParameter Value of U-parameter on the referenced surface.
1271 theVParameter Value of V-parameter on the referenced surface.
1272 theName Object name; when specified, this parameter is used
1273 for result publication in the study. Otherwise, if automatic
1274 publication is switched on, default value is used for result name.
1277 New GEOM.GEOM_Object, containing the created point.
1280 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1282 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1283 # Example: see GEOM_TestAll.py
1284 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1285 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1286 anObj.SetParameters(Parameters);
1287 self._autoPublish(anObj, theName, "vertex")
1290 ## Create a point by projection give coordinates on the given surface
1291 # @param theRefSurf The referenced surface.
1292 # @param theX X-coordinate in 3D space
1293 # @param theY Y-coordinate in 3D space
1294 # @param theZ Z-coordinate in 3D space
1295 # @param theName Object name; when specified, this parameter is used
1296 # for result publication in the study. Otherwise, if automatic
1297 # publication is switched on, default value is used for result name.
1299 # @return New GEOM.GEOM_Object, containing the created point.
1301 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1302 @ManageTransactions("BasicOp")
1303 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1305 Create a point by projection give coordinates on the given surface
1308 theRefSurf The referenced surface.
1309 theX X-coordinate in 3D space
1310 theY Y-coordinate in 3D space
1311 theZ Z-coordinate in 3D space
1312 theName Object name; when specified, this parameter is used
1313 for result publication in the study. Otherwise, if automatic
1314 publication is switched on, default value is used for result name.
1317 New GEOM.GEOM_Object, containing the created point.
1320 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1322 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1323 # Example: see GEOM_TestAll.py
1324 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1325 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1326 anObj.SetParameters(Parameters);
1327 self._autoPublish(anObj, theName, "vertex")
1330 ## Create a point, which lays on the given face.
1331 # The point will lay in arbitrary place of the face.
1332 # The only condition on it is a non-zero distance to the face boundary.
1333 # Such point can be used to uniquely identify the face inside any
1334 # shape in case, when the shape does not contain overlapped faces.
1335 # @param theFace The referenced face.
1336 # @param theName Object name; when specified, this parameter is used
1337 # for result publication in the study. Otherwise, if automatic
1338 # publication is switched on, default value is used for result name.
1340 # @return New GEOM.GEOM_Object, containing the created point.
1342 # @ref swig_MakeVertexInsideFace "Example"
1343 @ManageTransactions("BasicOp")
1344 def MakeVertexInsideFace (self, theFace, theName=None):
1346 Create a point, which lays on the given face.
1347 The point will lay in arbitrary place of the face.
1348 The only condition on it is a non-zero distance to the face boundary.
1349 Such point can be used to uniquely identify the face inside any
1350 shape in case, when the shape does not contain overlapped faces.
1353 theFace The referenced face.
1354 theName Object name; when specified, this parameter is used
1355 for result publication in the study. Otherwise, if automatic
1356 publication is switched on, default value is used for result name.
1359 New GEOM.GEOM_Object, containing the created point.
1362 p_on_face = geompy.MakeVertexInsideFace(Face)
1364 # Example: see GEOM_TestAll.py
1365 anObj = self.BasicOp.MakePointOnFace(theFace)
1366 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1367 self._autoPublish(anObj, theName, "vertex")
1370 ## Create a point on intersection of two lines.
1371 # @param theRefLine1, theRefLine2 The referenced lines.
1372 # @param theName Object name; when specified, this parameter is used
1373 # for result publication in the study. Otherwise, if automatic
1374 # publication is switched on, default value is used for result name.
1376 # @return New GEOM.GEOM_Object, containing the created point.
1378 # @ref swig_MakeVertexOnLinesIntersection "Example"
1379 @ManageTransactions("BasicOp")
1380 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1382 Create a point on intersection of two lines.
1385 theRefLine1, theRefLine2 The referenced lines.
1386 theName Object name; when specified, this parameter is used
1387 for result publication in the study. Otherwise, if automatic
1388 publication is switched on, default value is used for result name.
1391 New GEOM.GEOM_Object, containing the created point.
1393 # Example: see GEOM_TestAll.py
1394 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1395 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1396 self._autoPublish(anObj, theName, "vertex")
1399 ## Create a tangent, corresponding to the given parameter on the given curve.
1400 # @param theRefCurve The referenced curve.
1401 # @param theParameter Value of parameter on the referenced curve.
1402 # @param theName Object name; when specified, this parameter is used
1403 # for result publication in the study. Otherwise, if automatic
1404 # publication is switched on, default value is used for result name.
1406 # @return New GEOM.GEOM_Object, containing the created tangent.
1408 # @ref swig_MakeTangentOnCurve "Example"
1409 @ManageTransactions("BasicOp")
1410 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1412 Create a tangent, corresponding to the given parameter on the given curve.
1415 theRefCurve The referenced curve.
1416 theParameter Value of parameter on the referenced curve.
1417 theName Object name; when specified, this parameter is used
1418 for result publication in the study. Otherwise, if automatic
1419 publication is switched on, default value is used for result name.
1422 New GEOM.GEOM_Object, containing the created tangent.
1425 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1427 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1428 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1429 self._autoPublish(anObj, theName, "tangent")
1432 ## Create a tangent plane, corresponding to the given parameter on the given face.
1433 # @param theFace The face for which tangent plane should be built.
1434 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1435 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1436 # @param theTrimSize the size of plane.
1437 # @param theName Object name; when specified, this parameter is used
1438 # for result publication in the study. Otherwise, if automatic
1439 # publication is switched on, default value is used for result name.
1441 # @return New GEOM.GEOM_Object, containing the created tangent.
1443 # @ref swig_MakeTangentPlaneOnFace "Example"
1444 @ManageTransactions("BasicOp")
1445 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1447 Create a tangent plane, corresponding to the given parameter on the given face.
1450 theFace The face for which tangent plane should be built.
1451 theParameterV vertical value of the center point (0.0 - 1.0).
1452 theParameterU horisontal value of the center point (0.0 - 1.0).
1453 theTrimSize the size of plane.
1454 theName Object name; when specified, this parameter is used
1455 for result publication in the study. Otherwise, if automatic
1456 publication is switched on, default value is used for result name.
1459 New GEOM.GEOM_Object, containing the created tangent.
1462 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1464 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1465 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1466 self._autoPublish(anObj, theName, "tangent")
1469 ## Create a vector with the given components.
1470 # @param theDX X component of the vector.
1471 # @param theDY Y component of the vector.
1472 # @param theDZ Z component of the vector.
1473 # @param theName Object name; when specified, this parameter is used
1474 # for result publication in the study. Otherwise, if automatic
1475 # publication is switched on, default value is used for result name.
1477 # @return New GEOM.GEOM_Object, containing the created vector.
1479 # @ref tui_creation_vector "Example"
1480 @ManageTransactions("BasicOp")
1481 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1483 Create a vector with the given components.
1486 theDX X component of the vector.
1487 theDY Y component of the vector.
1488 theDZ Z component of the vector.
1489 theName Object name; when specified, this parameter is used
1490 for result publication in the study. Otherwise, if automatic
1491 publication is switched on, default value is used for result name.
1494 New GEOM.GEOM_Object, containing the created vector.
1496 # Example: see GEOM_TestAll.py
1497 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1498 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1499 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1500 anObj.SetParameters(Parameters)
1501 self._autoPublish(anObj, theName, "vector")
1504 ## Create a vector between two points.
1505 # @param thePnt1 Start point for the vector.
1506 # @param thePnt2 End point for the vector.
1507 # @param theName Object name; when specified, this parameter is used
1508 # for result publication in the study. Otherwise, if automatic
1509 # publication is switched on, default value is used for result name.
1511 # @return New GEOM.GEOM_Object, containing the created vector.
1513 # @ref tui_creation_vector "Example"
1514 @ManageTransactions("BasicOp")
1515 def MakeVector(self, thePnt1, thePnt2, theName=None):
1517 Create a vector between two points.
1520 thePnt1 Start point for the vector.
1521 thePnt2 End point for the vector.
1522 theName Object name; when specified, this parameter is used
1523 for result publication in the study. Otherwise, if automatic
1524 publication is switched on, default value is used for result name.
1527 New GEOM.GEOM_Object, containing the created vector.
1529 # Example: see GEOM_TestAll.py
1530 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1531 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1532 self._autoPublish(anObj, theName, "vector")
1535 ## Create a line, passing through the given point
1536 # and parrallel to the given direction
1537 # @param thePnt Point. The resulting line will pass through it.
1538 # @param theDir Direction. The resulting line will be parallel to it.
1539 # @param theName Object name; when specified, this parameter is used
1540 # for result publication in the study. Otherwise, if automatic
1541 # publication is switched on, default value is used for result name.
1543 # @return New GEOM.GEOM_Object, containing the created line.
1545 # @ref tui_creation_line "Example"
1546 @ManageTransactions("BasicOp")
1547 def MakeLine(self, thePnt, theDir, theName=None):
1549 Create a line, passing through the given point
1550 and parrallel to the given direction
1553 thePnt Point. The resulting line will pass through it.
1554 theDir Direction. The resulting line will be parallel to it.
1555 theName Object name; when specified, this parameter is used
1556 for result publication in the study. Otherwise, if automatic
1557 publication is switched on, default value is used for result name.
1560 New GEOM.GEOM_Object, containing the created line.
1562 # Example: see GEOM_TestAll.py
1563 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1564 RaiseIfFailed("MakeLine", self.BasicOp)
1565 self._autoPublish(anObj, theName, "line")
1568 ## Create a line, passing through the given points
1569 # @param thePnt1 First of two points, defining the line.
1570 # @param thePnt2 Second of two points, defining the line.
1571 # @param theName Object name; when specified, this parameter is used
1572 # for result publication in the study. Otherwise, if automatic
1573 # publication is switched on, default value is used for result name.
1575 # @return New GEOM.GEOM_Object, containing the created line.
1577 # @ref tui_creation_line "Example"
1578 @ManageTransactions("BasicOp")
1579 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1581 Create a line, passing through the given points
1584 thePnt1 First of two points, defining the line.
1585 thePnt2 Second of two points, defining the line.
1586 theName Object name; when specified, this parameter is used
1587 for result publication in the study. Otherwise, if automatic
1588 publication is switched on, default value is used for result name.
1591 New GEOM.GEOM_Object, containing the created line.
1593 # Example: see GEOM_TestAll.py
1594 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1595 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1596 self._autoPublish(anObj, theName, "line")
1599 ## Create a line on two faces intersection.
1600 # @param theFace1 First of two faces, defining the line.
1601 # @param theFace2 Second of two faces, defining the line.
1602 # @param theName Object name; when specified, this parameter is used
1603 # for result publication in the study. Otherwise, if automatic
1604 # publication is switched on, default value is used for result name.
1606 # @return New GEOM.GEOM_Object, containing the created line.
1608 # @ref swig_MakeLineTwoFaces "Example"
1609 @ManageTransactions("BasicOp")
1610 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1612 Create a line on two faces intersection.
1615 theFace1 First of two faces, defining the line.
1616 theFace2 Second of two faces, defining the line.
1617 theName Object name; when specified, this parameter is used
1618 for result publication in the study. Otherwise, if automatic
1619 publication is switched on, default value is used for result name.
1622 New GEOM.GEOM_Object, containing the created line.
1624 # Example: see GEOM_TestAll.py
1625 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1626 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1627 self._autoPublish(anObj, theName, "line")
1630 ## Create a plane, passing through the given point
1631 # and normal to the given vector.
1632 # @param thePnt Point, the plane has to pass through.
1633 # @param theVec Vector, defining the plane normal direction.
1634 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1635 # @param theName Object name; when specified, this parameter is used
1636 # for result publication in the study. Otherwise, if automatic
1637 # publication is switched on, default value is used for result name.
1639 # @return New GEOM.GEOM_Object, containing the created plane.
1641 # @ref tui_creation_plane "Example"
1642 @ManageTransactions("BasicOp")
1643 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1645 Create a plane, passing through the given point
1646 and normal to the given vector.
1649 thePnt Point, the plane has to pass through.
1650 theVec Vector, defining the plane normal direction.
1651 theTrimSize Half size of a side of quadrangle face, representing the plane.
1652 theName Object name; when specified, this parameter is used
1653 for result publication in the study. Otherwise, if automatic
1654 publication is switched on, default value is used for result name.
1657 New GEOM.GEOM_Object, containing the created plane.
1659 # Example: see GEOM_TestAll.py
1660 theTrimSize, Parameters = ParseParameters(theTrimSize);
1661 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1662 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1663 anObj.SetParameters(Parameters)
1664 self._autoPublish(anObj, theName, "plane")
1667 ## Create a plane, passing through the three given points
1668 # @param thePnt1 First of three points, defining the plane.
1669 # @param thePnt2 Second of three points, defining the plane.
1670 # @param thePnt3 Fird of three points, defining the plane.
1671 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1672 # @param theName Object name; when specified, this parameter is used
1673 # for result publication in the study. Otherwise, if automatic
1674 # publication is switched on, default value is used for result name.
1676 # @return New GEOM.GEOM_Object, containing the created plane.
1678 # @ref tui_creation_plane "Example"
1679 @ManageTransactions("BasicOp")
1680 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1682 Create a plane, passing through the three given points
1685 thePnt1 First of three points, defining the plane.
1686 thePnt2 Second of three points, defining the plane.
1687 thePnt3 Fird of three points, defining the plane.
1688 theTrimSize Half size of a side of quadrangle face, representing the plane.
1689 theName Object name; when specified, this parameter is used
1690 for result publication in the study. Otherwise, if automatic
1691 publication is switched on, default value is used for result name.
1694 New GEOM.GEOM_Object, containing the created plane.
1696 # Example: see GEOM_TestAll.py
1697 theTrimSize, Parameters = ParseParameters(theTrimSize);
1698 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1699 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1700 anObj.SetParameters(Parameters)
1701 self._autoPublish(anObj, theName, "plane")
1704 ## Create a plane, similar to the existing one, but with another size of representing face.
1705 # @param theFace Referenced plane or LCS(Marker).
1706 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1707 # @param theName Object name; when specified, this parameter is used
1708 # for result publication in the study. Otherwise, if automatic
1709 # publication is switched on, default value is used for result name.
1711 # @return New GEOM.GEOM_Object, containing the created plane.
1713 # @ref tui_creation_plane "Example"
1714 @ManageTransactions("BasicOp")
1715 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1717 Create a plane, similar to the existing one, but with another size of representing face.
1720 theFace Referenced plane or LCS(Marker).
1721 theTrimSize New half size of a side of quadrangle face, representing the plane.
1722 theName Object name; when specified, this parameter is used
1723 for result publication in the study. Otherwise, if automatic
1724 publication is switched on, default value is used for result name.
1727 New GEOM.GEOM_Object, containing the created plane.
1729 # Example: see GEOM_TestAll.py
1730 theTrimSize, Parameters = ParseParameters(theTrimSize);
1731 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1732 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1733 anObj.SetParameters(Parameters)
1734 self._autoPublish(anObj, theName, "plane")
1737 ## Create a plane, passing through the 2 vectors
1738 # with center in a start point of the first vector.
1739 # @param theVec1 Vector, defining center point and plane direction.
1740 # @param theVec2 Vector, defining the plane normal direction.
1741 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1742 # @param theName Object name; when specified, this parameter is used
1743 # for result publication in the study. Otherwise, if automatic
1744 # publication is switched on, default value is used for result name.
1746 # @return New GEOM.GEOM_Object, containing the created plane.
1748 # @ref tui_creation_plane "Example"
1749 @ManageTransactions("BasicOp")
1750 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1752 Create a plane, passing through the 2 vectors
1753 with center in a start point of the first vector.
1756 theVec1 Vector, defining center point and plane direction.
1757 theVec2 Vector, defining the plane normal direction.
1758 theTrimSize Half size of a side of quadrangle face, representing the plane.
1759 theName Object name; when specified, this parameter is used
1760 for result publication in the study. Otherwise, if automatic
1761 publication is switched on, default value is used for result name.
1764 New GEOM.GEOM_Object, containing the created plane.
1766 # Example: see GEOM_TestAll.py
1767 theTrimSize, Parameters = ParseParameters(theTrimSize);
1768 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1769 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1770 anObj.SetParameters(Parameters)
1771 self._autoPublish(anObj, theName, "plane")
1774 ## Create a plane, based on a Local coordinate system.
1775 # @param theLCS coordinate system, defining plane.
1776 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1777 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1778 # @param theName Object name; when specified, this parameter is used
1779 # for result publication in the study. Otherwise, if automatic
1780 # publication is switched on, default value is used for result name.
1782 # @return New GEOM.GEOM_Object, containing the created plane.
1784 # @ref tui_creation_plane "Example"
1785 @ManageTransactions("BasicOp")
1786 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1788 Create a plane, based on a Local coordinate system.
1791 theLCS coordinate system, defining plane.
1792 theTrimSize Half size of a side of quadrangle face, representing the plane.
1793 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1794 theName Object name; when specified, this parameter is used
1795 for result publication in the study. Otherwise, if automatic
1796 publication is switched on, default value is used for result name.
1799 New GEOM.GEOM_Object, containing the created plane.
1801 # Example: see GEOM_TestAll.py
1802 theTrimSize, Parameters = ParseParameters(theTrimSize);
1803 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1804 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1805 anObj.SetParameters(Parameters)
1806 self._autoPublish(anObj, theName, "plane")
1809 ## Create a local coordinate system.
1810 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1811 # @param XDX,XDY,XDZ Three components of OX direction
1812 # @param YDX,YDY,YDZ Three components of OY direction
1813 # @param theName Object name; when specified, this parameter is used
1814 # for result publication in the study. Otherwise, if automatic
1815 # publication is switched on, default value is used for result name.
1817 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1819 # @ref swig_MakeMarker "Example"
1820 @ManageTransactions("BasicOp")
1821 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1823 Create a local coordinate system.
1826 OX,OY,OZ Three coordinates of coordinate system origin.
1827 XDX,XDY,XDZ Three components of OX direction
1828 YDX,YDY,YDZ Three components of OY direction
1829 theName Object name; when specified, this parameter is used
1830 for result publication in the study. Otherwise, if automatic
1831 publication is switched on, default value is used for result name.
1834 New GEOM.GEOM_Object, containing the created coordinate system.
1836 # Example: see GEOM_TestAll.py
1837 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1838 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1839 RaiseIfFailed("MakeMarker", self.BasicOp)
1840 anObj.SetParameters(Parameters)
1841 self._autoPublish(anObj, theName, "lcs")
1844 ## Create a local coordinate system from shape.
1845 # @param theShape The initial shape to detect the coordinate system.
1846 # @param theName Object name; when specified, this parameter is used
1847 # for result publication in the study. Otherwise, if automatic
1848 # publication is switched on, default value is used for result name.
1850 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1852 # @ref tui_creation_lcs "Example"
1853 @ManageTransactions("BasicOp")
1854 def MakeMarkerFromShape(self, theShape, theName=None):
1856 Create a local coordinate system from shape.
1859 theShape The initial shape to detect the coordinate system.
1860 theName Object name; when specified, this parameter is used
1861 for result publication in the study. Otherwise, if automatic
1862 publication is switched on, default value is used for result name.
1865 New GEOM.GEOM_Object, containing the created coordinate system.
1867 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1868 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1869 self._autoPublish(anObj, theName, "lcs")
1872 ## Create a local coordinate system from point and two vectors.
1873 # @param theOrigin Point of coordinate system origin.
1874 # @param theXVec Vector of X direction
1875 # @param theYVec Vector of Y direction
1876 # @param theName Object name; when specified, this parameter is used
1877 # for result publication in the study. Otherwise, if automatic
1878 # publication is switched on, default value is used for result name.
1880 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1882 # @ref tui_creation_lcs "Example"
1883 @ManageTransactions("BasicOp")
1884 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1886 Create a local coordinate system from point and two vectors.
1889 theOrigin Point of coordinate system origin.
1890 theXVec Vector of X direction
1891 theYVec Vector of Y direction
1892 theName Object name; when specified, this parameter is used
1893 for result publication in the study. Otherwise, if automatic
1894 publication is switched on, default value is used for result name.
1897 New GEOM.GEOM_Object, containing the created coordinate system.
1900 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1901 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1902 self._autoPublish(anObj, theName, "lcs")
1905 # end of l3_basic_go
1908 ## @addtogroup l4_curves
1911 ## Create an arc of circle, passing through three given points.
1912 # @param thePnt1 Start point of the arc.
1913 # @param thePnt2 Middle point of the arc.
1914 # @param thePnt3 End point of the arc.
1915 # @param theName Object name; when specified, this parameter is used
1916 # for result publication in the study. Otherwise, if automatic
1917 # publication is switched on, default value is used for result name.
1919 # @return New GEOM.GEOM_Object, containing the created arc.
1921 # @ref swig_MakeArc "Example"
1922 @ManageTransactions("CurvesOp")
1923 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1925 Create an arc of circle, passing through three given points.
1928 thePnt1 Start point of the arc.
1929 thePnt2 Middle point of the arc.
1930 thePnt3 End point of the arc.
1931 theName Object name; when specified, this parameter is used
1932 for result publication in the study. Otherwise, if automatic
1933 publication is switched on, default value is used for result name.
1936 New GEOM.GEOM_Object, containing the created arc.
1938 # Example: see GEOM_TestAll.py
1939 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1940 RaiseIfFailed("MakeArc", self.CurvesOp)
1941 self._autoPublish(anObj, theName, "arc")
1944 ## Create an arc of circle from a center and 2 points.
1945 # @param thePnt1 Center of the arc
1946 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1947 # @param thePnt3 End point of the arc (Gives also a direction)
1948 # @param theSense Orientation of the arc
1949 # @param theName Object name; when specified, this parameter is used
1950 # for result publication in the study. Otherwise, if automatic
1951 # publication is switched on, default value is used for result name.
1953 # @return New GEOM.GEOM_Object, containing the created arc.
1955 # @ref swig_MakeArc "Example"
1956 @ManageTransactions("CurvesOp")
1957 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1959 Create an arc of circle from a center and 2 points.
1962 thePnt1 Center of the arc
1963 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1964 thePnt3 End point of the arc (Gives also a direction)
1965 theSense Orientation of the arc
1966 theName Object name; when specified, this parameter is used
1967 for result publication in the study. Otherwise, if automatic
1968 publication is switched on, default value is used for result name.
1971 New GEOM.GEOM_Object, containing the created arc.
1973 # Example: see GEOM_TestAll.py
1974 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1975 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1976 self._autoPublish(anObj, theName, "arc")
1979 ## Create an arc of ellipse, of center and two points.
1980 # @param theCenter Center of the arc.
1981 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1982 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1983 # @param theName Object name; when specified, this parameter is used
1984 # for result publication in the study. Otherwise, if automatic
1985 # publication is switched on, default value is used for result name.
1987 # @return New GEOM.GEOM_Object, containing the created arc.
1989 # @ref swig_MakeArc "Example"
1990 @ManageTransactions("CurvesOp")
1991 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1993 Create an arc of ellipse, of center and two points.
1996 theCenter Center of the arc.
1997 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1998 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1999 theName Object name; when specified, this parameter is used
2000 for result publication in the study. Otherwise, if automatic
2001 publication is switched on, default value is used for result name.
2004 New GEOM.GEOM_Object, containing the created arc.
2006 # Example: see GEOM_TestAll.py
2007 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2008 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2009 self._autoPublish(anObj, theName, "arc")
2012 ## Create a circle with given center, normal vector and radius.
2013 # @param thePnt Circle center.
2014 # @param theVec Vector, normal to the plane of the circle.
2015 # @param theR Circle radius.
2016 # @param theName Object name; when specified, this parameter is used
2017 # for result publication in the study. Otherwise, if automatic
2018 # publication is switched on, default value is used for result name.
2020 # @return New GEOM.GEOM_Object, containing the created circle.
2022 # @ref tui_creation_circle "Example"
2023 @ManageTransactions("CurvesOp")
2024 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2026 Create a circle with given center, normal vector and radius.
2029 thePnt Circle center.
2030 theVec Vector, normal to the plane of the circle.
2032 theName Object name; when specified, this parameter is used
2033 for result publication in the study. Otherwise, if automatic
2034 publication is switched on, default value is used for result name.
2037 New GEOM.GEOM_Object, containing the created circle.
2039 # Example: see GEOM_TestAll.py
2040 theR, Parameters = ParseParameters(theR)
2041 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2042 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2043 anObj.SetParameters(Parameters)
2044 self._autoPublish(anObj, theName, "circle")
2047 ## Create a circle with given radius.
2048 # Center of the circle will be in the origin of global
2049 # coordinate system and normal vector will be codirected with Z axis
2050 # @param theR Circle radius.
2051 # @param theName Object name; when specified, this parameter is used
2052 # for result publication in the study. Otherwise, if automatic
2053 # publication is switched on, default value is used for result name.
2055 # @return New GEOM.GEOM_Object, containing the created circle.
2056 @ManageTransactions("CurvesOp")
2057 def MakeCircleR(self, theR, theName=None):
2059 Create a circle with given radius.
2060 Center of the circle will be in the origin of global
2061 coordinate system and normal vector will be codirected with Z axis
2065 theName Object name; when specified, this parameter is used
2066 for result publication in the study. Otherwise, if automatic
2067 publication is switched on, default value is used for result name.
2070 New GEOM.GEOM_Object, containing the created circle.
2072 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2073 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2074 self._autoPublish(anObj, theName, "circle")
2077 ## Create a circle, passing through three given points
2078 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2079 # @param theName Object name; when specified, this parameter is used
2080 # for result publication in the study. Otherwise, if automatic
2081 # publication is switched on, default value is used for result name.
2083 # @return New GEOM.GEOM_Object, containing the created circle.
2085 # @ref tui_creation_circle "Example"
2086 @ManageTransactions("CurvesOp")
2087 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2089 Create a circle, passing through three given points
2092 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2093 theName Object name; when specified, this parameter is used
2094 for result publication in the study. Otherwise, if automatic
2095 publication is switched on, default value is used for result name.
2098 New GEOM.GEOM_Object, containing the created circle.
2100 # Example: see GEOM_TestAll.py
2101 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2102 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2103 self._autoPublish(anObj, theName, "circle")
2106 ## Create a circle, with given point1 as center,
2107 # passing through the point2 as radius and laying in the plane,
2108 # defined by all three given points.
2109 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2110 # @param theName Object name; when specified, this parameter is used
2111 # for result publication in the study. Otherwise, if automatic
2112 # publication is switched on, default value is used for result name.
2114 # @return New GEOM.GEOM_Object, containing the created circle.
2116 # @ref swig_MakeCircle "Example"
2117 @ManageTransactions("CurvesOp")
2118 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2120 Create a circle, with given point1 as center,
2121 passing through the point2 as radius and laying in the plane,
2122 defined by all three given points.
2125 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2126 theName Object name; when specified, this parameter is used
2127 for result publication in the study. Otherwise, if automatic
2128 publication is switched on, default value is used for result name.
2131 New GEOM.GEOM_Object, containing the created circle.
2133 # Example: see GEOM_example6.py
2134 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2135 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2136 self._autoPublish(anObj, theName, "circle")
2139 ## Create an ellipse with given center, normal vector and radiuses.
2140 # @param thePnt Ellipse center.
2141 # @param theVec Vector, normal to the plane of the ellipse.
2142 # @param theRMajor Major ellipse radius.
2143 # @param theRMinor Minor ellipse radius.
2144 # @param theVecMaj Vector, direction of the ellipse's main axis.
2145 # @param theName Object name; when specified, this parameter is used
2146 # for result publication in the study. Otherwise, if automatic
2147 # publication is switched on, default value is used for result name.
2149 # @return New GEOM.GEOM_Object, containing the created ellipse.
2151 # @ref tui_creation_ellipse "Example"
2152 @ManageTransactions("CurvesOp")
2153 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2155 Create an ellipse with given center, normal vector and radiuses.
2158 thePnt Ellipse center.
2159 theVec Vector, normal to the plane of the ellipse.
2160 theRMajor Major ellipse radius.
2161 theRMinor Minor ellipse radius.
2162 theVecMaj Vector, direction of the ellipse's main axis.
2163 theName Object name; when specified, this parameter is used
2164 for result publication in the study. Otherwise, if automatic
2165 publication is switched on, default value is used for result name.
2168 New GEOM.GEOM_Object, containing the created ellipse.
2170 # Example: see GEOM_TestAll.py
2171 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2172 if theVecMaj is not None:
2173 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2175 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2177 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2178 anObj.SetParameters(Parameters)
2179 self._autoPublish(anObj, theName, "ellipse")
2182 ## Create an ellipse with given radiuses.
2183 # Center of the ellipse will be in the origin of global
2184 # coordinate system and normal vector will be codirected with Z axis
2185 # @param theRMajor Major ellipse radius.
2186 # @param theRMinor Minor ellipse radius.
2187 # @param theName Object name; when specified, this parameter is used
2188 # for result publication in the study. Otherwise, if automatic
2189 # publication is switched on, default value is used for result name.
2191 # @return New GEOM.GEOM_Object, containing the created ellipse.
2192 @ManageTransactions("CurvesOp")
2193 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2195 Create an ellipse with given radiuses.
2196 Center of the ellipse will be in the origin of global
2197 coordinate system and normal vector will be codirected with Z axis
2200 theRMajor Major ellipse radius.
2201 theRMinor Minor ellipse radius.
2202 theName Object name; when specified, this parameter is used
2203 for result publication in the study. Otherwise, if automatic
2204 publication is switched on, default value is used for result name.
2207 New GEOM.GEOM_Object, containing the created ellipse.
2209 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2210 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2211 self._autoPublish(anObj, theName, "ellipse")
2214 ## Create a polyline on the set of points.
2215 # @param thePoints Sequence of points for the polyline.
2216 # @param theIsClosed If True, build a closed wire.
2217 # @param theName Object name; when specified, this parameter is used
2218 # for result publication in the study. Otherwise, if automatic
2219 # publication is switched on, default value is used for result name.
2221 # @return New GEOM.GEOM_Object, containing the created polyline.
2223 # @ref tui_creation_curve "Example"
2224 @ManageTransactions("CurvesOp")
2225 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2227 Create a polyline on the set of points.
2230 thePoints Sequence of points for the polyline.
2231 theIsClosed If True, build a closed wire.
2232 theName Object name; when specified, this parameter is used
2233 for result publication in the study. Otherwise, if automatic
2234 publication is switched on, default value is used for result name.
2237 New GEOM.GEOM_Object, containing the created polyline.
2239 # Example: see GEOM_TestAll.py
2240 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2241 RaiseIfFailed("MakePolyline", self.CurvesOp)
2242 self._autoPublish(anObj, theName, "polyline")
2245 ## Create bezier curve on the set of points.
2246 # @param thePoints Sequence of points for the bezier curve.
2247 # @param theIsClosed If True, build a closed curve.
2248 # @param theName Object name; when specified, this parameter is used
2249 # for result publication in the study. Otherwise, if automatic
2250 # publication is switched on, default value is used for result name.
2252 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2254 # @ref tui_creation_curve "Example"
2255 @ManageTransactions("CurvesOp")
2256 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2258 Create bezier curve on the set of points.
2261 thePoints Sequence of points for the bezier curve.
2262 theIsClosed If True, build a closed curve.
2263 theName Object name; when specified, this parameter is used
2264 for result publication in the study. Otherwise, if automatic
2265 publication is switched on, default value is used for result name.
2268 New GEOM.GEOM_Object, containing the created bezier curve.
2270 # Example: see GEOM_TestAll.py
2271 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2272 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2273 self._autoPublish(anObj, theName, "bezier")
2276 ## Create B-Spline curve on the set of points.
2277 # @param thePoints Sequence of points for the B-Spline curve.
2278 # @param theIsClosed If True, build a closed curve.
2279 # @param theDoReordering If TRUE, the algo does not follow the order of
2280 # \a thePoints but searches for the closest vertex.
2281 # @param theName Object name; when specified, this parameter is used
2282 # for result publication in the study. Otherwise, if automatic
2283 # publication is switched on, default value is used for result name.
2285 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2287 # @ref tui_creation_curve "Example"
2288 @ManageTransactions("CurvesOp")
2289 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2291 Create B-Spline curve on the set of points.
2294 thePoints Sequence of points for the B-Spline curve.
2295 theIsClosed If True, build a closed curve.
2296 theDoReordering If True, the algo does not follow the order of
2297 thePoints but searches for the closest vertex.
2298 theName Object name; when specified, this parameter is used
2299 for result publication in the study. Otherwise, if automatic
2300 publication is switched on, default value is used for result name.
2303 New GEOM.GEOM_Object, containing the created B-Spline curve.
2305 # Example: see GEOM_TestAll.py
2306 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2307 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2308 self._autoPublish(anObj, theName, "bspline")
2311 ## Create B-Spline curve on the set of points.
2312 # @param thePoints Sequence of points for the B-Spline curve.
2313 # @param theFirstVec Vector object, defining the curve direction at its first point.
2314 # @param theLastVec Vector object, defining the curve direction at its last point.
2315 # @param theName Object name; when specified, this parameter is used
2316 # for result publication in the study. Otherwise, if automatic
2317 # publication is switched on, default value is used for result name.
2319 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2321 # @ref tui_creation_curve "Example"
2322 @ManageTransactions("CurvesOp")
2323 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2325 Create B-Spline curve on the set of points.
2328 thePoints Sequence of points for the B-Spline curve.
2329 theFirstVec Vector object, defining the curve direction at its first point.
2330 theLastVec Vector object, defining the curve direction at its last point.
2331 theName Object name; when specified, this parameter is used
2332 for result publication in the study. Otherwise, if automatic
2333 publication is switched on, default value is used for result name.
2336 New GEOM.GEOM_Object, containing the created B-Spline curve.
2338 # Example: see GEOM_TestAll.py
2339 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2340 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2341 self._autoPublish(anObj, theName, "bspline")
2344 ## Creates a curve using the parametric definition of the basic points.
2345 # @param thexExpr parametric equation of the coordinates X.
2346 # @param theyExpr parametric equation of the coordinates Y.
2347 # @param thezExpr parametric equation of the coordinates Z.
2348 # @param theParamMin the minimal value of the parameter.
2349 # @param theParamMax the maximum value of the parameter.
2350 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2351 # @param theCurveType the type of the curve,
2352 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2353 # @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.
2354 # @param theName Object name; when specified, this parameter is used
2355 # for result publication in the study. Otherwise, if automatic
2356 # publication is switched on, default value is used for result name.
2358 # @return New GEOM.GEOM_Object, containing the created curve.
2360 # @ref tui_creation_curve "Example"
2361 @ManageTransactions("CurvesOp")
2362 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2363 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2365 Creates a curve using the parametric definition of the basic points.
2368 thexExpr parametric equation of the coordinates X.
2369 theyExpr parametric equation of the coordinates Y.
2370 thezExpr parametric equation of the coordinates Z.
2371 theParamMin the minimal value of the parameter.
2372 theParamMax the maximum value of the parameter.
2373 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2374 theCurveType the type of the curve,
2375 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2376 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2377 method is used which can lead to a bug.
2378 theName Object name; when specified, this parameter is used
2379 for result publication in the study. Otherwise, if automatic
2380 publication is switched on, default value is used for result name.
2383 New GEOM.GEOM_Object, containing the created curve.
2385 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2387 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2389 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2390 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2391 anObj.SetParameters(Parameters)
2392 self._autoPublish(anObj, theName, "curve")
2395 ## Create an isoline curve on a face.
2396 # @param theFace the face for which an isoline is created.
2397 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2399 # @param theParameter the U parameter for U-isoline or V parameter
2401 # @param theName Object name; when specified, this parameter is used
2402 # for result publication in the study. Otherwise, if automatic
2403 # publication is switched on, default value is used for result name.
2405 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2406 # a compound of edges.
2408 # @ref tui_creation_curve "Example"
2409 @ManageTransactions("CurvesOp")
2410 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2412 Create an isoline curve on a face.
2415 theFace the face for which an isoline is created.
2416 IsUIsoline True for U-isoline creation; False for V-isoline
2418 theParameter the U parameter for U-isoline or V parameter
2420 theName Object name; when specified, this parameter is used
2421 for result publication in the study. Otherwise, if automatic
2422 publication is switched on, default value is used for result name.
2425 New GEOM.GEOM_Object, containing the created isoline edge or a
2428 # Example: see GEOM_TestAll.py
2429 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2430 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2432 self._autoPublish(anObj, theName, "U-Isoline")
2434 self._autoPublish(anObj, theName, "V-Isoline")
2440 ## @addtogroup l3_sketcher
2443 ## Create a sketcher (wire or face), following the textual description,
2444 # passed through <VAR>theCommand</VAR> argument. \n
2445 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2446 # Format of the description string have to be the following:
2448 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2451 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2453 # - "R angle" : Set the direction by angle
2454 # - "D dx dy" : Set the direction by DX & DY
2457 # - "TT x y" : Create segment by point at X & Y
2458 # - "T dx dy" : Create segment by point with DX & DY
2459 # - "L length" : Create segment by direction & Length
2460 # - "IX x" : Create segment by direction & Intersect. X
2461 # - "IY y" : Create segment by direction & Intersect. Y
2464 # - "C radius length" : Create arc by direction, radius and length(in degree)
2465 # - "AA x y": Create arc by point at X & Y
2466 # - "A dx dy" : Create arc by point with DX & DY
2467 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2468 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2469 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2470 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2473 # - "WW" : Close Wire (to finish)
2474 # - "WF" : Close Wire and build face (to finish)
2477 # - Flag1 (= reverse) is 0 or 2 ...
2478 # - if 0 the drawn arc is the one of lower angle (< Pi)
2479 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2482 # - Flag2 (= control tolerance) is 0 or 1 ...
2483 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2484 # - if 1 the wire is built only if the end point is on the arc
2485 # with a tolerance of 10^-7 on the distance else the creation fails
2487 # @param theCommand String, defining the sketcher in local
2488 # coordinates of the working plane.
2489 # @param theWorkingPlane Nine double values, defining origin,
2490 # OZ and OX directions of the working plane.
2491 # @param theName Object name; when specified, this parameter is used
2492 # for result publication in the study. Otherwise, if automatic
2493 # publication is switched on, default value is used for result name.
2495 # @return New GEOM.GEOM_Object, containing the created wire.
2497 # @ref tui_sketcher_page "Example"
2498 @ManageTransactions("CurvesOp")
2499 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2501 Create a sketcher (wire or face), following the textual description, passed
2502 through theCommand argument.
2503 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2504 Format of the description string have to be the following:
2505 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2507 - x1, y1 are coordinates of the first sketcher point (zero by default),
2509 - "R angle" : Set the direction by angle
2510 - "D dx dy" : Set the direction by DX & DY
2512 - "TT x y" : Create segment by point at X & Y
2513 - "T dx dy" : Create segment by point with DX & DY
2514 - "L length" : Create segment by direction & Length
2515 - "IX x" : Create segment by direction & Intersect. X
2516 - "IY y" : Create segment by direction & Intersect. Y
2518 - "C radius length" : Create arc by direction, radius and length(in degree)
2519 - "AA x y": Create arc by point at X & Y
2520 - "A dx dy" : Create arc by point with DX & DY
2521 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2522 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2523 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2524 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2526 - "WW" : Close Wire (to finish)
2527 - "WF" : Close Wire and build face (to finish)
2529 - Flag1 (= reverse) is 0 or 2 ...
2530 - if 0 the drawn arc is the one of lower angle (< Pi)
2531 - if 2 the drawn arc ius the one of greater angle (> Pi)
2533 - Flag2 (= control tolerance) is 0 or 1 ...
2534 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2535 - if 1 the wire is built only if the end point is on the arc
2536 with a tolerance of 10^-7 on the distance else the creation fails
2539 theCommand String, defining the sketcher in local
2540 coordinates of the working plane.
2541 theWorkingPlane Nine double values, defining origin,
2542 OZ and OX directions of the working plane.
2543 theName Object name; when specified, this parameter is used
2544 for result publication in the study. Otherwise, if automatic
2545 publication is switched on, default value is used for result name.
2548 New GEOM.GEOM_Object, containing the created wire.
2550 # Example: see GEOM_TestAll.py
2551 theCommand,Parameters = ParseSketcherCommand(theCommand)
2552 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2553 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2554 anObj.SetParameters(Parameters)
2555 self._autoPublish(anObj, theName, "wire")
2558 ## Create a sketcher (wire or face), following the textual description,
2559 # passed through <VAR>theCommand</VAR> argument. \n
2560 # For format of the description string see MakeSketcher() method.\n
2561 # @param theCommand String, defining the sketcher in local
2562 # coordinates of the working plane.
2563 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2564 # @param theName Object name; when specified, this parameter is used
2565 # for result publication in the study. Otherwise, if automatic
2566 # publication is switched on, default value is used for result name.
2568 # @return New GEOM.GEOM_Object, containing the created wire.
2570 # @ref tui_sketcher_page "Example"
2571 @ManageTransactions("CurvesOp")
2572 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2574 Create a sketcher (wire or face), following the textual description,
2575 passed through theCommand argument.
2576 For format of the description string see geompy.MakeSketcher() method.
2579 theCommand String, defining the sketcher in local
2580 coordinates of the working plane.
2581 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2582 theName Object name; when specified, this parameter is used
2583 for result publication in the study. Otherwise, if automatic
2584 publication is switched on, default value is used for result name.
2587 New GEOM.GEOM_Object, containing the created wire.
2589 theCommand,Parameters = ParseSketcherCommand(theCommand)
2590 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2591 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2592 anObj.SetParameters(Parameters)
2593 self._autoPublish(anObj, theName, "wire")
2596 ## Obtain a 2D sketcher interface
2597 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2598 def Sketcher2D (self):
2600 Obtain a 2D sketcher interface.
2603 sk = geompy.Sketcher2D()
2605 sk.addSegmentRelative(15, 70)
2606 sk.addSegmentPerpY(50)
2607 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2608 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2609 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2611 Sketch_1 = sk.wire(geomObj_1)
2613 sk = Sketcher2D (self)
2616 ## Create a sketcher wire, following the numerical description,
2617 # passed through <VAR>theCoordinates</VAR> argument. \n
2618 # @param theCoordinates double values, defining points to create a wire,
2620 # @param theName Object name; when specified, this parameter is used
2621 # for result publication in the study. Otherwise, if automatic
2622 # publication is switched on, default value is used for result name.
2624 # @return New GEOM.GEOM_Object, containing the created wire.
2626 # @ref tui_3dsketcher_page "Example"
2627 @ManageTransactions("CurvesOp")
2628 def Make3DSketcher(self, theCoordinates, theName=None):
2630 Create a sketcher wire, following the numerical description,
2631 passed through theCoordinates argument.
2634 theCoordinates double values, defining points to create a wire,
2636 theName Object name; when specified, this parameter is used
2637 for result publication in the study. Otherwise, if automatic
2638 publication is switched on, default value is used for result name.
2641 New GEOM_Object, containing the created wire.
2643 theCoordinates,Parameters = ParseParameters(theCoordinates)
2644 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2645 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2646 anObj.SetParameters(Parameters)
2647 self._autoPublish(anObj, theName, "wire")
2650 ## Obtain a 3D sketcher interface
2651 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2653 # @ref tui_3dsketcher_page "Example"
2654 def Sketcher3D (self):
2656 Obtain a 3D sketcher interface.
2659 sk = geompy.Sketcher3D()
2660 sk.addPointsAbsolute(0,0,0, 70,0,0)
2661 sk.addPointsRelative(0, 0, 130)
2662 sk.addPointAnglesLength("OXY", 50, 0, 100)
2663 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2665 a3D_Sketcher_1 = sk.wire()
2667 sk = Sketcher3D (self)
2670 ## Obtain a 2D polyline creation interface
2671 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2673 # @ref tui_3dsketcher_page "Example"
2674 def Polyline2D (self):
2676 Obtain a 2D polyline creation interface.
2679 pl = geompy.Polyline2D()
2680 pl.addSection("section 1", GEOM.Polyline, True)
2681 pl.addPoints(0, 0, 10, 0, 10, 10)
2682 pl.addSection("section 2", GEOM.Interpolation, False)
2683 pl.addPoints(20, 0, 30, 0, 30, 10)
2684 resultObj = pl.result(WorkingPlane)
2686 pl = Polyline2D (self)
2689 # end of l3_sketcher
2692 ## @addtogroup l3_3d_primitives
2695 ## Create a box by coordinates of two opposite vertices.
2697 # @param x1,y1,z1 double values, defining first point it.
2698 # @param x2,y2,z2 double values, defining first point it.
2699 # @param theName Object name; when specified, this parameter is used
2700 # for result publication in the study. Otherwise, if automatic
2701 # publication is switched on, default value is used for result name.
2703 # @return New GEOM.GEOM_Object, containing the created box.
2705 # @ref tui_creation_box "Example"
2706 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2708 Create a box by coordinates of two opposite vertices.
2711 x1,y1,z1 double values, defining first point.
2712 x2,y2,z2 double values, defining second point.
2713 theName Object name; when specified, this parameter is used
2714 for result publication in the study. Otherwise, if automatic
2715 publication is switched on, default value is used for result name.
2718 New GEOM.GEOM_Object, containing the created box.
2720 # Example: see GEOM_TestAll.py
2721 pnt1 = self.MakeVertex(x1,y1,z1)
2722 pnt2 = self.MakeVertex(x2,y2,z2)
2723 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2724 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2726 ## Create a box with specified dimensions along the coordinate axes
2727 # and with edges, parallel to the coordinate axes.
2728 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2729 # @param theDX Length of Box edges, parallel to OX axis.
2730 # @param theDY Length of Box edges, parallel to OY axis.
2731 # @param theDZ Length of Box edges, parallel to OZ axis.
2732 # @param theName Object name; when specified, this parameter is used
2733 # for result publication in the study. Otherwise, if automatic
2734 # publication is switched on, default value is used for result name.
2736 # @return New GEOM.GEOM_Object, containing the created box.
2738 # @ref tui_creation_box "Example"
2739 @ManageTransactions("PrimOp")
2740 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2742 Create a box with specified dimensions along the coordinate axes
2743 and with edges, parallel to the coordinate axes.
2744 Center of the box will be at point (DX/2, DY/2, DZ/2).
2747 theDX Length of Box edges, parallel to OX axis.
2748 theDY Length of Box edges, parallel to OY axis.
2749 theDZ Length of Box edges, parallel to OZ axis.
2750 theName Object name; when specified, this parameter is used
2751 for result publication in the study. Otherwise, if automatic
2752 publication is switched on, default value is used for result name.
2755 New GEOM.GEOM_Object, containing the created box.
2757 # Example: see GEOM_TestAll.py
2758 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2759 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2760 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2761 anObj.SetParameters(Parameters)
2762 self._autoPublish(anObj, theName, "box")
2765 ## Create a box with two specified opposite vertices,
2766 # and with edges, parallel to the coordinate axes
2767 # @param thePnt1 First of two opposite vertices.
2768 # @param thePnt2 Second of two opposite vertices.
2769 # @param theName Object name; when specified, this parameter is used
2770 # for result publication in the study. Otherwise, if automatic
2771 # publication is switched on, default value is used for result name.
2773 # @return New GEOM.GEOM_Object, containing the created box.
2775 # @ref tui_creation_box "Example"
2776 @ManageTransactions("PrimOp")
2777 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2779 Create a box with two specified opposite vertices,
2780 and with edges, parallel to the coordinate axes
2783 thePnt1 First of two opposite vertices.
2784 thePnt2 Second of two opposite vertices.
2785 theName Object name; when specified, this parameter is used
2786 for result publication in the study. Otherwise, if automatic
2787 publication is switched on, default value is used for result name.
2790 New GEOM.GEOM_Object, containing the created box.
2792 # Example: see GEOM_TestAll.py
2793 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2794 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2795 self._autoPublish(anObj, theName, "box")
2798 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2799 # @param theH height of Face.
2800 # @param theW width of Face.
2801 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2802 # @param theName Object name; when specified, this parameter is used
2803 # for result publication in the study. Otherwise, if automatic
2804 # publication is switched on, default value is used for result name.
2806 # @return New GEOM.GEOM_Object, containing the created face.
2808 # @ref tui_creation_face "Example"
2809 @ManageTransactions("PrimOp")
2810 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2812 Create a face with specified dimensions with edges parallel to coordinate axes.
2815 theH height of Face.
2817 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2818 theName Object name; when specified, this parameter is used
2819 for result publication in the study. Otherwise, if automatic
2820 publication is switched on, default value is used for result name.
2823 New GEOM.GEOM_Object, containing the created face.
2825 # Example: see GEOM_TestAll.py
2826 theH,theW,Parameters = ParseParameters(theH, theW)
2827 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2828 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2829 anObj.SetParameters(Parameters)
2830 self._autoPublish(anObj, theName, "rectangle")
2833 ## Create a face from another plane and two sizes,
2834 # vertical size and horisontal size.
2835 # @param theObj Normale vector to the creating face or
2837 # @param theH Height (vertical size).
2838 # @param theW Width (horisontal size).
2839 # @param theName Object name; when specified, this parameter is used
2840 # for result publication in the study. Otherwise, if automatic
2841 # publication is switched on, default value is used for result name.
2843 # @return New GEOM.GEOM_Object, containing the created face.
2845 # @ref tui_creation_face "Example"
2846 @ManageTransactions("PrimOp")
2847 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2849 Create a face from another plane and two sizes,
2850 vertical size and horisontal size.
2853 theObj Normale vector to the creating face or
2855 theH Height (vertical size).
2856 theW Width (horisontal size).
2857 theName Object name; when specified, this parameter is used
2858 for result publication in the study. Otherwise, if automatic
2859 publication is switched on, default value is used for result name.
2862 New GEOM_Object, containing the created face.
2864 # Example: see GEOM_TestAll.py
2865 theH,theW,Parameters = ParseParameters(theH, theW)
2866 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2867 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2868 anObj.SetParameters(Parameters)
2869 self._autoPublish(anObj, theName, "rectangle")
2872 ## Create a disk with given center, normal vector and radius.
2873 # @param thePnt Disk center.
2874 # @param theVec Vector, normal to the plane of the disk.
2875 # @param theR Disk radius.
2876 # @param theName Object name; when specified, this parameter is used
2877 # for result publication in the study. Otherwise, if automatic
2878 # publication is switched on, default value is used for result name.
2880 # @return New GEOM.GEOM_Object, containing the created disk.
2882 # @ref tui_creation_disk "Example"
2883 @ManageTransactions("PrimOp")
2884 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2886 Create a disk with given center, normal vector and radius.
2890 theVec Vector, normal to the plane of the disk.
2892 theName Object name; when specified, this parameter is used
2893 for result publication in the study. Otherwise, if automatic
2894 publication is switched on, default value is used for result name.
2897 New GEOM.GEOM_Object, containing the created disk.
2899 # Example: see GEOM_TestAll.py
2900 theR,Parameters = ParseParameters(theR)
2901 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2902 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2903 anObj.SetParameters(Parameters)
2904 self._autoPublish(anObj, theName, "disk")
2907 ## Create a disk, passing through three given points
2908 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2909 # @param theName Object name; when specified, this parameter is used
2910 # for result publication in the study. Otherwise, if automatic
2911 # publication is switched on, default value is used for result name.
2913 # @return New GEOM.GEOM_Object, containing the created disk.
2915 # @ref tui_creation_disk "Example"
2916 @ManageTransactions("PrimOp")
2917 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2919 Create a disk, passing through three given points
2922 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2923 theName Object name; when specified, this parameter is used
2924 for result publication in the study. Otherwise, if automatic
2925 publication is switched on, default value is used for result name.
2928 New GEOM.GEOM_Object, containing the created disk.
2930 # Example: see GEOM_TestAll.py
2931 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2932 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2933 self._autoPublish(anObj, theName, "disk")
2936 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2937 # @param theR Radius of Face.
2938 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2939 # @param theName Object name; when specified, this parameter is used
2940 # for result publication in the study. Otherwise, if automatic
2941 # publication is switched on, default value is used for result name.
2943 # @return New GEOM.GEOM_Object, containing the created disk.
2945 # @ref tui_creation_face "Example"
2946 @ManageTransactions("PrimOp")
2947 def MakeDiskR(self, theR, theOrientation, theName=None):
2949 Create a disk with specified dimensions along OX-OY coordinate axes.
2952 theR Radius of Face.
2953 theOrientation set the orientation belong axis OXY or OYZ or OZX
2954 theName Object name; when specified, this parameter is used
2955 for result publication in the study. Otherwise, if automatic
2956 publication is switched on, default value is used for result name.
2959 New GEOM.GEOM_Object, containing the created disk.
2962 Disk3 = geompy.MakeDiskR(100., 1)
2964 # Example: see GEOM_TestAll.py
2965 theR,Parameters = ParseParameters(theR)
2966 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2967 RaiseIfFailed("MakeDiskR", self.PrimOp)
2968 anObj.SetParameters(Parameters)
2969 self._autoPublish(anObj, theName, "disk")
2972 ## Create a cylinder with given base point, axis, radius and height.
2973 # @param thePnt Central point of cylinder base.
2974 # @param theAxis Cylinder axis.
2975 # @param theR Cylinder radius.
2976 # @param theH Cylinder height.
2977 # @param theName Object name; when specified, this parameter is used
2978 # for result publication in the study. Otherwise, if automatic
2979 # publication is switched on, default value is used for result name.
2981 # @return New GEOM.GEOM_Object, containing the created cylinder.
2983 # @ref tui_creation_cylinder "Example"
2984 @ManageTransactions("PrimOp")
2985 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2987 Create a cylinder with given base point, axis, radius and height.
2990 thePnt Central point of cylinder base.
2991 theAxis Cylinder axis.
2992 theR Cylinder radius.
2993 theH Cylinder height.
2994 theName Object name; when specified, this parameter is used
2995 for result publication in the study. Otherwise, if automatic
2996 publication is switched on, default value is used for result name.
2999 New GEOM.GEOM_Object, containing the created cylinder.
3001 # Example: see GEOM_TestAll.py
3002 theR,theH,Parameters = ParseParameters(theR, theH)
3003 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3004 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3005 anObj.SetParameters(Parameters)
3006 self._autoPublish(anObj, theName, "cylinder")
3009 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3010 # @param thePnt Central point of cylinder base.
3011 # @param theAxis Cylinder axis.
3012 # @param theR Cylinder radius.
3013 # @param theH Cylinder height.
3014 # @param theA Cylinder angle in radians.
3015 # @param theName Object name; when specified, this parameter is used
3016 # for result publication in the study. Otherwise, if automatic
3017 # publication is switched on, default value is used for result name.
3019 # @return New GEOM.GEOM_Object, containing the created cylinder.
3021 # @ref tui_creation_cylinder "Example"
3022 @ManageTransactions("PrimOp")
3023 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3025 Create a a portion of cylinder with given base point, axis, radius, height and angle.
3028 thePnt Central point of cylinder base.
3029 theAxis Cylinder axis.
3030 theR Cylinder radius.
3031 theH Cylinder height.
3032 theA Cylinder angle in radians.
3033 theName Object name; when specified, this parameter is used
3034 for result publication in the study. Otherwise, if automatic
3035 publication is switched on, default value is used for result name.
3038 New GEOM.GEOM_Object, containing the created cylinder.
3040 # Example: see GEOM_TestAll.py
3042 if isinstance(theA,str):
3044 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3046 theA = theA*math.pi/180.
3047 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3048 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3049 anObj.SetParameters(Parameters)
3050 self._autoPublish(anObj, theName, "cylinder")
3053 ## Create a cylinder with given radius and height at
3054 # the origin of coordinate system. Axis of the cylinder
3055 # will be collinear to the OZ axis of the coordinate system.
3056 # @param theR Cylinder radius.
3057 # @param theH Cylinder height.
3058 # @param theName Object name; when specified, this parameter is used
3059 # for result publication in the study. Otherwise, if automatic
3060 # publication is switched on, default value is used for result name.
3062 # @return New GEOM.GEOM_Object, containing the created cylinder.
3064 # @ref tui_creation_cylinder "Example"
3065 @ManageTransactions("PrimOp")
3066 def MakeCylinderRH(self, theR, theH, theName=None):
3068 Create a cylinder with given radius and height at
3069 the origin of coordinate system. Axis of the cylinder
3070 will be collinear to the OZ axis of the coordinate system.
3073 theR Cylinder radius.
3074 theH Cylinder height.
3075 theName Object name; when specified, this parameter is used
3076 for result publication in the study. Otherwise, if automatic
3077 publication is switched on, default value is used for result name.
3080 New GEOM.GEOM_Object, containing the created cylinder.
3082 # Example: see GEOM_TestAll.py
3083 theR,theH,Parameters = ParseParameters(theR, theH)
3084 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3085 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3086 anObj.SetParameters(Parameters)
3087 self._autoPublish(anObj, theName, "cylinder")
3090 ## Create a portion of cylinder with given radius, height and angle at
3091 # the origin of coordinate system. Axis of the cylinder
3092 # will be collinear to the OZ axis of the coordinate system.
3093 # @param theR Cylinder radius.
3094 # @param theH Cylinder height.
3095 # @param theA Cylinder angle in radians.
3096 # @param theName Object name; when specified, this parameter is used
3097 # for result publication in the study. Otherwise, if automatic
3098 # publication is switched on, default value is used for result name.
3100 # @return New GEOM.GEOM_Object, containing the created cylinder.
3102 # @ref tui_creation_cylinder "Example"
3103 @ManageTransactions("PrimOp")
3104 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3106 Create a portion of cylinder with given radius, height and angle at
3107 the origin of coordinate system. Axis of the cylinder
3108 will be collinear to the OZ axis of the coordinate system.
3111 theR Cylinder radius.
3112 theH Cylinder height.
3113 theA Cylinder angle in radians.
3114 theName Object name; when specified, this parameter is used
3115 for result publication in the study. Otherwise, if automatic
3116 publication is switched on, default value is used for result name.
3119 New GEOM.GEOM_Object, containing the created cylinder.
3121 # Example: see GEOM_TestAll.py
3123 if isinstance(theA,str):
3125 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3127 theA = theA*math.pi/180.
3128 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3129 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3130 anObj.SetParameters(Parameters)
3131 self._autoPublish(anObj, theName, "cylinder")
3134 ## Create a sphere with given center and radius.
3135 # @param thePnt Sphere center.
3136 # @param theR Sphere radius.
3137 # @param theName Object name; when specified, this parameter is used
3138 # for result publication in the study. Otherwise, if automatic
3139 # publication is switched on, default value is used for result name.
3141 # @return New GEOM.GEOM_Object, containing the created sphere.
3143 # @ref tui_creation_sphere "Example"
3144 @ManageTransactions("PrimOp")
3145 def MakeSpherePntR(self, thePnt, theR, theName=None):
3147 Create a sphere with given center and radius.
3150 thePnt Sphere center.
3152 theName Object name; when specified, this parameter is used
3153 for result publication in the study. Otherwise, if automatic
3154 publication is switched on, default value is used for result name.
3157 New GEOM.GEOM_Object, containing the created sphere.
3159 # Example: see GEOM_TestAll.py
3160 theR,Parameters = ParseParameters(theR)
3161 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3162 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3163 anObj.SetParameters(Parameters)
3164 self._autoPublish(anObj, theName, "sphere")
3167 ## Create a sphere with given center and radius.
3168 # @param x,y,z Coordinates of sphere center.
3169 # @param theR Sphere radius.
3170 # @param theName Object name; when specified, this parameter is used
3171 # for result publication in the study. Otherwise, if automatic
3172 # publication is switched on, default value is used for result name.
3174 # @return New GEOM.GEOM_Object, containing the created sphere.
3176 # @ref tui_creation_sphere "Example"
3177 def MakeSphere(self, x, y, z, theR, theName=None):
3179 Create a sphere with given center and radius.
3182 x,y,z Coordinates of sphere center.
3184 theName Object name; when specified, this parameter is used
3185 for result publication in the study. Otherwise, if automatic
3186 publication is switched on, default value is used for result name.
3189 New GEOM.GEOM_Object, containing the created sphere.
3191 # Example: see GEOM_TestAll.py
3192 point = self.MakeVertex(x, y, z)
3193 # note: auto-publishing is done in self.MakeSpherePntR()
3194 anObj = self.MakeSpherePntR(point, theR, theName)
3197 ## Create a sphere with given radius at the origin of coordinate system.
3198 # @param theR Sphere radius.
3199 # @param theName Object name; when specified, this parameter is used
3200 # for result publication in the study. Otherwise, if automatic
3201 # publication is switched on, default value is used for result name.
3203 # @return New GEOM.GEOM_Object, containing the created sphere.
3205 # @ref tui_creation_sphere "Example"
3206 @ManageTransactions("PrimOp")
3207 def MakeSphereR(self, theR, theName=None):
3209 Create a sphere with given radius at the origin of coordinate system.
3213 theName Object name; when specified, this parameter is used
3214 for result publication in the study. Otherwise, if automatic
3215 publication is switched on, default value is used for result name.
3218 New GEOM.GEOM_Object, containing the created sphere.
3220 # Example: see GEOM_TestAll.py
3221 theR,Parameters = ParseParameters(theR)
3222 anObj = self.PrimOp.MakeSphereR(theR)
3223 RaiseIfFailed("MakeSphereR", self.PrimOp)
3224 anObj.SetParameters(Parameters)
3225 self._autoPublish(anObj, theName, "sphere")
3228 ## Create a cone with given base point, axis, height and radiuses.
3229 # @param thePnt Central point of the first cone base.
3230 # @param theAxis Cone axis.
3231 # @param theR1 Radius of the first cone base.
3232 # @param theR2 Radius of the second cone base.
3233 # \note If both radiuses are non-zero, the cone will be truncated.
3234 # \note If the radiuses are equal, a cylinder will be created instead.
3235 # @param theH Cone height.
3236 # @param theName Object name; when specified, this parameter is used
3237 # for result publication in the study. Otherwise, if automatic
3238 # publication is switched on, default value is used for result name.
3240 # @return New GEOM.GEOM_Object, containing the created cone.
3242 # @ref tui_creation_cone "Example"
3243 @ManageTransactions("PrimOp")
3244 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3246 Create a cone with given base point, axis, height and radiuses.
3249 thePnt Central point of the first cone base.
3251 theR1 Radius of the first cone base.
3252 theR2 Radius of the second cone base.
3254 theName Object name; when specified, this parameter is used
3255 for result publication in the study. Otherwise, if automatic
3256 publication is switched on, default value is used for result name.
3259 If both radiuses are non-zero, the cone will be truncated.
3260 If the radiuses are equal, a cylinder will be created instead.
3263 New GEOM.GEOM_Object, containing the created cone.
3265 # Example: see GEOM_TestAll.py
3266 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3267 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3268 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3269 anObj.SetParameters(Parameters)
3270 self._autoPublish(anObj, theName, "cone")
3273 ## Create a cone with given height and radiuses at
3274 # the origin of coordinate system. Axis of the cone will
3275 # be collinear to the OZ axis of the coordinate system.
3276 # @param theR1 Radius of the first cone base.
3277 # @param theR2 Radius of the second cone base.
3278 # \note If both radiuses are non-zero, the cone will be truncated.
3279 # \note If the radiuses are equal, a cylinder will be created instead.
3280 # @param theH Cone height.
3281 # @param theName Object name; when specified, this parameter is used
3282 # for result publication in the study. Otherwise, if automatic
3283 # publication is switched on, default value is used for result name.
3285 # @return New GEOM.GEOM_Object, containing the created cone.
3287 # @ref tui_creation_cone "Example"
3288 @ManageTransactions("PrimOp")
3289 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3291 Create a cone with given height and radiuses at
3292 the origin of coordinate system. Axis of the cone will
3293 be collinear to the OZ axis of the coordinate system.
3296 theR1 Radius of the first cone base.
3297 theR2 Radius of the second cone base.
3299 theName Object name; when specified, this parameter is used
3300 for result publication in the study. Otherwise, if automatic
3301 publication is switched on, default value is used for result name.
3304 If both radiuses are non-zero, the cone will be truncated.
3305 If the radiuses are equal, a cylinder will be created instead.
3308 New GEOM.GEOM_Object, containing the created cone.
3310 # Example: see GEOM_TestAll.py
3311 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3312 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3313 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3314 anObj.SetParameters(Parameters)
3315 self._autoPublish(anObj, theName, "cone")
3318 ## Create a torus with given center, normal vector and radiuses.
3319 # @param thePnt Torus central point.
3320 # @param theVec Torus axis of symmetry.
3321 # @param theRMajor Torus major radius.
3322 # @param theRMinor Torus minor radius.
3323 # @param theName Object name; when specified, this parameter is used
3324 # for result publication in the study. Otherwise, if automatic
3325 # publication is switched on, default value is used for result name.
3327 # @return New GEOM.GEOM_Object, containing the created torus.
3329 # @ref tui_creation_torus "Example"
3330 @ManageTransactions("PrimOp")
3331 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3333 Create a torus with given center, normal vector and radiuses.
3336 thePnt Torus central point.
3337 theVec Torus axis of symmetry.
3338 theRMajor Torus major radius.
3339 theRMinor Torus minor radius.
3340 theName Object name; when specified, this parameter is used
3341 for result publication in the study. Otherwise, if automatic
3342 publication is switched on, default value is used for result name.
3345 New GEOM.GEOM_Object, containing the created torus.
3347 # Example: see GEOM_TestAll.py
3348 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3349 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3350 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3351 anObj.SetParameters(Parameters)
3352 self._autoPublish(anObj, theName, "torus")
3355 ## Create a torus with given radiuses at the origin of coordinate system.
3356 # @param theRMajor Torus major radius.
3357 # @param theRMinor Torus minor radius.
3358 # @param theName Object name; when specified, this parameter is used
3359 # for result publication in the study. Otherwise, if automatic
3360 # publication is switched on, default value is used for result name.
3362 # @return New GEOM.GEOM_Object, containing the created torus.
3364 # @ref tui_creation_torus "Example"
3365 @ManageTransactions("PrimOp")
3366 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3368 Create a torus with given radiuses at the origin of coordinate system.
3371 theRMajor Torus major radius.
3372 theRMinor Torus minor radius.
3373 theName Object name; when specified, this parameter is used
3374 for result publication in the study. Otherwise, if automatic
3375 publication is switched on, default value is used for result name.
3378 New GEOM.GEOM_Object, containing the created torus.
3380 # Example: see GEOM_TestAll.py
3381 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3382 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3383 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3384 anObj.SetParameters(Parameters)
3385 self._autoPublish(anObj, theName, "torus")
3388 # end of l3_3d_primitives
3391 ## @addtogroup l3_complex
3394 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3395 # @param theBase Base shape to be extruded.
3396 # @param thePoint1 First end of extrusion vector.
3397 # @param thePoint2 Second end of extrusion vector.
3398 # @param theScaleFactor Use it to make prism with scaled second base.
3399 # Nagative value means not scaled second base.
3400 # @param theName Object name; when specified, this parameter is used
3401 # for result publication in the study. Otherwise, if automatic
3402 # publication is switched on, default value is used for result name.
3404 # @return New GEOM.GEOM_Object, containing the created prism.
3406 # @ref tui_creation_prism "Example"
3407 @ManageTransactions("PrimOp")
3408 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3410 Create a shape by extrusion of the base shape along a vector, defined by two points.
3413 theBase Base shape to be extruded.
3414 thePoint1 First end of extrusion vector.
3415 thePoint2 Second end of extrusion vector.
3416 theScaleFactor Use it to make prism with scaled second base.
3417 Nagative value means not scaled second base.
3418 theName Object name; when specified, this parameter is used
3419 for result publication in the study. Otherwise, if automatic
3420 publication is switched on, default value is used for result name.
3423 New GEOM.GEOM_Object, containing the created prism.
3425 # Example: see GEOM_TestAll.py
3428 if theScaleFactor > 0:
3429 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3430 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3432 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3433 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3434 anObj.SetParameters(Parameters)
3435 self._autoPublish(anObj, theName, "prism")
3438 ## Create a shape by extrusion of the base shape along a
3439 # vector, defined by two points, in 2 Ways (forward/backward).
3440 # @param theBase Base shape to be extruded.
3441 # @param thePoint1 First end of extrusion vector.
3442 # @param thePoint2 Second end of extrusion vector.
3443 # @param theName Object name; when specified, this parameter is used
3444 # for result publication in the study. Otherwise, if automatic
3445 # publication is switched on, default value is used for result name.
3447 # @return New GEOM.GEOM_Object, containing the created prism.
3449 # @ref tui_creation_prism "Example"
3450 @ManageTransactions("PrimOp")
3451 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3453 Create a shape by extrusion of the base shape along a
3454 vector, defined by two points, in 2 Ways (forward/backward).
3457 theBase Base shape to be extruded.
3458 thePoint1 First end of extrusion vector.
3459 thePoint2 Second end of extrusion vector.
3460 theName Object name; when specified, this parameter is used
3461 for result publication in the study. Otherwise, if automatic
3462 publication is switched on, default value is used for result name.
3465 New GEOM.GEOM_Object, containing the created prism.
3467 # Example: see GEOM_TestAll.py
3468 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3469 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3470 self._autoPublish(anObj, theName, "prism")
3473 ## Create a shape by extrusion of the base shape along the vector,
3474 # i.e. all the space, transfixed by the base shape during its translation
3475 # along the vector on the given distance.
3476 # @param theBase Base shape to be extruded.
3477 # @param theVec Direction of extrusion.
3478 # @param theH Prism dimension along theVec.
3479 # @param theScaleFactor Use it to make prism with scaled second base.
3480 # Negative value means not scaled second base.
3481 # @param theName Object name; when specified, this parameter is used
3482 # for result publication in the study. Otherwise, if automatic
3483 # publication is switched on, default value is used for result name.
3485 # @return New GEOM.GEOM_Object, containing the created prism.
3487 # @ref tui_creation_prism "Example"
3488 @ManageTransactions("PrimOp")
3489 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3491 Create a shape by extrusion of the base shape along the vector,
3492 i.e. all the space, transfixed by the base shape during its translation
3493 along the vector on the given distance.
3496 theBase Base shape to be extruded.
3497 theVec Direction of extrusion.
3498 theH Prism dimension along theVec.
3499 theScaleFactor Use it to make prism with scaled second base.
3500 Negative value means not scaled second base.
3501 theName Object name; when specified, this parameter is used
3502 for result publication in the study. Otherwise, if automatic
3503 publication is switched on, default value is used for result name.
3506 New GEOM.GEOM_Object, containing the created prism.
3508 # Example: see GEOM_TestAll.py
3511 if theScaleFactor > 0:
3512 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3513 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3515 theH,Parameters = ParseParameters(theH)
3516 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3517 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3518 anObj.SetParameters(Parameters)
3519 self._autoPublish(anObj, theName, "prism")
3522 ## Create a shape by extrusion of the base shape along the vector,
3523 # i.e. all the space, transfixed by the base shape during its translation
3524 # along the vector on the given distance in 2 Ways (forward/backward).
3525 # @param theBase Base shape to be extruded.
3526 # @param theVec Direction of extrusion.
3527 # @param theH Prism dimension along theVec in forward direction.
3528 # @param theName Object name; when specified, this parameter is used
3529 # for result publication in the study. Otherwise, if automatic
3530 # publication is switched on, default value is used for result name.
3532 # @return New GEOM.GEOM_Object, containing the created prism.
3534 # @ref tui_creation_prism "Example"
3535 @ManageTransactions("PrimOp")
3536 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3538 Create a shape by extrusion of the base shape along the vector,
3539 i.e. all the space, transfixed by the base shape during its translation
3540 along the vector on the given distance in 2 Ways (forward/backward).
3543 theBase Base shape to be extruded.
3544 theVec Direction of extrusion.
3545 theH Prism dimension along theVec in forward direction.
3546 theName Object name; when specified, this parameter is used
3547 for result publication in the study. Otherwise, if automatic
3548 publication is switched on, default value is used for result name.
3551 New GEOM.GEOM_Object, containing the created prism.
3553 # Example: see GEOM_TestAll.py
3554 theH,Parameters = ParseParameters(theH)
3555 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3556 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3557 anObj.SetParameters(Parameters)
3558 self._autoPublish(anObj, theName, "prism")
3561 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3562 # @param theBase Base shape to be extruded.
3563 # @param theDX, theDY, theDZ Directions of extrusion.
3564 # @param theScaleFactor Use it to make prism with scaled second base.
3565 # Nagative value means not scaled second base.
3566 # @param theName Object name; when specified, this parameter is used
3567 # for result publication in the study. Otherwise, if automatic
3568 # publication is switched on, default value is used for result name.
3570 # @return New GEOM.GEOM_Object, containing the created prism.
3572 # @ref tui_creation_prism "Example"
3573 @ManageTransactions("PrimOp")
3574 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3576 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3579 theBase Base shape to be extruded.
3580 theDX, theDY, theDZ Directions of extrusion.
3581 theScaleFactor Use it to make prism with scaled second base.
3582 Nagative value means not scaled second base.
3583 theName Object name; when specified, this parameter is used
3584 for result publication in the study. Otherwise, if automatic
3585 publication is switched on, default value is used for result name.
3588 New GEOM.GEOM_Object, containing the created prism.
3590 # Example: see GEOM_TestAll.py
3593 if theScaleFactor > 0:
3594 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3595 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3597 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3598 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3599 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3600 anObj.SetParameters(Parameters)
3601 self._autoPublish(anObj, theName, "prism")
3604 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3605 # i.e. all the space, transfixed by the base shape during its translation
3606 # along the vector on the given distance in 2 Ways (forward/backward).
3607 # @param theBase Base shape to be extruded.
3608 # @param theDX, theDY, theDZ Directions of extrusion.
3609 # @param theName Object name; when specified, this parameter is used
3610 # for result publication in the study. Otherwise, if automatic
3611 # publication is switched on, default value is used for result name.
3613 # @return New GEOM.GEOM_Object, containing the created prism.
3615 # @ref tui_creation_prism "Example"
3616 @ManageTransactions("PrimOp")
3617 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3619 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3620 i.e. all the space, transfixed by the base shape during its translation
3621 along the vector on the given distance in 2 Ways (forward/backward).
3624 theBase Base shape to be extruded.
3625 theDX, theDY, theDZ Directions of extrusion.
3626 theName Object name; when specified, this parameter is used
3627 for result publication in the study. Otherwise, if automatic
3628 publication is switched on, default value is used for result name.
3631 New GEOM.GEOM_Object, containing the created prism.
3633 # Example: see GEOM_TestAll.py
3634 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3635 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3636 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3637 anObj.SetParameters(Parameters)
3638 self._autoPublish(anObj, theName, "prism")
3641 ## Create a shape by revolution of the base shape around the axis
3642 # on the given angle, i.e. all the space, transfixed by the base
3643 # shape during its rotation around the axis on the given angle.
3644 # @param theBase Base shape to be rotated.
3645 # @param theAxis Rotation axis.
3646 # @param theAngle Rotation angle in radians.
3647 # @param theName Object name; when specified, this parameter is used
3648 # for result publication in the study. Otherwise, if automatic
3649 # publication is switched on, default value is used for result name.
3651 # @return New GEOM.GEOM_Object, containing the created revolution.
3653 # @ref tui_creation_revolution "Example"
3654 @ManageTransactions("PrimOp")
3655 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3657 Create a shape by revolution of the base shape around the axis
3658 on the given angle, i.e. all the space, transfixed by the base
3659 shape during its rotation around the axis on the given angle.
3662 theBase Base shape to be rotated.
3663 theAxis Rotation axis.
3664 theAngle Rotation angle in radians.
3665 theName Object name; when specified, this parameter is used
3666 for result publication in the study. Otherwise, if automatic
3667 publication is switched on, default value is used for result name.
3670 New GEOM.GEOM_Object, containing the created revolution.
3672 # Example: see GEOM_TestAll.py
3673 theAngle,Parameters = ParseParameters(theAngle)
3674 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3675 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3676 anObj.SetParameters(Parameters)
3677 self._autoPublish(anObj, theName, "revolution")
3680 ## Create a shape by revolution of the base shape around the axis
3681 # on the given angle, i.e. all the space, transfixed by the base
3682 # shape during its rotation around the axis on the given angle in
3683 # both directions (forward/backward)
3684 # @param theBase Base shape to be rotated.
3685 # @param theAxis Rotation axis.
3686 # @param theAngle Rotation angle in radians.
3687 # @param theName Object name; when specified, this parameter is used
3688 # for result publication in the study. Otherwise, if automatic
3689 # publication is switched on, default value is used for result name.
3691 # @return New GEOM.GEOM_Object, containing the created revolution.
3693 # @ref tui_creation_revolution "Example"
3694 @ManageTransactions("PrimOp")
3695 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3697 Create a shape by revolution of the base shape around the axis
3698 on the given angle, i.e. all the space, transfixed by the base
3699 shape during its rotation around the axis on the given angle in
3700 both directions (forward/backward).
3703 theBase Base shape to be rotated.
3704 theAxis Rotation axis.
3705 theAngle Rotation angle in radians.
3706 theName Object name; when specified, this parameter is used
3707 for result publication in the study. Otherwise, if automatic
3708 publication is switched on, default value is used for result name.
3711 New GEOM.GEOM_Object, containing the created revolution.
3713 theAngle,Parameters = ParseParameters(theAngle)
3714 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3715 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3716 anObj.SetParameters(Parameters)
3717 self._autoPublish(anObj, theName, "revolution")
3720 ## Create a filling from the given compound of contours.
3721 # @param theShape the compound of contours
3722 # @param theMinDeg a minimal degree of BSpline surface to create
3723 # @param theMaxDeg a maximal degree of BSpline surface to create
3724 # @param theTol2D a 2d tolerance to be reached
3725 # @param theTol3D a 3d tolerance to be reached
3726 # @param theNbIter a number of iteration of approximation algorithm
3727 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3728 # @param isApprox if True, BSpline curves are generated in the process
3729 # of surface construction. By default it is False, that means
3730 # the surface is created using given curves. The usage of
3731 # Approximation makes the algorithm work slower, but allows
3732 # building the surface for rather complex cases.
3733 # @param theName Object name; when specified, this parameter is used
3734 # for result publication in the study. Otherwise, if automatic
3735 # publication is switched on, default value is used for result name.
3737 # @return New GEOM.GEOM_Object, containing the created filling surface.
3739 # @ref tui_creation_filling "Example"
3740 @ManageTransactions("PrimOp")
3741 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3742 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3744 Create a filling from the given compound of contours.
3747 theShape the compound of contours
3748 theMinDeg a minimal degree of BSpline surface to create
3749 theMaxDeg a maximal degree of BSpline surface to create
3750 theTol2D a 2d tolerance to be reached
3751 theTol3D a 3d tolerance to be reached
3752 theNbIter a number of iteration of approximation algorithm
3753 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3754 isApprox if True, BSpline curves are generated in the process
3755 of surface construction. By default it is False, that means
3756 the surface is created using given curves. The usage of
3757 Approximation makes the algorithm work slower, but allows
3758 building the surface for rather complex cases
3759 theName Object name; when specified, this parameter is used
3760 for result publication in the study. Otherwise, if automatic
3761 publication is switched on, default value is used for result name.
3764 New GEOM.GEOM_Object, containing the created filling surface.
3767 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3769 # Example: see GEOM_TestAll.py
3770 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3771 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3772 theTol2D, theTol3D, theNbIter,
3773 theMethod, isApprox)
3774 RaiseIfFailed("MakeFilling", self.PrimOp)
3775 anObj.SetParameters(Parameters)
3776 self._autoPublish(anObj, theName, "filling")
3780 ## Create a filling from the given compound of contours.
3781 # This method corresponds to MakeFilling with isApprox=True
3782 # @param theShape the compound of contours
3783 # @param theMinDeg a minimal degree of BSpline surface to create
3784 # @param theMaxDeg a maximal degree of BSpline surface to create
3785 # @param theTol3D a 3d tolerance to be reached
3786 # @param theName Object name; when specified, this parameter is used
3787 # for result publication in the study. Otherwise, if automatic
3788 # publication is switched on, default value is used for result name.
3790 # @return New GEOM.GEOM_Object, containing the created filling surface.
3792 # @ref tui_creation_filling "Example"
3793 @ManageTransactions("PrimOp")
3794 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3796 Create a filling from the given compound of contours.
3797 This method corresponds to MakeFilling with isApprox=True
3800 theShape the compound of contours
3801 theMinDeg a minimal degree of BSpline surface to create
3802 theMaxDeg a maximal degree of BSpline surface to create
3803 theTol3D a 3d tolerance to be reached
3804 theName Object name; when specified, this parameter is used
3805 for result publication in the study. Otherwise, if automatic
3806 publication is switched on, default value is used for result name.
3809 New GEOM.GEOM_Object, containing the created filling surface.
3812 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3814 # Example: see GEOM_TestAll.py
3815 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3816 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3817 0, theTol3D, 0, GEOM.FOM_Default, True)
3818 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3819 anObj.SetParameters(Parameters)
3820 self._autoPublish(anObj, theName, "filling")
3823 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3824 # @param theSeqSections - set of specified sections.
3825 # @param theModeSolid - mode defining building solid or shell
3826 # @param thePreci - precision 3D used for smoothing
3827 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3828 # @param theName Object name; when specified, this parameter is used
3829 # for result publication in the study. Otherwise, if automatic
3830 # publication is switched on, default value is used for result name.
3832 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3834 # @ref swig_todo "Example"
3835 @ManageTransactions("PrimOp")
3836 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3838 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3841 theSeqSections - set of specified sections.
3842 theModeSolid - mode defining building solid or shell
3843 thePreci - precision 3D used for smoothing
3844 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3845 theName Object name; when specified, this parameter is used
3846 for result publication in the study. Otherwise, if automatic
3847 publication is switched on, default value is used for result name.
3850 New GEOM.GEOM_Object, containing the created shell or solid.
3852 # Example: see GEOM_TestAll.py
3853 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3854 RaiseIfFailed("MakeThruSections", self.PrimOp)
3855 self._autoPublish(anObj, theName, "filling")
3858 ## Create a shape by extrusion of the base shape along
3859 # the path shape. The path shape can be a wire or an edge.
3860 # @param theBase Base shape to be extruded.
3861 # @param thePath Path shape to extrude the base shape along it.
3862 # @param theName Object name; when specified, this parameter is used
3863 # for result publication in the study. Otherwise, if automatic
3864 # publication is switched on, default value is used for result name.
3866 # @return New GEOM.GEOM_Object, containing the created pipe.
3868 # @ref tui_creation_pipe "Example"
3869 @ManageTransactions("PrimOp")
3870 def MakePipe(self, theBase, thePath, theName=None):
3872 Create a shape by extrusion of the base shape along
3873 the path shape. The path shape can be a wire or an edge.
3876 theBase Base shape to be extruded.
3877 thePath Path shape to extrude the base shape along it.
3878 theName Object name; when specified, this parameter is used
3879 for result publication in the study. Otherwise, if automatic
3880 publication is switched on, default value is used for result name.
3883 New GEOM.GEOM_Object, containing the created pipe.
3885 # Example: see GEOM_TestAll.py
3886 anObj = self.PrimOp.MakePipe(theBase, thePath)
3887 RaiseIfFailed("MakePipe", self.PrimOp)
3888 self._autoPublish(anObj, theName, "pipe")
3891 ## Create a shape by extrusion of the profile shape along
3892 # the path shape. The path shape can be a wire or an edge.
3893 # the several profiles can be specified in the several locations of path.
3894 # @param theSeqBases - list of Bases shape to be extruded.
3895 # @param theLocations - list of locations on the path corresponding
3896 # specified list of the Bases shapes. Number of locations
3897 # should be equal to number of bases or list of locations can be empty.
3898 # @param thePath - Path shape to extrude the base shape along it.
3899 # @param theWithContact - the mode defining that the section is translated to be in
3900 # contact with the spine.
3901 # @param theWithCorrection - defining that the section is rotated to be
3902 # orthogonal to the spine tangent in the correspondent point
3903 # @param theName Object name; when specified, this parameter is used
3904 # for result publication in the study. Otherwise, if automatic
3905 # publication is switched on, default value is used for result name.
3907 # @return New GEOM.GEOM_Object, containing the created pipe.
3909 # @ref tui_creation_pipe_with_diff_sec "Example"
3910 @ManageTransactions("PrimOp")
3911 def MakePipeWithDifferentSections(self, theSeqBases,
3912 theLocations, thePath,
3913 theWithContact, theWithCorrection, theName=None):
3915 Create a shape by extrusion of the profile shape along
3916 the path shape. The path shape can be a wire or an edge.
3917 the several profiles can be specified in the several locations of path.
3920 theSeqBases - list of Bases shape to be extruded.
3921 theLocations - list of locations on the path corresponding
3922 specified list of the Bases shapes. Number of locations
3923 should be equal to number of bases or list of locations can be empty.
3924 thePath - Path shape to extrude the base shape along it.
3925 theWithContact - the mode defining that the section is translated to be in
3926 contact with the spine(0/1)
3927 theWithCorrection - defining that the section is rotated to be
3928 orthogonal to the spine tangent in the correspondent point (0/1)
3929 theName Object name; when specified, this parameter is used
3930 for result publication in the study. Otherwise, if automatic
3931 publication is switched on, default value is used for result name.
3934 New GEOM.GEOM_Object, containing the created pipe.
3936 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3937 theLocations, thePath,
3938 theWithContact, theWithCorrection)
3939 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3940 self._autoPublish(anObj, theName, "pipe")
3943 ## Create a shape by extrusion of the profile shape along
3944 # the path shape. The path shape can be a wire or a edge.
3945 # the several profiles can be specified in the several locations of path.
3946 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3947 # shell or face. If number of faces in neighbour sections
3948 # aren't coincided result solid between such sections will
3949 # be created using external boundaries of this shells.
3950 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3951 # This list is used for searching correspondences between
3952 # faces in the sections. Size of this list must be equal
3953 # to size of list of base shapes.
3954 # @param theLocations - list of locations on the path corresponding
3955 # specified list of the Bases shapes. Number of locations
3956 # should be equal to number of bases. First and last
3957 # locations must be coincided with first and last vertexes
3958 # of path correspondingly.
3959 # @param thePath - Path shape to extrude the base shape along it.
3960 # @param theWithContact - the mode defining that the section is translated to be in
3961 # contact with the spine.
3962 # @param theWithCorrection - defining that the section is rotated to be
3963 # orthogonal to the spine tangent in the correspondent point
3964 # @param theName Object name; when specified, this parameter is used
3965 # for result publication in the study. Otherwise, if automatic
3966 # publication is switched on, default value is used for result name.
3968 # @return New GEOM.GEOM_Object, containing the created solids.
3970 # @ref tui_creation_pipe_with_shell_sec "Example"
3971 @ManageTransactions("PrimOp")
3972 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3973 theLocations, thePath,
3974 theWithContact, theWithCorrection, theName=None):
3976 Create a shape by extrusion of the profile shape along
3977 the path shape. The path shape can be a wire or a edge.
3978 the several profiles can be specified in the several locations of path.
3981 theSeqBases - list of Bases shape to be extruded. Base shape must be
3982 shell or face. If number of faces in neighbour sections
3983 aren't coincided result solid between such sections will
3984 be created using external boundaries of this shells.
3985 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3986 This list is used for searching correspondences between
3987 faces in the sections. Size of this list must be equal
3988 to size of list of base shapes.
3989 theLocations - list of locations on the path corresponding
3990 specified list of the Bases shapes. Number of locations
3991 should be equal to number of bases. First and last
3992 locations must be coincided with first and last vertexes
3993 of path correspondingly.
3994 thePath - Path shape to extrude the base shape along it.
3995 theWithContact - the mode defining that the section is translated to be in
3996 contact with the spine (0/1)
3997 theWithCorrection - defining that the section is rotated to be
3998 orthogonal to the spine tangent in the correspondent point (0/1)
3999 theName Object name; when specified, this parameter is used
4000 for result publication in the study. Otherwise, if automatic
4001 publication is switched on, default value is used for result name.
4004 New GEOM.GEOM_Object, containing the created solids.
4006 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4007 theLocations, thePath,
4008 theWithContact, theWithCorrection)
4009 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4010 self._autoPublish(anObj, theName, "pipe")
4013 ## Create a shape by extrusion of the profile shape along
4014 # the path shape. This function is used only for debug pipe
4015 # functionality - it is a version of function MakePipeWithShellSections()
4016 # which give a possibility to recieve information about
4017 # creating pipe between each pair of sections step by step.
4018 @ManageTransactions("PrimOp")
4019 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4020 theLocations, thePath,
4021 theWithContact, theWithCorrection, theName=None):
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 previous function
4026 geompy.MakePipeWithShellSections() which give a possibility to
4027 recieve information about creating pipe between each pair of
4028 sections step by step.
4031 nbsect = len(theSeqBases)
4032 nbsubsect = len(theSeqSubBases)
4033 #print "nbsect = ",nbsect
4034 for i in range(1,nbsect):
4036 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4037 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4039 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4040 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4041 tmpLocations, thePath,
4042 theWithContact, theWithCorrection)
4043 if self.PrimOp.IsDone() == 0:
4044 print "Problems with pipe creation between ",i," and ",i+1," sections"
4045 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4048 print "Pipe between ",i," and ",i+1," sections is OK"
4053 resc = self.MakeCompound(res)
4054 #resc = self.MakeSewing(res, 0.001)
4055 #print "resc: ",resc
4056 self._autoPublish(resc, theName, "pipe")
4059 ## Create solids between given sections
4060 # @param theSeqBases - list of sections (shell or face).
4061 # @param theLocations - list of corresponding vertexes
4062 # @param theName Object name; when specified, this parameter is used
4063 # for result publication in the study. Otherwise, if automatic
4064 # publication is switched on, default value is used for result name.
4066 # @return New GEOM.GEOM_Object, containing the created solids.
4068 # @ref tui_creation_pipe_without_path "Example"
4069 @ManageTransactions("PrimOp")
4070 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4072 Create solids between given sections
4075 theSeqBases - list of sections (shell or face).
4076 theLocations - list of corresponding vertexes
4077 theName Object name; when specified, this parameter is used
4078 for result publication in the study. Otherwise, if automatic
4079 publication is switched on, default value is used for result name.
4082 New GEOM.GEOM_Object, containing the created solids.
4084 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4085 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4086 self._autoPublish(anObj, theName, "pipe")
4089 ## Create a shape by extrusion of the base shape along
4090 # the path shape with constant bi-normal direction along the given vector.
4091 # The path shape can be a wire or an edge.
4092 # @param theBase Base shape to be extruded.
4093 # @param thePath Path shape to extrude the base shape along it.
4094 # @param theVec Vector defines a constant binormal direction to keep the
4095 # same angle beetween the direction and the sections
4096 # along the sweep surface.
4097 # @param theName Object name; when specified, this parameter is used
4098 # for result publication in the study. Otherwise, if automatic
4099 # publication is switched on, default value is used for result name.
4101 # @return New GEOM.GEOM_Object, containing the created pipe.
4103 # @ref tui_creation_pipe "Example"
4104 @ManageTransactions("PrimOp")
4105 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4107 Create a shape by extrusion of the base shape along
4108 the path shape with constant bi-normal direction along the given vector.
4109 The path shape can be a wire or an edge.
4112 theBase Base shape to be extruded.
4113 thePath Path shape to extrude the base shape along it.
4114 theVec Vector defines a constant binormal direction to keep the
4115 same angle beetween the direction and the sections
4116 along the sweep surface.
4117 theName Object name; when specified, this parameter is used
4118 for result publication in the study. Otherwise, if automatic
4119 publication is switched on, default value is used for result name.
4122 New GEOM.GEOM_Object, containing the created pipe.
4124 # Example: see GEOM_TestAll.py
4125 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4126 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4127 self._autoPublish(anObj, theName, "pipe")
4130 ## Makes a thick solid from a face or a shell
4131 # @param theShape Face or Shell to be thicken
4132 # @param theThickness Thickness of the resulting solid
4133 # @param theName Object name; when specified, this parameter is used
4134 # for result publication in the study. Otherwise, if automatic
4135 # publication is switched on, default value is used for result name.
4137 # @return New GEOM.GEOM_Object, containing the created solid
4139 @ManageTransactions("PrimOp")
4140 def MakeThickSolid(self, theShape, theThickness, theName=None):
4142 Make a thick solid from a face or a shell
4145 theShape Face or Shell to be thicken
4146 theThickness Thickness of the resulting solid
4147 theName Object name; when specified, this parameter is used
4148 for result publication in the study. Otherwise, if automatic
4149 publication is switched on, default value is used for result name.
4152 New GEOM.GEOM_Object, containing the created solid
4154 # Example: see GEOM_TestAll.py
4155 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4156 RaiseIfFailed("MakeThickening", self.PrimOp)
4157 self._autoPublish(anObj, theName, "pipe")
4161 ## Modifies a face or a shell to make it a thick solid
4162 # @param theShape Face or Shell to be thicken
4163 # @param theThickness Thickness of the resulting solid
4165 # @return The modified shape
4167 @ManageTransactions("PrimOp")
4168 def Thicken(self, theShape, theThickness):
4170 Modifies a face or a shell to make it a thick solid
4173 theBase Base shape to be extruded.
4174 thePath Path shape to extrude the base shape along it.
4175 theName Object name; when specified, this parameter is used
4176 for result publication in the study. Otherwise, if automatic
4177 publication is switched on, default value is used for result name.
4182 # Example: see GEOM_TestAll.py
4183 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4184 RaiseIfFailed("MakeThickening", self.PrimOp)
4187 ## Build a middle path of a pipe-like shape.
4188 # The path shape can be a wire or an edge.
4189 # @param theShape It can be closed or unclosed pipe-like shell
4190 # or a pipe-like solid.
4191 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4192 # should be wires or faces of theShape.
4193 # @param theName Object name; when specified, this parameter is used
4194 # for result publication in the study. Otherwise, if automatic
4195 # publication is switched on, default value is used for result name.
4197 # @note It is not assumed that exact or approximate copy of theShape
4198 # can be obtained by applying existing Pipe operation on the
4199 # resulting "Path" wire taking theBase1 as the base - it is not
4200 # always possible; though in some particular cases it might work
4201 # it is not guaranteed. Thus, RestorePath function should not be
4202 # considered as an exact reverse operation of the Pipe.
4204 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4205 # source pipe's "path".
4207 # @ref tui_creation_pipe_path "Example"
4208 @ManageTransactions("PrimOp")
4209 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4211 Build a middle path of a pipe-like shape.
4212 The path shape can be a wire or an edge.
4215 theShape It can be closed or unclosed pipe-like shell
4216 or a pipe-like solid.
4217 theBase1, theBase2 Two bases of the supposed pipe. This
4218 should be wires or faces of theShape.
4219 theName Object name; when specified, this parameter is used
4220 for result publication in the study. Otherwise, if automatic
4221 publication is switched on, default value is used for result name.
4224 New GEOM_Object, containing an edge or wire that represent
4227 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4228 RaiseIfFailed("RestorePath", self.PrimOp)
4229 self._autoPublish(anObj, theName, "path")
4232 ## Build a middle path of a pipe-like shape.
4233 # The path shape can be a wire or an edge.
4234 # @param theShape It can be closed or unclosed pipe-like shell
4235 # or a pipe-like solid.
4236 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4237 # should be lists of edges of theShape.
4238 # @param theName Object name; when specified, this parameter is used
4239 # for result publication in the study. Otherwise, if automatic
4240 # publication is switched on, default value is used for result name.
4242 # @note It is not assumed that exact or approximate copy of theShape
4243 # can be obtained by applying existing Pipe operation on the
4244 # resulting "Path" wire taking theBase1 as the base - it is not
4245 # always possible; though in some particular cases it might work
4246 # it is not guaranteed. Thus, RestorePath function should not be
4247 # considered as an exact reverse operation of the Pipe.
4249 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4250 # source pipe's "path".
4252 # @ref tui_creation_pipe_path "Example"
4253 @ManageTransactions("PrimOp")
4254 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4256 Build a middle path of a pipe-like shape.
4257 The path shape can be a wire or an edge.
4260 theShape It can be closed or unclosed pipe-like shell
4261 or a pipe-like solid.
4262 listEdges1, listEdges2 Two bases of the supposed pipe. This
4263 should be lists of edges of theShape.
4264 theName Object name; when specified, this parameter is used
4265 for result publication in the study. Otherwise, if automatic
4266 publication is switched on, default value is used for result name.
4269 New GEOM_Object, containing an edge or wire that represent
4272 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4273 RaiseIfFailed("RestorePath", self.PrimOp)
4274 self._autoPublish(anObj, theName, "path")
4280 ## @addtogroup l3_advanced
4283 ## Create a linear edge with specified ends.
4284 # @param thePnt1 Point for the first end of edge.
4285 # @param thePnt2 Point for the second end of edge.
4286 # @param theName Object name; when specified, this parameter is used
4287 # for result publication in the study. Otherwise, if automatic
4288 # publication is switched on, default value is used for result name.
4290 # @return New GEOM.GEOM_Object, containing the created edge.
4292 # @ref tui_creation_edge "Example"
4293 @ManageTransactions("ShapesOp")
4294 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4296 Create a linear edge with specified ends.
4299 thePnt1 Point for the first end of edge.
4300 thePnt2 Point for the second end of edge.
4301 theName Object name; when specified, this parameter is used
4302 for result publication in the study. Otherwise, if automatic
4303 publication is switched on, default value is used for result name.
4306 New GEOM.GEOM_Object, containing the created edge.
4308 # Example: see GEOM_TestAll.py
4309 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4310 RaiseIfFailed("MakeEdge", self.ShapesOp)
4311 self._autoPublish(anObj, theName, "edge")
4314 ## Create a new edge, corresponding to the given length on the given curve.
4315 # @param theRefCurve The referenced curve (edge).
4316 # @param theLength Length on the referenced curve. It can be negative.
4317 # @param theStartPoint Any point can be selected for it, the new edge will begin
4318 # at the end of \a theRefCurve, close to the selected point.
4319 # If None, start from the first point of \a theRefCurve.
4320 # @param theName Object name; when specified, this parameter is used
4321 # for result publication in the study. Otherwise, if automatic
4322 # publication is switched on, default value is used for result name.
4324 # @return New GEOM.GEOM_Object, containing the created edge.
4326 # @ref tui_creation_edge "Example"
4327 @ManageTransactions("ShapesOp")
4328 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4330 Create a new edge, corresponding to the given length on the given curve.
4333 theRefCurve The referenced curve (edge).
4334 theLength Length on the referenced curve. It can be negative.
4335 theStartPoint Any point can be selected for it, the new edge will begin
4336 at the end of theRefCurve, close to the selected point.
4337 If None, start from the first point of theRefCurve.
4338 theName Object name; when specified, this parameter is used
4339 for result publication in the study. Otherwise, if automatic
4340 publication is switched on, default value is used for result name.
4343 New GEOM.GEOM_Object, containing the created edge.
4345 # Example: see GEOM_TestAll.py
4346 theLength, Parameters = ParseParameters(theLength)
4347 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4348 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4349 anObj.SetParameters(Parameters)
4350 self._autoPublish(anObj, theName, "edge")
4353 ## Create an edge from specified wire.
4354 # @param theWire source Wire
4355 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4356 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4357 # @param theName Object name; when specified, this parameter is used
4358 # for result publication in the study. Otherwise, if automatic
4359 # publication is switched on, default value is used for result name.
4361 # @return New GEOM.GEOM_Object, containing the created edge.
4363 # @ref tui_creation_edge "Example"
4364 @ManageTransactions("ShapesOp")
4365 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4367 Create an edge from specified wire.
4371 theLinearTolerance linear tolerance value (default = 1e-07)
4372 theAngularTolerance angular tolerance value (default = 1e-12)
4373 theName Object name; when specified, this parameter is used
4374 for result publication in the study. Otherwise, if automatic
4375 publication is switched on, default value is used for result name.
4378 New GEOM.GEOM_Object, containing the created edge.
4380 # Example: see GEOM_TestAll.py
4381 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4382 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4383 self._autoPublish(anObj, theName, "edge")
4386 ## Create a wire from the set of edges and wires.
4387 # @param theEdgesAndWires List of edges and/or wires.
4388 # @param theTolerance Maximum distance between vertices, that will be merged.
4389 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4390 # @param theName Object name; when specified, this parameter is used
4391 # for result publication in the study. Otherwise, if automatic
4392 # publication is switched on, default value is used for result name.
4394 # @return New GEOM.GEOM_Object, containing the created wire.
4396 # @ref tui_creation_wire "Example"
4397 @ManageTransactions("ShapesOp")
4398 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4400 Create a wire from the set of edges and wires.
4403 theEdgesAndWires List of edges and/or wires.
4404 theTolerance Maximum distance between vertices, that will be merged.
4405 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4406 theName Object name; when specified, this parameter is used
4407 for result publication in the study. Otherwise, if automatic
4408 publication is switched on, default value is used for result name.
4411 New GEOM.GEOM_Object, containing the created wire.
4413 # Example: see GEOM_TestAll.py
4414 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4415 RaiseIfFailed("MakeWire", self.ShapesOp)
4416 self._autoPublish(anObj, theName, "wire")
4419 ## Create a face on the given wire.
4420 # @param theWire closed Wire or Edge to build the face on.
4421 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4422 # If the tolerance of the obtained planar face is less
4423 # than 1e-06, this face will be returned, otherwise the
4424 # algorithm tries to build any suitable face on the given
4425 # wire and prints a warning message.
4426 # @param theName Object name; when specified, this parameter is used
4427 # for result publication in the study. Otherwise, if automatic
4428 # publication is switched on, default value is used for result name.
4430 # @return New GEOM.GEOM_Object, containing the created face.
4432 # @ref tui_creation_face "Example"
4433 @ManageTransactions("ShapesOp")
4434 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4436 Create a face on the given wire.
4439 theWire closed Wire or Edge to build the face on.
4440 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4441 If the tolerance of the obtained planar face is less
4442 than 1e-06, this face will be returned, otherwise the
4443 algorithm tries to build any suitable face on the given
4444 wire and prints a warning message.
4445 theName Object name; when specified, this parameter is used
4446 for result publication in the study. Otherwise, if automatic
4447 publication is switched on, default value is used for result name.
4450 New GEOM.GEOM_Object, containing the created face.
4452 # Example: see GEOM_TestAll.py
4453 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4454 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4455 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4457 RaiseIfFailed("MakeFace", self.ShapesOp)
4458 self._autoPublish(anObj, theName, "face")
4461 ## Create a face on the given wires set.
4462 # @param theWires List of closed wires or edges to build the face on.
4463 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4464 # If the tolerance of the obtained planar face is less
4465 # than 1e-06, this face will be returned, otherwise the
4466 # algorithm tries to build any suitable face on the given
4467 # wire and prints a warning message.
4468 # @param theName Object name; when specified, this parameter is used
4469 # for result publication in the study. Otherwise, if automatic
4470 # publication is switched on, default value is used for result name.
4472 # @return New GEOM.GEOM_Object, containing the created face.
4474 # @ref tui_creation_face "Example"
4475 @ManageTransactions("ShapesOp")
4476 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4478 Create a face on the given wires set.
4481 theWires List of closed wires or edges to build the face on.
4482 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4483 If the tolerance of the obtained planar face is less
4484 than 1e-06, this face will be returned, otherwise the
4485 algorithm tries to build any suitable face on the given
4486 wire and prints a warning message.
4487 theName Object name; when specified, this parameter is used
4488 for result publication in the study. Otherwise, if automatic
4489 publication is switched on, default value is used for result name.
4492 New GEOM.GEOM_Object, containing the created face.
4494 # Example: see GEOM_TestAll.py
4495 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4496 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4497 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4499 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4500 self._autoPublish(anObj, theName, "face")
4503 ## See MakeFaceWires() method for details.
4505 # @ref tui_creation_face "Example 1"
4506 # \n @ref swig_MakeFaces "Example 2"
4507 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4509 See geompy.MakeFaceWires() method for details.
4511 # Example: see GEOM_TestOthers.py
4512 # note: auto-publishing is done in self.MakeFaceWires()
4513 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4516 ## Create a shell from the set of faces and shells.
4517 # @param theFacesAndShells List of faces and/or shells.
4518 # @param theName Object name; when specified, this parameter is used
4519 # for result publication in the study. Otherwise, if automatic
4520 # publication is switched on, default value is used for result name.
4522 # @return New GEOM.GEOM_Object, containing the created shell.
4524 # @ref tui_creation_shell "Example"
4525 @ManageTransactions("ShapesOp")
4526 def MakeShell(self, theFacesAndShells, theName=None):
4528 Create a shell from the set of faces and shells.
4531 theFacesAndShells List of faces and/or shells.
4532 theName Object name; when specified, this parameter is used
4533 for result publication in the study. Otherwise, if automatic
4534 publication is switched on, default value is used for result name.
4537 New GEOM.GEOM_Object, containing the created shell.
4539 # Example: see GEOM_TestAll.py
4540 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4541 RaiseIfFailed("MakeShell", self.ShapesOp)
4542 self._autoPublish(anObj, theName, "shell")
4545 ## Create a solid, bounded by the given shells.
4546 # @param theShells Sequence of bounding shells.
4547 # @param theName Object name; when specified, this parameter is used
4548 # for result publication in the study. Otherwise, if automatic
4549 # publication is switched on, default value is used for result name.
4551 # @return New GEOM.GEOM_Object, containing the created solid.
4553 # @ref tui_creation_solid "Example"
4554 @ManageTransactions("ShapesOp")
4555 def MakeSolid(self, theShells, theName=None):
4557 Create a solid, bounded by the given shells.
4560 theShells Sequence of bounding shells.
4561 theName Object name; when specified, this parameter is used
4562 for result publication in the study. Otherwise, if automatic
4563 publication is switched on, default value is used for result name.
4566 New GEOM.GEOM_Object, containing the created solid.
4568 # Example: see GEOM_TestAll.py
4569 if len(theShells) == 1:
4570 descr = self._IsGoodForSolid(theShells[0])
4572 # raise RuntimeError, "MakeSolidShells : " + descr
4573 if descr == "WRN_SHAPE_UNCLOSED":
4574 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4575 anObj = self.ShapesOp.MakeSolidShells(theShells)
4576 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4577 self._autoPublish(anObj, theName, "solid")
4580 ## Create a compound of the given shapes.
4581 # @param theShapes List of shapes to put in compound.
4582 # @param theName Object name; when specified, this parameter is used
4583 # for result publication in the study. Otherwise, if automatic
4584 # publication is switched on, default value is used for result name.
4586 # @return New GEOM.GEOM_Object, containing the created compound.
4588 # @ref tui_creation_compound "Example"
4589 @ManageTransactions("ShapesOp")
4590 def MakeCompound(self, theShapes, theName=None):
4592 Create a compound of the given shapes.
4595 theShapes List of shapes to put in compound.
4596 theName Object name; when specified, this parameter is used
4597 for result publication in the study. Otherwise, if automatic
4598 publication is switched on, default value is used for result name.
4601 New GEOM.GEOM_Object, containing the created compound.
4603 # Example: see GEOM_TestAll.py
4604 anObj = self.ShapesOp.MakeCompound(theShapes)
4605 RaiseIfFailed("MakeCompound", self.ShapesOp)
4606 self._autoPublish(anObj, theName, "compound")
4609 # end of l3_advanced
4612 ## @addtogroup l2_measure
4615 ## Gives quantity of faces in the given shape.
4616 # @param theShape Shape to count faces of.
4617 # @return Quantity of faces.
4619 # @ref swig_NumberOf "Example"
4620 @ManageTransactions("ShapesOp")
4621 def NumberOfFaces(self, theShape):
4623 Gives quantity of faces in the given shape.
4626 theShape Shape to count faces of.
4631 # Example: see GEOM_TestOthers.py
4632 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4633 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4636 ## Gives quantity of edges in the given shape.
4637 # @param theShape Shape to count edges of.
4638 # @return Quantity of edges.
4640 # @ref swig_NumberOf "Example"
4641 @ManageTransactions("ShapesOp")
4642 def NumberOfEdges(self, theShape):
4644 Gives quantity of edges in the given shape.
4647 theShape Shape to count edges of.
4652 # Example: see GEOM_TestOthers.py
4653 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4654 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4657 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4658 # @param theShape Shape to count sub-shapes of.
4659 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4660 # @return Quantity of sub-shapes of given type.
4662 # @ref swig_NumberOf "Example"
4663 @ManageTransactions("ShapesOp")
4664 def NumberOfSubShapes(self, theShape, theShapeType):
4666 Gives quantity of sub-shapes of type theShapeType in the given shape.
4669 theShape Shape to count sub-shapes of.
4670 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4673 Quantity of sub-shapes of given type.
4675 # Example: see GEOM_TestOthers.py
4676 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4677 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4680 ## Gives quantity of solids in the given shape.
4681 # @param theShape Shape to count solids in.
4682 # @return Quantity of solids.
4684 # @ref swig_NumberOf "Example"
4685 @ManageTransactions("ShapesOp")
4686 def NumberOfSolids(self, theShape):
4688 Gives quantity of solids in the given shape.
4691 theShape Shape to count solids in.
4696 # Example: see GEOM_TestOthers.py
4697 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4698 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4704 ## @addtogroup l3_healing
4707 ## Reverses an orientation the given shape.
4708 # @param theShape Shape to be reversed.
4709 # @param theName Object name; when specified, this parameter is used
4710 # for result publication in the study. Otherwise, if automatic
4711 # publication is switched on, default value is used for result name.
4713 # @return The reversed copy of theShape.
4715 # @ref swig_ChangeOrientation "Example"
4716 @ManageTransactions("ShapesOp")
4717 def ChangeOrientation(self, theShape, theName=None):
4719 Reverses an orientation the given shape.
4722 theShape Shape to be reversed.
4723 theName Object name; when specified, this parameter is used
4724 for result publication in the study. Otherwise, if automatic
4725 publication is switched on, default value is used for result name.
4728 The reversed copy of theShape.
4730 # Example: see GEOM_TestAll.py
4731 anObj = self.ShapesOp.ChangeOrientation(theShape)
4732 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4733 self._autoPublish(anObj, theName, "reversed")
4736 ## See ChangeOrientation() method for details.
4738 # @ref swig_OrientationChange "Example"
4739 def OrientationChange(self, theShape, theName=None):
4741 See geompy.ChangeOrientation method for details.
4743 # Example: see GEOM_TestOthers.py
4744 # note: auto-publishing is done in self.ChangeOrientation()
4745 anObj = self.ChangeOrientation(theShape, theName)
4751 ## @addtogroup l4_obtain
4754 ## Retrieve all free faces from the given shape.
4755 # Free face is a face, which is not shared between two shells of the shape.
4756 # @param theShape Shape to find free faces in.
4757 # @return List of IDs of all free faces, contained in theShape.
4759 # @ref tui_measurement_tools_page "Example"
4760 @ManageTransactions("ShapesOp")
4761 def GetFreeFacesIDs(self,theShape):
4763 Retrieve all free faces from the given shape.
4764 Free face is a face, which is not shared between two shells of the shape.
4767 theShape Shape to find free faces in.
4770 List of IDs of all free faces, contained in theShape.
4772 # Example: see GEOM_TestOthers.py
4773 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4774 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4777 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4778 # @param theShape1 Shape to find sub-shapes in.
4779 # @param theShape2 Shape to find shared sub-shapes with.
4780 # @param theShapeType Type of sub-shapes to be retrieved.
4781 # @param theName Object name; when specified, this parameter is used
4782 # for result publication in the study. Otherwise, if automatic
4783 # publication is switched on, default value is used for result name.
4785 # @return List of sub-shapes of theShape1, shared with theShape2.
4787 # @ref swig_GetSharedShapes "Example"
4788 @ManageTransactions("ShapesOp")
4789 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4791 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4794 theShape1 Shape to find sub-shapes in.
4795 theShape2 Shape to find shared sub-shapes with.
4796 theShapeType Type of sub-shapes to be retrieved.
4797 theName Object name; when specified, this parameter is used
4798 for result publication in the study. Otherwise, if automatic
4799 publication is switched on, default value is used for result name.
4802 List of sub-shapes of theShape1, shared with theShape2.
4804 # Example: see GEOM_TestOthers.py
4805 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4806 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4807 self._autoPublish(aList, theName, "shared")
4810 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4811 # @param theShapes Shapes to find common sub-shapes of.
4812 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4813 # @param theName Object name; when specified, this parameter is used
4814 # for result publication in the study. Otherwise, if automatic
4815 # publication is switched on, default value is used for result name.
4817 # @return List of objects, that are sub-shapes of all given shapes.
4819 # @ref swig_GetSharedShapes "Example"
4820 @ManageTransactions("ShapesOp")
4821 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4823 Get all sub-shapes, shared by all shapes in the list theShapes.
4826 theShapes Shapes to find common sub-shapes of.
4827 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4828 theName Object name; when specified, this parameter is used
4829 for result publication in the study. Otherwise, if automatic
4830 publication is switched on, default value is used for result name.
4833 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4835 # Example: see GEOM_TestOthers.py
4836 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4837 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4838 self._autoPublish(aList, theName, "shared")
4841 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4842 # situated relatively the specified plane by the certain way,
4843 # defined through <VAR>theState</VAR> parameter.
4844 # @param theShape Shape to find sub-shapes of.
4845 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4846 # @param theAx1 Vector (or line, or linear edge), specifying normal
4847 # direction and location of the plane to find shapes on.
4848 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4849 # @param theName Object name; when specified, this parameter is used
4850 # for result publication in the study. Otherwise, if automatic
4851 # publication is switched on, default value is used for result name.
4853 # @return List of all found sub-shapes.
4855 # @ref swig_GetShapesOnPlane "Example"
4856 @ManageTransactions("ShapesOp")
4857 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4859 Find in theShape all sub-shapes of type theShapeType,
4860 situated relatively the specified plane by the certain way,
4861 defined through theState parameter.
4864 theShape Shape to find sub-shapes of.
4865 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4866 theAx1 Vector (or line, or linear edge), specifying normal
4867 direction and location of the plane to find shapes on.
4868 theState The state of the sub-shapes to find (see GEOM::shape_state)
4869 theName Object name; when specified, this parameter is used
4870 for result publication in the study. Otherwise, if automatic
4871 publication is switched on, default value is used for result name.
4874 List of all found sub-shapes.
4876 # Example: see GEOM_TestOthers.py
4877 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4878 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4879 self._autoPublish(aList, theName, "shapeOnPlane")
4882 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4883 # situated relatively the specified plane by the certain way,
4884 # defined through <VAR>theState</VAR> parameter.
4885 # @param theShape Shape to find sub-shapes of.
4886 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4887 # @param theAx1 Vector (or line, or linear edge), specifying normal
4888 # direction and location of the plane to find shapes on.
4889 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4891 # @return List of all found sub-shapes indices.
4893 # @ref swig_GetShapesOnPlaneIDs "Example"
4894 @ManageTransactions("ShapesOp")
4895 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4897 Find in theShape all sub-shapes of type theShapeType,
4898 situated relatively the specified plane by the certain way,
4899 defined through theState parameter.
4902 theShape Shape to find sub-shapes of.
4903 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4904 theAx1 Vector (or line, or linear edge), specifying normal
4905 direction and location of the plane to find shapes on.
4906 theState The state of the sub-shapes to find (see GEOM::shape_state)
4909 List of all found sub-shapes indices.
4911 # Example: see GEOM_TestOthers.py
4912 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4913 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4916 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4917 # situated relatively the specified plane by the certain way,
4918 # defined through <VAR>theState</VAR> parameter.
4919 # @param theShape Shape to find sub-shapes of.
4920 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4921 # @param theAx1 Vector (or line, or linear edge), specifying normal
4922 # direction of the plane to find shapes on.
4923 # @param thePnt Point specifying location of the plane to find shapes on.
4924 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4925 # @param theName Object name; when specified, this parameter is used
4926 # for result publication in the study. Otherwise, if automatic
4927 # publication is switched on, default value is used for result name.
4929 # @return List of all found sub-shapes.
4931 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4932 @ManageTransactions("ShapesOp")
4933 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4935 Find in theShape all sub-shapes of type theShapeType,
4936 situated relatively the specified plane by the certain way,
4937 defined through theState parameter.
4940 theShape Shape to find sub-shapes of.
4941 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4942 theAx1 Vector (or line, or linear edge), specifying normal
4943 direction and location of the plane to find shapes on.
4944 thePnt Point specifying location of the plane to find shapes on.
4945 theState The state of the sub-shapes to find (see GEOM::shape_state)
4946 theName Object name; when specified, this parameter is used
4947 for result publication in the study. Otherwise, if automatic
4948 publication is switched on, default value is used for result name.
4951 List of all found sub-shapes.
4953 # Example: see GEOM_TestOthers.py
4954 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4955 theAx1, thePnt, theState)
4956 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4957 self._autoPublish(aList, theName, "shapeOnPlane")
4960 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4961 # situated relatively the specified plane by the certain way,
4962 # defined through <VAR>theState</VAR> parameter.
4963 # @param theShape Shape to find sub-shapes of.
4964 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4965 # @param theAx1 Vector (or line, or linear edge), specifying normal
4966 # direction of the plane to find shapes on.
4967 # @param thePnt Point specifying location of the plane to find shapes on.
4968 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4970 # @return List of all found sub-shapes indices.
4972 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4973 @ManageTransactions("ShapesOp")
4974 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4976 Find in theShape all sub-shapes of type theShapeType,
4977 situated relatively the specified plane by the certain way,
4978 defined through theState parameter.
4981 theShape Shape to find sub-shapes of.
4982 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4983 theAx1 Vector (or line, or linear edge), specifying normal
4984 direction and location of the plane to find shapes on.
4985 thePnt Point specifying location of the plane to find shapes on.
4986 theState The state of the sub-shapes to find (see GEOM::shape_state)
4989 List of all found sub-shapes indices.
4991 # Example: see GEOM_TestOthers.py
4992 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4993 theAx1, thePnt, theState)
4994 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4997 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4998 # the specified cylinder by the certain way, defined through \a theState parameter.
4999 # @param theShape Shape to find sub-shapes of.
5000 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5001 # @param theAxis Vector (or line, or linear edge), specifying
5002 # axis of the cylinder to find shapes on.
5003 # @param theRadius Radius of the cylinder to find shapes on.
5004 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5005 # @param theName Object name; when specified, this parameter is used
5006 # for result publication in the study. Otherwise, if automatic
5007 # publication is switched on, default value is used for result name.
5009 # @return List of all found sub-shapes.
5011 # @ref swig_GetShapesOnCylinder "Example"
5012 @ManageTransactions("ShapesOp")
5013 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5015 Find in theShape all sub-shapes of type theShapeType, situated relatively
5016 the specified cylinder by the certain way, defined through theState parameter.
5019 theShape Shape to find sub-shapes of.
5020 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5021 theAxis Vector (or line, or linear edge), specifying
5022 axis of the cylinder to find shapes on.
5023 theRadius Radius of the cylinder to find shapes on.
5024 theState The state of the sub-shapes to find (see GEOM::shape_state)
5025 theName Object name; when specified, this parameter is used
5026 for result publication in the study. Otherwise, if automatic
5027 publication is switched on, default value is used for result name.
5030 List of all found sub-shapes.
5032 # Example: see GEOM_TestOthers.py
5033 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5034 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5035 self._autoPublish(aList, theName, "shapeOnCylinder")
5038 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5039 # the specified cylinder by the certain way, defined through \a theState parameter.
5040 # @param theShape Shape to find sub-shapes of.
5041 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5042 # @param theAxis Vector (or line, or linear edge), specifying
5043 # axis of the cylinder to find shapes on.
5044 # @param theRadius Radius of the cylinder to find shapes on.
5045 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5047 # @return List of all found sub-shapes indices.
5049 # @ref swig_GetShapesOnCylinderIDs "Example"
5050 @ManageTransactions("ShapesOp")
5051 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5053 Find in theShape all sub-shapes of type theShapeType, situated relatively
5054 the specified cylinder by the certain way, defined through theState parameter.
5057 theShape Shape to find sub-shapes of.
5058 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5059 theAxis Vector (or line, or linear edge), specifying
5060 axis of the cylinder to find shapes on.
5061 theRadius Radius of the cylinder to find shapes on.
5062 theState The state of the sub-shapes to find (see GEOM::shape_state)
5065 List of all found sub-shapes indices.
5067 # Example: see GEOM_TestOthers.py
5068 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5069 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5072 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5073 # the specified cylinder by the certain way, defined through \a theState parameter.
5074 # @param theShape Shape to find sub-shapes of.
5075 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5076 # @param theAxis Vector (or line, or linear edge), specifying
5077 # axis of the cylinder to find shapes on.
5078 # @param thePnt Point specifying location of the bottom of the cylinder.
5079 # @param theRadius Radius of the cylinder to find shapes on.
5080 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5081 # @param theName Object name; when specified, this parameter is used
5082 # for result publication in the study. Otherwise, if automatic
5083 # publication is switched on, default value is used for result name.
5085 # @return List of all found sub-shapes.
5087 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5088 @ManageTransactions("ShapesOp")
5089 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5091 Find in theShape all sub-shapes of type theShapeType, situated relatively
5092 the specified cylinder by the certain way, defined through theState parameter.
5095 theShape Shape to find sub-shapes of.
5096 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5097 theAxis Vector (or line, or linear edge), specifying
5098 axis of the cylinder to find shapes on.
5099 theRadius Radius of the cylinder to find shapes on.
5100 theState The state of the sub-shapes to find (see GEOM::shape_state)
5101 theName Object name; when specified, this parameter is used
5102 for result publication in the study. Otherwise, if automatic
5103 publication is switched on, default value is used for result name.
5106 List of all found sub-shapes.
5108 # Example: see GEOM_TestOthers.py
5109 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5110 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5111 self._autoPublish(aList, theName, "shapeOnCylinder")
5114 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5115 # the specified cylinder by the certain way, defined through \a theState parameter.
5116 # @param theShape Shape to find sub-shapes of.
5117 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5118 # @param theAxis Vector (or line, or linear edge), specifying
5119 # axis of the cylinder to find shapes on.
5120 # @param thePnt Point specifying location of the bottom of the cylinder.
5121 # @param theRadius Radius of the cylinder to find shapes on.
5122 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5124 # @return List of all found sub-shapes indices
5126 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5127 @ManageTransactions("ShapesOp")
5128 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5130 Find in theShape all sub-shapes of type theShapeType, situated relatively
5131 the specified cylinder by the certain way, defined through theState parameter.
5134 theShape Shape to find sub-shapes of.
5135 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5136 theAxis Vector (or line, or linear edge), specifying
5137 axis of the cylinder to find shapes on.
5138 theRadius Radius of the cylinder to find shapes on.
5139 theState The state of the sub-shapes to find (see GEOM::shape_state)
5142 List of all found sub-shapes indices.
5144 # Example: see GEOM_TestOthers.py
5145 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5146 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5149 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5150 # the specified sphere by the certain way, defined through \a theState parameter.
5151 # @param theShape Shape to find sub-shapes of.
5152 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5153 # @param theCenter Point, specifying center of the sphere to find shapes on.
5154 # @param theRadius Radius of the sphere to find shapes on.
5155 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5156 # @param theName Object name; when specified, this parameter is used
5157 # for result publication in the study. Otherwise, if automatic
5158 # publication is switched on, default value is used for result name.
5160 # @return List of all found sub-shapes.
5162 # @ref swig_GetShapesOnSphere "Example"
5163 @ManageTransactions("ShapesOp")
5164 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5166 Find in theShape all sub-shapes of type theShapeType, situated relatively
5167 the specified sphere by the certain way, defined through theState parameter.
5170 theShape Shape to find sub-shapes of.
5171 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5172 theCenter Point, specifying center of the sphere to find shapes on.
5173 theRadius Radius of the sphere to find shapes on.
5174 theState The state of the sub-shapes to find (see GEOM::shape_state)
5175 theName Object name; when specified, this parameter is used
5176 for result publication in the study. Otherwise, if automatic
5177 publication is switched on, default value is used for result name.
5180 List of all found sub-shapes.
5182 # Example: see GEOM_TestOthers.py
5183 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5184 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5185 self._autoPublish(aList, theName, "shapeOnSphere")
5188 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5189 # the specified sphere by the certain way, defined through \a theState parameter.
5190 # @param theShape Shape to find sub-shapes of.
5191 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5192 # @param theCenter Point, specifying center of the sphere to find shapes on.
5193 # @param theRadius Radius of the sphere to find shapes on.
5194 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5196 # @return List of all found sub-shapes indices.
5198 # @ref swig_GetShapesOnSphereIDs "Example"
5199 @ManageTransactions("ShapesOp")
5200 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5202 Find in theShape all sub-shapes of type theShapeType, situated relatively
5203 the specified sphere by the certain way, defined through theState parameter.
5206 theShape Shape to find sub-shapes of.
5207 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5208 theCenter Point, specifying center of the sphere to find shapes on.
5209 theRadius Radius of the sphere to find shapes on.
5210 theState The state of the sub-shapes to find (see GEOM::shape_state)
5213 List of all found sub-shapes indices.
5215 # Example: see GEOM_TestOthers.py
5216 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5217 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5220 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5221 # the specified quadrangle by the certain way, defined through \a theState parameter.
5222 # @param theShape Shape to find sub-shapes of.
5223 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5224 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5225 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5226 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5227 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5228 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5229 # @param theName Object name; when specified, this parameter is used
5230 # for result publication in the study. Otherwise, if automatic
5231 # publication is switched on, default value is used for result name.
5233 # @return List of all found sub-shapes.
5235 # @ref swig_GetShapesOnQuadrangle "Example"
5236 @ManageTransactions("ShapesOp")
5237 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5238 theTopLeftPoint, theTopRigthPoint,
5239 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5241 Find in theShape all sub-shapes of type theShapeType, situated relatively
5242 the specified quadrangle by the certain way, defined through theState parameter.
5245 theShape Shape to find sub-shapes of.
5246 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5247 theTopLeftPoint Point, specifying top left corner of a quadrangle
5248 theTopRigthPoint Point, specifying top right corner of a quadrangle
5249 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5250 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5251 theState The state of the sub-shapes to find (see GEOM::shape_state)
5252 theName Object name; when specified, this parameter is used
5253 for result publication in the study. Otherwise, if automatic
5254 publication is switched on, default value is used for result name.
5257 List of all found sub-shapes.
5259 # Example: see GEOM_TestOthers.py
5260 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5261 theTopLeftPoint, theTopRigthPoint,
5262 theBottomLeftPoint, theBottomRigthPoint, theState)
5263 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5264 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5267 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5268 # the specified quadrangle by the certain way, defined through \a theState parameter.
5269 # @param theShape Shape to find sub-shapes of.
5270 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5271 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5272 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5273 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5274 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5275 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5277 # @return List of all found sub-shapes indices.
5279 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5280 @ManageTransactions("ShapesOp")
5281 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5282 theTopLeftPoint, theTopRigthPoint,
5283 theBottomLeftPoint, theBottomRigthPoint, theState):
5285 Find in theShape all sub-shapes of type theShapeType, situated relatively
5286 the specified quadrangle by the certain way, defined through theState parameter.
5289 theShape Shape to find sub-shapes of.
5290 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5291 theTopLeftPoint Point, specifying top left corner of a quadrangle
5292 theTopRigthPoint Point, specifying top right corner of a quadrangle
5293 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5294 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5295 theState The state of the sub-shapes to find (see GEOM::shape_state)
5298 List of all found sub-shapes indices.
5301 # Example: see GEOM_TestOthers.py
5302 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5303 theTopLeftPoint, theTopRigthPoint,
5304 theBottomLeftPoint, theBottomRigthPoint, theState)
5305 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5308 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5309 # the specified \a theBox by the certain way, defined through \a theState parameter.
5310 # @param theBox Shape for relative comparing.
5311 # @param theShape Shape to find sub-shapes of.
5312 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5313 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5314 # @param theName Object name; when specified, this parameter is used
5315 # for result publication in the study. Otherwise, if automatic
5316 # publication is switched on, default value is used for result name.
5318 # @return List of all found sub-shapes.
5320 # @ref swig_GetShapesOnBox "Example"
5321 @ManageTransactions("ShapesOp")
5322 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5324 Find in theShape all sub-shapes of type theShapeType, situated relatively
5325 the specified theBox by the certain way, defined through theState parameter.
5328 theBox Shape for relative comparing.
5329 theShape Shape to find sub-shapes of.
5330 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5331 theState The state of the sub-shapes to find (see GEOM::shape_state)
5332 theName Object name; when specified, this parameter is used
5333 for result publication in the study. Otherwise, if automatic
5334 publication is switched on, default value is used for result name.
5337 List of all found sub-shapes.
5339 # Example: see GEOM_TestOthers.py
5340 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5341 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5342 self._autoPublish(aList, theName, "shapeOnBox")
5345 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5346 # the specified \a theBox by the certain way, defined through \a theState parameter.
5347 # @param theBox Shape for relative comparing.
5348 # @param theShape Shape to find sub-shapes of.
5349 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5350 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5352 # @return List of all found sub-shapes indices.
5354 # @ref swig_GetShapesOnBoxIDs "Example"
5355 @ManageTransactions("ShapesOp")
5356 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5358 Find in theShape all sub-shapes of type theShapeType, situated relatively
5359 the specified theBox by the certain way, defined through theState parameter.
5362 theBox Shape for relative comparing.
5363 theShape Shape to find sub-shapes of.
5364 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5365 theState The state of the sub-shapes to find (see GEOM::shape_state)
5368 List of all found sub-shapes indices.
5370 # Example: see GEOM_TestOthers.py
5371 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5372 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5375 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5376 # situated relatively the specified \a theCheckShape by the
5377 # certain way, defined through \a theState parameter.
5378 # @param theCheckShape Shape for relative comparing. It must be a solid.
5379 # @param theShape Shape to find sub-shapes of.
5380 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5381 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5382 # @param theName Object name; when specified, this parameter is used
5383 # for result publication in the study. Otherwise, if automatic
5384 # publication is switched on, default value is used for result name.
5386 # @return List of all found sub-shapes.
5388 # @ref swig_GetShapesOnShape "Example"
5389 @ManageTransactions("ShapesOp")
5390 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5392 Find in theShape all sub-shapes of type theShapeType,
5393 situated relatively the specified theCheckShape by the
5394 certain way, defined through theState parameter.
5397 theCheckShape Shape for relative comparing. It must be a solid.
5398 theShape Shape to find sub-shapes of.
5399 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5400 theState The state of the sub-shapes to find (see GEOM::shape_state)
5401 theName Object name; when specified, this parameter is used
5402 for result publication in the study. Otherwise, if automatic
5403 publication is switched on, default value is used for result name.
5406 List of all found sub-shapes.
5408 # Example: see GEOM_TestOthers.py
5409 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5410 theShapeType, theState)
5411 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5412 self._autoPublish(aList, theName, "shapeOnShape")
5415 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5416 # situated relatively the specified \a theCheckShape by the
5417 # certain way, defined through \a theState parameter.
5418 # @param theCheckShape Shape for relative comparing. It must be a solid.
5419 # @param theShape Shape to find sub-shapes of.
5420 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5421 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5422 # @param theName Object name; when specified, this parameter is used
5423 # for result publication in the study. Otherwise, if automatic
5424 # publication is switched on, default value is used for result name.
5426 # @return All found sub-shapes as compound.
5428 # @ref swig_GetShapesOnShapeAsCompound "Example"
5429 @ManageTransactions("ShapesOp")
5430 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5432 Find in theShape all sub-shapes of type theShapeType,
5433 situated relatively the specified theCheckShape by the
5434 certain way, defined through theState parameter.
5437 theCheckShape Shape for relative comparing. It must be a solid.
5438 theShape Shape to find sub-shapes of.
5439 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5440 theState The state of the sub-shapes to find (see GEOM::shape_state)
5441 theName Object name; when specified, this parameter is used
5442 for result publication in the study. Otherwise, if automatic
5443 publication is switched on, default value is used for result name.
5446 All found sub-shapes as compound.
5448 # Example: see GEOM_TestOthers.py
5449 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5450 theShapeType, theState)
5451 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5452 self._autoPublish(anObj, theName, "shapeOnShape")
5455 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5456 # situated relatively the specified \a theCheckShape by the
5457 # certain way, defined through \a theState parameter.
5458 # @param theCheckShape Shape for relative comparing. It must be a solid.
5459 # @param theShape Shape to find sub-shapes of.
5460 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5461 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5463 # @return List of all found sub-shapes indices.
5465 # @ref swig_GetShapesOnShapeIDs "Example"
5466 @ManageTransactions("ShapesOp")
5467 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5469 Find in theShape all sub-shapes of type theShapeType,
5470 situated relatively the specified theCheckShape by the
5471 certain way, defined through theState parameter.
5474 theCheckShape Shape for relative comparing. It must be a solid.
5475 theShape Shape to find sub-shapes of.
5476 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5477 theState The state of the sub-shapes to find (see GEOM::shape_state)
5480 List of all found sub-shapes indices.
5482 # Example: see GEOM_TestOthers.py
5483 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5484 theShapeType, theState)
5485 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5488 ## Get sub-shape(s) of theShapeWhere, which are
5489 # coincident with \a theShapeWhat or could be a part of it.
5490 # @param theShapeWhere Shape to find sub-shapes of.
5491 # @param theShapeWhat Shape, specifying what to find.
5492 # @param isNewImplementation implementation of GetInPlace functionality
5493 # (default = False, old alghorithm based on shape properties)
5494 # @param theName Object name; when specified, this parameter is used
5495 # for result publication in the study. Otherwise, if automatic
5496 # publication is switched on, default value is used for result name.
5498 # @return Group of all found sub-shapes or a single found sub-shape.
5500 # @note This function has a restriction on argument shapes.
5501 # If \a theShapeWhere has curved parts with significantly
5502 # outstanding centres (i.e. the mass centre of a part is closer to
5503 # \a theShapeWhat than to the part), such parts will not be found.
5504 # @image html get_in_place_lost_part.png
5506 # @ref swig_GetInPlace "Example"
5507 @ManageTransactions("ShapesOp")
5508 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5510 Get sub-shape(s) of theShapeWhere, which are
5511 coincident with theShapeWhat or could be a part of it.
5514 theShapeWhere Shape to find sub-shapes of.
5515 theShapeWhat Shape, specifying what to find.
5516 isNewImplementation Implementation of GetInPlace functionality
5517 (default = False, old alghorithm based on shape properties)
5518 theName Object name; when specified, this parameter is used
5519 for result publication in the study. Otherwise, if automatic
5520 publication is switched on, default value is used for result name.
5523 Group of all found sub-shapes or a single found sub-shape.
5527 This function has a restriction on argument shapes.
5528 If theShapeWhere has curved parts with significantly
5529 outstanding centres (i.e. the mass centre of a part is closer to
5530 theShapeWhat than to the part), such parts will not be found.
5532 # Example: see GEOM_TestOthers.py
5534 if isNewImplementation:
5535 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5537 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5539 RaiseIfFailed("GetInPlace", self.ShapesOp)
5540 self._autoPublish(anObj, theName, "inplace")
5543 ## Get sub-shape(s) of \a theShapeWhere, which are
5544 # coincident with \a theShapeWhat or could be a part of it.
5546 # Implementation of this method is based on a saved history of an operation,
5547 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5548 # arguments (an argument shape or a sub-shape of an argument shape).
5549 # The operation could be the Partition or one of boolean operations,
5550 # performed on simple shapes (not on compounds).
5552 # @param theShapeWhere Shape to find sub-shapes of.
5553 # @param theShapeWhat Shape, specifying what to find (must be in the
5554 # building history of the ShapeWhere).
5555 # @param theName Object name; when specified, this parameter is used
5556 # for result publication in the study. Otherwise, if automatic
5557 # publication is switched on, default value is used for result name.
5559 # @return Group of all found sub-shapes or a single found sub-shape.
5561 # @ref swig_GetInPlace "Example"
5562 @ManageTransactions("ShapesOp")
5563 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5565 Implementation of this method is based on a saved history of an operation,
5566 produced theShapeWhere. The theShapeWhat must be among this operation's
5567 arguments (an argument shape or a sub-shape of an argument shape).
5568 The operation could be the Partition or one of boolean operations,
5569 performed on simple shapes (not on compounds).
5572 theShapeWhere Shape to find sub-shapes of.
5573 theShapeWhat Shape, specifying what to find (must be in the
5574 building history of the ShapeWhere).
5575 theName Object name; when specified, this parameter is used
5576 for result publication in the study. Otherwise, if automatic
5577 publication is switched on, default value is used for result name.
5580 Group of all found sub-shapes or a single found sub-shape.
5582 # Example: see GEOM_TestOthers.py
5583 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5584 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5585 self._autoPublish(anObj, theName, "inplace")
5588 ## Get sub-shape of theShapeWhere, which is
5589 # equal to \a theShapeWhat.
5590 # @param theShapeWhere Shape to find sub-shape of.
5591 # @param theShapeWhat Shape, specifying what to find.
5592 # @param theName Object name; when specified, this parameter is used
5593 # for result publication in the study. Otherwise, if automatic
5594 # publication is switched on, default value is used for result name.
5596 # @return New GEOM.GEOM_Object for found sub-shape.
5598 # @ref swig_GetSame "Example"
5599 @ManageTransactions("ShapesOp")
5600 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5602 Get sub-shape of theShapeWhere, which is
5603 equal to theShapeWhat.
5606 theShapeWhere Shape to find sub-shape of.
5607 theShapeWhat Shape, specifying what to find.
5608 theName Object name; when specified, this parameter is used
5609 for result publication in the study. Otherwise, if automatic
5610 publication is switched on, default value is used for result name.
5613 New GEOM.GEOM_Object for found sub-shape.
5615 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5616 RaiseIfFailed("GetSame", self.ShapesOp)
5617 self._autoPublish(anObj, theName, "sameShape")
5621 ## Get sub-shape indices of theShapeWhere, which is
5622 # equal to \a theShapeWhat.
5623 # @param theShapeWhere Shape to find sub-shape of.
5624 # @param theShapeWhat Shape, specifying what to find.
5625 # @return List of all found sub-shapes indices.
5627 # @ref swig_GetSame "Example"
5628 @ManageTransactions("ShapesOp")
5629 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5631 Get sub-shape indices of theShapeWhere, which is
5632 equal to theShapeWhat.
5635 theShapeWhere Shape to find sub-shape of.
5636 theShapeWhat Shape, specifying what to find.
5639 List of all found sub-shapes indices.
5641 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5642 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5649 ## @addtogroup l4_access
5652 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5653 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5654 # @param aShape Shape to get sub-shape of.
5655 # @param ListOfID List of sub-shapes indices.
5656 # @param theName Object name; when specified, this parameter is used
5657 # for result publication in the study. Otherwise, if automatic
5658 # publication is switched on, default value is used for result name.
5660 # @return Found sub-shape.
5662 # @ref swig_all_decompose "Example"
5663 def GetSubShape(self, aShape, ListOfID, theName=None):
5665 Obtain a composite sub-shape of aShape, composed from sub-shapes
5666 of aShape, selected by their unique IDs inside aShape
5669 aShape Shape to get sub-shape of.
5670 ListOfID List of sub-shapes indices.
5671 theName Object name; when specified, this parameter is used
5672 for result publication in the study. Otherwise, if automatic
5673 publication is switched on, default value is used for result name.
5678 # Example: see GEOM_TestAll.py
5679 anObj = self.AddSubShape(aShape,ListOfID)
5680 self._autoPublish(anObj, theName, "subshape")
5683 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5684 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5685 # @param aShape Shape to get sub-shape of.
5686 # @param aSubShape Sub-shapes of aShape.
5687 # @return ID of found sub-shape.
5689 # @ref swig_all_decompose "Example"
5690 @ManageTransactions("LocalOp")
5691 def GetSubShapeID(self, aShape, aSubShape):
5693 Obtain unique ID of sub-shape aSubShape inside aShape
5694 of aShape, selected by their unique IDs inside aShape
5697 aShape Shape to get sub-shape of.
5698 aSubShape Sub-shapes of aShape.
5701 ID of found sub-shape.
5703 # Example: see GEOM_TestAll.py
5704 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5705 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5708 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5709 # This function is provided for performance purpose. The complexity is O(n) with n
5710 # the number of subobjects of aShape
5711 # @param aShape Shape to get sub-shape of.
5712 # @param aSubShapes Sub-shapes of aShape.
5713 # @return list of IDs of found sub-shapes.
5715 # @ref swig_all_decompose "Example"
5716 @ManageTransactions("ShapesOp")
5717 def GetSubShapesIDs(self, aShape, aSubShapes):
5719 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5720 This function is provided for performance purpose. The complexity is O(n) with n
5721 the number of subobjects of aShape
5724 aShape Shape to get sub-shape of.
5725 aSubShapes Sub-shapes of aShape.
5728 List of IDs of found sub-shape.
5730 # Example: see GEOM_TestAll.py
5731 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5732 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5738 ## @addtogroup l4_decompose
5741 ## Get all sub-shapes and groups of \a theShape,
5742 # that were created already by any other methods.
5743 # @param theShape Any shape.
5744 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5745 # returned, else all found sub-shapes and groups.
5746 # @return List of existing sub-objects of \a theShape.
5748 # @ref swig_all_decompose "Example"
5749 @ManageTransactions("ShapesOp")
5750 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5752 Get all sub-shapes and groups of theShape,
5753 that were created already by any other methods.
5757 theGroupsOnly If this parameter is TRUE, only groups will be
5758 returned, else all found sub-shapes and groups.
5761 List of existing sub-objects of theShape.
5763 # Example: see GEOM_TestAll.py
5764 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5765 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5768 ## Get all groups of \a theShape,
5769 # that were created already by any other methods.
5770 # @param theShape Any shape.
5771 # @return List of existing groups of \a theShape.
5773 # @ref swig_all_decompose "Example"
5774 @ManageTransactions("ShapesOp")
5775 def GetGroups(self, theShape):
5777 Get all groups of theShape,
5778 that were created already by any other methods.
5784 List of existing groups of theShape.
5786 # Example: see GEOM_TestAll.py
5787 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5788 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5791 ## Explode a shape on sub-shapes of a given type.
5792 # If the shape itself matches the type, it is also returned.
5793 # @param aShape Shape to be exploded.
5794 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5795 # @param theName Object name; when specified, this parameter is used
5796 # for result publication in the study. Otherwise, if automatic
5797 # publication is switched on, default value is used for result name.
5799 # @return List of sub-shapes of type theShapeType, contained in theShape.
5801 # @ref swig_all_decompose "Example"
5802 @ManageTransactions("ShapesOp")
5803 def SubShapeAll(self, aShape, aType, theName=None):
5805 Explode a shape on sub-shapes of a given type.
5806 If the shape itself matches the type, it is also returned.
5809 aShape Shape to be exploded.
5810 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5811 theName Object name; when specified, this parameter is used
5812 for result publication in the study. Otherwise, if automatic
5813 publication is switched on, default value is used for result name.
5816 List of sub-shapes of type theShapeType, contained in theShape.
5818 # Example: see GEOM_TestAll.py
5819 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5820 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5821 self._autoPublish(ListObj, theName, "subshape")
5824 ## Explode a shape on sub-shapes of a given type.
5825 # @param aShape Shape to be exploded.
5826 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5827 # @return List of IDs of sub-shapes.
5829 # @ref swig_all_decompose "Example"
5830 @ManageTransactions("ShapesOp")
5831 def SubShapeAllIDs(self, aShape, aType):
5833 Explode a shape on sub-shapes of a given type.
5836 aShape Shape to be exploded (see geompy.ShapeType)
5837 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5840 List of IDs of sub-shapes.
5842 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5843 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5846 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5847 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5848 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5849 # @param aShape Shape to get sub-shape of.
5850 # @param ListOfInd List of sub-shapes indices.
5851 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5852 # @param theName Object name; when specified, this parameter is used
5853 # for result publication in the study. Otherwise, if automatic
5854 # publication is switched on, default value is used for result name.
5856 # @return A compound of sub-shapes of aShape.
5858 # @ref swig_all_decompose "Example"
5859 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5861 Obtain a compound of sub-shapes of aShape,
5862 selected by their indices in list of all sub-shapes of type aType.
5863 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5866 aShape Shape to get sub-shape of.
5867 ListOfID List of sub-shapes indices.
5868 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5869 theName Object name; when specified, this parameter is used
5870 for result publication in the study. Otherwise, if automatic
5871 publication is switched on, default value is used for result name.
5874 A compound of sub-shapes of aShape.
5876 # Example: see GEOM_TestAll.py
5878 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5879 for ind in ListOfInd:
5880 ListOfIDs.append(AllShapeIDsList[ind - 1])
5881 # note: auto-publishing is done in self.GetSubShape()
5882 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5885 ## Explode a shape on sub-shapes of a given type.
5886 # Sub-shapes will be sorted taking into account their gravity centers,
5887 # to provide stable order of sub-shapes.
5888 # If the shape itself matches the type, it is also returned.
5889 # @param aShape Shape to be exploded.
5890 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5891 # @param theName Object name; when specified, this parameter is used
5892 # for result publication in the study. Otherwise, if automatic
5893 # publication is switched on, default value is used for result name.
5895 # @return List of sub-shapes of type theShapeType, contained in theShape.
5897 # @ref swig_SubShapeAllSorted "Example"
5898 @ManageTransactions("ShapesOp")
5899 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5901 Explode a shape on sub-shapes of a given type.
5902 Sub-shapes will be sorted taking into account their gravity centers,
5903 to provide stable order of sub-shapes.
5904 If the shape itself matches the type, it is also returned.
5907 aShape Shape to be exploded.
5908 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5909 theName Object name; when specified, this parameter is used
5910 for result publication in the study. Otherwise, if automatic
5911 publication is switched on, default value is used for result name.
5914 List of sub-shapes of type theShapeType, contained in theShape.
5916 # Example: see GEOM_TestAll.py
5917 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5918 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5919 self._autoPublish(ListObj, theName, "subshape")
5922 ## Explode a shape on sub-shapes of a given type.
5923 # Sub-shapes will be sorted taking into account their gravity centers,
5924 # to provide stable order of sub-shapes.
5925 # @param aShape Shape to be exploded.
5926 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5927 # @return List of IDs of sub-shapes.
5929 # @ref swig_all_decompose "Example"
5930 @ManageTransactions("ShapesOp")
5931 def SubShapeAllSortedCentresIDs(self, aShape, aType):
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.
5938 aShape Shape to be exploded.
5939 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5942 List of IDs of sub-shapes.
5944 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5945 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5948 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5949 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5950 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5951 # @param aShape Shape to get sub-shape of.
5952 # @param ListOfInd List of sub-shapes indices.
5953 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5954 # @param theName Object name; when specified, this parameter is used
5955 # for result publication in the study. Otherwise, if automatic
5956 # publication is switched on, default value is used for result name.
5958 # @return A compound of sub-shapes of aShape.
5960 # @ref swig_all_decompose "Example"
5961 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5963 Obtain a compound of sub-shapes of aShape,
5964 selected by they indices in sorted list of all sub-shapes of type aType.
5965 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5968 aShape Shape to get sub-shape of.
5969 ListOfID List of sub-shapes indices.
5970 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5971 theName Object name; when specified, this parameter is used
5972 for result publication in the study. Otherwise, if automatic
5973 publication is switched on, default value is used for result name.
5976 A compound of sub-shapes of aShape.
5978 # Example: see GEOM_TestAll.py
5980 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5981 for ind in ListOfInd:
5982 ListOfIDs.append(AllShapeIDsList[ind - 1])
5983 # note: auto-publishing is done in self.GetSubShape()
5984 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5987 ## Extract shapes (excluding the main shape) of given type.
5988 # @param aShape The shape.
5989 # @param aType The shape type (see ShapeType())
5990 # @param isSorted Boolean flag to switch sorting on/off.
5991 # @param theName Object name; when specified, this parameter is used
5992 # for result publication in the study. Otherwise, if automatic
5993 # publication is switched on, default value is used for result name.
5995 # @return List of sub-shapes of type aType, contained in aShape.
5997 # @ref swig_FilletChamfer "Example"
5998 @ManageTransactions("ShapesOp")
5999 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6001 Extract shapes (excluding the main shape) of given type.
6005 aType The shape type (see geompy.ShapeType)
6006 isSorted Boolean flag to switch sorting on/off.
6007 theName Object name; when specified, this parameter is used
6008 for result publication in the study. Otherwise, if automatic
6009 publication is switched on, default value is used for result name.
6012 List of sub-shapes of type aType, contained in aShape.
6014 # Example: see GEOM_TestAll.py
6015 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6016 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6017 self._autoPublish(ListObj, theName, "subshape")
6020 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6021 # @param aShape Main shape.
6022 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6023 # @param theName Object name; when specified, this parameter is used
6024 # for result publication in the study. Otherwise, if automatic
6025 # publication is switched on, default value is used for result name.
6026 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6028 # @ref swig_all_decompose "Example"
6029 @ManageTransactions("ShapesOp")
6030 def SubShapes(self, aShape, anIDs, theName=None):
6032 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6036 anIDs List of unique IDs of sub-shapes inside theMainShape.
6037 theName Object name; when specified, this parameter is used
6038 for result publication in the study. Otherwise, if automatic
6039 publication is switched on, default value is used for result name.
6042 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6044 # Example: see GEOM_TestAll.py
6045 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6046 RaiseIfFailed("SubShapes", self.ShapesOp)
6047 self._autoPublish(ListObj, theName, "subshape")
6050 # end of l4_decompose
6053 ## @addtogroup l4_decompose_d
6056 ## Deprecated method
6057 # It works like SubShapeAllSortedCentres(), but wrongly
6058 # defines centres of faces, shells and solids.
6059 @ManageTransactions("ShapesOp")
6060 def SubShapeAllSorted(self, aShape, aType, theName=None):
6063 It works like geompy.SubShapeAllSortedCentres, but wrongly
6064 defines centres of faces, shells and solids.
6066 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6067 RaiseIfFailed("MakeExplode", self.ShapesOp)
6068 self._autoPublish(ListObj, theName, "subshape")
6071 ## Deprecated method
6072 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6073 # defines centres of faces, shells and solids.
6074 @ManageTransactions("ShapesOp")
6075 def SubShapeAllSortedIDs(self, aShape, aType):
6078 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6079 defines centres of faces, shells and solids.
6081 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6082 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6085 ## Deprecated method
6086 # It works like SubShapeSortedCentres(), but has a bug
6087 # (wrongly defines centres of faces, shells and solids).
6088 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6091 It works like geompy.SubShapeSortedCentres, but has a bug
6092 (wrongly defines centres of faces, shells and solids).
6095 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6096 for ind in ListOfInd:
6097 ListOfIDs.append(AllShapeIDsList[ind - 1])
6098 # note: auto-publishing is done in self.GetSubShape()
6099 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6102 # end of l4_decompose_d
6105 ## @addtogroup l3_healing
6108 ## Apply a sequence of Shape Healing operators to the given object.
6109 # @param theShape Shape to be processed.
6110 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6111 # @param theParameters List of names of parameters
6112 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6113 # @param theValues List of values of parameters, in the same order
6114 # as parameters are listed in <VAR>theParameters</VAR> list.
6115 # @param theName Object name; when specified, this parameter is used
6116 # for result publication in the study. Otherwise, if automatic
6117 # publication is switched on, default value is used for result name.
6119 # <b> Operators and Parameters: </b> \n
6121 # * \b FixShape - corrects invalid shapes. \n
6122 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6123 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6125 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6126 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6127 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6128 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6130 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6131 # surfaces in segments using a certain angle. \n
6132 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6133 # if Angle=180, four if Angle=90, etc). \n
6134 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6136 # * \b SplitClosedFaces - splits closed faces in segments.
6137 # The number of segments depends on the number of splitting points.\n
6138 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6140 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6141 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6142 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6143 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6144 # This and the previous parameters can take the following values:\n
6145 # \b Parametric \b Continuity \n
6146 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6147 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6148 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6149 # ruling out sharp edges).\n
6150 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6151 # are of the same magnitude).\n
6152 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6153 # or surfaces (d/du C(u)) are the same at junction. \n
6154 # \b Geometric \b Continuity \n
6155 # \b G1: first derivatives are proportional at junction.\n
6156 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6157 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6158 # \b G2: first and second derivatives are proportional at junction.
6159 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6160 # continuity requires that the underlying parameterization was continuous as well.
6161 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6163 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6164 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6165 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6166 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6167 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6168 # with the specified parameters.\n
6169 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6170 # with the specified parameters.\n
6171 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6172 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6173 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6174 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6176 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6177 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6178 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6179 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6180 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6182 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6183 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6186 # @return New GEOM.GEOM_Object, containing processed shape.
6188 # \n @ref tui_shape_processing "Example"
6189 @ManageTransactions("HealOp")
6190 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6192 Apply a sequence of Shape Healing operators to the given object.
6195 theShape Shape to be processed.
6196 theValues List of values of parameters, in the same order
6197 as parameters are listed in theParameters list.
6198 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6199 theParameters List of names of parameters
6200 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6201 theName Object name; when specified, this parameter is used
6202 for result publication in the study. Otherwise, if automatic
6203 publication is switched on, default value is used for result name.
6205 Operators and Parameters:
6207 * FixShape - corrects invalid shapes.
6208 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6209 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6210 * FixFaceSize - removes small faces, such as spots and strips.
6211 * FixFaceSize.Tolerance - defines minimum possible face size.
6212 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6213 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6214 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6215 in segments using a certain angle.
6216 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6217 if Angle=180, four if Angle=90, etc).
6218 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6219 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6221 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6222 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6223 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6224 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6225 * SplitContinuity.CurveContinuity - required continuity for curves.
6226 This and the previous parameters can take the following values:
6228 Parametric Continuity:
6229 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6230 coincidental. The curves or surfaces may still meet at an angle,
6231 giving rise to a sharp corner or edge).
6232 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6233 are parallel, ruling out sharp edges).
6234 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6235 or surfaces are of the same magnitude).
6236 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6237 curves or surfaces (d/du C(u)) are the same at junction.
6239 Geometric Continuity:
6240 G1: first derivatives are proportional at junction.
6241 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6242 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6243 G2: first and second derivatives are proportional at junction. As the names imply,
6244 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6245 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6246 geometric continuity of order n, but not vice-versa.
6247 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6248 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6249 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6250 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6251 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6252 the specified parameters.
6253 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6254 the specified parameters.
6255 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6256 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6257 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6258 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6259 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6260 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6261 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6262 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6263 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6264 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6265 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6268 New GEOM.GEOM_Object, containing processed shape.
6270 Note: For more information look through SALOME Geometry User's Guide->
6271 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6273 # Example: see GEOM_TestHealing.py
6274 theValues,Parameters = ParseList(theValues)
6275 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6276 # To avoid script failure in case of good argument shape
6277 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6279 RaiseIfFailed("ProcessShape", self.HealOp)
6280 for string in (theOperators + theParameters):
6281 Parameters = ":" + Parameters
6283 anObj.SetParameters(Parameters)
6284 self._autoPublish(anObj, theName, "healed")
6287 ## Remove faces from the given object (shape).
6288 # @param theObject Shape to be processed.
6289 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6290 # removes ALL faces of the given object.
6291 # @param theName Object name; when specified, this parameter is used
6292 # for result publication in the study. Otherwise, if automatic
6293 # publication is switched on, default value is used for result name.
6295 # @return New GEOM.GEOM_Object, containing processed shape.
6297 # @ref tui_suppress_faces "Example"
6298 @ManageTransactions("HealOp")
6299 def SuppressFaces(self, theObject, theFaces, theName=None):
6301 Remove faces from the given object (shape).
6304 theObject Shape to be processed.
6305 theFaces Indices of faces to be removed, if EMPTY then the method
6306 removes ALL faces of the given object.
6307 theName Object name; when specified, this parameter is used
6308 for result publication in the study. Otherwise, if automatic
6309 publication is switched on, default value is used for result name.
6312 New GEOM.GEOM_Object, containing processed shape.
6314 # Example: see GEOM_TestHealing.py
6315 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6316 RaiseIfFailed("SuppressFaces", self.HealOp)
6317 self._autoPublish(anObj, theName, "suppressFaces")
6320 ## Sewing of some shapes into single shape.
6321 # @param ListShape Shapes to be processed.
6322 # @param theTolerance Required tolerance value.
6323 # @param AllowNonManifold Flag that allows non-manifold sewing.
6324 # @param theName Object name; when specified, this parameter is used
6325 # for result publication in the study. Otherwise, if automatic
6326 # publication is switched on, default value is used for result name.
6328 # @return New GEOM.GEOM_Object, containing processed shape.
6330 # @ref tui_sewing "Example"
6331 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6333 Sewing of some shapes into single shape.
6336 ListShape Shapes to be processed.
6337 theTolerance Required tolerance value.
6338 AllowNonManifold Flag that allows non-manifold sewing.
6339 theName Object name; when specified, this parameter is used
6340 for result publication in the study. Otherwise, if automatic
6341 publication is switched on, default value is used for result name.
6344 New GEOM.GEOM_Object, containing processed shape.
6346 # Example: see GEOM_TestHealing.py
6347 comp = self.MakeCompound(ListShape)
6348 # note: auto-publishing is done in self.Sew()
6349 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6352 ## Sewing of the given object.
6353 # @param theObject Shape to be processed.
6354 # @param theTolerance Required tolerance value.
6355 # @param AllowNonManifold Flag that allows non-manifold sewing.
6356 # @param theName Object name; when specified, this parameter is used
6357 # for result publication in the study. Otherwise, if automatic
6358 # publication is switched on, default value is used for result name.
6360 # @return New GEOM.GEOM_Object, containing processed shape.
6361 @ManageTransactions("HealOp")
6362 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6364 Sewing of the given object.
6367 theObject Shape to be processed.
6368 theTolerance Required tolerance value.
6369 AllowNonManifold Flag that allows non-manifold sewing.
6370 theName Object name; when specified, this parameter is used
6371 for result publication in the study. Otherwise, if automatic
6372 publication is switched on, default value is used for result name.
6375 New GEOM.GEOM_Object, containing processed shape.
6377 # Example: see MakeSewing() above
6378 theTolerance,Parameters = ParseParameters(theTolerance)
6379 if AllowNonManifold:
6380 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6382 anObj = self.HealOp.Sew(theObject, theTolerance)
6383 # To avoid script failure in case of good argument shape
6384 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6386 RaiseIfFailed("Sew", self.HealOp)
6387 anObj.SetParameters(Parameters)
6388 self._autoPublish(anObj, theName, "sewed")
6391 ## Rebuild the topology of theCompound of solids by removing
6392 # of the faces that are shared by several solids.
6393 # @param theCompound Shape to be processed.
6394 # @param theName Object name; when specified, this parameter is used
6395 # for result publication in the study. Otherwise, if automatic
6396 # publication is switched on, default value is used for result name.
6398 # @return New GEOM.GEOM_Object, containing processed shape.
6400 # @ref tui_remove_webs "Example"
6401 @ManageTransactions("HealOp")
6402 def RemoveInternalFaces (self, theCompound, theName=None):
6404 Rebuild the topology of theCompound of solids by removing
6405 of the faces that are shared by several solids.
6408 theCompound Shape to be processed.
6409 theName Object name; when specified, this parameter is used
6410 for result publication in the study. Otherwise, if automatic
6411 publication is switched on, default value is used for result name.
6414 New GEOM.GEOM_Object, containing processed shape.
6416 # Example: see GEOM_TestHealing.py
6417 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6418 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6419 self._autoPublish(anObj, theName, "removeWebs")
6422 ## Remove internal wires and edges from the given object (face).
6423 # @param theObject Shape to be processed.
6424 # @param theWires Indices of wires to be removed, if EMPTY then the method
6425 # removes ALL internal wires of the given object.
6426 # @param theName Object name; when specified, this parameter is used
6427 # for result publication in the study. Otherwise, if automatic
6428 # publication is switched on, default value is used for result name.
6430 # @return New GEOM.GEOM_Object, containing processed shape.
6432 # @ref tui_suppress_internal_wires "Example"
6433 @ManageTransactions("HealOp")
6434 def SuppressInternalWires(self, theObject, theWires, theName=None):
6436 Remove internal wires and edges from the given object (face).
6439 theObject Shape to be processed.
6440 theWires Indices of wires to be removed, if EMPTY then the method
6441 removes ALL internal wires of the given object.
6442 theName Object name; when specified, this parameter is used
6443 for result publication in the study. Otherwise, if automatic
6444 publication is switched on, default value is used for result name.
6447 New GEOM.GEOM_Object, containing processed shape.
6449 # Example: see GEOM_TestHealing.py
6450 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6451 RaiseIfFailed("RemoveIntWires", self.HealOp)
6452 self._autoPublish(anObj, theName, "suppressWires")
6455 ## Remove internal closed contours (holes) from the given object.
6456 # @param theObject Shape to be processed.
6457 # @param theWires Indices of wires to be removed, if EMPTY then the method
6458 # removes ALL internal holes of the given object
6459 # @param theName Object name; when specified, this parameter is used
6460 # for result publication in the study. Otherwise, if automatic
6461 # publication is switched on, default value is used for result name.
6463 # @return New GEOM.GEOM_Object, containing processed shape.
6465 # @ref tui_suppress_holes "Example"
6466 @ManageTransactions("HealOp")
6467 def SuppressHoles(self, theObject, theWires, theName=None):
6469 Remove internal closed contours (holes) from the given object.
6472 theObject Shape to be processed.
6473 theWires Indices of wires to be removed, if EMPTY then the method
6474 removes ALL internal holes of the given object
6475 theName Object name; when specified, this parameter is used
6476 for result publication in the study. Otherwise, if automatic
6477 publication is switched on, default value is used for result name.
6480 New GEOM.GEOM_Object, containing processed shape.
6482 # Example: see GEOM_TestHealing.py
6483 anObj = self.HealOp.FillHoles(theObject, theWires)
6484 RaiseIfFailed("FillHoles", self.HealOp)
6485 self._autoPublish(anObj, theName, "suppressHoles")
6488 ## Close an open wire.
6489 # @param theObject Shape to be processed.
6490 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6491 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6492 # @param isCommonVertex If True : closure by creation of a common vertex,
6493 # If False : closure by creation of an edge between ends.
6494 # @param theName Object name; when specified, this parameter is used
6495 # for result publication in the study. Otherwise, if automatic
6496 # publication is switched on, default value is used for result name.
6498 # @return New GEOM.GEOM_Object, containing processed shape.
6500 # @ref tui_close_contour "Example"
6501 @ManageTransactions("HealOp")
6502 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6507 theObject Shape to be processed.
6508 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6509 if [ ], then theObject itself is a wire.
6510 isCommonVertex If True : closure by creation of a common vertex,
6511 If False : closure by creation of an edge between ends.
6512 theName Object name; when specified, this parameter is used
6513 for result publication in the study. Otherwise, if automatic
6514 publication is switched on, default value is used for result name.
6517 New GEOM.GEOM_Object, containing processed shape.
6519 # Example: see GEOM_TestHealing.py
6520 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6521 RaiseIfFailed("CloseContour", self.HealOp)
6522 self._autoPublish(anObj, theName, "closeContour")
6525 ## Addition of a point to a given edge object.
6526 # @param theObject Shape to be processed.
6527 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6528 # if -1, then theObject itself is the edge.
6529 # @param theValue Value of parameter on edge or length parameter,
6530 # depending on \a isByParameter.
6531 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6532 # if FALSE : \a theValue is treated as a length parameter [0..1]
6533 # @param theName Object name; when specified, this parameter is used
6534 # for result publication in the study. Otherwise, if automatic
6535 # publication is switched on, default value is used for result name.
6537 # @return New GEOM.GEOM_Object, containing processed shape.
6539 # @ref tui_add_point_on_edge "Example"
6540 @ManageTransactions("HealOp")
6541 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6543 Addition of a point to a given edge object.
6546 theObject Shape to be processed.
6547 theEdgeIndex Index of edge to be divided within theObject's shape,
6548 if -1, then theObject itself is the edge.
6549 theValue Value of parameter on edge or length parameter,
6550 depending on isByParameter.
6551 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6552 if FALSE : theValue is treated as a length parameter [0..1]
6553 theName Object name; when specified, this parameter is used
6554 for result publication in the study. Otherwise, if automatic
6555 publication is switched on, default value is used for result name.
6558 New GEOM.GEOM_Object, containing processed shape.
6560 # Example: see GEOM_TestHealing.py
6561 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6562 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6563 RaiseIfFailed("DivideEdge", self.HealOp)
6564 anObj.SetParameters(Parameters)
6565 self._autoPublish(anObj, theName, "divideEdge")
6568 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6569 # @param theWire Wire to minimize the number of C1 continuous edges in.
6570 # @param theVertices A list of vertices to suppress. If the list
6571 # is empty, all vertices in a wire will be assumed.
6572 # @param theName Object name; when specified, this parameter is used
6573 # for result publication in the study. Otherwise, if automatic
6574 # publication is switched on, default value is used for result name.
6576 # @return New GEOM.GEOM_Object with modified wire.
6578 # @ref tui_fuse_collinear_edges "Example"
6579 @ManageTransactions("HealOp")
6580 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6582 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6585 theWire Wire to minimize the number of C1 continuous edges in.
6586 theVertices A list of vertices to suppress. If the list
6587 is empty, all vertices in a wire will be assumed.
6588 theName Object name; when specified, this parameter is used
6589 for result publication in the study. Otherwise, if automatic
6590 publication is switched on, default value is used for result name.
6593 New GEOM.GEOM_Object with modified wire.
6595 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6596 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6597 self._autoPublish(anObj, theName, "fuseEdges")
6600 ## Change orientation of the given object. Updates given shape.
6601 # @param theObject Shape to be processed.
6602 # @return Updated <var>theObject</var>
6604 # @ref swig_todo "Example"
6605 @ManageTransactions("HealOp")
6606 def ChangeOrientationShell(self,theObject):
6608 Change orientation of the given object. Updates given shape.
6611 theObject Shape to be processed.
6616 theObject = self.HealOp.ChangeOrientation(theObject)
6617 RaiseIfFailed("ChangeOrientation", self.HealOp)
6620 ## Change orientation of the given object.
6621 # @param theObject Shape to be processed.
6622 # @param theName Object name; when specified, this parameter is used
6623 # for result publication in the study. Otherwise, if automatic
6624 # publication is switched on, default value is used for result name.
6626 # @return New GEOM.GEOM_Object, containing processed shape.
6628 # @ref swig_todo "Example"
6629 @ManageTransactions("HealOp")
6630 def ChangeOrientationShellCopy(self, theObject, theName=None):
6632 Change orientation of the given object.
6635 theObject Shape to be processed.
6636 theName Object name; when specified, this parameter is used
6637 for result publication in the study. Otherwise, if automatic
6638 publication is switched on, default value is used for result name.
6641 New GEOM.GEOM_Object, containing processed shape.
6643 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6644 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6645 self._autoPublish(anObj, theName, "reversed")
6648 ## Try to limit tolerance of the given object by value \a theTolerance.
6649 # @param theObject Shape to be processed.
6650 # @param theTolerance Required tolerance value.
6651 # @param theName Object name; when specified, this parameter is used
6652 # for result publication in the study. Otherwise, if automatic
6653 # publication is switched on, default value is used for result name.
6655 # @return New GEOM.GEOM_Object, containing processed shape.
6657 # @ref tui_limit_tolerance "Example"
6658 @ManageTransactions("HealOp")
6659 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6661 Try to limit tolerance of the given object by value theTolerance.
6664 theObject Shape to be processed.
6665 theTolerance Required tolerance value.
6666 theName Object name; when specified, this parameter is used
6667 for result publication in the study. Otherwise, if automatic
6668 publication is switched on, default value is used for result name.
6671 New GEOM.GEOM_Object, containing processed shape.
6673 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6674 RaiseIfFailed("LimitTolerance", self.HealOp)
6675 self._autoPublish(anObj, theName, "limitTolerance")
6678 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6679 # that constitute a free boundary of the given shape.
6680 # @param theObject Shape to get free boundary of.
6681 # @param theName Object name; when specified, this parameter is used
6682 # for result publication in the study. Otherwise, if automatic
6683 # publication is switched on, default value is used for result name.
6685 # @return [\a status, \a theClosedWires, \a theOpenWires]
6686 # \n \a status: FALSE, if an error(s) occured during the method execution.
6687 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6688 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6690 # @ref tui_measurement_tools_page "Example"
6691 @ManageTransactions("HealOp")
6692 def GetFreeBoundary(self, theObject, theName=None):
6694 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6695 that constitute a free boundary of the given shape.
6698 theObject Shape to get free boundary of.
6699 theName Object name; when specified, this parameter is used
6700 for result publication in the study. Otherwise, if automatic
6701 publication is switched on, default value is used for result name.
6704 [status, theClosedWires, theOpenWires]
6705 status: FALSE, if an error(s) occured during the method execution.
6706 theClosedWires: Closed wires on the free boundary of the given shape.
6707 theOpenWires: Open wires on the free boundary of the given shape.
6709 # Example: see GEOM_TestHealing.py
6710 anObj = self.HealOp.GetFreeBoundary(theObject)
6711 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6712 self._autoPublish(anObj[1], theName, "closedWire")
6713 self._autoPublish(anObj[2], theName, "openWire")
6716 ## Replace coincident faces in theShape by one face.
6717 # @param theShape Initial shape.
6718 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6719 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6720 # otherwise all initial shapes.
6721 # @param theName Object name; when specified, this parameter is used
6722 # for result publication in the study. Otherwise, if automatic
6723 # publication is switched on, default value is used for result name.
6725 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6727 # @ref tui_glue_faces "Example"
6728 @ManageTransactions("ShapesOp")
6729 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6731 Replace coincident faces in theShape by one face.
6734 theShape Initial shape.
6735 theTolerance Maximum distance between faces, which can be considered as coincident.
6736 doKeepNonSolids If FALSE, only solids will present in the result,
6737 otherwise all initial shapes.
6738 theName Object name; when specified, this parameter is used
6739 for result publication in the study. Otherwise, if automatic
6740 publication is switched on, default value is used for result name.
6743 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6745 # Example: see GEOM_Spanner.py
6746 theTolerance,Parameters = ParseParameters(theTolerance)
6747 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6749 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6750 anObj.SetParameters(Parameters)
6751 self._autoPublish(anObj, theName, "glueFaces")
6754 ## Find coincident faces in theShape for possible gluing.
6755 # @param theShape Initial shape.
6756 # @param theTolerance Maximum distance between faces,
6757 # which can be considered as coincident.
6758 # @param theName Object name; when specified, this parameter is used
6759 # for result publication in the study. Otherwise, if automatic
6760 # publication is switched on, default value is used for result name.
6762 # @return GEOM.ListOfGO
6764 # @ref tui_glue_faces "Example"
6765 @ManageTransactions("ShapesOp")
6766 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6768 Find coincident faces in theShape for possible gluing.
6771 theShape Initial shape.
6772 theTolerance Maximum distance between faces,
6773 which can be considered as coincident.
6774 theName Object name; when specified, this parameter is used
6775 for result publication in the study. Otherwise, if automatic
6776 publication is switched on, default value is used for result name.
6781 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6782 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6783 self._autoPublish(anObj, theName, "facesToGlue")
6786 ## Replace coincident faces in theShape by one face
6787 # in compliance with given list of faces
6788 # @param theShape Initial shape.
6789 # @param theTolerance Maximum distance between faces,
6790 # which can be considered as coincident.
6791 # @param theFaces List of faces for gluing.
6792 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6793 # otherwise all initial shapes.
6794 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6795 # will be glued, otherwise only the edges,
6796 # belonging to <VAR>theFaces</VAR>.
6797 # @param theName Object name; when specified, this parameter is used
6798 # for result publication in the study. Otherwise, if automatic
6799 # publication is switched on, default value is used for result name.
6801 # @return New GEOM.GEOM_Object, containing a copy of theShape
6802 # without some faces.
6804 # @ref tui_glue_faces "Example"
6805 @ManageTransactions("ShapesOp")
6806 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6807 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6809 Replace coincident faces in theShape by one face
6810 in compliance with given list of faces
6813 theShape Initial shape.
6814 theTolerance Maximum distance between faces,
6815 which can be considered as coincident.
6816 theFaces List of faces for gluing.
6817 doKeepNonSolids If FALSE, only solids will present in the result,
6818 otherwise all initial shapes.
6819 doGlueAllEdges If TRUE, all coincident edges of theShape
6820 will be glued, otherwise only the edges,
6821 belonging to theFaces.
6822 theName Object name; when specified, this parameter is used
6823 for result publication in the study. Otherwise, if automatic
6824 publication is switched on, default value is used for result name.
6827 New GEOM.GEOM_Object, containing a copy of theShape
6830 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6831 doKeepNonSolids, doGlueAllEdges)
6833 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6834 self._autoPublish(anObj, theName, "glueFaces")
6837 ## Replace coincident edges in theShape by one edge.
6838 # @param theShape Initial shape.
6839 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6840 # @param theName Object name; when specified, this parameter is used
6841 # for result publication in the study. Otherwise, if automatic
6842 # publication is switched on, default value is used for result name.
6844 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6846 # @ref tui_glue_edges "Example"
6847 @ManageTransactions("ShapesOp")
6848 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6850 Replace coincident edges in theShape by one edge.
6853 theShape Initial shape.
6854 theTolerance Maximum distance between edges, which can be considered as coincident.
6855 theName Object name; when specified, this parameter is used
6856 for result publication in the study. Otherwise, if automatic
6857 publication is switched on, default value is used for result name.
6860 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6862 theTolerance,Parameters = ParseParameters(theTolerance)
6863 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6865 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6866 anObj.SetParameters(Parameters)
6867 self._autoPublish(anObj, theName, "glueEdges")
6870 ## Find coincident edges in theShape for possible gluing.
6871 # @param theShape Initial shape.
6872 # @param theTolerance Maximum distance between edges,
6873 # which can be considered as coincident.
6874 # @param theName Object name; when specified, this parameter is used
6875 # for result publication in the study. Otherwise, if automatic
6876 # publication is switched on, default value is used for result name.
6878 # @return GEOM.ListOfGO
6880 # @ref tui_glue_edges "Example"
6881 @ManageTransactions("ShapesOp")
6882 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6884 Find coincident edges in theShape for possible gluing.
6887 theShape Initial shape.
6888 theTolerance Maximum distance between edges,
6889 which can be considered as coincident.
6890 theName Object name; when specified, this parameter is used
6891 for result publication in the study. Otherwise, if automatic
6892 publication is switched on, default value is used for result name.
6897 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6898 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6899 self._autoPublish(anObj, theName, "edgesToGlue")
6902 ## Replace coincident edges in theShape by one edge
6903 # in compliance with given list of edges.
6904 # @param theShape Initial shape.
6905 # @param theTolerance Maximum distance between edges,
6906 # which can be considered as coincident.
6907 # @param theEdges List of edges for gluing.
6908 # @param theName Object name; when specified, this parameter is used
6909 # for result publication in the study. Otherwise, if automatic
6910 # publication is switched on, default value is used for result name.
6912 # @return New GEOM.GEOM_Object, containing a copy of theShape
6913 # without some edges.
6915 # @ref tui_glue_edges "Example"
6916 @ManageTransactions("ShapesOp")
6917 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6919 Replace coincident edges in theShape by one edge
6920 in compliance with given list of edges.
6923 theShape Initial shape.
6924 theTolerance Maximum distance between edges,
6925 which can be considered as coincident.
6926 theEdges List of edges for gluing.
6927 theName Object name; when specified, this parameter is used
6928 for result publication in the study. Otherwise, if automatic
6929 publication is switched on, default value is used for result name.
6932 New GEOM.GEOM_Object, containing a copy of theShape
6935 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6937 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6938 self._autoPublish(anObj, theName, "glueEdges")
6944 ## @addtogroup l3_boolean Boolean Operations
6947 # -----------------------------------------------------------------------------
6948 # Boolean (Common, Cut, Fuse, Section)
6949 # -----------------------------------------------------------------------------
6951 ## Perform one of boolean operations on two given shapes.
6952 # @param theShape1 First argument for boolean operation.
6953 # @param theShape2 Second argument for boolean operation.
6954 # @param theOperation Indicates the operation to be done:\n
6955 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6956 # @param checkSelfInte The flag that tells if the arguments should
6957 # be checked for self-intersection prior to the operation.
6958 # @param theName Object name; when specified, this parameter is used
6959 # for result publication in the study. Otherwise, if automatic
6960 # publication is switched on, default value is used for result name.
6962 # @note This algorithm doesn't find all types of self-intersections.
6963 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6964 # vertex/face and edge/face intersections. Face/face
6965 # intersections detection is switched off as it is a
6966 # time-consuming operation that gives an impact on performance.
6967 # To find all self-intersections please use
6968 # CheckSelfIntersections() method.
6970 # @return New GEOM.GEOM_Object, containing the result shape.
6972 # @ref tui_fuse "Example"
6973 @ManageTransactions("BoolOp")
6974 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6976 Perform one of boolean operations on two given shapes.
6979 theShape1 First argument for boolean operation.
6980 theShape2 Second argument for boolean operation.
6981 theOperation Indicates the operation to be done:
6982 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6983 checkSelfInte The flag that tells if the arguments should
6984 be checked for self-intersection prior to
6986 theName Object name; when specified, this parameter is used
6987 for result publication in the study. Otherwise, if automatic
6988 publication is switched on, default value is used for result name.
6991 This algorithm doesn't find all types of self-intersections.
6992 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6993 vertex/face and edge/face intersections. Face/face
6994 intersections detection is switched off as it is a
6995 time-consuming operation that gives an impact on performance.
6996 To find all self-intersections please use
6997 CheckSelfIntersections() method.
7000 New GEOM.GEOM_Object, containing the result shape.
7002 # Example: see GEOM_TestAll.py
7003 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7004 RaiseIfFailed("MakeBoolean", self.BoolOp)
7005 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7006 self._autoPublish(anObj, theName, def_names[theOperation])
7009 ## Perform Common boolean operation on two given shapes.
7010 # @param theShape1 First argument for boolean operation.
7011 # @param theShape2 Second argument for boolean operation.
7012 # @param checkSelfInte The flag that tells if the arguments should
7013 # be checked for self-intersection prior to the operation.
7014 # @param theName Object name; when specified, this parameter is used
7015 # for result publication in the study. Otherwise, if automatic
7016 # publication is switched on, default value is used for result name.
7018 # @note This algorithm doesn't find all types of self-intersections.
7019 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7020 # vertex/face and edge/face intersections. Face/face
7021 # intersections detection is switched off as it is a
7022 # time-consuming operation that gives an impact on performance.
7023 # To find all self-intersections please use
7024 # CheckSelfIntersections() method.
7026 # @return New GEOM.GEOM_Object, containing the result shape.
7028 # @ref tui_common "Example 1"
7029 # \n @ref swig_MakeCommon "Example 2"
7030 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7032 Perform Common boolean operation on two given shapes.
7035 theShape1 First argument for boolean operation.
7036 theShape2 Second argument for boolean operation.
7037 checkSelfInte The flag that tells if the arguments should
7038 be checked for self-intersection prior to
7040 theName Object name; when specified, this parameter is used
7041 for result publication in the study. Otherwise, if automatic
7042 publication is switched on, default value is used for result name.
7045 This algorithm doesn't find all types of self-intersections.
7046 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7047 vertex/face and edge/face intersections. Face/face
7048 intersections detection is switched off as it is a
7049 time-consuming operation that gives an impact on performance.
7050 To find all self-intersections please use
7051 CheckSelfIntersections() method.
7054 New GEOM.GEOM_Object, containing the result shape.
7056 # Example: see GEOM_TestOthers.py
7057 # note: auto-publishing is done in self.MakeBoolean()
7058 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7060 ## Perform Cut boolean operation on two given shapes.
7061 # @param theShape1 First argument for boolean operation.
7062 # @param theShape2 Second argument for boolean operation.
7063 # @param checkSelfInte The flag that tells if the arguments should
7064 # be checked for self-intersection prior to the operation.
7065 # @param theName Object name; when specified, this parameter is used
7066 # for result publication in the study. Otherwise, if automatic
7067 # publication is switched on, default value is used for result name.
7069 # @note This algorithm doesn't find all types of self-intersections.
7070 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7071 # vertex/face and edge/face intersections. Face/face
7072 # intersections detection is switched off as it is a
7073 # time-consuming operation that gives an impact on performance.
7074 # To find all self-intersections please use
7075 # CheckSelfIntersections() method.
7077 # @return New GEOM.GEOM_Object, containing the result shape.
7079 # @ref tui_cut "Example 1"
7080 # \n @ref swig_MakeCommon "Example 2"
7081 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7083 Perform Cut boolean operation on two given shapes.
7086 theShape1 First argument for boolean operation.
7087 theShape2 Second argument for boolean operation.
7088 checkSelfInte The flag that tells if the arguments should
7089 be checked for self-intersection prior to
7091 theName Object name; when specified, this parameter is used
7092 for result publication in the study. Otherwise, if automatic
7093 publication is switched on, default value is used for result name.
7096 This algorithm doesn't find all types of self-intersections.
7097 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7098 vertex/face and edge/face intersections. Face/face
7099 intersections detection is switched off as it is a
7100 time-consuming operation that gives an impact on performance.
7101 To find all self-intersections please use
7102 CheckSelfIntersections() method.
7105 New GEOM.GEOM_Object, containing the result shape.
7108 # Example: see GEOM_TestOthers.py
7109 # note: auto-publishing is done in self.MakeBoolean()
7110 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7112 ## Perform Fuse boolean operation on two given shapes.
7113 # @param theShape1 First argument for boolean operation.
7114 # @param theShape2 Second argument for boolean operation.
7115 # @param checkSelfInte The flag that tells if the arguments should
7116 # be checked for self-intersection prior to the operation.
7117 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7118 # operation should be performed during the operation.
7119 # @param theName Object name; when specified, this parameter is used
7120 # for result publication in the study. Otherwise, if automatic
7121 # publication is switched on, default value is used for result name.
7123 # @note This algorithm doesn't find all types of self-intersections.
7124 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7125 # vertex/face and edge/face intersections. Face/face
7126 # intersections detection is switched off as it is a
7127 # time-consuming operation that gives an impact on performance.
7128 # To find all self-intersections please use
7129 # CheckSelfIntersections() method.
7131 # @return New GEOM.GEOM_Object, containing the result shape.
7133 # @ref tui_fuse "Example 1"
7134 # \n @ref swig_MakeCommon "Example 2"
7135 @ManageTransactions("BoolOp")
7136 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7137 rmExtraEdges=False, theName=None):
7139 Perform Fuse boolean operation on two given shapes.
7142 theShape1 First argument for boolean operation.
7143 theShape2 Second argument for boolean operation.
7144 checkSelfInte The flag that tells if the arguments should
7145 be checked for self-intersection prior to
7147 rmExtraEdges The flag that tells if Remove Extra Edges
7148 operation should be performed during the operation.
7149 theName Object name; when specified, this parameter is used
7150 for result publication in the study. Otherwise, if automatic
7151 publication is switched on, default value is used for result name.
7154 This algorithm doesn't find all types of self-intersections.
7155 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7156 vertex/face and edge/face intersections. Face/face
7157 intersections detection is switched off as it is a
7158 time-consuming operation that gives an impact on performance.
7159 To find all self-intersections please use
7160 CheckSelfIntersections() method.
7163 New GEOM.GEOM_Object, containing the result shape.
7166 # Example: see GEOM_TestOthers.py
7167 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7168 checkSelfInte, rmExtraEdges)
7169 RaiseIfFailed("MakeFuse", self.BoolOp)
7170 self._autoPublish(anObj, theName, "fuse")
7173 ## Perform Section boolean operation on two given shapes.
7174 # @param theShape1 First argument for boolean operation.
7175 # @param theShape2 Second argument for boolean operation.
7176 # @param checkSelfInte The flag that tells if the arguments should
7177 # be checked for self-intersection prior to the operation.
7178 # @param theName Object name; when specified, this parameter is used
7179 # for result publication in the study. Otherwise, if automatic
7180 # publication is switched on, default value is used for result name.
7182 # @note This algorithm doesn't find all types of self-intersections.
7183 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7184 # vertex/face and edge/face intersections. Face/face
7185 # intersections detection is switched off as it is a
7186 # time-consuming operation that gives an impact on performance.
7187 # To find all self-intersections please use
7188 # CheckSelfIntersections() method.
7190 # @return New GEOM.GEOM_Object, containing the result shape.
7192 # @ref tui_section "Example 1"
7193 # \n @ref swig_MakeCommon "Example 2"
7194 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7196 Perform Section boolean operation on two given shapes.
7199 theShape1 First argument for boolean operation.
7200 theShape2 Second argument for boolean operation.
7201 checkSelfInte The flag that tells if the arguments should
7202 be checked for self-intersection prior to
7204 theName Object name; when specified, this parameter is used
7205 for result publication in the study. Otherwise, if automatic
7206 publication is switched on, default value is used for result name.
7209 This algorithm doesn't find all types of self-intersections.
7210 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7211 vertex/face and edge/face intersections. Face/face
7212 intersections detection is switched off as it is a
7213 time-consuming operation that gives an impact on performance.
7214 To find all self-intersections please use
7215 CheckSelfIntersections() method.
7218 New GEOM.GEOM_Object, containing the result shape.
7221 # Example: see GEOM_TestOthers.py
7222 # note: auto-publishing is done in self.MakeBoolean()
7223 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7225 ## Perform Fuse boolean operation on the list of shapes.
7226 # @param theShapesList Shapes to be fused.
7227 # @param checkSelfInte The flag that tells if the arguments should
7228 # be checked for self-intersection prior to the operation.
7229 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7230 # operation should be performed during the operation.
7231 # @param theName Object name; when specified, this parameter is used
7232 # for result publication in the study. Otherwise, if automatic
7233 # publication is switched on, default value is used for result name.
7235 # @note This algorithm doesn't find all types of self-intersections.
7236 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7237 # vertex/face and edge/face intersections. Face/face
7238 # intersections detection is switched off as it is a
7239 # time-consuming operation that gives an impact on performance.
7240 # To find all self-intersections please use
7241 # CheckSelfIntersections() method.
7243 # @return New GEOM.GEOM_Object, containing the result shape.
7245 # @ref tui_fuse "Example 1"
7246 # \n @ref swig_MakeCommon "Example 2"
7247 @ManageTransactions("BoolOp")
7248 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7249 rmExtraEdges=False, theName=None):
7251 Perform Fuse boolean operation on the list of shapes.
7254 theShapesList Shapes to be fused.
7255 checkSelfInte The flag that tells if the arguments should
7256 be checked for self-intersection prior to
7258 rmExtraEdges The flag that tells if Remove Extra Edges
7259 operation should be performed during the operation.
7260 theName Object name; when specified, this parameter is used
7261 for result publication in the study. Otherwise, if automatic
7262 publication is switched on, default value is used for result name.
7265 This algorithm doesn't find all types of self-intersections.
7266 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7267 vertex/face and edge/face intersections. Face/face
7268 intersections detection is switched off as it is a
7269 time-consuming operation that gives an impact on performance.
7270 To find all self-intersections please use
7271 CheckSelfIntersections() method.
7274 New GEOM.GEOM_Object, containing the result shape.
7277 # Example: see GEOM_TestOthers.py
7278 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7280 RaiseIfFailed("MakeFuseList", self.BoolOp)
7281 self._autoPublish(anObj, theName, "fuse")
7284 ## Perform Common boolean operation on the list of shapes.
7285 # @param theShapesList Shapes for Common operation.
7286 # @param checkSelfInte The flag that tells if the arguments should
7287 # be checked for self-intersection prior to the operation.
7288 # @param theName Object name; when specified, this parameter is used
7289 # for result publication in the study. Otherwise, if automatic
7290 # publication is switched on, default value is used for result name.
7292 # @note This algorithm doesn't find all types of self-intersections.
7293 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7294 # vertex/face and edge/face intersections. Face/face
7295 # intersections detection is switched off as it is a
7296 # time-consuming operation that gives an impact on performance.
7297 # To find all self-intersections please use
7298 # CheckSelfIntersections() method.
7300 # @return New GEOM.GEOM_Object, containing the result shape.
7302 # @ref tui_common "Example 1"
7303 # \n @ref swig_MakeCommon "Example 2"
7304 @ManageTransactions("BoolOp")
7305 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7307 Perform Common boolean operation on the list of shapes.
7310 theShapesList Shapes for Common operation.
7311 checkSelfInte The flag that tells if the arguments should
7312 be checked for self-intersection prior to
7314 theName Object name; when specified, this parameter is used
7315 for result publication in the study. Otherwise, if automatic
7316 publication is switched on, default value is used for result name.
7319 This algorithm doesn't find all types of self-intersections.
7320 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7321 vertex/face and edge/face intersections. Face/face
7322 intersections detection is switched off as it is a
7323 time-consuming operation that gives an impact on performance.
7324 To find all self-intersections please use
7325 CheckSelfIntersections() method.
7328 New GEOM.GEOM_Object, containing the result shape.
7331 # Example: see GEOM_TestOthers.py
7332 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7333 RaiseIfFailed("MakeCommonList", self.BoolOp)
7334 self._autoPublish(anObj, theName, "common")
7337 ## Perform Cut boolean operation on one object and the list of tools.
7338 # @param theMainShape The object of the operation.
7339 # @param theShapesList The list of tools of the operation.
7340 # @param checkSelfInte The flag that tells if the arguments should
7341 # be checked for self-intersection prior to the operation.
7342 # @param theName Object name; when specified, this parameter is used
7343 # for result publication in the study. Otherwise, if automatic
7344 # publication is switched on, default value is used for result name.
7346 # @note This algorithm doesn't find all types of self-intersections.
7347 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7348 # vertex/face and edge/face intersections. Face/face
7349 # intersections detection is switched off as it is a
7350 # time-consuming operation that gives an impact on performance.
7351 # To find all self-intersections please use
7352 # CheckSelfIntersections() method.
7354 # @return New GEOM.GEOM_Object, containing the result shape.
7356 # @ref tui_cut "Example 1"
7357 # \n @ref swig_MakeCommon "Example 2"
7358 @ManageTransactions("BoolOp")
7359 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7361 Perform Cut boolean operation on one object and the list of tools.
7364 theMainShape The object of the operation.
7365 theShapesList The list of tools of the operation.
7366 checkSelfInte The flag that tells if the arguments should
7367 be checked for self-intersection prior to
7369 theName Object name; when specified, this parameter is used
7370 for result publication in the study. Otherwise, if automatic
7371 publication is switched on, default value is used for result name.
7374 This algorithm doesn't find all types of self-intersections.
7375 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7376 vertex/face and edge/face intersections. Face/face
7377 intersections detection is switched off as it is a
7378 time-consuming operation that gives an impact on performance.
7379 To find all self-intersections please use
7380 CheckSelfIntersections() method.
7383 New GEOM.GEOM_Object, containing the result shape.
7386 # Example: see GEOM_TestOthers.py
7387 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7388 RaiseIfFailed("MakeCutList", self.BoolOp)
7389 self._autoPublish(anObj, theName, "cut")
7395 ## @addtogroup l3_basic_op
7398 ## Perform partition operation.
7399 # @param ListShapes Shapes to be intersected.
7400 # @param ListTools Shapes to intersect theShapes.
7401 # @param Limit Type of resulting shapes (see ShapeType()).\n
7402 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7403 # type will be detected automatically.
7404 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7405 # target type (equal to Limit) are kept in the result,
7406 # else standalone shapes of lower dimension
7407 # are kept also (if they exist).
7409 # @param theName Object name; when specified, this parameter is used
7410 # for result publication in the study. Otherwise, if automatic
7411 # publication is switched on, default value is used for result name.
7413 # @note Each compound from ListShapes and ListTools will be exploded
7414 # in order to avoid possible intersection between shapes from this compound.
7416 # After implementation new version of PartitionAlgo (October 2006)
7417 # other parameters are ignored by current functionality. They are kept
7418 # in this function only for support old versions.
7419 # @param ListKeepInside Shapes, outside which the results will be deleted.
7420 # Each shape from theKeepInside must belong to theShapes also.
7421 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7422 # Each shape from theRemoveInside must belong to theShapes also.
7423 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7424 # @param ListMaterials Material indices for each shape. Make sence,
7425 # only if theRemoveWebs is TRUE.
7427 # @return New GEOM.GEOM_Object, containing the result shapes.
7429 # @ref tui_partition "Example"
7430 @ManageTransactions("BoolOp")
7431 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7432 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7433 KeepNonlimitShapes=0, theName=None):
7435 Perform partition operation.
7438 ListShapes Shapes to be intersected.
7439 ListTools Shapes to intersect theShapes.
7440 Limit Type of resulting shapes (see geompy.ShapeType)
7441 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7442 type will be detected automatically.
7443 KeepNonlimitShapes if this parameter == 0, then only shapes of
7444 target type (equal to Limit) are kept in the result,
7445 else standalone shapes of lower dimension
7446 are kept also (if they exist).
7448 theName Object name; when specified, this parameter is used
7449 for result publication in the study. Otherwise, if automatic
7450 publication is switched on, default value is used for result name.
7452 Each compound from ListShapes and ListTools will be exploded
7453 in order to avoid possible intersection between shapes from
7456 After implementation new version of PartitionAlgo (October 2006) other
7457 parameters are ignored by current functionality. They are kept in this
7458 function only for support old versions.
7461 ListKeepInside Shapes, outside which the results will be deleted.
7462 Each shape from theKeepInside must belong to theShapes also.
7463 ListRemoveInside Shapes, inside which the results will be deleted.
7464 Each shape from theRemoveInside must belong to theShapes also.
7465 RemoveWebs If TRUE, perform Glue 3D algorithm.
7466 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7469 New GEOM.GEOM_Object, containing the result shapes.
7471 # Example: see GEOM_TestAll.py
7472 if Limit == self.ShapeType["AUTO"]:
7473 # automatic detection of the most appropriate shape limit type
7475 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7476 Limit = EnumToLong(lim)
7478 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7479 ListKeepInside, ListRemoveInside,
7480 Limit, RemoveWebs, ListMaterials,
7481 KeepNonlimitShapes);
7482 RaiseIfFailed("MakePartition", self.BoolOp)
7483 self._autoPublish(anObj, theName, "partition")
7486 ## Perform partition operation.
7487 # This method may be useful if it is needed to make a partition for
7488 # compound contains nonintersected shapes. Performance will be better
7489 # since intersection between shapes from compound is not performed.
7491 # Description of all parameters as in previous method MakePartition().
7492 # One additional parameter is provided:
7493 # @param checkSelfInte The flag that tells if the arguments should
7494 # be checked for self-intersection prior to the operation.
7496 # @note This algorithm doesn't find all types of self-intersections.
7497 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7498 # vertex/face and edge/face intersections. Face/face
7499 # intersections detection is switched off as it is a
7500 # time-consuming operation that gives an impact on performance.
7501 # To find all self-intersections please use
7502 # CheckSelfIntersections() method.
7504 # @note Passed compounds (via ListShapes or via ListTools)
7505 # have to consist of nonintersecting shapes.
7507 # @return New GEOM.GEOM_Object, containing the result shapes.
7509 # @ref swig_todo "Example"
7510 @ManageTransactions("BoolOp")
7511 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7512 ListKeepInside=[], ListRemoveInside=[],
7513 Limit=ShapeType["AUTO"], RemoveWebs=0,
7514 ListMaterials=[], KeepNonlimitShapes=0,
7515 checkSelfInte=False, theName=None):
7517 Perform partition operation.
7518 This method may be useful if it is needed to make a partition for
7519 compound contains nonintersected shapes. Performance will be better
7520 since intersection between shapes from compound is not performed.
7523 Description of all parameters as in method geompy.MakePartition.
7524 One additional parameter is provided:
7525 checkSelfInte The flag that tells if the arguments should
7526 be checked for self-intersection prior to
7530 This algorithm doesn't find all types of self-intersections.
7531 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7532 vertex/face and edge/face intersections. Face/face
7533 intersections detection is switched off as it is a
7534 time-consuming operation that gives an impact on performance.
7535 To find all self-intersections please use
7536 CheckSelfIntersections() method.
7539 Passed compounds (via ListShapes or via ListTools)
7540 have to consist of nonintersecting shapes.
7543 New GEOM.GEOM_Object, containing the result shapes.
7545 if Limit == self.ShapeType["AUTO"]:
7546 # automatic detection of the most appropriate shape limit type
7548 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7549 Limit = EnumToLong(lim)
7551 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7552 ListKeepInside, ListRemoveInside,
7553 Limit, RemoveWebs, ListMaterials,
7554 KeepNonlimitShapes, checkSelfInte);
7555 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7556 self._autoPublish(anObj, theName, "partition")
7559 ## See method MakePartition() for more information.
7561 # @ref tui_partition "Example 1"
7562 # \n @ref swig_Partition "Example 2"
7563 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7564 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7565 KeepNonlimitShapes=0, theName=None):
7567 See method geompy.MakePartition for more information.
7569 # Example: see GEOM_TestOthers.py
7570 # note: auto-publishing is done in self.MakePartition()
7571 anObj = self.MakePartition(ListShapes, ListTools,
7572 ListKeepInside, ListRemoveInside,
7573 Limit, RemoveWebs, ListMaterials,
7574 KeepNonlimitShapes, theName);
7577 ## Perform partition of the Shape with the Plane
7578 # @param theShape Shape to be intersected.
7579 # @param thePlane Tool shape, to intersect theShape.
7580 # @param theName Object name; when specified, this parameter is used
7581 # for result publication in the study. Otherwise, if automatic
7582 # publication is switched on, default value is used for result name.
7584 # @return New GEOM.GEOM_Object, containing the result shape.
7586 # @ref tui_partition "Example"
7587 @ManageTransactions("BoolOp")
7588 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7590 Perform partition of the Shape with the Plane
7593 theShape Shape to be intersected.
7594 thePlane Tool shape, to intersect theShape.
7595 theName Object name; when specified, this parameter is used
7596 for result publication in the study. Otherwise, if automatic
7597 publication is switched on, default value is used for result name.
7600 New GEOM.GEOM_Object, containing the result shape.
7602 # Example: see GEOM_TestAll.py
7603 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7604 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7605 self._autoPublish(anObj, theName, "partition")
7608 # end of l3_basic_op
7611 ## @addtogroup l3_transform
7614 ## Translate the given object along the vector, specified
7615 # by its end points.
7616 # @param theObject The object to be translated.
7617 # @param thePoint1 Start point of translation vector.
7618 # @param thePoint2 End point of translation vector.
7619 # @param theCopy Flag used to translate object itself or create a copy.
7620 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7621 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7622 @ManageTransactions("TrsfOp")
7623 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7625 Translate the given object along the vector, specified by its end points.
7628 theObject The object to be translated.
7629 thePoint1 Start point of translation vector.
7630 thePoint2 End point of translation vector.
7631 theCopy Flag used to translate object itself or create a copy.
7634 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7635 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7638 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7640 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7641 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7644 ## Translate the given object along the vector, specified
7645 # by its end points, creating its copy before the translation.
7646 # @param theObject The object to be translated.
7647 # @param thePoint1 Start point of translation vector.
7648 # @param thePoint2 End point of translation vector.
7649 # @param theName Object name; when specified, this parameter is used
7650 # for result publication in the study. Otherwise, if automatic
7651 # publication is switched on, default value is used for result name.
7653 # @return New GEOM.GEOM_Object, containing the translated object.
7655 # @ref tui_translation "Example 1"
7656 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7657 @ManageTransactions("TrsfOp")
7658 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7660 Translate the given object along the vector, specified
7661 by its end points, creating its copy before the translation.
7664 theObject The object to be translated.
7665 thePoint1 Start point of translation vector.
7666 thePoint2 End point of translation vector.
7667 theName Object name; when specified, this parameter is used
7668 for result publication in the study. Otherwise, if automatic
7669 publication is switched on, default value is used for result name.
7672 New GEOM.GEOM_Object, containing the translated object.
7674 # Example: see GEOM_TestAll.py
7675 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7676 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7677 self._autoPublish(anObj, theName, "translated")
7680 ## Translate the given object along the vector, specified by its components.
7681 # @param theObject The object to be translated.
7682 # @param theDX,theDY,theDZ Components of translation vector.
7683 # @param theCopy Flag used to translate object itself or create a copy.
7684 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7685 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7687 # @ref tui_translation "Example"
7688 @ManageTransactions("TrsfOp")
7689 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7691 Translate the given object along the vector, specified by its components.
7694 theObject The object to be translated.
7695 theDX,theDY,theDZ Components of translation vector.
7696 theCopy Flag used to translate object itself or create a copy.
7699 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7700 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7702 # Example: see GEOM_TestAll.py
7703 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7705 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7707 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7708 anObj.SetParameters(Parameters)
7709 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7712 ## Translate the given object along the vector, specified
7713 # by its components, creating its copy before the translation.
7714 # @param theObject The object to be translated.
7715 # @param theDX,theDY,theDZ Components of translation vector.
7716 # @param theName Object name; when specified, this parameter is used
7717 # for result publication in the study. Otherwise, if automatic
7718 # publication is switched on, default value is used for result name.
7720 # @return New GEOM.GEOM_Object, containing the translated object.
7722 # @ref tui_translation "Example"
7723 @ManageTransactions("TrsfOp")
7724 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7726 Translate the given object along the vector, specified
7727 by its components, creating its copy before the translation.
7730 theObject The object to be translated.
7731 theDX,theDY,theDZ Components of translation vector.
7732 theName Object name; when specified, this parameter is used
7733 for result publication in the study. Otherwise, if automatic
7734 publication is switched on, default value is used for result name.
7737 New GEOM.GEOM_Object, containing the translated object.
7739 # Example: see GEOM_TestAll.py
7740 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7741 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7742 anObj.SetParameters(Parameters)
7743 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7744 self._autoPublish(anObj, theName, "translated")
7747 ## Translate the given object along the given vector.
7748 # @param theObject The object to be translated.
7749 # @param theVector The translation vector.
7750 # @param theCopy Flag used to translate object itself or create a copy.
7751 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7752 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7753 @ManageTransactions("TrsfOp")
7754 def TranslateVector(self, theObject, theVector, theCopy=False):
7756 Translate the given object along the given vector.
7759 theObject The object to be translated.
7760 theVector The translation vector.
7761 theCopy Flag used to translate object itself or create a copy.
7764 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7765 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7768 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7770 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7771 RaiseIfFailed("TranslateVector", self.TrsfOp)
7774 ## Translate the given object along the given vector,
7775 # creating its copy before the translation.
7776 # @param theObject The object to be translated.
7777 # @param theVector The translation vector.
7778 # @param theName Object name; when specified, this parameter is used
7779 # for result publication in the study. Otherwise, if automatic
7780 # publication is switched on, default value is used for result name.
7782 # @return New GEOM.GEOM_Object, containing the translated object.
7784 # @ref tui_translation "Example"
7785 @ManageTransactions("TrsfOp")
7786 def MakeTranslationVector(self, theObject, theVector, theName=None):
7788 Translate the given object along the given vector,
7789 creating its copy before the translation.
7792 theObject The object to be translated.
7793 theVector The translation vector.
7794 theName Object name; when specified, this parameter is used
7795 for result publication in the study. Otherwise, if automatic
7796 publication is switched on, default value is used for result name.
7799 New GEOM.GEOM_Object, containing the translated object.
7801 # Example: see GEOM_TestAll.py
7802 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7803 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7804 self._autoPublish(anObj, theName, "translated")
7807 ## Translate the given object along the given vector on given distance.
7808 # @param theObject The object to be translated.
7809 # @param theVector The translation vector.
7810 # @param theDistance The translation distance.
7811 # @param theCopy Flag used to translate object itself or create a copy.
7812 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7813 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7815 # @ref tui_translation "Example"
7816 @ManageTransactions("TrsfOp")
7817 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7819 Translate the given object along the given vector on given distance.
7822 theObject The object to be translated.
7823 theVector The translation vector.
7824 theDistance The translation distance.
7825 theCopy Flag used to translate object itself or create a copy.
7828 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7829 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7831 # Example: see GEOM_TestAll.py
7832 theDistance,Parameters = ParseParameters(theDistance)
7833 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7834 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7835 anObj.SetParameters(Parameters)
7838 ## Translate the given object along the given vector on given distance,
7839 # creating its copy before the translation.
7840 # @param theObject The object to be translated.
7841 # @param theVector The translation vector.
7842 # @param theDistance The translation distance.
7843 # @param theName Object name; when specified, this parameter is used
7844 # for result publication in the study. Otherwise, if automatic
7845 # publication is switched on, default value is used for result name.
7847 # @return New GEOM.GEOM_Object, containing the translated object.
7849 # @ref tui_translation "Example"
7850 @ManageTransactions("TrsfOp")
7851 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7853 Translate the given object along the given vector on given distance,
7854 creating its copy before the translation.
7857 theObject The object to be translated.
7858 theVector The translation vector.
7859 theDistance The translation distance.
7860 theName Object name; when specified, this parameter is used
7861 for result publication in the study. Otherwise, if automatic
7862 publication is switched on, default value is used for result name.
7865 New GEOM.GEOM_Object, containing the translated object.
7867 # Example: see GEOM_TestAll.py
7868 theDistance,Parameters = ParseParameters(theDistance)
7869 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7870 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7871 anObj.SetParameters(Parameters)
7872 self._autoPublish(anObj, theName, "translated")
7875 ## Rotate the given object around the given axis on the given angle.
7876 # @param theObject The object to be rotated.
7877 # @param theAxis Rotation axis.
7878 # @param theAngle Rotation angle in radians.
7879 # @param theCopy Flag used to rotate object itself or create a copy.
7881 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7882 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7884 # @ref tui_rotation "Example"
7885 @ManageTransactions("TrsfOp")
7886 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7888 Rotate the given object around the given axis on the given angle.
7891 theObject The object to be rotated.
7892 theAxis Rotation axis.
7893 theAngle Rotation angle in radians.
7894 theCopy Flag used to rotate object itself or create a copy.
7897 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7898 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7900 # Example: see GEOM_TestAll.py
7902 if isinstance(theAngle,str):
7904 theAngle, Parameters = ParseParameters(theAngle)
7906 theAngle = theAngle*math.pi/180.0
7908 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7910 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7911 RaiseIfFailed("Rotate", self.TrsfOp)
7912 anObj.SetParameters(Parameters)
7915 ## Rotate the given object around the given axis
7916 # on the given angle, creating its copy before the rotation.
7917 # @param theObject The object to be rotated.
7918 # @param theAxis Rotation axis.
7919 # @param theAngle Rotation angle in radians.
7920 # @param theName Object name; when specified, this parameter is used
7921 # for result publication in the study. Otherwise, if automatic
7922 # publication is switched on, default value is used for result name.
7924 # @return New GEOM.GEOM_Object, containing the rotated object.
7926 # @ref tui_rotation "Example"
7927 @ManageTransactions("TrsfOp")
7928 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7930 Rotate the given object around the given axis
7931 on the given angle, creating its copy before the rotatation.
7934 theObject The object to be rotated.
7935 theAxis Rotation axis.
7936 theAngle Rotation angle in radians.
7937 theName Object name; when specified, this parameter is used
7938 for result publication in the study. Otherwise, if automatic
7939 publication is switched on, default value is used for result name.
7942 New GEOM.GEOM_Object, containing the rotated object.
7944 # Example: see GEOM_TestAll.py
7946 if isinstance(theAngle,str):
7948 theAngle, Parameters = ParseParameters(theAngle)
7950 theAngle = theAngle*math.pi/180.0
7951 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7952 RaiseIfFailed("RotateCopy", self.TrsfOp)
7953 anObj.SetParameters(Parameters)
7954 self._autoPublish(anObj, theName, "rotated")
7957 ## Rotate given object around vector perpendicular to plane
7958 # containing three points.
7959 # @param theObject The object to be rotated.
7960 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7961 # containing the three points.
7962 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7963 # @param theCopy Flag used to rotate object itself or create a copy.
7964 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7965 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7966 @ManageTransactions("TrsfOp")
7967 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7969 Rotate given object around vector perpendicular to plane
7970 containing three points.
7973 theObject The object to be rotated.
7974 theCentPoint central point the axis is the vector perpendicular to the plane
7975 containing the three points.
7976 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7977 theCopy Flag used to rotate object itself or create a copy.
7980 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7981 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7984 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7986 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7987 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7990 ## Rotate given object around vector perpendicular to plane
7991 # containing three points, creating its copy before the rotatation.
7992 # @param theObject The object to be rotated.
7993 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7994 # containing the three points.
7995 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7996 # @param theName Object name; when specified, this parameter is used
7997 # for result publication in the study. Otherwise, if automatic
7998 # publication is switched on, default value is used for result name.
8000 # @return New GEOM.GEOM_Object, containing the rotated object.
8002 # @ref tui_rotation "Example"
8003 @ManageTransactions("TrsfOp")
8004 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8006 Rotate given object around vector perpendicular to plane
8007 containing three points, creating its copy before the rotatation.
8010 theObject The object to be rotated.
8011 theCentPoint central point the axis is the vector perpendicular to the plane
8012 containing the three points.
8013 thePoint1,thePoint2 in a perpendicular plane of the axis.
8014 theName Object name; when specified, this parameter is used
8015 for result publication in the study. Otherwise, if automatic
8016 publication is switched on, default value is used for result name.
8019 New GEOM.GEOM_Object, containing the rotated object.
8021 # Example: see GEOM_TestAll.py
8022 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8023 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8024 self._autoPublish(anObj, theName, "rotated")
8027 ## Scale the given object by the specified factor.
8028 # @param theObject The object to be scaled.
8029 # @param thePoint Center point for scaling.
8030 # Passing None for it means scaling relatively the origin of global CS.
8031 # @param theFactor Scaling factor value.
8032 # @param theCopy Flag used to scale object itself or create a copy.
8033 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8034 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8035 @ManageTransactions("TrsfOp")
8036 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8038 Scale the given object by the specified factor.
8041 theObject The object to be scaled.
8042 thePoint Center point for scaling.
8043 Passing None for it means scaling relatively the origin of global CS.
8044 theFactor Scaling factor value.
8045 theCopy Flag used to scale object itself or create a copy.
8048 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8049 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8051 # Example: see GEOM_TestAll.py
8052 theFactor, Parameters = ParseParameters(theFactor)
8054 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8056 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8057 RaiseIfFailed("Scale", self.TrsfOp)
8058 anObj.SetParameters(Parameters)
8061 ## Scale the given object by the factor, creating its copy before the scaling.
8062 # @param theObject The object to be scaled.
8063 # @param thePoint Center point for scaling.
8064 # Passing None for it means scaling relatively the origin of global CS.
8065 # @param theFactor Scaling factor value.
8066 # @param theName Object name; when specified, this parameter is used
8067 # for result publication in the study. Otherwise, if automatic
8068 # publication is switched on, default value is used for result name.
8070 # @return New GEOM.GEOM_Object, containing the scaled shape.
8072 # @ref tui_scale "Example"
8073 @ManageTransactions("TrsfOp")
8074 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8076 Scale the given object by the factor, creating its copy before the scaling.
8079 theObject The object to be scaled.
8080 thePoint Center point for scaling.
8081 Passing None for it means scaling relatively the origin of global CS.
8082 theFactor Scaling factor value.
8083 theName Object name; when specified, this parameter is used
8084 for result publication in the study. Otherwise, if automatic
8085 publication is switched on, default value is used for result name.
8088 New GEOM.GEOM_Object, containing the scaled shape.
8090 # Example: see GEOM_TestAll.py
8091 theFactor, Parameters = ParseParameters(theFactor)
8092 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8093 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8094 anObj.SetParameters(Parameters)
8095 self._autoPublish(anObj, theName, "scaled")
8098 ## Scale the given object by different factors along coordinate axes.
8099 # @param theObject The object to be scaled.
8100 # @param thePoint Center point for scaling.
8101 # Passing None for it means scaling relatively the origin of global CS.
8102 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8103 # @param theCopy Flag used to scale object itself or create a copy.
8104 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8105 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8106 @ManageTransactions("TrsfOp")
8107 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8109 Scale the given object by different factors along coordinate axes.
8112 theObject The object to be scaled.
8113 thePoint Center point for scaling.
8114 Passing None for it means scaling relatively the origin of global CS.
8115 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8116 theCopy Flag used to scale object itself or create a copy.
8119 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8120 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8122 # Example: see GEOM_TestAll.py
8123 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8125 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8126 theFactorX, theFactorY, theFactorZ)
8128 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8129 theFactorX, theFactorY, theFactorZ)
8130 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8131 anObj.SetParameters(Parameters)
8134 ## Scale the given object by different factors along coordinate axes,
8135 # creating its copy before the scaling.
8136 # @param theObject The object to be scaled.
8137 # @param thePoint Center point for scaling.
8138 # Passing None for it means scaling relatively the origin of global CS.
8139 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8140 # @param theName Object name; when specified, this parameter is used
8141 # for result publication in the study. Otherwise, if automatic
8142 # publication is switched on, default value is used for result name.
8144 # @return New GEOM.GEOM_Object, containing the scaled shape.
8146 # @ref swig_scale "Example"
8147 @ManageTransactions("TrsfOp")
8148 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8150 Scale the given object by different factors along coordinate axes,
8151 creating its copy before the scaling.
8154 theObject The object to be scaled.
8155 thePoint Center point for scaling.
8156 Passing None for it means scaling relatively the origin of global CS.
8157 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8158 theName Object name; when specified, this parameter is used
8159 for result publication in the study. Otherwise, if automatic
8160 publication is switched on, default value is used for result name.
8163 New GEOM.GEOM_Object, containing the scaled shape.
8165 # Example: see GEOM_TestAll.py
8166 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8167 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8168 theFactorX, theFactorY, theFactorZ)
8169 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8170 anObj.SetParameters(Parameters)
8171 self._autoPublish(anObj, theName, "scaled")
8174 ## Mirror an object relatively the given plane.
8175 # @param theObject The object to be mirrored.
8176 # @param thePlane Plane of symmetry.
8177 # @param theCopy Flag used to mirror object itself or create a copy.
8178 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8179 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8180 @ManageTransactions("TrsfOp")
8181 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8183 Mirror an object relatively the given plane.
8186 theObject The object to be mirrored.
8187 thePlane Plane of symmetry.
8188 theCopy Flag used to mirror object itself or create a copy.
8191 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8192 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8195 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8197 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8198 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8201 ## Create an object, symmetrical
8202 # to the given one relatively the given plane.
8203 # @param theObject The object to be mirrored.
8204 # @param thePlane Plane of symmetry.
8205 # @param theName Object name; when specified, this parameter is used
8206 # for result publication in the study. Otherwise, if automatic
8207 # publication is switched on, default value is used for result name.
8209 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8211 # @ref tui_mirror "Example"
8212 @ManageTransactions("TrsfOp")
8213 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8215 Create an object, symmetrical to the given one relatively the given plane.
8218 theObject The object to be mirrored.
8219 thePlane Plane of symmetry.
8220 theName Object name; when specified, this parameter is used
8221 for result publication in the study. Otherwise, if automatic
8222 publication is switched on, default value is used for result name.
8225 New GEOM.GEOM_Object, containing the mirrored shape.
8227 # Example: see GEOM_TestAll.py
8228 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8229 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8230 self._autoPublish(anObj, theName, "mirrored")
8233 ## Mirror an object relatively the given axis.
8234 # @param theObject The object to be mirrored.
8235 # @param theAxis Axis of symmetry.
8236 # @param theCopy Flag used to mirror object itself or create a copy.
8237 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8238 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8239 @ManageTransactions("TrsfOp")
8240 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8242 Mirror an object relatively the given axis.
8245 theObject The object to be mirrored.
8246 theAxis Axis of symmetry.
8247 theCopy Flag used to mirror object itself or create a copy.
8250 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8251 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8254 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8256 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8257 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8260 ## Create an object, symmetrical
8261 # to the given one relatively the given axis.
8262 # @param theObject The object to be mirrored.
8263 # @param theAxis Axis of symmetry.
8264 # @param theName Object name; when specified, this parameter is used
8265 # for result publication in the study. Otherwise, if automatic
8266 # publication is switched on, default value is used for result name.
8268 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8270 # @ref tui_mirror "Example"
8271 @ManageTransactions("TrsfOp")
8272 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8274 Create an object, symmetrical to the given one relatively the given axis.
8277 theObject The object to be mirrored.
8278 theAxis Axis of symmetry.
8279 theName Object name; when specified, this parameter is used
8280 for result publication in the study. Otherwise, if automatic
8281 publication is switched on, default value is used for result name.
8284 New GEOM.GEOM_Object, containing the mirrored shape.
8286 # Example: see GEOM_TestAll.py
8287 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8288 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8289 self._autoPublish(anObj, theName, "mirrored")
8292 ## Mirror an object relatively the given point.
8293 # @param theObject The object to be mirrored.
8294 # @param thePoint Point of symmetry.
8295 # @param theCopy Flag used to mirror object itself or create a copy.
8296 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8297 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8298 @ManageTransactions("TrsfOp")
8299 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8301 Mirror an object relatively the given point.
8304 theObject The object to be mirrored.
8305 thePoint Point of symmetry.
8306 theCopy Flag used to mirror object itself or create a copy.
8309 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8310 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8312 # Example: see GEOM_TestAll.py
8314 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8316 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8317 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8320 ## Create an object, symmetrical
8321 # to the given one relatively the given point.
8322 # @param theObject The object to be mirrored.
8323 # @param thePoint Point of symmetry.
8324 # @param theName Object name; when specified, this parameter is used
8325 # for result publication in the study. Otherwise, if automatic
8326 # publication is switched on, default value is used for result name.
8328 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8330 # @ref tui_mirror "Example"
8331 @ManageTransactions("TrsfOp")
8332 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8334 Create an object, symmetrical
8335 to the given one relatively the given point.
8338 theObject The object to be mirrored.
8339 thePoint Point of symmetry.
8340 theName Object name; when specified, this parameter is used
8341 for result publication in the study. Otherwise, if automatic
8342 publication is switched on, default value is used for result name.
8345 New GEOM.GEOM_Object, containing the mirrored shape.
8347 # Example: see GEOM_TestAll.py
8348 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8349 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8350 self._autoPublish(anObj, theName, "mirrored")
8353 ## Modify the location of the given object.
8354 # @param theObject The object to be displaced.
8355 # @param theStartLCS Coordinate system to perform displacement from it.\n
8356 # If \a theStartLCS is NULL, displacement
8357 # will be performed from global CS.\n
8358 # If \a theObject itself is used as \a theStartLCS,
8359 # its location will be changed to \a theEndLCS.
8360 # @param theEndLCS Coordinate system to perform displacement to it.
8361 # @param theCopy Flag used to displace object itself or create a copy.
8362 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8363 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8364 @ManageTransactions("TrsfOp")
8365 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8367 Modify the Location of the given object by LCS, creating its copy before the setting.
8370 theObject The object to be displaced.
8371 theStartLCS Coordinate system to perform displacement from it.
8372 If theStartLCS is NULL, displacement
8373 will be performed from global CS.
8374 If theObject itself is used as theStartLCS,
8375 its location will be changed to theEndLCS.
8376 theEndLCS Coordinate system to perform displacement to it.
8377 theCopy Flag used to displace object itself or create a copy.
8380 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8381 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8383 # Example: see GEOM_TestAll.py
8385 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8387 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8388 RaiseIfFailed("Displace", self.TrsfOp)
8391 ## Modify the Location of the given object by LCS,
8392 # creating its copy before the setting.
8393 # @param theObject The object to be displaced.
8394 # @param theStartLCS Coordinate system to perform displacement from it.\n
8395 # If \a theStartLCS is NULL, displacement
8396 # will be performed from global CS.\n
8397 # If \a theObject itself is used as \a theStartLCS,
8398 # its location will be changed to \a theEndLCS.
8399 # @param theEndLCS Coordinate system to perform displacement to it.
8400 # @param theName Object name; when specified, this parameter is used
8401 # for result publication in the study. Otherwise, if automatic
8402 # publication is switched on, default value is used for result name.
8404 # @return New GEOM.GEOM_Object, containing the displaced shape.
8406 # @ref tui_modify_location "Example"
8407 @ManageTransactions("TrsfOp")
8408 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8410 Modify the Location of the given object by LCS, creating its copy before the setting.
8413 theObject The object to be displaced.
8414 theStartLCS Coordinate system to perform displacement from it.
8415 If theStartLCS is NULL, displacement
8416 will be performed from global CS.
8417 If theObject itself is used as theStartLCS,
8418 its location will be changed to theEndLCS.
8419 theEndLCS Coordinate system to perform displacement to it.
8420 theName Object name; when specified, this parameter is used
8421 for result publication in the study. Otherwise, if automatic
8422 publication is switched on, default value is used for result name.
8425 New GEOM.GEOM_Object, containing the displaced shape.
8428 # create local coordinate systems
8429 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8430 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8431 # modify the location of the given object
8432 position = geompy.MakePosition(cylinder, cs1, cs2)
8434 # Example: see GEOM_TestAll.py
8435 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8436 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8437 self._autoPublish(anObj, theName, "displaced")
8440 ## Modify the Location of the given object by Path.
8441 # @param theObject The object to be displaced.
8442 # @param thePath Wire or Edge along that the object will be translated.
8443 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8444 # @param theCopy is to create a copy objects if true.
8445 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8446 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8447 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8449 # @ref tui_modify_location "Example"
8450 @ManageTransactions("TrsfOp")
8451 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8453 Modify the Location of the given object by Path.
8456 theObject The object to be displaced.
8457 thePath Wire or Edge along that the object will be translated.
8458 theDistance progress of Path (0 = start location, 1 = end of path location).
8459 theCopy is to create a copy objects if true.
8460 theReverse 0 - for usual direction, 1 - to reverse path direction.
8463 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8464 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8467 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8469 # Example: see GEOM_TestAll.py
8470 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8471 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8474 ## Modify the Location of the given object by Path, creating its copy before the operation.
8475 # @param theObject The object to be displaced.
8476 # @param thePath Wire or Edge along that the object will be translated.
8477 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8478 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8479 # @param theName Object name; when specified, this parameter is used
8480 # for result publication in the study. Otherwise, if automatic
8481 # publication is switched on, default value is used for result name.
8483 # @return New GEOM.GEOM_Object, containing the displaced shape.
8484 @ManageTransactions("TrsfOp")
8485 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8487 Modify the Location of the given object by Path, creating its copy before the operation.
8490 theObject The object to be displaced.
8491 thePath Wire or Edge along that the object will be translated.
8492 theDistance progress of Path (0 = start location, 1 = end of path location).
8493 theReverse 0 - for usual direction, 1 - to reverse path direction.
8494 theName Object name; when specified, this parameter is used
8495 for result publication in the study. Otherwise, if automatic
8496 publication is switched on, default value is used for result name.
8499 New GEOM.GEOM_Object, containing the displaced shape.
8501 # Example: see GEOM_TestAll.py
8502 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8503 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8504 self._autoPublish(anObj, theName, "displaced")
8507 ## Offset given shape.
8508 # @param theObject The base object for the offset.
8509 # @param theOffset Offset value.
8510 # @param theCopy Flag used to offset object itself or create a copy.
8511 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8512 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8513 @ManageTransactions("TrsfOp")
8514 def Offset(self, theObject, theOffset, theCopy=False):
8519 theObject The base object for the offset.
8520 theOffset Offset value.
8521 theCopy Flag used to offset object itself or create a copy.
8524 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8525 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8527 theOffset, Parameters = ParseParameters(theOffset)
8529 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8531 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8532 RaiseIfFailed("Offset", self.TrsfOp)
8533 anObj.SetParameters(Parameters)
8536 ## Create new object as offset of the given one.
8537 # @param theObject The base object for the offset.
8538 # @param theOffset Offset value.
8539 # @param theName Object name; when specified, this parameter is used
8540 # for result publication in the study. Otherwise, if automatic
8541 # publication is switched on, default value is used for result name.
8543 # @return New GEOM.GEOM_Object, containing the offset object.
8545 # @ref tui_offset "Example"
8546 @ManageTransactions("TrsfOp")
8547 def MakeOffset(self, theObject, theOffset, theName=None):
8549 Create new object as offset of the given one.
8552 theObject The base object for the offset.
8553 theOffset Offset value.
8554 theName Object name; when specified, this parameter is used
8555 for result publication in the study. Otherwise, if automatic
8556 publication is switched on, default value is used for result name.
8559 New GEOM.GEOM_Object, containing the offset object.
8562 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8563 # create a new object as offset of the given object
8564 offset = geompy.MakeOffset(box, 70.)
8566 # Example: see GEOM_TestAll.py
8567 theOffset, Parameters = ParseParameters(theOffset)
8568 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8569 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8570 anObj.SetParameters(Parameters)
8571 self._autoPublish(anObj, theName, "offset")
8574 ## Create new object as projection of the given one on a 2D surface.
8575 # @param theSource The source object for the projection. It can be a point, edge or wire.
8576 # @param theTarget The target object. It can be planar or cylindrical face.
8577 # @param theName Object name; when specified, this parameter is used
8578 # for result publication in the study. Otherwise, if automatic
8579 # publication is switched on, default value is used for result name.
8581 # @return New GEOM.GEOM_Object, containing the projection.
8583 # @ref tui_projection "Example"
8584 @ManageTransactions("TrsfOp")
8585 def MakeProjection(self, theSource, theTarget, theName=None):
8587 Create new object as projection of the given one on a 2D surface.
8590 theSource The source object for the projection. It can be a point, edge or wire.
8591 theTarget The target object. It can be planar or cylindrical face.
8592 theName Object name; when specified, this parameter is used
8593 for result publication in the study. Otherwise, if automatic
8594 publication is switched on, default value is used for result name.
8597 New GEOM.GEOM_Object, containing the projection.
8599 # Example: see GEOM_TestAll.py
8600 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8601 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8602 self._autoPublish(anObj, theName, "projection")
8605 ## Create a projection projection of the given point on a wire or an edge.
8606 # If there are no solutions or there are 2 or more solutions It throws an
8608 # @param thePoint the point to be projected.
8609 # @param theWire the wire. The edge is accepted as well.
8610 # @param theName Object name; when specified, this parameter is used
8611 # for result publication in the study. Otherwise, if automatic
8612 # publication is switched on, default value is used for result name.
8614 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8615 # \n \a u: The parameter of projection point on edge.
8616 # \n \a PointOnEdge: The projection point.
8617 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8619 # @ref tui_projection "Example"
8620 @ManageTransactions("TrsfOp")
8621 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8623 Create a projection projection of the given point on a wire or an edge.
8624 If there are no solutions or there are 2 or more solutions It throws an
8628 thePoint the point to be projected.
8629 theWire the wire. The edge is accepted as well.
8630 theName Object name; when specified, this parameter is used
8631 for result publication in the study. Otherwise, if automatic
8632 publication is switched on, default value is used for result name.
8635 [u, PointOnEdge, EdgeInWireIndex]
8636 u: The parameter of projection point on edge.
8637 PointOnEdge: The projection point.
8638 EdgeInWireIndex: The index of an edge in a wire.
8640 # Example: see GEOM_TestAll.py
8641 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8642 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8643 self._autoPublish(anObj[1], theName, "projection")
8646 # -----------------------------------------------------------------------------
8648 # -----------------------------------------------------------------------------
8650 ## Translate the given object along the given vector a given number times
8651 # @param theObject The object to be translated.
8652 # @param theVector Direction of the translation. DX if None.
8653 # @param theStep Distance to translate on.
8654 # @param theNbTimes Quantity of translations to be done.
8655 # @param theName Object name; when specified, this parameter is used
8656 # for result publication in the study. Otherwise, if automatic
8657 # publication is switched on, default value is used for result name.
8659 # @return New GEOM.GEOM_Object, containing compound of all
8660 # the shapes, obtained after each translation.
8662 # @ref tui_multi_translation "Example"
8663 @ManageTransactions("TrsfOp")
8664 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8666 Translate the given object along the given vector a given number times
8669 theObject The object to be translated.
8670 theVector Direction of the translation. DX if None.
8671 theStep Distance to translate on.
8672 theNbTimes Quantity of translations to be done.
8673 theName Object name; when specified, this parameter is used
8674 for result publication in the study. Otherwise, if automatic
8675 publication is switched on, default value is used for result name.
8678 New GEOM.GEOM_Object, containing compound of all
8679 the shapes, obtained after each translation.
8682 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8684 # Example: see GEOM_TestAll.py
8685 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8686 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8687 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8688 anObj.SetParameters(Parameters)
8689 self._autoPublish(anObj, theName, "multitranslation")
8692 ## Conseqently apply two specified translations to theObject specified number of times.
8693 # @param theObject The object to be translated.
8694 # @param theVector1 Direction of the first translation. DX if None.
8695 # @param theStep1 Step of the first translation.
8696 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8697 # @param theVector2 Direction of the second translation. DY if None.
8698 # @param theStep2 Step of the second translation.
8699 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8700 # @param theName Object name; when specified, this parameter is used
8701 # for result publication in the study. Otherwise, if automatic
8702 # publication is switched on, default value is used for result name.
8704 # @return New GEOM.GEOM_Object, containing compound of all
8705 # the shapes, obtained after each translation.
8707 # @ref tui_multi_translation "Example"
8708 @ManageTransactions("TrsfOp")
8709 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8710 theVector2, theStep2, theNbTimes2, theName=None):
8712 Conseqently apply two specified translations to theObject specified number of times.
8715 theObject The object to be translated.
8716 theVector1 Direction of the first translation. DX if None.
8717 theStep1 Step of the first translation.
8718 theNbTimes1 Quantity of translations to be done along theVector1.
8719 theVector2 Direction of the second translation. DY if None.
8720 theStep2 Step of the second translation.
8721 theNbTimes2 Quantity of translations to be done along theVector2.
8722 theName Object name; when specified, this parameter is used
8723 for result publication in the study. Otherwise, if automatic
8724 publication is switched on, default value is used for result name.
8727 New GEOM.GEOM_Object, containing compound of all
8728 the shapes, obtained after each translation.
8731 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8733 # Example: see GEOM_TestAll.py
8734 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8735 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8736 theVector2, theStep2, theNbTimes2)
8737 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8738 anObj.SetParameters(Parameters)
8739 self._autoPublish(anObj, theName, "multitranslation")
8742 ## Rotate the given object around the given axis a given number times.
8743 # Rotation angle will be 2*PI/theNbTimes.
8744 # @param theObject The object to be rotated.
8745 # @param theAxis The rotation axis. DZ if None.
8746 # @param theNbTimes Quantity of rotations to be done.
8747 # @param theName Object name; when specified, this parameter is used
8748 # for result publication in the study. Otherwise, if automatic
8749 # publication is switched on, default value is used for result name.
8751 # @return New GEOM.GEOM_Object, containing compound of all the
8752 # shapes, obtained after each rotation.
8754 # @ref tui_multi_rotation "Example"
8755 @ManageTransactions("TrsfOp")
8756 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8758 Rotate the given object around the given axis a given number times.
8759 Rotation angle will be 2*PI/theNbTimes.
8762 theObject The object to be rotated.
8763 theAxis The rotation axis. DZ if None.
8764 theNbTimes Quantity of rotations to be done.
8765 theName Object name; when specified, this parameter is used
8766 for result publication in the study. Otherwise, if automatic
8767 publication is switched on, default value is used for result name.
8770 New GEOM.GEOM_Object, containing compound of all the
8771 shapes, obtained after each rotation.
8774 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8776 # Example: see GEOM_TestAll.py
8777 theNbTimes, Parameters = ParseParameters(theNbTimes)
8778 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8779 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8780 anObj.SetParameters(Parameters)
8781 self._autoPublish(anObj, theName, "multirotation")
8784 ## Rotate the given object around the given axis
8785 # a given number times on the given angle.
8786 # @param theObject The object to be rotated.
8787 # @param theAxis The rotation axis. DZ if None.
8788 # @param theAngleStep Rotation angle in radians.
8789 # @param theNbTimes Quantity of rotations to be done.
8790 # @param theName Object name; when specified, this parameter is used
8791 # for result publication in the study. Otherwise, if automatic
8792 # publication is switched on, default value is used for result name.
8794 # @return New GEOM.GEOM_Object, containing compound of all the
8795 # shapes, obtained after each rotation.
8797 # @ref tui_multi_rotation "Example"
8798 @ManageTransactions("TrsfOp")
8799 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8801 Rotate the given object around the given axis
8802 a given number times on the given angle.
8805 theObject The object to be rotated.
8806 theAxis The rotation axis. DZ if None.
8807 theAngleStep Rotation angle in radians.
8808 theNbTimes Quantity of rotations to be done.
8809 theName Object name; when specified, this parameter is used
8810 for result publication in the study. Otherwise, if automatic
8811 publication is switched on, default value is used for result name.
8814 New GEOM.GEOM_Object, containing compound of all the
8815 shapes, obtained after each rotation.
8818 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8820 # Example: see GEOM_TestAll.py
8821 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8822 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8823 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8824 anObj.SetParameters(Parameters)
8825 self._autoPublish(anObj, theName, "multirotation")
8828 ## Rotate the given object around the given axis a given
8829 # number times and multi-translate each rotation result.
8830 # Rotation angle will be 2*PI/theNbTimes1.
8831 # Translation direction passes through center of gravity
8832 # of rotated shape and its projection on the rotation axis.
8833 # @param theObject The object to be rotated.
8834 # @param theAxis Rotation axis. DZ if None.
8835 # @param theNbTimes1 Quantity of rotations to be done.
8836 # @param theRadialStep Translation distance.
8837 # @param theNbTimes2 Quantity of translations to be done.
8838 # @param theName Object name; when specified, this parameter is used
8839 # for result publication in the study. Otherwise, if automatic
8840 # publication is switched on, default value is used for result name.
8842 # @return New GEOM.GEOM_Object, containing compound of all the
8843 # shapes, obtained after each transformation.
8845 # @ref tui_multi_rotation "Example"
8846 @ManageTransactions("TrsfOp")
8847 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8849 Rotate the given object around the
8850 given axis on the given angle a given number
8851 times and multi-translate each rotation result.
8852 Translation direction passes through center of gravity
8853 of rotated shape and its projection on the rotation axis.
8856 theObject The object to be rotated.
8857 theAxis Rotation axis. DZ if None.
8858 theNbTimes1 Quantity of rotations to be done.
8859 theRadialStep Translation distance.
8860 theNbTimes2 Quantity of translations to be done.
8861 theName Object name; when specified, this parameter is used
8862 for result publication in the study. Otherwise, if automatic
8863 publication is switched on, default value is used for result name.
8866 New GEOM.GEOM_Object, containing compound of all the
8867 shapes, obtained after each transformation.
8870 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8872 # Example: see GEOM_TestAll.py
8873 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8874 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8875 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8876 anObj.SetParameters(Parameters)
8877 self._autoPublish(anObj, theName, "multirotation")
8880 ## Rotate the given object around the
8881 # given axis on the given angle a given number
8882 # times and multi-translate each rotation result.
8883 # Translation direction passes through center of gravity
8884 # of rotated shape and its projection on the rotation axis.
8885 # @param theObject The object to be rotated.
8886 # @param theAxis Rotation axis. DZ if None.
8887 # @param theAngleStep Rotation angle in radians.
8888 # @param theNbTimes1 Quantity of rotations to be done.
8889 # @param theRadialStep Translation distance.
8890 # @param theNbTimes2 Quantity of translations to be done.
8891 # @param theName Object name; when specified, this parameter is used
8892 # for result publication in the study. Otherwise, if automatic
8893 # publication is switched on, default value is used for result name.
8895 # @return New GEOM.GEOM_Object, containing compound of all the
8896 # shapes, obtained after each transformation.
8898 # @ref tui_multi_rotation "Example"
8899 @ManageTransactions("TrsfOp")
8900 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8902 Rotate the given object around the
8903 given axis on the given angle a given number
8904 times and multi-translate each rotation result.
8905 Translation direction passes through center of gravity
8906 of rotated shape and its projection on the rotation axis.
8909 theObject The object to be rotated.
8910 theAxis Rotation axis. DZ if None.
8911 theAngleStep Rotation angle in radians.
8912 theNbTimes1 Quantity of rotations to be done.
8913 theRadialStep Translation distance.
8914 theNbTimes2 Quantity of translations to be done.
8915 theName Object name; when specified, this parameter is used
8916 for result publication in the study. Otherwise, if automatic
8917 publication is switched on, default value is used for result name.
8920 New GEOM.GEOM_Object, containing compound of all the
8921 shapes, obtained after each transformation.
8924 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8926 # Example: see GEOM_TestAll.py
8927 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8928 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8929 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8930 anObj.SetParameters(Parameters)
8931 self._autoPublish(anObj, theName, "multirotation")
8934 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8936 # @ref swig_MakeMultiRotation "Example"
8937 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8939 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8942 pz = geompy.MakeVertex(0, 0, 100)
8943 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8944 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8946 # Example: see GEOM_TestOthers.py
8947 aVec = self.MakeLine(aPoint,aDir)
8948 # note: auto-publishing is done in self.MultiRotate1D()
8949 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8952 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8954 # @ref swig_MakeMultiRotation "Example"
8955 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8957 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8960 pz = geompy.MakeVertex(0, 0, 100)
8961 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8962 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8964 # Example: see GEOM_TestOthers.py
8965 aVec = self.MakeLine(aPoint,aDir)
8966 # note: auto-publishing is done in self.MultiRotate1D()
8967 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8970 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8972 # @ref swig_MakeMultiRotation "Example"
8973 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8975 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8978 pz = geompy.MakeVertex(0, 0, 100)
8979 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8980 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8982 # Example: see GEOM_TestOthers.py
8983 aVec = self.MakeLine(aPoint,aDir)
8984 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8985 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8988 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8990 # @ref swig_MakeMultiRotation "Example"
8991 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8993 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8996 pz = geompy.MakeVertex(0, 0, 100)
8997 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8998 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9000 # Example: see GEOM_TestOthers.py
9001 aVec = self.MakeLine(aPoint,aDir)
9002 # note: auto-publishing is done in self.MultiRotate2D()
9003 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9006 # end of l3_transform
9009 ## @addtogroup l3_transform_d
9012 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9013 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9015 Deprecated method. Use MultiRotate1DNbTimes instead.
9017 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9018 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9020 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9021 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9022 @ManageTransactions("TrsfOp")
9023 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9025 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9026 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9029 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9031 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9032 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9033 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9034 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9035 anObj.SetParameters(Parameters)
9036 self._autoPublish(anObj, theName, "multirotation")
9039 ## The same, as MultiRotate1D(), but axis is given by direction and point
9040 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9041 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9043 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9044 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9047 pz = geompy.MakeVertex(0, 0, 100)
9048 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9049 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9051 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9052 aVec = self.MakeLine(aPoint,aDir)
9053 # note: auto-publishing is done in self.MultiRotate1D()
9054 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9057 ## The same, as MultiRotate2D(), but axis is given by direction and point
9058 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9059 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9061 The same, as MultiRotate2D(), but axis is given by direction and point
9062 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9065 pz = geompy.MakeVertex(0, 0, 100)
9066 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9067 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9069 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9070 aVec = self.MakeLine(aPoint,aDir)
9071 # note: auto-publishing is done in self.MultiRotate2D()
9072 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9075 # end of l3_transform_d
9078 ## @addtogroup l3_local
9081 ## Perform a fillet on all edges of the given shape.
9082 # @param theShape Shape, to perform fillet on.
9083 # @param theR Fillet radius.
9084 # @param theName Object name; when specified, this parameter is used
9085 # for result publication in the study. Otherwise, if automatic
9086 # publication is switched on, default value is used for result name.
9088 # @return New GEOM.GEOM_Object, containing the result shape.
9090 # @ref tui_fillet "Example 1"
9091 # \n @ref swig_MakeFilletAll "Example 2"
9092 @ManageTransactions("LocalOp")
9093 def MakeFilletAll(self, theShape, theR, theName=None):
9095 Perform a fillet on all edges of the given shape.
9098 theShape Shape, to perform fillet on.
9100 theName Object name; when specified, this parameter is used
9101 for result publication in the study. Otherwise, if automatic
9102 publication is switched on, default value is used for result name.
9105 New GEOM.GEOM_Object, containing the result shape.
9108 filletall = geompy.MakeFilletAll(prism, 10.)
9110 # Example: see GEOM_TestOthers.py
9111 theR,Parameters = ParseParameters(theR)
9112 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9113 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9114 anObj.SetParameters(Parameters)
9115 self._autoPublish(anObj, theName, "fillet")
9118 ## Perform a fillet on the specified edges/faces of the given shape
9119 # @param theShape Shape, to perform fillet on.
9120 # @param theR Fillet radius.
9121 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9122 # @param theListShapes Global indices of edges/faces to perform fillet on.
9123 # @param theName Object name; when specified, this parameter is used
9124 # for result publication in the study. Otherwise, if automatic
9125 # publication is switched on, default value is used for result name.
9127 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9129 # @return New GEOM.GEOM_Object, containing the result shape.
9131 # @ref tui_fillet "Example"
9132 @ManageTransactions("LocalOp")
9133 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9135 Perform a fillet on the specified edges/faces of the given shape
9138 theShape Shape, to perform fillet on.
9140 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9141 theListShapes Global indices of edges/faces to perform fillet on.
9142 theName Object name; when specified, this parameter is used
9143 for result publication in the study. Otherwise, if automatic
9144 publication is switched on, default value is used for result name.
9147 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9150 New GEOM.GEOM_Object, containing the result shape.
9153 # get the list of IDs (IDList) for the fillet
9154 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9156 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9157 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9158 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9159 # make a fillet on the specified edges of the given shape
9160 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9162 # Example: see GEOM_TestAll.py
9163 theR,Parameters = ParseParameters(theR)
9165 if theShapeType == self.ShapeType["EDGE"]:
9166 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9167 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9169 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9170 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9171 anObj.SetParameters(Parameters)
9172 self._autoPublish(anObj, theName, "fillet")
9175 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9176 @ManageTransactions("LocalOp")
9177 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9179 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9182 # get the list of IDs (IDList) for the fillet
9183 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9185 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9186 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9187 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9188 # make a fillet on the specified edges of the given shape
9189 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9191 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9193 if theShapeType == self.ShapeType["EDGE"]:
9194 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9195 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9197 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9198 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9199 anObj.SetParameters(Parameters)
9200 self._autoPublish(anObj, theName, "fillet")
9203 ## Perform a fillet on the specified edges of the given shape
9204 # @param theShape Wire Shape to perform fillet on.
9205 # @param theR Fillet radius.
9206 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9207 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9208 # \note The list of vertices could be empty,
9209 # in this case fillet will done done at all vertices in wire
9210 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9211 # by the length of the edges, nearest to the fillet vertex.
9212 # But sometimes the next edge is C1 continuous with the one, nearest to
9213 # the fillet point, and such two (or more) edges can be united to allow
9214 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9215 # thus ignoring the secant vertex (vertices).
9216 # @param theName Object name; when specified, this parameter is used
9217 # for result publication in the study. Otherwise, if automatic
9218 # publication is switched on, default value is used for result name.
9220 # @return New GEOM.GEOM_Object, containing the result shape.
9222 # @ref tui_fillet2d "Example"
9223 @ManageTransactions("LocalOp")
9224 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9226 Perform a fillet on the specified edges of the given shape
9229 theShape Wire Shape to perform fillet on.
9231 theListOfVertexes Global indices of vertexes to perform fillet on.
9232 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9233 by the length of the edges, nearest to the fillet vertex.
9234 But sometimes the next edge is C1 continuous with the one, nearest to
9235 the fillet point, and such two (or more) edges can be united to allow
9236 bigger radius. Set this flag to TRUE to allow collinear edges union,
9237 thus ignoring the secant vertex (vertices).
9238 theName Object name; when specified, this parameter is used
9239 for result publication in the study. Otherwise, if automatic
9240 publication is switched on, default value is used for result name.
9242 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9244 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9247 New GEOM.GEOM_Object, containing the result shape.
9251 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9252 # make fillet at given wire vertices with giver radius
9253 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9255 # Example: see GEOM_TestAll.py
9256 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9257 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9258 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9259 anObj.SetParameters(Parameters)
9260 self._autoPublish(anObj, theName, "fillet")
9263 ## Perform a fillet at the specified vertices of the given face/shell.
9264 # @param theShape Face or Shell shape to perform fillet on.
9265 # @param theR Fillet radius.
9266 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9267 # @param theName Object name; when specified, this parameter is used
9268 # for result publication in the study. Otherwise, if automatic
9269 # publication is switched on, default value is used for result name.
9271 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9273 # @return New GEOM.GEOM_Object, containing the result shape.
9275 # @ref tui_fillet2d "Example"
9276 @ManageTransactions("LocalOp")
9277 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9279 Perform a fillet at the specified vertices of the given face/shell.
9282 theShape Face or Shell shape to perform fillet on.
9284 theListOfVertexes Global indices of vertexes to perform fillet on.
9285 theName Object name; when specified, this parameter is used
9286 for result publication in the study. Otherwise, if automatic
9287 publication is switched on, default value is used for result name.
9289 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9292 New GEOM.GEOM_Object, containing the result shape.
9295 face = geompy.MakeFaceHW(100, 100, 1)
9296 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9298 # Example: see GEOM_TestAll.py
9299 theR,Parameters = ParseParameters(theR)
9300 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9301 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9302 anObj.SetParameters(Parameters)
9303 self._autoPublish(anObj, theName, "fillet")
9306 ## Perform a symmetric chamfer on all edges of the given shape.
9307 # @param theShape Shape, to perform chamfer on.
9308 # @param theD Chamfer size along each face.
9309 # @param theName Object name; when specified, this parameter is used
9310 # for result publication in the study. Otherwise, if automatic
9311 # publication is switched on, default value is used for result name.
9313 # @return New GEOM.GEOM_Object, containing the result shape.
9315 # @ref tui_chamfer "Example 1"
9316 # \n @ref swig_MakeChamferAll "Example 2"
9317 @ManageTransactions("LocalOp")
9318 def MakeChamferAll(self, theShape, theD, theName=None):
9320 Perform a symmetric chamfer on all edges of the given shape.
9323 theShape Shape, to perform chamfer on.
9324 theD Chamfer size along each face.
9325 theName Object name; when specified, this parameter is used
9326 for result publication in the study. Otherwise, if automatic
9327 publication is switched on, default value is used for result name.
9330 New GEOM.GEOM_Object, containing the result shape.
9333 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9335 # Example: see GEOM_TestOthers.py
9336 theD,Parameters = ParseParameters(theD)
9337 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9338 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9339 anObj.SetParameters(Parameters)
9340 self._autoPublish(anObj, theName, "chamfer")
9343 ## Perform a chamfer on edges, common to the specified faces,
9344 # with distance D1 on the Face1
9345 # @param theShape Shape, to perform chamfer on.
9346 # @param theD1 Chamfer size along \a theFace1.
9347 # @param theD2 Chamfer size along \a theFace2.
9348 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9349 # @param theName Object name; when specified, this parameter is used
9350 # for result publication in the study. Otherwise, if automatic
9351 # publication is switched on, default value is used for result name.
9353 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9355 # @return New GEOM.GEOM_Object, containing the result shape.
9357 # @ref tui_chamfer "Example"
9358 @ManageTransactions("LocalOp")
9359 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9361 Perform a chamfer on edges, common to the specified faces,
9362 with distance D1 on the Face1
9365 theShape Shape, to perform chamfer on.
9366 theD1 Chamfer size along theFace1.
9367 theD2 Chamfer size along theFace2.
9368 theFace1,theFace2 Global indices of two faces of theShape.
9369 theName Object name; when specified, this parameter is used
9370 for result publication in the study. Otherwise, if automatic
9371 publication is switched on, default value is used for result name.
9374 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9377 New GEOM.GEOM_Object, containing the result shape.
9380 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9381 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9382 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9383 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9385 # Example: see GEOM_TestAll.py
9386 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9387 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9388 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9389 anObj.SetParameters(Parameters)
9390 self._autoPublish(anObj, theName, "chamfer")
9393 ## Perform a chamfer on edges
9394 # @param theShape Shape, to perform chamfer on.
9395 # @param theD Chamfer length
9396 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9397 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9398 # @param theName Object name; when specified, this parameter is used
9399 # for result publication in the study. Otherwise, if automatic
9400 # publication is switched on, default value is used for result name.
9402 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9404 # @return New GEOM.GEOM_Object, containing the result shape.
9405 @ManageTransactions("LocalOp")
9406 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9408 Perform a chamfer on edges
9411 theShape Shape, to perform chamfer on.
9412 theD1 Chamfer size along theFace1.
9413 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9414 theFace1,theFace2 Global indices of two faces of theShape.
9415 theName Object name; when specified, this parameter is used
9416 for result publication in the study. Otherwise, if automatic
9417 publication is switched on, default value is used for result name.
9420 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9423 New GEOM.GEOM_Object, containing the result shape.
9426 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9427 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9428 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9430 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9433 if isinstance(theAngle,str):
9435 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9437 theAngle = theAngle*math.pi/180.0
9438 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9439 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9440 anObj.SetParameters(Parameters)
9441 self._autoPublish(anObj, theName, "chamfer")
9444 ## Perform a chamfer on all edges of the specified faces,
9445 # with distance D1 on the first specified face (if several for one edge)
9446 # @param theShape Shape, to perform chamfer on.
9447 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9448 # connected to the edge, are in \a theFaces, \a theD1
9449 # will be get along face, which is nearer to \a theFaces beginning.
9450 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9451 # @param theFaces Sequence of global indices of faces of \a theShape.
9452 # @param theName Object name; when specified, this parameter is used
9453 # for result publication in the study. Otherwise, if automatic
9454 # publication is switched on, default value is used for result name.
9456 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9458 # @return New GEOM.GEOM_Object, containing the result shape.
9460 # @ref tui_chamfer "Example"
9461 @ManageTransactions("LocalOp")
9462 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9464 Perform a chamfer on all edges of the specified faces,
9465 with distance D1 on the first specified face (if several for one edge)
9468 theShape Shape, to perform chamfer on.
9469 theD1 Chamfer size along face from theFaces. If both faces,
9470 connected to the edge, are in theFaces, theD1
9471 will be get along face, which is nearer to theFaces beginning.
9472 theD2 Chamfer size along another of two faces, connected to the edge.
9473 theFaces Sequence of global indices of faces of theShape.
9474 theName Object name; when specified, this parameter is used
9475 for result publication in the study. Otherwise, if automatic
9476 publication is switched on, default value is used for result name.
9478 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9481 New GEOM.GEOM_Object, containing the result shape.
9483 # Example: see GEOM_TestAll.py
9484 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9485 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9486 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9487 anObj.SetParameters(Parameters)
9488 self._autoPublish(anObj, theName, "chamfer")
9491 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9492 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9494 # @ref swig_FilletChamfer "Example"
9495 @ManageTransactions("LocalOp")
9496 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9498 The Same that geompy.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)
9502 if isinstance(theAngle,str):
9504 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9506 theAngle = theAngle*math.pi/180.0
9507 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9508 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9509 anObj.SetParameters(Parameters)
9510 self._autoPublish(anObj, theName, "chamfer")
9513 ## Perform a chamfer on edges,
9514 # with distance D1 on the first specified face (if several for one edge)
9515 # @param theShape Shape, to perform chamfer on.
9516 # @param theD1,theD2 Chamfer size
9517 # @param theEdges Sequence of edges of \a theShape.
9518 # @param theName Object name; when specified, this parameter is used
9519 # for result publication in the study. Otherwise, if automatic
9520 # publication is switched on, default value is used for result name.
9522 # @return New GEOM.GEOM_Object, containing the result shape.
9524 # @ref swig_FilletChamfer "Example"
9525 @ManageTransactions("LocalOp")
9526 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9528 Perform a chamfer on edges,
9529 with distance D1 on the first specified face (if several for one edge)
9532 theShape Shape, to perform chamfer on.
9533 theD1,theD2 Chamfer size
9534 theEdges Sequence of edges of theShape.
9535 theName Object name; when specified, this parameter is used
9536 for result publication in the study. Otherwise, if automatic
9537 publication is switched on, default value is used for result name.
9540 New GEOM.GEOM_Object, containing the result shape.
9542 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9543 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9544 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9545 anObj.SetParameters(Parameters)
9546 self._autoPublish(anObj, theName, "chamfer")
9549 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9550 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9551 @ManageTransactions("LocalOp")
9552 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9554 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9555 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9558 if isinstance(theAngle,str):
9560 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9562 theAngle = theAngle*math.pi/180.0
9563 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9564 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9565 anObj.SetParameters(Parameters)
9566 self._autoPublish(anObj, theName, "chamfer")
9569 ## @sa MakeChamferEdge(), MakeChamferFaces()
9571 # @ref swig_MakeChamfer "Example"
9572 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9574 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9576 # Example: see GEOM_TestOthers.py
9578 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9579 if aShapeType == self.ShapeType["EDGE"]:
9580 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9582 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9585 ## Remove material from a solid by extrusion of the base shape on the given distance.
9586 # @param theInit Shape to remove material from. It must be a solid or
9587 # a compound made of a single solid.
9588 # @param theBase Closed edge or wire defining the base shape to be extruded.
9589 # @param theH Prism dimension along the normal to theBase
9590 # @param theAngle Draft angle in degrees.
9591 # @param theName Object name; when specified, this parameter is used
9592 # for result publication in the study. Otherwise, if automatic
9593 # publication is switched on, default value is used for result name.
9595 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9597 # @ref tui_creation_prism "Example"
9598 @ManageTransactions("PrimOp")
9599 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9601 Add material to a solid by extrusion of the base shape on the given distance.
9604 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9605 theBase Closed edge or wire defining the base shape to be extruded.
9606 theH Prism dimension along the normal to theBase
9607 theAngle Draft angle in degrees.
9608 theName Object name; when specified, this parameter is used
9609 for result publication in the study. Otherwise, if automatic
9610 publication is switched on, default value is used for result name.
9613 New GEOM.GEOM_Object, containing the initial shape with removed material.
9615 # Example: see GEOM_TestAll.py
9616 #theH,Parameters = ParseParameters(theH)
9617 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9618 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9619 #anObj.SetParameters(Parameters)
9620 self._autoPublish(anObj, theName, "extrudedCut")
9623 ## Add material to a solid by extrusion of the base shape on the given distance.
9624 # @param theInit Shape to add material to. It must be a solid or
9625 # a compound made of a single solid.
9626 # @param theBase Closed edge or wire defining the base shape to be extruded.
9627 # @param theH Prism dimension along the normal to theBase
9628 # @param theAngle Draft angle in degrees.
9629 # @param theName Object name; when specified, this parameter is used
9630 # for result publication in the study. Otherwise, if automatic
9631 # publication is switched on, default value is used for result name.
9633 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9635 # @ref tui_creation_prism "Example"
9636 @ManageTransactions("PrimOp")
9637 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9639 Add material to a solid by extrusion of the base shape on the given distance.
9642 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9643 theBase Closed edge or wire defining the base shape to be extruded.
9644 theH Prism dimension along the normal to theBase
9645 theAngle Draft angle in degrees.
9646 theName Object name; when specified, this parameter is used
9647 for result publication in the study. Otherwise, if automatic
9648 publication is switched on, default value is used for result name.
9651 New GEOM.GEOM_Object, containing the initial shape with added material.
9653 # Example: see GEOM_TestAll.py
9654 #theH,Parameters = ParseParameters(theH)
9655 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9656 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9657 #anObj.SetParameters(Parameters)
9658 self._autoPublish(anObj, theName, "extrudedBoss")
9664 ## @addtogroup l3_basic_op
9667 ## Perform an Archimde operation on the given shape with given parameters.
9668 # The object presenting the resulting face is returned.
9669 # @param theShape Shape to be put in water.
9670 # @param theWeight Weight og the shape.
9671 # @param theWaterDensity Density of the water.
9672 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9673 # @param theName Object name; when specified, this parameter is used
9674 # for result publication in the study. Otherwise, if automatic
9675 # publication is switched on, default value is used for result name.
9677 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9678 # by a plane, corresponding to water level.
9680 # @ref tui_archimede "Example"
9681 @ManageTransactions("LocalOp")
9682 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9684 Perform an Archimde operation on the given shape with given parameters.
9685 The object presenting the resulting face is returned.
9688 theShape Shape to be put in water.
9689 theWeight Weight og the shape.
9690 theWaterDensity Density of the water.
9691 theMeshDeflection Deflection of the mesh, using to compute the section.
9692 theName Object name; when specified, this parameter is used
9693 for result publication in the study. Otherwise, if automatic
9694 publication is switched on, default value is used for result name.
9697 New GEOM.GEOM_Object, containing a section of theShape
9698 by a plane, corresponding to water level.
9700 # Example: see GEOM_TestAll.py
9701 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9702 theWeight,theWaterDensity,theMeshDeflection)
9703 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9704 RaiseIfFailed("MakeArchimede", self.LocalOp)
9705 anObj.SetParameters(Parameters)
9706 self._autoPublish(anObj, theName, "archimede")
9709 # end of l3_basic_op
9712 ## @addtogroup l2_measure
9715 ## Get point coordinates
9718 # @ref tui_measurement_tools_page "Example"
9719 @ManageTransactions("MeasuOp")
9720 def PointCoordinates(self,Point):
9722 Get point coordinates
9727 # Example: see GEOM_TestMeasures.py
9728 aTuple = self.MeasuOp.PointCoordinates(Point)
9729 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9732 ## Get vector coordinates
9735 # @ref tui_measurement_tools_page "Example"
9736 def VectorCoordinates(self,Vector):
9738 Get vector coordinates
9744 p1=self.GetFirstVertex(Vector)
9745 p2=self.GetLastVertex(Vector)
9747 X1=self.PointCoordinates(p1)
9748 X2=self.PointCoordinates(p2)
9750 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9753 ## Compute cross product
9754 # @return vector w=u^v
9756 # @ref tui_measurement_tools_page "Example"
9757 def CrossProduct(self, Vector1, Vector2):
9759 Compute cross product
9761 Returns: vector w=u^v
9763 u=self.VectorCoordinates(Vector1)
9764 v=self.VectorCoordinates(Vector2)
9765 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])
9769 ## Compute cross product
9770 # @return dot product p=u.v
9772 # @ref tui_measurement_tools_page "Example"
9773 def DotProduct(self, Vector1, Vector2):
9775 Compute cross product
9777 Returns: dot product p=u.v
9779 u=self.VectorCoordinates(Vector1)
9780 v=self.VectorCoordinates(Vector2)
9781 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9786 ## Get summarized length of all wires,
9787 # area of surface and volume of the given shape.
9788 # @param theShape Shape to define properties of.
9789 # @return [theLength, theSurfArea, theVolume]\n
9790 # theLength: Summarized length of all wires of the given shape.\n
9791 # theSurfArea: Area of surface of the given shape.\n
9792 # theVolume: Volume of the given shape.
9794 # @ref tui_measurement_tools_page "Example"
9795 @ManageTransactions("MeasuOp")
9796 def BasicProperties(self,theShape):
9798 Get summarized length of all wires,
9799 area of surface and volume of the given shape.
9802 theShape Shape to define properties of.
9805 [theLength, theSurfArea, theVolume]
9806 theLength: Summarized length of all wires of the given shape.
9807 theSurfArea: Area of surface of the given shape.
9808 theVolume: Volume of the given shape.
9810 # Example: see GEOM_TestMeasures.py
9811 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9812 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9815 ## Get parameters of bounding box of the given shape
9816 # @param theShape Shape to obtain bounding box of.
9817 # @param precise TRUE for precise computation; FALSE for fast one.
9818 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9819 # Xmin,Xmax: Limits of shape along OX axis.
9820 # Ymin,Ymax: Limits of shape along OY axis.
9821 # Zmin,Zmax: Limits of shape along OZ axis.
9823 # @ref tui_measurement_tools_page "Example"
9824 @ManageTransactions("MeasuOp")
9825 def BoundingBox (self, theShape, precise=False):
9827 Get parameters of bounding box of the given shape
9830 theShape Shape to obtain bounding box of.
9831 precise TRUE for precise computation; FALSE for fast one.
9834 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9835 Xmin,Xmax: Limits of shape along OX axis.
9836 Ymin,Ymax: Limits of shape along OY axis.
9837 Zmin,Zmax: Limits of shape along OZ axis.
9839 # Example: see GEOM_TestMeasures.py
9840 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9841 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9844 ## Get bounding box of the given shape
9845 # @param theShape Shape to obtain bounding box of.
9846 # @param precise TRUE for precise computation; FALSE for fast one.
9847 # @param theName Object name; when specified, this parameter is used
9848 # for result publication in the study. Otherwise, if automatic
9849 # publication is switched on, default value is used for result name.
9851 # @return New GEOM.GEOM_Object, containing the created box.
9853 # @ref tui_measurement_tools_page "Example"
9854 @ManageTransactions("MeasuOp")
9855 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9857 Get bounding box of the given shape
9860 theShape Shape to obtain bounding box of.
9861 precise TRUE for precise computation; FALSE for fast one.
9862 theName Object name; when specified, this parameter is used
9863 for result publication in the study. Otherwise, if automatic
9864 publication is switched on, default value is used for result name.
9867 New GEOM.GEOM_Object, containing the created box.
9869 # Example: see GEOM_TestMeasures.py
9870 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9871 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9872 self._autoPublish(anObj, theName, "bndbox")
9875 ## Get inertia matrix and moments of inertia of theShape.
9876 # @param theShape Shape to calculate inertia of.
9877 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9878 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9879 # Ix,Iy,Iz: Moments of inertia of the given shape.
9881 # @ref tui_measurement_tools_page "Example"
9882 @ManageTransactions("MeasuOp")
9883 def Inertia(self,theShape):
9885 Get inertia matrix and moments of inertia of theShape.
9888 theShape Shape to calculate inertia of.
9891 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9892 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9893 Ix,Iy,Iz: Moments of inertia of the given shape.
9895 # Example: see GEOM_TestMeasures.py
9896 aTuple = self.MeasuOp.GetInertia(theShape)
9897 RaiseIfFailed("GetInertia", self.MeasuOp)
9900 ## Get if coords are included in the shape (ST_IN or ST_ON)
9901 # @param theShape Shape
9902 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9903 # @param tolerance to be used (default is 1.0e-7)
9904 # @return list_of_boolean = [res1, res2, ...]
9905 @ManageTransactions("MeasuOp")
9906 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9908 Get if coords are included in the shape (ST_IN or ST_ON)
9912 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9913 tolerance to be used (default is 1.0e-7)
9916 list_of_boolean = [res1, res2, ...]
9918 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9920 ## Get minimal distance between the given shapes.
9921 # @param theShape1,theShape2 Shapes to find minimal distance between.
9922 # @return Value of the minimal distance between the given shapes.
9924 # @ref tui_measurement_tools_page "Example"
9925 @ManageTransactions("MeasuOp")
9926 def MinDistance(self, theShape1, theShape2):
9928 Get minimal distance between the given shapes.
9931 theShape1,theShape2 Shapes to find minimal distance between.
9934 Value of the minimal distance between the given shapes.
9936 # Example: see GEOM_TestMeasures.py
9937 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9938 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9941 ## Get minimal distance between the given shapes.
9942 # @param theShape1,theShape2 Shapes to find minimal distance between.
9943 # @return Value of the minimal distance between the given shapes, in form of list
9944 # [Distance, DX, DY, DZ].
9946 # @ref swig_all_measure "Example"
9947 @ManageTransactions("MeasuOp")
9948 def MinDistanceComponents(self, theShape1, theShape2):
9950 Get minimal distance between the given shapes.
9953 theShape1,theShape2 Shapes to find minimal distance between.
9956 Value of the minimal distance between the given shapes, in form of list
9957 [Distance, DX, DY, DZ]
9959 # Example: see GEOM_TestMeasures.py
9960 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9961 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9962 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9965 ## Get closest points of the given shapes.
9966 # @param theShape1,theShape2 Shapes to find closest points of.
9967 # @return The number of found solutions (-1 in case of infinite number of
9968 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9970 # @ref tui_measurement_tools_page "Example"
9971 @ManageTransactions("MeasuOp")
9972 def ClosestPoints (self, theShape1, theShape2):
9974 Get closest points of the given shapes.
9977 theShape1,theShape2 Shapes to find closest points of.
9980 The number of found solutions (-1 in case of infinite number of
9981 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9983 # Example: see GEOM_TestMeasures.py
9984 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9985 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9988 ## Get angle between the given shapes in degrees.
9989 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9990 # @note If both arguments are vectors, the angle is computed in accordance
9991 # with their orientations, otherwise the minimum angle is computed.
9992 # @return Value of the angle between the given shapes in degrees.
9994 # @ref tui_measurement_tools_page "Example"
9995 @ManageTransactions("MeasuOp")
9996 def GetAngle(self, theShape1, theShape2):
9998 Get angle between the given shapes in degrees.
10001 theShape1,theShape2 Lines or linear edges to find angle between.
10004 If both arguments are vectors, the angle is computed in accordance
10005 with their orientations, otherwise the minimum angle is computed.
10008 Value of the angle between the given shapes in degrees.
10010 # Example: see GEOM_TestMeasures.py
10011 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10012 RaiseIfFailed("GetAngle", self.MeasuOp)
10015 ## Get angle between the given shapes in radians.
10016 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10017 # @note If both arguments are vectors, the angle is computed in accordance
10018 # with their orientations, otherwise the minimum angle is computed.
10019 # @return Value of the angle between the given shapes in radians.
10021 # @ref tui_measurement_tools_page "Example"
10022 @ManageTransactions("MeasuOp")
10023 def GetAngleRadians(self, theShape1, theShape2):
10025 Get angle between the given shapes in radians.
10028 theShape1,theShape2 Lines or linear edges to find angle between.
10032 If both arguments are vectors, the angle is computed in accordance
10033 with their orientations, otherwise the minimum angle is computed.
10036 Value of the angle between the given shapes in radians.
10038 # Example: see GEOM_TestMeasures.py
10039 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10040 RaiseIfFailed("GetAngle", self.MeasuOp)
10043 ## Get angle between the given vectors in degrees.
10044 # @param theShape1,theShape2 Vectors to find angle between.
10045 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10046 # if False, the opposite vector to the normal vector is used.
10047 # @return Value of the angle between the given vectors in degrees.
10049 # @ref tui_measurement_tools_page "Example"
10050 @ManageTransactions("MeasuOp")
10051 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10053 Get angle between the given vectors in degrees.
10056 theShape1,theShape2 Vectors to find angle between.
10057 theFlag If True, the normal vector is defined by the two vectors cross,
10058 if False, the opposite vector to the normal vector is used.
10061 Value of the angle between the given vectors in degrees.
10063 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10065 anAngle = 360. - anAngle
10066 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10069 ## The same as GetAngleVectors, but the result is in radians.
10070 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10072 Get angle between the given vectors in radians.
10075 theShape1,theShape2 Vectors to find angle between.
10076 theFlag If True, the normal vector is defined by the two vectors cross,
10077 if False, the opposite vector to the normal vector is used.
10080 Value of the angle between the given vectors in radians.
10082 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10085 ## @name Curve Curvature Measurement
10086 # Methods for receiving radius of curvature of curves
10087 # in the given point
10090 ## Measure curvature of a curve at a point, set by parameter.
10091 # @param theCurve a curve.
10092 # @param theParam parameter.
10093 # @return radius of curvature of \a theCurve.
10095 # @ref swig_todo "Example"
10096 @ManageTransactions("MeasuOp")
10097 def CurveCurvatureByParam(self, theCurve, theParam):
10099 Measure curvature of a curve at a point, set by parameter.
10103 theParam parameter.
10106 radius of curvature of theCurve.
10108 # Example: see GEOM_TestMeasures.py
10109 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10110 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10113 ## Measure curvature of a curve at a point.
10114 # @param theCurve a curve.
10115 # @param thePoint given point.
10116 # @return radius of curvature of \a theCurve.
10118 # @ref swig_todo "Example"
10119 @ManageTransactions("MeasuOp")
10120 def CurveCurvatureByPoint(self, theCurve, thePoint):
10122 Measure curvature of a curve at a point.
10126 thePoint given point.
10129 radius of curvature of theCurve.
10131 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10132 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10136 ## @name Surface Curvature Measurement
10137 # Methods for receiving max and min radius of curvature of surfaces
10138 # in the given point
10141 ## Measure max radius of curvature of surface.
10142 # @param theSurf the given surface.
10143 # @param theUParam Value of U-parameter on the referenced surface.
10144 # @param theVParam Value of V-parameter on the referenced surface.
10145 # @return max radius of curvature of theSurf.
10147 ## @ref swig_todo "Example"
10148 @ManageTransactions("MeasuOp")
10149 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10151 Measure max radius of curvature of surface.
10154 theSurf the given surface.
10155 theUParam Value of U-parameter on the referenced surface.
10156 theVParam Value of V-parameter on the referenced surface.
10159 max radius of curvature of theSurf.
10161 # Example: see GEOM_TestMeasures.py
10162 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10163 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10166 ## Measure max radius of curvature of surface in the given point
10167 # @param theSurf the given surface.
10168 # @param thePoint given point.
10169 # @return max radius of curvature of theSurf.
10171 ## @ref swig_todo "Example"
10172 @ManageTransactions("MeasuOp")
10173 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10175 Measure max radius of curvature of surface in the given point.
10178 theSurf the given surface.
10179 thePoint given point.
10182 max radius of curvature of theSurf.
10184 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10185 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10188 ## Measure min radius of curvature of surface.
10189 # @param theSurf the given surface.
10190 # @param theUParam Value of U-parameter on the referenced surface.
10191 # @param theVParam Value of V-parameter on the referenced surface.
10192 # @return min radius of curvature of theSurf.
10194 ## @ref swig_todo "Example"
10195 @ManageTransactions("MeasuOp")
10196 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10198 Measure min radius of curvature of surface.
10201 theSurf the given surface.
10202 theUParam Value of U-parameter on the referenced surface.
10203 theVParam Value of V-parameter on the referenced surface.
10206 Min radius of curvature of theSurf.
10208 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10209 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10212 ## Measure min radius of curvature of surface in the given point
10213 # @param theSurf the given surface.
10214 # @param thePoint given point.
10215 # @return min radius of curvature of theSurf.
10217 ## @ref swig_todo "Example"
10218 @ManageTransactions("MeasuOp")
10219 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10221 Measure min radius of curvature of surface in the given point.
10224 theSurf the given surface.
10225 thePoint given point.
10228 Min radius of curvature of theSurf.
10230 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10231 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10235 ## Get min and max tolerances of sub-shapes of theShape
10236 # @param theShape Shape, to get tolerances of.
10237 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10238 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10239 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10240 # VertMin,VertMax: Min and max tolerances of the vertices.
10242 # @ref tui_measurement_tools_page "Example"
10243 @ManageTransactions("MeasuOp")
10244 def Tolerance(self,theShape):
10246 Get min and max tolerances of sub-shapes of theShape
10249 theShape Shape, to get tolerances of.
10252 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10253 FaceMin,FaceMax: Min and max tolerances of the faces.
10254 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10255 VertMin,VertMax: Min and max tolerances of the vertices.
10257 # Example: see GEOM_TestMeasures.py
10258 aTuple = self.MeasuOp.GetTolerance(theShape)
10259 RaiseIfFailed("GetTolerance", self.MeasuOp)
10262 ## Obtain description of the given shape (number of sub-shapes of each type)
10263 # @param theShape Shape to be described.
10264 # @return Description of the given shape.
10266 # @ref tui_measurement_tools_page "Example"
10267 @ManageTransactions("MeasuOp")
10268 def WhatIs(self,theShape):
10270 Obtain description of the given shape (number of sub-shapes of each type)
10273 theShape Shape to be described.
10276 Description of the given shape.
10278 # Example: see GEOM_TestMeasures.py
10279 aDescr = self.MeasuOp.WhatIs(theShape)
10280 RaiseIfFailed("WhatIs", self.MeasuOp)
10283 ## Obtain quantity of shapes of the given type in \a theShape.
10284 # If \a theShape is of type \a theType, it is also counted.
10285 # @param theShape Shape to be described.
10286 # @param theType the given ShapeType().
10287 # @return Quantity of shapes of type \a theType in \a theShape.
10289 # @ref tui_measurement_tools_page "Example"
10290 def NbShapes (self, theShape, theType):
10292 Obtain quantity of shapes of the given type in theShape.
10293 If theShape is of type theType, it is also counted.
10296 theShape Shape to be described.
10297 theType the given geompy.ShapeType
10300 Quantity of shapes of type theType in theShape.
10302 # Example: see GEOM_TestMeasures.py
10303 listSh = self.SubShapeAllIDs(theShape, theType)
10307 ## Obtain quantity of shapes of each type in \a theShape.
10308 # The \a theShape is also counted.
10309 # @param theShape Shape to be described.
10310 # @return Dictionary of ShapeType() with bound quantities of shapes.
10312 # @ref tui_measurement_tools_page "Example"
10313 def ShapeInfo (self, theShape):
10315 Obtain quantity of shapes of each type in theShape.
10316 The theShape is also counted.
10319 theShape Shape to be described.
10322 Dictionary of geompy.ShapeType with bound quantities of shapes.
10324 # Example: see GEOM_TestMeasures.py
10326 for typeSh in self.ShapeType:
10327 if typeSh in ( "AUTO", "SHAPE" ): continue
10328 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10334 def GetCreationInformation(self, theShape):
10335 info = theShape.GetCreationInformation()
10337 opName = info.operationName
10338 if not opName: opName = "no info available"
10339 res = "Operation: " + opName
10341 for parVal in info.params:
10342 res += " \n %s = %s" % ( parVal.name, parVal.value )
10345 ## Get a point, situated at the centre of mass of theShape.
10346 # @param theShape Shape to define centre of mass of.
10347 # @param theName Object name; when specified, this parameter is used
10348 # for result publication in the study. Otherwise, if automatic
10349 # publication is switched on, default value is used for result name.
10351 # @return New GEOM.GEOM_Object, containing the created point.
10353 # @ref tui_measurement_tools_page "Example"
10354 @ManageTransactions("MeasuOp")
10355 def MakeCDG(self, theShape, theName=None):
10357 Get a point, situated at the centre of mass of theShape.
10360 theShape Shape to define centre of mass of.
10361 theName Object name; when specified, this parameter is used
10362 for result publication in the study. Otherwise, if automatic
10363 publication is switched on, default value is used for result name.
10366 New GEOM.GEOM_Object, containing the created point.
10368 # Example: see GEOM_TestMeasures.py
10369 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10370 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10371 self._autoPublish(anObj, theName, "centerOfMass")
10374 ## Get a vertex sub-shape by index depended with orientation.
10375 # @param theShape Shape to find sub-shape.
10376 # @param theIndex Index to find vertex by this index (starting from zero)
10377 # @param theName Object name; when specified, this parameter is used
10378 # for result publication in the study. Otherwise, if automatic
10379 # publication is switched on, default value is used for result name.
10381 # @return New GEOM.GEOM_Object, containing the created vertex.
10383 # @ref tui_measurement_tools_page "Example"
10384 @ManageTransactions("MeasuOp")
10385 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10387 Get a vertex sub-shape by index depended with orientation.
10390 theShape Shape to find sub-shape.
10391 theIndex Index to find vertex by this index (starting from zero)
10392 theName Object name; when specified, this parameter is used
10393 for result publication in the study. Otherwise, if automatic
10394 publication is switched on, default value is used for result name.
10397 New GEOM.GEOM_Object, containing the created vertex.
10399 # Example: see GEOM_TestMeasures.py
10400 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10401 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10402 self._autoPublish(anObj, theName, "vertex")
10405 ## Get the first vertex of wire/edge depended orientation.
10406 # @param theShape Shape to find first vertex.
10407 # @param theName Object name; when specified, this parameter is used
10408 # for result publication in the study. Otherwise, if automatic
10409 # publication is switched on, default value is used for result name.
10411 # @return New GEOM.GEOM_Object, containing the created vertex.
10413 # @ref tui_measurement_tools_page "Example"
10414 def GetFirstVertex(self, theShape, theName=None):
10416 Get the first vertex of wire/edge depended orientation.
10419 theShape Shape to find first vertex.
10420 theName Object name; when specified, this parameter is used
10421 for result publication in the study. Otherwise, if automatic
10422 publication is switched on, default value is used for result name.
10425 New GEOM.GEOM_Object, containing the created vertex.
10427 # Example: see GEOM_TestMeasures.py
10428 # note: auto-publishing is done in self.GetVertexByIndex()
10429 return self.GetVertexByIndex(theShape, 0, theName)
10431 ## Get the last vertex of wire/edge depended orientation.
10432 # @param theShape Shape to find last vertex.
10433 # @param theName Object name; when specified, this parameter is used
10434 # for result publication in the study. Otherwise, if automatic
10435 # publication is switched on, default value is used for result name.
10437 # @return New GEOM.GEOM_Object, containing the created vertex.
10439 # @ref tui_measurement_tools_page "Example"
10440 def GetLastVertex(self, theShape, theName=None):
10442 Get the last vertex of wire/edge depended orientation.
10445 theShape Shape to find last vertex.
10446 theName Object name; when specified, this parameter is used
10447 for result publication in the study. Otherwise, if automatic
10448 publication is switched on, default value is used for result name.
10451 New GEOM.GEOM_Object, containing the created vertex.
10453 # Example: see GEOM_TestMeasures.py
10454 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10455 # note: auto-publishing is done in self.GetVertexByIndex()
10456 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10458 ## Get a normale to the given face. If the point is not given,
10459 # the normale is calculated at the center of mass.
10460 # @param theFace Face to define normale of.
10461 # @param theOptionalPoint Point to compute the normale at.
10462 # @param theName Object name; when specified, this parameter is used
10463 # for result publication in the study. Otherwise, if automatic
10464 # publication is switched on, default value is used for result name.
10466 # @return New GEOM.GEOM_Object, containing the created vector.
10468 # @ref swig_todo "Example"
10469 @ManageTransactions("MeasuOp")
10470 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10472 Get a normale to the given face. If the point is not given,
10473 the normale is calculated at the center of mass.
10476 theFace Face to define normale of.
10477 theOptionalPoint Point to compute the normale at.
10478 theName Object name; when specified, this parameter is used
10479 for result publication in the study. Otherwise, if automatic
10480 publication is switched on, default value is used for result name.
10483 New GEOM.GEOM_Object, containing the created vector.
10485 # Example: see GEOM_TestMeasures.py
10486 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10487 RaiseIfFailed("GetNormal", self.MeasuOp)
10488 self._autoPublish(anObj, theName, "normal")
10491 ## Print shape errors obtained from CheckShape.
10492 # @param theShape Shape that was checked.
10493 # @param theShapeErrors the shape errors obtained by CheckShape.
10494 # @param theReturnStatus If 0 the description of problem is printed.
10495 # If 1 the description of problem is returned.
10496 # @return If theReturnStatus is equal to 1 the description is returned.
10497 # Otherwise doesn't return anything.
10499 # @ref tui_measurement_tools_page "Example"
10500 @ManageTransactions("MeasuOp")
10501 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10503 Print shape errors obtained from CheckShape.
10506 theShape Shape that was checked.
10507 theShapeErrors the shape errors obtained by CheckShape.
10508 theReturnStatus If 0 the description of problem is printed.
10509 If 1 the description of problem is returned.
10512 If theReturnStatus is equal to 1 the description is returned.
10513 Otherwise doesn't return anything.
10515 # Example: see GEOM_TestMeasures.py
10516 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10517 if theReturnStatus == 1:
10522 ## Check a topology of the given shape.
10523 # @param theShape Shape to check validity of.
10524 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10525 # if TRUE, the shape's geometry will be checked also.
10526 # @param theReturnStatus If 0 and if theShape is invalid, a description
10527 # of problem is printed.
10528 # If 1 isValid flag and the description of
10529 # problem is returned.
10530 # If 2 isValid flag and the list of error data
10532 # @return TRUE, if the shape "seems to be valid".
10533 # If theShape is invalid, prints a description of problem.
10534 # If theReturnStatus is equal to 1 the description is returned
10535 # along with IsValid flag.
10536 # If theReturnStatus is equal to 2 the list of error data is
10537 # returned along with IsValid flag.
10539 # @ref tui_measurement_tools_page "Example"
10540 @ManageTransactions("MeasuOp")
10541 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10543 Check a topology of the given shape.
10546 theShape Shape to check validity of.
10547 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10548 if TRUE, the shape's geometry will be checked also.
10549 theReturnStatus If 0 and if theShape is invalid, a description
10550 of problem is printed.
10551 If 1 IsValid flag and the description of
10552 problem is returned.
10553 If 2 IsValid flag and the list of error data
10557 TRUE, if the shape "seems to be valid".
10558 If theShape is invalid, prints a description of problem.
10559 If theReturnStatus is equal to 1 the description is returned
10560 along with IsValid flag.
10561 If theReturnStatus is equal to 2 the list of error data is
10562 returned along with IsValid flag.
10564 # Example: see GEOM_TestMeasures.py
10566 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10567 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10569 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10570 RaiseIfFailed("CheckShape", self.MeasuOp)
10572 if theReturnStatus == 0:
10573 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10575 if theReturnStatus == 1:
10576 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10577 return (IsValid, Descr)
10578 elif theReturnStatus == 2:
10579 return (IsValid, ShapeErrors)
10582 ## Detect self-intersections in the given shape.
10583 # @param theShape Shape to check.
10584 # @return TRUE, if the shape contains no self-intersections.
10586 # @ref tui_measurement_tools_page "Example"
10587 @ManageTransactions("MeasuOp")
10588 def CheckSelfIntersections(self, theShape):
10590 Detect self-intersections in the given shape.
10593 theShape Shape to check.
10596 TRUE, if the shape contains no self-intersections.
10598 # Example: see GEOM_TestMeasures.py
10599 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10600 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10603 ## Get position (LCS) of theShape.
10605 # Origin of the LCS is situated at the shape's center of mass.
10606 # Axes of the LCS are obtained from shape's location or,
10607 # if the shape is a planar face, from position of its plane.
10609 # @param theShape Shape to calculate position of.
10610 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10611 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10612 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10613 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10615 # @ref swig_todo "Example"
10616 @ManageTransactions("MeasuOp")
10617 def GetPosition(self,theShape):
10619 Get position (LCS) of theShape.
10620 Origin of the LCS is situated at the shape's center of mass.
10621 Axes of the LCS are obtained from shape's location or,
10622 if the shape is a planar face, from position of its plane.
10625 theShape Shape to calculate position of.
10628 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10629 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10630 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10631 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10633 # Example: see GEOM_TestMeasures.py
10634 aTuple = self.MeasuOp.GetPosition(theShape)
10635 RaiseIfFailed("GetPosition", self.MeasuOp)
10638 ## Get kind of theShape.
10640 # @param theShape Shape to get a kind of.
10641 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10642 # and a list of parameters, describing the shape.
10643 # @note Concrete meaning of each value, returned via \a theIntegers
10644 # or \a theDoubles list depends on the kind() of the shape.
10646 # @ref swig_todo "Example"
10647 @ManageTransactions("MeasuOp")
10648 def KindOfShape(self,theShape):
10650 Get kind of theShape.
10653 theShape Shape to get a kind of.
10656 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10657 and a list of parameters, describing the shape.
10659 Concrete meaning of each value, returned via theIntegers
10660 or theDoubles list depends on the geompy.kind of the shape
10662 # Example: see GEOM_TestMeasures.py
10663 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10664 RaiseIfFailed("KindOfShape", self.MeasuOp)
10666 aKind = aRoughTuple[0]
10667 anInts = aRoughTuple[1]
10668 aDbls = aRoughTuple[2]
10670 # Now there is no exception from this rule:
10671 aKindTuple = [aKind] + aDbls + anInts
10673 # If they are we will regroup parameters for such kind of shape.
10675 #if aKind == kind.SOME_KIND:
10676 # # SOME_KIND int int double int double double
10677 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10681 ## Returns the string that describes if the shell is good for solid.
10682 # This is a support method for MakeSolid.
10684 # @param theShell the shell to be checked.
10685 # @return Returns a string that describes the shell validity for
10686 # solid construction.
10687 @ManageTransactions("MeasuOp")
10688 def _IsGoodForSolid(self, theShell):
10690 Returns the string that describes if the shell is good for solid.
10691 This is a support method for MakeSolid.
10694 theShell the shell to be checked.
10697 Returns a string that describes the shell validity for
10698 solid construction.
10700 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10703 # end of l2_measure
10706 ## @addtogroup l2_import_export
10709 ## Import a shape from the BREP, IGES, STEP or other file
10710 # (depends on given format) with given name.
10712 # Note: this function is deprecated, it is kept for backward compatibility only
10713 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10715 # @param theFileName The file, containing the shape.
10716 # @param theFormatName Specify format for the file reading.
10717 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10718 # If format 'IGES_SCALE' is used instead of 'IGES' or
10719 # format 'STEP_SCALE' is used instead of 'STEP',
10720 # length unit will be set to 'meter' and result model will be scaled.
10721 # @param theName Object name; when specified, this parameter is used
10722 # for result publication in the study. Otherwise, if automatic
10723 # publication is switched on, default value is used for result name.
10725 # @return New GEOM.GEOM_Object, containing the imported shape.
10726 # If material names are imported it returns the list of
10727 # objects. The first one is the imported object followed by
10729 # @note Auto publishing is allowed for the shape itself. Imported
10730 # material groups are not automatically published.
10732 # @ref swig_Import_Export "Example"
10733 @ManageTransactions("InsertOp")
10734 def ImportFile(self, theFileName, theFormatName, theName=None):
10736 Import a shape from the BREP, IGES, STEP or other file
10737 (depends on given format) with given name.
10739 Note: this function is deprecated, it is kept for backward compatibility only
10740 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10743 theFileName The file, containing the shape.
10744 theFormatName Specify format for the file reading.
10745 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10746 If format 'IGES_SCALE' is used instead of 'IGES' or
10747 format 'STEP_SCALE' is used instead of 'STEP',
10748 length unit will be set to 'meter' and result model will be scaled.
10749 theName Object name; when specified, this parameter is used
10750 for result publication in the study. Otherwise, if automatic
10751 publication is switched on, default value is used for result name.
10754 New GEOM.GEOM_Object, containing the imported shape.
10755 If material names are imported it returns the list of
10756 objects. The first one is the imported object followed by
10759 Auto publishing is allowed for the shape itself. Imported
10760 material groups are not automatically published.
10762 # Example: see GEOM_TestOthers.py
10764 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10765 where <FormatName> is a name of desirable format for importing.
10767 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10768 RaiseIfFailed("ImportFile", self.InsertOp)
10769 aNbObj = len(aListObj)
10771 self._autoPublish(aListObj[0], theName, "imported")
10776 ## Deprecated analog of ImportFile()
10777 def Import(self, theFileName, theFormatName, theName=None):
10779 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10781 # note: auto-publishing is done in self.ImportFile()
10782 return self.ImportFile(theFileName, theFormatName, theName)
10784 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10785 # @note This method will not be dumped to the python script by DumpStudy functionality.
10786 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10787 # @param theStream The BRep binary stream.
10788 # @param theName Object name; when specified, this parameter is used
10789 # for result publication in the study. Otherwise, if automatic
10790 # publication is switched on, default value is used for result name.
10792 # @return New GEOM_Object, containing the shape, read from theStream.
10794 # @ref swig_Import_Export "Example"
10795 @ManageTransactions("InsertOp")
10796 def RestoreShape (self, theStream, theName=None):
10798 Read a shape from the binary stream, containing its bounding representation (BRep).
10801 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10804 theStream The BRep binary stream.
10805 theName Object name; when specified, this parameter is used
10806 for result publication in the study. Otherwise, if automatic
10807 publication is switched on, default value is used for result name.
10810 New GEOM_Object, containing the shape, read from theStream.
10812 # Example: see GEOM_TestOthers.py
10813 anObj = self.InsertOp.RestoreShape(theStream)
10814 RaiseIfFailed("RestoreShape", self.InsertOp)
10815 self._autoPublish(anObj, theName, "restored")
10818 ## Export the given shape into a file with given name.
10820 # Note: this function is deprecated, it is kept for backward compatibility only
10821 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10823 # @param theObject Shape to be stored in the file.
10824 # @param theFileName Name of the file to store the given shape in.
10825 # @param theFormatName Specify format for the shape storage.
10826 # Available formats can be obtained with
10827 # geompy.InsertOp.ExportTranslators()[0] method.
10829 # @ref swig_Import_Export "Example"
10830 @ManageTransactions("InsertOp")
10831 def Export(self, theObject, theFileName, theFormatName):
10833 Export the given shape into a file with given name.
10835 Note: this function is deprecated, it is kept for backward compatibility only
10836 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10839 theObject Shape to be stored in the file.
10840 theFileName Name of the file to store the given shape in.
10841 theFormatName Specify format for the shape storage.
10842 Available formats can be obtained with
10843 geompy.InsertOp.ExportTranslators()[0] method.
10845 # Example: see GEOM_TestOthers.py
10847 WARNING: Function Export is deprecated, use Export<FormatName> instead,
10848 where <FormatName> is a name of desirable format for exporting.
10850 self.InsertOp.Export(theObject, theFileName, theFormatName)
10851 if self.InsertOp.IsDone() == 0:
10852 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10856 # end of l2_import_export
10859 ## @addtogroup l3_blocks
10862 ## Create a quadrangle face from four edges. Order of Edges is not
10863 # important. It is not necessary that edges share the same vertex.
10864 # @param E1,E2,E3,E4 Edges for the face bound.
10865 # @param theName Object name; when specified, this parameter is used
10866 # for result publication in the study. Otherwise, if automatic
10867 # publication is switched on, default value is used for result name.
10869 # @return New GEOM.GEOM_Object, containing the created face.
10871 # @ref tui_building_by_blocks_page "Example"
10872 @ManageTransactions("BlocksOp")
10873 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10875 Create a quadrangle face from four edges. Order of Edges is not
10876 important. It is not necessary that edges share the same vertex.
10879 E1,E2,E3,E4 Edges for the face bound.
10880 theName Object name; when specified, this parameter is used
10881 for result publication in the study. Otherwise, if automatic
10882 publication is switched on, default value is used for result name.
10885 New GEOM.GEOM_Object, containing the created face.
10888 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10890 # Example: see GEOM_Spanner.py
10891 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10892 RaiseIfFailed("MakeQuad", self.BlocksOp)
10893 self._autoPublish(anObj, theName, "quad")
10896 ## Create a quadrangle face on two edges.
10897 # The missing edges will be built by creating the shortest ones.
10898 # @param E1,E2 Two opposite edges for the face.
10899 # @param theName Object name; when specified, this parameter is used
10900 # for result publication in the study. Otherwise, if automatic
10901 # publication is switched on, default value is used for result name.
10903 # @return New GEOM.GEOM_Object, containing the created face.
10905 # @ref tui_building_by_blocks_page "Example"
10906 @ManageTransactions("BlocksOp")
10907 def MakeQuad2Edges(self, E1, E2, theName=None):
10909 Create a quadrangle face on two edges.
10910 The missing edges will be built by creating the shortest ones.
10913 E1,E2 Two opposite edges for the face.
10914 theName Object name; when specified, this parameter is used
10915 for result publication in the study. Otherwise, if automatic
10916 publication is switched on, default value is used for result name.
10919 New GEOM.GEOM_Object, containing the created face.
10923 p1 = geompy.MakeVertex( 0., 0., 0.)
10924 p2 = geompy.MakeVertex(150., 30., 0.)
10925 p3 = geompy.MakeVertex( 0., 120., 50.)
10926 p4 = geompy.MakeVertex( 0., 40., 70.)
10928 edge1 = geompy.MakeEdge(p1, p2)
10929 edge2 = geompy.MakeEdge(p3, p4)
10930 # create a quadrangle face from two edges
10931 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10933 # Example: see GEOM_Spanner.py
10934 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10935 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10936 self._autoPublish(anObj, theName, "quad")
10939 ## Create a quadrangle face with specified corners.
10940 # The missing edges will be built by creating the shortest ones.
10941 # @param V1,V2,V3,V4 Corner vertices for the face.
10942 # @param theName Object name; when specified, this parameter is used
10943 # for result publication in the study. Otherwise, if automatic
10944 # publication is switched on, default value is used for result name.
10946 # @return New GEOM.GEOM_Object, containing the created face.
10948 # @ref tui_building_by_blocks_page "Example 1"
10949 # \n @ref swig_MakeQuad4Vertices "Example 2"
10950 @ManageTransactions("BlocksOp")
10951 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10953 Create a quadrangle face with specified corners.
10954 The missing edges will be built by creating the shortest ones.
10957 V1,V2,V3,V4 Corner vertices for the face.
10958 theName Object name; when specified, this parameter is used
10959 for result publication in the study. Otherwise, if automatic
10960 publication is switched on, default value is used for result name.
10963 New GEOM.GEOM_Object, containing the created face.
10967 p1 = geompy.MakeVertex( 0., 0., 0.)
10968 p2 = geompy.MakeVertex(150., 30., 0.)
10969 p3 = geompy.MakeVertex( 0., 120., 50.)
10970 p4 = geompy.MakeVertex( 0., 40., 70.)
10971 # create a quadrangle from four points in its corners
10972 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10974 # Example: see GEOM_Spanner.py
10975 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10976 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10977 self._autoPublish(anObj, theName, "quad")
10980 ## Create a hexahedral solid, bounded by the six given faces. Order of
10981 # faces is not important. It is not necessary that Faces share the same edge.
10982 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10983 # @param theName Object name; when specified, this parameter is used
10984 # for result publication in the study. Otherwise, if automatic
10985 # publication is switched on, default value is used for result name.
10987 # @return New GEOM.GEOM_Object, containing the created solid.
10989 # @ref tui_building_by_blocks_page "Example 1"
10990 # \n @ref swig_MakeHexa "Example 2"
10991 @ManageTransactions("BlocksOp")
10992 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10994 Create a hexahedral solid, bounded by the six given faces. Order of
10995 faces is not important. It is not necessary that Faces share the same edge.
10998 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10999 theName Object name; when specified, this parameter is used
11000 for result publication in the study. Otherwise, if automatic
11001 publication is switched on, default value is used for result name.
11004 New GEOM.GEOM_Object, containing the created solid.
11007 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11009 # Example: see GEOM_Spanner.py
11010 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11011 RaiseIfFailed("MakeHexa", self.BlocksOp)
11012 self._autoPublish(anObj, theName, "hexa")
11015 ## Create a hexahedral solid between two given faces.
11016 # The missing faces will be built by creating the smallest ones.
11017 # @param F1,F2 Two opposite faces for the hexahedral solid.
11018 # @param theName Object name; when specified, this parameter is used
11019 # for result publication in the study. Otherwise, if automatic
11020 # publication is switched on, default value is used for result name.
11022 # @return New GEOM.GEOM_Object, containing the created solid.
11024 # @ref tui_building_by_blocks_page "Example 1"
11025 # \n @ref swig_MakeHexa2Faces "Example 2"
11026 @ManageTransactions("BlocksOp")
11027 def MakeHexa2Faces(self, F1, F2, theName=None):
11029 Create a hexahedral solid between two given faces.
11030 The missing faces will be built by creating the smallest ones.
11033 F1,F2 Two opposite faces for the hexahedral solid.
11034 theName Object name; when specified, this parameter is used
11035 for result publication in the study. Otherwise, if automatic
11036 publication is switched on, default value is used for result name.
11039 New GEOM.GEOM_Object, containing the created solid.
11042 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11044 # Example: see GEOM_Spanner.py
11045 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11046 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11047 self._autoPublish(anObj, theName, "hexa")
11053 ## @addtogroup l3_blocks_op
11056 ## Get a vertex, found in the given shape by its coordinates.
11057 # @param theShape Block or a compound of blocks.
11058 # @param theX,theY,theZ Coordinates of the sought vertex.
11059 # @param theEpsilon Maximum allowed distance between the resulting
11060 # vertex and point with the given coordinates.
11061 # @param theName Object name; when specified, this parameter is used
11062 # for result publication in the study. Otherwise, if automatic
11063 # publication is switched on, default value is used for result name.
11065 # @return New GEOM.GEOM_Object, containing the found vertex.
11067 # @ref swig_GetPoint "Example"
11068 @ManageTransactions("BlocksOp")
11069 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11071 Get a vertex, found in the given shape by its coordinates.
11074 theShape Block or a compound of blocks.
11075 theX,theY,theZ Coordinates of the sought vertex.
11076 theEpsilon Maximum allowed distance between the resulting
11077 vertex and point with the given coordinates.
11078 theName Object name; when specified, this parameter is used
11079 for result publication in the study. Otherwise, if automatic
11080 publication is switched on, default value is used for result name.
11083 New GEOM.GEOM_Object, containing the found vertex.
11086 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11088 # Example: see GEOM_TestOthers.py
11089 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11090 RaiseIfFailed("GetPoint", self.BlocksOp)
11091 self._autoPublish(anObj, theName, "vertex")
11094 ## Find a vertex of the given shape, which has minimal distance to the given point.
11095 # @param theShape Any shape.
11096 # @param thePoint Point, close to the desired vertex.
11097 # @param theName Object name; when specified, this parameter is used
11098 # for result publication in the study. Otherwise, if automatic
11099 # publication is switched on, default value is used for result name.
11101 # @return New GEOM.GEOM_Object, containing the found vertex.
11103 # @ref swig_GetVertexNearPoint "Example"
11104 @ManageTransactions("BlocksOp")
11105 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11107 Find a vertex of the given shape, which has minimal distance to the given point.
11110 theShape Any shape.
11111 thePoint Point, close to the desired vertex.
11112 theName Object name; when specified, this parameter is used
11113 for result publication in the study. Otherwise, if automatic
11114 publication is switched on, default value is used for result name.
11117 New GEOM.GEOM_Object, containing the found vertex.
11120 pmidle = geompy.MakeVertex(50, 0, 50)
11121 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11123 # Example: see GEOM_TestOthers.py
11124 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11125 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11126 self._autoPublish(anObj, theName, "vertex")
11129 ## Get an edge, found in the given shape by two given vertices.
11130 # @param theShape Block or a compound of blocks.
11131 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11132 # @param theName Object name; when specified, this parameter is used
11133 # for result publication in the study. Otherwise, if automatic
11134 # publication is switched on, default value is used for result name.
11136 # @return New GEOM.GEOM_Object, containing the found edge.
11138 # @ref swig_GetEdge "Example"
11139 @ManageTransactions("BlocksOp")
11140 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11142 Get an edge, found in the given shape by two given vertices.
11145 theShape Block or a compound of blocks.
11146 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11147 theName Object name; when specified, this parameter is used
11148 for result publication in the study. Otherwise, if automatic
11149 publication is switched on, default value is used for result name.
11152 New GEOM.GEOM_Object, containing the found edge.
11154 # Example: see GEOM_Spanner.py
11155 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11156 RaiseIfFailed("GetEdge", self.BlocksOp)
11157 self._autoPublish(anObj, theName, "edge")
11160 ## Find an edge of the given shape, which has minimal distance to the given point.
11161 # @param theShape Block or a compound of blocks.
11162 # @param thePoint Point, close to the desired edge.
11163 # @param theName Object name; when specified, this parameter is used
11164 # for result publication in the study. Otherwise, if automatic
11165 # publication is switched on, default value is used for result name.
11167 # @return New GEOM.GEOM_Object, containing the found edge.
11169 # @ref swig_GetEdgeNearPoint "Example"
11170 @ManageTransactions("BlocksOp")
11171 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11173 Find an edge of the given shape, which has minimal distance to the given point.
11176 theShape Block or a compound of blocks.
11177 thePoint Point, close to the desired edge.
11178 theName Object name; when specified, this parameter is used
11179 for result publication in the study. Otherwise, if automatic
11180 publication is switched on, default value is used for result name.
11183 New GEOM.GEOM_Object, containing the found edge.
11185 # Example: see GEOM_TestOthers.py
11186 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11187 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11188 self._autoPublish(anObj, theName, "edge")
11191 ## Returns a face, found in the given shape by four given corner vertices.
11192 # @param theShape Block or a compound of blocks.
11193 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11194 # @param theName Object name; when specified, this parameter is used
11195 # for result publication in the study. Otherwise, if automatic
11196 # publication is switched on, default value is used for result name.
11198 # @return New GEOM.GEOM_Object, containing the found face.
11200 # @ref swig_todo "Example"
11201 @ManageTransactions("BlocksOp")
11202 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11204 Returns a face, found in the given shape by four given corner vertices.
11207 theShape Block or a compound of blocks.
11208 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11209 theName Object name; when specified, this parameter is used
11210 for result publication in the study. Otherwise, if automatic
11211 publication is switched on, default value is used for result name.
11214 New GEOM.GEOM_Object, containing the found face.
11216 # Example: see GEOM_Spanner.py
11217 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11218 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11219 self._autoPublish(anObj, theName, "face")
11222 ## Get a face of block, found in the given shape by two given edges.
11223 # @param theShape Block or a compound of blocks.
11224 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11225 # @param theName Object name; when specified, this parameter is used
11226 # for result publication in the study. Otherwise, if automatic
11227 # publication is switched on, default value is used for result name.
11229 # @return New GEOM.GEOM_Object, containing the found face.
11231 # @ref swig_todo "Example"
11232 @ManageTransactions("BlocksOp")
11233 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11235 Get a face of block, found in the given shape by two given edges.
11238 theShape Block or a compound of blocks.
11239 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11240 theName Object name; when specified, this parameter is used
11241 for result publication in the study. Otherwise, if automatic
11242 publication is switched on, default value is used for result name.
11245 New GEOM.GEOM_Object, containing the found face.
11247 # Example: see GEOM_Spanner.py
11248 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11249 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11250 self._autoPublish(anObj, theName, "face")
11253 ## Find a face, opposite to the given one in the given block.
11254 # @param theBlock Must be a hexahedral solid.
11255 # @param theFace Face of \a theBlock, opposite to the desired face.
11256 # @param theName Object name; when specified, this parameter is used
11257 # for result publication in the study. Otherwise, if automatic
11258 # publication is switched on, default value is used for result name.
11260 # @return New GEOM.GEOM_Object, containing the found face.
11262 # @ref swig_GetOppositeFace "Example"
11263 @ManageTransactions("BlocksOp")
11264 def GetOppositeFace(self, theBlock, theFace, theName=None):
11266 Find a face, opposite to the given one in the given block.
11269 theBlock Must be a hexahedral solid.
11270 theFace Face of theBlock, opposite to the desired face.
11271 theName Object name; when specified, this parameter is used
11272 for result publication in the study. Otherwise, if automatic
11273 publication is switched on, default value is used for result name.
11276 New GEOM.GEOM_Object, containing the found face.
11278 # Example: see GEOM_Spanner.py
11279 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11280 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11281 self._autoPublish(anObj, theName, "face")
11284 ## Find a face of the given shape, which has minimal distance to the given point.
11285 # @param theShape Block or a compound of blocks.
11286 # @param thePoint Point, close to the desired face.
11287 # @param theName Object name; when specified, this parameter is used
11288 # for result publication in the study. Otherwise, if automatic
11289 # publication is switched on, default value is used for result name.
11291 # @return New GEOM.GEOM_Object, containing the found face.
11293 # @ref swig_GetFaceNearPoint "Example"
11294 @ManageTransactions("BlocksOp")
11295 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11297 Find a face of the given shape, which has minimal distance to the given point.
11300 theShape Block or a compound of blocks.
11301 thePoint Point, close to the desired face.
11302 theName Object name; when specified, this parameter is used
11303 for result publication in the study. Otherwise, if automatic
11304 publication is switched on, default value is used for result name.
11307 New GEOM.GEOM_Object, containing the found face.
11309 # Example: see GEOM_Spanner.py
11310 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11311 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11312 self._autoPublish(anObj, theName, "face")
11315 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11316 # @param theBlock Block or a compound of blocks.
11317 # @param theVector Vector, close to the normale of the desired face.
11318 # @param theName Object name; when specified, this parameter is used
11319 # for result publication in the study. Otherwise, if automatic
11320 # publication is switched on, default value is used for result name.
11322 # @return New GEOM.GEOM_Object, containing the found face.
11324 # @ref swig_todo "Example"
11325 @ManageTransactions("BlocksOp")
11326 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11328 Find a face of block, whose outside normale has minimal angle with the given vector.
11331 theBlock Block or a compound of blocks.
11332 theVector Vector, close to the normale of the desired face.
11333 theName Object name; when specified, this parameter is used
11334 for result publication in the study. Otherwise, if automatic
11335 publication is switched on, default value is used for result name.
11338 New GEOM.GEOM_Object, containing the found face.
11340 # Example: see GEOM_Spanner.py
11341 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11342 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11343 self._autoPublish(anObj, theName, "face")
11346 ## Find all sub-shapes of type \a theShapeType of the given shape,
11347 # which have minimal distance to the given point.
11348 # @param theShape Any shape.
11349 # @param thePoint Point, close to the desired shape.
11350 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11351 # @param theTolerance The tolerance for distances comparison. All shapes
11352 # with distances to the given point in interval
11353 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11354 # @param theName Object name; when specified, this parameter is used
11355 # for result publication in the study. Otherwise, if automatic
11356 # publication is switched on, default value is used for result name.
11358 # @return New GEOM_Object, containing a group of all found shapes.
11360 # @ref swig_GetShapesNearPoint "Example"
11361 @ManageTransactions("BlocksOp")
11362 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11364 Find all sub-shapes of type theShapeType of the given shape,
11365 which have minimal distance to the given point.
11368 theShape Any shape.
11369 thePoint Point, close to the desired shape.
11370 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11371 theTolerance The tolerance for distances comparison. All shapes
11372 with distances to the given point in interval
11373 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11374 theName Object name; when specified, this parameter is used
11375 for result publication in the study. Otherwise, if automatic
11376 publication is switched on, default value is used for result name.
11379 New GEOM_Object, containing a group of all found shapes.
11381 # Example: see GEOM_TestOthers.py
11382 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11383 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11384 self._autoPublish(anObj, theName, "group")
11387 # end of l3_blocks_op
11390 ## @addtogroup l4_blocks_measure
11393 ## Check, if the compound of blocks is given.
11394 # To be considered as a compound of blocks, the
11395 # given shape must satisfy the following conditions:
11396 # - Each element of the compound should be a Block (6 faces and 12 edges).
11397 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11398 # - The compound should be connexe.
11399 # - The glue between two quadrangle faces should be applied.
11400 # @param theCompound The compound to check.
11401 # @return TRUE, if the given shape is a compound of blocks.
11402 # If theCompound is not valid, prints all discovered errors.
11404 # @ref tui_measurement_tools_page "Example 1"
11405 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11406 @ManageTransactions("BlocksOp")
11407 def CheckCompoundOfBlocks(self,theCompound):
11409 Check, if the compound of blocks is given.
11410 To be considered as a compound of blocks, the
11411 given shape must satisfy the following conditions:
11412 - Each element of the compound should be a Block (6 faces and 12 edges).
11413 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11414 - The compound should be connexe.
11415 - The glue between two quadrangle faces should be applied.
11418 theCompound The compound to check.
11421 TRUE, if the given shape is a compound of blocks.
11422 If theCompound is not valid, prints all discovered errors.
11424 # Example: see GEOM_Spanner.py
11425 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11426 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11428 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11432 ## Retrieve all non blocks solids and faces from \a theShape.
11433 # @param theShape The shape to explore.
11434 # @param theName Object name; when specified, this parameter is used
11435 # for result publication in the study. Otherwise, if automatic
11436 # publication is switched on, default value is used for result name.
11438 # @return A tuple of two GEOM_Objects. The first object is a group of all
11439 # non block solids (= not 6 faces, or with 6 faces, but with the
11440 # presence of non-quadrangular faces). The second object is a
11441 # group of all non quadrangular faces.
11443 # @ref tui_measurement_tools_page "Example 1"
11444 # \n @ref swig_GetNonBlocks "Example 2"
11445 @ManageTransactions("BlocksOp")
11446 def GetNonBlocks (self, theShape, theName=None):
11448 Retrieve all non blocks solids and faces from theShape.
11451 theShape The shape to explore.
11452 theName Object name; when specified, this parameter is used
11453 for result publication in the study. Otherwise, if automatic
11454 publication is switched on, default value is used for result name.
11457 A tuple of two GEOM_Objects. The first object is a group of all
11458 non block solids (= not 6 faces, or with 6 faces, but with the
11459 presence of non-quadrangular faces). The second object is a
11460 group of all non quadrangular faces.
11463 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11465 # Example: see GEOM_Spanner.py
11466 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11467 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11468 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11471 ## Remove all seam and degenerated edges from \a theShape.
11472 # Unite faces and edges, sharing one surface. It means that
11473 # this faces must have references to one C++ surface object (handle).
11474 # @param theShape The compound or single solid to remove irregular edges from.
11475 # @param doUnionFaces If True, then unite faces. If False (the default value),
11476 # do not unite faces.
11477 # @param theName Object name; when specified, this parameter is used
11478 # for result publication in the study. Otherwise, if automatic
11479 # publication is switched on, default value is used for result name.
11481 # @return Improved shape.
11483 # @ref swig_RemoveExtraEdges "Example"
11484 @ManageTransactions("BlocksOp")
11485 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11487 Remove all seam and degenerated edges from theShape.
11488 Unite faces and edges, sharing one surface. It means that
11489 this faces must have references to one C++ surface object (handle).
11492 theShape The compound or single solid to remove irregular edges from.
11493 doUnionFaces If True, then unite faces. If False (the default value),
11494 do not unite faces.
11495 theName Object name; when specified, this parameter is used
11496 for result publication in the study. Otherwise, if automatic
11497 publication is switched on, default value is used for result name.
11502 # Example: see GEOM_TestOthers.py
11503 nbFacesOptimum = -1 # -1 means do not unite faces
11504 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11505 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11506 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11507 self._autoPublish(anObj, theName, "removeExtraEdges")
11510 ## Performs union faces of \a theShape
11511 # Unite faces sharing one surface. It means that
11512 # these faces must have references to one C++ surface object (handle).
11513 # @param theShape The compound or single solid that contains faces
11514 # to perform union.
11515 # @param theName Object name; when specified, this parameter is used
11516 # for result publication in the study. Otherwise, if automatic
11517 # publication is switched on, default value is used for result name.
11519 # @return Improved shape.
11521 # @ref swig_UnionFaces "Example"
11522 @ManageTransactions("BlocksOp")
11523 def UnionFaces(self, theShape, theName=None):
11525 Performs union faces of theShape.
11526 Unite faces sharing one surface. It means that
11527 these faces must have references to one C++ surface object (handle).
11530 theShape The compound or single solid that contains faces
11532 theName Object name; when specified, this parameter is used
11533 for result publication in the study. Otherwise, if automatic
11534 publication is switched on, default value is used for result name.
11539 # Example: see GEOM_TestOthers.py
11540 anObj = self.BlocksOp.UnionFaces(theShape)
11541 RaiseIfFailed("UnionFaces", self.BlocksOp)
11542 self._autoPublish(anObj, theName, "unionFaces")
11545 ## Check, if the given shape is a blocks compound.
11546 # Fix all detected errors.
11547 # \note Single block can be also fixed by this method.
11548 # @param theShape The compound to check and improve.
11549 # @param theName Object name; when specified, this parameter is used
11550 # for result publication in the study. Otherwise, if automatic
11551 # publication is switched on, default value is used for result name.
11553 # @return Improved compound.
11555 # @ref swig_CheckAndImprove "Example"
11556 @ManageTransactions("BlocksOp")
11557 def CheckAndImprove(self, theShape, theName=None):
11559 Check, if the given shape is a blocks compound.
11560 Fix all detected errors.
11563 Single block can be also fixed by this method.
11566 theShape The compound to check and improve.
11567 theName Object name; when specified, this parameter is used
11568 for result publication in the study. Otherwise, if automatic
11569 publication is switched on, default value is used for result name.
11574 # Example: see GEOM_TestOthers.py
11575 anObj = self.BlocksOp.CheckAndImprove(theShape)
11576 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11577 self._autoPublish(anObj, theName, "improved")
11580 # end of l4_blocks_measure
11583 ## @addtogroup l3_blocks_op
11586 ## Get all the blocks, contained in the given compound.
11587 # @param theCompound The compound to explode.
11588 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11589 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11590 # @param 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.
11594 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11596 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11598 # @ref tui_explode_on_blocks "Example 1"
11599 # \n @ref swig_MakeBlockExplode "Example 2"
11600 @ManageTransactions("BlocksOp")
11601 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11603 Get all the blocks, contained in the given compound.
11606 theCompound The compound to explode.
11607 theMinNbFaces If solid has lower number of faces, it is not a block.
11608 theMaxNbFaces If solid has higher number of faces, it is not a block.
11609 theName Object name; when specified, this parameter is used
11610 for result publication in the study. Otherwise, if automatic
11611 publication is switched on, default value is used for result name.
11614 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11617 List of GEOM.GEOM_Object, containing the retrieved blocks.
11619 # Example: see GEOM_TestOthers.py
11620 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11621 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11622 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11623 for anObj in aList:
11624 anObj.SetParameters(Parameters)
11626 self._autoPublish(aList, theName, "block")
11629 ## Find block, containing the given point inside its volume or on boundary.
11630 # @param theCompound Compound, to find block in.
11631 # @param thePoint Point, close to the desired block. If the point lays on
11632 # boundary between some blocks, we return block with nearest center.
11633 # @param theName Object name; when specified, this parameter is used
11634 # for result publication in the study. Otherwise, if automatic
11635 # publication is switched on, default value is used for result name.
11637 # @return New GEOM.GEOM_Object, containing the found block.
11639 # @ref swig_todo "Example"
11640 @ManageTransactions("BlocksOp")
11641 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11643 Find block, containing the given point inside its volume or on boundary.
11646 theCompound Compound, to find block in.
11647 thePoint Point, close to the desired block. If the point lays on
11648 boundary between some blocks, we return block with nearest center.
11649 theName Object name; when specified, this parameter is used
11650 for result publication in the study. Otherwise, if automatic
11651 publication is switched on, default value is used for result name.
11654 New GEOM.GEOM_Object, containing the found block.
11656 # Example: see GEOM_Spanner.py
11657 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11658 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11659 self._autoPublish(anObj, theName, "block")
11662 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11663 # @param theCompound Compound, to find block in.
11664 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11665 # @param theName Object name; when specified, this parameter is used
11666 # for result publication in the study. Otherwise, if automatic
11667 # publication is switched on, default value is used for result name.
11669 # @return New GEOM.GEOM_Object, containing the found block.
11671 # @ref swig_GetBlockByParts "Example"
11672 @ManageTransactions("BlocksOp")
11673 def GetBlockByParts(self, theCompound, theParts, theName=None):
11675 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11678 theCompound Compound, to find block in.
11679 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11680 theName Object name; when specified, this parameter is used
11681 for result publication in the study. Otherwise, if automatic
11682 publication is switched on, default value is used for result name.
11685 New GEOM_Object, containing the found block.
11687 # Example: see GEOM_TestOthers.py
11688 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11689 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11690 self._autoPublish(anObj, theName, "block")
11693 ## Return all blocks, containing all the elements, passed as the parts.
11694 # @param theCompound Compound, to find blocks in.
11695 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11696 # @param theName Object name; when specified, this parameter is used
11697 # for result publication in the study. Otherwise, if automatic
11698 # publication is switched on, default value is used for result name.
11700 # @return List of GEOM.GEOM_Object, containing the found blocks.
11702 # @ref swig_todo "Example"
11703 @ManageTransactions("BlocksOp")
11704 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11706 Return all blocks, containing all the elements, passed as the parts.
11709 theCompound Compound, to find blocks in.
11710 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11711 theName Object name; when specified, this parameter is used
11712 for result publication in the study. Otherwise, if automatic
11713 publication is switched on, default value is used for result name.
11716 List of GEOM.GEOM_Object, containing the found blocks.
11718 # Example: see GEOM_Spanner.py
11719 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11720 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11721 self._autoPublish(aList, theName, "block")
11724 ## Multi-transformate block and glue the result.
11725 # Transformation is defined so, as to superpose direction faces.
11726 # @param Block Hexahedral solid to be multi-transformed.
11727 # @param DirFace1 ID of First direction face.
11728 # @param DirFace2 ID of Second direction face.
11729 # @param NbTimes Quantity of transformations to be done.
11730 # @param theName Object name; when specified, this parameter is used
11731 # for result publication in the study. Otherwise, if automatic
11732 # publication is switched on, default value is used for result name.
11734 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11736 # @return New GEOM.GEOM_Object, containing the result shape.
11738 # @ref tui_multi_transformation "Example"
11739 @ManageTransactions("BlocksOp")
11740 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11742 Multi-transformate block and glue the result.
11743 Transformation is defined so, as to superpose direction faces.
11746 Block Hexahedral solid to be multi-transformed.
11747 DirFace1 ID of First direction face.
11748 DirFace2 ID of Second direction face.
11749 NbTimes Quantity of transformations to be done.
11750 theName Object name; when specified, this parameter is used
11751 for result publication in the study. Otherwise, if automatic
11752 publication is switched on, default value is used for result name.
11755 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11758 New GEOM.GEOM_Object, containing the result shape.
11760 # Example: see GEOM_Spanner.py
11761 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11762 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11763 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11764 anObj.SetParameters(Parameters)
11765 self._autoPublish(anObj, theName, "transformed")
11768 ## Multi-transformate block and glue the result.
11769 # @param Block Hexahedral solid to be multi-transformed.
11770 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11771 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11772 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11773 # @param 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.
11777 # @return New GEOM.GEOM_Object, containing the result shape.
11779 # @ref tui_multi_transformation "Example"
11780 @ManageTransactions("BlocksOp")
11781 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11782 DirFace1V, DirFace2V, NbTimesV, theName=None):
11784 Multi-transformate block and glue the result.
11787 Block Hexahedral solid to be multi-transformed.
11788 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11789 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11790 NbTimesU,NbTimesV Quantity of transformations to be done.
11791 theName Object name; when specified, this parameter is used
11792 for result publication in the study. Otherwise, if automatic
11793 publication is switched on, default value is used for result name.
11796 New GEOM.GEOM_Object, containing the result shape.
11798 # Example: see GEOM_Spanner.py
11799 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11800 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11801 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11802 DirFace1V, DirFace2V, NbTimesV)
11803 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11804 anObj.SetParameters(Parameters)
11805 self._autoPublish(anObj, theName, "transformed")
11808 ## Build all possible propagation groups.
11809 # Propagation group is a set of all edges, opposite to one (main)
11810 # edge of this group directly or through other opposite edges.
11811 # Notion of Opposite Edge make sence only on quadrangle face.
11812 # @param theShape Shape to build propagation groups on.
11813 # @param theName Object name; when specified, this parameter is used
11814 # for result publication in the study. Otherwise, if automatic
11815 # publication is switched on, default value is used for result name.
11817 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11819 # @ref swig_Propagate "Example"
11820 @ManageTransactions("BlocksOp")
11821 def Propagate(self, theShape, theName=None):
11823 Build all possible propagation groups.
11824 Propagation group is a set of all edges, opposite to one (main)
11825 edge of this group directly or through other opposite edges.
11826 Notion of Opposite Edge make sence only on quadrangle face.
11829 theShape Shape to build propagation groups on.
11830 theName Object name; when specified, this parameter is used
11831 for result publication in the study. Otherwise, if automatic
11832 publication is switched on, default value is used for result name.
11835 List of GEOM.GEOM_Object, each of them is a propagation group.
11837 # Example: see GEOM_TestOthers.py
11838 listChains = self.BlocksOp.Propagate(theShape)
11839 RaiseIfFailed("Propagate", self.BlocksOp)
11840 self._autoPublish(listChains, theName, "propagate")
11843 # end of l3_blocks_op
11846 ## @addtogroup l3_groups
11849 ## Creates a new group which will store sub-shapes of theMainShape
11850 # @param theMainShape is a GEOM object on which the group is selected
11851 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11852 # @param theName Object name; when specified, this parameter is used
11853 # for result publication in the study. Otherwise, if automatic
11854 # publication is switched on, default value is used for result name.
11856 # @return a newly created GEOM group (GEOM.GEOM_Object)
11858 # @ref tui_working_with_groups_page "Example 1"
11859 # \n @ref swig_CreateGroup "Example 2"
11860 @ManageTransactions("GroupOp")
11861 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11863 Creates a new group which will store sub-shapes of theMainShape
11866 theMainShape is a GEOM object on which the group is selected
11867 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11868 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11869 theName Object name; when specified, this parameter is used
11870 for result publication in the study. Otherwise, if automatic
11871 publication is switched on, default value is used for result name.
11874 a newly created GEOM group
11877 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11880 # Example: see GEOM_TestOthers.py
11881 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11882 RaiseIfFailed("CreateGroup", self.GroupOp)
11883 self._autoPublish(anObj, theName, "group")
11886 ## Adds a sub-object with ID theSubShapeId to the group
11887 # @param theGroup is a GEOM group to which the new sub-shape is added
11888 # @param theSubShapeID is a sub-shape ID in the main object.
11889 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11891 # @ref tui_working_with_groups_page "Example"
11892 @ManageTransactions("GroupOp")
11893 def AddObject(self,theGroup, theSubShapeID):
11895 Adds a sub-object with ID theSubShapeId to the group
11898 theGroup is a GEOM group to which the new sub-shape is added
11899 theSubShapeID is a sub-shape ID in the main object.
11902 Use method GetSubShapeID() to get an unique ID of the sub-shape
11904 # Example: see GEOM_TestOthers.py
11905 self.GroupOp.AddObject(theGroup, theSubShapeID)
11906 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11907 RaiseIfFailed("AddObject", self.GroupOp)
11911 ## Removes a sub-object with ID \a theSubShapeId from the group
11912 # @param theGroup is a GEOM group from which the new sub-shape is removed
11913 # @param theSubShapeID is a sub-shape ID in the main object.
11914 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11916 # @ref tui_working_with_groups_page "Example"
11917 @ManageTransactions("GroupOp")
11918 def RemoveObject(self,theGroup, theSubShapeID):
11920 Removes a sub-object with ID theSubShapeId from the group
11923 theGroup is a GEOM group from which the new sub-shape is removed
11924 theSubShapeID is a sub-shape ID in the main object.
11927 Use method GetSubShapeID() to get an unique ID of the sub-shape
11929 # Example: see GEOM_TestOthers.py
11930 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11931 RaiseIfFailed("RemoveObject", self.GroupOp)
11934 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11935 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11936 # @param theSubShapes is a list of sub-shapes to be added.
11938 # @ref tui_working_with_groups_page "Example"
11939 @ManageTransactions("GroupOp")
11940 def UnionList (self,theGroup, theSubShapes):
11942 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11945 theGroup is a GEOM group to which the new sub-shapes are added.
11946 theSubShapes is a list of sub-shapes to be added.
11948 # Example: see GEOM_TestOthers.py
11949 self.GroupOp.UnionList(theGroup, theSubShapes)
11950 RaiseIfFailed("UnionList", self.GroupOp)
11953 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11954 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11955 # @param theSubShapes is a list of indices of sub-shapes to be added.
11957 # @ref swig_UnionIDs "Example"
11958 @ManageTransactions("GroupOp")
11959 def UnionIDs(self,theGroup, theSubShapes):
11961 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11964 theGroup is a GEOM group to which the new sub-shapes are added.
11965 theSubShapes is a list of indices of sub-shapes to be added.
11967 # Example: see GEOM_TestOthers.py
11968 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11969 RaiseIfFailed("UnionIDs", self.GroupOp)
11972 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11973 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11974 # @param theSubShapes is a list of sub-shapes to be removed.
11976 # @ref tui_working_with_groups_page "Example"
11977 @ManageTransactions("GroupOp")
11978 def DifferenceList (self,theGroup, theSubShapes):
11980 Removes from the group all the given shapes. No errors, if some shapes are not included.
11983 theGroup is a GEOM group from which the sub-shapes are removed.
11984 theSubShapes is a list of sub-shapes to be removed.
11986 # Example: see GEOM_TestOthers.py
11987 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11988 RaiseIfFailed("DifferenceList", self.GroupOp)
11991 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11992 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11993 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11995 # @ref swig_DifferenceIDs "Example"
11996 @ManageTransactions("GroupOp")
11997 def DifferenceIDs(self,theGroup, theSubShapes):
11999 Removes from the group all the given shapes. No errors, if some shapes are not included.
12002 theGroup is a GEOM group from which the sub-shapes are removed.
12003 theSubShapes is a list of indices of sub-shapes to be removed.
12005 # Example: see GEOM_TestOthers.py
12006 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12007 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12010 ## Union of two groups.
12011 # New group is created. It will contain all entities
12012 # which are present in groups theGroup1 and theGroup2.
12013 # @param theGroup1, theGroup2 are the initial GEOM groups
12014 # to create the united group from.
12015 # @param theName Object name; when specified, this parameter is used
12016 # for result publication in the study. Otherwise, if automatic
12017 # publication is switched on, default value is used for result name.
12019 # @return a newly created GEOM group.
12021 # @ref tui_union_groups_anchor "Example"
12022 @ManageTransactions("GroupOp")
12023 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12025 Union of two groups.
12026 New group is created. It will contain all entities
12027 which are present in groups theGroup1 and theGroup2.
12030 theGroup1, theGroup2 are the initial GEOM groups
12031 to create the united group from.
12032 theName Object name; when specified, this parameter is used
12033 for result publication in the study. Otherwise, if automatic
12034 publication is switched on, default value is used for result name.
12037 a newly created GEOM group.
12039 # Example: see GEOM_TestOthers.py
12040 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12041 RaiseIfFailed("UnionGroups", self.GroupOp)
12042 self._autoPublish(aGroup, theName, "group")
12045 ## Intersection of two groups.
12046 # New group is created. It will contain only those entities
12047 # which are present in both groups theGroup1 and theGroup2.
12048 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12049 # @param theName Object name; when specified, this parameter is used
12050 # for result publication in the study. Otherwise, if automatic
12051 # publication is switched on, default value is used for result name.
12053 # @return a newly created GEOM group.
12055 # @ref tui_intersect_groups_anchor "Example"
12056 @ManageTransactions("GroupOp")
12057 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12059 Intersection of two groups.
12060 New group is created. It will contain only those entities
12061 which are present in both groups theGroup1 and theGroup2.
12064 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12065 theName Object name; when specified, this parameter is used
12066 for result publication in the study. Otherwise, if automatic
12067 publication is switched on, default value is used for result name.
12070 a newly created GEOM group.
12072 # Example: see GEOM_TestOthers.py
12073 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12074 RaiseIfFailed("IntersectGroups", self.GroupOp)
12075 self._autoPublish(aGroup, theName, "group")
12078 ## Cut of two groups.
12079 # New group is created. It will contain entities which are
12080 # present in group theGroup1 but are not present in group theGroup2.
12081 # @param theGroup1 is a GEOM group to include elements of.
12082 # @param theGroup2 is a GEOM group to exclude elements of.
12083 # @param theName Object name; when specified, this parameter is used
12084 # for result publication in the study. Otherwise, if automatic
12085 # publication is switched on, default value is used for result name.
12087 # @return a newly created GEOM group.
12089 # @ref tui_cut_groups_anchor "Example"
12090 @ManageTransactions("GroupOp")
12091 def CutGroups (self, theGroup1, theGroup2, theName=None):
12094 New group is created. It will contain entities which are
12095 present in group theGroup1 but are not present in group theGroup2.
12098 theGroup1 is a GEOM group to include elements of.
12099 theGroup2 is a GEOM group to exclude elements of.
12100 theName Object name; when specified, this parameter is used
12101 for result publication in the study. Otherwise, if automatic
12102 publication is switched on, default value is used for result name.
12105 a newly created GEOM group.
12107 # Example: see GEOM_TestOthers.py
12108 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12109 RaiseIfFailed("CutGroups", self.GroupOp)
12110 self._autoPublish(aGroup, theName, "group")
12113 ## Union of list of groups.
12114 # New group is created. It will contain all entities that are
12115 # present in groups listed in theGList.
12116 # @param theGList is a list of GEOM groups to create the united group from.
12117 # @param theName Object name; when specified, this parameter is used
12118 # for result publication in the study. Otherwise, if automatic
12119 # publication is switched on, default value is used for result name.
12121 # @return a newly created GEOM group.
12123 # @ref tui_union_groups_anchor "Example"
12124 @ManageTransactions("GroupOp")
12125 def UnionListOfGroups (self, theGList, theName=None):
12127 Union of list of groups.
12128 New group is created. It will contain all entities that are
12129 present in groups listed in theGList.
12132 theGList is a list of GEOM groups to create the united group from.
12133 theName Object name; when specified, this parameter is used
12134 for result publication in the study. Otherwise, if automatic
12135 publication is switched on, default value is used for result name.
12138 a newly created GEOM group.
12140 # Example: see GEOM_TestOthers.py
12141 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12142 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12143 self._autoPublish(aGroup, theName, "group")
12146 ## Cut of lists of groups.
12147 # New group is created. It will contain only entities
12148 # which are present in groups listed in theGList.
12149 # @param theGList is a list of GEOM groups to include elements of.
12150 # @param theName Object name; when specified, this parameter is used
12151 # for result publication in the study. Otherwise, if automatic
12152 # publication is switched on, default value is used for result name.
12154 # @return a newly created GEOM group.
12156 # @ref tui_intersect_groups_anchor "Example"
12157 @ManageTransactions("GroupOp")
12158 def IntersectListOfGroups (self, theGList, theName=None):
12160 Cut of lists of groups.
12161 New group is created. It will contain only entities
12162 which are present in groups listed in theGList.
12165 theGList is a list of GEOM groups to include elements of.
12166 theName Object name; when specified, this parameter is used
12167 for result publication in the study. Otherwise, if automatic
12168 publication is switched on, default value is used for result name.
12171 a newly created GEOM group.
12173 # Example: see GEOM_TestOthers.py
12174 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12175 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12176 self._autoPublish(aGroup, theName, "group")
12179 ## Cut of lists of groups.
12180 # New group is created. It will contain only entities
12181 # which are present in groups listed in theGList1 but
12182 # are not present in groups from theGList2.
12183 # @param theGList1 is a list of GEOM groups to include elements of.
12184 # @param theGList2 is a list of GEOM groups to exclude elements of.
12185 # @param theName Object name; when specified, this parameter is used
12186 # for result publication in the study. Otherwise, if automatic
12187 # publication is switched on, default value is used for result name.
12189 # @return a newly created GEOM group.
12191 # @ref tui_cut_groups_anchor "Example"
12192 @ManageTransactions("GroupOp")
12193 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12195 Cut of lists of groups.
12196 New group is created. It will contain only entities
12197 which are present in groups listed in theGList1 but
12198 are not present in groups from theGList2.
12201 theGList1 is a list of GEOM groups to include elements of.
12202 theGList2 is a list of GEOM groups to exclude elements of.
12203 theName Object name; when specified, this parameter is used
12204 for result publication in the study. Otherwise, if automatic
12205 publication is switched on, default value is used for result name.
12208 a newly created GEOM group.
12210 # Example: see GEOM_TestOthers.py
12211 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12212 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12213 self._autoPublish(aGroup, theName, "group")
12216 ## Returns a list of sub-objects ID stored in the group
12217 # @param theGroup is a GEOM group for which a list of IDs is requested
12219 # @ref swig_GetObjectIDs "Example"
12220 @ManageTransactions("GroupOp")
12221 def GetObjectIDs(self,theGroup):
12223 Returns a list of sub-objects ID stored in the group
12226 theGroup is a GEOM group for which a list of IDs is requested
12228 # Example: see GEOM_TestOthers.py
12229 ListIDs = self.GroupOp.GetObjects(theGroup)
12230 RaiseIfFailed("GetObjects", self.GroupOp)
12233 ## Returns a type of sub-objects stored in the group
12234 # @param theGroup is a GEOM group which type is returned.
12236 # @ref swig_GetType "Example"
12237 @ManageTransactions("GroupOp")
12238 def GetType(self,theGroup):
12240 Returns a type of sub-objects stored in the group
12243 theGroup is a GEOM group which type is returned.
12245 # Example: see GEOM_TestOthers.py
12246 aType = self.GroupOp.GetType(theGroup)
12247 RaiseIfFailed("GetType", self.GroupOp)
12250 ## Convert a type of geom object from id to string value
12251 # @param theId is a GEOM obect type id.
12252 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12253 # @ref swig_GetType "Example"
12254 def ShapeIdToType(self, theId):
12256 Convert a type of geom object from id to string value
12259 theId is a GEOM obect type id.
12262 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12289 return "REVOLUTION"
12337 return "FREE_BOUNDS"
12345 return "THRUSECTIONS"
12347 return "COMPOUNDFILTER"
12349 return "SHAPES_ON_SHAPE"
12351 return "ELLIPSE_ARC"
12353 return "3DSKETCHER"
12359 return "PIPETSHAPE"
12360 return "Shape Id not exist."
12362 ## Returns a main shape associated with the group
12363 # @param theGroup is a GEOM group for which a main shape object is requested
12364 # @return a GEOM object which is a main shape for theGroup
12366 # @ref swig_GetMainShape "Example"
12367 @ManageTransactions("GroupOp")
12368 def GetMainShape(self,theGroup):
12370 Returns a main shape associated with the group
12373 theGroup is a GEOM group for which a main shape object is requested
12376 a GEOM object which is a main shape for theGroup
12378 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12380 # Example: see GEOM_TestOthers.py
12381 anObj = self.GroupOp.GetMainShape(theGroup)
12382 RaiseIfFailed("GetMainShape", self.GroupOp)
12385 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12386 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12387 # @param theShape given shape (see GEOM.GEOM_Object)
12388 # @param min_length minimum length of edges of theShape
12389 # @param max_length maximum length of edges of theShape
12390 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12391 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12392 # @param theName Object name; when specified, this parameter is used
12393 # for result publication in the study. Otherwise, if automatic
12394 # publication is switched on, default value is used for result name.
12396 # @return a newly created GEOM group of edges
12398 # @@ref swig_todo "Example"
12399 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12401 Create group of edges of theShape, whose length is in range [min_length, max_length].
12402 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12405 theShape given shape
12406 min_length minimum length of edges of theShape
12407 max_length maximum length of edges of theShape
12408 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12409 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12410 theName Object name; when specified, this parameter is used
12411 for result publication in the study. Otherwise, if automatic
12412 publication is switched on, default value is used for result name.
12415 a newly created GEOM group of edges.
12417 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12418 edges_in_range = []
12420 Props = self.BasicProperties(edge)
12421 if min_length <= Props[0] and Props[0] <= max_length:
12422 if (not include_min) and (min_length == Props[0]):
12425 if (not include_max) and (Props[0] == max_length):
12428 edges_in_range.append(edge)
12430 if len(edges_in_range) <= 0:
12431 print "No edges found by given criteria"
12434 # note: auto-publishing is done in self.CreateGroup()
12435 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12436 self.UnionList(group_edges, edges_in_range)
12440 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12441 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12442 # @param min_length minimum length of edges of selected shape
12443 # @param max_length maximum length of edges of selected shape
12444 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12445 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12446 # @return a newly created GEOM group of edges
12447 # @ref swig_todo "Example"
12448 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12450 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12451 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12454 min_length minimum length of edges of selected shape
12455 max_length maximum length of edges of selected shape
12456 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12457 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12460 a newly created GEOM group of edges.
12462 nb_selected = sg.SelectedCount()
12463 if nb_selected < 1:
12464 print "Select a shape before calling this function, please."
12466 if nb_selected > 1:
12467 print "Only one shape must be selected"
12470 id_shape = sg.getSelected(0)
12471 shape = IDToObject( id_shape )
12473 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12477 if include_min: left_str = " <= "
12478 if include_max: right_str = " <= "
12480 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12481 + left_str + "length" + right_str + `max_length`)
12483 sg.updateObjBrowser(1)
12490 #@@ insert new functions before this line @@ do not remove this line @@#
12492 ## Create a copy of the given object
12494 # @param theOriginal geometry object for copy
12495 # @param theName Object name; when specified, this parameter is used
12496 # for result publication in the study. Otherwise, if automatic
12497 # publication is switched on, default value is used for result name.
12499 # @return New GEOM_Object, containing the copied shape.
12501 # @ingroup l1_geomBuilder_auxiliary
12502 # @ref swig_MakeCopy "Example"
12503 @ManageTransactions("InsertOp")
12504 def MakeCopy(self, theOriginal, theName=None):
12506 Create a copy of the given object
12509 theOriginal geometry object for copy
12510 theName Object name; when specified, this parameter is used
12511 for result publication in the study. Otherwise, if automatic
12512 publication is switched on, default value is used for result name.
12515 New GEOM_Object, containing the copied shape.
12517 Example of usage: Copy = geompy.MakeCopy(Box)
12519 # Example: see GEOM_TestAll.py
12520 anObj = self.InsertOp.MakeCopy(theOriginal)
12521 RaiseIfFailed("MakeCopy", self.InsertOp)
12522 self._autoPublish(anObj, theName, "copy")
12525 ## Add Path to load python scripts from
12526 # @param Path a path to load python scripts from
12527 # @ingroup l1_geomBuilder_auxiliary
12528 def addPath(self,Path):
12530 Add Path to load python scripts from
12533 Path a path to load python scripts from
12535 if (sys.path.count(Path) < 1):
12536 sys.path.append(Path)
12540 ## Load marker texture from the file
12541 # @param Path a path to the texture file
12542 # @return unique texture identifier
12543 # @ingroup l1_geomBuilder_auxiliary
12544 @ManageTransactions("InsertOp")
12545 def LoadTexture(self, Path):
12547 Load marker texture from the file
12550 Path a path to the texture file
12553 unique texture identifier
12555 # Example: see GEOM_TestAll.py
12556 ID = self.InsertOp.LoadTexture(Path)
12557 RaiseIfFailed("LoadTexture", self.InsertOp)
12560 ## Get internal name of the object based on its study entry
12561 # @note This method does not provide an unique identifier of the geometry object.
12562 # @note This is internal function of GEOM component, though it can be used outside it for
12563 # appropriate reason (e.g. for identification of geometry object).
12564 # @param obj geometry object
12565 # @return unique object identifier
12566 # @ingroup l1_geomBuilder_auxiliary
12567 def getObjectID(self, obj):
12569 Get internal name of the object based on its study entry.
12570 Note: this method does not provide an unique identifier of the geometry object.
12571 It is an internal function of GEOM component, though it can be used outside GEOM for
12572 appropriate reason (e.g. for identification of geometry object).
12575 obj geometry object
12578 unique object identifier
12581 entry = salome.ObjectToID(obj)
12582 if entry is not None:
12583 lst = entry.split(":")
12585 ID = lst[-1] # -1 means last item in the list
12586 return "GEOM_" + ID
12591 ## Add marker texture. @a Width and @a Height parameters
12592 # specify width and height of the texture in pixels.
12593 # If @a RowData is @c True, @a Texture parameter should represent texture data
12594 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12595 # parameter should be unpacked string, in which '1' symbols represent opaque
12596 # pixels and '0' represent transparent pixels of the texture bitmap.
12598 # @param Width texture width in pixels
12599 # @param Height texture height in pixels
12600 # @param Texture texture data
12601 # @param RowData if @c True, @a Texture data are packed in the byte stream
12602 # @return unique texture identifier
12603 # @ingroup l1_geomBuilder_auxiliary
12604 @ManageTransactions("InsertOp")
12605 def AddTexture(self, Width, Height, Texture, RowData=False):
12607 Add marker texture. Width and Height parameters
12608 specify width and height of the texture in pixels.
12609 If RowData is True, Texture parameter should represent texture data
12610 packed into the byte array. If RowData is False (default), Texture
12611 parameter should be unpacked string, in which '1' symbols represent opaque
12612 pixels and '0' represent transparent pixels of the texture bitmap.
12615 Width texture width in pixels
12616 Height texture height in pixels
12617 Texture texture data
12618 RowData if True, Texture data are packed in the byte stream
12621 return unique texture identifier
12623 if not RowData: Texture = PackData(Texture)
12624 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12625 RaiseIfFailed("AddTexture", self.InsertOp)
12628 ## Creates a new folder object. It is a container for any GEOM objects.
12629 # @param Name name of the container
12630 # @param Father parent object. If None,
12631 # folder under 'Geometry' root object will be created.
12632 # @return a new created folder
12633 # @ingroup l1_publish_data
12634 def NewFolder(self, Name, Father=None):
12636 Create a new folder object. It is an auxiliary container for any GEOM objects.
12639 Name name of the container
12640 Father parent object. If None,
12641 folder under 'Geometry' root object will be created.
12644 a new created folder
12646 if not Father: Father = self.father
12647 return self.CreateFolder(Name, Father)
12649 ## Move object to the specified folder
12650 # @param Object object to move
12651 # @param Folder target folder
12652 # @ingroup l1_publish_data
12653 def PutToFolder(self, Object, Folder):
12655 Move object to the specified folder
12658 Object object to move
12659 Folder target folder
12661 self.MoveToFolder(Object, Folder)
12664 ## Move list of objects to the specified folder
12665 # @param ListOfSO list of objects to move
12666 # @param Folder target folder
12667 # @ingroup l1_publish_data
12668 def PutListToFolder(self, ListOfSO, Folder):
12670 Move list of objects to the specified folder
12673 ListOfSO list of objects to move
12674 Folder target folder
12676 self.MoveListToFolder(ListOfSO, Folder)
12679 ## @addtogroup l2_field
12683 # @param shape the shape the field lies on
12684 # @param name the field name
12685 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12686 # @param dimension dimension of the shape the field lies on
12687 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12688 # @param componentNames names of components
12689 # @return a created field
12690 @ManageTransactions("FieldOp")
12691 def CreateField(self, shape, name, type, dimension, componentNames):
12696 shape the shape the field lies on
12697 name the field name
12698 type type of field data
12699 dimension dimension of the shape the field lies on
12700 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12701 componentNames names of components
12706 if isinstance( type, int ):
12707 if type < 0 or type > 3:
12708 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12709 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12711 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12712 RaiseIfFailed("CreateField", self.FieldOp)
12714 geom._autoPublish( f, "", name)
12717 ## Removes a field from the GEOM component
12718 # @param field the field to remove
12719 def RemoveField(self, field):
12720 "Removes a field from the GEOM component"
12722 if isinstance( field, GEOM._objref_GEOM_Field ):
12723 geom.RemoveObject( field )
12724 elif isinstance( field, geomField ):
12725 geom.RemoveObject( field.field )
12727 raise RuntimeError, "RemoveField() : the object is not a field"
12730 ## Returns number of fields on a shape
12731 @ManageTransactions("FieldOp")
12732 def CountFields(self, shape):
12733 "Returns number of fields on a shape"
12734 nb = self.FieldOp.CountFields( shape )
12735 RaiseIfFailed("CountFields", self.FieldOp)
12738 ## Returns all fields on a shape
12739 @ManageTransactions("FieldOp")
12740 def GetFields(self, shape):
12741 "Returns all fields on a shape"
12742 ff = self.FieldOp.GetFields( shape )
12743 RaiseIfFailed("GetFields", self.FieldOp)
12746 ## Returns a field on a shape by its name
12747 @ManageTransactions("FieldOp")
12748 def GetField(self, shape, name):
12749 "Returns a field on a shape by its name"
12750 f = self.FieldOp.GetField( shape, name )
12751 RaiseIfFailed("GetField", self.FieldOp)
12759 # Register the new proxy for GEOM_Gen
12760 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12763 ## Field on Geometry
12764 # @ingroup l2_field
12765 class geomField( GEOM._objref_GEOM_Field ):
12767 def __init__(self):
12768 GEOM._objref_GEOM_Field.__init__(self)
12769 self.field = GEOM._objref_GEOM_Field
12772 ## Returns the shape the field lies on
12773 def getShape(self):
12774 "Returns the shape the field lies on"
12775 return self.field.GetShape(self)
12777 ## Returns the field name
12779 "Returns the field name"
12780 return self.field.GetName(self)
12782 ## Returns type of field data as integer [0-3]
12784 "Returns type of field data"
12785 return self.field.GetDataType(self)._v
12787 ## Returns type of field data:
12788 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12789 def getTypeEnum(self):
12790 "Returns type of field data"
12791 return self.field.GetDataType(self)
12793 ## Returns dimension of the shape the field lies on:
12794 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12795 def getDimension(self):
12796 """Returns dimension of the shape the field lies on:
12797 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12798 return self.field.GetDimension(self)
12800 ## Returns names of components
12801 def getComponents(self):
12802 "Returns names of components"
12803 return self.field.GetComponents(self)
12805 ## Adds a time step to the field
12806 # @param step the time step number further used as the step identifier
12807 # @param stamp the time step time
12808 # @param values the values of the time step
12809 def addStep(self, step, stamp, values):
12810 "Adds a time step to the field"
12811 stp = self.field.AddStep( self, step, stamp )
12813 raise RuntimeError, \
12814 "Field.addStep() : Error: step %s already exists in this field"%step
12816 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12817 self.setValues( step, values )
12820 ## Remove a time step from the field
12821 def removeStep(self,step):
12822 "Remove a time step from the field"
12825 stepObj = self.field.GetStep( self, step )
12827 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12830 #traceback.print_exc()
12832 self.field.RemoveStep( self, step )
12834 geom.myBuilder.RemoveObjectWithChildren( stepSO )
12837 ## Returns number of time steps in the field
12838 def countSteps(self):
12839 "Returns number of time steps in the field"
12840 return self.field.CountSteps(self)
12842 ## Returns a list of time step IDs in the field
12843 def getSteps(self):
12844 "Returns a list of time step IDs in the field"
12845 return self.field.GetSteps(self)
12847 ## Returns a time step by its ID
12848 def getStep(self,step):
12849 "Returns a time step by its ID"
12850 stp = self.field.GetStep(self, step)
12852 raise RuntimeError, "Step %s is missing from this field"%step
12855 ## Returns the time of the field step
12856 def getStamp(self,step):
12857 "Returns the time of the field step"
12858 return self.getStep(step).GetStamp()
12860 ## Changes the time of the field step
12861 def setStamp(self, step, stamp):
12862 "Changes the time of the field step"
12863 return self.getStep(step).SetStamp(stamp)
12865 ## Returns values of the field step
12866 def getValues(self, step):
12867 "Returns values of the field step"
12868 return self.getStep(step).GetValues()
12870 ## Changes values of the field step
12871 def setValues(self, step, values):
12872 "Changes values of the field step"
12873 stp = self.getStep(step)
12874 errBeg = "Field.setValues(values) : Error: "
12876 ok = stp.SetValues( values )
12877 except Exception, e:
12879 if excStr.find("WrongPythonType") > 0:
12880 raise RuntimeError, errBeg +\
12881 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12882 raise RuntimeError, errBeg + str(e)
12884 nbOK = self.field.GetArraySize(self)
12887 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12889 raise RuntimeError, errBeg + "failed"
12892 pass # end of class geomField
12894 # Register the new proxy for GEOM_Field
12895 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12898 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12899 # interface to GEOM operations.
12904 # salome.salome_init()
12905 # from salome.geom import geomBuilder
12906 # geompy = geomBuilder.New(salome.myStudy)
12908 # @param study SALOME study, generally obtained by salome.myStudy.
12909 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12910 # @return geomBuilder instance
12911 def New( study, instance=None):
12913 Create a new geomBuilder instance.The geomBuilder class provides the Python
12914 interface to GEOM operations.
12918 salome.salome_init()
12919 from salome.geom import geomBuilder
12920 geompy = geomBuilder.New(salome.myStudy)
12923 study SALOME study, generally obtained by salome.myStudy.
12924 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12926 geomBuilder instance
12928 #print "New geomBuilder ", study, instance
12935 geom = geomBuilder()
12936 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12937 geom.init_geom(study)
12941 # Register methods from the plug-ins in the geomBuilder class
12942 plugins_var = os.environ.get( "GEOM_PluginsList" )
12945 if plugins_var is not None:
12946 plugins = plugins_var.split( ":" )
12947 plugins=filter(lambda x: len(x)>0, plugins)
12948 if plugins is not None:
12949 for pluginName in plugins:
12950 pluginBuilderName = pluginName + "Builder"
12952 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12953 except Exception, e:
12954 from salome_utils import verbose
12955 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12957 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12958 plugin = eval( pluginBuilderName )
12960 # add methods from plugin module to the geomBuilder class
12961 for k in dir( plugin ):
12962 if k[0] == '_': continue
12963 method = getattr( plugin, k )
12964 if type( method ).__name__ == 'function':
12965 if not hasattr( geomBuilder, k ):
12966 setattr( geomBuilder, k, method )