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
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 # end of l3_sketcher
2673 ## @addtogroup l3_3d_primitives
2676 ## Create a box by coordinates of two opposite vertices.
2678 # @param x1,y1,z1 double values, defining first point it.
2679 # @param x2,y2,z2 double values, defining first point it.
2680 # @param theName Object name; when specified, this parameter is used
2681 # for result publication in the study. Otherwise, if automatic
2682 # publication is switched on, default value is used for result name.
2684 # @return New GEOM.GEOM_Object, containing the created box.
2686 # @ref tui_creation_box "Example"
2687 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2689 Create a box by coordinates of two opposite vertices.
2692 x1,y1,z1 double values, defining first point.
2693 x2,y2,z2 double values, defining second point.
2694 theName Object name; when specified, this parameter is used
2695 for result publication in the study. Otherwise, if automatic
2696 publication is switched on, default value is used for result name.
2699 New GEOM.GEOM_Object, containing the created box.
2701 # Example: see GEOM_TestAll.py
2702 pnt1 = self.MakeVertex(x1,y1,z1)
2703 pnt2 = self.MakeVertex(x2,y2,z2)
2704 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2705 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2707 ## Create a box with specified dimensions along the coordinate axes
2708 # and with edges, parallel to the coordinate axes.
2709 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2710 # @param theDX Length of Box edges, parallel to OX axis.
2711 # @param theDY Length of Box edges, parallel to OY axis.
2712 # @param theDZ Length of Box edges, parallel to OZ axis.
2713 # @param 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.
2717 # @return New GEOM.GEOM_Object, containing the created box.
2719 # @ref tui_creation_box "Example"
2720 @ManageTransactions("PrimOp")
2721 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2723 Create a box with specified dimensions along the coordinate axes
2724 and with edges, parallel to the coordinate axes.
2725 Center of the box will be at point (DX/2, DY/2, DZ/2).
2728 theDX Length of Box edges, parallel to OX axis.
2729 theDY Length of Box edges, parallel to OY axis.
2730 theDZ Length of Box edges, parallel to OZ axis.
2731 theName Object name; when specified, this parameter is used
2732 for result publication in the study. Otherwise, if automatic
2733 publication is switched on, default value is used for result name.
2736 New GEOM.GEOM_Object, containing the created box.
2738 # Example: see GEOM_TestAll.py
2739 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2740 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2741 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2742 anObj.SetParameters(Parameters)
2743 self._autoPublish(anObj, theName, "box")
2746 ## Create a box with two specified opposite vertices,
2747 # and with edges, parallel to the coordinate axes
2748 # @param thePnt1 First of two opposite vertices.
2749 # @param thePnt2 Second of two opposite vertices.
2750 # @param 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.
2754 # @return New GEOM.GEOM_Object, containing the created box.
2756 # @ref tui_creation_box "Example"
2757 @ManageTransactions("PrimOp")
2758 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2760 Create a box with two specified opposite vertices,
2761 and with edges, parallel to the coordinate axes
2764 thePnt1 First of two opposite vertices.
2765 thePnt2 Second of two opposite vertices.
2766 theName Object name; when specified, this parameter is used
2767 for result publication in the study. Otherwise, if automatic
2768 publication is switched on, default value is used for result name.
2771 New GEOM.GEOM_Object, containing the created box.
2773 # Example: see GEOM_TestAll.py
2774 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2775 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2776 self._autoPublish(anObj, theName, "box")
2779 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2780 # @param theH height of Face.
2781 # @param theW width of Face.
2782 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2783 # @param theName Object name; when specified, this parameter is used
2784 # for result publication in the study. Otherwise, if automatic
2785 # publication is switched on, default value is used for result name.
2787 # @return New GEOM.GEOM_Object, containing the created face.
2789 # @ref tui_creation_face "Example"
2790 @ManageTransactions("PrimOp")
2791 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2793 Create a face with specified dimensions with edges parallel to coordinate axes.
2796 theH height of Face.
2798 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2799 theName Object name; when specified, this parameter is used
2800 for result publication in the study. Otherwise, if automatic
2801 publication is switched on, default value is used for result name.
2804 New GEOM.GEOM_Object, containing the created face.
2806 # Example: see GEOM_TestAll.py
2807 theH,theW,Parameters = ParseParameters(theH, theW)
2808 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2809 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2810 anObj.SetParameters(Parameters)
2811 self._autoPublish(anObj, theName, "rectangle")
2814 ## Create a face from another plane and two sizes,
2815 # vertical size and horisontal size.
2816 # @param theObj Normale vector to the creating face or
2818 # @param theH Height (vertical size).
2819 # @param theW Width (horisontal size).
2820 # @param theName Object name; when specified, this parameter is used
2821 # for result publication in the study. Otherwise, if automatic
2822 # publication is switched on, default value is used for result name.
2824 # @return New GEOM.GEOM_Object, containing the created face.
2826 # @ref tui_creation_face "Example"
2827 @ManageTransactions("PrimOp")
2828 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2830 Create a face from another plane and two sizes,
2831 vertical size and horisontal size.
2834 theObj Normale vector to the creating face or
2836 theH Height (vertical size).
2837 theW Width (horisontal size).
2838 theName Object name; when specified, this parameter is used
2839 for result publication in the study. Otherwise, if automatic
2840 publication is switched on, default value is used for result name.
2843 New GEOM_Object, containing the created face.
2845 # Example: see GEOM_TestAll.py
2846 theH,theW,Parameters = ParseParameters(theH, theW)
2847 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2848 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2849 anObj.SetParameters(Parameters)
2850 self._autoPublish(anObj, theName, "rectangle")
2853 ## Create a disk with given center, normal vector and radius.
2854 # @param thePnt Disk center.
2855 # @param theVec Vector, normal to the plane of the disk.
2856 # @param theR Disk radius.
2857 # @param 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.
2861 # @return New GEOM.GEOM_Object, containing the created disk.
2863 # @ref tui_creation_disk "Example"
2864 @ManageTransactions("PrimOp")
2865 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2867 Create a disk with given center, normal vector and radius.
2871 theVec Vector, normal to the plane of the disk.
2873 theName Object name; when specified, this parameter is used
2874 for result publication in the study. Otherwise, if automatic
2875 publication is switched on, default value is used for result name.
2878 New GEOM.GEOM_Object, containing the created disk.
2880 # Example: see GEOM_TestAll.py
2881 theR,Parameters = ParseParameters(theR)
2882 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2883 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2884 anObj.SetParameters(Parameters)
2885 self._autoPublish(anObj, theName, "disk")
2888 ## Create a disk, passing through three given points
2889 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2890 # @param theName Object name; when specified, this parameter is used
2891 # for result publication in the study. Otherwise, if automatic
2892 # publication is switched on, default value is used for result name.
2894 # @return New GEOM.GEOM_Object, containing the created disk.
2896 # @ref tui_creation_disk "Example"
2897 @ManageTransactions("PrimOp")
2898 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2900 Create a disk, passing through three given points
2903 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2904 theName Object name; when specified, this parameter is used
2905 for result publication in the study. Otherwise, if automatic
2906 publication is switched on, default value is used for result name.
2909 New GEOM.GEOM_Object, containing the created disk.
2911 # Example: see GEOM_TestAll.py
2912 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2913 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2914 self._autoPublish(anObj, theName, "disk")
2917 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2918 # @param theR Radius of Face.
2919 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2920 # @param theName Object name; when specified, this parameter is used
2921 # for result publication in the study. Otherwise, if automatic
2922 # publication is switched on, default value is used for result name.
2924 # @return New GEOM.GEOM_Object, containing the created disk.
2926 # @ref tui_creation_face "Example"
2927 @ManageTransactions("PrimOp")
2928 def MakeDiskR(self, theR, theOrientation, theName=None):
2930 Create a disk with specified dimensions along OX-OY coordinate axes.
2933 theR Radius of Face.
2934 theOrientation set the orientation belong axis OXY or OYZ or OZX
2935 theName Object name; when specified, this parameter is used
2936 for result publication in the study. Otherwise, if automatic
2937 publication is switched on, default value is used for result name.
2940 New GEOM.GEOM_Object, containing the created disk.
2943 Disk3 = geompy.MakeDiskR(100., 1)
2945 # Example: see GEOM_TestAll.py
2946 theR,Parameters = ParseParameters(theR)
2947 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2948 RaiseIfFailed("MakeDiskR", self.PrimOp)
2949 anObj.SetParameters(Parameters)
2950 self._autoPublish(anObj, theName, "disk")
2953 ## Create a cylinder with given base point, axis, radius and height.
2954 # @param thePnt Central point of cylinder base.
2955 # @param theAxis Cylinder axis.
2956 # @param theR Cylinder radius.
2957 # @param theH Cylinder height.
2958 # @param theName Object name; when specified, this parameter is used
2959 # for result publication in the study. Otherwise, if automatic
2960 # publication is switched on, default value is used for result name.
2962 # @return New GEOM.GEOM_Object, containing the created cylinder.
2964 # @ref tui_creation_cylinder "Example"
2965 @ManageTransactions("PrimOp")
2966 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2968 Create a cylinder with given base point, axis, radius and height.
2971 thePnt Central point of cylinder base.
2972 theAxis Cylinder axis.
2973 theR Cylinder radius.
2974 theH Cylinder height.
2975 theName Object name; when specified, this parameter is used
2976 for result publication in the study. Otherwise, if automatic
2977 publication is switched on, default value is used for result name.
2980 New GEOM.GEOM_Object, containing the created cylinder.
2982 # Example: see GEOM_TestAll.py
2983 theR,theH,Parameters = ParseParameters(theR, theH)
2984 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2985 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2986 anObj.SetParameters(Parameters)
2987 self._autoPublish(anObj, theName, "cylinder")
2990 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
2991 # @param thePnt Central point of cylinder base.
2992 # @param theAxis Cylinder axis.
2993 # @param theR Cylinder radius.
2994 # @param theH Cylinder height.
2995 # @param theA Cylinder angle in radians.
2996 # @param theName Object name; when specified, this parameter is used
2997 # for result publication in the study. Otherwise, if automatic
2998 # publication is switched on, default value is used for result name.
3000 # @return New GEOM.GEOM_Object, containing the created cylinder.
3002 # @ref tui_creation_cylinder "Example"
3003 @ManageTransactions("PrimOp")
3004 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3006 Create a a portion of cylinder with given base point, axis, radius, height and angle.
3009 thePnt Central point of cylinder base.
3010 theAxis Cylinder axis.
3011 theR Cylinder radius.
3012 theH Cylinder height.
3013 theA Cylinder angle in radians.
3014 theName Object name; when specified, this parameter is used
3015 for result publication in the study. Otherwise, if automatic
3016 publication is switched on, default value is used for result name.
3019 New GEOM.GEOM_Object, containing the created cylinder.
3021 # Example: see GEOM_TestAll.py
3023 if isinstance(theA,str):
3025 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3027 theA = theA*math.pi/180.
3028 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3029 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3030 anObj.SetParameters(Parameters)
3031 self._autoPublish(anObj, theName, "cylinder")
3034 ## Create a cylinder with given radius and height at
3035 # the origin of coordinate system. Axis of the cylinder
3036 # will be collinear to the OZ axis of the coordinate system.
3037 # @param theR Cylinder radius.
3038 # @param theH Cylinder height.
3039 # @param theName Object name; when specified, this parameter is used
3040 # for result publication in the study. Otherwise, if automatic
3041 # publication is switched on, default value is used for result name.
3043 # @return New GEOM.GEOM_Object, containing the created cylinder.
3045 # @ref tui_creation_cylinder "Example"
3046 @ManageTransactions("PrimOp")
3047 def MakeCylinderRH(self, theR, theH, theName=None):
3049 Create a cylinder with given radius and height at
3050 the origin of coordinate system. Axis of the cylinder
3051 will be collinear to the OZ axis of the coordinate system.
3054 theR Cylinder radius.
3055 theH Cylinder height.
3056 theName Object name; when specified, this parameter is used
3057 for result publication in the study. Otherwise, if automatic
3058 publication is switched on, default value is used for result name.
3061 New GEOM.GEOM_Object, containing the created cylinder.
3063 # Example: see GEOM_TestAll.py
3064 theR,theH,Parameters = ParseParameters(theR, theH)
3065 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3066 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3067 anObj.SetParameters(Parameters)
3068 self._autoPublish(anObj, theName, "cylinder")
3071 ## Create a portion of cylinder with given radius, height and angle at
3072 # the origin of coordinate system. Axis of the cylinder
3073 # will be collinear to the OZ axis of the coordinate system.
3074 # @param theR Cylinder radius.
3075 # @param theH Cylinder height.
3076 # @param theA Cylinder angle in radians.
3077 # @param theName Object name; when specified, this parameter is used
3078 # for result publication in the study. Otherwise, if automatic
3079 # publication is switched on, default value is used for result name.
3081 # @return New GEOM.GEOM_Object, containing the created cylinder.
3083 # @ref tui_creation_cylinder "Example"
3084 @ManageTransactions("PrimOp")
3085 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3087 Create a portion of cylinder with given radius, height and angle at
3088 the origin of coordinate system. Axis of the cylinder
3089 will be collinear to the OZ axis of the coordinate system.
3092 theR Cylinder radius.
3093 theH Cylinder height.
3094 theA Cylinder angle in radians.
3095 theName Object name; when specified, this parameter is used
3096 for result publication in the study. Otherwise, if automatic
3097 publication is switched on, default value is used for result name.
3100 New GEOM.GEOM_Object, containing the created cylinder.
3102 # Example: see GEOM_TestAll.py
3104 if isinstance(theA,str):
3106 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3108 theA = theA*math.pi/180.
3109 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3110 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3111 anObj.SetParameters(Parameters)
3112 self._autoPublish(anObj, theName, "cylinder")
3115 ## Create a sphere with given center and radius.
3116 # @param thePnt Sphere center.
3117 # @param theR Sphere radius.
3118 # @param theName Object name; when specified, this parameter is used
3119 # for result publication in the study. Otherwise, if automatic
3120 # publication is switched on, default value is used for result name.
3122 # @return New GEOM.GEOM_Object, containing the created sphere.
3124 # @ref tui_creation_sphere "Example"
3125 @ManageTransactions("PrimOp")
3126 def MakeSpherePntR(self, thePnt, theR, theName=None):
3128 Create a sphere with given center and radius.
3131 thePnt Sphere center.
3133 theName Object name; when specified, this parameter is used
3134 for result publication in the study. Otherwise, if automatic
3135 publication is switched on, default value is used for result name.
3138 New GEOM.GEOM_Object, containing the created sphere.
3140 # Example: see GEOM_TestAll.py
3141 theR,Parameters = ParseParameters(theR)
3142 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3143 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3144 anObj.SetParameters(Parameters)
3145 self._autoPublish(anObj, theName, "sphere")
3148 ## Create a sphere with given center and radius.
3149 # @param x,y,z Coordinates of sphere center.
3150 # @param theR Sphere radius.
3151 # @param theName Object name; when specified, this parameter is used
3152 # for result publication in the study. Otherwise, if automatic
3153 # publication is switched on, default value is used for result name.
3155 # @return New GEOM.GEOM_Object, containing the created sphere.
3157 # @ref tui_creation_sphere "Example"
3158 def MakeSphere(self, x, y, z, theR, theName=None):
3160 Create a sphere with given center and radius.
3163 x,y,z Coordinates of sphere center.
3165 theName Object name; when specified, this parameter is used
3166 for result publication in the study. Otherwise, if automatic
3167 publication is switched on, default value is used for result name.
3170 New GEOM.GEOM_Object, containing the created sphere.
3172 # Example: see GEOM_TestAll.py
3173 point = self.MakeVertex(x, y, z)
3174 # note: auto-publishing is done in self.MakeSpherePntR()
3175 anObj = self.MakeSpherePntR(point, theR, theName)
3178 ## Create a sphere with given radius at the origin of coordinate system.
3179 # @param theR Sphere radius.
3180 # @param theName Object name; when specified, this parameter is used
3181 # for result publication in the study. Otherwise, if automatic
3182 # publication is switched on, default value is used for result name.
3184 # @return New GEOM.GEOM_Object, containing the created sphere.
3186 # @ref tui_creation_sphere "Example"
3187 @ManageTransactions("PrimOp")
3188 def MakeSphereR(self, theR, theName=None):
3190 Create a sphere with given radius at the origin of coordinate system.
3194 theName Object name; when specified, this parameter is used
3195 for result publication in the study. Otherwise, if automatic
3196 publication is switched on, default value is used for result name.
3199 New GEOM.GEOM_Object, containing the created sphere.
3201 # Example: see GEOM_TestAll.py
3202 theR,Parameters = ParseParameters(theR)
3203 anObj = self.PrimOp.MakeSphereR(theR)
3204 RaiseIfFailed("MakeSphereR", self.PrimOp)
3205 anObj.SetParameters(Parameters)
3206 self._autoPublish(anObj, theName, "sphere")
3209 ## Create a cone with given base point, axis, height and radiuses.
3210 # @param thePnt Central point of the first cone base.
3211 # @param theAxis Cone axis.
3212 # @param theR1 Radius of the first cone base.
3213 # @param theR2 Radius of the second cone base.
3214 # \note If both radiuses are non-zero, the cone will be truncated.
3215 # \note If the radiuses are equal, a cylinder will be created instead.
3216 # @param theH Cone height.
3217 # @param theName Object name; when specified, this parameter is used
3218 # for result publication in the study. Otherwise, if automatic
3219 # publication is switched on, default value is used for result name.
3221 # @return New GEOM.GEOM_Object, containing the created cone.
3223 # @ref tui_creation_cone "Example"
3224 @ManageTransactions("PrimOp")
3225 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3227 Create a cone with given base point, axis, height and radiuses.
3230 thePnt Central point of the first cone base.
3232 theR1 Radius of the first cone base.
3233 theR2 Radius of the second cone base.
3235 theName Object name; when specified, this parameter is used
3236 for result publication in the study. Otherwise, if automatic
3237 publication is switched on, default value is used for result name.
3240 If both radiuses are non-zero, the cone will be truncated.
3241 If the radiuses are equal, a cylinder will be created instead.
3244 New GEOM.GEOM_Object, containing the created cone.
3246 # Example: see GEOM_TestAll.py
3247 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3248 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3249 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3250 anObj.SetParameters(Parameters)
3251 self._autoPublish(anObj, theName, "cone")
3254 ## Create a cone with given height and radiuses at
3255 # the origin of coordinate system. Axis of the cone will
3256 # be collinear to the OZ axis of the coordinate system.
3257 # @param theR1 Radius of the first cone base.
3258 # @param theR2 Radius of the second cone base.
3259 # \note If both radiuses are non-zero, the cone will be truncated.
3260 # \note If the radiuses are equal, a cylinder will be created instead.
3261 # @param theH Cone height.
3262 # @param theName Object name; when specified, this parameter is used
3263 # for result publication in the study. Otherwise, if automatic
3264 # publication is switched on, default value is used for result name.
3266 # @return New GEOM.GEOM_Object, containing the created cone.
3268 # @ref tui_creation_cone "Example"
3269 @ManageTransactions("PrimOp")
3270 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3272 Create a cone with given height and radiuses at
3273 the origin of coordinate system. Axis of the cone will
3274 be collinear to the OZ axis of the coordinate system.
3277 theR1 Radius of the first cone base.
3278 theR2 Radius of the second cone base.
3280 theName Object name; when specified, this parameter is used
3281 for result publication in the study. Otherwise, if automatic
3282 publication is switched on, default value is used for result name.
3285 If both radiuses are non-zero, the cone will be truncated.
3286 If the radiuses are equal, a cylinder will be created instead.
3289 New GEOM.GEOM_Object, containing the created cone.
3291 # Example: see GEOM_TestAll.py
3292 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3293 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3294 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3295 anObj.SetParameters(Parameters)
3296 self._autoPublish(anObj, theName, "cone")
3299 ## Create a torus with given center, normal vector and radiuses.
3300 # @param thePnt Torus central point.
3301 # @param theVec Torus axis of symmetry.
3302 # @param theRMajor Torus major radius.
3303 # @param theRMinor Torus minor radius.
3304 # @param theName Object name; when specified, this parameter is used
3305 # for result publication in the study. Otherwise, if automatic
3306 # publication is switched on, default value is used for result name.
3308 # @return New GEOM.GEOM_Object, containing the created torus.
3310 # @ref tui_creation_torus "Example"
3311 @ManageTransactions("PrimOp")
3312 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3314 Create a torus with given center, normal vector and radiuses.
3317 thePnt Torus central point.
3318 theVec Torus axis of symmetry.
3319 theRMajor Torus major radius.
3320 theRMinor Torus minor radius.
3321 theName Object name; when specified, this parameter is used
3322 for result publication in the study. Otherwise, if automatic
3323 publication is switched on, default value is used for result name.
3326 New GEOM.GEOM_Object, containing the created torus.
3328 # Example: see GEOM_TestAll.py
3329 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3330 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3331 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3332 anObj.SetParameters(Parameters)
3333 self._autoPublish(anObj, theName, "torus")
3336 ## Create a torus with given radiuses at the origin of coordinate system.
3337 # @param theRMajor Torus major radius.
3338 # @param theRMinor Torus minor radius.
3339 # @param theName Object name; when specified, this parameter is used
3340 # for result publication in the study. Otherwise, if automatic
3341 # publication is switched on, default value is used for result name.
3343 # @return New GEOM.GEOM_Object, containing the created torus.
3345 # @ref tui_creation_torus "Example"
3346 @ManageTransactions("PrimOp")
3347 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3349 Create a torus with given radiuses at the origin of coordinate system.
3352 theRMajor Torus major radius.
3353 theRMinor Torus minor radius.
3354 theName Object name; when specified, this parameter is used
3355 for result publication in the study. Otherwise, if automatic
3356 publication is switched on, default value is used for result name.
3359 New GEOM.GEOM_Object, containing the created torus.
3361 # Example: see GEOM_TestAll.py
3362 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3363 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3364 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3365 anObj.SetParameters(Parameters)
3366 self._autoPublish(anObj, theName, "torus")
3369 # end of l3_3d_primitives
3372 ## @addtogroup l3_complex
3375 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3376 # @param theBase Base shape to be extruded.
3377 # @param thePoint1 First end of extrusion vector.
3378 # @param thePoint2 Second end of extrusion vector.
3379 # @param theScaleFactor Use it to make prism with scaled second base.
3380 # Nagative value means not scaled second base.
3381 # @param theName Object name; when specified, this parameter is used
3382 # for result publication in the study. Otherwise, if automatic
3383 # publication is switched on, default value is used for result name.
3385 # @return New GEOM.GEOM_Object, containing the created prism.
3387 # @ref tui_creation_prism "Example"
3388 @ManageTransactions("PrimOp")
3389 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3391 Create a shape by extrusion of the base shape along a vector, defined by two points.
3394 theBase Base shape to be extruded.
3395 thePoint1 First end of extrusion vector.
3396 thePoint2 Second end of extrusion vector.
3397 theScaleFactor Use it to make prism with scaled second base.
3398 Nagative value means not scaled second base.
3399 theName Object name; when specified, this parameter is used
3400 for result publication in the study. Otherwise, if automatic
3401 publication is switched on, default value is used for result name.
3404 New GEOM.GEOM_Object, containing the created prism.
3406 # Example: see GEOM_TestAll.py
3409 if theScaleFactor > 0:
3410 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3411 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3413 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3414 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3415 anObj.SetParameters(Parameters)
3416 self._autoPublish(anObj, theName, "prism")
3419 ## Create a shape by extrusion of the base shape along a
3420 # vector, defined by two points, in 2 Ways (forward/backward).
3421 # @param theBase Base shape to be extruded.
3422 # @param thePoint1 First end of extrusion vector.
3423 # @param thePoint2 Second end of extrusion vector.
3424 # @param theName Object name; when specified, this parameter is used
3425 # for result publication in the study. Otherwise, if automatic
3426 # publication is switched on, default value is used for result name.
3428 # @return New GEOM.GEOM_Object, containing the created prism.
3430 # @ref tui_creation_prism "Example"
3431 @ManageTransactions("PrimOp")
3432 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3434 Create a shape by extrusion of the base shape along a
3435 vector, defined by two points, in 2 Ways (forward/backward).
3438 theBase Base shape to be extruded.
3439 thePoint1 First end of extrusion vector.
3440 thePoint2 Second end of extrusion vector.
3441 theName Object name; when specified, this parameter is used
3442 for result publication in the study. Otherwise, if automatic
3443 publication is switched on, default value is used for result name.
3446 New GEOM.GEOM_Object, containing the created prism.
3448 # Example: see GEOM_TestAll.py
3449 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3450 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3451 self._autoPublish(anObj, theName, "prism")
3454 ## Create a shape by extrusion of the base shape along the vector,
3455 # i.e. all the space, transfixed by the base shape during its translation
3456 # along the vector on the given distance.
3457 # @param theBase Base shape to be extruded.
3458 # @param theVec Direction of extrusion.
3459 # @param theH Prism dimension along theVec.
3460 # @param theScaleFactor Use it to make prism with scaled second base.
3461 # Negative value means not scaled second base.
3462 # @param theName Object name; when specified, this parameter is used
3463 # for result publication in the study. Otherwise, if automatic
3464 # publication is switched on, default value is used for result name.
3466 # @return New GEOM.GEOM_Object, containing the created prism.
3468 # @ref tui_creation_prism "Example"
3469 @ManageTransactions("PrimOp")
3470 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3472 Create a shape by extrusion of the base shape along the vector,
3473 i.e. all the space, transfixed by the base shape during its translation
3474 along the vector on the given distance.
3477 theBase Base shape to be extruded.
3478 theVec Direction of extrusion.
3479 theH Prism dimension along theVec.
3480 theScaleFactor Use it to make prism with scaled second base.
3481 Negative value means not scaled second base.
3482 theName Object name; when specified, this parameter is used
3483 for result publication in the study. Otherwise, if automatic
3484 publication is switched on, default value is used for result name.
3487 New GEOM.GEOM_Object, containing the created prism.
3489 # Example: see GEOM_TestAll.py
3492 if theScaleFactor > 0:
3493 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3494 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3496 theH,Parameters = ParseParameters(theH)
3497 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3498 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3499 anObj.SetParameters(Parameters)
3500 self._autoPublish(anObj, theName, "prism")
3503 ## Create a shape by extrusion of the base shape along the vector,
3504 # i.e. all the space, transfixed by the base shape during its translation
3505 # along the vector on the given distance in 2 Ways (forward/backward).
3506 # @param theBase Base shape to be extruded.
3507 # @param theVec Direction of extrusion.
3508 # @param theH Prism dimension along theVec in forward direction.
3509 # @param theName Object name; when specified, this parameter is used
3510 # for result publication in the study. Otherwise, if automatic
3511 # publication is switched on, default value is used for result name.
3513 # @return New GEOM.GEOM_Object, containing the created prism.
3515 # @ref tui_creation_prism "Example"
3516 @ManageTransactions("PrimOp")
3517 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3519 Create a shape by extrusion of the base shape along the vector,
3520 i.e. all the space, transfixed by the base shape during its translation
3521 along the vector on the given distance in 2 Ways (forward/backward).
3524 theBase Base shape to be extruded.
3525 theVec Direction of extrusion.
3526 theH Prism dimension along theVec in forward direction.
3527 theName Object name; when specified, this parameter is used
3528 for result publication in the study. Otherwise, if automatic
3529 publication is switched on, default value is used for result name.
3532 New GEOM.GEOM_Object, containing the created prism.
3534 # Example: see GEOM_TestAll.py
3535 theH,Parameters = ParseParameters(theH)
3536 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3537 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3538 anObj.SetParameters(Parameters)
3539 self._autoPublish(anObj, theName, "prism")
3542 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3543 # @param theBase Base shape to be extruded.
3544 # @param theDX, theDY, theDZ Directions of extrusion.
3545 # @param theScaleFactor Use it to make prism with scaled second base.
3546 # Nagative value means not scaled second base.
3547 # @param theName Object name; when specified, this parameter is used
3548 # for result publication in the study. Otherwise, if automatic
3549 # publication is switched on, default value is used for result name.
3551 # @return New GEOM.GEOM_Object, containing the created prism.
3553 # @ref tui_creation_prism "Example"
3554 @ManageTransactions("PrimOp")
3555 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3557 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3560 theBase Base shape to be extruded.
3561 theDX, theDY, theDZ Directions of extrusion.
3562 theScaleFactor Use it to make prism with scaled second base.
3563 Nagative value means not scaled second base.
3564 theName Object name; when specified, this parameter is used
3565 for result publication in the study. Otherwise, if automatic
3566 publication is switched on, default value is used for result name.
3569 New GEOM.GEOM_Object, containing the created prism.
3571 # Example: see GEOM_TestAll.py
3574 if theScaleFactor > 0:
3575 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3576 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3578 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3579 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3580 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3581 anObj.SetParameters(Parameters)
3582 self._autoPublish(anObj, theName, "prism")
3585 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3586 # i.e. all the space, transfixed by the base shape during its translation
3587 # along the vector on the given distance in 2 Ways (forward/backward).
3588 # @param theBase Base shape to be extruded.
3589 # @param theDX, theDY, theDZ Directions of extrusion.
3590 # @param theName Object name; when specified, this parameter is used
3591 # for result publication in the study. Otherwise, if automatic
3592 # publication is switched on, default value is used for result name.
3594 # @return New GEOM.GEOM_Object, containing the created prism.
3596 # @ref tui_creation_prism "Example"
3597 @ManageTransactions("PrimOp")
3598 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3600 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3601 i.e. all the space, transfixed by the base shape during its translation
3602 along the vector on the given distance in 2 Ways (forward/backward).
3605 theBase Base shape to be extruded.
3606 theDX, theDY, theDZ Directions of extrusion.
3607 theName Object name; when specified, this parameter is used
3608 for result publication in the study. Otherwise, if automatic
3609 publication is switched on, default value is used for result name.
3612 New GEOM.GEOM_Object, containing the created prism.
3614 # Example: see GEOM_TestAll.py
3615 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3616 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3617 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3618 anObj.SetParameters(Parameters)
3619 self._autoPublish(anObj, theName, "prism")
3622 ## Create a shape by revolution of the base shape around the axis
3623 # on the given angle, i.e. all the space, transfixed by the base
3624 # shape during its rotation around the axis on the given angle.
3625 # @param theBase Base shape to be rotated.
3626 # @param theAxis Rotation axis.
3627 # @param theAngle Rotation angle in radians.
3628 # @param theName Object name; when specified, this parameter is used
3629 # for result publication in the study. Otherwise, if automatic
3630 # publication is switched on, default value is used for result name.
3632 # @return New GEOM.GEOM_Object, containing the created revolution.
3634 # @ref tui_creation_revolution "Example"
3635 @ManageTransactions("PrimOp")
3636 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3638 Create a shape by revolution of the base shape around the axis
3639 on the given angle, i.e. all the space, transfixed by the base
3640 shape during its rotation around the axis on the given angle.
3643 theBase Base shape to be rotated.
3644 theAxis Rotation axis.
3645 theAngle Rotation angle in radians.
3646 theName Object name; when specified, this parameter is used
3647 for result publication in the study. Otherwise, if automatic
3648 publication is switched on, default value is used for result name.
3651 New GEOM.GEOM_Object, containing the created revolution.
3653 # Example: see GEOM_TestAll.py
3654 theAngle,Parameters = ParseParameters(theAngle)
3655 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3656 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3657 anObj.SetParameters(Parameters)
3658 self._autoPublish(anObj, theName, "revolution")
3661 ## Create a shape by revolution of the base shape around the axis
3662 # on the given angle, i.e. all the space, transfixed by the base
3663 # shape during its rotation around the axis on the given angle in
3664 # both directions (forward/backward)
3665 # @param theBase Base shape to be rotated.
3666 # @param theAxis Rotation axis.
3667 # @param theAngle Rotation angle in radians.
3668 # @param theName Object name; when specified, this parameter is used
3669 # for result publication in the study. Otherwise, if automatic
3670 # publication is switched on, default value is used for result name.
3672 # @return New GEOM.GEOM_Object, containing the created revolution.
3674 # @ref tui_creation_revolution "Example"
3675 @ManageTransactions("PrimOp")
3676 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3678 Create a shape by revolution of the base shape around the axis
3679 on the given angle, i.e. all the space, transfixed by the base
3680 shape during its rotation around the axis on the given angle in
3681 both directions (forward/backward).
3684 theBase Base shape to be rotated.
3685 theAxis Rotation axis.
3686 theAngle Rotation angle in radians.
3687 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.
3692 New GEOM.GEOM_Object, containing the created revolution.
3694 theAngle,Parameters = ParseParameters(theAngle)
3695 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3696 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3697 anObj.SetParameters(Parameters)
3698 self._autoPublish(anObj, theName, "revolution")
3701 ## Create a filling from the given compound of contours.
3702 # @param theShape the compound of contours
3703 # @param theMinDeg a minimal degree of BSpline surface to create
3704 # @param theMaxDeg a maximal degree of BSpline surface to create
3705 # @param theTol2D a 2d tolerance to be reached
3706 # @param theTol3D a 3d tolerance to be reached
3707 # @param theNbIter a number of iteration of approximation algorithm
3708 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3709 # @param isApprox if True, BSpline curves are generated in the process
3710 # of surface construction. By default it is False, that means
3711 # the surface is created using given curves. The usage of
3712 # Approximation makes the algorithm work slower, but allows
3713 # building the surface for rather complex cases.
3714 # @param theName Object name; when specified, this parameter is used
3715 # for result publication in the study. Otherwise, if automatic
3716 # publication is switched on, default value is used for result name.
3718 # @return New GEOM.GEOM_Object, containing the created filling surface.
3720 # @ref tui_creation_filling "Example"
3721 @ManageTransactions("PrimOp")
3722 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3723 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3725 Create a filling from the given compound of contours.
3728 theShape the compound of contours
3729 theMinDeg a minimal degree of BSpline surface to create
3730 theMaxDeg a maximal degree of BSpline surface to create
3731 theTol2D a 2d tolerance to be reached
3732 theTol3D a 3d tolerance to be reached
3733 theNbIter a number of iteration of approximation algorithm
3734 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3735 isApprox if True, BSpline curves are generated in the process
3736 of surface construction. By default it is False, that means
3737 the surface is created using given curves. The usage of
3738 Approximation makes the algorithm work slower, but allows
3739 building the surface for rather complex cases
3740 theName Object name; when specified, this parameter is used
3741 for result publication in the study. Otherwise, if automatic
3742 publication is switched on, default value is used for result name.
3745 New GEOM.GEOM_Object, containing the created filling surface.
3748 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3750 # Example: see GEOM_TestAll.py
3751 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3752 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3753 theTol2D, theTol3D, theNbIter,
3754 theMethod, isApprox)
3755 RaiseIfFailed("MakeFilling", self.PrimOp)
3756 anObj.SetParameters(Parameters)
3757 self._autoPublish(anObj, theName, "filling")
3761 ## Create a filling from the given compound of contours.
3762 # This method corresponds to MakeFilling with isApprox=True
3763 # @param theShape the compound of contours
3764 # @param theMinDeg a minimal degree of BSpline surface to create
3765 # @param theMaxDeg a maximal degree of BSpline surface to create
3766 # @param theTol3D a 3d tolerance to be reached
3767 # @param theName Object name; when specified, this parameter is used
3768 # for result publication in the study. Otherwise, if automatic
3769 # publication is switched on, default value is used for result name.
3771 # @return New GEOM.GEOM_Object, containing the created filling surface.
3773 # @ref tui_creation_filling "Example"
3774 @ManageTransactions("PrimOp")
3775 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3777 Create a filling from the given compound of contours.
3778 This method corresponds to MakeFilling with isApprox=True
3781 theShape the compound of contours
3782 theMinDeg a minimal degree of BSpline surface to create
3783 theMaxDeg a maximal degree of BSpline surface to create
3784 theTol3D a 3d tolerance to be reached
3785 theName Object name; when specified, this parameter is used
3786 for result publication in the study. Otherwise, if automatic
3787 publication is switched on, default value is used for result name.
3790 New GEOM.GEOM_Object, containing the created filling surface.
3793 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3795 # Example: see GEOM_TestAll.py
3796 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3797 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3798 0, theTol3D, 0, GEOM.FOM_Default, True)
3799 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3800 anObj.SetParameters(Parameters)
3801 self._autoPublish(anObj, theName, "filling")
3804 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3805 # @param theSeqSections - set of specified sections.
3806 # @param theModeSolid - mode defining building solid or shell
3807 # @param thePreci - precision 3D used for smoothing
3808 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3809 # @param theName Object name; when specified, this parameter is used
3810 # for result publication in the study. Otherwise, if automatic
3811 # publication is switched on, default value is used for result name.
3813 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3815 # @ref swig_todo "Example"
3816 @ManageTransactions("PrimOp")
3817 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3819 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3822 theSeqSections - set of specified sections.
3823 theModeSolid - mode defining building solid or shell
3824 thePreci - precision 3D used for smoothing
3825 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3826 theName Object name; when specified, this parameter is used
3827 for result publication in the study. Otherwise, if automatic
3828 publication is switched on, default value is used for result name.
3831 New GEOM.GEOM_Object, containing the created shell or solid.
3833 # Example: see GEOM_TestAll.py
3834 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3835 RaiseIfFailed("MakeThruSections", self.PrimOp)
3836 self._autoPublish(anObj, theName, "filling")
3839 ## Create a shape by extrusion of the base shape along
3840 # the path shape. The path shape can be a wire or an edge.
3841 # @param theBase Base shape to be extruded.
3842 # @param thePath Path shape to extrude the base shape along it.
3843 # @param theName Object name; when specified, this parameter is used
3844 # for result publication in the study. Otherwise, if automatic
3845 # publication is switched on, default value is used for result name.
3847 # @return New GEOM.GEOM_Object, containing the created pipe.
3849 # @ref tui_creation_pipe "Example"
3850 @ManageTransactions("PrimOp")
3851 def MakePipe(self, theBase, thePath, theName=None):
3853 Create a shape by extrusion of the base shape along
3854 the path shape. The path shape can be a wire or an edge.
3857 theBase Base shape to be extruded.
3858 thePath Path shape to extrude the base shape along it.
3859 theName Object name; when specified, this parameter is used
3860 for result publication in the study. Otherwise, if automatic
3861 publication is switched on, default value is used for result name.
3864 New GEOM.GEOM_Object, containing the created pipe.
3866 # Example: see GEOM_TestAll.py
3867 anObj = self.PrimOp.MakePipe(theBase, thePath)
3868 RaiseIfFailed("MakePipe", self.PrimOp)
3869 self._autoPublish(anObj, theName, "pipe")
3872 ## Create a shape by extrusion of the profile shape along
3873 # the path shape. The path shape can be a wire or an edge.
3874 # the several profiles can be specified in the several locations of path.
3875 # @param theSeqBases - list of Bases shape to be extruded.
3876 # @param theLocations - list of locations on the path corresponding
3877 # specified list of the Bases shapes. Number of locations
3878 # should be equal to number of bases or list of locations can be empty.
3879 # @param thePath - Path shape to extrude the base shape along it.
3880 # @param theWithContact - the mode defining that the section is translated to be in
3881 # contact with the spine.
3882 # @param theWithCorrection - defining that the section is rotated to be
3883 # orthogonal to the spine tangent in the correspondent point
3884 # @param theName Object name; when specified, this parameter is used
3885 # for result publication in the study. Otherwise, if automatic
3886 # publication is switched on, default value is used for result name.
3888 # @return New GEOM.GEOM_Object, containing the created pipe.
3890 # @ref tui_creation_pipe_with_diff_sec "Example"
3891 @ManageTransactions("PrimOp")
3892 def MakePipeWithDifferentSections(self, theSeqBases,
3893 theLocations, thePath,
3894 theWithContact, theWithCorrection, theName=None):
3896 Create a shape by extrusion of the profile shape along
3897 the path shape. The path shape can be a wire or an edge.
3898 the several profiles can be specified in the several locations of path.
3901 theSeqBases - list of Bases shape to be extruded.
3902 theLocations - list of locations on the path corresponding
3903 specified list of the Bases shapes. Number of locations
3904 should be equal to number of bases or list of locations can be empty.
3905 thePath - Path shape to extrude the base shape along it.
3906 theWithContact - the mode defining that the section is translated to be in
3907 contact with the spine(0/1)
3908 theWithCorrection - defining that the section is rotated to be
3909 orthogonal to the spine tangent in the correspondent point (0/1)
3910 theName Object name; when specified, this parameter is used
3911 for result publication in the study. Otherwise, if automatic
3912 publication is switched on, default value is used for result name.
3915 New GEOM.GEOM_Object, containing the created pipe.
3917 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3918 theLocations, thePath,
3919 theWithContact, theWithCorrection)
3920 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3921 self._autoPublish(anObj, theName, "pipe")
3924 ## Create a shape by extrusion of the profile shape along
3925 # the path shape. The path shape can be a wire or a edge.
3926 # the several profiles can be specified in the several locations of path.
3927 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3928 # shell or face. If number of faces in neighbour sections
3929 # aren't coincided result solid between such sections will
3930 # be created using external boundaries of this shells.
3931 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3932 # This list is used for searching correspondences between
3933 # faces in the sections. Size of this list must be equal
3934 # to size of list of base shapes.
3935 # @param theLocations - list of locations on the path corresponding
3936 # specified list of the Bases shapes. Number of locations
3937 # should be equal to number of bases. First and last
3938 # locations must be coincided with first and last vertexes
3939 # of path correspondingly.
3940 # @param thePath - Path shape to extrude the base shape along it.
3941 # @param theWithContact - the mode defining that the section is translated to be in
3942 # contact with the spine.
3943 # @param theWithCorrection - defining that the section is rotated to be
3944 # orthogonal to the spine tangent in the correspondent point
3945 # @param theName Object name; when specified, this parameter is used
3946 # for result publication in the study. Otherwise, if automatic
3947 # publication is switched on, default value is used for result name.
3949 # @return New GEOM.GEOM_Object, containing the created solids.
3951 # @ref tui_creation_pipe_with_shell_sec "Example"
3952 @ManageTransactions("PrimOp")
3953 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3954 theLocations, thePath,
3955 theWithContact, theWithCorrection, theName=None):
3957 Create a shape by extrusion of the profile shape along
3958 the path shape. The path shape can be a wire or a edge.
3959 the several profiles can be specified in the several locations of path.
3962 theSeqBases - list of Bases shape to be extruded. Base shape must be
3963 shell or face. If number of faces in neighbour sections
3964 aren't coincided result solid between such sections will
3965 be created using external boundaries of this shells.
3966 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3967 This list is used for searching correspondences between
3968 faces in the sections. Size of this list must be equal
3969 to size of list of base shapes.
3970 theLocations - list of locations on the path corresponding
3971 specified list of the Bases shapes. Number of locations
3972 should be equal to number of bases. First and last
3973 locations must be coincided with first and last vertexes
3974 of path correspondingly.
3975 thePath - Path shape to extrude the base shape along it.
3976 theWithContact - the mode defining that the section is translated to be in
3977 contact with the spine (0/1)
3978 theWithCorrection - defining that the section is rotated to be
3979 orthogonal to the spine tangent in the correspondent point (0/1)
3980 theName Object name; when specified, this parameter is used
3981 for result publication in the study. Otherwise, if automatic
3982 publication is switched on, default value is used for result name.
3985 New GEOM.GEOM_Object, containing the created solids.
3987 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3988 theLocations, thePath,
3989 theWithContact, theWithCorrection)
3990 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3991 self._autoPublish(anObj, theName, "pipe")
3994 ## Create a shape by extrusion of the profile shape along
3995 # the path shape. This function is used only for debug pipe
3996 # functionality - it is a version of function MakePipeWithShellSections()
3997 # which give a possibility to recieve information about
3998 # creating pipe between each pair of sections step by step.
3999 @ManageTransactions("PrimOp")
4000 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4001 theLocations, thePath,
4002 theWithContact, theWithCorrection, theName=None):
4004 Create a shape by extrusion of the profile shape along
4005 the path shape. This function is used only for debug pipe
4006 functionality - it is a version of previous function
4007 geompy.MakePipeWithShellSections() which give a possibility to
4008 recieve information about creating pipe between each pair of
4009 sections step by step.
4012 nbsect = len(theSeqBases)
4013 nbsubsect = len(theSeqSubBases)
4014 #print "nbsect = ",nbsect
4015 for i in range(1,nbsect):
4017 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4018 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4020 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4021 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4022 tmpLocations, thePath,
4023 theWithContact, theWithCorrection)
4024 if self.PrimOp.IsDone() == 0:
4025 print "Problems with pipe creation between ",i," and ",i+1," sections"
4026 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4029 print "Pipe between ",i," and ",i+1," sections is OK"
4034 resc = self.MakeCompound(res)
4035 #resc = self.MakeSewing(res, 0.001)
4036 #print "resc: ",resc
4037 self._autoPublish(resc, theName, "pipe")
4040 ## Create solids between given sections
4041 # @param theSeqBases - list of sections (shell or face).
4042 # @param theLocations - list of corresponding vertexes
4043 # @param theName Object name; when specified, this parameter is used
4044 # for result publication in the study. Otherwise, if automatic
4045 # publication is switched on, default value is used for result name.
4047 # @return New GEOM.GEOM_Object, containing the created solids.
4049 # @ref tui_creation_pipe_without_path "Example"
4050 @ManageTransactions("PrimOp")
4051 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4053 Create solids between given sections
4056 theSeqBases - list of sections (shell or face).
4057 theLocations - list of corresponding vertexes
4058 theName Object name; when specified, this parameter is used
4059 for result publication in the study. Otherwise, if automatic
4060 publication is switched on, default value is used for result name.
4063 New GEOM.GEOM_Object, containing the created solids.
4065 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4066 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4067 self._autoPublish(anObj, theName, "pipe")
4070 ## Create a shape by extrusion of the base shape along
4071 # the path shape with constant bi-normal direction along the given vector.
4072 # The path shape can be a wire or an edge.
4073 # @param theBase Base shape to be extruded.
4074 # @param thePath Path shape to extrude the base shape along it.
4075 # @param theVec Vector defines a constant binormal direction to keep the
4076 # same angle beetween the direction and the sections
4077 # along the sweep surface.
4078 # @param theName Object name; when specified, this parameter is used
4079 # for result publication in the study. Otherwise, if automatic
4080 # publication is switched on, default value is used for result name.
4082 # @return New GEOM.GEOM_Object, containing the created pipe.
4084 # @ref tui_creation_pipe "Example"
4085 @ManageTransactions("PrimOp")
4086 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4088 Create a shape by extrusion of the base shape along
4089 the path shape with constant bi-normal direction along the given vector.
4090 The path shape can be a wire or an edge.
4093 theBase Base shape to be extruded.
4094 thePath Path shape to extrude the base shape along it.
4095 theVec Vector defines a constant binormal direction to keep the
4096 same angle beetween the direction and the sections
4097 along the sweep surface.
4098 theName Object name; when specified, this parameter is used
4099 for result publication in the study. Otherwise, if automatic
4100 publication is switched on, default value is used for result name.
4103 New GEOM.GEOM_Object, containing the created pipe.
4105 # Example: see GEOM_TestAll.py
4106 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4107 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4108 self._autoPublish(anObj, theName, "pipe")
4111 ## Makes a thick solid from a face or a shell
4112 # @param theShape Face or Shell to be thicken
4113 # @param theThickness Thickness of the resulting solid
4114 # @param theName Object name; when specified, this parameter is used
4115 # for result publication in the study. Otherwise, if automatic
4116 # publication is switched on, default value is used for result name.
4118 # @return New GEOM.GEOM_Object, containing the created solid
4120 @ManageTransactions("PrimOp")
4121 def MakeThickSolid(self, theShape, theThickness, theName=None):
4123 Make a thick solid from a face or a shell
4126 theShape Face or Shell to be thicken
4127 theThickness Thickness of the resulting solid
4128 theName Object name; when specified, this parameter is used
4129 for result publication in the study. Otherwise, if automatic
4130 publication is switched on, default value is used for result name.
4133 New GEOM.GEOM_Object, containing the created solid
4135 # Example: see GEOM_TestAll.py
4136 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4137 RaiseIfFailed("MakeThickening", self.PrimOp)
4138 self._autoPublish(anObj, theName, "pipe")
4142 ## Modifies a face or a shell to make it a thick solid
4143 # @param theShape Face or Shell to be thicken
4144 # @param theThickness Thickness of the resulting solid
4146 # @return The modified shape
4148 @ManageTransactions("PrimOp")
4149 def Thicken(self, theShape, theThickness):
4151 Modifies a face or a shell to make it a thick solid
4154 theBase Base shape to be extruded.
4155 thePath Path shape to extrude the base shape along it.
4156 theName Object name; when specified, this parameter is used
4157 for result publication in the study. Otherwise, if automatic
4158 publication is switched on, default value is used for result name.
4163 # Example: see GEOM_TestAll.py
4164 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4165 RaiseIfFailed("MakeThickening", self.PrimOp)
4168 ## Build a middle path of a pipe-like shape.
4169 # The path shape can be a wire or an edge.
4170 # @param theShape It can be closed or unclosed pipe-like shell
4171 # or a pipe-like solid.
4172 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4173 # should be wires or faces of theShape.
4174 # @param theName Object name; when specified, this parameter is used
4175 # for result publication in the study. Otherwise, if automatic
4176 # publication is switched on, default value is used for result name.
4178 # @note It is not assumed that exact or approximate copy of theShape
4179 # can be obtained by applying existing Pipe operation on the
4180 # resulting "Path" wire taking theBase1 as the base - it is not
4181 # always possible; though in some particular cases it might work
4182 # it is not guaranteed. Thus, RestorePath function should not be
4183 # considered as an exact reverse operation of the Pipe.
4185 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4186 # source pipe's "path".
4188 # @ref tui_creation_pipe_path "Example"
4189 @ManageTransactions("PrimOp")
4190 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4192 Build a middle path of a pipe-like shape.
4193 The path shape can be a wire or an edge.
4196 theShape It can be closed or unclosed pipe-like shell
4197 or a pipe-like solid.
4198 theBase1, theBase2 Two bases of the supposed pipe. This
4199 should be wires or faces of theShape.
4200 theName Object name; when specified, this parameter is used
4201 for result publication in the study. Otherwise, if automatic
4202 publication is switched on, default value is used for result name.
4205 New GEOM_Object, containing an edge or wire that represent
4208 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4209 RaiseIfFailed("RestorePath", self.PrimOp)
4210 self._autoPublish(anObj, theName, "path")
4213 ## Build a middle path of a pipe-like shape.
4214 # The path shape can be a wire or an edge.
4215 # @param theShape It can be closed or unclosed pipe-like shell
4216 # or a pipe-like solid.
4217 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4218 # should be lists of edges of theShape.
4219 # @param 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.
4223 # @note It is not assumed that exact or approximate copy of theShape
4224 # can be obtained by applying existing Pipe operation on the
4225 # resulting "Path" wire taking theBase1 as the base - it is not
4226 # always possible; though in some particular cases it might work
4227 # it is not guaranteed. Thus, RestorePath function should not be
4228 # considered as an exact reverse operation of the Pipe.
4230 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4231 # source pipe's "path".
4233 # @ref tui_creation_pipe_path "Example"
4234 @ManageTransactions("PrimOp")
4235 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4237 Build a middle path of a pipe-like shape.
4238 The path shape can be a wire or an edge.
4241 theShape It can be closed or unclosed pipe-like shell
4242 or a pipe-like solid.
4243 listEdges1, listEdges2 Two bases of the supposed pipe. This
4244 should be lists of edges of theShape.
4245 theName Object name; when specified, this parameter is used
4246 for result publication in the study. Otherwise, if automatic
4247 publication is switched on, default value is used for result name.
4250 New GEOM_Object, containing an edge or wire that represent
4253 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4254 RaiseIfFailed("RestorePath", self.PrimOp)
4255 self._autoPublish(anObj, theName, "path")
4261 ## @addtogroup l3_advanced
4264 ## Create a linear edge with specified ends.
4265 # @param thePnt1 Point for the first end of edge.
4266 # @param thePnt2 Point for the second end of edge.
4267 # @param theName Object name; when specified, this parameter is used
4268 # for result publication in the study. Otherwise, if automatic
4269 # publication is switched on, default value is used for result name.
4271 # @return New GEOM.GEOM_Object, containing the created edge.
4273 # @ref tui_creation_edge "Example"
4274 @ManageTransactions("ShapesOp")
4275 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4277 Create a linear edge with specified ends.
4280 thePnt1 Point for the first end of edge.
4281 thePnt2 Point for the second end of edge.
4282 theName Object name; when specified, this parameter is used
4283 for result publication in the study. Otherwise, if automatic
4284 publication is switched on, default value is used for result name.
4287 New GEOM.GEOM_Object, containing the created edge.
4289 # Example: see GEOM_TestAll.py
4290 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4291 RaiseIfFailed("MakeEdge", self.ShapesOp)
4292 self._autoPublish(anObj, theName, "edge")
4295 ## Create a new edge, corresponding to the given length on the given curve.
4296 # @param theRefCurve The referenced curve (edge).
4297 # @param theLength Length on the referenced curve. It can be negative.
4298 # @param theStartPoint Any point can be selected for it, the new edge will begin
4299 # at the end of \a theRefCurve, close to the selected point.
4300 # If None, start from the first point of \a theRefCurve.
4301 # @param 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.
4305 # @return New GEOM.GEOM_Object, containing the created edge.
4307 # @ref tui_creation_edge "Example"
4308 @ManageTransactions("ShapesOp")
4309 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4311 Create a new edge, corresponding to the given length on the given curve.
4314 theRefCurve The referenced curve (edge).
4315 theLength Length on the referenced curve. It can be negative.
4316 theStartPoint Any point can be selected for it, the new edge will begin
4317 at the end of theRefCurve, close to the selected point.
4318 If None, start from the first point of theRefCurve.
4319 theName Object name; when specified, this parameter is used
4320 for result publication in the study. Otherwise, if automatic
4321 publication is switched on, default value is used for result name.
4324 New GEOM.GEOM_Object, containing the created edge.
4326 # Example: see GEOM_TestAll.py
4327 theLength, Parameters = ParseParameters(theLength)
4328 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4329 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4330 anObj.SetParameters(Parameters)
4331 self._autoPublish(anObj, theName, "edge")
4334 ## Create an edge from specified wire.
4335 # @param theWire source Wire
4336 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4337 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4338 # @param 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.
4342 # @return New GEOM.GEOM_Object, containing the created edge.
4344 # @ref tui_creation_edge "Example"
4345 @ManageTransactions("ShapesOp")
4346 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4348 Create an edge from specified wire.
4352 theLinearTolerance linear tolerance value (default = 1e-07)
4353 theAngularTolerance angular tolerance value (default = 1e-12)
4354 theName Object name; when specified, this parameter is used
4355 for result publication in the study. Otherwise, if automatic
4356 publication is switched on, default value is used for result name.
4359 New GEOM.GEOM_Object, containing the created edge.
4361 # Example: see GEOM_TestAll.py
4362 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4363 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4364 self._autoPublish(anObj, theName, "edge")
4367 ## Create a wire from the set of edges and wires.
4368 # @param theEdgesAndWires List of edges and/or wires.
4369 # @param theTolerance Maximum distance between vertices, that will be merged.
4370 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4371 # @param theName Object name; when specified, this parameter is used
4372 # for result publication in the study. Otherwise, if automatic
4373 # publication is switched on, default value is used for result name.
4375 # @return New GEOM.GEOM_Object, containing the created wire.
4377 # @ref tui_creation_wire "Example"
4378 @ManageTransactions("ShapesOp")
4379 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4381 Create a wire from the set of edges and wires.
4384 theEdgesAndWires List of edges and/or wires.
4385 theTolerance Maximum distance between vertices, that will be merged.
4386 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4387 theName Object name; when specified, this parameter is used
4388 for result publication in the study. Otherwise, if automatic
4389 publication is switched on, default value is used for result name.
4392 New GEOM.GEOM_Object, containing the created wire.
4394 # Example: see GEOM_TestAll.py
4395 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4396 RaiseIfFailed("MakeWire", self.ShapesOp)
4397 self._autoPublish(anObj, theName, "wire")
4400 ## Create a face on the given wire.
4401 # @param theWire closed Wire or Edge to build the face on.
4402 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4403 # If the tolerance of the obtained planar face is less
4404 # than 1e-06, this face will be returned, otherwise the
4405 # algorithm tries to build any suitable face on the given
4406 # wire and prints a warning message.
4407 # @param theName Object name; when specified, this parameter is used
4408 # for result publication in the study. Otherwise, if automatic
4409 # publication is switched on, default value is used for result name.
4411 # @return New GEOM.GEOM_Object, containing the created face.
4413 # @ref tui_creation_face "Example"
4414 @ManageTransactions("ShapesOp")
4415 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4417 Create a face on the given wire.
4420 theWire closed Wire or Edge to build the face on.
4421 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 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.
4431 New GEOM.GEOM_Object, containing the created face.
4433 # Example: see GEOM_TestAll.py
4434 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4435 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4436 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4438 RaiseIfFailed("MakeFace", self.ShapesOp)
4439 self._autoPublish(anObj, theName, "face")
4442 ## Create a face on the given wires set.
4443 # @param theWires List of closed wires or edges to build the face on.
4444 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4445 # If the tolerance of the obtained planar face is less
4446 # than 1e-06, this face will be returned, otherwise the
4447 # algorithm tries to build any suitable face on the given
4448 # wire and prints a warning message.
4449 # @param theName Object name; when specified, this parameter is used
4450 # for result publication in the study. Otherwise, if automatic
4451 # publication is switched on, default value is used for result name.
4453 # @return New GEOM.GEOM_Object, containing the created face.
4455 # @ref tui_creation_face "Example"
4456 @ManageTransactions("ShapesOp")
4457 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4459 Create a face on the given wires set.
4462 theWires List of closed wires or edges to build the face on.
4463 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 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.
4473 New GEOM.GEOM_Object, containing the created face.
4475 # Example: see GEOM_TestAll.py
4476 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4477 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4478 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4480 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4481 self._autoPublish(anObj, theName, "face")
4484 ## See MakeFaceWires() method for details.
4486 # @ref tui_creation_face "Example 1"
4487 # \n @ref swig_MakeFaces "Example 2"
4488 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4490 See geompy.MakeFaceWires() method for details.
4492 # Example: see GEOM_TestOthers.py
4493 # note: auto-publishing is done in self.MakeFaceWires()
4494 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4497 ## Create a shell from the set of faces and shells.
4498 # @param theFacesAndShells List of faces and/or shells.
4499 # @param theName Object name; when specified, this parameter is used
4500 # for result publication in the study. Otherwise, if automatic
4501 # publication is switched on, default value is used for result name.
4503 # @return New GEOM.GEOM_Object, containing the created shell.
4505 # @ref tui_creation_shell "Example"
4506 @ManageTransactions("ShapesOp")
4507 def MakeShell(self, theFacesAndShells, theName=None):
4509 Create a shell from the set of faces and shells.
4512 theFacesAndShells List of faces and/or shells.
4513 theName Object name; when specified, this parameter is used
4514 for result publication in the study. Otherwise, if automatic
4515 publication is switched on, default value is used for result name.
4518 New GEOM.GEOM_Object, containing the created shell.
4520 # Example: see GEOM_TestAll.py
4521 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4522 RaiseIfFailed("MakeShell", self.ShapesOp)
4523 self._autoPublish(anObj, theName, "shell")
4526 ## Create a solid, bounded by the given shells.
4527 # @param theShells Sequence of bounding shells.
4528 # @param theName Object name; when specified, this parameter is used
4529 # for result publication in the study. Otherwise, if automatic
4530 # publication is switched on, default value is used for result name.
4532 # @return New GEOM.GEOM_Object, containing the created solid.
4534 # @ref tui_creation_solid "Example"
4535 @ManageTransactions("ShapesOp")
4536 def MakeSolid(self, theShells, theName=None):
4538 Create a solid, bounded by the given shells.
4541 theShells Sequence of bounding shells.
4542 theName Object name; when specified, this parameter is used
4543 for result publication in the study. Otherwise, if automatic
4544 publication is switched on, default value is used for result name.
4547 New GEOM.GEOM_Object, containing the created solid.
4549 # Example: see GEOM_TestAll.py
4550 if len(theShells) == 1:
4551 descr = self._IsGoodForSolid(theShells[0])
4553 # raise RuntimeError, "MakeSolidShells : " + descr
4554 if descr == "WRN_SHAPE_UNCLOSED":
4555 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4556 anObj = self.ShapesOp.MakeSolidShells(theShells)
4557 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4558 self._autoPublish(anObj, theName, "solid")
4561 ## Create a compound of the given shapes.
4562 # @param theShapes List of shapes to put in compound.
4563 # @param theName Object name; when specified, this parameter is used
4564 # for result publication in the study. Otherwise, if automatic
4565 # publication is switched on, default value is used for result name.
4567 # @return New GEOM.GEOM_Object, containing the created compound.
4569 # @ref tui_creation_compound "Example"
4570 @ManageTransactions("ShapesOp")
4571 def MakeCompound(self, theShapes, theName=None):
4573 Create a compound of the given shapes.
4576 theShapes List of shapes to put in compound.
4577 theName Object name; when specified, this parameter is used
4578 for result publication in the study. Otherwise, if automatic
4579 publication is switched on, default value is used for result name.
4582 New GEOM.GEOM_Object, containing the created compound.
4584 # Example: see GEOM_TestAll.py
4585 anObj = self.ShapesOp.MakeCompound(theShapes)
4586 RaiseIfFailed("MakeCompound", self.ShapesOp)
4587 self._autoPublish(anObj, theName, "compound")
4590 # end of l3_advanced
4593 ## @addtogroup l2_measure
4596 ## Gives quantity of faces in the given shape.
4597 # @param theShape Shape to count faces of.
4598 # @return Quantity of faces.
4600 # @ref swig_NumberOf "Example"
4601 @ManageTransactions("ShapesOp")
4602 def NumberOfFaces(self, theShape):
4604 Gives quantity of faces in the given shape.
4607 theShape Shape to count faces of.
4612 # Example: see GEOM_TestOthers.py
4613 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4614 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4617 ## Gives quantity of edges in the given shape.
4618 # @param theShape Shape to count edges of.
4619 # @return Quantity of edges.
4621 # @ref swig_NumberOf "Example"
4622 @ManageTransactions("ShapesOp")
4623 def NumberOfEdges(self, theShape):
4625 Gives quantity of edges in the given shape.
4628 theShape Shape to count edges of.
4633 # Example: see GEOM_TestOthers.py
4634 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4635 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4638 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4639 # @param theShape Shape to count sub-shapes of.
4640 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4641 # @return Quantity of sub-shapes of given type.
4643 # @ref swig_NumberOf "Example"
4644 @ManageTransactions("ShapesOp")
4645 def NumberOfSubShapes(self, theShape, theShapeType):
4647 Gives quantity of sub-shapes of type theShapeType in the given shape.
4650 theShape Shape to count sub-shapes of.
4651 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4654 Quantity of sub-shapes of given type.
4656 # Example: see GEOM_TestOthers.py
4657 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4658 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4661 ## Gives quantity of solids in the given shape.
4662 # @param theShape Shape to count solids in.
4663 # @return Quantity of solids.
4665 # @ref swig_NumberOf "Example"
4666 @ManageTransactions("ShapesOp")
4667 def NumberOfSolids(self, theShape):
4669 Gives quantity of solids in the given shape.
4672 theShape Shape to count solids in.
4677 # Example: see GEOM_TestOthers.py
4678 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4679 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4685 ## @addtogroup l3_healing
4688 ## Reverses an orientation the given shape.
4689 # @param theShape Shape to be reversed.
4690 # @param theName Object name; when specified, this parameter is used
4691 # for result publication in the study. Otherwise, if automatic
4692 # publication is switched on, default value is used for result name.
4694 # @return The reversed copy of theShape.
4696 # @ref swig_ChangeOrientation "Example"
4697 @ManageTransactions("ShapesOp")
4698 def ChangeOrientation(self, theShape, theName=None):
4700 Reverses an orientation the given shape.
4703 theShape Shape to be reversed.
4704 theName Object name; when specified, this parameter is used
4705 for result publication in the study. Otherwise, if automatic
4706 publication is switched on, default value is used for result name.
4709 The reversed copy of theShape.
4711 # Example: see GEOM_TestAll.py
4712 anObj = self.ShapesOp.ChangeOrientation(theShape)
4713 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4714 self._autoPublish(anObj, theName, "reversed")
4717 ## See ChangeOrientation() method for details.
4719 # @ref swig_OrientationChange "Example"
4720 def OrientationChange(self, theShape, theName=None):
4722 See geompy.ChangeOrientation method for details.
4724 # Example: see GEOM_TestOthers.py
4725 # note: auto-publishing is done in self.ChangeOrientation()
4726 anObj = self.ChangeOrientation(theShape, theName)
4732 ## @addtogroup l4_obtain
4735 ## Retrieve all free faces from the given shape.
4736 # Free face is a face, which is not shared between two shells of the shape.
4737 # @param theShape Shape to find free faces in.
4738 # @return List of IDs of all free faces, contained in theShape.
4740 # @ref tui_measurement_tools_page "Example"
4741 @ManageTransactions("ShapesOp")
4742 def GetFreeFacesIDs(self,theShape):
4744 Retrieve all free faces from the given shape.
4745 Free face is a face, which is not shared between two shells of the shape.
4748 theShape Shape to find free faces in.
4751 List of IDs of all free faces, contained in theShape.
4753 # Example: see GEOM_TestOthers.py
4754 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4755 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4758 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4759 # @param theShape1 Shape to find sub-shapes in.
4760 # @param theShape2 Shape to find shared sub-shapes with.
4761 # @param theShapeType Type of sub-shapes to be retrieved.
4762 # @param theName Object name; when specified, this parameter is used
4763 # for result publication in the study. Otherwise, if automatic
4764 # publication is switched on, default value is used for result name.
4766 # @return List of sub-shapes of theShape1, shared with theShape2.
4768 # @ref swig_GetSharedShapes "Example"
4769 @ManageTransactions("ShapesOp")
4770 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4772 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4775 theShape1 Shape to find sub-shapes in.
4776 theShape2 Shape to find shared sub-shapes with.
4777 theShapeType Type of sub-shapes to be retrieved.
4778 theName Object name; when specified, this parameter is used
4779 for result publication in the study. Otherwise, if automatic
4780 publication is switched on, default value is used for result name.
4783 List of sub-shapes of theShape1, shared with theShape2.
4785 # Example: see GEOM_TestOthers.py
4786 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4787 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4788 self._autoPublish(aList, theName, "shared")
4791 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4792 # @param theShapes Shapes to find common sub-shapes of.
4793 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4794 # @param theName Object name; when specified, this parameter is used
4795 # for result publication in the study. Otherwise, if automatic
4796 # publication is switched on, default value is used for result name.
4798 # @return List of objects, that are sub-shapes of all given shapes.
4800 # @ref swig_GetSharedShapes "Example"
4801 @ManageTransactions("ShapesOp")
4802 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4804 Get all sub-shapes, shared by all shapes in the list theShapes.
4807 theShapes Shapes to find common sub-shapes of.
4808 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4809 theName Object name; when specified, this parameter is used
4810 for result publication in the study. Otherwise, if automatic
4811 publication is switched on, default value is used for result name.
4814 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4816 # Example: see GEOM_TestOthers.py
4817 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4818 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4819 self._autoPublish(aList, theName, "shared")
4822 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4823 # situated relatively the specified plane by the certain way,
4824 # defined through <VAR>theState</VAR> parameter.
4825 # @param theShape Shape to find sub-shapes of.
4826 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4827 # @param theAx1 Vector (or line, or linear edge), specifying normal
4828 # direction and location of the plane to find shapes on.
4829 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4830 # @param theName Object name; when specified, this parameter is used
4831 # for result publication in the study. Otherwise, if automatic
4832 # publication is switched on, default value is used for result name.
4834 # @return List of all found sub-shapes.
4836 # @ref swig_GetShapesOnPlane "Example"
4837 @ManageTransactions("ShapesOp")
4838 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4840 Find in theShape all sub-shapes of type theShapeType,
4841 situated relatively the specified plane by the certain way,
4842 defined through theState parameter.
4845 theShape Shape to find sub-shapes of.
4846 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4847 theAx1 Vector (or line, or linear edge), specifying normal
4848 direction and location of the plane to find shapes on.
4849 theState The state of the sub-shapes to find (see GEOM::shape_state)
4850 theName Object name; when specified, this parameter is used
4851 for result publication in the study. Otherwise, if automatic
4852 publication is switched on, default value is used for result name.
4855 List of all found sub-shapes.
4857 # Example: see GEOM_TestOthers.py
4858 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4859 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4860 self._autoPublish(aList, theName, "shapeOnPlane")
4863 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4864 # situated relatively the specified plane by the certain way,
4865 # defined through <VAR>theState</VAR> parameter.
4866 # @param theShape Shape to find sub-shapes of.
4867 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4868 # @param theAx1 Vector (or line, or linear edge), specifying normal
4869 # direction and location of the plane to find shapes on.
4870 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4872 # @return List of all found sub-shapes indices.
4874 # @ref swig_GetShapesOnPlaneIDs "Example"
4875 @ManageTransactions("ShapesOp")
4876 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4878 Find in theShape all sub-shapes of type theShapeType,
4879 situated relatively the specified plane by the certain way,
4880 defined through theState parameter.
4883 theShape Shape to find sub-shapes of.
4884 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4885 theAx1 Vector (or line, or linear edge), specifying normal
4886 direction and location of the plane to find shapes on.
4887 theState The state of the sub-shapes to find (see GEOM::shape_state)
4890 List of all found sub-shapes indices.
4892 # Example: see GEOM_TestOthers.py
4893 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4894 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4897 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4898 # situated relatively the specified plane by the certain way,
4899 # defined through <VAR>theState</VAR> parameter.
4900 # @param theShape Shape to find sub-shapes of.
4901 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4902 # @param theAx1 Vector (or line, or linear edge), specifying normal
4903 # direction of the plane to find shapes on.
4904 # @param thePnt Point specifying location of the plane to find shapes on.
4905 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4906 # @param theName Object name; when specified, this parameter is used
4907 # for result publication in the study. Otherwise, if automatic
4908 # publication is switched on, default value is used for result name.
4910 # @return List of all found sub-shapes.
4912 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4913 @ManageTransactions("ShapesOp")
4914 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4916 Find in theShape all sub-shapes of type theShapeType,
4917 situated relatively the specified plane by the certain way,
4918 defined through theState parameter.
4921 theShape Shape to find sub-shapes of.
4922 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4923 theAx1 Vector (or line, or linear edge), specifying normal
4924 direction and location of the plane to find shapes on.
4925 thePnt Point specifying location of the plane to find shapes on.
4926 theState The state of the sub-shapes to find (see GEOM::shape_state)
4927 theName Object name; when specified, this parameter is used
4928 for result publication in the study. Otherwise, if automatic
4929 publication is switched on, default value is used for result name.
4932 List of all found sub-shapes.
4934 # Example: see GEOM_TestOthers.py
4935 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4936 theAx1, thePnt, theState)
4937 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4938 self._autoPublish(aList, theName, "shapeOnPlane")
4941 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4942 # situated relatively the specified plane by the certain way,
4943 # defined through <VAR>theState</VAR> parameter.
4944 # @param theShape Shape to find sub-shapes of.
4945 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4946 # @param theAx1 Vector (or line, or linear edge), specifying normal
4947 # direction of the plane to find shapes on.
4948 # @param thePnt Point specifying location of the plane to find shapes on.
4949 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4951 # @return List of all found sub-shapes indices.
4953 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4954 @ManageTransactions("ShapesOp")
4955 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4957 Find in theShape all sub-shapes of type theShapeType,
4958 situated relatively the specified plane by the certain way,
4959 defined through theState parameter.
4962 theShape Shape to find sub-shapes of.
4963 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4964 theAx1 Vector (or line, or linear edge), specifying normal
4965 direction and location of the plane to find shapes on.
4966 thePnt Point specifying location of the plane to find shapes on.
4967 theState The state of the sub-shapes to find (see GEOM::shape_state)
4970 List of all found sub-shapes indices.
4972 # Example: see GEOM_TestOthers.py
4973 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4974 theAx1, thePnt, theState)
4975 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4978 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4979 # the specified cylinder by the certain way, defined through \a theState parameter.
4980 # @param theShape Shape to find sub-shapes of.
4981 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4982 # @param theAxis Vector (or line, or linear edge), specifying
4983 # axis of the cylinder to find shapes on.
4984 # @param theRadius Radius of the cylinder to find shapes on.
4985 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4986 # @param theName Object name; when specified, this parameter is used
4987 # for result publication in the study. Otherwise, if automatic
4988 # publication is switched on, default value is used for result name.
4990 # @return List of all found sub-shapes.
4992 # @ref swig_GetShapesOnCylinder "Example"
4993 @ManageTransactions("ShapesOp")
4994 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4996 Find in theShape all sub-shapes of type theShapeType, situated relatively
4997 the specified cylinder by the certain way, defined through theState parameter.
5000 theShape Shape to find sub-shapes of.
5001 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5002 theAxis Vector (or line, or linear edge), specifying
5003 axis of the cylinder to find shapes on.
5004 theRadius Radius of the cylinder to find shapes on.
5005 theState The state of the sub-shapes to find (see GEOM::shape_state)
5006 theName Object name; when specified, this parameter is used
5007 for result publication in the study. Otherwise, if automatic
5008 publication is switched on, default value is used for result name.
5011 List of all found sub-shapes.
5013 # Example: see GEOM_TestOthers.py
5014 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5015 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5016 self._autoPublish(aList, theName, "shapeOnCylinder")
5019 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5020 # the specified cylinder by the certain way, defined through \a theState parameter.
5021 # @param theShape Shape to find sub-shapes of.
5022 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5023 # @param theAxis Vector (or line, or linear edge), specifying
5024 # axis of the cylinder to find shapes on.
5025 # @param theRadius Radius of the cylinder to find shapes on.
5026 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5028 # @return List of all found sub-shapes indices.
5030 # @ref swig_GetShapesOnCylinderIDs "Example"
5031 @ManageTransactions("ShapesOp")
5032 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5034 Find in theShape all sub-shapes of type theShapeType, situated relatively
5035 the specified cylinder by the certain way, defined through theState parameter.
5038 theShape Shape to find sub-shapes of.
5039 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5040 theAxis Vector (or line, or linear edge), specifying
5041 axis of the cylinder to find shapes on.
5042 theRadius Radius of the cylinder to find shapes on.
5043 theState The state of the sub-shapes to find (see GEOM::shape_state)
5046 List of all found sub-shapes indices.
5048 # Example: see GEOM_TestOthers.py
5049 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5050 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5053 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5054 # the specified cylinder by the certain way, defined through \a theState parameter.
5055 # @param theShape Shape to find sub-shapes of.
5056 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5057 # @param theAxis Vector (or line, or linear edge), specifying
5058 # axis of the cylinder to find shapes on.
5059 # @param thePnt Point specifying location of the bottom of the cylinder.
5060 # @param theRadius Radius of the cylinder to find shapes on.
5061 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5062 # @param theName Object name; when specified, this parameter is used
5063 # for result publication in the study. Otherwise, if automatic
5064 # publication is switched on, default value is used for result name.
5066 # @return List of all found sub-shapes.
5068 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5069 @ManageTransactions("ShapesOp")
5070 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5072 Find in theShape all sub-shapes of type theShapeType, situated relatively
5073 the specified cylinder by the certain way, defined through theState parameter.
5076 theShape Shape to find sub-shapes of.
5077 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5078 theAxis Vector (or line, or linear edge), specifying
5079 axis of the cylinder to find shapes on.
5080 theRadius Radius of the cylinder to find shapes on.
5081 theState The state of the sub-shapes to find (see GEOM::shape_state)
5082 theName Object name; when specified, this parameter is used
5083 for result publication in the study. Otherwise, if automatic
5084 publication is switched on, default value is used for result name.
5087 List of all found sub-shapes.
5089 # Example: see GEOM_TestOthers.py
5090 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5091 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5092 self._autoPublish(aList, theName, "shapeOnCylinder")
5095 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5096 # the specified cylinder by the certain way, defined through \a theState parameter.
5097 # @param theShape Shape to find sub-shapes of.
5098 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5099 # @param theAxis Vector (or line, or linear edge), specifying
5100 # axis of the cylinder to find shapes on.
5101 # @param thePnt Point specifying location of the bottom of the cylinder.
5102 # @param theRadius Radius of the cylinder to find shapes on.
5103 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5105 # @return List of all found sub-shapes indices
5107 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5108 @ManageTransactions("ShapesOp")
5109 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5111 Find in theShape all sub-shapes of type theShapeType, situated relatively
5112 the specified cylinder by the certain way, defined through theState parameter.
5115 theShape Shape to find sub-shapes of.
5116 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5117 theAxis Vector (or line, or linear edge), specifying
5118 axis of the cylinder to find shapes on.
5119 theRadius Radius of the cylinder to find shapes on.
5120 theState The state of the sub-shapes to find (see GEOM::shape_state)
5123 List of all found sub-shapes indices.
5125 # Example: see GEOM_TestOthers.py
5126 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5127 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5130 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5131 # the specified sphere by the certain way, defined through \a theState parameter.
5132 # @param theShape Shape to find sub-shapes of.
5133 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5134 # @param theCenter Point, specifying center of the sphere to find shapes on.
5135 # @param theRadius Radius of the sphere to find shapes on.
5136 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5137 # @param theName Object name; when specified, this parameter is used
5138 # for result publication in the study. Otherwise, if automatic
5139 # publication is switched on, default value is used for result name.
5141 # @return List of all found sub-shapes.
5143 # @ref swig_GetShapesOnSphere "Example"
5144 @ManageTransactions("ShapesOp")
5145 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5147 Find in theShape all sub-shapes of type theShapeType, situated relatively
5148 the specified sphere by the certain way, defined through theState parameter.
5151 theShape Shape to find sub-shapes of.
5152 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5153 theCenter Point, specifying center of the sphere to find shapes on.
5154 theRadius Radius of the sphere to find shapes on.
5155 theState The state of the sub-shapes to find (see GEOM::shape_state)
5156 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.
5161 List of all found sub-shapes.
5163 # Example: see GEOM_TestOthers.py
5164 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5165 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5166 self._autoPublish(aList, theName, "shapeOnSphere")
5169 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5170 # the specified sphere by the certain way, defined through \a theState parameter.
5171 # @param theShape Shape to find sub-shapes of.
5172 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5173 # @param theCenter Point, specifying center of the sphere to find shapes on.
5174 # @param theRadius Radius of the sphere to find shapes on.
5175 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5177 # @return List of all found sub-shapes indices.
5179 # @ref swig_GetShapesOnSphereIDs "Example"
5180 @ManageTransactions("ShapesOp")
5181 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5183 Find in theShape all sub-shapes of type theShapeType, situated relatively
5184 the specified sphere by the certain way, defined through theState parameter.
5187 theShape Shape to find sub-shapes of.
5188 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5189 theCenter Point, specifying center of the sphere to find shapes on.
5190 theRadius Radius of the sphere to find shapes on.
5191 theState The state of the sub-shapes to find (see GEOM::shape_state)
5194 List of all found sub-shapes indices.
5196 # Example: see GEOM_TestOthers.py
5197 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5198 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5201 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5202 # the specified quadrangle by the certain way, defined through \a theState parameter.
5203 # @param theShape Shape to find sub-shapes of.
5204 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5205 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5206 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5207 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5208 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5209 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5210 # @param theName Object name; when specified, this parameter is used
5211 # for result publication in the study. Otherwise, if automatic
5212 # publication is switched on, default value is used for result name.
5214 # @return List of all found sub-shapes.
5216 # @ref swig_GetShapesOnQuadrangle "Example"
5217 @ManageTransactions("ShapesOp")
5218 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5219 theTopLeftPoint, theTopRigthPoint,
5220 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5222 Find in theShape all sub-shapes of type theShapeType, situated relatively
5223 the specified quadrangle by the certain way, defined through theState parameter.
5226 theShape Shape to find sub-shapes of.
5227 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5228 theTopLeftPoint Point, specifying top left corner of a quadrangle
5229 theTopRigthPoint Point, specifying top right corner of a quadrangle
5230 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5231 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5232 theState The state of the sub-shapes to find (see GEOM::shape_state)
5233 theName Object name; when specified, this parameter is used
5234 for result publication in the study. Otherwise, if automatic
5235 publication is switched on, default value is used for result name.
5238 List of all found sub-shapes.
5240 # Example: see GEOM_TestOthers.py
5241 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5242 theTopLeftPoint, theTopRigthPoint,
5243 theBottomLeftPoint, theBottomRigthPoint, theState)
5244 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5245 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5248 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5249 # the specified quadrangle by the certain way, defined through \a theState parameter.
5250 # @param theShape Shape to find sub-shapes of.
5251 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5252 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5253 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5254 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5255 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5256 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5258 # @return List of all found sub-shapes indices.
5260 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5261 @ManageTransactions("ShapesOp")
5262 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5263 theTopLeftPoint, theTopRigthPoint,
5264 theBottomLeftPoint, theBottomRigthPoint, theState):
5266 Find in theShape all sub-shapes of type theShapeType, situated relatively
5267 the specified quadrangle by the certain way, defined through theState parameter.
5270 theShape Shape to find sub-shapes of.
5271 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5272 theTopLeftPoint Point, specifying top left corner of a quadrangle
5273 theTopRigthPoint Point, specifying top right corner of a quadrangle
5274 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5275 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5276 theState The state of the sub-shapes to find (see GEOM::shape_state)
5279 List of all found sub-shapes indices.
5282 # Example: see GEOM_TestOthers.py
5283 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5284 theTopLeftPoint, theTopRigthPoint,
5285 theBottomLeftPoint, theBottomRigthPoint, theState)
5286 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5289 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5290 # the specified \a theBox by the certain way, defined through \a theState parameter.
5291 # @param theBox Shape for relative comparing.
5292 # @param theShape Shape to find sub-shapes of.
5293 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5294 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5295 # @param theName Object name; when specified, this parameter is used
5296 # for result publication in the study. Otherwise, if automatic
5297 # publication is switched on, default value is used for result name.
5299 # @return List of all found sub-shapes.
5301 # @ref swig_GetShapesOnBox "Example"
5302 @ManageTransactions("ShapesOp")
5303 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5305 Find in theShape all sub-shapes of type theShapeType, situated relatively
5306 the specified theBox by the certain way, defined through theState parameter.
5309 theBox Shape for relative comparing.
5310 theShape Shape to find sub-shapes of.
5311 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5312 theState The state of the sub-shapes to find (see GEOM::shape_state)
5313 theName Object name; when specified, this parameter is used
5314 for result publication in the study. Otherwise, if automatic
5315 publication is switched on, default value is used for result name.
5318 List of all found sub-shapes.
5320 # Example: see GEOM_TestOthers.py
5321 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5322 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5323 self._autoPublish(aList, theName, "shapeOnBox")
5326 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5327 # the specified \a theBox by the certain way, defined through \a theState parameter.
5328 # @param theBox Shape for relative comparing.
5329 # @param theShape Shape to find sub-shapes of.
5330 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5331 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5333 # @return List of all found sub-shapes indices.
5335 # @ref swig_GetShapesOnBoxIDs "Example"
5336 @ManageTransactions("ShapesOp")
5337 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5339 Find in theShape all sub-shapes of type theShapeType, situated relatively
5340 the specified theBox by the certain way, defined through theState parameter.
5343 theBox Shape for relative comparing.
5344 theShape Shape to find sub-shapes of.
5345 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5346 theState The state of the sub-shapes to find (see GEOM::shape_state)
5349 List of all found sub-shapes indices.
5351 # Example: see GEOM_TestOthers.py
5352 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5353 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5356 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5357 # situated relatively the specified \a theCheckShape by the
5358 # certain way, defined through \a theState parameter.
5359 # @param theCheckShape Shape for relative comparing. It must be a solid.
5360 # @param theShape Shape to find sub-shapes of.
5361 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5362 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5363 # @param theName Object name; when specified, this parameter is used
5364 # for result publication in the study. Otherwise, if automatic
5365 # publication is switched on, default value is used for result name.
5367 # @return List of all found sub-shapes.
5369 # @ref swig_GetShapesOnShape "Example"
5370 @ManageTransactions("ShapesOp")
5371 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5373 Find in theShape all sub-shapes of type theShapeType,
5374 situated relatively the specified theCheckShape by the
5375 certain way, defined through theState parameter.
5378 theCheckShape Shape for relative comparing. It must be a solid.
5379 theShape Shape to find sub-shapes of.
5380 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5381 theState The state of the sub-shapes to find (see GEOM::shape_state)
5382 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.
5387 List of all found sub-shapes.
5389 # Example: see GEOM_TestOthers.py
5390 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5391 theShapeType, theState)
5392 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5393 self._autoPublish(aList, theName, "shapeOnShape")
5396 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5397 # situated relatively the specified \a theCheckShape by the
5398 # certain way, defined through \a theState parameter.
5399 # @param theCheckShape Shape for relative comparing. It must be a solid.
5400 # @param theShape Shape to find sub-shapes of.
5401 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5402 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5403 # @param theName Object name; when specified, this parameter is used
5404 # for result publication in the study. Otherwise, if automatic
5405 # publication is switched on, default value is used for result name.
5407 # @return All found sub-shapes as compound.
5409 # @ref swig_GetShapesOnShapeAsCompound "Example"
5410 @ManageTransactions("ShapesOp")
5411 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5413 Find in theShape all sub-shapes of type theShapeType,
5414 situated relatively the specified theCheckShape by the
5415 certain way, defined through theState parameter.
5418 theCheckShape Shape for relative comparing. It must be a solid.
5419 theShape Shape to find sub-shapes of.
5420 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5421 theState The state of the sub-shapes to find (see GEOM::shape_state)
5422 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.
5427 All found sub-shapes as compound.
5429 # Example: see GEOM_TestOthers.py
5430 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5431 theShapeType, theState)
5432 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5433 self._autoPublish(anObj, theName, "shapeOnShape")
5436 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5437 # situated relatively the specified \a theCheckShape by the
5438 # certain way, defined through \a theState parameter.
5439 # @param theCheckShape Shape for relative comparing. It must be a solid.
5440 # @param theShape Shape to find sub-shapes of.
5441 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5442 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5444 # @return List of all found sub-shapes indices.
5446 # @ref swig_GetShapesOnShapeIDs "Example"
5447 @ManageTransactions("ShapesOp")
5448 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5450 Find in theShape all sub-shapes of type theShapeType,
5451 situated relatively the specified theCheckShape by the
5452 certain way, defined through theState parameter.
5455 theCheckShape Shape for relative comparing. It must be a solid.
5456 theShape Shape to find sub-shapes of.
5457 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5458 theState The state of the sub-shapes to find (see GEOM::shape_state)
5461 List of all found sub-shapes indices.
5463 # Example: see GEOM_TestOthers.py
5464 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5465 theShapeType, theState)
5466 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5469 ## Get sub-shape(s) of theShapeWhere, which are
5470 # coincident with \a theShapeWhat or could be a part of it.
5471 # @param theShapeWhere Shape to find sub-shapes of.
5472 # @param theShapeWhat Shape, specifying what to find.
5473 # @param isNewImplementation implementation of GetInPlace functionality
5474 # (default = False, old alghorithm based on shape properties)
5475 # @param theName Object name; when specified, this parameter is used
5476 # for result publication in the study. Otherwise, if automatic
5477 # publication is switched on, default value is used for result name.
5479 # @return Group of all found sub-shapes or a single found sub-shape.
5481 # @note This function has a restriction on argument shapes.
5482 # If \a theShapeWhere has curved parts with significantly
5483 # outstanding centres (i.e. the mass centre of a part is closer to
5484 # \a theShapeWhat than to the part), such parts will not be found.
5485 # @image html get_in_place_lost_part.png
5487 # @ref swig_GetInPlace "Example"
5488 @ManageTransactions("ShapesOp")
5489 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5491 Get sub-shape(s) of theShapeWhere, which are
5492 coincident with theShapeWhat or could be a part of it.
5495 theShapeWhere Shape to find sub-shapes of.
5496 theShapeWhat Shape, specifying what to find.
5497 isNewImplementation Implementation of GetInPlace functionality
5498 (default = False, old alghorithm based on shape properties)
5499 theName Object name; when specified, this parameter is used
5500 for result publication in the study. Otherwise, if automatic
5501 publication is switched on, default value is used for result name.
5504 Group of all found sub-shapes or a single found sub-shape.
5508 This function has a restriction on argument shapes.
5509 If theShapeWhere has curved parts with significantly
5510 outstanding centres (i.e. the mass centre of a part is closer to
5511 theShapeWhat than to the part), such parts will not be found.
5513 # Example: see GEOM_TestOthers.py
5515 if isNewImplementation:
5516 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5518 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5520 RaiseIfFailed("GetInPlace", self.ShapesOp)
5521 self._autoPublish(anObj, theName, "inplace")
5524 ## Get sub-shape(s) of \a theShapeWhere, which are
5525 # coincident with \a theShapeWhat or could be a part of it.
5527 # Implementation of this method is based on a saved history of an operation,
5528 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5529 # arguments (an argument shape or a sub-shape of an argument shape).
5530 # The operation could be the Partition or one of boolean operations,
5531 # performed on simple shapes (not on compounds).
5533 # @param theShapeWhere Shape to find sub-shapes of.
5534 # @param theShapeWhat Shape, specifying what to find (must be in the
5535 # building history of the ShapeWhere).
5536 # @param theName Object name; when specified, this parameter is used
5537 # for result publication in the study. Otherwise, if automatic
5538 # publication is switched on, default value is used for result name.
5540 # @return Group of all found sub-shapes or a single found sub-shape.
5542 # @ref swig_GetInPlace "Example"
5543 @ManageTransactions("ShapesOp")
5544 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5546 Implementation of this method is based on a saved history of an operation,
5547 produced theShapeWhere. The 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).
5553 theShapeWhere Shape to find sub-shapes of.
5554 theShapeWhat Shape, specifying what to find (must be in the
5555 building history of the ShapeWhere).
5556 theName Object name; when specified, this parameter is used
5557 for result publication in the study. Otherwise, if automatic
5558 publication is switched on, default value is used for result name.
5561 Group of all found sub-shapes or a single found sub-shape.
5563 # Example: see GEOM_TestOthers.py
5564 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5565 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5566 self._autoPublish(anObj, theName, "inplace")
5569 ## Get sub-shape of theShapeWhere, which is
5570 # equal to \a theShapeWhat.
5571 # @param theShapeWhere Shape to find sub-shape of.
5572 # @param theShapeWhat Shape, specifying what to find.
5573 # @param theName Object name; when specified, this parameter is used
5574 # for result publication in the study. Otherwise, if automatic
5575 # publication is switched on, default value is used for result name.
5577 # @return New GEOM.GEOM_Object for found sub-shape.
5579 # @ref swig_GetSame "Example"
5580 @ManageTransactions("ShapesOp")
5581 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5583 Get sub-shape of theShapeWhere, which is
5584 equal to theShapeWhat.
5587 theShapeWhere Shape to find sub-shape of.
5588 theShapeWhat Shape, specifying what to find.
5589 theName Object name; when specified, this parameter is used
5590 for result publication in the study. Otherwise, if automatic
5591 publication is switched on, default value is used for result name.
5594 New GEOM.GEOM_Object for found sub-shape.
5596 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5597 RaiseIfFailed("GetSame", self.ShapesOp)
5598 self._autoPublish(anObj, theName, "sameShape")
5602 ## Get sub-shape indices of theShapeWhere, which is
5603 # equal to \a theShapeWhat.
5604 # @param theShapeWhere Shape to find sub-shape of.
5605 # @param theShapeWhat Shape, specifying what to find.
5606 # @return List of all found sub-shapes indices.
5608 # @ref swig_GetSame "Example"
5609 @ManageTransactions("ShapesOp")
5610 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5612 Get sub-shape indices of theShapeWhere, which is
5613 equal to theShapeWhat.
5616 theShapeWhere Shape to find sub-shape of.
5617 theShapeWhat Shape, specifying what to find.
5620 List of all found sub-shapes indices.
5622 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5623 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5630 ## @addtogroup l4_access
5633 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5634 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5635 # @param aShape Shape to get sub-shape of.
5636 # @param ListOfID List of sub-shapes indices.
5637 # @param theName Object name; when specified, this parameter is used
5638 # for result publication in the study. Otherwise, if automatic
5639 # publication is switched on, default value is used for result name.
5641 # @return Found sub-shape.
5643 # @ref swig_all_decompose "Example"
5644 def GetSubShape(self, aShape, ListOfID, theName=None):
5646 Obtain a composite sub-shape of aShape, composed from sub-shapes
5647 of aShape, selected by their unique IDs inside aShape
5650 aShape Shape to get sub-shape of.
5651 ListOfID List of sub-shapes indices.
5652 theName Object name; when specified, this parameter is used
5653 for result publication in the study. Otherwise, if automatic
5654 publication is switched on, default value is used for result name.
5659 # Example: see GEOM_TestAll.py
5660 anObj = self.AddSubShape(aShape,ListOfID)
5661 self._autoPublish(anObj, theName, "subshape")
5664 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5665 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5666 # @param aShape Shape to get sub-shape of.
5667 # @param aSubShape Sub-shapes of aShape.
5668 # @return ID of found sub-shape.
5670 # @ref swig_all_decompose "Example"
5671 @ManageTransactions("LocalOp")
5672 def GetSubShapeID(self, aShape, aSubShape):
5674 Obtain unique ID of sub-shape aSubShape inside aShape
5675 of aShape, selected by their unique IDs inside aShape
5678 aShape Shape to get sub-shape of.
5679 aSubShape Sub-shapes of aShape.
5682 ID of found sub-shape.
5684 # Example: see GEOM_TestAll.py
5685 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5686 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5689 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5690 # This function is provided for performance purpose. The complexity is O(n) with n
5691 # the number of subobjects of aShape
5692 # @param aShape Shape to get sub-shape of.
5693 # @param aSubShapes Sub-shapes of aShape.
5694 # @return list of IDs of found sub-shapes.
5696 # @ref swig_all_decompose "Example"
5697 @ManageTransactions("ShapesOp")
5698 def GetSubShapesIDs(self, aShape, aSubShapes):
5700 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5701 This function is provided for performance purpose. The complexity is O(n) with n
5702 the number of subobjects of aShape
5705 aShape Shape to get sub-shape of.
5706 aSubShapes Sub-shapes of aShape.
5709 List of IDs of found sub-shape.
5711 # Example: see GEOM_TestAll.py
5712 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5713 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5719 ## @addtogroup l4_decompose
5722 ## Get all sub-shapes and groups of \a theShape,
5723 # that were created already by any other methods.
5724 # @param theShape Any shape.
5725 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5726 # returned, else all found sub-shapes and groups.
5727 # @return List of existing sub-objects of \a theShape.
5729 # @ref swig_all_decompose "Example"
5730 @ManageTransactions("ShapesOp")
5731 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5733 Get all sub-shapes and groups of theShape,
5734 that were created already by any other methods.
5738 theGroupsOnly If this parameter is TRUE, only groups will be
5739 returned, else all found sub-shapes and groups.
5742 List of existing sub-objects of theShape.
5744 # Example: see GEOM_TestAll.py
5745 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5746 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5749 ## Get all groups of \a theShape,
5750 # that were created already by any other methods.
5751 # @param theShape Any shape.
5752 # @return List of existing groups of \a theShape.
5754 # @ref swig_all_decompose "Example"
5755 @ManageTransactions("ShapesOp")
5756 def GetGroups(self, theShape):
5758 Get all groups of theShape,
5759 that were created already by any other methods.
5765 List of existing groups of theShape.
5767 # Example: see GEOM_TestAll.py
5768 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5769 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5772 ## Explode a shape on sub-shapes of a given type.
5773 # If the shape itself matches the type, it is also returned.
5774 # @param aShape Shape to be exploded.
5775 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5776 # @param theName Object name; when specified, this parameter is used
5777 # for result publication in the study. Otherwise, if automatic
5778 # publication is switched on, default value is used for result name.
5780 # @return List of sub-shapes of type theShapeType, contained in theShape.
5782 # @ref swig_all_decompose "Example"
5783 @ManageTransactions("ShapesOp")
5784 def SubShapeAll(self, aShape, aType, theName=None):
5786 Explode a shape on sub-shapes of a given type.
5787 If the shape itself matches the type, it is also returned.
5790 aShape Shape to be exploded.
5791 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5792 theName Object name; when specified, this parameter is used
5793 for result publication in the study. Otherwise, if automatic
5794 publication is switched on, default value is used for result name.
5797 List of sub-shapes of type theShapeType, contained in theShape.
5799 # Example: see GEOM_TestAll.py
5800 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5801 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5802 self._autoPublish(ListObj, theName, "subshape")
5805 ## Explode a shape on sub-shapes of a given type.
5806 # @param aShape Shape to be exploded.
5807 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5808 # @return List of IDs of sub-shapes.
5810 # @ref swig_all_decompose "Example"
5811 @ManageTransactions("ShapesOp")
5812 def SubShapeAllIDs(self, aShape, aType):
5814 Explode a shape on sub-shapes of a given type.
5817 aShape Shape to be exploded (see geompy.ShapeType)
5818 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5821 List of IDs of sub-shapes.
5823 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5824 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5827 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5828 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
5829 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5830 # @param aShape Shape to get sub-shape of.
5831 # @param ListOfInd List of sub-shapes indices.
5832 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5833 # @param theName Object name; when specified, this parameter is used
5834 # for result publication in the study. Otherwise, if automatic
5835 # publication is switched on, default value is used for result name.
5837 # @return A compound of sub-shapes of aShape.
5839 # @ref swig_all_decompose "Example"
5840 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5842 Obtain a compound of sub-shapes of aShape,
5843 selected by their indices in list of all sub-shapes of type aType.
5844 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5847 aShape Shape to get sub-shape of.
5848 ListOfID List of sub-shapes indices.
5849 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5850 theName Object name; when specified, this parameter is used
5851 for result publication in the study. Otherwise, if automatic
5852 publication is switched on, default value is used for result name.
5855 A compound of sub-shapes of aShape.
5857 # Example: see GEOM_TestAll.py
5859 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5860 for ind in ListOfInd:
5861 ListOfIDs.append(AllShapeIDsList[ind - 1])
5862 # note: auto-publishing is done in self.GetSubShape()
5863 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5866 ## Explode a shape on sub-shapes of a given type.
5867 # Sub-shapes will be sorted taking into account their gravity centers,
5868 # to provide stable order of sub-shapes.
5869 # If the shape itself matches the type, it is also returned.
5870 # @param aShape Shape to be exploded.
5871 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5872 # @param theName Object name; when specified, this parameter is used
5873 # for result publication in the study. Otherwise, if automatic
5874 # publication is switched on, default value is used for result name.
5876 # @return List of sub-shapes of type theShapeType, contained in theShape.
5878 # @ref swig_SubShapeAllSorted "Example"
5879 @ManageTransactions("ShapesOp")
5880 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5882 Explode a shape on sub-shapes of a given type.
5883 Sub-shapes will be sorted taking into account their gravity centers,
5884 to provide stable order of sub-shapes.
5885 If the shape itself matches the type, it is also returned.
5888 aShape Shape to be exploded.
5889 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5890 theName Object name; when specified, this parameter is used
5891 for result publication in the study. Otherwise, if automatic
5892 publication is switched on, default value is used for result name.
5895 List of sub-shapes of type theShapeType, contained in theShape.
5897 # Example: see GEOM_TestAll.py
5898 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5899 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5900 self._autoPublish(ListObj, theName, "subshape")
5903 ## Explode a shape on sub-shapes of a given type.
5904 # Sub-shapes will be sorted taking into account their gravity centers,
5905 # to provide stable order of sub-shapes.
5906 # @param aShape Shape to be exploded.
5907 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5908 # @return List of IDs of sub-shapes.
5910 # @ref swig_all_decompose "Example"
5911 @ManageTransactions("ShapesOp")
5912 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5914 Explode a shape on sub-shapes of a given type.
5915 Sub-shapes will be sorted taking into account their gravity centers,
5916 to provide stable order of sub-shapes.
5919 aShape Shape to be exploded.
5920 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5923 List of IDs of sub-shapes.
5925 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5926 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5929 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5930 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5931 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5932 # @param aShape Shape to get sub-shape of.
5933 # @param ListOfInd List of sub-shapes indices.
5934 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5935 # @param theName Object name; when specified, this parameter is used
5936 # for result publication in the study. Otherwise, if automatic
5937 # publication is switched on, default value is used for result name.
5939 # @return A compound of sub-shapes of aShape.
5941 # @ref swig_all_decompose "Example"
5942 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5944 Obtain a compound of sub-shapes of aShape,
5945 selected by they indices in sorted list of all sub-shapes of type aType.
5946 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5949 aShape Shape to get sub-shape of.
5950 ListOfID List of sub-shapes indices.
5951 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5952 theName Object name; when specified, this parameter is used
5953 for result publication in the study. Otherwise, if automatic
5954 publication is switched on, default value is used for result name.
5957 A compound of sub-shapes of aShape.
5959 # Example: see GEOM_TestAll.py
5961 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5962 for ind in ListOfInd:
5963 ListOfIDs.append(AllShapeIDsList[ind - 1])
5964 # note: auto-publishing is done in self.GetSubShape()
5965 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5968 ## Extract shapes (excluding the main shape) of given type.
5969 # @param aShape The shape.
5970 # @param aType The shape type (see ShapeType())
5971 # @param isSorted Boolean flag to switch sorting on/off.
5972 # @param theName Object name; when specified, this parameter is used
5973 # for result publication in the study. Otherwise, if automatic
5974 # publication is switched on, default value is used for result name.
5976 # @return List of sub-shapes of type aType, contained in aShape.
5978 # @ref swig_FilletChamfer "Example"
5979 @ManageTransactions("ShapesOp")
5980 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5982 Extract shapes (excluding the main shape) of given type.
5986 aType The shape type (see geompy.ShapeType)
5987 isSorted Boolean flag to switch sorting on/off.
5988 theName Object name; when specified, this parameter is used
5989 for result publication in the study. Otherwise, if automatic
5990 publication is switched on, default value is used for result name.
5993 List of sub-shapes of type aType, contained in aShape.
5995 # Example: see GEOM_TestAll.py
5996 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5997 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5998 self._autoPublish(ListObj, theName, "subshape")
6001 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6002 # @param aShape Main shape.
6003 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6004 # @param theName Object name; when specified, this parameter is used
6005 # for result publication in the study. Otherwise, if automatic
6006 # publication is switched on, default value is used for result name.
6007 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6009 # @ref swig_all_decompose "Example"
6010 @ManageTransactions("ShapesOp")
6011 def SubShapes(self, aShape, anIDs, theName=None):
6013 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6017 anIDs List of unique IDs of sub-shapes inside theMainShape.
6018 theName Object name; when specified, this parameter is used
6019 for result publication in the study. Otherwise, if automatic
6020 publication is switched on, default value is used for result name.
6023 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6025 # Example: see GEOM_TestAll.py
6026 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6027 RaiseIfFailed("SubShapes", self.ShapesOp)
6028 self._autoPublish(ListObj, theName, "subshape")
6031 # end of l4_decompose
6034 ## @addtogroup l4_decompose_d
6037 ## Deprecated method
6038 # It works like SubShapeAllSortedCentres(), but wrongly
6039 # defines centres of faces, shells and solids.
6040 @ManageTransactions("ShapesOp")
6041 def SubShapeAllSorted(self, aShape, aType, theName=None):
6044 It works like geompy.SubShapeAllSortedCentres, but wrongly
6045 defines centres of faces, shells and solids.
6047 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6048 RaiseIfFailed("MakeExplode", self.ShapesOp)
6049 self._autoPublish(ListObj, theName, "subshape")
6052 ## Deprecated method
6053 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6054 # defines centres of faces, shells and solids.
6055 @ManageTransactions("ShapesOp")
6056 def SubShapeAllSortedIDs(self, aShape, aType):
6059 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6060 defines centres of faces, shells and solids.
6062 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6063 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6066 ## Deprecated method
6067 # It works like SubShapeSortedCentres(), but has a bug
6068 # (wrongly defines centres of faces, shells and solids).
6069 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6072 It works like geompy.SubShapeSortedCentres, but has a bug
6073 (wrongly defines centres of faces, shells and solids).
6076 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6077 for ind in ListOfInd:
6078 ListOfIDs.append(AllShapeIDsList[ind - 1])
6079 # note: auto-publishing is done in self.GetSubShape()
6080 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6083 # end of l4_decompose_d
6086 ## @addtogroup l3_healing
6089 ## Apply a sequence of Shape Healing operators to the given object.
6090 # @param theShape Shape to be processed.
6091 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6092 # @param theParameters List of names of parameters
6093 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6094 # @param theValues List of values of parameters, in the same order
6095 # as parameters are listed in <VAR>theParameters</VAR> list.
6096 # @param theName Object name; when specified, this parameter is used
6097 # for result publication in the study. Otherwise, if automatic
6098 # publication is switched on, default value is used for result name.
6100 # <b> Operators and Parameters: </b> \n
6102 # * \b FixShape - corrects invalid shapes. \n
6103 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6104 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6106 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6107 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6108 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6109 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6111 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6112 # surfaces in segments using a certain angle. \n
6113 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6114 # if Angle=180, four if Angle=90, etc). \n
6115 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6117 # * \b SplitClosedFaces - splits closed faces in segments.
6118 # The number of segments depends on the number of splitting points.\n
6119 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6121 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6122 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6123 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6124 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6125 # This and the previous parameters can take the following values:\n
6126 # \b Parametric \b Continuity \n
6127 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6128 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6129 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6130 # ruling out sharp edges).\n
6131 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6132 # are of the same magnitude).\n
6133 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6134 # or surfaces (d/du C(u)) are the same at junction. \n
6135 # \b Geometric \b Continuity \n
6136 # \b G1: first derivatives are proportional at junction.\n
6137 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6138 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6139 # \b G2: first and second derivatives are proportional at junction.
6140 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6141 # continuity requires that the underlying parameterization was continuous as well.
6142 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6144 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6145 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6146 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6147 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6148 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6149 # with the specified parameters.\n
6150 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6151 # with the specified parameters.\n
6152 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6153 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6154 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6155 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6157 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6158 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6159 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6160 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6161 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6163 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6164 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6167 # @return New GEOM.GEOM_Object, containing processed shape.
6169 # \n @ref tui_shape_processing "Example"
6170 @ManageTransactions("HealOp")
6171 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6173 Apply a sequence of Shape Healing operators to the given object.
6176 theShape Shape to be processed.
6177 theValues List of values of parameters, in the same order
6178 as parameters are listed in theParameters list.
6179 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6180 theParameters List of names of parameters
6181 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6182 theName Object name; when specified, this parameter is used
6183 for result publication in the study. Otherwise, if automatic
6184 publication is switched on, default value is used for result name.
6186 Operators and Parameters:
6188 * FixShape - corrects invalid shapes.
6189 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6190 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6191 * FixFaceSize - removes small faces, such as spots and strips.
6192 * FixFaceSize.Tolerance - defines minimum possible face size.
6193 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6194 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6195 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6196 in segments using a certain angle.
6197 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6198 if Angle=180, four if Angle=90, etc).
6199 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6200 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6202 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6203 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6204 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6205 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6206 * SplitContinuity.CurveContinuity - required continuity for curves.
6207 This and the previous parameters can take the following values:
6209 Parametric Continuity:
6210 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6211 coincidental. The curves or surfaces may still meet at an angle,
6212 giving rise to a sharp corner or edge).
6213 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6214 are parallel, ruling out sharp edges).
6215 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6216 or surfaces are of the same magnitude).
6217 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6218 curves or surfaces (d/du C(u)) are the same at junction.
6220 Geometric Continuity:
6221 G1: first derivatives are proportional at junction.
6222 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6223 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6224 G2: first and second derivatives are proportional at junction. As the names imply,
6225 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6226 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6227 geometric continuity of order n, but not vice-versa.
6228 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6229 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6230 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6231 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6232 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6233 the specified parameters.
6234 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6235 the specified parameters.
6236 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6237 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6238 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6239 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6240 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6241 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6242 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6243 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6244 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6245 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6246 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6249 New GEOM.GEOM_Object, containing processed shape.
6251 Note: For more information look through SALOME Geometry User's Guide->
6252 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6254 # Example: see GEOM_TestHealing.py
6255 theValues,Parameters = ParseList(theValues)
6256 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6257 # To avoid script failure in case of good argument shape
6258 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6260 RaiseIfFailed("ProcessShape", self.HealOp)
6261 for string in (theOperators + theParameters):
6262 Parameters = ":" + Parameters
6264 anObj.SetParameters(Parameters)
6265 self._autoPublish(anObj, theName, "healed")
6268 ## Remove faces from the given object (shape).
6269 # @param theObject Shape to be processed.
6270 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6271 # removes ALL faces of the given object.
6272 # @param theName Object name; when specified, this parameter is used
6273 # for result publication in the study. Otherwise, if automatic
6274 # publication is switched on, default value is used for result name.
6276 # @return New GEOM.GEOM_Object, containing processed shape.
6278 # @ref tui_suppress_faces "Example"
6279 @ManageTransactions("HealOp")
6280 def SuppressFaces(self, theObject, theFaces, theName=None):
6282 Remove faces from the given object (shape).
6285 theObject Shape to be processed.
6286 theFaces Indices of faces to be removed, if EMPTY then the method
6287 removes ALL faces of the given object.
6288 theName Object name; when specified, this parameter is used
6289 for result publication in the study. Otherwise, if automatic
6290 publication is switched on, default value is used for result name.
6293 New GEOM.GEOM_Object, containing processed shape.
6295 # Example: see GEOM_TestHealing.py
6296 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6297 RaiseIfFailed("SuppressFaces", self.HealOp)
6298 self._autoPublish(anObj, theName, "suppressFaces")
6301 ## Sewing of some shapes into single shape.
6302 # @param ListShape Shapes to be processed.
6303 # @param theTolerance Required tolerance value.
6304 # @param AllowNonManifold Flag that allows non-manifold sewing.
6305 # @param theName Object name; when specified, this parameter is used
6306 # for result publication in the study. Otherwise, if automatic
6307 # publication is switched on, default value is used for result name.
6309 # @return New GEOM.GEOM_Object, containing processed shape.
6311 # @ref tui_sewing "Example"
6312 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6314 Sewing of some shapes into single shape.
6317 ListShape Shapes to be processed.
6318 theTolerance Required tolerance value.
6319 AllowNonManifold Flag that allows non-manifold sewing.
6320 theName Object name; when specified, this parameter is used
6321 for result publication in the study. Otherwise, if automatic
6322 publication is switched on, default value is used for result name.
6325 New GEOM.GEOM_Object, containing processed shape.
6327 # Example: see GEOM_TestHealing.py
6328 comp = self.MakeCompound(ListShape)
6329 # note: auto-publishing is done in self.Sew()
6330 anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
6333 ## Sewing of the given object.
6334 # @param theObject Shape to be processed.
6335 # @param theTolerance Required tolerance value.
6336 # @param AllowNonManifold Flag that allows non-manifold sewing.
6337 # @param theName Object name; when specified, this parameter is used
6338 # for result publication in the study. Otherwise, if automatic
6339 # publication is switched on, default value is used for result name.
6341 # @return New GEOM.GEOM_Object, containing processed shape.
6342 @ManageTransactions("HealOp")
6343 def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
6345 Sewing of the given object.
6348 theObject Shape to be processed.
6349 theTolerance Required tolerance value.
6350 AllowNonManifold Flag that allows non-manifold sewing.
6351 theName Object name; when specified, this parameter is used
6352 for result publication in the study. Otherwise, if automatic
6353 publication is switched on, default value is used for result name.
6356 New GEOM.GEOM_Object, containing processed shape.
6358 # Example: see MakeSewing() above
6359 theTolerance,Parameters = ParseParameters(theTolerance)
6360 if AllowNonManifold:
6361 anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
6363 anObj = self.HealOp.Sew(theObject, theTolerance)
6364 # To avoid script failure in case of good argument shape
6365 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6367 RaiseIfFailed("Sew", self.HealOp)
6368 anObj.SetParameters(Parameters)
6369 self._autoPublish(anObj, theName, "sewed")
6372 ## Rebuild the topology of theCompound of solids by removing
6373 # of the faces that are shared by several solids.
6374 # @param theCompound Shape to be processed.
6375 # @param theName Object name; when specified, this parameter is used
6376 # for result publication in the study. Otherwise, if automatic
6377 # publication is switched on, default value is used for result name.
6379 # @return New GEOM.GEOM_Object, containing processed shape.
6381 # @ref tui_remove_webs "Example"
6382 @ManageTransactions("HealOp")
6383 def RemoveInternalFaces (self, theCompound, theName=None):
6385 Rebuild the topology of theCompound of solids by removing
6386 of the faces that are shared by several solids.
6389 theCompound Shape to be processed.
6390 theName Object name; when specified, this parameter is used
6391 for result publication in the study. Otherwise, if automatic
6392 publication is switched on, default value is used for result name.
6395 New GEOM.GEOM_Object, containing processed shape.
6397 # Example: see GEOM_TestHealing.py
6398 anObj = self.HealOp.RemoveInternalFaces(theCompound)
6399 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6400 self._autoPublish(anObj, theName, "removeWebs")
6403 ## Remove internal wires and edges from the given object (face).
6404 # @param theObject Shape to be processed.
6405 # @param theWires Indices of wires to be removed, if EMPTY then the method
6406 # removes ALL internal wires of the given object.
6407 # @param theName Object name; when specified, this parameter is used
6408 # for result publication in the study. Otherwise, if automatic
6409 # publication is switched on, default value is used for result name.
6411 # @return New GEOM.GEOM_Object, containing processed shape.
6413 # @ref tui_suppress_internal_wires "Example"
6414 @ManageTransactions("HealOp")
6415 def SuppressInternalWires(self, theObject, theWires, theName=None):
6417 Remove internal wires and edges from the given object (face).
6420 theObject Shape to be processed.
6421 theWires Indices of wires to be removed, if EMPTY then the method
6422 removes ALL internal wires of the given object.
6423 theName Object name; when specified, this parameter is used
6424 for result publication in the study. Otherwise, if automatic
6425 publication is switched on, default value is used for result name.
6428 New GEOM.GEOM_Object, containing processed shape.
6430 # Example: see GEOM_TestHealing.py
6431 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6432 RaiseIfFailed("RemoveIntWires", self.HealOp)
6433 self._autoPublish(anObj, theName, "suppressWires")
6436 ## Remove internal closed contours (holes) from the given object.
6437 # @param theObject Shape to be processed.
6438 # @param theWires Indices of wires to be removed, if EMPTY then the method
6439 # removes ALL internal holes of the given object
6440 # @param theName Object name; when specified, this parameter is used
6441 # for result publication in the study. Otherwise, if automatic
6442 # publication is switched on, default value is used for result name.
6444 # @return New GEOM.GEOM_Object, containing processed shape.
6446 # @ref tui_suppress_holes "Example"
6447 @ManageTransactions("HealOp")
6448 def SuppressHoles(self, theObject, theWires, theName=None):
6450 Remove internal closed contours (holes) from the given object.
6453 theObject Shape to be processed.
6454 theWires Indices of wires to be removed, if EMPTY then the method
6455 removes ALL internal holes of the given object
6456 theName Object name; when specified, this parameter is used
6457 for result publication in the study. Otherwise, if automatic
6458 publication is switched on, default value is used for result name.
6461 New GEOM.GEOM_Object, containing processed shape.
6463 # Example: see GEOM_TestHealing.py
6464 anObj = self.HealOp.FillHoles(theObject, theWires)
6465 RaiseIfFailed("FillHoles", self.HealOp)
6466 self._autoPublish(anObj, theName, "suppressHoles")
6469 ## Close an open wire.
6470 # @param theObject Shape to be processed.
6471 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6472 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6473 # @param isCommonVertex If True : closure by creation of a common vertex,
6474 # If False : closure by creation of an edge between ends.
6475 # @param 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.
6479 # @return New GEOM.GEOM_Object, containing processed shape.
6481 # @ref tui_close_contour "Example"
6482 @ManageTransactions("HealOp")
6483 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6488 theObject Shape to be processed.
6489 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6490 if [ ], then theObject itself is a wire.
6491 isCommonVertex If True : closure by creation of a common vertex,
6492 If False : closure by creation of an edge between ends.
6493 theName Object name; when specified, this parameter is used
6494 for result publication in the study. Otherwise, if automatic
6495 publication is switched on, default value is used for result name.
6498 New GEOM.GEOM_Object, containing processed shape.
6500 # Example: see GEOM_TestHealing.py
6501 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6502 RaiseIfFailed("CloseContour", self.HealOp)
6503 self._autoPublish(anObj, theName, "closeContour")
6506 ## Addition of a point to a given edge object.
6507 # @param theObject Shape to be processed.
6508 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6509 # if -1, then theObject itself is the edge.
6510 # @param theValue Value of parameter on edge or length parameter,
6511 # depending on \a isByParameter.
6512 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6513 # if FALSE : \a theValue is treated as a length parameter [0..1]
6514 # @param theName Object name; when specified, this parameter is used
6515 # for result publication in the study. Otherwise, if automatic
6516 # publication is switched on, default value is used for result name.
6518 # @return New GEOM.GEOM_Object, containing processed shape.
6520 # @ref tui_add_point_on_edge "Example"
6521 @ManageTransactions("HealOp")
6522 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6524 Addition of a point to a given edge object.
6527 theObject Shape to be processed.
6528 theEdgeIndex Index of edge to be divided within theObject's shape,
6529 if -1, then theObject itself is the edge.
6530 theValue Value of parameter on edge or length parameter,
6531 depending on isByParameter.
6532 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6533 if FALSE : theValue is treated as a length parameter [0..1]
6534 theName Object name; when specified, this parameter is used
6535 for result publication in the study. Otherwise, if automatic
6536 publication is switched on, default value is used for result name.
6539 New GEOM.GEOM_Object, containing processed shape.
6541 # Example: see GEOM_TestHealing.py
6542 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6543 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6544 RaiseIfFailed("DivideEdge", self.HealOp)
6545 anObj.SetParameters(Parameters)
6546 self._autoPublish(anObj, theName, "divideEdge")
6549 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6550 # @param theWire Wire to minimize the number of C1 continuous edges in.
6551 # @param theVertices A list of vertices to suppress. If the list
6552 # is empty, all vertices in a wire will be assumed.
6553 # @param 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.
6557 # @return New GEOM.GEOM_Object with modified wire.
6559 # @ref tui_fuse_collinear_edges "Example"
6560 @ManageTransactions("HealOp")
6561 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6563 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6566 theWire Wire to minimize the number of C1 continuous edges in.
6567 theVertices A list of vertices to suppress. If the list
6568 is empty, all vertices in a wire will be assumed.
6569 theName Object name; when specified, this parameter is used
6570 for result publication in the study. Otherwise, if automatic
6571 publication is switched on, default value is used for result name.
6574 New GEOM.GEOM_Object with modified wire.
6576 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6577 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6578 self._autoPublish(anObj, theName, "fuseEdges")
6581 ## Change orientation of the given object. Updates given shape.
6582 # @param theObject Shape to be processed.
6583 # @return Updated <var>theObject</var>
6585 # @ref swig_todo "Example"
6586 @ManageTransactions("HealOp")
6587 def ChangeOrientationShell(self,theObject):
6589 Change orientation of the given object. Updates given shape.
6592 theObject Shape to be processed.
6597 theObject = self.HealOp.ChangeOrientation(theObject)
6598 RaiseIfFailed("ChangeOrientation", self.HealOp)
6601 ## Change orientation of the given object.
6602 # @param theObject Shape to be processed.
6603 # @param theName Object name; when specified, this parameter is used
6604 # for result publication in the study. Otherwise, if automatic
6605 # publication is switched on, default value is used for result name.
6607 # @return New GEOM.GEOM_Object, containing processed shape.
6609 # @ref swig_todo "Example"
6610 @ManageTransactions("HealOp")
6611 def ChangeOrientationShellCopy(self, theObject, theName=None):
6613 Change orientation of the given object.
6616 theObject Shape to be processed.
6617 theName Object name; when specified, this parameter is used
6618 for result publication in the study. Otherwise, if automatic
6619 publication is switched on, default value is used for result name.
6622 New GEOM.GEOM_Object, containing processed shape.
6624 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6625 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6626 self._autoPublish(anObj, theName, "reversed")
6629 ## Try to limit tolerance of the given object by value \a theTolerance.
6630 # @param theObject Shape to be processed.
6631 # @param theTolerance Required tolerance value.
6632 # @param theName Object name; when specified, this parameter is used
6633 # for result publication in the study. Otherwise, if automatic
6634 # publication is switched on, default value is used for result name.
6636 # @return New GEOM.GEOM_Object, containing processed shape.
6638 # @ref tui_limit_tolerance "Example"
6639 @ManageTransactions("HealOp")
6640 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6642 Try to limit tolerance of the given object by value theTolerance.
6645 theObject Shape to be processed.
6646 theTolerance Required tolerance value.
6647 theName Object name; when specified, this parameter is used
6648 for result publication in the study. Otherwise, if automatic
6649 publication is switched on, default value is used for result name.
6652 New GEOM.GEOM_Object, containing processed shape.
6654 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6655 RaiseIfFailed("LimitTolerance", self.HealOp)
6656 self._autoPublish(anObj, theName, "limitTolerance")
6659 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6660 # that constitute a free boundary of the given shape.
6661 # @param theObject Shape to get free boundary of.
6662 # @param theName Object name; when specified, this parameter is used
6663 # for result publication in the study. Otherwise, if automatic
6664 # publication is switched on, default value is used for result name.
6666 # @return [\a status, \a theClosedWires, \a theOpenWires]
6667 # \n \a status: FALSE, if an error(s) occured during the method execution.
6668 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6669 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6671 # @ref tui_measurement_tools_page "Example"
6672 @ManageTransactions("HealOp")
6673 def GetFreeBoundary(self, theObject, theName=None):
6675 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6676 that constitute a free boundary of the given shape.
6679 theObject Shape to get free boundary of.
6680 theName Object name; when specified, this parameter is used
6681 for result publication in the study. Otherwise, if automatic
6682 publication is switched on, default value is used for result name.
6685 [status, theClosedWires, theOpenWires]
6686 status: FALSE, if an error(s) occured during the method execution.
6687 theClosedWires: Closed wires on the free boundary of the given shape.
6688 theOpenWires: Open wires on the free boundary of the given shape.
6690 # Example: see GEOM_TestHealing.py
6691 anObj = self.HealOp.GetFreeBoundary(theObject)
6692 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6693 self._autoPublish(anObj[1], theName, "closedWire")
6694 self._autoPublish(anObj[2], theName, "openWire")
6697 ## Replace coincident faces in theShape by one face.
6698 # @param theShape Initial shape.
6699 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6700 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6701 # otherwise all initial shapes.
6702 # @param theName Object name; when specified, this parameter is used
6703 # for result publication in the study. Otherwise, if automatic
6704 # publication is switched on, default value is used for result name.
6706 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6708 # @ref tui_glue_faces "Example"
6709 @ManageTransactions("ShapesOp")
6710 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6712 Replace coincident faces in theShape by one face.
6715 theShape Initial shape.
6716 theTolerance Maximum distance between faces, which can be considered as coincident.
6717 doKeepNonSolids If FALSE, only solids will present in the result,
6718 otherwise all initial shapes.
6719 theName Object name; when specified, this parameter is used
6720 for result publication in the study. Otherwise, if automatic
6721 publication is switched on, default value is used for result name.
6724 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6726 # Example: see GEOM_Spanner.py
6727 theTolerance,Parameters = ParseParameters(theTolerance)
6728 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6730 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6731 anObj.SetParameters(Parameters)
6732 self._autoPublish(anObj, theName, "glueFaces")
6735 ## Find coincident faces in theShape for possible gluing.
6736 # @param theShape Initial shape.
6737 # @param theTolerance Maximum distance between faces,
6738 # which can be considered as coincident.
6739 # @param theName Object name; when specified, this parameter is used
6740 # for result publication in the study. Otherwise, if automatic
6741 # publication is switched on, default value is used for result name.
6743 # @return GEOM.ListOfGO
6745 # @ref tui_glue_faces "Example"
6746 @ManageTransactions("ShapesOp")
6747 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6749 Find coincident faces in theShape for possible gluing.
6752 theShape Initial shape.
6753 theTolerance Maximum distance between faces,
6754 which can be considered as coincident.
6755 theName Object name; when specified, this parameter is used
6756 for result publication in the study. Otherwise, if automatic
6757 publication is switched on, default value is used for result name.
6762 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6763 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6764 self._autoPublish(anObj, theName, "facesToGlue")
6767 ## Replace coincident faces in theShape by one face
6768 # in compliance with given list of faces
6769 # @param theShape Initial shape.
6770 # @param theTolerance Maximum distance between faces,
6771 # which can be considered as coincident.
6772 # @param theFaces List of faces for gluing.
6773 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6774 # otherwise all initial shapes.
6775 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6776 # will be glued, otherwise only the edges,
6777 # belonging to <VAR>theFaces</VAR>.
6778 # @param theName Object name; when specified, this parameter is used
6779 # for result publication in the study. Otherwise, if automatic
6780 # publication is switched on, default value is used for result name.
6782 # @return New GEOM.GEOM_Object, containing a copy of theShape
6783 # without some faces.
6785 # @ref tui_glue_faces "Example"
6786 @ManageTransactions("ShapesOp")
6787 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6788 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6790 Replace coincident faces in theShape by one face
6791 in compliance with given list of faces
6794 theShape Initial shape.
6795 theTolerance Maximum distance between faces,
6796 which can be considered as coincident.
6797 theFaces List of faces for gluing.
6798 doKeepNonSolids If FALSE, only solids will present in the result,
6799 otherwise all initial shapes.
6800 doGlueAllEdges If TRUE, all coincident edges of theShape
6801 will be glued, otherwise only the edges,
6802 belonging to theFaces.
6803 theName Object name; when specified, this parameter is used
6804 for result publication in the study. Otherwise, if automatic
6805 publication is switched on, default value is used for result name.
6808 New GEOM.GEOM_Object, containing a copy of theShape
6811 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6812 doKeepNonSolids, doGlueAllEdges)
6814 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6815 self._autoPublish(anObj, theName, "glueFaces")
6818 ## Replace coincident edges in theShape by one edge.
6819 # @param theShape Initial shape.
6820 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6821 # @param theName Object name; when specified, this parameter is used
6822 # for result publication in the study. Otherwise, if automatic
6823 # publication is switched on, default value is used for result name.
6825 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6827 # @ref tui_glue_edges "Example"
6828 @ManageTransactions("ShapesOp")
6829 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6831 Replace coincident edges in theShape by one edge.
6834 theShape Initial shape.
6835 theTolerance Maximum distance between edges, which can be considered as coincident.
6836 theName Object name; when specified, this parameter is used
6837 for result publication in the study. Otherwise, if automatic
6838 publication is switched on, default value is used for result name.
6841 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6843 theTolerance,Parameters = ParseParameters(theTolerance)
6844 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6846 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6847 anObj.SetParameters(Parameters)
6848 self._autoPublish(anObj, theName, "glueEdges")
6851 ## Find coincident edges in theShape for possible gluing.
6852 # @param theShape Initial shape.
6853 # @param theTolerance Maximum distance between edges,
6854 # which can be considered as coincident.
6855 # @param 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.
6859 # @return GEOM.ListOfGO
6861 # @ref tui_glue_edges "Example"
6862 @ManageTransactions("ShapesOp")
6863 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6865 Find coincident edges in theShape for possible gluing.
6868 theShape Initial shape.
6869 theTolerance Maximum distance between edges,
6870 which can be considered as coincident.
6871 theName Object name; when specified, this parameter is used
6872 for result publication in the study. Otherwise, if automatic
6873 publication is switched on, default value is used for result name.
6878 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6879 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6880 self._autoPublish(anObj, theName, "edgesToGlue")
6883 ## Replace coincident edges in theShape by one edge
6884 # in compliance with given list of edges.
6885 # @param theShape Initial shape.
6886 # @param theTolerance Maximum distance between edges,
6887 # which can be considered as coincident.
6888 # @param theEdges List of edges for gluing.
6889 # @param theName Object name; when specified, this parameter is used
6890 # for result publication in the study. Otherwise, if automatic
6891 # publication is switched on, default value is used for result name.
6893 # @return New GEOM.GEOM_Object, containing a copy of theShape
6894 # without some edges.
6896 # @ref tui_glue_edges "Example"
6897 @ManageTransactions("ShapesOp")
6898 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6900 Replace coincident edges in theShape by one edge
6901 in compliance with given list of edges.
6904 theShape Initial shape.
6905 theTolerance Maximum distance between edges,
6906 which can be considered as coincident.
6907 theEdges List of edges for gluing.
6908 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.
6913 New GEOM.GEOM_Object, containing a copy of theShape
6916 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6918 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6919 self._autoPublish(anObj, theName, "glueEdges")
6925 ## @addtogroup l3_boolean Boolean Operations
6928 # -----------------------------------------------------------------------------
6929 # Boolean (Common, Cut, Fuse, Section)
6930 # -----------------------------------------------------------------------------
6932 ## Perform one of boolean operations on two given shapes.
6933 # @param theShape1 First argument for boolean operation.
6934 # @param theShape2 Second argument for boolean operation.
6935 # @param theOperation Indicates the operation to be done:\n
6936 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6937 # @param checkSelfInte The flag that tells if the arguments should
6938 # be checked for self-intersection prior to the operation.
6939 # @param theName Object name; when specified, this parameter is used
6940 # for result publication in the study. Otherwise, if automatic
6941 # publication is switched on, default value is used for result name.
6943 # @note This algorithm doesn't find all types of self-intersections.
6944 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6945 # vertex/face and edge/face intersections. Face/face
6946 # intersections detection is switched off as it is a
6947 # time-consuming operation that gives an impact on performance.
6948 # To find all self-intersections please use
6949 # CheckSelfIntersections() method.
6951 # @return New GEOM.GEOM_Object, containing the result shape.
6953 # @ref tui_fuse "Example"
6954 @ManageTransactions("BoolOp")
6955 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
6957 Perform one of boolean operations on two given shapes.
6960 theShape1 First argument for boolean operation.
6961 theShape2 Second argument for boolean operation.
6962 theOperation Indicates the operation to be done:
6963 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6964 checkSelfInte The flag that tells if the arguments should
6965 be checked for self-intersection prior to
6967 theName Object name; when specified, this parameter is used
6968 for result publication in the study. Otherwise, if automatic
6969 publication is switched on, default value is used for result name.
6972 This algorithm doesn't find all types of self-intersections.
6973 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
6974 vertex/face and edge/face intersections. Face/face
6975 intersections detection is switched off as it is a
6976 time-consuming operation that gives an impact on performance.
6977 To find all self-intersections please use
6978 CheckSelfIntersections() method.
6981 New GEOM.GEOM_Object, containing the result shape.
6983 # Example: see GEOM_TestAll.py
6984 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
6985 RaiseIfFailed("MakeBoolean", self.BoolOp)
6986 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6987 self._autoPublish(anObj, theName, def_names[theOperation])
6990 ## Perform Common boolean operation on two given shapes.
6991 # @param theShape1 First argument for boolean operation.
6992 # @param theShape2 Second argument for boolean operation.
6993 # @param checkSelfInte The flag that tells if the arguments should
6994 # be checked for self-intersection prior to the operation.
6995 # @param theName Object name; when specified, this parameter is used
6996 # for result publication in the study. Otherwise, if automatic
6997 # publication is switched on, default value is used for result name.
6999 # @note This algorithm doesn't find all types of self-intersections.
7000 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7001 # vertex/face and edge/face intersections. Face/face
7002 # intersections detection is switched off as it is a
7003 # time-consuming operation that gives an impact on performance.
7004 # To find all self-intersections please use
7005 # CheckSelfIntersections() method.
7007 # @return New GEOM.GEOM_Object, containing the result shape.
7009 # @ref tui_common "Example 1"
7010 # \n @ref swig_MakeCommon "Example 2"
7011 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7013 Perform Common boolean operation on two given shapes.
7016 theShape1 First argument for boolean operation.
7017 theShape2 Second argument for boolean operation.
7018 checkSelfInte The flag that tells if the arguments should
7019 be checked for self-intersection prior to
7021 theName Object name; when specified, this parameter is used
7022 for result publication in the study. Otherwise, if automatic
7023 publication is switched on, default value is used for result name.
7026 This algorithm doesn't find all types of self-intersections.
7027 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7028 vertex/face and edge/face intersections. Face/face
7029 intersections detection is switched off as it is a
7030 time-consuming operation that gives an impact on performance.
7031 To find all self-intersections please use
7032 CheckSelfIntersections() method.
7035 New GEOM.GEOM_Object, containing the result shape.
7037 # Example: see GEOM_TestOthers.py
7038 # note: auto-publishing is done in self.MakeBoolean()
7039 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7041 ## Perform Cut boolean operation on two given shapes.
7042 # @param theShape1 First argument for boolean operation.
7043 # @param theShape2 Second argument for boolean operation.
7044 # @param checkSelfInte The flag that tells if the arguments should
7045 # be checked for self-intersection prior to the operation.
7046 # @param theName Object name; when specified, this parameter is used
7047 # for result publication in the study. Otherwise, if automatic
7048 # publication is switched on, default value is used for result name.
7050 # @note This algorithm doesn't find all types of self-intersections.
7051 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7052 # vertex/face and edge/face intersections. Face/face
7053 # intersections detection is switched off as it is a
7054 # time-consuming operation that gives an impact on performance.
7055 # To find all self-intersections please use
7056 # CheckSelfIntersections() method.
7058 # @return New GEOM.GEOM_Object, containing the result shape.
7060 # @ref tui_cut "Example 1"
7061 # \n @ref swig_MakeCommon "Example 2"
7062 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7064 Perform Cut boolean operation on two given shapes.
7067 theShape1 First argument for boolean operation.
7068 theShape2 Second argument for boolean operation.
7069 checkSelfInte The flag that tells if the arguments should
7070 be checked for self-intersection prior to
7072 theName Object name; when specified, this parameter is used
7073 for result publication in the study. Otherwise, if automatic
7074 publication is switched on, default value is used for result name.
7077 This algorithm doesn't find all types of self-intersections.
7078 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7079 vertex/face and edge/face intersections. Face/face
7080 intersections detection is switched off as it is a
7081 time-consuming operation that gives an impact on performance.
7082 To find all self-intersections please use
7083 CheckSelfIntersections() method.
7086 New GEOM.GEOM_Object, containing the result shape.
7089 # Example: see GEOM_TestOthers.py
7090 # note: auto-publishing is done in self.MakeBoolean()
7091 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7093 ## Perform Fuse boolean operation on two given shapes.
7094 # @param theShape1 First argument for boolean operation.
7095 # @param theShape2 Second argument for boolean operation.
7096 # @param checkSelfInte The flag that tells if the arguments should
7097 # be checked for self-intersection prior to the operation.
7098 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7099 # operation should be performed during the operation.
7100 # @param theName Object name; when specified, this parameter is used
7101 # for result publication in the study. Otherwise, if automatic
7102 # publication is switched on, default value is used for result name.
7104 # @note This algorithm doesn't find all types of self-intersections.
7105 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7106 # vertex/face and edge/face intersections. Face/face
7107 # intersections detection is switched off as it is a
7108 # time-consuming operation that gives an impact on performance.
7109 # To find all self-intersections please use
7110 # CheckSelfIntersections() method.
7112 # @return New GEOM.GEOM_Object, containing the result shape.
7114 # @ref tui_fuse "Example 1"
7115 # \n @ref swig_MakeCommon "Example 2"
7116 @ManageTransactions("BoolOp")
7117 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7118 rmExtraEdges=False, theName=None):
7120 Perform Fuse boolean operation on two given shapes.
7123 theShape1 First argument for boolean operation.
7124 theShape2 Second argument for boolean operation.
7125 checkSelfInte The flag that tells if the arguments should
7126 be checked for self-intersection prior to
7128 rmExtraEdges The flag that tells if Remove Extra Edges
7129 operation should be performed during the operation.
7130 theName Object name; when specified, this parameter is used
7131 for result publication in the study. Otherwise, if automatic
7132 publication is switched on, default value is used for result name.
7135 This algorithm doesn't find all types of self-intersections.
7136 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7137 vertex/face and edge/face intersections. Face/face
7138 intersections detection is switched off as it is a
7139 time-consuming operation that gives an impact on performance.
7140 To find all self-intersections please use
7141 CheckSelfIntersections() method.
7144 New GEOM.GEOM_Object, containing the result shape.
7147 # Example: see GEOM_TestOthers.py
7148 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7149 checkSelfInte, rmExtraEdges)
7150 RaiseIfFailed("MakeFuse", self.BoolOp)
7151 self._autoPublish(anObj, theName, "fuse")
7154 ## Perform Section boolean operation on two given shapes.
7155 # @param theShape1 First argument for boolean operation.
7156 # @param theShape2 Second argument for boolean operation.
7157 # @param checkSelfInte The flag that tells if the arguments should
7158 # be checked for self-intersection prior to the operation.
7159 # @param theName Object name; when specified, this parameter is used
7160 # for result publication in the study. Otherwise, if automatic
7161 # publication is switched on, default value is used for result name.
7163 # @note This algorithm doesn't find all types of self-intersections.
7164 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7165 # vertex/face and edge/face intersections. Face/face
7166 # intersections detection is switched off as it is a
7167 # time-consuming operation that gives an impact on performance.
7168 # To find all self-intersections please use
7169 # CheckSelfIntersections() method.
7171 # @return New GEOM.GEOM_Object, containing the result shape.
7173 # @ref tui_section "Example 1"
7174 # \n @ref swig_MakeCommon "Example 2"
7175 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7177 Perform Section boolean operation on two given shapes.
7180 theShape1 First argument for boolean operation.
7181 theShape2 Second argument for boolean operation.
7182 checkSelfInte The flag that tells if the arguments should
7183 be checked for self-intersection prior to
7185 theName Object name; when specified, this parameter is used
7186 for result publication in the study. Otherwise, if automatic
7187 publication is switched on, default value is used for result name.
7190 This algorithm doesn't find all types of self-intersections.
7191 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7192 vertex/face and edge/face intersections. Face/face
7193 intersections detection is switched off as it is a
7194 time-consuming operation that gives an impact on performance.
7195 To find all self-intersections please use
7196 CheckSelfIntersections() method.
7199 New GEOM.GEOM_Object, containing the result shape.
7202 # Example: see GEOM_TestOthers.py
7203 # note: auto-publishing is done in self.MakeBoolean()
7204 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7206 ## Perform Fuse boolean operation on the list of shapes.
7207 # @param theShapesList Shapes to be fused.
7208 # @param checkSelfInte The flag that tells if the arguments should
7209 # be checked for self-intersection prior to the operation.
7210 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7211 # operation should be performed during the operation.
7212 # @param theName Object name; when specified, this parameter is used
7213 # for result publication in the study. Otherwise, if automatic
7214 # publication is switched on, default value is used for result name.
7216 # @note This algorithm doesn't find all types of self-intersections.
7217 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7218 # vertex/face and edge/face intersections. Face/face
7219 # intersections detection is switched off as it is a
7220 # time-consuming operation that gives an impact on performance.
7221 # To find all self-intersections please use
7222 # CheckSelfIntersections() method.
7224 # @return New GEOM.GEOM_Object, containing the result shape.
7226 # @ref tui_fuse "Example 1"
7227 # \n @ref swig_MakeCommon "Example 2"
7228 @ManageTransactions("BoolOp")
7229 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7230 rmExtraEdges=False, theName=None):
7232 Perform Fuse boolean operation on the list of shapes.
7235 theShapesList Shapes to be fused.
7236 checkSelfInte The flag that tells if the arguments should
7237 be checked for self-intersection prior to
7239 rmExtraEdges The flag that tells if Remove Extra Edges
7240 operation should be performed during the operation.
7241 theName Object name; when specified, this parameter is used
7242 for result publication in the study. Otherwise, if automatic
7243 publication is switched on, default value is used for result name.
7246 This algorithm doesn't find all types of self-intersections.
7247 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7248 vertex/face and edge/face intersections. Face/face
7249 intersections detection is switched off as it is a
7250 time-consuming operation that gives an impact on performance.
7251 To find all self-intersections please use
7252 CheckSelfIntersections() method.
7255 New GEOM.GEOM_Object, containing the result shape.
7258 # Example: see GEOM_TestOthers.py
7259 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7261 RaiseIfFailed("MakeFuseList", self.BoolOp)
7262 self._autoPublish(anObj, theName, "fuse")
7265 ## Perform Common boolean operation on the list of shapes.
7266 # @param theShapesList Shapes for Common operation.
7267 # @param checkSelfInte The flag that tells if the arguments should
7268 # be checked for self-intersection prior to the operation.
7269 # @param theName Object name; when specified, this parameter is used
7270 # for result publication in the study. Otherwise, if automatic
7271 # publication is switched on, default value is used for result name.
7273 # @note This algorithm doesn't find all types of self-intersections.
7274 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7275 # vertex/face and edge/face intersections. Face/face
7276 # intersections detection is switched off as it is a
7277 # time-consuming operation that gives an impact on performance.
7278 # To find all self-intersections please use
7279 # CheckSelfIntersections() method.
7281 # @return New GEOM.GEOM_Object, containing the result shape.
7283 # @ref tui_common "Example 1"
7284 # \n @ref swig_MakeCommon "Example 2"
7285 @ManageTransactions("BoolOp")
7286 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7288 Perform Common boolean operation on the list of shapes.
7291 theShapesList Shapes for Common operation.
7292 checkSelfInte The flag that tells if the arguments should
7293 be checked for self-intersection prior to
7295 theName Object name; when specified, this parameter is used
7296 for result publication in the study. Otherwise, if automatic
7297 publication is switched on, default value is used for result name.
7300 This algorithm doesn't find all types of self-intersections.
7301 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7302 vertex/face and edge/face intersections. Face/face
7303 intersections detection is switched off as it is a
7304 time-consuming operation that gives an impact on performance.
7305 To find all self-intersections please use
7306 CheckSelfIntersections() method.
7309 New GEOM.GEOM_Object, containing the result shape.
7312 # Example: see GEOM_TestOthers.py
7313 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7314 RaiseIfFailed("MakeCommonList", self.BoolOp)
7315 self._autoPublish(anObj, theName, "common")
7318 ## Perform Cut boolean operation on one object and the list of tools.
7319 # @param theMainShape The object of the operation.
7320 # @param theShapesList The list of tools of the operation.
7321 # @param checkSelfInte The flag that tells if the arguments should
7322 # be checked for self-intersection prior to the operation.
7323 # @param theName Object name; when specified, this parameter is used
7324 # for result publication in the study. Otherwise, if automatic
7325 # publication is switched on, default value is used for result name.
7327 # @note This algorithm doesn't find all types of self-intersections.
7328 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7329 # vertex/face and edge/face intersections. Face/face
7330 # intersections detection is switched off as it is a
7331 # time-consuming operation that gives an impact on performance.
7332 # To find all self-intersections please use
7333 # CheckSelfIntersections() method.
7335 # @return New GEOM.GEOM_Object, containing the result shape.
7337 # @ref tui_cut "Example 1"
7338 # \n @ref swig_MakeCommon "Example 2"
7339 @ManageTransactions("BoolOp")
7340 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7342 Perform Cut boolean operation on one object and the list of tools.
7345 theMainShape The object of the operation.
7346 theShapesList The list of tools of the operation.
7347 checkSelfInte The flag that tells if the arguments should
7348 be checked for self-intersection prior to
7350 theName Object name; when specified, this parameter is used
7351 for result publication in the study. Otherwise, if automatic
7352 publication is switched on, default value is used for result name.
7355 This algorithm doesn't find all types of self-intersections.
7356 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7357 vertex/face and edge/face intersections. Face/face
7358 intersections detection is switched off as it is a
7359 time-consuming operation that gives an impact on performance.
7360 To find all self-intersections please use
7361 CheckSelfIntersections() method.
7364 New GEOM.GEOM_Object, containing the result shape.
7367 # Example: see GEOM_TestOthers.py
7368 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7369 RaiseIfFailed("MakeCutList", self.BoolOp)
7370 self._autoPublish(anObj, theName, "cut")
7376 ## @addtogroup l3_basic_op
7379 ## Perform partition operation.
7380 # @param ListShapes Shapes to be intersected.
7381 # @param ListTools Shapes to intersect theShapes.
7382 # @param Limit Type of resulting shapes (see ShapeType()).\n
7383 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7384 # type will be detected automatically.
7385 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7386 # target type (equal to Limit) are kept in the result,
7387 # else standalone shapes of lower dimension
7388 # are kept also (if they exist).
7390 # @param theName Object name; when specified, this parameter is used
7391 # for result publication in the study. Otherwise, if automatic
7392 # publication is switched on, default value is used for result name.
7394 # @note Each compound from ListShapes and ListTools will be exploded
7395 # in order to avoid possible intersection between shapes from this compound.
7397 # After implementation new version of PartitionAlgo (October 2006)
7398 # other parameters are ignored by current functionality. They are kept
7399 # in this function only for support old versions.
7400 # @param ListKeepInside Shapes, outside which the results will be deleted.
7401 # Each shape from theKeepInside must belong to theShapes also.
7402 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7403 # Each shape from theRemoveInside must belong to theShapes also.
7404 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7405 # @param ListMaterials Material indices for each shape. Make sence,
7406 # only if theRemoveWebs is TRUE.
7408 # @return New GEOM.GEOM_Object, containing the result shapes.
7410 # @ref tui_partition "Example"
7411 @ManageTransactions("BoolOp")
7412 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7413 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7414 KeepNonlimitShapes=0, theName=None):
7416 Perform partition operation.
7419 ListShapes Shapes to be intersected.
7420 ListTools Shapes to intersect theShapes.
7421 Limit Type of resulting shapes (see geompy.ShapeType)
7422 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7423 type will be detected automatically.
7424 KeepNonlimitShapes if this parameter == 0, then only shapes of
7425 target type (equal to Limit) are kept in the result,
7426 else standalone shapes of lower dimension
7427 are kept also (if they exist).
7429 theName Object name; when specified, this parameter is used
7430 for result publication in the study. Otherwise, if automatic
7431 publication is switched on, default value is used for result name.
7433 Each compound from ListShapes and ListTools will be exploded
7434 in order to avoid possible intersection between shapes from
7437 After implementation new version of PartitionAlgo (October 2006) other
7438 parameters are ignored by current functionality. They are kept in this
7439 function only for support old versions.
7442 ListKeepInside Shapes, outside which the results will be deleted.
7443 Each shape from theKeepInside must belong to theShapes also.
7444 ListRemoveInside Shapes, inside which the results will be deleted.
7445 Each shape from theRemoveInside must belong to theShapes also.
7446 RemoveWebs If TRUE, perform Glue 3D algorithm.
7447 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7450 New GEOM.GEOM_Object, containing the result shapes.
7452 # Example: see GEOM_TestAll.py
7453 if Limit == self.ShapeType["AUTO"]:
7454 # automatic detection of the most appropriate shape limit type
7456 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7457 Limit = EnumToLong(lim)
7459 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7460 ListKeepInside, ListRemoveInside,
7461 Limit, RemoveWebs, ListMaterials,
7462 KeepNonlimitShapes);
7463 RaiseIfFailed("MakePartition", self.BoolOp)
7464 self._autoPublish(anObj, theName, "partition")
7467 ## Perform partition operation.
7468 # This method may be useful if it is needed to make a partition for
7469 # compound contains nonintersected shapes. Performance will be better
7470 # since intersection between shapes from compound is not performed.
7472 # Description of all parameters as in previous method MakePartition().
7473 # One additional parameter is provided:
7474 # @param checkSelfInte The flag that tells if the arguments should
7475 # be checked for self-intersection prior to the operation.
7477 # @note This algorithm doesn't find all types of self-intersections.
7478 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7479 # vertex/face and edge/face intersections. Face/face
7480 # intersections detection is switched off as it is a
7481 # time-consuming operation that gives an impact on performance.
7482 # To find all self-intersections please use
7483 # CheckSelfIntersections() method.
7485 # @note Passed compounds (via ListShapes or via ListTools)
7486 # have to consist of nonintersecting shapes.
7488 # @return New GEOM.GEOM_Object, containing the result shapes.
7490 # @ref swig_todo "Example"
7491 @ManageTransactions("BoolOp")
7492 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7493 ListKeepInside=[], ListRemoveInside=[],
7494 Limit=ShapeType["AUTO"], RemoveWebs=0,
7495 ListMaterials=[], KeepNonlimitShapes=0,
7496 checkSelfInte=False, theName=None):
7498 Perform partition operation.
7499 This method may be useful if it is needed to make a partition for
7500 compound contains nonintersected shapes. Performance will be better
7501 since intersection between shapes from compound is not performed.
7504 Description of all parameters as in method geompy.MakePartition.
7505 One additional parameter is provided:
7506 checkSelfInte The flag that tells if the arguments should
7507 be checked for self-intersection prior to
7511 This algorithm doesn't find all types of self-intersections.
7512 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7513 vertex/face and edge/face intersections. Face/face
7514 intersections detection is switched off as it is a
7515 time-consuming operation that gives an impact on performance.
7516 To find all self-intersections please use
7517 CheckSelfIntersections() method.
7520 Passed compounds (via ListShapes or via ListTools)
7521 have to consist of nonintersecting shapes.
7524 New GEOM.GEOM_Object, containing the result shapes.
7526 if Limit == self.ShapeType["AUTO"]:
7527 # automatic detection of the most appropriate shape limit type
7529 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7530 Limit = EnumToLong(lim)
7532 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7533 ListKeepInside, ListRemoveInside,
7534 Limit, RemoveWebs, ListMaterials,
7535 KeepNonlimitShapes, checkSelfInte);
7536 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7537 self._autoPublish(anObj, theName, "partition")
7540 ## See method MakePartition() for more information.
7542 # @ref tui_partition "Example 1"
7543 # \n @ref swig_Partition "Example 2"
7544 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7545 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7546 KeepNonlimitShapes=0, theName=None):
7548 See method geompy.MakePartition for more information.
7550 # Example: see GEOM_TestOthers.py
7551 # note: auto-publishing is done in self.MakePartition()
7552 anObj = self.MakePartition(ListShapes, ListTools,
7553 ListKeepInside, ListRemoveInside,
7554 Limit, RemoveWebs, ListMaterials,
7555 KeepNonlimitShapes, theName);
7558 ## Perform partition of the Shape with the Plane
7559 # @param theShape Shape to be intersected.
7560 # @param thePlane Tool shape, to intersect theShape.
7561 # @param theName Object name; when specified, this parameter is used
7562 # for result publication in the study. Otherwise, if automatic
7563 # publication is switched on, default value is used for result name.
7565 # @return New GEOM.GEOM_Object, containing the result shape.
7567 # @ref tui_partition "Example"
7568 @ManageTransactions("BoolOp")
7569 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7571 Perform partition of the Shape with the Plane
7574 theShape Shape to be intersected.
7575 thePlane Tool shape, to intersect theShape.
7576 theName Object name; when specified, this parameter is used
7577 for result publication in the study. Otherwise, if automatic
7578 publication is switched on, default value is used for result name.
7581 New GEOM.GEOM_Object, containing the result shape.
7583 # Example: see GEOM_TestAll.py
7584 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7585 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7586 self._autoPublish(anObj, theName, "partition")
7589 # end of l3_basic_op
7592 ## @addtogroup l3_transform
7595 ## Translate the given object along the vector, specified
7596 # by its end points.
7597 # @param theObject The object to be translated.
7598 # @param thePoint1 Start point of translation vector.
7599 # @param thePoint2 End point of translation vector.
7600 # @param theCopy Flag used to translate object itself or create a copy.
7601 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7602 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7603 @ManageTransactions("TrsfOp")
7604 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7606 Translate the given object along the vector, specified by its end points.
7609 theObject The object to be translated.
7610 thePoint1 Start point of translation vector.
7611 thePoint2 End point of translation vector.
7612 theCopy Flag used to translate object itself or create a copy.
7615 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7616 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7619 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7621 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7622 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7625 ## Translate the given object along the vector, specified
7626 # by its end points, creating its copy before the translation.
7627 # @param theObject The object to be translated.
7628 # @param thePoint1 Start point of translation vector.
7629 # @param thePoint2 End point of translation vector.
7630 # @param theName Object name; when specified, this parameter is used
7631 # for result publication in the study. Otherwise, if automatic
7632 # publication is switched on, default value is used for result name.
7634 # @return New GEOM.GEOM_Object, containing the translated object.
7636 # @ref tui_translation "Example 1"
7637 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7638 @ManageTransactions("TrsfOp")
7639 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
7641 Translate the given object along the vector, specified
7642 by its end points, creating its copy before the translation.
7645 theObject The object to be translated.
7646 thePoint1 Start point of translation vector.
7647 thePoint2 End point of translation vector.
7648 theName Object name; when specified, this parameter is used
7649 for result publication in the study. Otherwise, if automatic
7650 publication is switched on, default value is used for result name.
7653 New GEOM.GEOM_Object, containing the translated object.
7655 # Example: see GEOM_TestAll.py
7656 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7657 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
7658 self._autoPublish(anObj, theName, "translated")
7661 ## Translate the given object along the vector, specified by its components.
7662 # @param theObject The object to be translated.
7663 # @param theDX,theDY,theDZ Components of translation vector.
7664 # @param theCopy Flag used to translate object itself or create a copy.
7665 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7666 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7668 # @ref tui_translation "Example"
7669 @ManageTransactions("TrsfOp")
7670 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
7672 Translate the given object along the vector, specified by its components.
7675 theObject The object to be translated.
7676 theDX,theDY,theDZ Components of translation vector.
7677 theCopy Flag used to translate object itself or create a copy.
7680 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7681 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7683 # Example: see GEOM_TestAll.py
7684 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7686 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7688 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
7689 anObj.SetParameters(Parameters)
7690 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7693 ## Translate the given object along the vector, specified
7694 # by its components, creating its copy before the translation.
7695 # @param theObject The object to be translated.
7696 # @param theDX,theDY,theDZ Components of translation vector.
7697 # @param theName Object name; when specified, this parameter is used
7698 # for result publication in the study. Otherwise, if automatic
7699 # publication is switched on, default value is used for result name.
7701 # @return New GEOM.GEOM_Object, containing the translated object.
7703 # @ref tui_translation "Example"
7704 @ManageTransactions("TrsfOp")
7705 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
7707 Translate the given object along the vector, specified
7708 by its components, creating its copy before the translation.
7711 theObject The object to be translated.
7712 theDX,theDY,theDZ Components of translation vector.
7713 theName Object name; when specified, this parameter is used
7714 for result publication in the study. Otherwise, if automatic
7715 publication is switched on, default value is used for result name.
7718 New GEOM.GEOM_Object, containing the translated object.
7720 # Example: see GEOM_TestAll.py
7721 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
7722 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
7723 anObj.SetParameters(Parameters)
7724 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
7725 self._autoPublish(anObj, theName, "translated")
7728 ## Translate the given object along the given vector.
7729 # @param theObject The object to be translated.
7730 # @param theVector The translation vector.
7731 # @param theCopy Flag used to translate object itself or create a copy.
7732 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7733 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7734 @ManageTransactions("TrsfOp")
7735 def TranslateVector(self, theObject, theVector, theCopy=False):
7737 Translate the given object along the given vector.
7740 theObject The object to be translated.
7741 theVector The translation vector.
7742 theCopy Flag used to translate object itself or create a copy.
7745 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7746 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7749 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7751 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
7752 RaiseIfFailed("TranslateVector", self.TrsfOp)
7755 ## Translate the given object along the given vector,
7756 # creating its copy before the translation.
7757 # @param theObject The object to be translated.
7758 # @param theVector The translation vector.
7759 # @param theName Object name; when specified, this parameter is used
7760 # for result publication in the study. Otherwise, if automatic
7761 # publication is switched on, default value is used for result name.
7763 # @return New GEOM.GEOM_Object, containing the translated object.
7765 # @ref tui_translation "Example"
7766 @ManageTransactions("TrsfOp")
7767 def MakeTranslationVector(self, theObject, theVector, theName=None):
7769 Translate the given object along the given vector,
7770 creating its copy before the translation.
7773 theObject The object to be translated.
7774 theVector The translation vector.
7775 theName Object name; when specified, this parameter is used
7776 for result publication in the study. Otherwise, if automatic
7777 publication is switched on, default value is used for result name.
7780 New GEOM.GEOM_Object, containing the translated object.
7782 # Example: see GEOM_TestAll.py
7783 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
7784 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
7785 self._autoPublish(anObj, theName, "translated")
7788 ## Translate the given object along the given vector on given distance.
7789 # @param theObject The object to be translated.
7790 # @param theVector The translation vector.
7791 # @param theDistance The translation distance.
7792 # @param theCopy Flag used to translate object itself or create a copy.
7793 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7794 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7796 # @ref tui_translation "Example"
7797 @ManageTransactions("TrsfOp")
7798 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
7800 Translate the given object along the given vector on given distance.
7803 theObject The object to be translated.
7804 theVector The translation vector.
7805 theDistance The translation distance.
7806 theCopy Flag used to translate object itself or create a copy.
7809 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7810 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7812 # Example: see GEOM_TestAll.py
7813 theDistance,Parameters = ParseParameters(theDistance)
7814 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
7815 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7816 anObj.SetParameters(Parameters)
7819 ## Translate the given object along the given vector on given distance,
7820 # creating its copy before the translation.
7821 # @param theObject The object to be translated.
7822 # @param theVector The translation vector.
7823 # @param theDistance The translation distance.
7824 # @param theName Object name; when specified, this parameter is used
7825 # for result publication in the study. Otherwise, if automatic
7826 # publication is switched on, default value is used for result name.
7828 # @return New GEOM.GEOM_Object, containing the translated object.
7830 # @ref tui_translation "Example"
7831 @ManageTransactions("TrsfOp")
7832 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7834 Translate the given object along the given vector on given distance,
7835 creating its copy before the translation.
7838 theObject The object to be translated.
7839 theVector The translation vector.
7840 theDistance The translation distance.
7841 theName Object name; when specified, this parameter is used
7842 for result publication in the study. Otherwise, if automatic
7843 publication is switched on, default value is used for result name.
7846 New GEOM.GEOM_Object, containing the translated object.
7848 # Example: see GEOM_TestAll.py
7849 theDistance,Parameters = ParseParameters(theDistance)
7850 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7851 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7852 anObj.SetParameters(Parameters)
7853 self._autoPublish(anObj, theName, "translated")
7856 ## Rotate the given object around the given axis on the given angle.
7857 # @param theObject The object to be rotated.
7858 # @param theAxis Rotation axis.
7859 # @param theAngle Rotation angle in radians.
7860 # @param theCopy Flag used to rotate object itself or create a copy.
7862 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7863 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7865 # @ref tui_rotation "Example"
7866 @ManageTransactions("TrsfOp")
7867 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7869 Rotate the given object around the given axis on the given angle.
7872 theObject The object to be rotated.
7873 theAxis Rotation axis.
7874 theAngle Rotation angle in radians.
7875 theCopy Flag used to rotate object itself or create a copy.
7878 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7879 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7881 # Example: see GEOM_TestAll.py
7883 if isinstance(theAngle,str):
7885 theAngle, Parameters = ParseParameters(theAngle)
7887 theAngle = theAngle*math.pi/180.0
7889 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7891 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7892 RaiseIfFailed("Rotate", self.TrsfOp)
7893 anObj.SetParameters(Parameters)
7896 ## Rotate the given object around the given axis
7897 # on the given angle, creating its copy before the rotation.
7898 # @param theObject The object to be rotated.
7899 # @param theAxis Rotation axis.
7900 # @param theAngle Rotation angle in radians.
7901 # @param theName Object name; when specified, this parameter is used
7902 # for result publication in the study. Otherwise, if automatic
7903 # publication is switched on, default value is used for result name.
7905 # @return New GEOM.GEOM_Object, containing the rotated object.
7907 # @ref tui_rotation "Example"
7908 @ManageTransactions("TrsfOp")
7909 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7911 Rotate the given object around the given axis
7912 on the given angle, creating its copy before the rotatation.
7915 theObject The object to be rotated.
7916 theAxis Rotation axis.
7917 theAngle Rotation angle in radians.
7918 theName Object name; when specified, this parameter is used
7919 for result publication in the study. Otherwise, if automatic
7920 publication is switched on, default value is used for result name.
7923 New GEOM.GEOM_Object, containing the rotated object.
7925 # Example: see GEOM_TestAll.py
7927 if isinstance(theAngle,str):
7929 theAngle, Parameters = ParseParameters(theAngle)
7931 theAngle = theAngle*math.pi/180.0
7932 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7933 RaiseIfFailed("RotateCopy", self.TrsfOp)
7934 anObj.SetParameters(Parameters)
7935 self._autoPublish(anObj, theName, "rotated")
7938 ## Rotate given object around vector perpendicular to plane
7939 # containing three points.
7940 # @param theObject The object to be rotated.
7941 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7942 # containing the three points.
7943 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7944 # @param theCopy Flag used to rotate object itself or create a copy.
7945 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7946 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7947 @ManageTransactions("TrsfOp")
7948 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7950 Rotate given object around vector perpendicular to plane
7951 containing three points.
7954 theObject The object to be rotated.
7955 theCentPoint central point the axis is the vector perpendicular to the plane
7956 containing the three points.
7957 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7958 theCopy Flag used to rotate object itself or create a copy.
7961 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7962 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7965 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7967 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7968 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7971 ## Rotate given object around vector perpendicular to plane
7972 # containing three points, creating its copy before the rotatation.
7973 # @param theObject The object to be rotated.
7974 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7975 # containing the three points.
7976 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7977 # @param theName Object name; when specified, this parameter is used
7978 # for result publication in the study. Otherwise, if automatic
7979 # publication is switched on, default value is used for result name.
7981 # @return New GEOM.GEOM_Object, containing the rotated object.
7983 # @ref tui_rotation "Example"
7984 @ManageTransactions("TrsfOp")
7985 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7987 Rotate given object around vector perpendicular to plane
7988 containing three points, creating its copy before the rotatation.
7991 theObject The object to be rotated.
7992 theCentPoint central point the axis is the vector perpendicular to the plane
7993 containing the three points.
7994 thePoint1,thePoint2 in a perpendicular plane of the axis.
7995 theName Object name; when specified, this parameter is used
7996 for result publication in the study. Otherwise, if automatic
7997 publication is switched on, default value is used for result name.
8000 New GEOM.GEOM_Object, containing the rotated object.
8002 # Example: see GEOM_TestAll.py
8003 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8004 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8005 self._autoPublish(anObj, theName, "rotated")
8008 ## Scale the given object by the specified factor.
8009 # @param theObject The object to be scaled.
8010 # @param thePoint Center point for scaling.
8011 # Passing None for it means scaling relatively the origin of global CS.
8012 # @param theFactor Scaling factor value.
8013 # @param theCopy Flag used to scale object itself or create a copy.
8014 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8015 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8016 @ManageTransactions("TrsfOp")
8017 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8019 Scale the given object by the specified factor.
8022 theObject The object to be scaled.
8023 thePoint Center point for scaling.
8024 Passing None for it means scaling relatively the origin of global CS.
8025 theFactor Scaling factor value.
8026 theCopy Flag used to scale object itself or create a copy.
8029 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8030 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8032 # Example: see GEOM_TestAll.py
8033 theFactor, Parameters = ParseParameters(theFactor)
8035 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8037 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8038 RaiseIfFailed("Scale", self.TrsfOp)
8039 anObj.SetParameters(Parameters)
8042 ## Scale the given object by the factor, creating its copy before the scaling.
8043 # @param theObject The object to be scaled.
8044 # @param thePoint Center point for scaling.
8045 # Passing None for it means scaling relatively the origin of global CS.
8046 # @param theFactor Scaling factor value.
8047 # @param theName Object name; when specified, this parameter is used
8048 # for result publication in the study. Otherwise, if automatic
8049 # publication is switched on, default value is used for result name.
8051 # @return New GEOM.GEOM_Object, containing the scaled shape.
8053 # @ref tui_scale "Example"
8054 @ManageTransactions("TrsfOp")
8055 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8057 Scale the given object by the factor, creating its copy before the scaling.
8060 theObject The object to be scaled.
8061 thePoint Center point for scaling.
8062 Passing None for it means scaling relatively the origin of global CS.
8063 theFactor Scaling factor value.
8064 theName Object name; when specified, this parameter is used
8065 for result publication in the study. Otherwise, if automatic
8066 publication is switched on, default value is used for result name.
8069 New GEOM.GEOM_Object, containing the scaled shape.
8071 # Example: see GEOM_TestAll.py
8072 theFactor, Parameters = ParseParameters(theFactor)
8073 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8074 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8075 anObj.SetParameters(Parameters)
8076 self._autoPublish(anObj, theName, "scaled")
8079 ## Scale the given object by different factors along coordinate axes.
8080 # @param theObject The object to be scaled.
8081 # @param thePoint Center point for scaling.
8082 # Passing None for it means scaling relatively the origin of global CS.
8083 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8084 # @param theCopy Flag used to scale object itself or create a copy.
8085 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8086 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8087 @ManageTransactions("TrsfOp")
8088 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8090 Scale the given object by different factors along coordinate axes.
8093 theObject The object to be scaled.
8094 thePoint Center point for scaling.
8095 Passing None for it means scaling relatively the origin of global CS.
8096 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8097 theCopy Flag used to scale object itself or create a copy.
8100 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8101 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8103 # Example: see GEOM_TestAll.py
8104 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8106 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8107 theFactorX, theFactorY, theFactorZ)
8109 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8110 theFactorX, theFactorY, theFactorZ)
8111 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8112 anObj.SetParameters(Parameters)
8115 ## Scale the given object by different factors along coordinate axes,
8116 # creating its copy before the scaling.
8117 # @param theObject The object to be scaled.
8118 # @param thePoint Center point for scaling.
8119 # Passing None for it means scaling relatively the origin of global CS.
8120 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8121 # @param theName Object name; when specified, this parameter is used
8122 # for result publication in the study. Otherwise, if automatic
8123 # publication is switched on, default value is used for result name.
8125 # @return New GEOM.GEOM_Object, containing the scaled shape.
8127 # @ref swig_scale "Example"
8128 @ManageTransactions("TrsfOp")
8129 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8131 Scale the given object by different factors along coordinate axes,
8132 creating its copy before the scaling.
8135 theObject The object to be scaled.
8136 thePoint Center point for scaling.
8137 Passing None for it means scaling relatively the origin of global CS.
8138 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8139 theName Object name; when specified, this parameter is used
8140 for result publication in the study. Otherwise, if automatic
8141 publication is switched on, default value is used for result name.
8144 New GEOM.GEOM_Object, containing the scaled shape.
8146 # Example: see GEOM_TestAll.py
8147 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8148 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8149 theFactorX, theFactorY, theFactorZ)
8150 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8151 anObj.SetParameters(Parameters)
8152 self._autoPublish(anObj, theName, "scaled")
8155 ## Mirror an object relatively the given plane.
8156 # @param theObject The object to be mirrored.
8157 # @param thePlane Plane of symmetry.
8158 # @param theCopy Flag used to mirror object itself or create a copy.
8159 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8160 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8161 @ManageTransactions("TrsfOp")
8162 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8164 Mirror an object relatively the given plane.
8167 theObject The object to be mirrored.
8168 thePlane Plane of symmetry.
8169 theCopy Flag used to mirror object itself or create a copy.
8172 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8173 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8176 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8178 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8179 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8182 ## Create an object, symmetrical
8183 # to the given one relatively the given plane.
8184 # @param theObject The object to be mirrored.
8185 # @param thePlane Plane of symmetry.
8186 # @param theName Object name; when specified, this parameter is used
8187 # for result publication in the study. Otherwise, if automatic
8188 # publication is switched on, default value is used for result name.
8190 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8192 # @ref tui_mirror "Example"
8193 @ManageTransactions("TrsfOp")
8194 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8196 Create an object, symmetrical to the given one relatively the given plane.
8199 theObject The object to be mirrored.
8200 thePlane Plane of symmetry.
8201 theName Object name; when specified, this parameter is used
8202 for result publication in the study. Otherwise, if automatic
8203 publication is switched on, default value is used for result name.
8206 New GEOM.GEOM_Object, containing the mirrored shape.
8208 # Example: see GEOM_TestAll.py
8209 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8210 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8211 self._autoPublish(anObj, theName, "mirrored")
8214 ## Mirror an object relatively the given axis.
8215 # @param theObject The object to be mirrored.
8216 # @param theAxis Axis of symmetry.
8217 # @param theCopy Flag used to mirror object itself or create a copy.
8218 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8219 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8220 @ManageTransactions("TrsfOp")
8221 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8223 Mirror an object relatively the given axis.
8226 theObject The object to be mirrored.
8227 theAxis Axis of symmetry.
8228 theCopy Flag used to mirror object itself or create a copy.
8231 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8232 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8235 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8237 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8238 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8241 ## Create an object, symmetrical
8242 # to the given one relatively the given axis.
8243 # @param theObject The object to be mirrored.
8244 # @param theAxis Axis of symmetry.
8245 # @param theName Object name; when specified, this parameter is used
8246 # for result publication in the study. Otherwise, if automatic
8247 # publication is switched on, default value is used for result name.
8249 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8251 # @ref tui_mirror "Example"
8252 @ManageTransactions("TrsfOp")
8253 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8255 Create an object, symmetrical to the given one relatively the given axis.
8258 theObject The object to be mirrored.
8259 theAxis Axis of symmetry.
8260 theName Object name; when specified, this parameter is used
8261 for result publication in the study. Otherwise, if automatic
8262 publication is switched on, default value is used for result name.
8265 New GEOM.GEOM_Object, containing the mirrored shape.
8267 # Example: see GEOM_TestAll.py
8268 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8269 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8270 self._autoPublish(anObj, theName, "mirrored")
8273 ## Mirror an object relatively the given point.
8274 # @param theObject The object to be mirrored.
8275 # @param thePoint Point of symmetry.
8276 # @param theCopy Flag used to mirror object itself or create a copy.
8277 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8278 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8279 @ManageTransactions("TrsfOp")
8280 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8282 Mirror an object relatively the given point.
8285 theObject The object to be mirrored.
8286 thePoint Point of symmetry.
8287 theCopy Flag used to mirror object itself or create a copy.
8290 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8291 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8293 # Example: see GEOM_TestAll.py
8295 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8297 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8298 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8301 ## Create an object, symmetrical
8302 # to the given one relatively the given point.
8303 # @param theObject The object to be mirrored.
8304 # @param thePoint Point of symmetry.
8305 # @param theName Object name; when specified, this parameter is used
8306 # for result publication in the study. Otherwise, if automatic
8307 # publication is switched on, default value is used for result name.
8309 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8311 # @ref tui_mirror "Example"
8312 @ManageTransactions("TrsfOp")
8313 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8315 Create an object, symmetrical
8316 to the given one relatively the given point.
8319 theObject The object to be mirrored.
8320 thePoint Point of symmetry.
8321 theName Object name; when specified, this parameter is used
8322 for result publication in the study. Otherwise, if automatic
8323 publication is switched on, default value is used for result name.
8326 New GEOM.GEOM_Object, containing the mirrored shape.
8328 # Example: see GEOM_TestAll.py
8329 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8330 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8331 self._autoPublish(anObj, theName, "mirrored")
8334 ## Modify the location of the given object.
8335 # @param theObject The object to be displaced.
8336 # @param theStartLCS Coordinate system to perform displacement from it.\n
8337 # If \a theStartLCS is NULL, displacement
8338 # will be performed from global CS.\n
8339 # If \a theObject itself is used as \a theStartLCS,
8340 # its location will be changed to \a theEndLCS.
8341 # @param theEndLCS Coordinate system to perform displacement to it.
8342 # @param theCopy Flag used to displace object itself or create a copy.
8343 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8344 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8345 @ManageTransactions("TrsfOp")
8346 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8348 Modify the Location of the given object by LCS, creating its copy before the setting.
8351 theObject The object to be displaced.
8352 theStartLCS Coordinate system to perform displacement from it.
8353 If theStartLCS is NULL, displacement
8354 will be performed from global CS.
8355 If theObject itself is used as theStartLCS,
8356 its location will be changed to theEndLCS.
8357 theEndLCS Coordinate system to perform displacement to it.
8358 theCopy Flag used to displace object itself or create a copy.
8361 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8362 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8364 # Example: see GEOM_TestAll.py
8366 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8368 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8369 RaiseIfFailed("Displace", self.TrsfOp)
8372 ## Modify the Location of the given object by LCS,
8373 # creating its copy before the setting.
8374 # @param theObject The object to be displaced.
8375 # @param theStartLCS Coordinate system to perform displacement from it.\n
8376 # If \a theStartLCS is NULL, displacement
8377 # will be performed from global CS.\n
8378 # If \a theObject itself is used as \a theStartLCS,
8379 # its location will be changed to \a theEndLCS.
8380 # @param theEndLCS Coordinate system to perform displacement to it.
8381 # @param theName Object name; when specified, this parameter is used
8382 # for result publication in the study. Otherwise, if automatic
8383 # publication is switched on, default value is used for result name.
8385 # @return New GEOM.GEOM_Object, containing the displaced shape.
8387 # @ref tui_modify_location "Example"
8388 @ManageTransactions("TrsfOp")
8389 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8391 Modify the Location of the given object by LCS, creating its copy before the setting.
8394 theObject The object to be displaced.
8395 theStartLCS Coordinate system to perform displacement from it.
8396 If theStartLCS is NULL, displacement
8397 will be performed from global CS.
8398 If theObject itself is used as theStartLCS,
8399 its location will be changed to theEndLCS.
8400 theEndLCS Coordinate system to perform displacement to it.
8401 theName Object name; when specified, this parameter is used
8402 for result publication in the study. Otherwise, if automatic
8403 publication is switched on, default value is used for result name.
8406 New GEOM.GEOM_Object, containing the displaced shape.
8409 # create local coordinate systems
8410 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8411 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8412 # modify the location of the given object
8413 position = geompy.MakePosition(cylinder, cs1, cs2)
8415 # Example: see GEOM_TestAll.py
8416 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8417 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8418 self._autoPublish(anObj, theName, "displaced")
8421 ## Modify the Location of the given object by Path.
8422 # @param theObject The object to be displaced.
8423 # @param thePath Wire or Edge along that the object will be translated.
8424 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8425 # @param theCopy is to create a copy objects if true.
8426 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8427 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8428 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8430 # @ref tui_modify_location "Example"
8431 @ManageTransactions("TrsfOp")
8432 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8434 Modify the Location of the given object by Path.
8437 theObject The object to be displaced.
8438 thePath Wire or Edge along that the object will be translated.
8439 theDistance progress of Path (0 = start location, 1 = end of path location).
8440 theCopy is to create a copy objects if true.
8441 theReverse 0 - for usual direction, 1 - to reverse path direction.
8444 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8445 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8448 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8450 # Example: see GEOM_TestAll.py
8451 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8452 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8455 ## Modify the Location of the given object by Path, creating its copy before the operation.
8456 # @param theObject The object to be displaced.
8457 # @param thePath Wire or Edge along that the object will be translated.
8458 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8459 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8460 # @param theName Object name; when specified, this parameter is used
8461 # for result publication in the study. Otherwise, if automatic
8462 # publication is switched on, default value is used for result name.
8464 # @return New GEOM.GEOM_Object, containing the displaced shape.
8465 @ManageTransactions("TrsfOp")
8466 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8468 Modify the Location of the given object by Path, creating its copy before the operation.
8471 theObject The object to be displaced.
8472 thePath Wire or Edge along that the object will be translated.
8473 theDistance progress of Path (0 = start location, 1 = end of path location).
8474 theReverse 0 - for usual direction, 1 - to reverse path direction.
8475 theName Object name; when specified, this parameter is used
8476 for result publication in the study. Otherwise, if automatic
8477 publication is switched on, default value is used for result name.
8480 New GEOM.GEOM_Object, containing the displaced shape.
8482 # Example: see GEOM_TestAll.py
8483 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8484 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8485 self._autoPublish(anObj, theName, "displaced")
8488 ## Offset given shape.
8489 # @param theObject The base object for the offset.
8490 # @param theOffset Offset value.
8491 # @param theCopy Flag used to offset object itself or create a copy.
8492 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8493 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8494 @ManageTransactions("TrsfOp")
8495 def Offset(self, theObject, theOffset, theCopy=False):
8500 theObject The base object for the offset.
8501 theOffset Offset value.
8502 theCopy Flag used to offset object itself or create a copy.
8505 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8506 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8508 theOffset, Parameters = ParseParameters(theOffset)
8510 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8512 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8513 RaiseIfFailed("Offset", self.TrsfOp)
8514 anObj.SetParameters(Parameters)
8517 ## Create new object as offset of the given one.
8518 # @param theObject The base object for the offset.
8519 # @param theOffset Offset value.
8520 # @param theName Object name; when specified, this parameter is used
8521 # for result publication in the study. Otherwise, if automatic
8522 # publication is switched on, default value is used for result name.
8524 # @return New GEOM.GEOM_Object, containing the offset object.
8526 # @ref tui_offset "Example"
8527 @ManageTransactions("TrsfOp")
8528 def MakeOffset(self, theObject, theOffset, theName=None):
8530 Create new object as offset of the given one.
8533 theObject The base object for the offset.
8534 theOffset Offset value.
8535 theName Object name; when specified, this parameter is used
8536 for result publication in the study. Otherwise, if automatic
8537 publication is switched on, default value is used for result name.
8540 New GEOM.GEOM_Object, containing the offset object.
8543 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8544 # create a new object as offset of the given object
8545 offset = geompy.MakeOffset(box, 70.)
8547 # Example: see GEOM_TestAll.py
8548 theOffset, Parameters = ParseParameters(theOffset)
8549 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8550 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8551 anObj.SetParameters(Parameters)
8552 self._autoPublish(anObj, theName, "offset")
8555 ## Create new object as projection of the given one on a 2D surface.
8556 # @param theSource The source object for the projection. It can be a point, edge or wire.
8557 # @param theTarget The target object. It can be planar or cylindrical face.
8558 # @param theName Object name; when specified, this parameter is used
8559 # for result publication in the study. Otherwise, if automatic
8560 # publication is switched on, default value is used for result name.
8562 # @return New GEOM.GEOM_Object, containing the projection.
8564 # @ref tui_projection "Example"
8565 @ManageTransactions("TrsfOp")
8566 def MakeProjection(self, theSource, theTarget, theName=None):
8568 Create new object as projection of the given one on a 2D surface.
8571 theSource The source object for the projection. It can be a point, edge or wire.
8572 theTarget The target object. It can be planar or cylindrical face.
8573 theName Object name; when specified, this parameter is used
8574 for result publication in the study. Otherwise, if automatic
8575 publication is switched on, default value is used for result name.
8578 New GEOM.GEOM_Object, containing the projection.
8580 # Example: see GEOM_TestAll.py
8581 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8582 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8583 self._autoPublish(anObj, theName, "projection")
8586 ## Create a projection projection of the given point on a wire or an edge.
8587 # If there are no solutions or there are 2 or more solutions It throws an
8589 # @param thePoint the point to be projected.
8590 # @param theWire the wire. The edge is accepted as well.
8591 # @param theName Object name; when specified, this parameter is used
8592 # for result publication in the study. Otherwise, if automatic
8593 # publication is switched on, default value is used for result name.
8595 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8596 # \n \a u: The parameter of projection point on edge.
8597 # \n \a PointOnEdge: The projection point.
8598 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8600 # @ref tui_projection "Example"
8601 @ManageTransactions("TrsfOp")
8602 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8604 Create a projection projection of the given point on a wire or an edge.
8605 If there are no solutions or there are 2 or more solutions It throws an
8609 thePoint the point to be projected.
8610 theWire the wire. The edge is accepted as well.
8611 theName Object name; when specified, this parameter is used
8612 for result publication in the study. Otherwise, if automatic
8613 publication is switched on, default value is used for result name.
8616 [u, PointOnEdge, EdgeInWireIndex]
8617 u: The parameter of projection point on edge.
8618 PointOnEdge: The projection point.
8619 EdgeInWireIndex: The index of an edge in a wire.
8621 # Example: see GEOM_TestAll.py
8622 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8623 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8624 self._autoPublish(anObj[1], theName, "projection")
8627 # -----------------------------------------------------------------------------
8629 # -----------------------------------------------------------------------------
8631 ## Translate the given object along the given vector a given number times
8632 # @param theObject The object to be translated.
8633 # @param theVector Direction of the translation. DX if None.
8634 # @param theStep Distance to translate on.
8635 # @param theNbTimes Quantity of translations to be done.
8636 # @param theName Object name; when specified, this parameter is used
8637 # for result publication in the study. Otherwise, if automatic
8638 # publication is switched on, default value is used for result name.
8640 # @return New GEOM.GEOM_Object, containing compound of all
8641 # the shapes, obtained after each translation.
8643 # @ref tui_multi_translation "Example"
8644 @ManageTransactions("TrsfOp")
8645 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
8647 Translate the given object along the given vector a given number times
8650 theObject The object to be translated.
8651 theVector Direction of the translation. DX if None.
8652 theStep Distance to translate on.
8653 theNbTimes Quantity of translations to be done.
8654 theName Object name; when specified, this parameter is used
8655 for result publication in the study. Otherwise, if automatic
8656 publication is switched on, default value is used for result name.
8659 New GEOM.GEOM_Object, containing compound of all
8660 the shapes, obtained after each translation.
8663 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
8665 # Example: see GEOM_TestAll.py
8666 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
8667 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
8668 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
8669 anObj.SetParameters(Parameters)
8670 self._autoPublish(anObj, theName, "multitranslation")
8673 ## Conseqently apply two specified translations to theObject specified number of times.
8674 # @param theObject The object to be translated.
8675 # @param theVector1 Direction of the first translation. DX if None.
8676 # @param theStep1 Step of the first translation.
8677 # @param theNbTimes1 Quantity of translations to be done along theVector1.
8678 # @param theVector2 Direction of the second translation. DY if None.
8679 # @param theStep2 Step of the second translation.
8680 # @param theNbTimes2 Quantity of translations to be done along theVector2.
8681 # @param theName Object name; when specified, this parameter is used
8682 # for result publication in the study. Otherwise, if automatic
8683 # publication is switched on, default value is used for result name.
8685 # @return New GEOM.GEOM_Object, containing compound of all
8686 # the shapes, obtained after each translation.
8688 # @ref tui_multi_translation "Example"
8689 @ManageTransactions("TrsfOp")
8690 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
8691 theVector2, theStep2, theNbTimes2, theName=None):
8693 Conseqently apply two specified translations to theObject specified number of times.
8696 theObject The object to be translated.
8697 theVector1 Direction of the first translation. DX if None.
8698 theStep1 Step of the first translation.
8699 theNbTimes1 Quantity of translations to be done along theVector1.
8700 theVector2 Direction of the second translation. DY if None.
8701 theStep2 Step of the second translation.
8702 theNbTimes2 Quantity of translations to be done along theVector2.
8703 theName Object name; when specified, this parameter is used
8704 for result publication in the study. Otherwise, if automatic
8705 publication is switched on, default value is used for result name.
8708 New GEOM.GEOM_Object, containing compound of all
8709 the shapes, obtained after each translation.
8712 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
8714 # Example: see GEOM_TestAll.py
8715 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
8716 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
8717 theVector2, theStep2, theNbTimes2)
8718 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
8719 anObj.SetParameters(Parameters)
8720 self._autoPublish(anObj, theName, "multitranslation")
8723 ## Rotate the given object around the given axis a given number times.
8724 # Rotation angle will be 2*PI/theNbTimes.
8725 # @param theObject The object to be rotated.
8726 # @param theAxis The rotation axis. DZ if None.
8727 # @param theNbTimes Quantity of rotations to be done.
8728 # @param theName Object name; when specified, this parameter is used
8729 # for result publication in the study. Otherwise, if automatic
8730 # publication is switched on, default value is used for result name.
8732 # @return New GEOM.GEOM_Object, containing compound of all the
8733 # shapes, obtained after each rotation.
8735 # @ref tui_multi_rotation "Example"
8736 @ManageTransactions("TrsfOp")
8737 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
8739 Rotate the given object around the given axis a given number times.
8740 Rotation angle will be 2*PI/theNbTimes.
8743 theObject The object to be rotated.
8744 theAxis The rotation axis. DZ if None.
8745 theNbTimes Quantity of rotations to be done.
8746 theName Object name; when specified, this parameter is used
8747 for result publication in the study. Otherwise, if automatic
8748 publication is switched on, default value is used for result name.
8751 New GEOM.GEOM_Object, containing compound of all the
8752 shapes, obtained after each rotation.
8755 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
8757 # Example: see GEOM_TestAll.py
8758 theNbTimes, Parameters = ParseParameters(theNbTimes)
8759 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
8760 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
8761 anObj.SetParameters(Parameters)
8762 self._autoPublish(anObj, theName, "multirotation")
8765 ## Rotate the given object around the given axis
8766 # a given number times on the given angle.
8767 # @param theObject The object to be rotated.
8768 # @param theAxis The rotation axis. DZ if None.
8769 # @param theAngleStep Rotation angle in radians.
8770 # @param theNbTimes Quantity of rotations to be done.
8771 # @param theName Object name; when specified, this parameter is used
8772 # for result publication in the study. Otherwise, if automatic
8773 # publication is switched on, default value is used for result name.
8775 # @return New GEOM.GEOM_Object, containing compound of all the
8776 # shapes, obtained after each rotation.
8778 # @ref tui_multi_rotation "Example"
8779 @ManageTransactions("TrsfOp")
8780 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
8782 Rotate the given object around the given axis
8783 a given number times on the given angle.
8786 theObject The object to be rotated.
8787 theAxis The rotation axis. DZ if None.
8788 theAngleStep Rotation angle in radians.
8789 theNbTimes Quantity of rotations to be done.
8790 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.
8795 New GEOM.GEOM_Object, containing compound of all the
8796 shapes, obtained after each rotation.
8799 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
8801 # Example: see GEOM_TestAll.py
8802 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
8803 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
8804 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
8805 anObj.SetParameters(Parameters)
8806 self._autoPublish(anObj, theName, "multirotation")
8809 ## Rotate the given object around the given axis a given
8810 # number times and multi-translate each rotation result.
8811 # Rotation angle will be 2*PI/theNbTimes1.
8812 # Translation direction passes through center of gravity
8813 # of rotated shape and its projection on the rotation axis.
8814 # @param theObject The object to be rotated.
8815 # @param theAxis Rotation axis. DZ if None.
8816 # @param theNbTimes1 Quantity of rotations to be done.
8817 # @param theRadialStep Translation distance.
8818 # @param theNbTimes2 Quantity of translations to be done.
8819 # @param theName Object name; when specified, this parameter is used
8820 # for result publication in the study. Otherwise, if automatic
8821 # publication is switched on, default value is used for result name.
8823 # @return New GEOM.GEOM_Object, containing compound of all the
8824 # shapes, obtained after each transformation.
8826 # @ref tui_multi_rotation "Example"
8827 @ManageTransactions("TrsfOp")
8828 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8830 Rotate the given object around the
8831 given axis on the given angle a given number
8832 times and multi-translate each rotation result.
8833 Translation direction passes through center of gravity
8834 of rotated shape and its projection on the rotation axis.
8837 theObject The object to be rotated.
8838 theAxis Rotation axis. DZ if None.
8839 theNbTimes1 Quantity of rotations to be done.
8840 theRadialStep Translation distance.
8841 theNbTimes2 Quantity of translations to be done.
8842 theName Object name; when specified, this parameter is used
8843 for result publication in the study. Otherwise, if automatic
8844 publication is switched on, default value is used for result name.
8847 New GEOM.GEOM_Object, containing compound of all the
8848 shapes, obtained after each transformation.
8851 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8853 # Example: see GEOM_TestAll.py
8854 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
8855 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
8856 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
8857 anObj.SetParameters(Parameters)
8858 self._autoPublish(anObj, theName, "multirotation")
8861 ## Rotate the given object around the
8862 # given axis on the given angle a given number
8863 # times and multi-translate each rotation result.
8864 # Translation direction passes through center of gravity
8865 # of rotated shape and its projection on the rotation axis.
8866 # @param theObject The object to be rotated.
8867 # @param theAxis Rotation axis. DZ if None.
8868 # @param theAngleStep Rotation angle in radians.
8869 # @param theNbTimes1 Quantity of rotations to be done.
8870 # @param theRadialStep Translation distance.
8871 # @param theNbTimes2 Quantity of translations to be done.
8872 # @param theName Object name; when specified, this parameter is used
8873 # for result publication in the study. Otherwise, if automatic
8874 # publication is switched on, default value is used for result name.
8876 # @return New GEOM.GEOM_Object, containing compound of all the
8877 # shapes, obtained after each transformation.
8879 # @ref tui_multi_rotation "Example"
8880 @ManageTransactions("TrsfOp")
8881 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
8883 Rotate the given object around the
8884 given axis on the given angle a given number
8885 times and multi-translate each rotation result.
8886 Translation direction passes through center of gravity
8887 of rotated shape and its projection on the rotation axis.
8890 theObject The object to be rotated.
8891 theAxis Rotation axis. DZ if None.
8892 theAngleStep Rotation angle in radians.
8893 theNbTimes1 Quantity of rotations to be done.
8894 theRadialStep Translation distance.
8895 theNbTimes2 Quantity of translations to be done.
8896 theName Object name; when specified, this parameter is used
8897 for result publication in the study. Otherwise, if automatic
8898 publication is switched on, default value is used for result name.
8901 New GEOM.GEOM_Object, containing compound of all the
8902 shapes, obtained after each transformation.
8905 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8907 # Example: see GEOM_TestAll.py
8908 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8909 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8910 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8911 anObj.SetParameters(Parameters)
8912 self._autoPublish(anObj, theName, "multirotation")
8915 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8917 # @ref swig_MakeMultiRotation "Example"
8918 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8920 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8923 pz = geompy.MakeVertex(0, 0, 100)
8924 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8925 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8927 # Example: see GEOM_TestOthers.py
8928 aVec = self.MakeLine(aPoint,aDir)
8929 # note: auto-publishing is done in self.MultiRotate1D()
8930 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8933 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8935 # @ref swig_MakeMultiRotation "Example"
8936 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8938 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8941 pz = geompy.MakeVertex(0, 0, 100)
8942 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8943 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8945 # Example: see GEOM_TestOthers.py
8946 aVec = self.MakeLine(aPoint,aDir)
8947 # note: auto-publishing is done in self.MultiRotate1D()
8948 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8951 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8953 # @ref swig_MakeMultiRotation "Example"
8954 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8956 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8959 pz = geompy.MakeVertex(0, 0, 100)
8960 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8961 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8963 # Example: see GEOM_TestOthers.py
8964 aVec = self.MakeLine(aPoint,aDir)
8965 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8966 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8969 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8971 # @ref swig_MakeMultiRotation "Example"
8972 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8974 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8977 pz = geompy.MakeVertex(0, 0, 100)
8978 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8979 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8981 # Example: see GEOM_TestOthers.py
8982 aVec = self.MakeLine(aPoint,aDir)
8983 # note: auto-publishing is done in self.MultiRotate2D()
8984 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8987 # end of l3_transform
8990 ## @addtogroup l3_transform_d
8993 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8994 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8996 Deprecated method. Use MultiRotate1DNbTimes instead.
8998 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8999 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9001 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9002 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9003 @ManageTransactions("TrsfOp")
9004 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9006 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9007 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9010 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9012 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9013 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9014 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9015 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9016 anObj.SetParameters(Parameters)
9017 self._autoPublish(anObj, theName, "multirotation")
9020 ## The same, as MultiRotate1D(), but axis is given by direction and point
9021 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9022 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9024 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9025 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9028 pz = geompy.MakeVertex(0, 0, 100)
9029 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9030 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9032 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9033 aVec = self.MakeLine(aPoint,aDir)
9034 # note: auto-publishing is done in self.MultiRotate1D()
9035 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9038 ## The same, as MultiRotate2D(), but axis is given by direction and point
9039 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9040 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9042 The same, as MultiRotate2D(), but axis is given by direction and point
9043 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9046 pz = geompy.MakeVertex(0, 0, 100)
9047 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9048 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9050 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9051 aVec = self.MakeLine(aPoint,aDir)
9052 # note: auto-publishing is done in self.MultiRotate2D()
9053 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9056 # end of l3_transform_d
9059 ## @addtogroup l3_local
9062 ## Perform a fillet on all edges of the given shape.
9063 # @param theShape Shape, to perform fillet on.
9064 # @param theR Fillet radius.
9065 # @param theName Object name; when specified, this parameter is used
9066 # for result publication in the study. Otherwise, if automatic
9067 # publication is switched on, default value is used for result name.
9069 # @return New GEOM.GEOM_Object, containing the result shape.
9071 # @ref tui_fillet "Example 1"
9072 # \n @ref swig_MakeFilletAll "Example 2"
9073 @ManageTransactions("LocalOp")
9074 def MakeFilletAll(self, theShape, theR, theName=None):
9076 Perform a fillet on all edges of the given shape.
9079 theShape Shape, to perform fillet on.
9081 theName Object name; when specified, this parameter is used
9082 for result publication in the study. Otherwise, if automatic
9083 publication is switched on, default value is used for result name.
9086 New GEOM.GEOM_Object, containing the result shape.
9089 filletall = geompy.MakeFilletAll(prism, 10.)
9091 # Example: see GEOM_TestOthers.py
9092 theR,Parameters = ParseParameters(theR)
9093 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9094 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9095 anObj.SetParameters(Parameters)
9096 self._autoPublish(anObj, theName, "fillet")
9099 ## Perform a fillet on the specified edges/faces of the given shape
9100 # @param theShape Shape, to perform fillet on.
9101 # @param theR Fillet radius.
9102 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9103 # @param theListShapes Global indices of edges/faces to perform fillet on.
9104 # @param theName Object name; when specified, this parameter is used
9105 # for result publication in the study. Otherwise, if automatic
9106 # publication is switched on, default value is used for result name.
9108 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9110 # @return New GEOM.GEOM_Object, containing the result shape.
9112 # @ref tui_fillet "Example"
9113 @ManageTransactions("LocalOp")
9114 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9116 Perform a fillet on the specified edges/faces of the given shape
9119 theShape Shape, to perform fillet on.
9121 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9122 theListShapes Global indices of edges/faces to perform fillet on.
9123 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.
9128 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9131 New GEOM.GEOM_Object, containing the result shape.
9134 # get the list of IDs (IDList) for the fillet
9135 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9137 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9138 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9139 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9140 # make a fillet on the specified edges of the given shape
9141 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9143 # Example: see GEOM_TestAll.py
9144 theR,Parameters = ParseParameters(theR)
9146 if theShapeType == self.ShapeType["EDGE"]:
9147 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9148 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9150 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9151 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9152 anObj.SetParameters(Parameters)
9153 self._autoPublish(anObj, theName, "fillet")
9156 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9157 @ManageTransactions("LocalOp")
9158 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9160 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9163 # get the list of IDs (IDList) for the fillet
9164 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9166 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9167 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9168 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9169 # make a fillet on the specified edges of the given shape
9170 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9172 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9174 if theShapeType == self.ShapeType["EDGE"]:
9175 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9176 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9178 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9179 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9180 anObj.SetParameters(Parameters)
9181 self._autoPublish(anObj, theName, "fillet")
9184 ## Perform a fillet on the specified edges of the given shape
9185 # @param theShape Wire Shape to perform fillet on.
9186 # @param theR Fillet radius.
9187 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9188 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9189 # \note The list of vertices could be empty,
9190 # in this case fillet will done done at all vertices in wire
9191 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9192 # by the length of the edges, nearest to the fillet vertex.
9193 # But sometimes the next edge is C1 continuous with the one, nearest to
9194 # the fillet point, and such two (or more) edges can be united to allow
9195 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9196 # thus ignoring the secant vertex (vertices).
9197 # @param theName Object name; when specified, this parameter is used
9198 # for result publication in the study. Otherwise, if automatic
9199 # publication is switched on, default value is used for result name.
9201 # @return New GEOM.GEOM_Object, containing the result shape.
9203 # @ref tui_fillet2d "Example"
9204 @ManageTransactions("LocalOp")
9205 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9207 Perform a fillet on the specified edges of the given shape
9210 theShape Wire Shape to perform fillet on.
9212 theListOfVertexes Global indices of vertexes to perform fillet on.
9213 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9214 by the length of the edges, nearest to the fillet vertex.
9215 But sometimes the next edge is C1 continuous with the one, nearest to
9216 the fillet point, and such two (or more) edges can be united to allow
9217 bigger radius. Set this flag to TRUE to allow collinear edges union,
9218 thus ignoring the secant vertex (vertices).
9219 theName Object name; when specified, this parameter is used
9220 for result publication in the study. Otherwise, if automatic
9221 publication is switched on, default value is used for result name.
9223 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9225 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9228 New GEOM.GEOM_Object, containing the result shape.
9232 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9233 # make fillet at given wire vertices with giver radius
9234 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9236 # Example: see GEOM_TestAll.py
9237 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9238 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9239 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9240 anObj.SetParameters(Parameters)
9241 self._autoPublish(anObj, theName, "fillet")
9244 ## Perform a fillet at the specified vertices of the given face/shell.
9245 # @param theShape Face or Shell shape to perform fillet on.
9246 # @param theR Fillet radius.
9247 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9248 # @param theName Object name; when specified, this parameter is used
9249 # for result publication in the study. Otherwise, if automatic
9250 # publication is switched on, default value is used for result name.
9252 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9254 # @return New GEOM.GEOM_Object, containing the result shape.
9256 # @ref tui_fillet2d "Example"
9257 @ManageTransactions("LocalOp")
9258 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9260 Perform a fillet at the specified vertices of the given face/shell.
9263 theShape Face or Shell shape to perform fillet on.
9265 theListOfVertexes Global indices of vertexes to perform fillet on.
9266 theName Object name; when specified, this parameter is used
9267 for result publication in the study. Otherwise, if automatic
9268 publication is switched on, default value is used for result name.
9270 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9273 New GEOM.GEOM_Object, containing the result shape.
9276 face = geompy.MakeFaceHW(100, 100, 1)
9277 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9279 # Example: see GEOM_TestAll.py
9280 theR,Parameters = ParseParameters(theR)
9281 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9282 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9283 anObj.SetParameters(Parameters)
9284 self._autoPublish(anObj, theName, "fillet")
9287 ## Perform a symmetric chamfer on all edges of the given shape.
9288 # @param theShape Shape, to perform chamfer on.
9289 # @param theD Chamfer size along each face.
9290 # @param theName Object name; when specified, this parameter is used
9291 # for result publication in the study. Otherwise, if automatic
9292 # publication is switched on, default value is used for result name.
9294 # @return New GEOM.GEOM_Object, containing the result shape.
9296 # @ref tui_chamfer "Example 1"
9297 # \n @ref swig_MakeChamferAll "Example 2"
9298 @ManageTransactions("LocalOp")
9299 def MakeChamferAll(self, theShape, theD, theName=None):
9301 Perform a symmetric chamfer on all edges of the given shape.
9304 theShape Shape, to perform chamfer on.
9305 theD Chamfer size along each face.
9306 theName Object name; when specified, this parameter is used
9307 for result publication in the study. Otherwise, if automatic
9308 publication is switched on, default value is used for result name.
9311 New GEOM.GEOM_Object, containing the result shape.
9314 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9316 # Example: see GEOM_TestOthers.py
9317 theD,Parameters = ParseParameters(theD)
9318 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9319 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9320 anObj.SetParameters(Parameters)
9321 self._autoPublish(anObj, theName, "chamfer")
9324 ## Perform a chamfer on edges, common to the specified faces,
9325 # with distance D1 on the Face1
9326 # @param theShape Shape, to perform chamfer on.
9327 # @param theD1 Chamfer size along \a theFace1.
9328 # @param theD2 Chamfer size along \a theFace2.
9329 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9330 # @param theName Object name; when specified, this parameter is used
9331 # for result publication in the study. Otherwise, if automatic
9332 # publication is switched on, default value is used for result name.
9334 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9336 # @return New GEOM.GEOM_Object, containing the result shape.
9338 # @ref tui_chamfer "Example"
9339 @ManageTransactions("LocalOp")
9340 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9342 Perform a chamfer on edges, common to the specified faces,
9343 with distance D1 on the Face1
9346 theShape Shape, to perform chamfer on.
9347 theD1 Chamfer size along theFace1.
9348 theD2 Chamfer size along theFace2.
9349 theFace1,theFace2 Global indices of two faces of theShape.
9350 theName Object name; when specified, this parameter is used
9351 for result publication in the study. Otherwise, if automatic
9352 publication is switched on, default value is used for result name.
9355 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9358 New GEOM.GEOM_Object, containing the result shape.
9361 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9362 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9363 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9364 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9366 # Example: see GEOM_TestAll.py
9367 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9368 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9369 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9370 anObj.SetParameters(Parameters)
9371 self._autoPublish(anObj, theName, "chamfer")
9374 ## Perform a chamfer on edges
9375 # @param theShape Shape, to perform chamfer on.
9376 # @param theD Chamfer length
9377 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9378 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9379 # @param theName Object name; when specified, this parameter is used
9380 # for result publication in the study. Otherwise, if automatic
9381 # publication is switched on, default value is used for result name.
9383 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9385 # @return New GEOM.GEOM_Object, containing the result shape.
9386 @ManageTransactions("LocalOp")
9387 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9389 Perform a chamfer on edges
9392 theShape Shape, to perform chamfer on.
9393 theD1 Chamfer size along theFace1.
9394 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9395 theFace1,theFace2 Global indices of two faces of theShape.
9396 theName Object name; when specified, this parameter is used
9397 for result publication in the study. Otherwise, if automatic
9398 publication is switched on, default value is used for result name.
9401 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9404 New GEOM.GEOM_Object, containing the result shape.
9407 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9408 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9409 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9411 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9414 if isinstance(theAngle,str):
9416 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9418 theAngle = theAngle*math.pi/180.0
9419 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9420 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9421 anObj.SetParameters(Parameters)
9422 self._autoPublish(anObj, theName, "chamfer")
9425 ## Perform a chamfer on all edges of the specified faces,
9426 # with distance D1 on the first specified face (if several for one edge)
9427 # @param theShape Shape, to perform chamfer on.
9428 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9429 # connected to the edge, are in \a theFaces, \a theD1
9430 # will be get along face, which is nearer to \a theFaces beginning.
9431 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9432 # @param theFaces Sequence of global indices of faces of \a theShape.
9433 # @param theName Object name; when specified, this parameter is used
9434 # for result publication in the study. Otherwise, if automatic
9435 # publication is switched on, default value is used for result name.
9437 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9439 # @return New GEOM.GEOM_Object, containing the result shape.
9441 # @ref tui_chamfer "Example"
9442 @ManageTransactions("LocalOp")
9443 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9445 Perform a chamfer on all edges of the specified faces,
9446 with distance D1 on the first specified face (if several for one edge)
9449 theShape Shape, to perform chamfer on.
9450 theD1 Chamfer size along face from theFaces. If both faces,
9451 connected to the edge, are in theFaces, theD1
9452 will be get along face, which is nearer to theFaces beginning.
9453 theD2 Chamfer size along another of two faces, connected to the edge.
9454 theFaces Sequence of global indices of faces of theShape.
9455 theName Object name; when specified, this parameter is used
9456 for result publication in the study. Otherwise, if automatic
9457 publication is switched on, default value is used for result name.
9459 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9462 New GEOM.GEOM_Object, containing the result shape.
9464 # Example: see GEOM_TestAll.py
9465 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9466 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9467 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9468 anObj.SetParameters(Parameters)
9469 self._autoPublish(anObj, theName, "chamfer")
9472 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9473 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9475 # @ref swig_FilletChamfer "Example"
9476 @ManageTransactions("LocalOp")
9477 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9479 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9480 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9483 if isinstance(theAngle,str):
9485 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9487 theAngle = theAngle*math.pi/180.0
9488 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9489 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9490 anObj.SetParameters(Parameters)
9491 self._autoPublish(anObj, theName, "chamfer")
9494 ## Perform a chamfer on edges,
9495 # with distance D1 on the first specified face (if several for one edge)
9496 # @param theShape Shape, to perform chamfer on.
9497 # @param theD1,theD2 Chamfer size
9498 # @param theEdges Sequence of edges of \a theShape.
9499 # @param theName Object name; when specified, this parameter is used
9500 # for result publication in the study. Otherwise, if automatic
9501 # publication is switched on, default value is used for result name.
9503 # @return New GEOM.GEOM_Object, containing the result shape.
9505 # @ref swig_FilletChamfer "Example"
9506 @ManageTransactions("LocalOp")
9507 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9509 Perform a chamfer on edges,
9510 with distance D1 on the first specified face (if several for one edge)
9513 theShape Shape, to perform chamfer on.
9514 theD1,theD2 Chamfer size
9515 theEdges Sequence of edges of theShape.
9516 theName Object name; when specified, this parameter is used
9517 for result publication in the study. Otherwise, if automatic
9518 publication is switched on, default value is used for result name.
9521 New GEOM.GEOM_Object, containing the result shape.
9523 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9524 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9525 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9526 anObj.SetParameters(Parameters)
9527 self._autoPublish(anObj, theName, "chamfer")
9530 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9531 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9532 @ManageTransactions("LocalOp")
9533 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9535 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9536 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9539 if isinstance(theAngle,str):
9541 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9543 theAngle = theAngle*math.pi/180.0
9544 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9545 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9546 anObj.SetParameters(Parameters)
9547 self._autoPublish(anObj, theName, "chamfer")
9550 ## @sa MakeChamferEdge(), MakeChamferFaces()
9552 # @ref swig_MakeChamfer "Example"
9553 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9555 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9557 # Example: see GEOM_TestOthers.py
9559 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9560 if aShapeType == self.ShapeType["EDGE"]:
9561 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9563 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9566 ## Remove material from a solid by extrusion of the base shape on the given distance.
9567 # @param theInit Shape to remove material from. It must be a solid or
9568 # a compound made of a single solid.
9569 # @param theBase Closed edge or wire defining the base shape to be extruded.
9570 # @param theH Prism dimension along the normal to theBase
9571 # @param theAngle Draft angle in degrees.
9572 # @param theName Object name; when specified, this parameter is used
9573 # for result publication in the study. Otherwise, if automatic
9574 # publication is switched on, default value is used for result name.
9576 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9578 # @ref tui_creation_prism "Example"
9579 @ManageTransactions("PrimOp")
9580 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9582 Add material to a solid by extrusion of the base shape on the given distance.
9585 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9586 theBase Closed edge or wire defining the base shape to be extruded.
9587 theH Prism dimension along the normal to theBase
9588 theAngle Draft angle in degrees.
9589 theName Object name; when specified, this parameter is used
9590 for result publication in the study. Otherwise, if automatic
9591 publication is switched on, default value is used for result name.
9594 New GEOM.GEOM_Object, containing the initial shape with removed material.
9596 # Example: see GEOM_TestAll.py
9597 #theH,Parameters = ParseParameters(theH)
9598 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9599 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9600 #anObj.SetParameters(Parameters)
9601 self._autoPublish(anObj, theName, "extrudedCut")
9604 ## Add material to a solid by extrusion of the base shape on the given distance.
9605 # @param theInit Shape to add material to. It must be a solid or
9606 # a compound made of a single solid.
9607 # @param theBase Closed edge or wire defining the base shape to be extruded.
9608 # @param theH Prism dimension along the normal to theBase
9609 # @param theAngle Draft angle in degrees.
9610 # @param theName Object name; when specified, this parameter is used
9611 # for result publication in the study. Otherwise, if automatic
9612 # publication is switched on, default value is used for result name.
9614 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9616 # @ref tui_creation_prism "Example"
9617 @ManageTransactions("PrimOp")
9618 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9620 Add material to a solid by extrusion of the base shape on the given distance.
9623 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9624 theBase Closed edge or wire defining the base shape to be extruded.
9625 theH Prism dimension along the normal to theBase
9626 theAngle Draft angle in degrees.
9627 theName Object name; when specified, this parameter is used
9628 for result publication in the study. Otherwise, if automatic
9629 publication is switched on, default value is used for result name.
9632 New GEOM.GEOM_Object, containing the initial shape with added material.
9634 # Example: see GEOM_TestAll.py
9635 #theH,Parameters = ParseParameters(theH)
9636 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
9637 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9638 #anObj.SetParameters(Parameters)
9639 self._autoPublish(anObj, theName, "extrudedBoss")
9645 ## @addtogroup l3_basic_op
9648 ## Perform an Archimde operation on the given shape with given parameters.
9649 # The object presenting the resulting face is returned.
9650 # @param theShape Shape to be put in water.
9651 # @param theWeight Weight og the shape.
9652 # @param theWaterDensity Density of the water.
9653 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
9654 # @param theName Object name; when specified, this parameter is used
9655 # for result publication in the study. Otherwise, if automatic
9656 # publication is switched on, default value is used for result name.
9658 # @return New GEOM.GEOM_Object, containing a section of \a theShape
9659 # by a plane, corresponding to water level.
9661 # @ref tui_archimede "Example"
9662 @ManageTransactions("LocalOp")
9663 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
9665 Perform an Archimde operation on the given shape with given parameters.
9666 The object presenting the resulting face is returned.
9669 theShape Shape to be put in water.
9670 theWeight Weight og the shape.
9671 theWaterDensity Density of the water.
9672 theMeshDeflection Deflection of the mesh, using to compute the section.
9673 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.
9678 New GEOM.GEOM_Object, containing a section of theShape
9679 by a plane, corresponding to water level.
9681 # Example: see GEOM_TestAll.py
9682 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
9683 theWeight,theWaterDensity,theMeshDeflection)
9684 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
9685 RaiseIfFailed("MakeArchimede", self.LocalOp)
9686 anObj.SetParameters(Parameters)
9687 self._autoPublish(anObj, theName, "archimede")
9690 # end of l3_basic_op
9693 ## @addtogroup l2_measure
9696 ## Get point coordinates
9699 # @ref tui_measurement_tools_page "Example"
9700 @ManageTransactions("MeasuOp")
9701 def PointCoordinates(self,Point):
9703 Get point coordinates
9708 # Example: see GEOM_TestMeasures.py
9709 aTuple = self.MeasuOp.PointCoordinates(Point)
9710 RaiseIfFailed("PointCoordinates", self.MeasuOp)
9713 ## Get vector coordinates
9716 # @ref tui_measurement_tools_page "Example"
9717 def VectorCoordinates(self,Vector):
9719 Get vector coordinates
9725 p1=self.GetFirstVertex(Vector)
9726 p2=self.GetLastVertex(Vector)
9728 X1=self.PointCoordinates(p1)
9729 X2=self.PointCoordinates(p2)
9731 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
9734 ## Compute cross product
9735 # @return vector w=u^v
9737 # @ref tui_measurement_tools_page "Example"
9738 def CrossProduct(self, Vector1, Vector2):
9740 Compute cross product
9742 Returns: vector w=u^v
9744 u=self.VectorCoordinates(Vector1)
9745 v=self.VectorCoordinates(Vector2)
9746 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])
9750 ## Compute cross product
9751 # @return dot product p=u.v
9753 # @ref tui_measurement_tools_page "Example"
9754 def DotProduct(self, Vector1, Vector2):
9756 Compute cross product
9758 Returns: dot product p=u.v
9760 u=self.VectorCoordinates(Vector1)
9761 v=self.VectorCoordinates(Vector2)
9762 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
9767 ## Get summarized length of all wires,
9768 # area of surface and volume of the given shape.
9769 # @param theShape Shape to define properties of.
9770 # @return [theLength, theSurfArea, theVolume]\n
9771 # theLength: Summarized length of all wires of the given shape.\n
9772 # theSurfArea: Area of surface of the given shape.\n
9773 # theVolume: Volume of the given shape.
9775 # @ref tui_measurement_tools_page "Example"
9776 @ManageTransactions("MeasuOp")
9777 def BasicProperties(self,theShape):
9779 Get summarized length of all wires,
9780 area of surface and volume of the given shape.
9783 theShape Shape to define properties of.
9786 [theLength, theSurfArea, theVolume]
9787 theLength: Summarized length of all wires of the given shape.
9788 theSurfArea: Area of surface of the given shape.
9789 theVolume: Volume of the given shape.
9791 # Example: see GEOM_TestMeasures.py
9792 aTuple = self.MeasuOp.GetBasicProperties(theShape)
9793 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
9796 ## Get parameters of bounding box of the given shape
9797 # @param theShape Shape to obtain bounding box of.
9798 # @param precise TRUE for precise computation; FALSE for fast one.
9799 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9800 # Xmin,Xmax: Limits of shape along OX axis.
9801 # Ymin,Ymax: Limits of shape along OY axis.
9802 # Zmin,Zmax: Limits of shape along OZ axis.
9804 # @ref tui_measurement_tools_page "Example"
9805 @ManageTransactions("MeasuOp")
9806 def BoundingBox (self, theShape, precise=False):
9808 Get parameters of bounding box of the given shape
9811 theShape Shape to obtain bounding box of.
9812 precise TRUE for precise computation; FALSE for fast one.
9815 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
9816 Xmin,Xmax: Limits of shape along OX axis.
9817 Ymin,Ymax: Limits of shape along OY axis.
9818 Zmin,Zmax: Limits of shape along OZ axis.
9820 # Example: see GEOM_TestMeasures.py
9821 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
9822 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
9825 ## Get bounding box of the given shape
9826 # @param theShape Shape to obtain bounding box of.
9827 # @param precise TRUE for precise computation; FALSE for fast one.
9828 # @param theName Object name; when specified, this parameter is used
9829 # for result publication in the study. Otherwise, if automatic
9830 # publication is switched on, default value is used for result name.
9832 # @return New GEOM.GEOM_Object, containing the created box.
9834 # @ref tui_measurement_tools_page "Example"
9835 @ManageTransactions("MeasuOp")
9836 def MakeBoundingBox (self, theShape, precise=False, theName=None):
9838 Get bounding box of the given shape
9841 theShape Shape to obtain bounding box of.
9842 precise TRUE for precise computation; FALSE for fast one.
9843 theName Object name; when specified, this parameter is used
9844 for result publication in the study. Otherwise, if automatic
9845 publication is switched on, default value is used for result name.
9848 New GEOM.GEOM_Object, containing the created box.
9850 # Example: see GEOM_TestMeasures.py
9851 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
9852 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
9853 self._autoPublish(anObj, theName, "bndbox")
9856 ## Get inertia matrix and moments of inertia of theShape.
9857 # @param theShape Shape to calculate inertia of.
9858 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9859 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
9860 # Ix,Iy,Iz: Moments of inertia of the given shape.
9862 # @ref tui_measurement_tools_page "Example"
9863 @ManageTransactions("MeasuOp")
9864 def Inertia(self,theShape):
9866 Get inertia matrix and moments of inertia of theShape.
9869 theShape Shape to calculate inertia of.
9872 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
9873 I(1-3)(1-3): Components of the inertia matrix of the given shape.
9874 Ix,Iy,Iz: Moments of inertia of the given shape.
9876 # Example: see GEOM_TestMeasures.py
9877 aTuple = self.MeasuOp.GetInertia(theShape)
9878 RaiseIfFailed("GetInertia", self.MeasuOp)
9881 ## Get if coords are included in the shape (ST_IN or ST_ON)
9882 # @param theShape Shape
9883 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9884 # @param tolerance to be used (default is 1.0e-7)
9885 # @return list_of_boolean = [res1, res2, ...]
9886 @ManageTransactions("MeasuOp")
9887 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
9889 Get if coords are included in the shape (ST_IN or ST_ON)
9893 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
9894 tolerance to be used (default is 1.0e-7)
9897 list_of_boolean = [res1, res2, ...]
9899 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
9901 ## Get minimal distance between the given shapes.
9902 # @param theShape1,theShape2 Shapes to find minimal distance between.
9903 # @return Value of the minimal distance between the given shapes.
9905 # @ref tui_measurement_tools_page "Example"
9906 @ManageTransactions("MeasuOp")
9907 def MinDistance(self, theShape1, theShape2):
9909 Get minimal distance between the given shapes.
9912 theShape1,theShape2 Shapes to find minimal distance between.
9915 Value of the minimal distance between the given shapes.
9917 # Example: see GEOM_TestMeasures.py
9918 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9919 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9922 ## Get minimal distance between the given shapes.
9923 # @param theShape1,theShape2 Shapes to find minimal distance between.
9924 # @return Value of the minimal distance between the given shapes, in form of list
9925 # [Distance, DX, DY, DZ].
9927 # @ref swig_all_measure "Example"
9928 @ManageTransactions("MeasuOp")
9929 def MinDistanceComponents(self, theShape1, theShape2):
9931 Get minimal distance between the given shapes.
9934 theShape1,theShape2 Shapes to find minimal distance between.
9937 Value of the minimal distance between the given shapes, in form of list
9938 [Distance, DX, DY, DZ]
9940 # Example: see GEOM_TestMeasures.py
9941 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9942 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9943 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9946 ## Get closest points of the given shapes.
9947 # @param theShape1,theShape2 Shapes to find closest points of.
9948 # @return The number of found solutions (-1 in case of infinite number of
9949 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9951 # @ref tui_measurement_tools_page "Example"
9952 @ManageTransactions("MeasuOp")
9953 def ClosestPoints (self, theShape1, theShape2):
9955 Get closest points of the given shapes.
9958 theShape1,theShape2 Shapes to find closest points of.
9961 The number of found solutions (-1 in case of infinite number of
9962 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9964 # Example: see GEOM_TestMeasures.py
9965 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9966 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9969 ## Get angle between the given shapes in degrees.
9970 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9971 # @note If both arguments are vectors, the angle is computed in accordance
9972 # with their orientations, otherwise the minimum angle is computed.
9973 # @return Value of the angle between the given shapes in degrees.
9975 # @ref tui_measurement_tools_page "Example"
9976 @ManageTransactions("MeasuOp")
9977 def GetAngle(self, theShape1, theShape2):
9979 Get angle between the given shapes in degrees.
9982 theShape1,theShape2 Lines or linear edges to find angle between.
9985 If both arguments are vectors, the angle is computed in accordance
9986 with their orientations, otherwise the minimum angle is computed.
9989 Value of the angle between the given shapes in degrees.
9991 # Example: see GEOM_TestMeasures.py
9992 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9993 RaiseIfFailed("GetAngle", self.MeasuOp)
9996 ## Get angle between the given shapes in radians.
9997 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9998 # @note If both arguments are vectors, the angle is computed in accordance
9999 # with their orientations, otherwise the minimum angle is computed.
10000 # @return Value of the angle between the given shapes in radians.
10002 # @ref tui_measurement_tools_page "Example"
10003 @ManageTransactions("MeasuOp")
10004 def GetAngleRadians(self, theShape1, theShape2):
10006 Get angle between the given shapes in radians.
10009 theShape1,theShape2 Lines or linear edges to find angle between.
10013 If both arguments are vectors, the angle is computed in accordance
10014 with their orientations, otherwise the minimum angle is computed.
10017 Value of the angle between the given shapes in radians.
10019 # Example: see GEOM_TestMeasures.py
10020 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10021 RaiseIfFailed("GetAngle", self.MeasuOp)
10024 ## Get angle between the given vectors in degrees.
10025 # @param theShape1,theShape2 Vectors to find angle between.
10026 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10027 # if False, the opposite vector to the normal vector is used.
10028 # @return Value of the angle between the given vectors in degrees.
10030 # @ref tui_measurement_tools_page "Example"
10031 @ManageTransactions("MeasuOp")
10032 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10034 Get angle between the given vectors in degrees.
10037 theShape1,theShape2 Vectors to find angle between.
10038 theFlag If True, the normal vector is defined by the two vectors cross,
10039 if False, the opposite vector to the normal vector is used.
10042 Value of the angle between the given vectors in degrees.
10044 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10046 anAngle = 360. - anAngle
10047 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10050 ## The same as GetAngleVectors, but the result is in radians.
10051 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10053 Get angle between the given vectors in radians.
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 radians.
10063 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10066 ## @name Curve Curvature Measurement
10067 # Methods for receiving radius of curvature of curves
10068 # in the given point
10071 ## Measure curvature of a curve at a point, set by parameter.
10072 # @param theCurve a curve.
10073 # @param theParam parameter.
10074 # @return radius of curvature of \a theCurve.
10076 # @ref swig_todo "Example"
10077 @ManageTransactions("MeasuOp")
10078 def CurveCurvatureByParam(self, theCurve, theParam):
10080 Measure curvature of a curve at a point, set by parameter.
10084 theParam parameter.
10087 radius of curvature of theCurve.
10089 # Example: see GEOM_TestMeasures.py
10090 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10091 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10094 ## Measure curvature of a curve at a point.
10095 # @param theCurve a curve.
10096 # @param thePoint given point.
10097 # @return radius of curvature of \a theCurve.
10099 # @ref swig_todo "Example"
10100 @ManageTransactions("MeasuOp")
10101 def CurveCurvatureByPoint(self, theCurve, thePoint):
10103 Measure curvature of a curve at a point.
10107 thePoint given point.
10110 radius of curvature of theCurve.
10112 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10113 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10117 ## @name Surface Curvature Measurement
10118 # Methods for receiving max and min radius of curvature of surfaces
10119 # in the given point
10122 ## Measure max radius of curvature of surface.
10123 # @param theSurf the given surface.
10124 # @param theUParam Value of U-parameter on the referenced surface.
10125 # @param theVParam Value of V-parameter on the referenced surface.
10126 # @return max radius of curvature of theSurf.
10128 ## @ref swig_todo "Example"
10129 @ManageTransactions("MeasuOp")
10130 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10132 Measure max radius of curvature of surface.
10135 theSurf the given surface.
10136 theUParam Value of U-parameter on the referenced surface.
10137 theVParam Value of V-parameter on the referenced surface.
10140 max radius of curvature of theSurf.
10142 # Example: see GEOM_TestMeasures.py
10143 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10144 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10147 ## Measure max radius of curvature of surface in the given point
10148 # @param theSurf the given surface.
10149 # @param thePoint given point.
10150 # @return max radius of curvature of theSurf.
10152 ## @ref swig_todo "Example"
10153 @ManageTransactions("MeasuOp")
10154 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10156 Measure max radius of curvature of surface in the given point.
10159 theSurf the given surface.
10160 thePoint given point.
10163 max radius of curvature of theSurf.
10165 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10166 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10169 ## Measure min radius of curvature of surface.
10170 # @param theSurf the given surface.
10171 # @param theUParam Value of U-parameter on the referenced surface.
10172 # @param theVParam Value of V-parameter on the referenced surface.
10173 # @return min radius of curvature of theSurf.
10175 ## @ref swig_todo "Example"
10176 @ManageTransactions("MeasuOp")
10177 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10179 Measure min radius of curvature of surface.
10182 theSurf the given surface.
10183 theUParam Value of U-parameter on the referenced surface.
10184 theVParam Value of V-parameter on the referenced surface.
10187 Min radius of curvature of theSurf.
10189 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10190 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10193 ## Measure min radius of curvature of surface in the given point
10194 # @param theSurf the given surface.
10195 # @param thePoint given point.
10196 # @return min radius of curvature of theSurf.
10198 ## @ref swig_todo "Example"
10199 @ManageTransactions("MeasuOp")
10200 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10202 Measure min radius of curvature of surface in the given point.
10205 theSurf the given surface.
10206 thePoint given point.
10209 Min radius of curvature of theSurf.
10211 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10212 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10216 ## Get min and max tolerances of sub-shapes of theShape
10217 # @param theShape Shape, to get tolerances of.
10218 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10219 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10220 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10221 # VertMin,VertMax: Min and max tolerances of the vertices.
10223 # @ref tui_measurement_tools_page "Example"
10224 @ManageTransactions("MeasuOp")
10225 def Tolerance(self,theShape):
10227 Get min and max tolerances of sub-shapes of theShape
10230 theShape Shape, to get tolerances of.
10233 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10234 FaceMin,FaceMax: Min and max tolerances of the faces.
10235 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10236 VertMin,VertMax: Min and max tolerances of the vertices.
10238 # Example: see GEOM_TestMeasures.py
10239 aTuple = self.MeasuOp.GetTolerance(theShape)
10240 RaiseIfFailed("GetTolerance", self.MeasuOp)
10243 ## Obtain description of the given shape (number of sub-shapes of each type)
10244 # @param theShape Shape to be described.
10245 # @return Description of the given shape.
10247 # @ref tui_measurement_tools_page "Example"
10248 @ManageTransactions("MeasuOp")
10249 def WhatIs(self,theShape):
10251 Obtain description of the given shape (number of sub-shapes of each type)
10254 theShape Shape to be described.
10257 Description of the given shape.
10259 # Example: see GEOM_TestMeasures.py
10260 aDescr = self.MeasuOp.WhatIs(theShape)
10261 RaiseIfFailed("WhatIs", self.MeasuOp)
10264 ## Obtain quantity of shapes of the given type in \a theShape.
10265 # If \a theShape is of type \a theType, it is also counted.
10266 # @param theShape Shape to be described.
10267 # @param theType the given ShapeType().
10268 # @return Quantity of shapes of type \a theType in \a theShape.
10270 # @ref tui_measurement_tools_page "Example"
10271 def NbShapes (self, theShape, theType):
10273 Obtain quantity of shapes of the given type in theShape.
10274 If theShape is of type theType, it is also counted.
10277 theShape Shape to be described.
10278 theType the given geompy.ShapeType
10281 Quantity of shapes of type theType in theShape.
10283 # Example: see GEOM_TestMeasures.py
10284 listSh = self.SubShapeAllIDs(theShape, theType)
10288 ## Obtain quantity of shapes of each type in \a theShape.
10289 # The \a theShape is also counted.
10290 # @param theShape Shape to be described.
10291 # @return Dictionary of ShapeType() with bound quantities of shapes.
10293 # @ref tui_measurement_tools_page "Example"
10294 def ShapeInfo (self, theShape):
10296 Obtain quantity of shapes of each type in theShape.
10297 The theShape is also counted.
10300 theShape Shape to be described.
10303 Dictionary of geompy.ShapeType with bound quantities of shapes.
10305 # Example: see GEOM_TestMeasures.py
10307 for typeSh in self.ShapeType:
10308 if typeSh in ( "AUTO", "SHAPE" ): continue
10309 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10315 def GetCreationInformation(self, theShape):
10316 info = theShape.GetCreationInformation()
10318 opName = info.operationName
10319 if not opName: opName = "no info available"
10320 res = "Operation: " + opName
10322 for parVal in info.params:
10323 res += " \n %s = %s" % ( parVal.name, parVal.value )
10326 ## Get a point, situated at the centre of mass of theShape.
10327 # @param theShape Shape to define centre of mass of.
10328 # @param theName Object name; when specified, this parameter is used
10329 # for result publication in the study. Otherwise, if automatic
10330 # publication is switched on, default value is used for result name.
10332 # @return New GEOM.GEOM_Object, containing the created point.
10334 # @ref tui_measurement_tools_page "Example"
10335 @ManageTransactions("MeasuOp")
10336 def MakeCDG(self, theShape, theName=None):
10338 Get a point, situated at the centre of mass of theShape.
10341 theShape Shape to define centre of mass of.
10342 theName Object name; when specified, this parameter is used
10343 for result publication in the study. Otherwise, if automatic
10344 publication is switched on, default value is used for result name.
10347 New GEOM.GEOM_Object, containing the created point.
10349 # Example: see GEOM_TestMeasures.py
10350 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10351 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10352 self._autoPublish(anObj, theName, "centerOfMass")
10355 ## Get a vertex sub-shape by index depended with orientation.
10356 # @param theShape Shape to find sub-shape.
10357 # @param theIndex Index to find vertex by this index (starting from zero)
10358 # @param theName Object name; when specified, this parameter is used
10359 # for result publication in the study. Otherwise, if automatic
10360 # publication is switched on, default value is used for result name.
10362 # @return New GEOM.GEOM_Object, containing the created vertex.
10364 # @ref tui_measurement_tools_page "Example"
10365 @ManageTransactions("MeasuOp")
10366 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10368 Get a vertex sub-shape by index depended with orientation.
10371 theShape Shape to find sub-shape.
10372 theIndex Index to find vertex by this index (starting from zero)
10373 theName Object name; when specified, this parameter is used
10374 for result publication in the study. Otherwise, if automatic
10375 publication is switched on, default value is used for result name.
10378 New GEOM.GEOM_Object, containing the created vertex.
10380 # Example: see GEOM_TestMeasures.py
10381 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10382 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10383 self._autoPublish(anObj, theName, "vertex")
10386 ## Get the first vertex of wire/edge depended orientation.
10387 # @param theShape Shape to find first vertex.
10388 # @param theName Object name; when specified, this parameter is used
10389 # for result publication in the study. Otherwise, if automatic
10390 # publication is switched on, default value is used for result name.
10392 # @return New GEOM.GEOM_Object, containing the created vertex.
10394 # @ref tui_measurement_tools_page "Example"
10395 def GetFirstVertex(self, theShape, theName=None):
10397 Get the first vertex of wire/edge depended orientation.
10400 theShape Shape to find first vertex.
10401 theName Object name; when specified, this parameter is used
10402 for result publication in the study. Otherwise, if automatic
10403 publication is switched on, default value is used for result name.
10406 New GEOM.GEOM_Object, containing the created vertex.
10408 # Example: see GEOM_TestMeasures.py
10409 # note: auto-publishing is done in self.GetVertexByIndex()
10410 return self.GetVertexByIndex(theShape, 0, theName)
10412 ## Get the last vertex of wire/edge depended orientation.
10413 # @param theShape Shape to find last vertex.
10414 # @param theName Object name; when specified, this parameter is used
10415 # for result publication in the study. Otherwise, if automatic
10416 # publication is switched on, default value is used for result name.
10418 # @return New GEOM.GEOM_Object, containing the created vertex.
10420 # @ref tui_measurement_tools_page "Example"
10421 def GetLastVertex(self, theShape, theName=None):
10423 Get the last vertex of wire/edge depended orientation.
10426 theShape Shape to find last vertex.
10427 theName Object name; when specified, this parameter is used
10428 for result publication in the study. Otherwise, if automatic
10429 publication is switched on, default value is used for result name.
10432 New GEOM.GEOM_Object, containing the created vertex.
10434 # Example: see GEOM_TestMeasures.py
10435 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10436 # note: auto-publishing is done in self.GetVertexByIndex()
10437 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10439 ## Get a normale to the given face. If the point is not given,
10440 # the normale is calculated at the center of mass.
10441 # @param theFace Face to define normale of.
10442 # @param theOptionalPoint Point to compute the normale at.
10443 # @param theName Object name; when specified, this parameter is used
10444 # for result publication in the study. Otherwise, if automatic
10445 # publication is switched on, default value is used for result name.
10447 # @return New GEOM.GEOM_Object, containing the created vector.
10449 # @ref swig_todo "Example"
10450 @ManageTransactions("MeasuOp")
10451 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10453 Get a normale to the given face. If the point is not given,
10454 the normale is calculated at the center of mass.
10457 theFace Face to define normale of.
10458 theOptionalPoint Point to compute the normale at.
10459 theName Object name; when specified, this parameter is used
10460 for result publication in the study. Otherwise, if automatic
10461 publication is switched on, default value is used for result name.
10464 New GEOM.GEOM_Object, containing the created vector.
10466 # Example: see GEOM_TestMeasures.py
10467 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10468 RaiseIfFailed("GetNormal", self.MeasuOp)
10469 self._autoPublish(anObj, theName, "normal")
10472 ## Print shape errors obtained from CheckShape.
10473 # @param theShape Shape that was checked.
10474 # @param theShapeErrors the shape errors obtained by CheckShape.
10475 # @param theReturnStatus If 0 the description of problem is printed.
10476 # If 1 the description of problem is returned.
10477 # @return If theReturnStatus is equal to 1 the description is returned.
10478 # Otherwise doesn't return anything.
10480 # @ref tui_measurement_tools_page "Example"
10481 @ManageTransactions("MeasuOp")
10482 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10484 Print shape errors obtained from CheckShape.
10487 theShape Shape that was checked.
10488 theShapeErrors the shape errors obtained by CheckShape.
10489 theReturnStatus If 0 the description of problem is printed.
10490 If 1 the description of problem is returned.
10493 If theReturnStatus is equal to 1 the description is returned.
10494 Otherwise doesn't return anything.
10496 # Example: see GEOM_TestMeasures.py
10497 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10498 if theReturnStatus == 1:
10503 ## Check a topology of the given shape.
10504 # @param theShape Shape to check validity of.
10505 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10506 # if TRUE, the shape's geometry will be checked also.
10507 # @param theReturnStatus If 0 and if theShape is invalid, a description
10508 # of problem is printed.
10509 # If 1 isValid flag and the description of
10510 # problem is returned.
10511 # If 2 isValid flag and the list of error data
10513 # @return TRUE, if the shape "seems to be valid".
10514 # If theShape is invalid, prints a description of problem.
10515 # If theReturnStatus is equal to 1 the description is returned
10516 # along with IsValid flag.
10517 # If theReturnStatus is equal to 2 the list of error data is
10518 # returned along with IsValid flag.
10520 # @ref tui_measurement_tools_page "Example"
10521 @ManageTransactions("MeasuOp")
10522 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10524 Check a topology of the given shape.
10527 theShape Shape to check validity of.
10528 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10529 if TRUE, the shape's geometry will be checked also.
10530 theReturnStatus If 0 and if theShape is invalid, a description
10531 of problem is printed.
10532 If 1 IsValid flag and the description of
10533 problem is returned.
10534 If 2 IsValid flag and the list of error data
10538 TRUE, if the shape "seems to be valid".
10539 If theShape is invalid, prints a description of problem.
10540 If theReturnStatus is equal to 1 the description is returned
10541 along with IsValid flag.
10542 If theReturnStatus is equal to 2 the list of error data is
10543 returned along with IsValid flag.
10545 # Example: see GEOM_TestMeasures.py
10547 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10548 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10550 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10551 RaiseIfFailed("CheckShape", self.MeasuOp)
10553 if theReturnStatus == 0:
10554 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10556 if theReturnStatus == 1:
10557 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10558 return (IsValid, Descr)
10559 elif theReturnStatus == 2:
10560 return (IsValid, ShapeErrors)
10563 ## Detect self-intersections in the given shape.
10564 # @param theShape Shape to check.
10565 # @return TRUE, if the shape contains no self-intersections.
10567 # @ref tui_measurement_tools_page "Example"
10568 @ManageTransactions("MeasuOp")
10569 def CheckSelfIntersections(self, theShape):
10571 Detect self-intersections in the given shape.
10574 theShape Shape to check.
10577 TRUE, if the shape contains no self-intersections.
10579 # Example: see GEOM_TestMeasures.py
10580 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
10581 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10584 ## Get position (LCS) of theShape.
10586 # Origin of the LCS is situated at the shape's center of mass.
10587 # Axes of the LCS are obtained from shape's location or,
10588 # if the shape is a planar face, from position of its plane.
10590 # @param theShape Shape to calculate position of.
10591 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10592 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
10593 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10594 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10596 # @ref swig_todo "Example"
10597 @ManageTransactions("MeasuOp")
10598 def GetPosition(self,theShape):
10600 Get position (LCS) of theShape.
10601 Origin of the LCS is situated at the shape's center of mass.
10602 Axes of the LCS are obtained from shape's location or,
10603 if the shape is a planar face, from position of its plane.
10606 theShape Shape to calculate position of.
10609 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
10610 Ox,Oy,Oz: Coordinates of shape's LCS origin.
10611 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
10612 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
10614 # Example: see GEOM_TestMeasures.py
10615 aTuple = self.MeasuOp.GetPosition(theShape)
10616 RaiseIfFailed("GetPosition", self.MeasuOp)
10619 ## Get kind of theShape.
10621 # @param theShape Shape to get a kind of.
10622 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
10623 # and a list of parameters, describing the shape.
10624 # @note Concrete meaning of each value, returned via \a theIntegers
10625 # or \a theDoubles list depends on the kind() of the shape.
10627 # @ref swig_todo "Example"
10628 @ManageTransactions("MeasuOp")
10629 def KindOfShape(self,theShape):
10631 Get kind of theShape.
10634 theShape Shape to get a kind of.
10637 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
10638 and a list of parameters, describing the shape.
10640 Concrete meaning of each value, returned via theIntegers
10641 or theDoubles list depends on the geompy.kind of the shape
10643 # Example: see GEOM_TestMeasures.py
10644 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
10645 RaiseIfFailed("KindOfShape", self.MeasuOp)
10647 aKind = aRoughTuple[0]
10648 anInts = aRoughTuple[1]
10649 aDbls = aRoughTuple[2]
10651 # Now there is no exception from this rule:
10652 aKindTuple = [aKind] + aDbls + anInts
10654 # If they are we will regroup parameters for such kind of shape.
10656 #if aKind == kind.SOME_KIND:
10657 # # SOME_KIND int int double int double double
10658 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
10662 ## Returns the string that describes if the shell is good for solid.
10663 # This is a support method for MakeSolid.
10665 # @param theShell the shell to be checked.
10666 # @return Returns a string that describes the shell validity for
10667 # solid construction.
10668 @ManageTransactions("MeasuOp")
10669 def _IsGoodForSolid(self, theShell):
10671 Returns the string that describes if the shell is good for solid.
10672 This is a support method for MakeSolid.
10675 theShell the shell to be checked.
10678 Returns a string that describes the shell validity for
10679 solid construction.
10681 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
10684 # end of l2_measure
10687 ## @addtogroup l2_import_export
10690 ## Import a shape from the BREP, IGES, STEP or other file
10691 # (depends on given format) with given name.
10693 # Note: this function is deprecated, it is kept for backward compatibility only
10694 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10696 # @param theFileName The file, containing the shape.
10697 # @param theFormatName Specify format for the file reading.
10698 # Available formats can be obtained with InsertOp.ImportTranslators() method.
10699 # If format 'IGES_SCALE' is used instead of 'IGES' or
10700 # format 'STEP_SCALE' is used instead of 'STEP',
10701 # length unit will be set to 'meter' and result model will be scaled.
10702 # @param theName Object name; when specified, this parameter is used
10703 # for result publication in the study. Otherwise, if automatic
10704 # publication is switched on, default value is used for result name.
10706 # @return New GEOM.GEOM_Object, containing the imported shape.
10707 # If material names are imported it returns the list of
10708 # objects. The first one is the imported object followed by
10710 # @note Auto publishing is allowed for the shape itself. Imported
10711 # material groups are not automatically published.
10713 # @ref swig_Import_Export "Example"
10714 @ManageTransactions("InsertOp")
10715 def ImportFile(self, theFileName, theFormatName, theName=None):
10717 Import a shape from the BREP, IGES, STEP or other file
10718 (depends on given format) with given name.
10720 Note: this function is deprecated, it is kept for backward compatibility only
10721 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
10724 theFileName The file, containing the shape.
10725 theFormatName Specify format for the file reading.
10726 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
10727 If format 'IGES_SCALE' is used instead of 'IGES' or
10728 format 'STEP_SCALE' is used instead of 'STEP',
10729 length unit will be set to 'meter' and result model will be scaled.
10730 theName Object name; when specified, this parameter is used
10731 for result publication in the study. Otherwise, if automatic
10732 publication is switched on, default value is used for result name.
10735 New GEOM.GEOM_Object, containing the imported shape.
10736 If material names are imported it returns the list of
10737 objects. The first one is the imported object followed by
10740 Auto publishing is allowed for the shape itself. Imported
10741 material groups are not automatically published.
10743 # Example: see GEOM_TestOthers.py
10745 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
10746 where <FormatName> is a name of desirable format for importing.
10748 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
10749 RaiseIfFailed("ImportFile", self.InsertOp)
10750 aNbObj = len(aListObj)
10752 self._autoPublish(aListObj[0], theName, "imported")
10757 ## Deprecated analog of ImportFile()
10758 def Import(self, theFileName, theFormatName, theName=None):
10760 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
10762 # note: auto-publishing is done in self.ImportFile()
10763 return self.ImportFile(theFileName, theFormatName, theName)
10765 ## Read a shape from the binary stream, containing its bounding representation (BRep).
10766 # @note This method will not be dumped to the python script by DumpStudy functionality.
10767 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
10768 # @param theStream The BRep binary stream.
10769 # @param theName Object name; when specified, this parameter is used
10770 # for result publication in the study. Otherwise, if automatic
10771 # publication is switched on, default value is used for result name.
10773 # @return New GEOM_Object, containing the shape, read from theStream.
10775 # @ref swig_Import_Export "Example"
10776 @ManageTransactions("InsertOp")
10777 def RestoreShape (self, theStream, theName=None):
10779 Read a shape from the binary stream, containing its bounding representation (BRep).
10782 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
10785 theStream The BRep binary stream.
10786 theName Object name; when specified, this parameter is used
10787 for result publication in the study. Otherwise, if automatic
10788 publication is switched on, default value is used for result name.
10791 New GEOM_Object, containing the shape, read from theStream.
10793 # Example: see GEOM_TestOthers.py
10794 anObj = self.InsertOp.RestoreShape(theStream)
10795 RaiseIfFailed("RestoreShape", self.InsertOp)
10796 self._autoPublish(anObj, theName, "restored")
10799 ## Export the given shape into a file with given name.
10801 # Note: this function is deprecated, it is kept for backward compatibility only
10802 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10804 # @param theObject Shape to be stored in the file.
10805 # @param theFileName Name of the file to store the given shape in.
10806 # @param theFormatName Specify format for the shape storage.
10807 # Available formats can be obtained with
10808 # geompy.InsertOp.ExportTranslators()[0] method.
10810 # @ref swig_Import_Export "Example"
10811 @ManageTransactions("InsertOp")
10812 def Export(self, theObject, theFileName, theFormatName):
10814 Export the given shape into a file with given name.
10816 Note: this function is deprecated, it is kept for backward compatibility only
10817 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
10820 theObject Shape to be stored in the file.
10821 theFileName Name of the file to store the given shape in.
10822 theFormatName Specify format for the shape storage.
10823 Available formats can be obtained with
10824 geompy.InsertOp.ExportTranslators()[0] method.
10826 # Example: see GEOM_TestOthers.py
10828 WARNING: Function Export is deprecated, use Export<FormatName> instead,
10829 where <FormatName> is a name of desirable format for exporting.
10831 self.InsertOp.Export(theObject, theFileName, theFormatName)
10832 if self.InsertOp.IsDone() == 0:
10833 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
10837 # end of l2_import_export
10840 ## @addtogroup l3_blocks
10843 ## Create a quadrangle face from four edges. Order of Edges is not
10844 # important. It is not necessary that edges share the same vertex.
10845 # @param E1,E2,E3,E4 Edges for the face bound.
10846 # @param theName Object name; when specified, this parameter is used
10847 # for result publication in the study. Otherwise, if automatic
10848 # publication is switched on, default value is used for result name.
10850 # @return New GEOM.GEOM_Object, containing the created face.
10852 # @ref tui_building_by_blocks_page "Example"
10853 @ManageTransactions("BlocksOp")
10854 def MakeQuad(self, E1, E2, E3, E4, theName=None):
10856 Create a quadrangle face from four edges. Order of Edges is not
10857 important. It is not necessary that edges share the same vertex.
10860 E1,E2,E3,E4 Edges for the face bound.
10861 theName Object name; when specified, this parameter is used
10862 for result publication in the study. Otherwise, if automatic
10863 publication is switched on, default value is used for result name.
10866 New GEOM.GEOM_Object, containing the created face.
10869 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
10871 # Example: see GEOM_Spanner.py
10872 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
10873 RaiseIfFailed("MakeQuad", self.BlocksOp)
10874 self._autoPublish(anObj, theName, "quad")
10877 ## Create a quadrangle face on two edges.
10878 # The missing edges will be built by creating the shortest ones.
10879 # @param E1,E2 Two opposite edges for the face.
10880 # @param 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.
10884 # @return New GEOM.GEOM_Object, containing the created face.
10886 # @ref tui_building_by_blocks_page "Example"
10887 @ManageTransactions("BlocksOp")
10888 def MakeQuad2Edges(self, E1, E2, theName=None):
10890 Create a quadrangle face on two edges.
10891 The missing edges will be built by creating the shortest ones.
10894 E1,E2 Two opposite edges for the face.
10895 theName Object name; when specified, this parameter is used
10896 for result publication in the study. Otherwise, if automatic
10897 publication is switched on, default value is used for result name.
10900 New GEOM.GEOM_Object, containing the created face.
10904 p1 = geompy.MakeVertex( 0., 0., 0.)
10905 p2 = geompy.MakeVertex(150., 30., 0.)
10906 p3 = geompy.MakeVertex( 0., 120., 50.)
10907 p4 = geompy.MakeVertex( 0., 40., 70.)
10909 edge1 = geompy.MakeEdge(p1, p2)
10910 edge2 = geompy.MakeEdge(p3, p4)
10911 # create a quadrangle face from two edges
10912 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10914 # Example: see GEOM_Spanner.py
10915 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10916 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10917 self._autoPublish(anObj, theName, "quad")
10920 ## Create a quadrangle face with specified corners.
10921 # The missing edges will be built by creating the shortest ones.
10922 # @param V1,V2,V3,V4 Corner vertices for the face.
10923 # @param theName Object name; when specified, this parameter is used
10924 # for result publication in the study. Otherwise, if automatic
10925 # publication is switched on, default value is used for result name.
10927 # @return New GEOM.GEOM_Object, containing the created face.
10929 # @ref tui_building_by_blocks_page "Example 1"
10930 # \n @ref swig_MakeQuad4Vertices "Example 2"
10931 @ManageTransactions("BlocksOp")
10932 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10934 Create a quadrangle face with specified corners.
10935 The missing edges will be built by creating the shortest ones.
10938 V1,V2,V3,V4 Corner vertices for the face.
10939 theName Object name; when specified, this parameter is used
10940 for result publication in the study. Otherwise, if automatic
10941 publication is switched on, default value is used for result name.
10944 New GEOM.GEOM_Object, containing the created face.
10948 p1 = geompy.MakeVertex( 0., 0., 0.)
10949 p2 = geompy.MakeVertex(150., 30., 0.)
10950 p3 = geompy.MakeVertex( 0., 120., 50.)
10951 p4 = geompy.MakeVertex( 0., 40., 70.)
10952 # create a quadrangle from four points in its corners
10953 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10955 # Example: see GEOM_Spanner.py
10956 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10957 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10958 self._autoPublish(anObj, theName, "quad")
10961 ## Create a hexahedral solid, bounded by the six given faces. Order of
10962 # faces is not important. It is not necessary that Faces share the same edge.
10963 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10964 # @param theName Object name; when specified, this parameter is used
10965 # for result publication in the study. Otherwise, if automatic
10966 # publication is switched on, default value is used for result name.
10968 # @return New GEOM.GEOM_Object, containing the created solid.
10970 # @ref tui_building_by_blocks_page "Example 1"
10971 # \n @ref swig_MakeHexa "Example 2"
10972 @ManageTransactions("BlocksOp")
10973 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10975 Create a hexahedral solid, bounded by the six given faces. Order of
10976 faces is not important. It is not necessary that Faces share the same edge.
10979 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10980 theName Object name; when specified, this parameter is used
10981 for result publication in the study. Otherwise, if automatic
10982 publication is switched on, default value is used for result name.
10985 New GEOM.GEOM_Object, containing the created solid.
10988 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10990 # Example: see GEOM_Spanner.py
10991 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10992 RaiseIfFailed("MakeHexa", self.BlocksOp)
10993 self._autoPublish(anObj, theName, "hexa")
10996 ## Create a hexahedral solid between two given faces.
10997 # The missing faces will be built by creating the smallest ones.
10998 # @param F1,F2 Two opposite faces for the hexahedral solid.
10999 # @param 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.
11003 # @return New GEOM.GEOM_Object, containing the created solid.
11005 # @ref tui_building_by_blocks_page "Example 1"
11006 # \n @ref swig_MakeHexa2Faces "Example 2"
11007 @ManageTransactions("BlocksOp")
11008 def MakeHexa2Faces(self, F1, F2, theName=None):
11010 Create a hexahedral solid between two given faces.
11011 The missing faces will be built by creating the smallest ones.
11014 F1,F2 Two opposite faces for the hexahedral solid.
11015 theName Object name; when specified, this parameter is used
11016 for result publication in the study. Otherwise, if automatic
11017 publication is switched on, default value is used for result name.
11020 New GEOM.GEOM_Object, containing the created solid.
11023 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11025 # Example: see GEOM_Spanner.py
11026 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11027 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11028 self._autoPublish(anObj, theName, "hexa")
11034 ## @addtogroup l3_blocks_op
11037 ## Get a vertex, found in the given shape by its coordinates.
11038 # @param theShape Block or a compound of blocks.
11039 # @param theX,theY,theZ Coordinates of the sought vertex.
11040 # @param theEpsilon Maximum allowed distance between the resulting
11041 # vertex and point with the given coordinates.
11042 # @param theName Object name; when specified, this parameter is used
11043 # for result publication in the study. Otherwise, if automatic
11044 # publication is switched on, default value is used for result name.
11046 # @return New GEOM.GEOM_Object, containing the found vertex.
11048 # @ref swig_GetPoint "Example"
11049 @ManageTransactions("BlocksOp")
11050 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11052 Get a vertex, found in the given shape by its coordinates.
11055 theShape Block or a compound of blocks.
11056 theX,theY,theZ Coordinates of the sought vertex.
11057 theEpsilon Maximum allowed distance between the resulting
11058 vertex and point with the given coordinates.
11059 theName Object name; when specified, this parameter is used
11060 for result publication in the study. Otherwise, if automatic
11061 publication is switched on, default value is used for result name.
11064 New GEOM.GEOM_Object, containing the found vertex.
11067 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11069 # Example: see GEOM_TestOthers.py
11070 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11071 RaiseIfFailed("GetPoint", self.BlocksOp)
11072 self._autoPublish(anObj, theName, "vertex")
11075 ## Find a vertex of the given shape, which has minimal distance to the given point.
11076 # @param theShape Any shape.
11077 # @param thePoint Point, close to the desired vertex.
11078 # @param 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.
11082 # @return New GEOM.GEOM_Object, containing the found vertex.
11084 # @ref swig_GetVertexNearPoint "Example"
11085 @ManageTransactions("BlocksOp")
11086 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11088 Find a vertex of the given shape, which has minimal distance to the given point.
11091 theShape Any shape.
11092 thePoint Point, close to the desired vertex.
11093 theName Object name; when specified, this parameter is used
11094 for result publication in the study. Otherwise, if automatic
11095 publication is switched on, default value is used for result name.
11098 New GEOM.GEOM_Object, containing the found vertex.
11101 pmidle = geompy.MakeVertex(50, 0, 50)
11102 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11104 # Example: see GEOM_TestOthers.py
11105 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11106 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11107 self._autoPublish(anObj, theName, "vertex")
11110 ## Get an edge, found in the given shape by two given vertices.
11111 # @param theShape Block or a compound of blocks.
11112 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11113 # @param theName Object name; when specified, this parameter is used
11114 # for result publication in the study. Otherwise, if automatic
11115 # publication is switched on, default value is used for result name.
11117 # @return New GEOM.GEOM_Object, containing the found edge.
11119 # @ref swig_GetEdge "Example"
11120 @ManageTransactions("BlocksOp")
11121 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11123 Get an edge, found in the given shape by two given vertices.
11126 theShape Block or a compound of blocks.
11127 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11128 theName Object name; when specified, this parameter is used
11129 for result publication in the study. Otherwise, if automatic
11130 publication is switched on, default value is used for result name.
11133 New GEOM.GEOM_Object, containing the found edge.
11135 # Example: see GEOM_Spanner.py
11136 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11137 RaiseIfFailed("GetEdge", self.BlocksOp)
11138 self._autoPublish(anObj, theName, "edge")
11141 ## Find an edge of the given shape, which has minimal distance to the given point.
11142 # @param theShape Block or a compound of blocks.
11143 # @param thePoint Point, close to the desired edge.
11144 # @param theName Object name; when specified, this parameter is used
11145 # for result publication in the study. Otherwise, if automatic
11146 # publication is switched on, default value is used for result name.
11148 # @return New GEOM.GEOM_Object, containing the found edge.
11150 # @ref swig_GetEdgeNearPoint "Example"
11151 @ManageTransactions("BlocksOp")
11152 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11154 Find an edge of the given shape, which has minimal distance to the given point.
11157 theShape Block or a compound of blocks.
11158 thePoint Point, close to the desired edge.
11159 theName Object name; when specified, this parameter is used
11160 for result publication in the study. Otherwise, if automatic
11161 publication is switched on, default value is used for result name.
11164 New GEOM.GEOM_Object, containing the found edge.
11166 # Example: see GEOM_TestOthers.py
11167 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11168 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11169 self._autoPublish(anObj, theName, "edge")
11172 ## Returns a face, found in the given shape by four given corner vertices.
11173 # @param theShape Block or a compound of blocks.
11174 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11175 # @param theName Object name; when specified, this parameter is used
11176 # for result publication in the study. Otherwise, if automatic
11177 # publication is switched on, default value is used for result name.
11179 # @return New GEOM.GEOM_Object, containing the found face.
11181 # @ref swig_todo "Example"
11182 @ManageTransactions("BlocksOp")
11183 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11185 Returns a face, found in the given shape by four given corner vertices.
11188 theShape Block or a compound of blocks.
11189 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11190 theName Object name; when specified, this parameter is used
11191 for result publication in the study. Otherwise, if automatic
11192 publication is switched on, default value is used for result name.
11195 New GEOM.GEOM_Object, containing the found face.
11197 # Example: see GEOM_Spanner.py
11198 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11199 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11200 self._autoPublish(anObj, theName, "face")
11203 ## Get a face of block, found in the given shape by two given edges.
11204 # @param theShape Block or a compound of blocks.
11205 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11206 # @param theName Object name; when specified, this parameter is used
11207 # for result publication in the study. Otherwise, if automatic
11208 # publication is switched on, default value is used for result name.
11210 # @return New GEOM.GEOM_Object, containing the found face.
11212 # @ref swig_todo "Example"
11213 @ManageTransactions("BlocksOp")
11214 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11216 Get a face of block, found in the given shape by two given edges.
11219 theShape Block or a compound of blocks.
11220 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11221 theName Object name; when specified, this parameter is used
11222 for result publication in the study. Otherwise, if automatic
11223 publication is switched on, default value is used for result name.
11226 New GEOM.GEOM_Object, containing the found face.
11228 # Example: see GEOM_Spanner.py
11229 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11230 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11231 self._autoPublish(anObj, theName, "face")
11234 ## Find a face, opposite to the given one in the given block.
11235 # @param theBlock Must be a hexahedral solid.
11236 # @param theFace Face of \a theBlock, opposite to the desired face.
11237 # @param theName Object name; when specified, this parameter is used
11238 # for result publication in the study. Otherwise, if automatic
11239 # publication is switched on, default value is used for result name.
11241 # @return New GEOM.GEOM_Object, containing the found face.
11243 # @ref swig_GetOppositeFace "Example"
11244 @ManageTransactions("BlocksOp")
11245 def GetOppositeFace(self, theBlock, theFace, theName=None):
11247 Find a face, opposite to the given one in the given block.
11250 theBlock Must be a hexahedral solid.
11251 theFace Face of theBlock, opposite to the desired face.
11252 theName Object name; when specified, this parameter is used
11253 for result publication in the study. Otherwise, if automatic
11254 publication is switched on, default value is used for result name.
11257 New GEOM.GEOM_Object, containing the found face.
11259 # Example: see GEOM_Spanner.py
11260 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11261 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11262 self._autoPublish(anObj, theName, "face")
11265 ## Find a face of the given shape, which has minimal distance to the given point.
11266 # @param theShape Block or a compound of blocks.
11267 # @param thePoint Point, close to the desired face.
11268 # @param theName Object name; when specified, this parameter is used
11269 # for result publication in the study. Otherwise, if automatic
11270 # publication is switched on, default value is used for result name.
11272 # @return New GEOM.GEOM_Object, containing the found face.
11274 # @ref swig_GetFaceNearPoint "Example"
11275 @ManageTransactions("BlocksOp")
11276 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11278 Find a face of the given shape, which has minimal distance to the given point.
11281 theShape Block or a compound of blocks.
11282 thePoint Point, close to the desired face.
11283 theName Object name; when specified, this parameter is used
11284 for result publication in the study. Otherwise, if automatic
11285 publication is switched on, default value is used for result name.
11288 New GEOM.GEOM_Object, containing the found face.
11290 # Example: see GEOM_Spanner.py
11291 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11292 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11293 self._autoPublish(anObj, theName, "face")
11296 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11297 # @param theBlock Block or a compound of blocks.
11298 # @param theVector Vector, close to the normale of the desired face.
11299 # @param theName Object name; when specified, this parameter is used
11300 # for result publication in the study. Otherwise, if automatic
11301 # publication is switched on, default value is used for result name.
11303 # @return New GEOM.GEOM_Object, containing the found face.
11305 # @ref swig_todo "Example"
11306 @ManageTransactions("BlocksOp")
11307 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11309 Find a face of block, whose outside normale has minimal angle with the given vector.
11312 theBlock Block or a compound of blocks.
11313 theVector Vector, close to the normale of the desired face.
11314 theName Object name; when specified, this parameter is used
11315 for result publication in the study. Otherwise, if automatic
11316 publication is switched on, default value is used for result name.
11319 New GEOM.GEOM_Object, containing the found face.
11321 # Example: see GEOM_Spanner.py
11322 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11323 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11324 self._autoPublish(anObj, theName, "face")
11327 ## Find all sub-shapes of type \a theShapeType of the given shape,
11328 # which have minimal distance to the given point.
11329 # @param theShape Any shape.
11330 # @param thePoint Point, close to the desired shape.
11331 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11332 # @param theTolerance The tolerance for distances comparison. All shapes
11333 # with distances to the given point in interval
11334 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11335 # @param theName Object name; when specified, this parameter is used
11336 # for result publication in the study. Otherwise, if automatic
11337 # publication is switched on, default value is used for result name.
11339 # @return New GEOM_Object, containing a group of all found shapes.
11341 # @ref swig_GetShapesNearPoint "Example"
11342 @ManageTransactions("BlocksOp")
11343 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11345 Find all sub-shapes of type theShapeType of the given shape,
11346 which have minimal distance to the given point.
11349 theShape Any shape.
11350 thePoint Point, close to the desired shape.
11351 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11352 theTolerance The tolerance for distances comparison. All shapes
11353 with distances to the given point in interval
11354 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11355 theName Object name; when specified, this parameter is used
11356 for result publication in the study. Otherwise, if automatic
11357 publication is switched on, default value is used for result name.
11360 New GEOM_Object, containing a group of all found shapes.
11362 # Example: see GEOM_TestOthers.py
11363 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11364 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11365 self._autoPublish(anObj, theName, "group")
11368 # end of l3_blocks_op
11371 ## @addtogroup l4_blocks_measure
11374 ## Check, if the compound of blocks is given.
11375 # To be considered as a compound of blocks, the
11376 # given shape must satisfy the following conditions:
11377 # - Each element of the compound should be a Block (6 faces and 12 edges).
11378 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11379 # - The compound should be connexe.
11380 # - The glue between two quadrangle faces should be applied.
11381 # @param theCompound The compound to check.
11382 # @return TRUE, if the given shape is a compound of blocks.
11383 # If theCompound is not valid, prints all discovered errors.
11385 # @ref tui_measurement_tools_page "Example 1"
11386 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11387 @ManageTransactions("BlocksOp")
11388 def CheckCompoundOfBlocks(self,theCompound):
11390 Check, if the compound of blocks is given.
11391 To be considered as a compound of blocks, the
11392 given shape must satisfy the following conditions:
11393 - Each element of the compound should be a Block (6 faces and 12 edges).
11394 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11395 - The compound should be connexe.
11396 - The glue between two quadrangle faces should be applied.
11399 theCompound The compound to check.
11402 TRUE, if the given shape is a compound of blocks.
11403 If theCompound is not valid, prints all discovered errors.
11405 # Example: see GEOM_Spanner.py
11406 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
11407 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11409 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11413 ## Retrieve all non blocks solids and faces from \a theShape.
11414 # @param theShape The shape to explore.
11415 # @param theName Object name; when specified, this parameter is used
11416 # for result publication in the study. Otherwise, if automatic
11417 # publication is switched on, default value is used for result name.
11419 # @return A tuple of two GEOM_Objects. The first object is a group of all
11420 # non block solids (= not 6 faces, or with 6 faces, but with the
11421 # presence of non-quadrangular faces). The second object is a
11422 # group of all non quadrangular faces.
11424 # @ref tui_measurement_tools_page "Example 1"
11425 # \n @ref swig_GetNonBlocks "Example 2"
11426 @ManageTransactions("BlocksOp")
11427 def GetNonBlocks (self, theShape, theName=None):
11429 Retrieve all non blocks solids and faces from theShape.
11432 theShape The shape to explore.
11433 theName Object name; when specified, this parameter is used
11434 for result publication in the study. Otherwise, if automatic
11435 publication is switched on, default value is used for result name.
11438 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.
11444 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11446 # Example: see GEOM_Spanner.py
11447 aTuple = self.BlocksOp.GetNonBlocks(theShape)
11448 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11449 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11452 ## Remove all seam and degenerated edges from \a theShape.
11453 # Unite faces and edges, sharing one surface. It means that
11454 # this faces must have references to one C++ surface object (handle).
11455 # @param theShape The compound or single solid to remove irregular edges from.
11456 # @param doUnionFaces If True, then unite faces. If False (the default value),
11457 # do not unite faces.
11458 # @param theName Object name; when specified, this parameter is used
11459 # for result publication in the study. Otherwise, if automatic
11460 # publication is switched on, default value is used for result name.
11462 # @return Improved shape.
11464 # @ref swig_RemoveExtraEdges "Example"
11465 @ManageTransactions("BlocksOp")
11466 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11468 Remove all seam and degenerated edges from theShape.
11469 Unite faces and edges, sharing one surface. It means that
11470 this faces must have references to one C++ surface object (handle).
11473 theShape The compound or single solid to remove irregular edges from.
11474 doUnionFaces If True, then unite faces. If False (the default value),
11475 do not unite faces.
11476 theName Object name; when specified, this parameter is used
11477 for result publication in the study. Otherwise, if automatic
11478 publication is switched on, default value is used for result name.
11483 # Example: see GEOM_TestOthers.py
11484 nbFacesOptimum = -1 # -1 means do not unite faces
11485 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11486 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11487 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11488 self._autoPublish(anObj, theName, "removeExtraEdges")
11491 ## Performs union faces of \a theShape
11492 # Unite faces sharing one surface. It means that
11493 # these faces must have references to one C++ surface object (handle).
11494 # @param theShape The compound or single solid that contains faces
11495 # to perform union.
11496 # @param theName Object name; when specified, this parameter is used
11497 # for result publication in the study. Otherwise, if automatic
11498 # publication is switched on, default value is used for result name.
11500 # @return Improved shape.
11502 # @ref swig_UnionFaces "Example"
11503 @ManageTransactions("BlocksOp")
11504 def UnionFaces(self, theShape, theName=None):
11506 Performs union faces of theShape.
11507 Unite faces sharing one surface. It means that
11508 these faces must have references to one C++ surface object (handle).
11511 theShape The compound or single solid that contains faces
11513 theName Object name; when specified, this parameter is used
11514 for result publication in the study. Otherwise, if automatic
11515 publication is switched on, default value is used for result name.
11520 # Example: see GEOM_TestOthers.py
11521 anObj = self.BlocksOp.UnionFaces(theShape)
11522 RaiseIfFailed("UnionFaces", self.BlocksOp)
11523 self._autoPublish(anObj, theName, "unionFaces")
11526 ## Check, if the given shape is a blocks compound.
11527 # Fix all detected errors.
11528 # \note Single block can be also fixed by this method.
11529 # @param theShape The compound to check and improve.
11530 # @param theName Object name; when specified, this parameter is used
11531 # for result publication in the study. Otherwise, if automatic
11532 # publication is switched on, default value is used for result name.
11534 # @return Improved compound.
11536 # @ref swig_CheckAndImprove "Example"
11537 @ManageTransactions("BlocksOp")
11538 def CheckAndImprove(self, theShape, theName=None):
11540 Check, if the given shape is a blocks compound.
11541 Fix all detected errors.
11544 Single block can be also fixed by this method.
11547 theShape The compound to check and improve.
11548 theName Object name; when specified, this parameter is used
11549 for result publication in the study. Otherwise, if automatic
11550 publication is switched on, default value is used for result name.
11555 # Example: see GEOM_TestOthers.py
11556 anObj = self.BlocksOp.CheckAndImprove(theShape)
11557 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
11558 self._autoPublish(anObj, theName, "improved")
11561 # end of l4_blocks_measure
11564 ## @addtogroup l3_blocks_op
11567 ## Get all the blocks, contained in the given compound.
11568 # @param theCompound The compound to explode.
11569 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
11570 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
11571 # @param theName Object name; when specified, this parameter is used
11572 # for result publication in the study. Otherwise, if automatic
11573 # publication is switched on, default value is used for result name.
11575 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11577 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
11579 # @ref tui_explode_on_blocks "Example 1"
11580 # \n @ref swig_MakeBlockExplode "Example 2"
11581 @ManageTransactions("BlocksOp")
11582 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
11584 Get all the blocks, contained in the given compound.
11587 theCompound The compound to explode.
11588 theMinNbFaces If solid has lower number of faces, it is not a block.
11589 theMaxNbFaces If solid has higher number of faces, it is not a block.
11590 theName Object name; when specified, this parameter is used
11591 for result publication in the study. Otherwise, if automatic
11592 publication is switched on, default value is used for result name.
11595 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
11598 List of GEOM.GEOM_Object, containing the retrieved blocks.
11600 # Example: see GEOM_TestOthers.py
11601 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
11602 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
11603 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
11604 for anObj in aList:
11605 anObj.SetParameters(Parameters)
11607 self._autoPublish(aList, theName, "block")
11610 ## Find block, containing the given point inside its volume or on boundary.
11611 # @param theCompound Compound, to find block in.
11612 # @param thePoint Point, close to the desired block. If the point lays on
11613 # boundary between some blocks, we return block with nearest center.
11614 # @param theName Object name; when specified, this parameter is used
11615 # for result publication in the study. Otherwise, if automatic
11616 # publication is switched on, default value is used for result name.
11618 # @return New GEOM.GEOM_Object, containing the found block.
11620 # @ref swig_todo "Example"
11621 @ManageTransactions("BlocksOp")
11622 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
11624 Find block, containing the given point inside its volume or on boundary.
11627 theCompound Compound, to find block in.
11628 thePoint Point, close to the desired block. If the point lays on
11629 boundary between some blocks, we return block with nearest center.
11630 theName Object name; when specified, this parameter is used
11631 for result publication in the study. Otherwise, if automatic
11632 publication is switched on, default value is used for result name.
11635 New GEOM.GEOM_Object, containing the found block.
11637 # Example: see GEOM_Spanner.py
11638 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
11639 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
11640 self._autoPublish(anObj, theName, "block")
11643 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11644 # @param theCompound Compound, to find block in.
11645 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
11646 # @param theName Object name; when specified, this parameter is used
11647 # for result publication in the study. Otherwise, if automatic
11648 # publication is switched on, default value is used for result name.
11650 # @return New GEOM.GEOM_Object, containing the found block.
11652 # @ref swig_GetBlockByParts "Example"
11653 @ManageTransactions("BlocksOp")
11654 def GetBlockByParts(self, theCompound, theParts, theName=None):
11656 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
11659 theCompound Compound, to find block in.
11660 theParts List of faces and/or edges and/or vertices to be parts of the found block.
11661 theName Object name; when specified, this parameter is used
11662 for result publication in the study. Otherwise, if automatic
11663 publication is switched on, default value is used for result name.
11666 New GEOM_Object, containing the found block.
11668 # Example: see GEOM_TestOthers.py
11669 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
11670 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
11671 self._autoPublish(anObj, theName, "block")
11674 ## Return all blocks, containing all the elements, passed as the parts.
11675 # @param theCompound Compound, to find blocks in.
11676 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11677 # @param theName Object name; when specified, this parameter is used
11678 # for result publication in the study. Otherwise, if automatic
11679 # publication is switched on, default value is used for result name.
11681 # @return List of GEOM.GEOM_Object, containing the found blocks.
11683 # @ref swig_todo "Example"
11684 @ManageTransactions("BlocksOp")
11685 def GetBlocksByParts(self, theCompound, theParts, theName=None):
11687 Return all blocks, containing all the elements, passed as the parts.
11690 theCompound Compound, to find blocks in.
11691 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
11692 theName Object name; when specified, this parameter is used
11693 for result publication in the study. Otherwise, if automatic
11694 publication is switched on, default value is used for result name.
11697 List of GEOM.GEOM_Object, containing the found blocks.
11699 # Example: see GEOM_Spanner.py
11700 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
11701 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
11702 self._autoPublish(aList, theName, "block")
11705 ## Multi-transformate block and glue the result.
11706 # Transformation is defined so, as to superpose direction faces.
11707 # @param Block Hexahedral solid to be multi-transformed.
11708 # @param DirFace1 ID of First direction face.
11709 # @param DirFace2 ID of Second direction face.
11710 # @param NbTimes Quantity of transformations to be done.
11711 # @param 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.
11715 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11717 # @return New GEOM.GEOM_Object, containing the result shape.
11719 # @ref tui_multi_transformation "Example"
11720 @ManageTransactions("BlocksOp")
11721 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
11723 Multi-transformate block and glue the result.
11724 Transformation is defined so, as to superpose direction faces.
11727 Block Hexahedral solid to be multi-transformed.
11728 DirFace1 ID of First direction face.
11729 DirFace2 ID of Second direction face.
11730 NbTimes Quantity of transformations to be done.
11731 theName Object name; when specified, this parameter is used
11732 for result publication in the study. Otherwise, if automatic
11733 publication is switched on, default value is used for result name.
11736 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
11739 New GEOM.GEOM_Object, containing the result shape.
11741 # Example: see GEOM_Spanner.py
11742 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
11743 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
11744 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
11745 anObj.SetParameters(Parameters)
11746 self._autoPublish(anObj, theName, "transformed")
11749 ## Multi-transformate block and glue the result.
11750 # @param Block Hexahedral solid to be multi-transformed.
11751 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11752 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11753 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
11754 # @param theName Object name; when specified, this parameter is used
11755 # for result publication in the study. Otherwise, if automatic
11756 # publication is switched on, default value is used for result name.
11758 # @return New GEOM.GEOM_Object, containing the result shape.
11760 # @ref tui_multi_transformation "Example"
11761 @ManageTransactions("BlocksOp")
11762 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
11763 DirFace1V, DirFace2V, NbTimesV, theName=None):
11765 Multi-transformate block and glue the result.
11768 Block Hexahedral solid to be multi-transformed.
11769 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
11770 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
11771 NbTimesU,NbTimesV Quantity of transformations to be done.
11772 theName Object name; when specified, this parameter is used
11773 for result publication in the study. Otherwise, if automatic
11774 publication is switched on, default value is used for result name.
11777 New GEOM.GEOM_Object, containing the result shape.
11779 # Example: see GEOM_Spanner.py
11780 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
11781 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
11782 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
11783 DirFace1V, DirFace2V, NbTimesV)
11784 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
11785 anObj.SetParameters(Parameters)
11786 self._autoPublish(anObj, theName, "transformed")
11789 ## Build all possible propagation groups.
11790 # Propagation group is a set of all edges, opposite to one (main)
11791 # edge of this group directly or through other opposite edges.
11792 # Notion of Opposite Edge make sence only on quadrangle face.
11793 # @param theShape Shape to build propagation groups on.
11794 # @param theName Object name; when specified, this parameter is used
11795 # for result publication in the study. Otherwise, if automatic
11796 # publication is switched on, default value is used for result name.
11798 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
11800 # @ref swig_Propagate "Example"
11801 @ManageTransactions("BlocksOp")
11802 def Propagate(self, theShape, theName=None):
11804 Build all possible propagation groups.
11805 Propagation group is a set of all edges, opposite to one (main)
11806 edge of this group directly or through other opposite edges.
11807 Notion of Opposite Edge make sence only on quadrangle face.
11810 theShape Shape to build propagation groups on.
11811 theName Object name; when specified, this parameter is used
11812 for result publication in the study. Otherwise, if automatic
11813 publication is switched on, default value is used for result name.
11816 List of GEOM.GEOM_Object, each of them is a propagation group.
11818 # Example: see GEOM_TestOthers.py
11819 listChains = self.BlocksOp.Propagate(theShape)
11820 RaiseIfFailed("Propagate", self.BlocksOp)
11821 self._autoPublish(listChains, theName, "propagate")
11824 # end of l3_blocks_op
11827 ## @addtogroup l3_groups
11830 ## Creates a new group which will store sub-shapes of theMainShape
11831 # @param theMainShape is a GEOM object on which the group is selected
11832 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
11833 # @param theName Object name; when specified, this parameter is used
11834 # for result publication in the study. Otherwise, if automatic
11835 # publication is switched on, default value is used for result name.
11837 # @return a newly created GEOM group (GEOM.GEOM_Object)
11839 # @ref tui_working_with_groups_page "Example 1"
11840 # \n @ref swig_CreateGroup "Example 2"
11841 @ManageTransactions("GroupOp")
11842 def CreateGroup(self, theMainShape, theShapeType, theName=None):
11844 Creates a new group which will store sub-shapes of theMainShape
11847 theMainShape is a GEOM object on which the group is selected
11848 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
11849 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
11850 theName Object name; when specified, this parameter is used
11851 for result publication in the study. Otherwise, if automatic
11852 publication is switched on, default value is used for result name.
11855 a newly created GEOM group
11858 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
11861 # Example: see GEOM_TestOthers.py
11862 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
11863 RaiseIfFailed("CreateGroup", self.GroupOp)
11864 self._autoPublish(anObj, theName, "group")
11867 ## Adds a sub-object with ID theSubShapeId to the group
11868 # @param theGroup is a GEOM group to which the new sub-shape is added
11869 # @param theSubShapeID is a sub-shape ID in the main object.
11870 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11872 # @ref tui_working_with_groups_page "Example"
11873 @ManageTransactions("GroupOp")
11874 def AddObject(self,theGroup, theSubShapeID):
11876 Adds a sub-object with ID theSubShapeId to the group
11879 theGroup is a GEOM group to which the new sub-shape is added
11880 theSubShapeID is a sub-shape ID in the main object.
11883 Use method GetSubShapeID() to get an unique ID of the sub-shape
11885 # Example: see GEOM_TestOthers.py
11886 self.GroupOp.AddObject(theGroup, theSubShapeID)
11887 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
11888 RaiseIfFailed("AddObject", self.GroupOp)
11892 ## Removes a sub-object with ID \a theSubShapeId from the group
11893 # @param theGroup is a GEOM group from which the new sub-shape is removed
11894 # @param theSubShapeID is a sub-shape ID in the main object.
11895 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
11897 # @ref tui_working_with_groups_page "Example"
11898 @ManageTransactions("GroupOp")
11899 def RemoveObject(self,theGroup, theSubShapeID):
11901 Removes a sub-object with ID theSubShapeId from the group
11904 theGroup is a GEOM group from which the new sub-shape is removed
11905 theSubShapeID is a sub-shape ID in the main object.
11908 Use method GetSubShapeID() to get an unique ID of the sub-shape
11910 # Example: see GEOM_TestOthers.py
11911 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
11912 RaiseIfFailed("RemoveObject", self.GroupOp)
11915 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11916 # @param theGroup is a GEOM group to which the new sub-shapes are added.
11917 # @param theSubShapes is a list of sub-shapes to be added.
11919 # @ref tui_working_with_groups_page "Example"
11920 @ManageTransactions("GroupOp")
11921 def UnionList (self,theGroup, theSubShapes):
11923 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
11926 theGroup is a GEOM group to which the new sub-shapes are added.
11927 theSubShapes is a list of sub-shapes to be added.
11929 # Example: see GEOM_TestOthers.py
11930 self.GroupOp.UnionList(theGroup, theSubShapes)
11931 RaiseIfFailed("UnionList", 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 indices of sub-shapes to be added.
11938 # @ref swig_UnionIDs "Example"
11939 @ManageTransactions("GroupOp")
11940 def UnionIDs(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 indices of sub-shapes to be added.
11948 # Example: see GEOM_TestOthers.py
11949 self.GroupOp.UnionIDs(theGroup, theSubShapes)
11950 RaiseIfFailed("UnionIDs", self.GroupOp)
11953 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11954 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11955 # @param theSubShapes is a list of sub-shapes to be removed.
11957 # @ref tui_working_with_groups_page "Example"
11958 @ManageTransactions("GroupOp")
11959 def DifferenceList (self,theGroup, theSubShapes):
11961 Removes from the group all the given shapes. No errors, if some shapes are not included.
11964 theGroup is a GEOM group from which the sub-shapes are removed.
11965 theSubShapes is a list of sub-shapes to be removed.
11967 # Example: see GEOM_TestOthers.py
11968 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11969 RaiseIfFailed("DifferenceList", 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 indices of sub-shapes to be removed.
11976 # @ref swig_DifferenceIDs "Example"
11977 @ManageTransactions("GroupOp")
11978 def DifferenceIDs(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 indices of sub-shapes to be removed.
11986 # Example: see GEOM_TestOthers.py
11987 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11988 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11991 ## Union of two groups.
11992 # New group is created. It will contain all entities
11993 # which are present in groups theGroup1 and theGroup2.
11994 # @param theGroup1, theGroup2 are the initial GEOM groups
11995 # to create the united group from.
11996 # @param theName Object name; when specified, this parameter is used
11997 # for result publication in the study. Otherwise, if automatic
11998 # publication is switched on, default value is used for result name.
12000 # @return a newly created GEOM group.
12002 # @ref tui_union_groups_anchor "Example"
12003 @ManageTransactions("GroupOp")
12004 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12006 Union of two groups.
12007 New group is created. It will contain all entities
12008 which are present in groups theGroup1 and theGroup2.
12011 theGroup1, theGroup2 are the initial GEOM groups
12012 to create the united group from.
12013 theName Object name; when specified, this parameter is used
12014 for result publication in the study. Otherwise, if automatic
12015 publication is switched on, default value is used for result name.
12018 a newly created GEOM group.
12020 # Example: see GEOM_TestOthers.py
12021 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12022 RaiseIfFailed("UnionGroups", self.GroupOp)
12023 self._autoPublish(aGroup, theName, "group")
12026 ## Intersection of two groups.
12027 # New group is created. It will contain only those entities
12028 # which are present in both groups theGroup1 and theGroup2.
12029 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12030 # @param theName Object name; when specified, this parameter is used
12031 # for result publication in the study. Otherwise, if automatic
12032 # publication is switched on, default value is used for result name.
12034 # @return a newly created GEOM group.
12036 # @ref tui_intersect_groups_anchor "Example"
12037 @ManageTransactions("GroupOp")
12038 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12040 Intersection of two groups.
12041 New group is created. It will contain only those entities
12042 which are present in both groups theGroup1 and theGroup2.
12045 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12046 theName Object name; when specified, this parameter is used
12047 for result publication in the study. Otherwise, if automatic
12048 publication is switched on, default value is used for result name.
12051 a newly created GEOM group.
12053 # Example: see GEOM_TestOthers.py
12054 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12055 RaiseIfFailed("IntersectGroups", self.GroupOp)
12056 self._autoPublish(aGroup, theName, "group")
12059 ## Cut of two groups.
12060 # New group is created. It will contain entities which are
12061 # present in group theGroup1 but are not present in group theGroup2.
12062 # @param theGroup1 is a GEOM group to include elements of.
12063 # @param theGroup2 is a GEOM group to exclude elements of.
12064 # @param theName Object name; when specified, this parameter is used
12065 # for result publication in the study. Otherwise, if automatic
12066 # publication is switched on, default value is used for result name.
12068 # @return a newly created GEOM group.
12070 # @ref tui_cut_groups_anchor "Example"
12071 @ManageTransactions("GroupOp")
12072 def CutGroups (self, theGroup1, theGroup2, theName=None):
12075 New group is created. It will contain entities which are
12076 present in group theGroup1 but are not present in group theGroup2.
12079 theGroup1 is a GEOM group to include elements of.
12080 theGroup2 is a GEOM group to exclude elements of.
12081 theName Object name; when specified, this parameter is used
12082 for result publication in the study. Otherwise, if automatic
12083 publication is switched on, default value is used for result name.
12086 a newly created GEOM group.
12088 # Example: see GEOM_TestOthers.py
12089 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12090 RaiseIfFailed("CutGroups", self.GroupOp)
12091 self._autoPublish(aGroup, theName, "group")
12094 ## Union of list of groups.
12095 # New group is created. It will contain all entities that are
12096 # present in groups listed in theGList.
12097 # @param theGList is a list of GEOM groups to create the united group from.
12098 # @param theName Object name; when specified, this parameter is used
12099 # for result publication in the study. Otherwise, if automatic
12100 # publication is switched on, default value is used for result name.
12102 # @return a newly created GEOM group.
12104 # @ref tui_union_groups_anchor "Example"
12105 @ManageTransactions("GroupOp")
12106 def UnionListOfGroups (self, theGList, theName=None):
12108 Union of list of groups.
12109 New group is created. It will contain all entities that are
12110 present in groups listed in theGList.
12113 theGList is a list of GEOM groups to create the united group from.
12114 theName Object name; when specified, this parameter is used
12115 for result publication in the study. Otherwise, if automatic
12116 publication is switched on, default value is used for result name.
12119 a newly created GEOM group.
12121 # Example: see GEOM_TestOthers.py
12122 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12123 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12124 self._autoPublish(aGroup, theName, "group")
12127 ## Cut of lists of groups.
12128 # New group is created. It will contain only entities
12129 # which are present in groups listed in theGList.
12130 # @param theGList is a list of GEOM groups to include elements of.
12131 # @param theName Object name; when specified, this parameter is used
12132 # for result publication in the study. Otherwise, if automatic
12133 # publication is switched on, default value is used for result name.
12135 # @return a newly created GEOM group.
12137 # @ref tui_intersect_groups_anchor "Example"
12138 @ManageTransactions("GroupOp")
12139 def IntersectListOfGroups (self, theGList, theName=None):
12141 Cut of lists of groups.
12142 New group is created. It will contain only entities
12143 which are present in groups listed in theGList.
12146 theGList is a list of GEOM groups to include elements of.
12147 theName Object name; when specified, this parameter is used
12148 for result publication in the study. Otherwise, if automatic
12149 publication is switched on, default value is used for result name.
12152 a newly created GEOM group.
12154 # Example: see GEOM_TestOthers.py
12155 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12156 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12157 self._autoPublish(aGroup, theName, "group")
12160 ## Cut of lists of groups.
12161 # New group is created. It will contain only entities
12162 # which are present in groups listed in theGList1 but
12163 # are not present in groups from theGList2.
12164 # @param theGList1 is a list of GEOM groups to include elements of.
12165 # @param theGList2 is a list of GEOM groups to exclude elements of.
12166 # @param 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.
12170 # @return a newly created GEOM group.
12172 # @ref tui_cut_groups_anchor "Example"
12173 @ManageTransactions("GroupOp")
12174 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12176 Cut of lists of groups.
12177 New group is created. It will contain only entities
12178 which are present in groups listed in theGList1 but
12179 are not present in groups from theGList2.
12182 theGList1 is a list of GEOM groups to include elements of.
12183 theGList2 is a list of GEOM groups to exclude elements of.
12184 theName Object name; when specified, this parameter is used
12185 for result publication in the study. Otherwise, if automatic
12186 publication is switched on, default value is used for result name.
12189 a newly created GEOM group.
12191 # Example: see GEOM_TestOthers.py
12192 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12193 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12194 self._autoPublish(aGroup, theName, "group")
12197 ## Returns a list of sub-objects ID stored in the group
12198 # @param theGroup is a GEOM group for which a list of IDs is requested
12200 # @ref swig_GetObjectIDs "Example"
12201 @ManageTransactions("GroupOp")
12202 def GetObjectIDs(self,theGroup):
12204 Returns a list of sub-objects ID stored in the group
12207 theGroup is a GEOM group for which a list of IDs is requested
12209 # Example: see GEOM_TestOthers.py
12210 ListIDs = self.GroupOp.GetObjects(theGroup)
12211 RaiseIfFailed("GetObjects", self.GroupOp)
12214 ## Returns a type of sub-objects stored in the group
12215 # @param theGroup is a GEOM group which type is returned.
12217 # @ref swig_GetType "Example"
12218 @ManageTransactions("GroupOp")
12219 def GetType(self,theGroup):
12221 Returns a type of sub-objects stored in the group
12224 theGroup is a GEOM group which type is returned.
12226 # Example: see GEOM_TestOthers.py
12227 aType = self.GroupOp.GetType(theGroup)
12228 RaiseIfFailed("GetType", self.GroupOp)
12231 ## Convert a type of geom object from id to string value
12232 # @param theId is a GEOM obect type id.
12233 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12234 # @ref swig_GetType "Example"
12235 def ShapeIdToType(self, theId):
12237 Convert a type of geom object from id to string value
12240 theId is a GEOM obect type id.
12243 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12270 return "REVOLUTION"
12318 return "FREE_BOUNDS"
12326 return "THRUSECTIONS"
12328 return "COMPOUNDFILTER"
12330 return "SHAPES_ON_SHAPE"
12332 return "ELLIPSE_ARC"
12334 return "3DSKETCHER"
12340 return "PIPETSHAPE"
12341 return "Shape Id not exist."
12343 ## Returns a main shape associated with the group
12344 # @param theGroup is a GEOM group for which a main shape object is requested
12345 # @return a GEOM object which is a main shape for theGroup
12347 # @ref swig_GetMainShape "Example"
12348 @ManageTransactions("GroupOp")
12349 def GetMainShape(self,theGroup):
12351 Returns a main shape associated with the group
12354 theGroup is a GEOM group for which a main shape object is requested
12357 a GEOM object which is a main shape for theGroup
12359 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12361 # Example: see GEOM_TestOthers.py
12362 anObj = self.GroupOp.GetMainShape(theGroup)
12363 RaiseIfFailed("GetMainShape", self.GroupOp)
12366 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12367 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12368 # @param theShape given shape (see GEOM.GEOM_Object)
12369 # @param min_length minimum length of edges of theShape
12370 # @param max_length maximum length of edges of theShape
12371 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12372 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12373 # @param theName Object name; when specified, this parameter is used
12374 # for result publication in the study. Otherwise, if automatic
12375 # publication is switched on, default value is used for result name.
12377 # @return a newly created GEOM group of edges
12379 # @@ref swig_todo "Example"
12380 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12382 Create group of edges of theShape, whose length is in range [min_length, max_length].
12383 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12386 theShape given shape
12387 min_length minimum length of edges of theShape
12388 max_length maximum length of edges of theShape
12389 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12390 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12391 theName Object name; when specified, this parameter is used
12392 for result publication in the study. Otherwise, if automatic
12393 publication is switched on, default value is used for result name.
12396 a newly created GEOM group of edges.
12398 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12399 edges_in_range = []
12401 Props = self.BasicProperties(edge)
12402 if min_length <= Props[0] and Props[0] <= max_length:
12403 if (not include_min) and (min_length == Props[0]):
12406 if (not include_max) and (Props[0] == max_length):
12409 edges_in_range.append(edge)
12411 if len(edges_in_range) <= 0:
12412 print "No edges found by given criteria"
12415 # note: auto-publishing is done in self.CreateGroup()
12416 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12417 self.UnionList(group_edges, edges_in_range)
12421 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12422 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12423 # @param min_length minimum length of edges of selected shape
12424 # @param max_length maximum length of edges of selected shape
12425 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12426 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12427 # @return a newly created GEOM group of edges
12428 # @ref swig_todo "Example"
12429 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12431 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12432 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12435 min_length minimum length of edges of selected shape
12436 max_length maximum length of edges of selected shape
12437 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12438 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12441 a newly created GEOM group of edges.
12443 nb_selected = sg.SelectedCount()
12444 if nb_selected < 1:
12445 print "Select a shape before calling this function, please."
12447 if nb_selected > 1:
12448 print "Only one shape must be selected"
12451 id_shape = sg.getSelected(0)
12452 shape = IDToObject( id_shape )
12454 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12458 if include_min: left_str = " <= "
12459 if include_max: right_str = " <= "
12461 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12462 + left_str + "length" + right_str + `max_length`)
12464 sg.updateObjBrowser(1)
12471 #@@ insert new functions before this line @@ do not remove this line @@#
12473 ## Create a copy of the given object
12475 # @param theOriginal geometry object for copy
12476 # @param theName Object name; when specified, this parameter is used
12477 # for result publication in the study. Otherwise, if automatic
12478 # publication is switched on, default value is used for result name.
12480 # @return New GEOM_Object, containing the copied shape.
12482 # @ingroup l1_geomBuilder_auxiliary
12483 # @ref swig_MakeCopy "Example"
12484 @ManageTransactions("InsertOp")
12485 def MakeCopy(self, theOriginal, theName=None):
12487 Create a copy of the given object
12490 theOriginal geometry object for copy
12491 theName Object name; when specified, this parameter is used
12492 for result publication in the study. Otherwise, if automatic
12493 publication is switched on, default value is used for result name.
12496 New GEOM_Object, containing the copied shape.
12498 Example of usage: Copy = geompy.MakeCopy(Box)
12500 # Example: see GEOM_TestAll.py
12501 anObj = self.InsertOp.MakeCopy(theOriginal)
12502 RaiseIfFailed("MakeCopy", self.InsertOp)
12503 self._autoPublish(anObj, theName, "copy")
12506 ## Add Path to load python scripts from
12507 # @param Path a path to load python scripts from
12508 # @ingroup l1_geomBuilder_auxiliary
12509 def addPath(self,Path):
12511 Add Path to load python scripts from
12514 Path a path to load python scripts from
12516 if (sys.path.count(Path) < 1):
12517 sys.path.append(Path)
12521 ## Load marker texture from the file
12522 # @param Path a path to the texture file
12523 # @return unique texture identifier
12524 # @ingroup l1_geomBuilder_auxiliary
12525 @ManageTransactions("InsertOp")
12526 def LoadTexture(self, Path):
12528 Load marker texture from the file
12531 Path a path to the texture file
12534 unique texture identifier
12536 # Example: see GEOM_TestAll.py
12537 ID = self.InsertOp.LoadTexture(Path)
12538 RaiseIfFailed("LoadTexture", self.InsertOp)
12541 ## Get internal name of the object based on its study entry
12542 # @note This method does not provide an unique identifier of the geometry object.
12543 # @note This is internal function of GEOM component, though it can be used outside it for
12544 # appropriate reason (e.g. for identification of geometry object).
12545 # @param obj geometry object
12546 # @return unique object identifier
12547 # @ingroup l1_geomBuilder_auxiliary
12548 def getObjectID(self, obj):
12550 Get internal name of the object based on its study entry.
12551 Note: this method does not provide an unique identifier of the geometry object.
12552 It is an internal function of GEOM component, though it can be used outside GEOM for
12553 appropriate reason (e.g. for identification of geometry object).
12556 obj geometry object
12559 unique object identifier
12562 entry = salome.ObjectToID(obj)
12563 if entry is not None:
12564 lst = entry.split(":")
12566 ID = lst[-1] # -1 means last item in the list
12567 return "GEOM_" + ID
12572 ## Add marker texture. @a Width and @a Height parameters
12573 # specify width and height of the texture in pixels.
12574 # If @a RowData is @c True, @a Texture parameter should represent texture data
12575 # packed into the byte array. If @a RowData is @c False (default), @a Texture
12576 # parameter should be unpacked string, in which '1' symbols represent opaque
12577 # pixels and '0' represent transparent pixels of the texture bitmap.
12579 # @param Width texture width in pixels
12580 # @param Height texture height in pixels
12581 # @param Texture texture data
12582 # @param RowData if @c True, @a Texture data are packed in the byte stream
12583 # @return unique texture identifier
12584 # @ingroup l1_geomBuilder_auxiliary
12585 @ManageTransactions("InsertOp")
12586 def AddTexture(self, Width, Height, Texture, RowData=False):
12588 Add marker texture. Width and Height parameters
12589 specify width and height of the texture in pixels.
12590 If RowData is True, Texture parameter should represent texture data
12591 packed into the byte array. If RowData is False (default), Texture
12592 parameter should be unpacked string, in which '1' symbols represent opaque
12593 pixels and '0' represent transparent pixels of the texture bitmap.
12596 Width texture width in pixels
12597 Height texture height in pixels
12598 Texture texture data
12599 RowData if True, Texture data are packed in the byte stream
12602 return unique texture identifier
12604 if not RowData: Texture = PackData(Texture)
12605 ID = self.InsertOp.AddTexture(Width, Height, Texture)
12606 RaiseIfFailed("AddTexture", self.InsertOp)
12609 ## Creates a new folder object. It is a container for any GEOM objects.
12610 # @param Name name of the container
12611 # @param Father parent object. If None,
12612 # folder under 'Geometry' root object will be created.
12613 # @return a new created folder
12614 # @ingroup l1_publish_data
12615 def NewFolder(self, Name, Father=None):
12617 Create a new folder object. It is an auxiliary container for any GEOM objects.
12620 Name name of the container
12621 Father parent object. If None,
12622 folder under 'Geometry' root object will be created.
12625 a new created folder
12627 if not Father: Father = self.father
12628 return self.CreateFolder(Name, Father)
12630 ## Move object to the specified folder
12631 # @param Object object to move
12632 # @param Folder target folder
12633 # @ingroup l1_publish_data
12634 def PutToFolder(self, Object, Folder):
12636 Move object to the specified folder
12639 Object object to move
12640 Folder target folder
12642 self.MoveToFolder(Object, Folder)
12645 ## Move list of objects to the specified folder
12646 # @param ListOfSO list of objects to move
12647 # @param Folder target folder
12648 # @ingroup l1_publish_data
12649 def PutListToFolder(self, ListOfSO, Folder):
12651 Move list of objects to the specified folder
12654 ListOfSO list of objects to move
12655 Folder target folder
12657 self.MoveListToFolder(ListOfSO, Folder)
12660 ## @addtogroup l2_field
12664 # @param shape the shape the field lies on
12665 # @param name the field name
12666 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
12667 # @param dimension dimension of the shape the field lies on
12668 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12669 # @param componentNames names of components
12670 # @return a created field
12671 @ManageTransactions("FieldOp")
12672 def CreateField(self, shape, name, type, dimension, componentNames):
12677 shape the shape the field lies on
12678 name the field name
12679 type type of field data
12680 dimension dimension of the shape the field lies on
12681 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12682 componentNames names of components
12687 if isinstance( type, int ):
12688 if type < 0 or type > 3:
12689 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
12690 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
12692 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
12693 RaiseIfFailed("CreateField", self.FieldOp)
12695 geom._autoPublish( f, "", name)
12698 ## Removes a field from the GEOM component
12699 # @param field the field to remove
12700 def RemoveField(self, field):
12701 "Removes a field from the GEOM component"
12703 if isinstance( field, GEOM._objref_GEOM_Field ):
12704 geom.RemoveObject( field )
12705 elif isinstance( field, geomField ):
12706 geom.RemoveObject( field.field )
12708 raise RuntimeError, "RemoveField() : the object is not a field"
12711 ## Returns number of fields on a shape
12712 @ManageTransactions("FieldOp")
12713 def CountFields(self, shape):
12714 "Returns number of fields on a shape"
12715 nb = self.FieldOp.CountFields( shape )
12716 RaiseIfFailed("CountFields", self.FieldOp)
12719 ## Returns all fields on a shape
12720 @ManageTransactions("FieldOp")
12721 def GetFields(self, shape):
12722 "Returns all fields on a shape"
12723 ff = self.FieldOp.GetFields( shape )
12724 RaiseIfFailed("GetFields", self.FieldOp)
12727 ## Returns a field on a shape by its name
12728 @ManageTransactions("FieldOp")
12729 def GetField(self, shape, name):
12730 "Returns a field on a shape by its name"
12731 f = self.FieldOp.GetField( shape, name )
12732 RaiseIfFailed("GetField", self.FieldOp)
12740 # Register the new proxy for GEOM_Gen
12741 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
12744 ## Field on Geometry
12745 # @ingroup l2_field
12746 class geomField( GEOM._objref_GEOM_Field ):
12748 def __init__(self):
12749 GEOM._objref_GEOM_Field.__init__(self)
12750 self.field = GEOM._objref_GEOM_Field
12753 ## Returns the shape the field lies on
12754 def getShape(self):
12755 "Returns the shape the field lies on"
12756 return self.field.GetShape(self)
12758 ## Returns the field name
12760 "Returns the field name"
12761 return self.field.GetName(self)
12763 ## Returns type of field data as integer [0-3]
12765 "Returns type of field data"
12766 return self.field.GetDataType(self)._v
12768 ## Returns type of field data:
12769 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
12770 def getTypeEnum(self):
12771 "Returns type of field data"
12772 return self.field.GetDataType(self)
12774 ## Returns dimension of the shape the field lies on:
12775 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
12776 def getDimension(self):
12777 """Returns dimension of the shape the field lies on:
12778 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
12779 return self.field.GetDimension(self)
12781 ## Returns names of components
12782 def getComponents(self):
12783 "Returns names of components"
12784 return self.field.GetComponents(self)
12786 ## Adds a time step to the field
12787 # @param step the time step number further used as the step identifier
12788 # @param stamp the time step time
12789 # @param values the values of the time step
12790 def addStep(self, step, stamp, values):
12791 "Adds a time step to the field"
12792 stp = self.field.AddStep( self, step, stamp )
12794 raise RuntimeError, \
12795 "Field.addStep() : Error: step %s already exists in this field"%step
12797 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
12798 self.setValues( step, values )
12801 ## Remove a time step from the field
12802 def removeStep(self,step):
12803 "Remove a time step from the field"
12806 stepObj = self.field.GetStep( self, step )
12808 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
12811 #traceback.print_exc()
12813 self.field.RemoveStep( self, step )
12815 geom.myBuilder.RemoveObjectWithChildren( stepSO )
12818 ## Returns number of time steps in the field
12819 def countSteps(self):
12820 "Returns number of time steps in the field"
12821 return self.field.CountSteps(self)
12823 ## Returns a list of time step IDs in the field
12824 def getSteps(self):
12825 "Returns a list of time step IDs in the field"
12826 return self.field.GetSteps(self)
12828 ## Returns a time step by its ID
12829 def getStep(self,step):
12830 "Returns a time step by its ID"
12831 stp = self.field.GetStep(self, step)
12833 raise RuntimeError, "Step %s is missing from this field"%step
12836 ## Returns the time of the field step
12837 def getStamp(self,step):
12838 "Returns the time of the field step"
12839 return self.getStep(step).GetStamp()
12841 ## Changes the time of the field step
12842 def setStamp(self, step, stamp):
12843 "Changes the time of the field step"
12844 return self.getStep(step).SetStamp(stamp)
12846 ## Returns values of the field step
12847 def getValues(self, step):
12848 "Returns values of the field step"
12849 return self.getStep(step).GetValues()
12851 ## Changes values of the field step
12852 def setValues(self, step, values):
12853 "Changes values of the field step"
12854 stp = self.getStep(step)
12855 errBeg = "Field.setValues(values) : Error: "
12857 ok = stp.SetValues( values )
12858 except Exception, e:
12860 if excStr.find("WrongPythonType") > 0:
12861 raise RuntimeError, errBeg +\
12862 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
12863 raise RuntimeError, errBeg + str(e)
12865 nbOK = self.field.GetArraySize(self)
12868 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
12870 raise RuntimeError, errBeg + "failed"
12873 pass # end of class geomField
12875 # Register the new proxy for GEOM_Field
12876 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
12879 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
12880 # interface to GEOM operations.
12885 # salome.salome_init()
12886 # from salome.geom import geomBuilder
12887 # geompy = geomBuilder.New(salome.myStudy)
12889 # @param study SALOME study, generally obtained by salome.myStudy.
12890 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12891 # @return geomBuilder instance
12892 def New( study, instance=None):
12894 Create a new geomBuilder instance.The geomBuilder class provides the Python
12895 interface to GEOM operations.
12899 salome.salome_init()
12900 from salome.geom import geomBuilder
12901 geompy = geomBuilder.New(salome.myStudy)
12904 study SALOME study, generally obtained by salome.myStudy.
12905 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
12907 geomBuilder instance
12909 #print "New geomBuilder ", study, instance
12916 geom = geomBuilder()
12917 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
12918 geom.init_geom(study)
12922 # Register methods from the plug-ins in the geomBuilder class
12923 plugins_var = os.environ.get( "GEOM_PluginsList" )
12926 if plugins_var is not None:
12927 plugins = plugins_var.split( ":" )
12928 plugins=filter(lambda x: len(x)>0, plugins)
12929 if plugins is not None:
12930 for pluginName in plugins:
12931 pluginBuilderName = pluginName + "Builder"
12933 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
12934 except Exception, e:
12935 from salome_utils import verbose
12936 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
12938 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
12939 plugin = eval( pluginBuilderName )
12941 # add methods from plugin module to the geomBuilder class
12942 for k in dir( plugin ):
12943 if k[0] == '_': continue
12944 method = getattr( plugin, k )
12945 if type( method ).__name__ == 'function':
12946 if not hasattr( geomBuilder, k ):
12947 setattr( geomBuilder, k, method )