1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New(salome.myStudy)
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New(salome.myStudy)
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New(salome.myStudy)
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
243 # initialize SALOME session in try/except block
244 # to avoid problems in some cases, e.g. when generating documentation
252 from salome_notebook import *
259 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
262 def _toListOfNames(_names, _size=-1):
265 if type(_names) in [types.ListType, types.TupleType]:
266 for i in _names: l.append(i)
269 if l and len(l) < _size:
270 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
273 # Decorator function to manage transactions for all geometric operations.
274 def ManageTransactions(theOpeName):
275 def MTDecorator(theFunction):
276 # To keep the original function name an documentation.
277 @functools.wraps(theFunction)
278 def OpenCallClose(self, *args, **kwargs):
280 anOperation = getattr(self, theOpeName)
281 anOperation.StartOperation()
284 res = theFunction(self, *args, **kwargs)
286 anOperation.FinishOperation()
290 anOperation.AbortOperation()
295 ## Raise an Error, containing the Method_name, if Operation is Failed
296 ## @ingroup l1_geomBuilder_auxiliary
297 def RaiseIfFailed (Method_name, Operation):
298 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
299 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
301 ## Return list of variables value from salome notebook
302 ## @ingroup l1_geomBuilder_auxiliary
303 def ParseParameters(*parameters):
306 for parameter in parameters:
307 if isinstance(parameter, list):
308 lResults = ParseParameters(*parameter)
309 if len(lResults) > 0:
310 Result.append(lResults[:-1])
311 StringResult += lResults[-1].split(":")
315 if isinstance(parameter,str):
316 if notebook.isVariable(parameter):
317 Result.append(notebook.get(parameter))
319 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
322 Result.append(parameter)
324 StringResult.append(str(parameter))
328 Result.append(":".join(StringResult))
330 Result = ":".join(StringResult)
333 ## Return list of variables value from salome notebook
334 ## @ingroup l1_geomBuilder_auxiliary
338 for parameter in list:
339 if isinstance(parameter,str) and notebook.isVariable(parameter):
340 Result.append(str(notebook.get(parameter)))
343 Result.append(str(parameter))
346 StringResult = StringResult + str(parameter)
347 StringResult = StringResult + ":"
349 StringResult = StringResult[:len(StringResult)-1]
350 return Result, StringResult
352 ## Return list of variables value from salome notebook
353 ## @ingroup l1_geomBuilder_auxiliary
354 def ParseSketcherCommand(command):
357 sections = command.split(":")
358 for section in sections:
359 parameters = section.split(" ")
361 for parameter in parameters:
362 if paramIndex > 1 and parameter.find("'") != -1:
363 parameter = parameter.replace("'","")
364 if notebook.isVariable(parameter):
365 Result = Result + str(notebook.get(parameter)) + " "
368 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
372 Result = Result + str(parameter) + " "
375 StringResult = StringResult + parameter
376 StringResult = StringResult + ":"
378 paramIndex = paramIndex + 1
380 Result = Result[:len(Result)-1] + ":"
382 Result = Result[:len(Result)-1]
383 return Result, StringResult
385 ## Helper function which can be used to pack the passed string to the byte data.
386 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
387 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
390 ## val = PackData("10001110") # val = 0xAE
391 ## val = PackData("1") # val = 0x80
393 ## @param data unpacked data - a string containing '1' and '0' symbols
394 ## @return data packed to the byte stream
395 ## @ingroup l1_geomBuilder_auxiliary
398 Helper function which can be used to pack the passed string to the byte data.
399 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
400 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
403 data unpacked data - a string containing '1' and '0' symbols
406 data packed to the byte stream
409 val = PackData("10001110") # val = 0xAE
410 val = PackData("1") # val = 0x80
413 if len(data)%8: bytes += 1
415 for b in range(bytes):
416 d = data[b*8:(b+1)*8]
421 if d[i] == "1": val += 1
423 raise "Invalid symbol %s" % d[i]
430 ## Read bitmap texture from the text file.
431 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
432 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
433 ## The function returns width and height of the pixmap in pixels and byte stream representing
434 ## texture bitmap itself.
436 ## This function can be used to read the texture to the byte stream in order to pass it to
437 ## the AddTexture() function of geomBuilder class.
440 ## from salome.geom import geomBuilder
441 ## geompy = geomBuilder.New(salome.myStudy)
442 ## texture = geompy.readtexture('mytexture.dat')
443 ## texture = geompy.AddTexture(*texture)
444 ## obj.SetMarkerTexture(texture)
446 ## @param fname texture file name
447 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
448 ## @ingroup l1_geomBuilder_auxiliary
449 def ReadTexture(fname):
451 Read bitmap texture from the text file.
452 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
453 A zero symbol ('0') represents transparent pixel of the texture bitmap.
454 The function returns width and height of the pixmap in pixels and byte stream representing
455 texture bitmap itself.
456 This function can be used to read the texture to the byte stream in order to pass it to
457 the AddTexture() function of geomBuilder class.
460 fname texture file name
463 sequence of tree values: texture's width, height in pixels and its byte stream
466 from salome.geom import geomBuilder
467 geompy = geomBuilder.New(salome.myStudy)
468 texture = geompy.readtexture('mytexture.dat')
469 texture = geompy.AddTexture(*texture)
470 obj.SetMarkerTexture(texture)
474 lines = [ l.strip() for l in f.readlines()]
477 if lines: maxlen = max([len(x) for x in lines])
479 if maxlen%8: lenbytes += 1
483 lenline = (len(line)/8+1)*8
486 lenline = (len(line)/8)*8
488 for i in range(lenline/8):
491 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
494 bytedata += PackData(byte)
496 for i in range(lenline/8, lenbytes):
497 bytedata += PackData("0")
499 return lenbytes*8, len(lines), bytedata
504 ## Returns a long value from enumeration type
505 # Can be used for CORBA enumerator types like GEOM.shape_type
506 # @param theItem enumeration type
507 # @ingroup l1_geomBuilder_auxiliary
508 def EnumToLong(theItem):
510 Returns a long value from enumeration type
511 Can be used for CORBA enumerator types like geomBuilder.ShapeType
514 theItem enumeration type
517 if hasattr(theItem, "_v"): ret = theItem._v
520 ## Pack an argument into a list
522 if isinstance( arg, list ):
524 if hasattr( arg, "__getitem__" ):
528 ## Information about closed/unclosed state of shell or wire
529 # @ingroup l1_geomBuilder_auxiliary
532 Information about closed/unclosed state of shell or wire
538 ## Private class used to bind calls of plugin operations to geomBuilder
539 class PluginOperation:
540 def __init__(self, operation, function):
541 self.operation = operation
542 self.function = function
545 @ManageTransactions("operation")
546 def __call__(self, *args):
547 res = self.function(self.operation, *args)
548 RaiseIfFailed(self.function.__name__, self.operation)
551 # Warning: geom is a singleton
557 class geomBuilder(object, GEOM._objref_GEOM_Gen):
559 ## Enumeration ShapeType as a dictionary. \n
560 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
561 # @ingroup l1_geomBuilder_auxiliary
562 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
564 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
565 # and a list of parameters, describing the shape.
566 # List of parameters, describing the shape:
567 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
568 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
570 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
572 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
574 # - SPHERE: [xc yc zc R]
575 # - CYLINDER: [xb yb zb dx dy dz R H]
576 # - BOX: [xc yc zc ax ay az]
577 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
578 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
579 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
580 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
581 # - SOLID: [nb_faces nb_edges nb_vertices]
583 # - SPHERE2D: [xc yc zc R]
584 # - CYLINDER2D: [xb yb zb dx dy dz R H]
585 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
586 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
587 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
588 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
589 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
590 # - PLANE: [xo yo zo dx dy dz]
591 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
592 # - FACE: [nb_edges nb_vertices]
594 # - CIRCLE: [xc yc zc dx dy dz R]
595 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
596 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
597 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
598 # - LINE: [xo yo zo dx dy dz]
599 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
600 # - EDGE: [nb_vertices]
603 # @ingroup l1_geomBuilder_auxiliary
604 kind = GEOM.GEOM_IKindOfShape
611 #print "==== __new__ ", engine, geom, doLcc, created
613 # geom engine is either retrieved from engine, or created
615 # Following test avoids a recursive loop
618 # geom engine not created: existing engine found
620 if doLcc and not created:
622 # FindOrLoadComponent called:
623 # 1. CORBA resolution of server
624 # 2. the __new__ method is called again
625 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
626 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
629 # FindOrLoadComponent not called
631 # geomBuilder instance is created from lcc.FindOrLoadComponent
632 #print "==== super ", engine, geom, doLcc, created
633 geom = super(geomBuilder,cls).__new__(cls)
636 # geom engine not created: existing engine found
637 #print "==== existing ", engine, geom, doLcc, created
639 #print "return geom 1 ", geom
642 #print "return geom 2 ", geom
647 #print "-------- geomBuilder __init__ --- ", created, self
650 GEOM._objref_GEOM_Gen.__init__(self)
651 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
652 self.myBuilder = None
671 ## Process object publication in the study, as follows:
672 # - if @a theName is specified (not None), the object is published in the study
673 # with this name, not taking into account "auto-publishing" option;
674 # - if @a theName is NOT specified, the object is published in the study
675 # (using default name, which can be customized using @a theDefaultName parameter)
676 # only if auto-publishing is switched on.
678 # @param theObj object, a subject for publishing
679 # @param theName object name for study
680 # @param theDefaultName default name for the auto-publishing
682 # @sa addToStudyAuto()
683 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
685 def _item_name(_names, _defname, _idx=-1):
686 if not _names: _names = _defname
687 if type(_names) in [types.ListType, types.TupleType]:
689 if _idx >= len(_names) or not _names[_idx]:
690 if type(_defname) not in [types.ListType, types.TupleType]:
691 _name = "%s_%d"%(_defname, _idx+1)
692 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
693 _name = _defname[_idx]
695 _name = "%noname_%d"%(dn, _idx+1)
701 # must be wrong usage
706 _name = "%s_%d"%(_names, _idx+1)
712 def _publish( _name, _obj ):
714 if isinstance( _obj, GEOM._objref_GEOM_Field ):
715 fatherObj = _obj.GetShape()
716 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
717 fatherObj = _obj.GetField()
718 elif not _obj.IsMainShape():
719 fatherObj = _obj.GetMainShape()
721 if fatherObj and fatherObj.GetStudyEntry():
722 self.addToStudyInFather(fatherObj, _obj, _name)
724 self.addToStudy(_obj, _name)
730 if not theName and not self.myMaxNbSubShapesAllowed:
731 return # nothing to do: auto-publishing is disabled
732 if not theName and not theDefaultName:
733 return # neither theName nor theDefaultName is given
735 if type(theObj) in [types.ListType, types.TupleType]:
736 # list of objects is being published
739 if not obj: continue # bad object
740 name = _item_name(theName, theDefaultName, idx)
741 _publish( name, obj )
743 if not theName and idx == self.myMaxNbSubShapesAllowed: break
747 # single object is published
748 name = _item_name(theName, theDefaultName)
749 _publish( name, theObj )
752 ## @addtogroup l1_geomBuilder_auxiliary
754 def init_geom(self,theStudy):
755 self.myStudy = theStudy
756 self.myStudyId = self.myStudy._get_StudyId()
757 self.myBuilder = self.myStudy.NewBuilder()
758 self.father = self.myStudy.FindComponent("GEOM")
759 notebook.myStudy = theStudy
760 if self.father is None:
761 self.father = self.myBuilder.NewComponent("GEOM")
762 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
763 FName = A1._narrow(SALOMEDS.AttributeName)
764 FName.SetValue("Geometry")
765 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
766 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
767 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
768 self.myBuilder.DefineComponentInstance(self.father,self)
770 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
771 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
772 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
773 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
774 self.HealOp = self.GetIHealingOperations (self.myStudyId)
775 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
776 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
777 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
778 self.LocalOp = self.GetILocalOperations (self.myStudyId)
779 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
780 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
781 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
782 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
784 # set GEOM as root in the use case tree
785 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
786 self.myUseCaseBuilder.SetRootCurrent()
787 self.myUseCaseBuilder.Append(self.father)
789 # load data from the study file, if necessary
790 self.myBuilder.LoadWith(self.father, self)
793 def GetPluginOperations(self, studyID, libraryName):
794 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
797 ## Enable / disable results auto-publishing
799 # The automatic publishing is managed in the following way:
800 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
801 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
802 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
803 # value passed as parameter has the same effect.
804 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
805 # maximum number of sub-shapes allowed for publishing is set to specified value.
807 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
808 # @ingroup l1_publish_data
809 def addToStudyAuto(self, maxNbSubShapes=-1):
811 Enable / disable results auto-publishing
813 The automatic publishing is managed in the following way:
814 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
815 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
816 maximum number of sub-shapes allowed for publishing is unlimited; any negative
817 value passed as parameter has the same effect.
818 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
819 maximum number of sub-shapes allowed for publishing is set to this value.
822 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
825 geompy.addToStudyAuto() # enable auto-publishing
826 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
827 geompy.addToStudyAuto(0) # disable auto-publishing
829 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
832 ## Dump component to the Python script
833 # This method overrides IDL function to allow default values for the parameters.
834 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
836 Dump component to the Python script
837 This method overrides IDL function to allow default values for the parameters.
839 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
841 ## Get name for sub-shape aSubObj of shape aMainObj
843 # @ref swig_SubShapeName "Example"
844 @ManageTransactions("ShapesOp")
845 def SubShapeName(self,aSubObj, aMainObj):
847 Get name for sub-shape aSubObj of shape aMainObj
849 # Example: see GEOM_TestAll.py
851 #aSubId = orb.object_to_string(aSubObj)
852 #aMainId = orb.object_to_string(aMainObj)
853 #index = gg.getIndexTopology(aSubId, aMainId)
854 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
855 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
856 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
859 ## Publish in study aShape with name aName
861 # \param aShape the shape to be published
862 # \param aName the name for the shape
863 # \param doRestoreSubShapes if True, finds and publishes also
864 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
865 # and published sub-shapes of arguments
866 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
867 # these arguments description
868 # \return study entry of the published shape in form of string
870 # @ingroup l1_publish_data
871 # @ref swig_all_addtostudy "Example"
872 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
873 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
875 Publish in study aShape with name aName
878 aShape the shape to be published
879 aName the name for the shape
880 doRestoreSubShapes if True, finds and publishes also
881 sub-shapes of aShape, corresponding to its arguments
882 and published sub-shapes of arguments
883 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
884 these arguments description
887 study entry of the published shape in form of string
890 id_block1 = geompy.addToStudy(Block1, "Block 1")
892 # Example: see GEOM_TestAll.py
894 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
895 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
896 if doRestoreSubShapes:
897 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
898 theFindMethod, theInheritFirstArg, True )
900 print "addToStudy() failed"
902 return aShape.GetStudyEntry()
904 ## Publish in study aShape with name aName as sub-object of previously published aFather
905 # \param aFather previously published object
906 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
907 # \param aName the name for the shape
909 # \return study entry of the published shape in form of string
911 # @ingroup l1_publish_data
912 # @ref swig_all_addtostudyInFather "Example"
913 def addToStudyInFather(self, aFather, aShape, aName):
915 Publish in study aShape with name aName as sub-object of previously published aFather
918 aFather previously published object
919 aShape the shape to be published as sub-object of aFather
920 aName the name for the shape
923 study entry of the published shape in form of string
925 # Example: see GEOM_TestAll.py
927 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
928 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
930 print "addToStudyInFather() failed"
932 return aShape.GetStudyEntry()
934 ## Unpublish object in study
936 # \param obj the object to be unpublished
937 def hideInStudy(self, obj):
939 Unpublish object in study
942 obj the object to be unpublished
944 ior = salome.orb.object_to_string(obj)
945 aSObject = self.myStudy.FindObjectIOR(ior)
946 if aSObject is not None:
947 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
948 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
949 drwAttribute.SetDrawable(False)
950 # hide references if any
951 vso = self.myStudy.FindDependances(aSObject);
953 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
954 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
955 drwAttribute.SetDrawable(False)
959 # end of l1_geomBuilder_auxiliary
962 ## @addtogroup l3_restore_ss
965 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
966 # To be used from python scripts out of addToStudy() (non-default usage)
967 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
968 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
969 # If this list is empty, all operation arguments will be published
970 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
971 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
972 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
973 # Do not publish sub-shapes in place of arguments, but only
974 # in place of sub-shapes of the first argument,
975 # because the whole shape corresponds to the first argument.
976 # Mainly to be used after transformations, but it also can be
977 # usefull after partition with one object shape, and some other
978 # operations, where only the first argument has to be considered.
979 # If theObject has only one argument shape, this flag is automatically
980 # considered as True, not regarding really passed value.
981 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
982 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
983 # \return list of published sub-shapes
985 # @ref tui_restore_prs_params "Example"
986 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
987 theInheritFirstArg=False, theAddPrefix=True):
989 Publish sub-shapes, standing for arguments and sub-shapes of arguments
990 To be used from python scripts out of geompy.addToStudy (non-default usage)
993 theObject published GEOM.GEOM_Object, arguments of which will be published
994 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
995 If this list is empty, all operation arguments will be published
996 theFindMethod method to search sub-shapes, corresponding to arguments and
997 their sub-shapes. Value from enumeration GEOM.find_shape_method.
998 theInheritFirstArg set properties of the first argument for theObject.
999 Do not publish sub-shapes in place of arguments, but only
1000 in place of sub-shapes of the first argument,
1001 because the whole shape corresponds to the first argument.
1002 Mainly to be used after transformations, but it also can be
1003 usefull after partition with one object shape, and some other
1004 operations, where only the first argument has to be considered.
1005 If theObject has only one argument shape, this flag is automatically
1006 considered as True, not regarding really passed value.
1007 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1008 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1010 list of published sub-shapes
1012 # Example: see GEOM_TestAll.py
1013 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1014 theFindMethod, theInheritFirstArg, theAddPrefix)
1016 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1017 # To be used from python scripts out of addToStudy() (non-default usage)
1018 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1019 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1020 # If this list is empty, all operation arguments will be published
1021 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1022 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1023 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1024 # Do not publish sub-shapes in place of arguments, but only
1025 # in place of sub-shapes of the first argument,
1026 # because the whole shape corresponds to the first argument.
1027 # Mainly to be used after transformations, but it also can be
1028 # usefull after partition with one object shape, and some other
1029 # operations, where only the first argument has to be considered.
1030 # If theObject has only one argument shape, this flag is automatically
1031 # considered as True, not regarding really passed value.
1032 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1033 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1034 # \return list of published sub-shapes
1036 # @ref tui_restore_prs_params "Example"
1037 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1038 theInheritFirstArg=False, theAddPrefix=True):
1040 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1041 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1044 theObject published GEOM.GEOM_Object, arguments of which will be published
1045 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1046 If this list is empty, all operation arguments will be published
1047 theFindMethod method to search sub-shapes, corresponding to arguments and
1048 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1049 theInheritFirstArg set properties of the first argument for theObject.
1050 Do not publish sub-shapes in place of arguments, but only
1051 in place of sub-shapes of the first argument,
1052 because the whole shape corresponds to the first argument.
1053 Mainly to be used after transformations, but it also can be
1054 usefull after partition with one object shape, and some other
1055 operations, where only the first argument has to be considered.
1056 If theObject has only one argument shape, this flag is automatically
1057 considered as True, not regarding really passed value.
1058 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1059 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1062 list of published sub-shapes
1064 # Example: see GEOM_TestAll.py
1065 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1066 theFindMethod, theInheritFirstArg, theAddPrefix)
1068 # end of l3_restore_ss
1071 ## @addtogroup l3_basic_go
1074 ## Create point by three coordinates.
1075 # @param theX The X coordinate of the point.
1076 # @param theY The Y coordinate of the point.
1077 # @param theZ The Z coordinate of the point.
1078 # @param theName Object name; when specified, this parameter is used
1079 # for result publication in the study. Otherwise, if automatic
1080 # publication is switched on, default value is used for result name.
1082 # @return New GEOM.GEOM_Object, containing the created point.
1084 # @ref tui_creation_point "Example"
1085 @ManageTransactions("BasicOp")
1086 def MakeVertex(self, theX, theY, theZ, theName=None):
1088 Create point by three coordinates.
1091 theX The X coordinate of the point.
1092 theY The Y coordinate of the point.
1093 theZ The Z coordinate of the point.
1094 theName Object name; when specified, this parameter is used
1095 for result publication in the study. Otherwise, if automatic
1096 publication is switched on, default value is used for result name.
1099 New GEOM.GEOM_Object, containing the created point.
1101 # Example: see GEOM_TestAll.py
1102 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1103 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1104 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1105 anObj.SetParameters(Parameters)
1106 self._autoPublish(anObj, theName, "vertex")
1109 ## Create a point, distant from the referenced point
1110 # on the given distances along the coordinate axes.
1111 # @param theReference The referenced point.
1112 # @param theX Displacement from the referenced point along OX axis.
1113 # @param theY Displacement from the referenced point along OY axis.
1114 # @param theZ Displacement from the referenced point along OZ axis.
1115 # @param theName Object name; when specified, this parameter is used
1116 # for result publication in the study. Otherwise, if automatic
1117 # publication is switched on, default value is used for result name.
1119 # @return New GEOM.GEOM_Object, containing the created point.
1121 # @ref tui_creation_point "Example"
1122 @ManageTransactions("BasicOp")
1123 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1125 Create a point, distant from the referenced point
1126 on the given distances along the coordinate axes.
1129 theReference The referenced point.
1130 theX Displacement from the referenced point along OX axis.
1131 theY Displacement from the referenced point along OY axis.
1132 theZ Displacement from the referenced point along OZ axis.
1133 theName Object name; when specified, this parameter is used
1134 for result publication in the study. Otherwise, if automatic
1135 publication is switched on, default value is used for result name.
1138 New GEOM.GEOM_Object, containing the created point.
1140 # Example: see GEOM_TestAll.py
1141 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1142 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1143 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1144 anObj.SetParameters(Parameters)
1145 self._autoPublish(anObj, theName, "vertex")
1148 ## Create a point, corresponding to the given parameter on the given curve.
1149 # @param theRefCurve The referenced curve.
1150 # @param theParameter Value of parameter on the referenced curve.
1151 # @param theName Object name; when specified, this parameter is used
1152 # for result publication in the study. Otherwise, if automatic
1153 # publication is switched on, default value is used for result name.
1155 # @return New GEOM.GEOM_Object, containing the created point.
1157 # @ref tui_creation_point "Example"
1158 @ManageTransactions("BasicOp")
1159 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1161 Create a point, corresponding to the given parameter on the given curve.
1164 theRefCurve The referenced curve.
1165 theParameter Value of parameter on the referenced curve.
1166 theName Object name; when specified, this parameter is used
1167 for result publication in the study. Otherwise, if automatic
1168 publication is switched on, default value is used for result name.
1171 New GEOM.GEOM_Object, containing the created point.
1174 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1176 # Example: see GEOM_TestAll.py
1177 theParameter, Parameters = ParseParameters(theParameter)
1178 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1179 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1180 anObj.SetParameters(Parameters)
1181 self._autoPublish(anObj, theName, "vertex")
1184 ## Create a point by projection give coordinates on the given curve
1185 # @param theRefCurve The referenced curve.
1186 # @param theX X-coordinate in 3D space
1187 # @param theY Y-coordinate in 3D space
1188 # @param theZ Z-coordinate in 3D space
1189 # @param theName Object name; when specified, this parameter is used
1190 # for result publication in the study. Otherwise, if automatic
1191 # publication is switched on, default value is used for result name.
1193 # @return New GEOM.GEOM_Object, containing the created point.
1195 # @ref tui_creation_point "Example"
1196 @ManageTransactions("BasicOp")
1197 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1199 Create a point by projection give coordinates on the given curve
1202 theRefCurve The referenced curve.
1203 theX X-coordinate in 3D space
1204 theY Y-coordinate in 3D space
1205 theZ Z-coordinate in 3D space
1206 theName Object name; when specified, this parameter is used
1207 for result publication in the study. Otherwise, if automatic
1208 publication is switched on, default value is used for result name.
1211 New GEOM.GEOM_Object, containing the created point.
1214 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1216 # Example: see GEOM_TestAll.py
1217 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1218 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1219 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1220 anObj.SetParameters(Parameters)
1221 self._autoPublish(anObj, theName, "vertex")
1224 ## Create a point, corresponding to the given length on the given curve.
1225 # @param theRefCurve The referenced curve.
1226 # @param theLength Length on the referenced curve. It can be negative.
1227 # @param theStartPoint Point allowing to choose the direction for the calculation
1228 # of the length. If None, start from the first point of theRefCurve.
1229 # @param theName Object name; when specified, this parameter is used
1230 # for result publication in the study. Otherwise, if automatic
1231 # publication is switched on, default value is used for result name.
1233 # @return New GEOM.GEOM_Object, containing the created point.
1235 # @ref tui_creation_point "Example"
1236 @ManageTransactions("BasicOp")
1237 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1239 Create a point, corresponding to the given length on the given curve.
1242 theRefCurve The referenced curve.
1243 theLength Length on the referenced curve. It can be negative.
1244 theStartPoint Point allowing to choose the direction for the calculation
1245 of the length. If None, start from the first point of theRefCurve.
1246 theName Object name; when specified, this parameter is used
1247 for result publication in the study. Otherwise, if automatic
1248 publication is switched on, default value is used for result name.
1251 New GEOM.GEOM_Object, containing the created point.
1253 # Example: see GEOM_TestAll.py
1254 theLength, Parameters = ParseParameters(theLength)
1255 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1256 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1257 anObj.SetParameters(Parameters)
1258 self._autoPublish(anObj, theName, "vertex")
1261 ## Create a point, corresponding to the given parameters on the
1263 # @param theRefSurf The referenced surface.
1264 # @param theUParameter Value of U-parameter on the referenced surface.
1265 # @param theVParameter Value of V-parameter on the referenced surface.
1266 # @param theName Object name; when specified, this parameter is used
1267 # for result publication in the study. Otherwise, if automatic
1268 # publication is switched on, default value is used for result name.
1270 # @return New GEOM.GEOM_Object, containing the created point.
1272 # @ref swig_MakeVertexOnSurface "Example"
1273 @ManageTransactions("BasicOp")
1274 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1276 Create a point, corresponding to the given parameters on the
1280 theRefSurf The referenced surface.
1281 theUParameter Value of U-parameter on the referenced surface.
1282 theVParameter Value of V-parameter on the referenced surface.
1283 theName Object name; when specified, this parameter is used
1284 for result publication in the study. Otherwise, if automatic
1285 publication is switched on, default value is used for result name.
1288 New GEOM.GEOM_Object, containing the created point.
1291 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1293 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1294 # Example: see GEOM_TestAll.py
1295 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1296 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1297 anObj.SetParameters(Parameters);
1298 self._autoPublish(anObj, theName, "vertex")
1301 ## Create a point by projection give coordinates on the given surface
1302 # @param theRefSurf The referenced surface.
1303 # @param theX X-coordinate in 3D space
1304 # @param theY Y-coordinate in 3D space
1305 # @param theZ Z-coordinate in 3D space
1306 # @param theName Object name; when specified, this parameter is used
1307 # for result publication in the study. Otherwise, if automatic
1308 # publication is switched on, default value is used for result name.
1310 # @return New GEOM.GEOM_Object, containing the created point.
1312 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1313 @ManageTransactions("BasicOp")
1314 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1316 Create a point by projection give coordinates on the given surface
1319 theRefSurf The referenced surface.
1320 theX X-coordinate in 3D space
1321 theY Y-coordinate in 3D space
1322 theZ Z-coordinate in 3D space
1323 theName Object name; when specified, this parameter is used
1324 for result publication in the study. Otherwise, if automatic
1325 publication is switched on, default value is used for result name.
1328 New GEOM.GEOM_Object, containing the created point.
1331 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1333 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1334 # Example: see GEOM_TestAll.py
1335 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1336 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1337 anObj.SetParameters(Parameters);
1338 self._autoPublish(anObj, theName, "vertex")
1341 ## Create a point, which lays on the given face.
1342 # The point will lay in arbitrary place of the face.
1343 # The only condition on it is a non-zero distance to the face boundary.
1344 # Such point can be used to uniquely identify the face inside any
1345 # shape in case, when the shape does not contain overlapped faces.
1346 # @param theFace The referenced face.
1347 # @param theName Object name; when specified, this parameter is used
1348 # for result publication in the study. Otherwise, if automatic
1349 # publication is switched on, default value is used for result name.
1351 # @return New GEOM.GEOM_Object, containing the created point.
1353 # @ref swig_MakeVertexInsideFace "Example"
1354 @ManageTransactions("BasicOp")
1355 def MakeVertexInsideFace (self, theFace, theName=None):
1357 Create a point, which lays on the given face.
1358 The point will lay in arbitrary place of the face.
1359 The only condition on it is a non-zero distance to the face boundary.
1360 Such point can be used to uniquely identify the face inside any
1361 shape in case, when the shape does not contain overlapped faces.
1364 theFace The referenced face.
1365 theName Object name; when specified, this parameter is used
1366 for result publication in the study. Otherwise, if automatic
1367 publication is switched on, default value is used for result name.
1370 New GEOM.GEOM_Object, containing the created point.
1373 p_on_face = geompy.MakeVertexInsideFace(Face)
1375 # Example: see GEOM_TestAll.py
1376 anObj = self.BasicOp.MakePointOnFace(theFace)
1377 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1378 self._autoPublish(anObj, theName, "vertex")
1381 ## Create a point on intersection of two lines.
1382 # @param theRefLine1, theRefLine2 The referenced lines.
1383 # @param theName Object name; when specified, this parameter is used
1384 # for result publication in the study. Otherwise, if automatic
1385 # publication is switched on, default value is used for result name.
1387 # @return New GEOM.GEOM_Object, containing the created point.
1389 # @ref swig_MakeVertexOnLinesIntersection "Example"
1390 @ManageTransactions("BasicOp")
1391 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1393 Create a point on intersection of two lines.
1396 theRefLine1, theRefLine2 The referenced lines.
1397 theName Object name; when specified, this parameter is used
1398 for result publication in the study. Otherwise, if automatic
1399 publication is switched on, default value is used for result name.
1402 New GEOM.GEOM_Object, containing the created point.
1404 # Example: see GEOM_TestAll.py
1405 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1406 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1407 self._autoPublish(anObj, theName, "vertex")
1410 ## Create a tangent, corresponding to the given parameter on the given curve.
1411 # @param theRefCurve The referenced curve.
1412 # @param theParameter Value of parameter on the referenced curve.
1413 # @param theName Object name; when specified, this parameter is used
1414 # for result publication in the study. Otherwise, if automatic
1415 # publication is switched on, default value is used for result name.
1417 # @return New GEOM.GEOM_Object, containing the created tangent.
1419 # @ref swig_MakeTangentOnCurve "Example"
1420 @ManageTransactions("BasicOp")
1421 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1423 Create a tangent, corresponding to the given parameter on the given curve.
1426 theRefCurve The referenced curve.
1427 theParameter Value of parameter on the referenced curve.
1428 theName Object name; when specified, this parameter is used
1429 for result publication in the study. Otherwise, if automatic
1430 publication is switched on, default value is used for result name.
1433 New GEOM.GEOM_Object, containing the created tangent.
1436 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1438 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1439 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1440 self._autoPublish(anObj, theName, "tangent")
1443 ## Create a tangent plane, corresponding to the given parameter on the given face.
1444 # @param theFace The face for which tangent plane should be built.
1445 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1446 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1447 # @param theTrimSize the size of plane.
1448 # @param theName Object name; when specified, this parameter is used
1449 # for result publication in the study. Otherwise, if automatic
1450 # publication is switched on, default value is used for result name.
1452 # @return New GEOM.GEOM_Object, containing the created tangent.
1454 # @ref swig_MakeTangentPlaneOnFace "Example"
1455 @ManageTransactions("BasicOp")
1456 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1458 Create a tangent plane, corresponding to the given parameter on the given face.
1461 theFace The face for which tangent plane should be built.
1462 theParameterV vertical value of the center point (0.0 - 1.0).
1463 theParameterU horisontal value of the center point (0.0 - 1.0).
1464 theTrimSize the size of plane.
1465 theName Object name; when specified, this parameter is used
1466 for result publication in the study. Otherwise, if automatic
1467 publication is switched on, default value is used for result name.
1470 New GEOM.GEOM_Object, containing the created tangent.
1473 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1475 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1476 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1477 self._autoPublish(anObj, theName, "tangent")
1480 ## Create a vector with the given components.
1481 # @param theDX X component of the vector.
1482 # @param theDY Y component of the vector.
1483 # @param theDZ Z component of the vector.
1484 # @param theName Object name; when specified, this parameter is used
1485 # for result publication in the study. Otherwise, if automatic
1486 # publication is switched on, default value is used for result name.
1488 # @return New GEOM.GEOM_Object, containing the created vector.
1490 # @ref tui_creation_vector "Example"
1491 @ManageTransactions("BasicOp")
1492 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1494 Create a vector with the given components.
1497 theDX X component of the vector.
1498 theDY Y component of the vector.
1499 theDZ Z component of the vector.
1500 theName Object name; when specified, this parameter is used
1501 for result publication in the study. Otherwise, if automatic
1502 publication is switched on, default value is used for result name.
1505 New GEOM.GEOM_Object, containing the created vector.
1507 # Example: see GEOM_TestAll.py
1508 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1509 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1510 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1511 anObj.SetParameters(Parameters)
1512 self._autoPublish(anObj, theName, "vector")
1515 ## Create a vector between two points.
1516 # @param thePnt1 Start point for the vector.
1517 # @param thePnt2 End point for the vector.
1518 # @param theName Object name; when specified, this parameter is used
1519 # for result publication in the study. Otherwise, if automatic
1520 # publication is switched on, default value is used for result name.
1522 # @return New GEOM.GEOM_Object, containing the created vector.
1524 # @ref tui_creation_vector "Example"
1525 @ManageTransactions("BasicOp")
1526 def MakeVector(self, thePnt1, thePnt2, theName=None):
1528 Create a vector between two points.
1531 thePnt1 Start point for the vector.
1532 thePnt2 End point for the vector.
1533 theName Object name; when specified, this parameter is used
1534 for result publication in the study. Otherwise, if automatic
1535 publication is switched on, default value is used for result name.
1538 New GEOM.GEOM_Object, containing the created vector.
1540 # Example: see GEOM_TestAll.py
1541 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1542 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1543 self._autoPublish(anObj, theName, "vector")
1546 ## Create a line, passing through the given point
1547 # and parrallel to the given direction
1548 # @param thePnt Point. The resulting line will pass through it.
1549 # @param theDir Direction. The resulting line will be parallel to it.
1550 # @param theName Object name; when specified, this parameter is used
1551 # for result publication in the study. Otherwise, if automatic
1552 # publication is switched on, default value is used for result name.
1554 # @return New GEOM.GEOM_Object, containing the created line.
1556 # @ref tui_creation_line "Example"
1557 @ManageTransactions("BasicOp")
1558 def MakeLine(self, thePnt, theDir, theName=None):
1560 Create a line, passing through the given point
1561 and parrallel to the given direction
1564 thePnt Point. The resulting line will pass through it.
1565 theDir Direction. The resulting line will be parallel to it.
1566 theName Object name; when specified, this parameter is used
1567 for result publication in the study. Otherwise, if automatic
1568 publication is switched on, default value is used for result name.
1571 New GEOM.GEOM_Object, containing the created line.
1573 # Example: see GEOM_TestAll.py
1574 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1575 RaiseIfFailed("MakeLine", self.BasicOp)
1576 self._autoPublish(anObj, theName, "line")
1579 ## Create a line, passing through the given points
1580 # @param thePnt1 First of two points, defining the line.
1581 # @param thePnt2 Second of two points, defining the line.
1582 # @param theName Object name; when specified, this parameter is used
1583 # for result publication in the study. Otherwise, if automatic
1584 # publication is switched on, default value is used for result name.
1586 # @return New GEOM.GEOM_Object, containing the created line.
1588 # @ref tui_creation_line "Example"
1589 @ManageTransactions("BasicOp")
1590 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1592 Create a line, passing through the given points
1595 thePnt1 First of two points, defining the line.
1596 thePnt2 Second of two points, defining the line.
1597 theName Object name; when specified, this parameter is used
1598 for result publication in the study. Otherwise, if automatic
1599 publication is switched on, default value is used for result name.
1602 New GEOM.GEOM_Object, containing the created line.
1604 # Example: see GEOM_TestAll.py
1605 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1606 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1607 self._autoPublish(anObj, theName, "line")
1610 ## Create a line on two faces intersection.
1611 # @param theFace1 First of two faces, defining the line.
1612 # @param theFace2 Second of two faces, defining the line.
1613 # @param theName Object name; when specified, this parameter is used
1614 # for result publication in the study. Otherwise, if automatic
1615 # publication is switched on, default value is used for result name.
1617 # @return New GEOM.GEOM_Object, containing the created line.
1619 # @ref swig_MakeLineTwoFaces "Example"
1620 @ManageTransactions("BasicOp")
1621 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1623 Create a line on two faces intersection.
1626 theFace1 First of two faces, defining the line.
1627 theFace2 Second of two faces, defining the line.
1628 theName Object name; when specified, this parameter is used
1629 for result publication in the study. Otherwise, if automatic
1630 publication is switched on, default value is used for result name.
1633 New GEOM.GEOM_Object, containing the created line.
1635 # Example: see GEOM_TestAll.py
1636 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1637 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1638 self._autoPublish(anObj, theName, "line")
1641 ## Create a plane, passing through the given point
1642 # and normal to the given vector.
1643 # @param thePnt Point, the plane has to pass through.
1644 # @param theVec Vector, defining the plane normal direction.
1645 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1646 # @param theName Object name; when specified, this parameter is used
1647 # for result publication in the study. Otherwise, if automatic
1648 # publication is switched on, default value is used for result name.
1650 # @return New GEOM.GEOM_Object, containing the created plane.
1652 # @ref tui_creation_plane "Example"
1653 @ManageTransactions("BasicOp")
1654 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1656 Create a plane, passing through the given point
1657 and normal to the given vector.
1660 thePnt Point, the plane has to pass through.
1661 theVec Vector, defining the plane normal direction.
1662 theTrimSize Half size of a side of quadrangle face, representing the plane.
1663 theName Object name; when specified, this parameter is used
1664 for result publication in the study. Otherwise, if automatic
1665 publication is switched on, default value is used for result name.
1668 New GEOM.GEOM_Object, containing the created plane.
1670 # Example: see GEOM_TestAll.py
1671 theTrimSize, Parameters = ParseParameters(theTrimSize);
1672 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1673 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1674 anObj.SetParameters(Parameters)
1675 self._autoPublish(anObj, theName, "plane")
1678 ## Create a plane, passing through the three given points
1679 # @param thePnt1 First of three points, defining the plane.
1680 # @param thePnt2 Second of three points, defining the plane.
1681 # @param thePnt3 Fird of three points, defining the plane.
1682 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1683 # @param theName Object name; when specified, this parameter is used
1684 # for result publication in the study. Otherwise, if automatic
1685 # publication is switched on, default value is used for result name.
1687 # @return New GEOM.GEOM_Object, containing the created plane.
1689 # @ref tui_creation_plane "Example"
1690 @ManageTransactions("BasicOp")
1691 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1693 Create a plane, passing through the three given points
1696 thePnt1 First of three points, defining the plane.
1697 thePnt2 Second of three points, defining the plane.
1698 thePnt3 Fird of three points, defining the plane.
1699 theTrimSize Half size of a side of quadrangle face, representing the plane.
1700 theName Object name; when specified, this parameter is used
1701 for result publication in the study. Otherwise, if automatic
1702 publication is switched on, default value is used for result name.
1705 New GEOM.GEOM_Object, containing the created plane.
1707 # Example: see GEOM_TestAll.py
1708 theTrimSize, Parameters = ParseParameters(theTrimSize);
1709 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1710 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1711 anObj.SetParameters(Parameters)
1712 self._autoPublish(anObj, theName, "plane")
1715 ## Create a plane, similar to the existing one, but with another size of representing face.
1716 # @param theFace Referenced plane or LCS(Marker).
1717 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1718 # @param theName Object name; when specified, this parameter is used
1719 # for result publication in the study. Otherwise, if automatic
1720 # publication is switched on, default value is used for result name.
1722 # @return New GEOM.GEOM_Object, containing the created plane.
1724 # @ref tui_creation_plane "Example"
1725 @ManageTransactions("BasicOp")
1726 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1728 Create a plane, similar to the existing one, but with another size of representing face.
1731 theFace Referenced plane or LCS(Marker).
1732 theTrimSize New half size of a side of quadrangle face, representing the plane.
1733 theName Object name; when specified, this parameter is used
1734 for result publication in the study. Otherwise, if automatic
1735 publication is switched on, default value is used for result name.
1738 New GEOM.GEOM_Object, containing the created plane.
1740 # Example: see GEOM_TestAll.py
1741 theTrimSize, Parameters = ParseParameters(theTrimSize);
1742 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1743 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1744 anObj.SetParameters(Parameters)
1745 self._autoPublish(anObj, theName, "plane")
1748 ## Create a plane, passing through the 2 vectors
1749 # with center in a start point of the first vector.
1750 # @param theVec1 Vector, defining center point and plane direction.
1751 # @param theVec2 Vector, defining the plane normal direction.
1752 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1753 # @param theName Object name; when specified, this parameter is used
1754 # for result publication in the study. Otherwise, if automatic
1755 # publication is switched on, default value is used for result name.
1757 # @return New GEOM.GEOM_Object, containing the created plane.
1759 # @ref tui_creation_plane "Example"
1760 @ManageTransactions("BasicOp")
1761 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1763 Create a plane, passing through the 2 vectors
1764 with center in a start point of the first vector.
1767 theVec1 Vector, defining center point and plane direction.
1768 theVec2 Vector, defining the plane normal direction.
1769 theTrimSize Half size of a side of quadrangle face, representing the plane.
1770 theName Object name; when specified, this parameter is used
1771 for result publication in the study. Otherwise, if automatic
1772 publication is switched on, default value is used for result name.
1775 New GEOM.GEOM_Object, containing the created plane.
1777 # Example: see GEOM_TestAll.py
1778 theTrimSize, Parameters = ParseParameters(theTrimSize);
1779 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1780 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1781 anObj.SetParameters(Parameters)
1782 self._autoPublish(anObj, theName, "plane")
1785 ## Create a plane, based on a Local coordinate system.
1786 # @param theLCS coordinate system, defining plane.
1787 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1788 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1789 # @param theName Object name; when specified, this parameter is used
1790 # for result publication in the study. Otherwise, if automatic
1791 # publication is switched on, default value is used for result name.
1793 # @return New GEOM.GEOM_Object, containing the created plane.
1795 # @ref tui_creation_plane "Example"
1796 @ManageTransactions("BasicOp")
1797 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1799 Create a plane, based on a Local coordinate system.
1802 theLCS coordinate system, defining plane.
1803 theTrimSize Half size of a side of quadrangle face, representing the plane.
1804 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1805 theName Object name; when specified, this parameter is used
1806 for result publication in the study. Otherwise, if automatic
1807 publication is switched on, default value is used for result name.
1810 New GEOM.GEOM_Object, containing the created plane.
1812 # Example: see GEOM_TestAll.py
1813 theTrimSize, Parameters = ParseParameters(theTrimSize);
1814 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1815 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1816 anObj.SetParameters(Parameters)
1817 self._autoPublish(anObj, theName, "plane")
1820 ## Create a local coordinate system.
1821 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1822 # @param XDX,XDY,XDZ Three components of OX direction
1823 # @param YDX,YDY,YDZ Three components of OY direction
1824 # @param theName Object name; when specified, this parameter is used
1825 # for result publication in the study. Otherwise, if automatic
1826 # publication is switched on, default value is used for result name.
1828 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1830 # @ref swig_MakeMarker "Example"
1831 @ManageTransactions("BasicOp")
1832 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1834 Create a local coordinate system.
1837 OX,OY,OZ Three coordinates of coordinate system origin.
1838 XDX,XDY,XDZ Three components of OX direction
1839 YDX,YDY,YDZ Three components of OY direction
1840 theName Object name; when specified, this parameter is used
1841 for result publication in the study. Otherwise, if automatic
1842 publication is switched on, default value is used for result name.
1845 New GEOM.GEOM_Object, containing the created coordinate system.
1847 # Example: see GEOM_TestAll.py
1848 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1849 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1850 RaiseIfFailed("MakeMarker", self.BasicOp)
1851 anObj.SetParameters(Parameters)
1852 self._autoPublish(anObj, theName, "lcs")
1855 ## Create a local coordinate system from shape.
1856 # @param theShape The initial shape to detect the coordinate system.
1857 # @param theName Object name; when specified, this parameter is used
1858 # for result publication in the study. Otherwise, if automatic
1859 # publication is switched on, default value is used for result name.
1861 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1863 # @ref tui_creation_lcs "Example"
1864 @ManageTransactions("BasicOp")
1865 def MakeMarkerFromShape(self, theShape, theName=None):
1867 Create a local coordinate system from shape.
1870 theShape The initial shape to detect the coordinate system.
1871 theName Object name; when specified, this parameter is used
1872 for result publication in the study. Otherwise, if automatic
1873 publication is switched on, default value is used for result name.
1876 New GEOM.GEOM_Object, containing the created coordinate system.
1878 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1879 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1880 self._autoPublish(anObj, theName, "lcs")
1883 ## Create a local coordinate system from point and two vectors.
1884 # @param theOrigin Point of coordinate system origin.
1885 # @param theXVec Vector of X direction
1886 # @param theYVec Vector of Y direction
1887 # @param theName Object name; when specified, this parameter is used
1888 # for result publication in the study. Otherwise, if automatic
1889 # publication is switched on, default value is used for result name.
1891 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1893 # @ref tui_creation_lcs "Example"
1894 @ManageTransactions("BasicOp")
1895 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1897 Create a local coordinate system from point and two vectors.
1900 theOrigin Point of coordinate system origin.
1901 theXVec Vector of X direction
1902 theYVec Vector of Y direction
1903 theName Object name; when specified, this parameter is used
1904 for result publication in the study. Otherwise, if automatic
1905 publication is switched on, default value is used for result name.
1908 New GEOM.GEOM_Object, containing the created coordinate system.
1911 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1912 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1913 self._autoPublish(anObj, theName, "lcs")
1916 # end of l3_basic_go
1919 ## @addtogroup l4_curves
1922 ## Create an arc of circle, passing through three given points.
1923 # @param thePnt1 Start point of the arc.
1924 # @param thePnt2 Middle point of the arc.
1925 # @param thePnt3 End point of the arc.
1926 # @param theName Object name; when specified, this parameter is used
1927 # for result publication in the study. Otherwise, if automatic
1928 # publication is switched on, default value is used for result name.
1930 # @return New GEOM.GEOM_Object, containing the created arc.
1932 # @ref swig_MakeArc "Example"
1933 @ManageTransactions("CurvesOp")
1934 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1936 Create an arc of circle, passing through three given points.
1939 thePnt1 Start point of the arc.
1940 thePnt2 Middle point of the arc.
1941 thePnt3 End point of the arc.
1942 theName Object name; when specified, this parameter is used
1943 for result publication in the study. Otherwise, if automatic
1944 publication is switched on, default value is used for result name.
1947 New GEOM.GEOM_Object, containing the created arc.
1949 # Example: see GEOM_TestAll.py
1950 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1951 RaiseIfFailed("MakeArc", self.CurvesOp)
1952 self._autoPublish(anObj, theName, "arc")
1955 ## Create an arc of circle from a center and 2 points.
1956 # @param thePnt1 Center of the arc
1957 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1958 # @param thePnt3 End point of the arc (Gives also a direction)
1959 # @param theSense Orientation of the arc
1960 # @param theName Object name; when specified, this parameter is used
1961 # for result publication in the study. Otherwise, if automatic
1962 # publication is switched on, default value is used for result name.
1964 # @return New GEOM.GEOM_Object, containing the created arc.
1966 # @ref swig_MakeArc "Example"
1967 @ManageTransactions("CurvesOp")
1968 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1970 Create an arc of circle from a center and 2 points.
1973 thePnt1 Center of the arc
1974 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1975 thePnt3 End point of the arc (Gives also a direction)
1976 theSense Orientation of the arc
1977 theName Object name; when specified, this parameter is used
1978 for result publication in the study. Otherwise, if automatic
1979 publication is switched on, default value is used for result name.
1982 New GEOM.GEOM_Object, containing the created arc.
1984 # Example: see GEOM_TestAll.py
1985 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1986 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1987 self._autoPublish(anObj, theName, "arc")
1990 ## Create an arc of ellipse, of center and two points.
1991 # @param theCenter Center of the arc.
1992 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1993 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1994 # @param theName Object name; when specified, this parameter is used
1995 # for result publication in the study. Otherwise, if automatic
1996 # publication is switched on, default value is used for result name.
1998 # @return New GEOM.GEOM_Object, containing the created arc.
2000 # @ref swig_MakeArc "Example"
2001 @ManageTransactions("CurvesOp")
2002 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2004 Create an arc of ellipse, of center and two points.
2007 theCenter Center of the arc.
2008 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2009 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2010 theName Object name; when specified, this parameter is used
2011 for result publication in the study. Otherwise, if automatic
2012 publication is switched on, default value is used for result name.
2015 New GEOM.GEOM_Object, containing the created arc.
2017 # Example: see GEOM_TestAll.py
2018 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2019 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2020 self._autoPublish(anObj, theName, "arc")
2023 ## Create a circle with given center, normal vector and radius.
2024 # @param thePnt Circle center.
2025 # @param theVec Vector, normal to the plane of the circle.
2026 # @param theR Circle radius.
2027 # @param theName Object name; when specified, this parameter is used
2028 # for result publication in the study. Otherwise, if automatic
2029 # publication is switched on, default value is used for result name.
2031 # @return New GEOM.GEOM_Object, containing the created circle.
2033 # @ref tui_creation_circle "Example"
2034 @ManageTransactions("CurvesOp")
2035 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2037 Create a circle with given center, normal vector and radius.
2040 thePnt Circle center.
2041 theVec Vector, normal to the plane of the circle.
2043 theName Object name; when specified, this parameter is used
2044 for result publication in the study. Otherwise, if automatic
2045 publication is switched on, default value is used for result name.
2048 New GEOM.GEOM_Object, containing the created circle.
2050 # Example: see GEOM_TestAll.py
2051 theR, Parameters = ParseParameters(theR)
2052 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2053 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2054 anObj.SetParameters(Parameters)
2055 self._autoPublish(anObj, theName, "circle")
2058 ## Create a circle with given radius.
2059 # Center of the circle will be in the origin of global
2060 # coordinate system and normal vector will be codirected with Z axis
2061 # @param theR Circle radius.
2062 # @param theName Object name; when specified, this parameter is used
2063 # for result publication in the study. Otherwise, if automatic
2064 # publication is switched on, default value is used for result name.
2066 # @return New GEOM.GEOM_Object, containing the created circle.
2067 @ManageTransactions("CurvesOp")
2068 def MakeCircleR(self, theR, theName=None):
2070 Create a circle with given radius.
2071 Center of the circle will be in the origin of global
2072 coordinate system and normal vector will be codirected with Z axis
2076 theName Object name; when specified, this parameter is used
2077 for result publication in the study. Otherwise, if automatic
2078 publication is switched on, default value is used for result name.
2081 New GEOM.GEOM_Object, containing the created circle.
2083 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2084 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2085 self._autoPublish(anObj, theName, "circle")
2088 ## Create a circle, passing through three given points
2089 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2090 # @param theName Object name; when specified, this parameter is used
2091 # for result publication in the study. Otherwise, if automatic
2092 # publication is switched on, default value is used for result name.
2094 # @return New GEOM.GEOM_Object, containing the created circle.
2096 # @ref tui_creation_circle "Example"
2097 @ManageTransactions("CurvesOp")
2098 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2100 Create a circle, passing through three given points
2103 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2104 theName Object name; when specified, this parameter is used
2105 for result publication in the study. Otherwise, if automatic
2106 publication is switched on, default value is used for result name.
2109 New GEOM.GEOM_Object, containing the created circle.
2111 # Example: see GEOM_TestAll.py
2112 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2113 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2114 self._autoPublish(anObj, theName, "circle")
2117 ## Create a circle, with given point1 as center,
2118 # passing through the point2 as radius and laying in the plane,
2119 # defined by all three given points.
2120 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2121 # @param theName Object name; when specified, this parameter is used
2122 # for result publication in the study. Otherwise, if automatic
2123 # publication is switched on, default value is used for result name.
2125 # @return New GEOM.GEOM_Object, containing the created circle.
2127 # @ref swig_MakeCircle "Example"
2128 @ManageTransactions("CurvesOp")
2129 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2131 Create a circle, with given point1 as center,
2132 passing through the point2 as radius and laying in the plane,
2133 defined by all three given points.
2136 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2137 theName Object name; when specified, this parameter is used
2138 for result publication in the study. Otherwise, if automatic
2139 publication is switched on, default value is used for result name.
2142 New GEOM.GEOM_Object, containing the created circle.
2144 # Example: see GEOM_example6.py
2145 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2146 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2147 self._autoPublish(anObj, theName, "circle")
2150 ## Create an ellipse with given center, normal vector and radiuses.
2151 # @param thePnt Ellipse center.
2152 # @param theVec Vector, normal to the plane of the ellipse.
2153 # @param theRMajor Major ellipse radius.
2154 # @param theRMinor Minor ellipse radius.
2155 # @param theVecMaj Vector, direction of the ellipse's main axis.
2156 # @param theName Object name; when specified, this parameter is used
2157 # for result publication in the study. Otherwise, if automatic
2158 # publication is switched on, default value is used for result name.
2160 # @return New GEOM.GEOM_Object, containing the created ellipse.
2162 # @ref tui_creation_ellipse "Example"
2163 @ManageTransactions("CurvesOp")
2164 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2166 Create an ellipse with given center, normal vector and radiuses.
2169 thePnt Ellipse center.
2170 theVec Vector, normal to the plane of the ellipse.
2171 theRMajor Major ellipse radius.
2172 theRMinor Minor ellipse radius.
2173 theVecMaj Vector, direction of the ellipse's main axis.
2174 theName Object name; when specified, this parameter is used
2175 for result publication in the study. Otherwise, if automatic
2176 publication is switched on, default value is used for result name.
2179 New GEOM.GEOM_Object, containing the created ellipse.
2181 # Example: see GEOM_TestAll.py
2182 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2183 if theVecMaj is not None:
2184 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2186 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2188 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2189 anObj.SetParameters(Parameters)
2190 self._autoPublish(anObj, theName, "ellipse")
2193 ## Create an ellipse with given radiuses.
2194 # Center of the ellipse will be in the origin of global
2195 # coordinate system and normal vector will be codirected with Z axis
2196 # @param theRMajor Major ellipse radius.
2197 # @param theRMinor Minor ellipse radius.
2198 # @param theName Object name; when specified, this parameter is used
2199 # for result publication in the study. Otherwise, if automatic
2200 # publication is switched on, default value is used for result name.
2202 # @return New GEOM.GEOM_Object, containing the created ellipse.
2203 @ManageTransactions("CurvesOp")
2204 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2206 Create an ellipse with given radiuses.
2207 Center of the ellipse will be in the origin of global
2208 coordinate system and normal vector will be codirected with Z axis
2211 theRMajor Major ellipse radius.
2212 theRMinor Minor ellipse radius.
2213 theName Object name; when specified, this parameter is used
2214 for result publication in the study. Otherwise, if automatic
2215 publication is switched on, default value is used for result name.
2218 New GEOM.GEOM_Object, containing the created ellipse.
2220 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2221 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2222 self._autoPublish(anObj, theName, "ellipse")
2225 ## Create a polyline on the set of points.
2226 # @param thePoints Sequence of points for the polyline.
2227 # @param theIsClosed If True, build a closed wire.
2228 # @param theName Object name; when specified, this parameter is used
2229 # for result publication in the study. Otherwise, if automatic
2230 # publication is switched on, default value is used for result name.
2232 # @return New GEOM.GEOM_Object, containing the created polyline.
2234 # @ref tui_creation_curve "Example"
2235 @ManageTransactions("CurvesOp")
2236 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2238 Create a polyline on the set of points.
2241 thePoints Sequence of points for the polyline.
2242 theIsClosed If True, build a closed wire.
2243 theName Object name; when specified, this parameter is used
2244 for result publication in the study. Otherwise, if automatic
2245 publication is switched on, default value is used for result name.
2248 New GEOM.GEOM_Object, containing the created polyline.
2250 # Example: see GEOM_TestAll.py
2251 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2252 RaiseIfFailed("MakePolyline", self.CurvesOp)
2253 self._autoPublish(anObj, theName, "polyline")
2256 ## Create bezier curve on the set of points.
2257 # @param thePoints Sequence of points for the bezier curve.
2258 # @param theIsClosed If True, build a closed curve.
2259 # @param theName Object name; when specified, this parameter is used
2260 # for result publication in the study. Otherwise, if automatic
2261 # publication is switched on, default value is used for result name.
2263 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2265 # @ref tui_creation_curve "Example"
2266 @ManageTransactions("CurvesOp")
2267 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2269 Create bezier curve on the set of points.
2272 thePoints Sequence of points for the bezier curve.
2273 theIsClosed If True, build a closed curve.
2274 theName Object name; when specified, this parameter is used
2275 for result publication in the study. Otherwise, if automatic
2276 publication is switched on, default value is used for result name.
2279 New GEOM.GEOM_Object, containing the created bezier curve.
2281 # Example: see GEOM_TestAll.py
2282 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2283 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2284 self._autoPublish(anObj, theName, "bezier")
2287 ## Create B-Spline curve on the set of points.
2288 # @param thePoints Sequence of points for the B-Spline curve.
2289 # @param theIsClosed If True, build a closed curve.
2290 # @param theDoReordering If TRUE, the algo does not follow the order of
2291 # \a thePoints but searches for the closest vertex.
2292 # @param theName Object name; when specified, this parameter is used
2293 # for result publication in the study. Otherwise, if automatic
2294 # publication is switched on, default value is used for result name.
2296 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2298 # @ref tui_creation_curve "Example"
2299 @ManageTransactions("CurvesOp")
2300 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2302 Create B-Spline curve on the set of points.
2305 thePoints Sequence of points for the B-Spline curve.
2306 theIsClosed If True, build a closed curve.
2307 theDoReordering If True, the algo does not follow the order of
2308 thePoints but searches for the closest vertex.
2309 theName Object name; when specified, this parameter is used
2310 for result publication in the study. Otherwise, if automatic
2311 publication is switched on, default value is used for result name.
2314 New GEOM.GEOM_Object, containing the created B-Spline curve.
2316 # Example: see GEOM_TestAll.py
2317 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2318 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2319 self._autoPublish(anObj, theName, "bspline")
2322 ## Create B-Spline curve on the set of points.
2323 # @param thePoints Sequence of points for the B-Spline curve.
2324 # @param theFirstVec Vector object, defining the curve direction at its first point.
2325 # @param theLastVec Vector object, defining the curve direction at its last point.
2326 # @param theName Object name; when specified, this parameter is used
2327 # for result publication in the study. Otherwise, if automatic
2328 # publication is switched on, default value is used for result name.
2330 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2332 # @ref tui_creation_curve "Example"
2333 @ManageTransactions("CurvesOp")
2334 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2336 Create B-Spline curve on the set of points.
2339 thePoints Sequence of points for the B-Spline curve.
2340 theFirstVec Vector object, defining the curve direction at its first point.
2341 theLastVec Vector object, defining the curve direction at its last point.
2342 theName Object name; when specified, this parameter is used
2343 for result publication in the study. Otherwise, if automatic
2344 publication is switched on, default value is used for result name.
2347 New GEOM.GEOM_Object, containing the created B-Spline curve.
2349 # Example: see GEOM_TestAll.py
2350 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2351 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2352 self._autoPublish(anObj, theName, "bspline")
2355 ## Creates a curve using the parametric definition of the basic points.
2356 # @param thexExpr parametric equation of the coordinates X.
2357 # @param theyExpr parametric equation of the coordinates Y.
2358 # @param thezExpr parametric equation of the coordinates Z.
2359 # @param theParamMin the minimal value of the parameter.
2360 # @param theParamMax the maximum value of the parameter.
2361 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2362 # @param theCurveType the type of the curve,
2363 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2364 # @param theNewMethod flag for switching to the new method if the flag is set to false a deprecated method is used which can lead to a bug.
2365 # @param theName Object name; when specified, this parameter is used
2366 # for result publication in the study. Otherwise, if automatic
2367 # publication is switched on, default value is used for result name.
2369 # @return New GEOM.GEOM_Object, containing the created curve.
2371 # @ref tui_creation_curve "Example"
2372 @ManageTransactions("CurvesOp")
2373 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2374 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2376 Creates a curve using the parametric definition of the basic points.
2379 thexExpr parametric equation of the coordinates X.
2380 theyExpr parametric equation of the coordinates Y.
2381 thezExpr parametric equation of the coordinates Z.
2382 theParamMin the minimal value of the parameter.
2383 theParamMax the maximum value of the parameter.
2384 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2385 theCurveType the type of the curve,
2386 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2387 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2388 method is used which can lead to a bug.
2389 theName Object name; when specified, this parameter is used
2390 for result publication in the study. Otherwise, if automatic
2391 publication is switched on, default value is used for result name.
2394 New GEOM.GEOM_Object, containing the created curve.
2396 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2398 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2400 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2401 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2402 anObj.SetParameters(Parameters)
2403 self._autoPublish(anObj, theName, "curve")
2406 ## Create an isoline curve on a face.
2407 # @param theFace the face for which an isoline is created.
2408 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2410 # @param theParameter the U parameter for U-isoline or V parameter
2412 # @param theName Object name; when specified, this parameter is used
2413 # for result publication in the study. Otherwise, if automatic
2414 # publication is switched on, default value is used for result name.
2416 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2417 # a compound of edges.
2419 # @ref tui_creation_curve "Example"
2420 @ManageTransactions("CurvesOp")
2421 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2423 Create an isoline curve on a face.
2426 theFace the face for which an isoline is created.
2427 IsUIsoline True for U-isoline creation; False for V-isoline
2429 theParameter the U parameter for U-isoline or V parameter
2431 theName Object name; when specified, this parameter is used
2432 for result publication in the study. Otherwise, if automatic
2433 publication is switched on, default value is used for result name.
2436 New GEOM.GEOM_Object, containing the created isoline edge or a
2439 # Example: see GEOM_TestAll.py
2440 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2441 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2443 self._autoPublish(anObj, theName, "U-Isoline")
2445 self._autoPublish(anObj, theName, "V-Isoline")
2451 ## @addtogroup l3_sketcher
2454 ## Create a sketcher (wire or face), following the textual description,
2455 # passed through <VAR>theCommand</VAR> argument. \n
2456 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2457 # Format of the description string have to be the following:
2459 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2462 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2464 # - "R angle" : Set the direction by angle
2465 # - "D dx dy" : Set the direction by DX & DY
2468 # - "TT x y" : Create segment by point at X & Y
2469 # - "T dx dy" : Create segment by point with DX & DY
2470 # - "L length" : Create segment by direction & Length
2471 # - "IX x" : Create segment by direction & Intersect. X
2472 # - "IY y" : Create segment by direction & Intersect. Y
2475 # - "C radius length" : Create arc by direction, radius and length(in degree)
2476 # - "AA x y": Create arc by point at X & Y
2477 # - "A dx dy" : Create arc by point with DX & DY
2478 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2479 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2480 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2481 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2484 # - "WW" : Close Wire (to finish)
2485 # - "WF" : Close Wire and build face (to finish)
2488 # - Flag1 (= reverse) is 0 or 2 ...
2489 # - if 0 the drawn arc is the one of lower angle (< Pi)
2490 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2493 # - Flag2 (= control tolerance) is 0 or 1 ...
2494 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2495 # - if 1 the wire is built only if the end point is on the arc
2496 # with a tolerance of 10^-7 on the distance else the creation fails
2498 # @param theCommand String, defining the sketcher in local
2499 # coordinates of the working plane.
2500 # @param theWorkingPlane Nine double values, defining origin,
2501 # OZ and OX directions of the working plane.
2502 # @param theName Object name; when specified, this parameter is used
2503 # for result publication in the study. Otherwise, if automatic
2504 # publication is switched on, default value is used for result name.
2506 # @return New GEOM.GEOM_Object, containing the created wire.
2508 # @ref tui_sketcher_page "Example"
2509 @ManageTransactions("CurvesOp")
2510 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2512 Create a sketcher (wire or face), following the textual description, passed
2513 through theCommand argument.
2514 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2515 Format of the description string have to be the following:
2516 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2518 - x1, y1 are coordinates of the first sketcher point (zero by default),
2520 - "R angle" : Set the direction by angle
2521 - "D dx dy" : Set the direction by DX & DY
2523 - "TT x y" : Create segment by point at X & Y
2524 - "T dx dy" : Create segment by point with DX & DY
2525 - "L length" : Create segment by direction & Length
2526 - "IX x" : Create segment by direction & Intersect. X
2527 - "IY y" : Create segment by direction & Intersect. Y
2529 - "C radius length" : Create arc by direction, radius and length(in degree)
2530 - "AA x y": Create arc by point at X & Y
2531 - "A dx dy" : Create arc by point with DX & DY
2532 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2533 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2534 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2535 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2537 - "WW" : Close Wire (to finish)
2538 - "WF" : Close Wire and build face (to finish)
2540 - Flag1 (= reverse) is 0 or 2 ...
2541 - if 0 the drawn arc is the one of lower angle (< Pi)
2542 - if 2 the drawn arc ius the one of greater angle (> Pi)
2544 - Flag2 (= control tolerance) is 0 or 1 ...
2545 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2546 - if 1 the wire is built only if the end point is on the arc
2547 with a tolerance of 10^-7 on the distance else the creation fails
2550 theCommand String, defining the sketcher in local
2551 coordinates of the working plane.
2552 theWorkingPlane Nine double values, defining origin,
2553 OZ and OX directions of the working plane.
2554 theName Object name; when specified, this parameter is used
2555 for result publication in the study. Otherwise, if automatic
2556 publication is switched on, default value is used for result name.
2559 New GEOM.GEOM_Object, containing the created wire.
2561 # Example: see GEOM_TestAll.py
2562 theCommand,Parameters = ParseSketcherCommand(theCommand)
2563 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2564 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2565 anObj.SetParameters(Parameters)
2566 self._autoPublish(anObj, theName, "wire")
2569 ## Create a sketcher (wire or face), following the textual description,
2570 # passed through <VAR>theCommand</VAR> argument. \n
2571 # For format of the description string see MakeSketcher() method.\n
2572 # @param theCommand String, defining the sketcher in local
2573 # coordinates of the working plane.
2574 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2575 # @param theName Object name; when specified, this parameter is used
2576 # for result publication in the study. Otherwise, if automatic
2577 # publication is switched on, default value is used for result name.
2579 # @return New GEOM.GEOM_Object, containing the created wire.
2581 # @ref tui_sketcher_page "Example"
2582 @ManageTransactions("CurvesOp")
2583 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2585 Create a sketcher (wire or face), following the textual description,
2586 passed through theCommand argument.
2587 For format of the description string see geompy.MakeSketcher() method.
2590 theCommand String, defining the sketcher in local
2591 coordinates of the working plane.
2592 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2593 theName Object name; when specified, this parameter is used
2594 for result publication in the study. Otherwise, if automatic
2595 publication is switched on, default value is used for result name.
2598 New GEOM.GEOM_Object, containing the created wire.
2600 theCommand,Parameters = ParseSketcherCommand(theCommand)
2601 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2602 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2603 anObj.SetParameters(Parameters)
2604 self._autoPublish(anObj, theName, "wire")
2607 ## Obtain a 2D sketcher interface
2608 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2609 def Sketcher2D (self):
2611 Obtain a 2D sketcher interface.
2614 sk = geompy.Sketcher2D()
2616 sk.addSegmentRelative(15, 70)
2617 sk.addSegmentPerpY(50)
2618 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2619 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2620 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2622 Sketch_1 = sk.wire(geomObj_1)
2624 sk = Sketcher2D (self)
2627 ## Create a sketcher wire, following the numerical description,
2628 # passed through <VAR>theCoordinates</VAR> argument. \n
2629 # @param theCoordinates double values, defining points to create a wire,
2631 # @param theName Object name; when specified, this parameter is used
2632 # for result publication in the study. Otherwise, if automatic
2633 # publication is switched on, default value is used for result name.
2635 # @return New GEOM.GEOM_Object, containing the created wire.
2637 # @ref tui_3dsketcher_page "Example"
2638 @ManageTransactions("CurvesOp")
2639 def Make3DSketcher(self, theCoordinates, theName=None):
2641 Create a sketcher wire, following the numerical description,
2642 passed through theCoordinates argument.
2645 theCoordinates double values, defining points to create a wire,
2647 theName Object name; when specified, this parameter is used
2648 for result publication in the study. Otherwise, if automatic
2649 publication is switched on, default value is used for result name.
2652 New GEOM_Object, containing the created wire.
2654 theCoordinates,Parameters = ParseParameters(theCoordinates)
2655 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2656 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2657 anObj.SetParameters(Parameters)
2658 self._autoPublish(anObj, theName, "wire")
2661 ## Obtain a 3D sketcher interface
2662 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2664 # @ref tui_3dsketcher_page "Example"
2665 def Sketcher3D (self):
2667 Obtain a 3D sketcher interface.
2670 sk = geompy.Sketcher3D()
2671 sk.addPointsAbsolute(0,0,0, 70,0,0)
2672 sk.addPointsRelative(0, 0, 130)
2673 sk.addPointAnglesLength("OXY", 50, 0, 100)
2674 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2676 a3D_Sketcher_1 = sk.wire()
2678 sk = Sketcher3D (self)
2681 ## Obtain a 2D polyline creation interface
2682 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2684 # @ref tui_3dsketcher_page "Example"
2685 def Polyline2D (self):
2687 Obtain a 2D polyline creation interface.
2690 pl = geompy.Polyline2D()
2691 pl.addSection("section 1", GEOM.Polyline, True)
2692 pl.addPoints(0, 0, 10, 0, 10, 10)
2693 pl.addSection("section 2", GEOM.Interpolation, False)
2694 pl.addPoints(20, 0, 30, 0, 30, 10)
2695 resultObj = pl.result(WorkingPlane)
2697 pl = Polyline2D (self)
2700 # end of l3_sketcher
2703 ## @addtogroup l3_3d_primitives
2706 ## Create a box by coordinates of two opposite vertices.
2708 # @param x1,y1,z1 double values, defining first point it.
2709 # @param x2,y2,z2 double values, defining first point it.
2710 # @param theName Object name; when specified, this parameter is used
2711 # for result publication in the study. Otherwise, if automatic
2712 # publication is switched on, default value is used for result name.
2714 # @return New GEOM.GEOM_Object, containing the created box.
2716 # @ref tui_creation_box "Example"
2717 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2719 Create a box by coordinates of two opposite vertices.
2722 x1,y1,z1 double values, defining first point.
2723 x2,y2,z2 double values, defining second point.
2724 theName Object name; when specified, this parameter is used
2725 for result publication in the study. Otherwise, if automatic
2726 publication is switched on, default value is used for result name.
2729 New GEOM.GEOM_Object, containing the created box.
2731 # Example: see GEOM_TestAll.py
2732 pnt1 = self.MakeVertex(x1,y1,z1)
2733 pnt2 = self.MakeVertex(x2,y2,z2)
2734 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2735 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2737 ## Create a box with specified dimensions along the coordinate axes
2738 # and with edges, parallel to the coordinate axes.
2739 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2740 # @param theDX Length of Box edges, parallel to OX axis.
2741 # @param theDY Length of Box edges, parallel to OY axis.
2742 # @param theDZ Length of Box edges, parallel to OZ axis.
2743 # @param theName Object name; when specified, this parameter is used
2744 # for result publication in the study. Otherwise, if automatic
2745 # publication is switched on, default value is used for result name.
2747 # @return New GEOM.GEOM_Object, containing the created box.
2749 # @ref tui_creation_box "Example"
2750 @ManageTransactions("PrimOp")
2751 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2753 Create a box with specified dimensions along the coordinate axes
2754 and with edges, parallel to the coordinate axes.
2755 Center of the box will be at point (DX/2, DY/2, DZ/2).
2758 theDX Length of Box edges, parallel to OX axis.
2759 theDY Length of Box edges, parallel to OY axis.
2760 theDZ Length of Box edges, parallel to OZ axis.
2761 theName Object name; when specified, this parameter is used
2762 for result publication in the study. Otherwise, if automatic
2763 publication is switched on, default value is used for result name.
2766 New GEOM.GEOM_Object, containing the created box.
2768 # Example: see GEOM_TestAll.py
2769 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2770 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2771 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2772 anObj.SetParameters(Parameters)
2773 self._autoPublish(anObj, theName, "box")
2776 ## Create a box with two specified opposite vertices,
2777 # and with edges, parallel to the coordinate axes
2778 # @param thePnt1 First of two opposite vertices.
2779 # @param thePnt2 Second of two opposite vertices.
2780 # @param theName Object name; when specified, this parameter is used
2781 # for result publication in the study. Otherwise, if automatic
2782 # publication is switched on, default value is used for result name.
2784 # @return New GEOM.GEOM_Object, containing the created box.
2786 # @ref tui_creation_box "Example"
2787 @ManageTransactions("PrimOp")
2788 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2790 Create a box with two specified opposite vertices,
2791 and with edges, parallel to the coordinate axes
2794 thePnt1 First of two opposite vertices.
2795 thePnt2 Second of two opposite vertices.
2796 theName Object name; when specified, this parameter is used
2797 for result publication in the study. Otherwise, if automatic
2798 publication is switched on, default value is used for result name.
2801 New GEOM.GEOM_Object, containing the created box.
2803 # Example: see GEOM_TestAll.py
2804 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2805 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2806 self._autoPublish(anObj, theName, "box")
2809 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2810 # @param theH height of Face.
2811 # @param theW width of Face.
2812 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2813 # @param theName Object name; when specified, this parameter is used
2814 # for result publication in the study. Otherwise, if automatic
2815 # publication is switched on, default value is used for result name.
2817 # @return New GEOM.GEOM_Object, containing the created face.
2819 # @ref tui_creation_face "Example"
2820 @ManageTransactions("PrimOp")
2821 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2823 Create a face with specified dimensions with edges parallel to coordinate axes.
2826 theH height of Face.
2828 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2829 theName Object name; when specified, this parameter is used
2830 for result publication in the study. Otherwise, if automatic
2831 publication is switched on, default value is used for result name.
2834 New GEOM.GEOM_Object, containing the created face.
2836 # Example: see GEOM_TestAll.py
2837 theH,theW,Parameters = ParseParameters(theH, theW)
2838 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2839 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2840 anObj.SetParameters(Parameters)
2841 self._autoPublish(anObj, theName, "rectangle")
2844 ## Create a face from another plane and two sizes,
2845 # vertical size and horisontal size.
2846 # @param theObj Normale vector to the creating face or
2848 # @param theH Height (vertical size).
2849 # @param theW Width (horisontal size).
2850 # @param theName Object name; when specified, this parameter is used
2851 # for result publication in the study. Otherwise, if automatic
2852 # publication is switched on, default value is used for result name.
2854 # @return New GEOM.GEOM_Object, containing the created face.
2856 # @ref tui_creation_face "Example"
2857 @ManageTransactions("PrimOp")
2858 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2860 Create a face from another plane and two sizes,
2861 vertical size and horisontal size.
2864 theObj Normale vector to the creating face or
2866 theH Height (vertical size).
2867 theW Width (horisontal size).
2868 theName Object name; when specified, this parameter is used
2869 for result publication in the study. Otherwise, if automatic
2870 publication is switched on, default value is used for result name.
2873 New GEOM_Object, containing the created face.
2875 # Example: see GEOM_TestAll.py
2876 theH,theW,Parameters = ParseParameters(theH, theW)
2877 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2878 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2879 anObj.SetParameters(Parameters)
2880 self._autoPublish(anObj, theName, "rectangle")
2883 ## Create a disk with given center, normal vector and radius.
2884 # @param thePnt Disk center.
2885 # @param theVec Vector, normal to the plane of the disk.
2886 # @param theR Disk radius.
2887 # @param theName Object name; when specified, this parameter is used
2888 # for result publication in the study. Otherwise, if automatic
2889 # publication is switched on, default value is used for result name.
2891 # @return New GEOM.GEOM_Object, containing the created disk.
2893 # @ref tui_creation_disk "Example"
2894 @ManageTransactions("PrimOp")
2895 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2897 Create a disk with given center, normal vector and radius.
2901 theVec Vector, normal to the plane of the disk.
2903 theName Object name; when specified, this parameter is used
2904 for result publication in the study. Otherwise, if automatic
2905 publication is switched on, default value is used for result name.
2908 New GEOM.GEOM_Object, containing the created disk.
2910 # Example: see GEOM_TestAll.py
2911 theR,Parameters = ParseParameters(theR)
2912 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2913 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2914 anObj.SetParameters(Parameters)
2915 self._autoPublish(anObj, theName, "disk")
2918 ## Create a disk, passing through three given points
2919 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2920 # @param theName Object name; when specified, this parameter is used
2921 # for result publication in the study. Otherwise, if automatic
2922 # publication is switched on, default value is used for result name.
2924 # @return New GEOM.GEOM_Object, containing the created disk.
2926 # @ref tui_creation_disk "Example"
2927 @ManageTransactions("PrimOp")
2928 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2930 Create a disk, passing through three given points
2933 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2934 theName Object name; when specified, this parameter is used
2935 for result publication in the study. Otherwise, if automatic
2936 publication is switched on, default value is used for result name.
2939 New GEOM.GEOM_Object, containing the created disk.
2941 # Example: see GEOM_TestAll.py
2942 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2943 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2944 self._autoPublish(anObj, theName, "disk")
2947 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2948 # @param theR Radius of Face.
2949 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2950 # @param theName Object name; when specified, this parameter is used
2951 # for result publication in the study. Otherwise, if automatic
2952 # publication is switched on, default value is used for result name.
2954 # @return New GEOM.GEOM_Object, containing the created disk.
2956 # @ref tui_creation_face "Example"
2957 @ManageTransactions("PrimOp")
2958 def MakeDiskR(self, theR, theOrientation, theName=None):
2960 Create a disk with specified dimensions along OX-OY coordinate axes.
2963 theR Radius of Face.
2964 theOrientation set the orientation belong axis OXY or OYZ or OZX
2965 theName Object name; when specified, this parameter is used
2966 for result publication in the study. Otherwise, if automatic
2967 publication is switched on, default value is used for result name.
2970 New GEOM.GEOM_Object, containing the created disk.
2973 Disk3 = geompy.MakeDiskR(100., 1)
2975 # Example: see GEOM_TestAll.py
2976 theR,Parameters = ParseParameters(theR)
2977 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2978 RaiseIfFailed("MakeDiskR", self.PrimOp)
2979 anObj.SetParameters(Parameters)
2980 self._autoPublish(anObj, theName, "disk")
2983 ## Create a cylinder with given base point, axis, radius and height.
2984 # @param thePnt Central point of cylinder base.
2985 # @param theAxis Cylinder axis.
2986 # @param theR Cylinder radius.
2987 # @param theH Cylinder height.
2988 # @param theName Object name; when specified, this parameter is used
2989 # for result publication in the study. Otherwise, if automatic
2990 # publication is switched on, default value is used for result name.
2992 # @return New GEOM.GEOM_Object, containing the created cylinder.
2994 # @ref tui_creation_cylinder "Example"
2995 @ManageTransactions("PrimOp")
2996 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2998 Create a cylinder with given base point, axis, radius and height.
3001 thePnt Central point of cylinder base.
3002 theAxis Cylinder axis.
3003 theR Cylinder radius.
3004 theH Cylinder height.
3005 theName Object name; when specified, this parameter is used
3006 for result publication in the study. Otherwise, if automatic
3007 publication is switched on, default value is used for result name.
3010 New GEOM.GEOM_Object, containing the created cylinder.
3012 # Example: see GEOM_TestAll.py
3013 theR,theH,Parameters = ParseParameters(theR, theH)
3014 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3015 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3016 anObj.SetParameters(Parameters)
3017 self._autoPublish(anObj, theName, "cylinder")
3020 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3021 # @param thePnt Central point of cylinder base.
3022 # @param theAxis Cylinder axis.
3023 # @param theR Cylinder radius.
3024 # @param theH Cylinder height.
3025 # @param theA Cylinder angle in radians.
3026 # @param theName Object name; when specified, this parameter is used
3027 # for result publication in the study. Otherwise, if automatic
3028 # publication is switched on, default value is used for result name.
3030 # @return New GEOM.GEOM_Object, containing the created cylinder.
3032 # @ref tui_creation_cylinder "Example"
3033 @ManageTransactions("PrimOp")
3034 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3036 Create a portion of cylinder with given base point, axis, radius, height and angle.
3039 thePnt Central point of cylinder base.
3040 theAxis Cylinder axis.
3041 theR Cylinder radius.
3042 theH Cylinder height.
3043 theA Cylinder angle in radians.
3044 theName Object name; when specified, this parameter is used
3045 for result publication in the study. Otherwise, if automatic
3046 publication is switched on, default value is used for result name.
3049 New GEOM.GEOM_Object, containing the created cylinder.
3051 # Example: see GEOM_TestAll.py
3053 if isinstance(theA,str):
3055 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3057 theA = theA*math.pi/180.
3058 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3059 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3060 anObj.SetParameters(Parameters)
3061 self._autoPublish(anObj, theName, "cylinder")
3064 ## Create a cylinder with given radius and height at
3065 # the origin of coordinate system. Axis of the cylinder
3066 # will be collinear to the OZ axis of the coordinate system.
3067 # @param theR Cylinder radius.
3068 # @param theH Cylinder height.
3069 # @param theName Object name; when specified, this parameter is used
3070 # for result publication in the study. Otherwise, if automatic
3071 # publication is switched on, default value is used for result name.
3073 # @return New GEOM.GEOM_Object, containing the created cylinder.
3075 # @ref tui_creation_cylinder "Example"
3076 @ManageTransactions("PrimOp")
3077 def MakeCylinderRH(self, theR, theH, theName=None):
3079 Create a cylinder with given radius and height at
3080 the origin of coordinate system. Axis of the cylinder
3081 will be collinear to the OZ axis of the coordinate system.
3084 theR Cylinder radius.
3085 theH Cylinder height.
3086 theName Object name; when specified, this parameter is used
3087 for result publication in the study. Otherwise, if automatic
3088 publication is switched on, default value is used for result name.
3091 New GEOM.GEOM_Object, containing the created cylinder.
3093 # Example: see GEOM_TestAll.py
3094 theR,theH,Parameters = ParseParameters(theR, theH)
3095 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3096 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3097 anObj.SetParameters(Parameters)
3098 self._autoPublish(anObj, theName, "cylinder")
3101 ## Create a portion of cylinder with given radius, height and angle at
3102 # the origin of coordinate system. Axis of the cylinder
3103 # will be collinear to the OZ axis of the coordinate system.
3104 # @param theR Cylinder radius.
3105 # @param theH Cylinder height.
3106 # @param theA Cylinder angle in radians.
3107 # @param theName Object name; when specified, this parameter is used
3108 # for result publication in the study. Otherwise, if automatic
3109 # publication is switched on, default value is used for result name.
3111 # @return New GEOM.GEOM_Object, containing the created cylinder.
3113 # @ref tui_creation_cylinder "Example"
3114 @ManageTransactions("PrimOp")
3115 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3117 Create a portion of cylinder with given radius, height and angle at
3118 the origin of coordinate system. Axis of the cylinder
3119 will be collinear to the OZ axis of the coordinate system.
3122 theR Cylinder radius.
3123 theH Cylinder height.
3124 theA Cylinder angle in radians.
3125 theName Object name; when specified, this parameter is used
3126 for result publication in the study. Otherwise, if automatic
3127 publication is switched on, default value is used for result name.
3130 New GEOM.GEOM_Object, containing the created cylinder.
3132 # Example: see GEOM_TestAll.py
3134 if isinstance(theA,str):
3136 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3138 theA = theA*math.pi/180.
3139 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3140 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3141 anObj.SetParameters(Parameters)
3142 self._autoPublish(anObj, theName, "cylinder")
3145 ## Create a sphere with given center and radius.
3146 # @param thePnt Sphere center.
3147 # @param theR Sphere radius.
3148 # @param theName Object name; when specified, this parameter is used
3149 # for result publication in the study. Otherwise, if automatic
3150 # publication is switched on, default value is used for result name.
3152 # @return New GEOM.GEOM_Object, containing the created sphere.
3154 # @ref tui_creation_sphere "Example"
3155 @ManageTransactions("PrimOp")
3156 def MakeSpherePntR(self, thePnt, theR, theName=None):
3158 Create a sphere with given center and radius.
3161 thePnt Sphere center.
3163 theName Object name; when specified, this parameter is used
3164 for result publication in the study. Otherwise, if automatic
3165 publication is switched on, default value is used for result name.
3168 New GEOM.GEOM_Object, containing the created sphere.
3170 # Example: see GEOM_TestAll.py
3171 theR,Parameters = ParseParameters(theR)
3172 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3173 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3174 anObj.SetParameters(Parameters)
3175 self._autoPublish(anObj, theName, "sphere")
3178 ## Create a sphere with given center and radius.
3179 # @param x,y,z Coordinates of sphere center.
3180 # @param theR Sphere radius.
3181 # @param theName Object name; when specified, this parameter is used
3182 # for result publication in the study. Otherwise, if automatic
3183 # publication is switched on, default value is used for result name.
3185 # @return New GEOM.GEOM_Object, containing the created sphere.
3187 # @ref tui_creation_sphere "Example"
3188 def MakeSphere(self, x, y, z, theR, theName=None):
3190 Create a sphere with given center and radius.
3193 x,y,z Coordinates of sphere center.
3195 theName Object name; when specified, this parameter is used
3196 for result publication in the study. Otherwise, if automatic
3197 publication is switched on, default value is used for result name.
3200 New GEOM.GEOM_Object, containing the created sphere.
3202 # Example: see GEOM_TestAll.py
3203 point = self.MakeVertex(x, y, z)
3204 # note: auto-publishing is done in self.MakeSpherePntR()
3205 anObj = self.MakeSpherePntR(point, theR, theName)
3208 ## Create a sphere with given radius at the origin of coordinate system.
3209 # @param theR Sphere radius.
3210 # @param theName Object name; when specified, this parameter is used
3211 # for result publication in the study. Otherwise, if automatic
3212 # publication is switched on, default value is used for result name.
3214 # @return New GEOM.GEOM_Object, containing the created sphere.
3216 # @ref tui_creation_sphere "Example"
3217 @ManageTransactions("PrimOp")
3218 def MakeSphereR(self, theR, theName=None):
3220 Create a sphere with given radius at the origin of coordinate system.
3224 theName Object name; when specified, this parameter is used
3225 for result publication in the study. Otherwise, if automatic
3226 publication is switched on, default value is used for result name.
3229 New GEOM.GEOM_Object, containing the created sphere.
3231 # Example: see GEOM_TestAll.py
3232 theR,Parameters = ParseParameters(theR)
3233 anObj = self.PrimOp.MakeSphereR(theR)
3234 RaiseIfFailed("MakeSphereR", self.PrimOp)
3235 anObj.SetParameters(Parameters)
3236 self._autoPublish(anObj, theName, "sphere")
3239 ## Create a cone with given base point, axis, height and radiuses.
3240 # @param thePnt Central point of the first cone base.
3241 # @param theAxis Cone axis.
3242 # @param theR1 Radius of the first cone base.
3243 # @param theR2 Radius of the second cone base.
3244 # \note If both radiuses are non-zero, the cone will be truncated.
3245 # \note If the radiuses are equal, a cylinder will be created instead.
3246 # @param theH Cone height.
3247 # @param theName Object name; when specified, this parameter is used
3248 # for result publication in the study. Otherwise, if automatic
3249 # publication is switched on, default value is used for result name.
3251 # @return New GEOM.GEOM_Object, containing the created cone.
3253 # @ref tui_creation_cone "Example"
3254 @ManageTransactions("PrimOp")
3255 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3257 Create a cone with given base point, axis, height and radiuses.
3260 thePnt Central point of the first cone base.
3262 theR1 Radius of the first cone base.
3263 theR2 Radius of the second cone base.
3265 theName Object name; when specified, this parameter is used
3266 for result publication in the study. Otherwise, if automatic
3267 publication is switched on, default value is used for result name.
3270 If both radiuses are non-zero, the cone will be truncated.
3271 If the radiuses are equal, a cylinder will be created instead.
3274 New GEOM.GEOM_Object, containing the created cone.
3276 # Example: see GEOM_TestAll.py
3277 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3278 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3279 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3280 anObj.SetParameters(Parameters)
3281 self._autoPublish(anObj, theName, "cone")
3284 ## Create a cone with given height and radiuses at
3285 # the origin of coordinate system. Axis of the cone will
3286 # be collinear to the OZ axis of the coordinate system.
3287 # @param theR1 Radius of the first cone base.
3288 # @param theR2 Radius of the second cone base.
3289 # \note If both radiuses are non-zero, the cone will be truncated.
3290 # \note If the radiuses are equal, a cylinder will be created instead.
3291 # @param theH Cone height.
3292 # @param theName Object name; when specified, this parameter is used
3293 # for result publication in the study. Otherwise, if automatic
3294 # publication is switched on, default value is used for result name.
3296 # @return New GEOM.GEOM_Object, containing the created cone.
3298 # @ref tui_creation_cone "Example"
3299 @ManageTransactions("PrimOp")
3300 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3302 Create a cone with given height and radiuses at
3303 the origin of coordinate system. Axis of the cone will
3304 be collinear to the OZ axis of the coordinate system.
3307 theR1 Radius of the first cone base.
3308 theR2 Radius of the second cone base.
3310 theName Object name; when specified, this parameter is used
3311 for result publication in the study. Otherwise, if automatic
3312 publication is switched on, default value is used for result name.
3315 If both radiuses are non-zero, the cone will be truncated.
3316 If the radiuses are equal, a cylinder will be created instead.
3319 New GEOM.GEOM_Object, containing the created cone.
3321 # Example: see GEOM_TestAll.py
3322 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3323 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3324 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3325 anObj.SetParameters(Parameters)
3326 self._autoPublish(anObj, theName, "cone")
3329 ## Create a torus with given center, normal vector and radiuses.
3330 # @param thePnt Torus central point.
3331 # @param theVec Torus axis of symmetry.
3332 # @param theRMajor Torus major radius.
3333 # @param theRMinor Torus minor radius.
3334 # @param theName Object name; when specified, this parameter is used
3335 # for result publication in the study. Otherwise, if automatic
3336 # publication is switched on, default value is used for result name.
3338 # @return New GEOM.GEOM_Object, containing the created torus.
3340 # @ref tui_creation_torus "Example"
3341 @ManageTransactions("PrimOp")
3342 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3344 Create a torus with given center, normal vector and radiuses.
3347 thePnt Torus central point.
3348 theVec Torus axis of symmetry.
3349 theRMajor Torus major radius.
3350 theRMinor Torus minor radius.
3351 theName Object name; when specified, this parameter is used
3352 for result publication in the study. Otherwise, if automatic
3353 publication is switched on, default value is used for result name.
3356 New GEOM.GEOM_Object, containing the created torus.
3358 # Example: see GEOM_TestAll.py
3359 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3360 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3361 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3362 anObj.SetParameters(Parameters)
3363 self._autoPublish(anObj, theName, "torus")
3366 ## Create a torus with given radiuses at the origin of coordinate system.
3367 # @param theRMajor Torus major radius.
3368 # @param theRMinor Torus minor radius.
3369 # @param theName Object name; when specified, this parameter is used
3370 # for result publication in the study. Otherwise, if automatic
3371 # publication is switched on, default value is used for result name.
3373 # @return New GEOM.GEOM_Object, containing the created torus.
3375 # @ref tui_creation_torus "Example"
3376 @ManageTransactions("PrimOp")
3377 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3379 Create a torus with given radiuses at the origin of coordinate system.
3382 theRMajor Torus major radius.
3383 theRMinor Torus minor radius.
3384 theName Object name; when specified, this parameter is used
3385 for result publication in the study. Otherwise, if automatic
3386 publication is switched on, default value is used for result name.
3389 New GEOM.GEOM_Object, containing the created torus.
3391 # Example: see GEOM_TestAll.py
3392 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3393 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3394 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3395 anObj.SetParameters(Parameters)
3396 self._autoPublish(anObj, theName, "torus")
3399 # end of l3_3d_primitives
3402 ## @addtogroup l3_complex
3405 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3406 # @param theBase Base shape to be extruded.
3407 # @param thePoint1 First end of extrusion vector.
3408 # @param thePoint2 Second end of extrusion vector.
3409 # @param theScaleFactor Use it to make prism with scaled second base.
3410 # Nagative value means not scaled second base.
3411 # @param theName Object name; when specified, this parameter is used
3412 # for result publication in the study. Otherwise, if automatic
3413 # publication is switched on, default value is used for result name.
3415 # @return New GEOM.GEOM_Object, containing the created prism.
3417 # @ref tui_creation_prism "Example"
3418 @ManageTransactions("PrimOp")
3419 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3421 Create a shape by extrusion of the base shape along a vector, defined by two points.
3424 theBase Base shape to be extruded.
3425 thePoint1 First end of extrusion vector.
3426 thePoint2 Second end of extrusion vector.
3427 theScaleFactor Use it to make prism with scaled second base.
3428 Nagative value means not scaled second base.
3429 theName Object name; when specified, this parameter is used
3430 for result publication in the study. Otherwise, if automatic
3431 publication is switched on, default value is used for result name.
3434 New GEOM.GEOM_Object, containing the created prism.
3436 # Example: see GEOM_TestAll.py
3439 if theScaleFactor > 0:
3440 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3441 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3443 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3444 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3445 anObj.SetParameters(Parameters)
3446 self._autoPublish(anObj, theName, "prism")
3449 ## Create a shape by extrusion of the base shape along a
3450 # vector, defined by two points, in 2 Ways (forward/backward).
3451 # @param theBase Base shape to be extruded.
3452 # @param thePoint1 First end of extrusion vector.
3453 # @param thePoint2 Second end of extrusion vector.
3454 # @param theName Object name; when specified, this parameter is used
3455 # for result publication in the study. Otherwise, if automatic
3456 # publication is switched on, default value is used for result name.
3458 # @return New GEOM.GEOM_Object, containing the created prism.
3460 # @ref tui_creation_prism "Example"
3461 @ManageTransactions("PrimOp")
3462 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3464 Create a shape by extrusion of the base shape along a
3465 vector, defined by two points, in 2 Ways (forward/backward).
3468 theBase Base shape to be extruded.
3469 thePoint1 First end of extrusion vector.
3470 thePoint2 Second end of extrusion vector.
3471 theName Object name; when specified, this parameter is used
3472 for result publication in the study. Otherwise, if automatic
3473 publication is switched on, default value is used for result name.
3476 New GEOM.GEOM_Object, containing the created prism.
3478 # Example: see GEOM_TestAll.py
3479 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3480 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3481 self._autoPublish(anObj, theName, "prism")
3484 ## Create a shape by extrusion of the base shape along the vector,
3485 # i.e. all the space, transfixed by the base shape during its translation
3486 # along the vector on the given distance.
3487 # @param theBase Base shape to be extruded.
3488 # @param theVec Direction of extrusion.
3489 # @param theH Prism dimension along theVec.
3490 # @param theScaleFactor Use it to make prism with scaled second base.
3491 # Negative value means not scaled second base.
3492 # @param theName Object name; when specified, this parameter is used
3493 # for result publication in the study. Otherwise, if automatic
3494 # publication is switched on, default value is used for result name.
3496 # @return New GEOM.GEOM_Object, containing the created prism.
3498 # @ref tui_creation_prism "Example"
3499 @ManageTransactions("PrimOp")
3500 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3502 Create a shape by extrusion of the base shape along the vector,
3503 i.e. all the space, transfixed by the base shape during its translation
3504 along the vector on the given distance.
3507 theBase Base shape to be extruded.
3508 theVec Direction of extrusion.
3509 theH Prism dimension along theVec.
3510 theScaleFactor Use it to make prism with scaled second base.
3511 Negative value means not scaled second base.
3512 theName Object name; when specified, this parameter is used
3513 for result publication in the study. Otherwise, if automatic
3514 publication is switched on, default value is used for result name.
3517 New GEOM.GEOM_Object, containing the created prism.
3519 # Example: see GEOM_TestAll.py
3522 if theScaleFactor > 0:
3523 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3524 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3526 theH,Parameters = ParseParameters(theH)
3527 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3528 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3529 anObj.SetParameters(Parameters)
3530 self._autoPublish(anObj, theName, "prism")
3533 ## Create a shape by extrusion of the base shape along the vector,
3534 # i.e. all the space, transfixed by the base shape during its translation
3535 # along the vector on the given distance in 2 Ways (forward/backward).
3536 # @param theBase Base shape to be extruded.
3537 # @param theVec Direction of extrusion.
3538 # @param theH Prism dimension along theVec in forward direction.
3539 # @param theName Object name; when specified, this parameter is used
3540 # for result publication in the study. Otherwise, if automatic
3541 # publication is switched on, default value is used for result name.
3543 # @return New GEOM.GEOM_Object, containing the created prism.
3545 # @ref tui_creation_prism "Example"
3546 @ManageTransactions("PrimOp")
3547 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3549 Create a shape by extrusion of the base shape along the vector,
3550 i.e. all the space, transfixed by the base shape during its translation
3551 along the vector on the given distance in 2 Ways (forward/backward).
3554 theBase Base shape to be extruded.
3555 theVec Direction of extrusion.
3556 theH Prism dimension along theVec in forward direction.
3557 theName Object name; when specified, this parameter is used
3558 for result publication in the study. Otherwise, if automatic
3559 publication is switched on, default value is used for result name.
3562 New GEOM.GEOM_Object, containing the created prism.
3564 # Example: see GEOM_TestAll.py
3565 theH,Parameters = ParseParameters(theH)
3566 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3567 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3568 anObj.SetParameters(Parameters)
3569 self._autoPublish(anObj, theName, "prism")
3572 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3573 # @param theBase Base shape to be extruded.
3574 # @param theDX, theDY, theDZ Directions of extrusion.
3575 # @param theScaleFactor Use it to make prism with scaled second base.
3576 # Nagative value means not scaled second base.
3577 # @param theName Object name; when specified, this parameter is used
3578 # for result publication in the study. Otherwise, if automatic
3579 # publication is switched on, default value is used for result name.
3581 # @return New GEOM.GEOM_Object, containing the created prism.
3583 # @ref tui_creation_prism "Example"
3584 @ManageTransactions("PrimOp")
3585 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3587 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3590 theBase Base shape to be extruded.
3591 theDX, theDY, theDZ Directions of extrusion.
3592 theScaleFactor Use it to make prism with scaled second base.
3593 Nagative value means not scaled second base.
3594 theName Object name; when specified, this parameter is used
3595 for result publication in the study. Otherwise, if automatic
3596 publication is switched on, default value is used for result name.
3599 New GEOM.GEOM_Object, containing the created prism.
3601 # Example: see GEOM_TestAll.py
3604 if theScaleFactor > 0:
3605 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3606 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3608 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3609 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3610 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3611 anObj.SetParameters(Parameters)
3612 self._autoPublish(anObj, theName, "prism")
3615 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3616 # i.e. all the space, transfixed by the base shape during its translation
3617 # along the vector on the given distance in 2 Ways (forward/backward).
3618 # @param theBase Base shape to be extruded.
3619 # @param theDX, theDY, theDZ Directions of extrusion.
3620 # @param theName Object name; when specified, this parameter is used
3621 # for result publication in the study. Otherwise, if automatic
3622 # publication is switched on, default value is used for result name.
3624 # @return New GEOM.GEOM_Object, containing the created prism.
3626 # @ref tui_creation_prism "Example"
3627 @ManageTransactions("PrimOp")
3628 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3630 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3631 i.e. all the space, transfixed by the base shape during its translation
3632 along the vector on the given distance in 2 Ways (forward/backward).
3635 theBase Base shape to be extruded.
3636 theDX, theDY, theDZ Directions of extrusion.
3637 theName Object name; when specified, this parameter is used
3638 for result publication in the study. Otherwise, if automatic
3639 publication is switched on, default value is used for result name.
3642 New GEOM.GEOM_Object, containing the created prism.
3644 # Example: see GEOM_TestAll.py
3645 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3646 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3647 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3648 anObj.SetParameters(Parameters)
3649 self._autoPublish(anObj, theName, "prism")
3652 ## Create a shape by revolution of the base shape around the axis
3653 # on the given angle, i.e. all the space, transfixed by the base
3654 # shape during its rotation around the axis on the given angle.
3655 # @param theBase Base shape to be rotated.
3656 # @param theAxis Rotation axis.
3657 # @param theAngle Rotation angle in radians.
3658 # @param theName Object name; when specified, this parameter is used
3659 # for result publication in the study. Otherwise, if automatic
3660 # publication is switched on, default value is used for result name.
3662 # @return New GEOM.GEOM_Object, containing the created revolution.
3664 # @ref tui_creation_revolution "Example"
3665 @ManageTransactions("PrimOp")
3666 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3668 Create a shape by revolution of the base shape around the axis
3669 on the given angle, i.e. all the space, transfixed by the base
3670 shape during its rotation around the axis on the given angle.
3673 theBase Base shape to be rotated.
3674 theAxis Rotation axis.
3675 theAngle Rotation angle in radians.
3676 theName Object name; when specified, this parameter is used
3677 for result publication in the study. Otherwise, if automatic
3678 publication is switched on, default value is used for result name.
3681 New GEOM.GEOM_Object, containing the created revolution.
3683 # Example: see GEOM_TestAll.py
3684 theAngle,Parameters = ParseParameters(theAngle)
3685 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3686 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3687 anObj.SetParameters(Parameters)
3688 self._autoPublish(anObj, theName, "revolution")
3691 ## Create a shape by revolution of the base shape around the axis
3692 # on the given angle, i.e. all the space, transfixed by the base
3693 # shape during its rotation around the axis on the given angle in
3694 # both directions (forward/backward)
3695 # @param theBase Base shape to be rotated.
3696 # @param theAxis Rotation axis.
3697 # @param theAngle Rotation angle in radians.
3698 # @param theName Object name; when specified, this parameter is used
3699 # for result publication in the study. Otherwise, if automatic
3700 # publication is switched on, default value is used for result name.
3702 # @return New GEOM.GEOM_Object, containing the created revolution.
3704 # @ref tui_creation_revolution "Example"
3705 @ManageTransactions("PrimOp")
3706 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3708 Create a shape by revolution of the base shape around the axis
3709 on the given angle, i.e. all the space, transfixed by the base
3710 shape during its rotation around the axis on the given angle in
3711 both directions (forward/backward).
3714 theBase Base shape to be rotated.
3715 theAxis Rotation axis.
3716 theAngle Rotation angle in radians.
3717 theName Object name; when specified, this parameter is used
3718 for result publication in the study. Otherwise, if automatic
3719 publication is switched on, default value is used for result name.
3722 New GEOM.GEOM_Object, containing the created revolution.
3724 theAngle,Parameters = ParseParameters(theAngle)
3725 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3726 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3727 anObj.SetParameters(Parameters)
3728 self._autoPublish(anObj, theName, "revolution")
3731 ## Create a face from a given set of contours.
3732 # @param theContours either a list or a compound of edges/wires.
3733 # @param theMinDeg a minimal degree of BSpline surface to create.
3734 # @param theMaxDeg a maximal degree of BSpline surface to create.
3735 # @param theTol2D a 2d tolerance to be reached.
3736 # @param theTol3D a 3d tolerance to be reached.
3737 # @param theNbIter a number of iteration of approximation algorithm.
3738 # @param theMethod Kind of method to perform filling operation
3739 # (see GEOM.filling_oper_method enum).
3740 # @param isApprox if True, BSpline curves are generated in the process
3741 # of surface construction. By default it is False, that means
3742 # the surface is created using given curves. The usage of
3743 # Approximation makes the algorithm work slower, but allows
3744 # building the surface for rather complex cases.
3745 # @param theName Object name; when specified, this parameter is used
3746 # for result publication in the study. Otherwise, if automatic
3747 # publication is switched on, default value is used for result name.
3749 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3751 # @ref tui_creation_filling "Example"
3752 @ManageTransactions("PrimOp")
3753 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3754 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3756 Create a face from a given set of contours.
3759 theContours either a list or a compound of edges/wires.
3760 theMinDeg a minimal degree of BSpline surface to create.
3761 theMaxDeg a maximal degree of BSpline surface to create.
3762 theTol2D a 2d tolerance to be reached.
3763 theTol3D a 3d tolerance to be reached.
3764 theNbIter a number of iteration of approximation algorithm.
3765 theMethod Kind of method to perform filling operation
3766 (see GEOM.filling_oper_method enum).
3767 isApprox if True, BSpline curves are generated in the process
3768 of surface construction. By default it is False, that means
3769 the surface is created using given curves. The usage of
3770 Approximation makes the algorithm work slower, but allows
3771 building the surface for rather complex cases.
3772 theName Object name; when specified, this parameter is used
3773 for result publication in the study. Otherwise, if automatic
3774 publication is switched on, default value is used for result name.
3777 New GEOM.GEOM_Object (face), containing the created filling surface.
3780 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3782 # Example: see GEOM_TestAll.py
3783 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3784 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3785 theTol2D, theTol3D, theNbIter,
3786 theMethod, isApprox)
3787 RaiseIfFailed("MakeFilling", self.PrimOp)
3788 anObj.SetParameters(Parameters)
3789 self._autoPublish(anObj, theName, "filling")
3793 ## Create a face from a given set of contours.
3794 # This method corresponds to MakeFilling() with isApprox=True.
3795 # @param theContours either a list or a compound of edges/wires.
3796 # @param theMinDeg a minimal degree of BSpline surface to create.
3797 # @param theMaxDeg a maximal degree of BSpline surface to create.
3798 # @param theTol3D a 3d tolerance to be reached.
3799 # @param theName Object name; when specified, this parameter is used
3800 # for result publication in the study. Otherwise, if automatic
3801 # publication is switched on, default value is used for result name.
3803 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3805 # @ref tui_creation_filling "Example"
3806 @ManageTransactions("PrimOp")
3807 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3809 Create a filling from the given compound of contours.
3810 This method corresponds to MakeFilling() with isApprox=True.
3813 theContours either a list or a compound of edges/wires.
3814 theMinDeg a minimal degree of BSpline surface to create.
3815 theMaxDeg a maximal degree of BSpline surface to create.
3816 theTol3D a 3d tolerance to be reached.
3817 theName Object name; when specified, this parameter is used
3818 for result publication in the study. Otherwise, if automatic
3819 publication is switched on, default value is used for result name.
3822 New GEOM.GEOM_Object (face), containing the created filling surface.
3825 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3827 # Example: see GEOM_TestAll.py
3828 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3829 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3830 0, theTol3D, 0, GEOM.FOM_Default, True)
3831 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3832 anObj.SetParameters(Parameters)
3833 self._autoPublish(anObj, theName, "filling")
3836 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3837 # @param theSeqSections - set of specified sections.
3838 # @param theModeSolid - mode defining building solid or shell
3839 # @param thePreci - precision 3D used for smoothing
3840 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3841 # @param theName Object name; when specified, this parameter is used
3842 # for result publication in the study. Otherwise, if automatic
3843 # publication is switched on, default value is used for result name.
3845 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3847 # @ref swig_todo "Example"
3848 @ManageTransactions("PrimOp")
3849 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3851 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3854 theSeqSections - set of specified sections.
3855 theModeSolid - mode defining building solid or shell
3856 thePreci - precision 3D used for smoothing
3857 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3858 theName Object name; when specified, this parameter is used
3859 for result publication in the study. Otherwise, if automatic
3860 publication is switched on, default value is used for result name.
3863 New GEOM.GEOM_Object, containing the created shell or solid.
3865 # Example: see GEOM_TestAll.py
3866 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3867 RaiseIfFailed("MakeThruSections", self.PrimOp)
3868 self._autoPublish(anObj, theName, "filling")
3871 ## Create a shape by extrusion of the base shape along
3872 # the path shape. The path shape can be a wire or an edge.
3873 # @param theBase Base shape to be extruded.
3874 # @param thePath Path shape to extrude the base shape along it.
3875 # @param theName Object name; when specified, this parameter is used
3876 # for result publication in the study. Otherwise, if automatic
3877 # publication is switched on, default value is used for result name.
3879 # @return New GEOM.GEOM_Object, containing the created pipe.
3881 # @ref tui_creation_pipe "Example"
3882 @ManageTransactions("PrimOp")
3883 def MakePipe(self, theBase, thePath, theName=None):
3885 Create a shape by extrusion of the base shape along
3886 the path shape. The path shape can be a wire or an edge.
3889 theBase Base shape to be extruded.
3890 thePath Path shape to extrude the base shape along it.
3891 theName Object name; when specified, this parameter is used
3892 for result publication in the study. Otherwise, if automatic
3893 publication is switched on, default value is used for result name.
3896 New GEOM.GEOM_Object, containing the created pipe.
3898 # Example: see GEOM_TestAll.py
3899 anObj = self.PrimOp.MakePipe(theBase, thePath)
3900 RaiseIfFailed("MakePipe", self.PrimOp)
3901 self._autoPublish(anObj, theName, "pipe")
3904 ## Create a shape by extrusion of the profile shape along
3905 # the path shape. The path shape can be a wire or an edge.
3906 # the several profiles can be specified in the several locations of path.
3907 # @param theSeqBases - list of Bases shape to be extruded.
3908 # @param theLocations - list of locations on the path corresponding
3909 # specified list of the Bases shapes. Number of locations
3910 # should be equal to number of bases or list of locations can be empty.
3911 # @param thePath - Path shape to extrude the base shape along it.
3912 # @param theWithContact - the mode defining that the section is translated to be in
3913 # contact with the spine.
3914 # @param theWithCorrection - defining that the section is rotated to be
3915 # orthogonal to the spine tangent in the correspondent point
3916 # @param theName Object name; when specified, this parameter is used
3917 # for result publication in the study. Otherwise, if automatic
3918 # publication is switched on, default value is used for result name.
3920 # @return New GEOM.GEOM_Object, containing the created pipe.
3922 # @ref tui_creation_pipe_with_diff_sec "Example"
3923 @ManageTransactions("PrimOp")
3924 def MakePipeWithDifferentSections(self, theSeqBases,
3925 theLocations, thePath,
3926 theWithContact, theWithCorrection, theName=None):
3928 Create a shape by extrusion of the profile shape along
3929 the path shape. The path shape can be a wire or an edge.
3930 the several profiles can be specified in the several locations of path.
3933 theSeqBases - list of Bases shape to be extruded.
3934 theLocations - list of locations on the path corresponding
3935 specified list of the Bases shapes. Number of locations
3936 should be equal to number of bases or list of locations can be empty.
3937 thePath - Path shape to extrude the base shape along it.
3938 theWithContact - the mode defining that the section is translated to be in
3939 contact with the spine(0/1)
3940 theWithCorrection - defining that the section is rotated to be
3941 orthogonal to the spine tangent in the correspondent point (0/1)
3942 theName Object name; when specified, this parameter is used
3943 for result publication in the study. Otherwise, if automatic
3944 publication is switched on, default value is used for result name.
3947 New GEOM.GEOM_Object, containing the created pipe.
3949 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3950 theLocations, thePath,
3951 theWithContact, theWithCorrection)
3952 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3953 self._autoPublish(anObj, theName, "pipe")
3956 ## Create a shape by extrusion of the profile shape along
3957 # the path shape. The path shape can be a wire or a edge.
3958 # the several profiles can be specified in the several locations of path.
3959 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3960 # shell or face. If number of faces in neighbour sections
3961 # aren't coincided result solid between such sections will
3962 # be created using external boundaries of this shells.
3963 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3964 # This list is used for searching correspondences between
3965 # faces in the sections. Size of this list must be equal
3966 # to size of list of base shapes.
3967 # @param theLocations - list of locations on the path corresponding
3968 # specified list of the Bases shapes. Number of locations
3969 # should be equal to number of bases. First and last
3970 # locations must be coincided with first and last vertexes
3971 # of path correspondingly.
3972 # @param thePath - Path shape to extrude the base shape along it.
3973 # @param theWithContact - the mode defining that the section is translated to be in
3974 # contact with the spine.
3975 # @param theWithCorrection - defining that the section is rotated to be
3976 # orthogonal to the spine tangent in the correspondent point
3977 # @param theName Object name; when specified, this parameter is used
3978 # for result publication in the study. Otherwise, if automatic
3979 # publication is switched on, default value is used for result name.
3981 # @return New GEOM.GEOM_Object, containing the created solids.
3983 # @ref tui_creation_pipe_with_shell_sec "Example"
3984 @ManageTransactions("PrimOp")
3985 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3986 theLocations, thePath,
3987 theWithContact, theWithCorrection, theName=None):
3989 Create a shape by extrusion of the profile shape along
3990 the path shape. The path shape can be a wire or a edge.
3991 the several profiles can be specified in the several locations of path.
3994 theSeqBases - list of Bases shape to be extruded. Base shape must be
3995 shell or face. If number of faces in neighbour sections
3996 aren't coincided result solid between such sections will
3997 be created using external boundaries of this shells.
3998 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3999 This list is used for searching correspondences between
4000 faces in the sections. Size of this list must be equal
4001 to size of list of base shapes.
4002 theLocations - list of locations on the path corresponding
4003 specified list of the Bases shapes. Number of locations
4004 should be equal to number of bases. First and last
4005 locations must be coincided with first and last vertexes
4006 of path correspondingly.
4007 thePath - Path shape to extrude the base shape along it.
4008 theWithContact - the mode defining that the section is translated to be in
4009 contact with the spine (0/1)
4010 theWithCorrection - defining that the section is rotated to be
4011 orthogonal to the spine tangent in the correspondent point (0/1)
4012 theName Object name; when specified, this parameter is used
4013 for result publication in the study. Otherwise, if automatic
4014 publication is switched on, default value is used for result name.
4017 New GEOM.GEOM_Object, containing the created solids.
4019 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4020 theLocations, thePath,
4021 theWithContact, theWithCorrection)
4022 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4023 self._autoPublish(anObj, theName, "pipe")
4026 ## Create a shape by extrusion of the profile shape along
4027 # the path shape. This function is used only for debug pipe
4028 # functionality - it is a version of function MakePipeWithShellSections()
4029 # which give a possibility to recieve information about
4030 # creating pipe between each pair of sections step by step.
4031 @ManageTransactions("PrimOp")
4032 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4033 theLocations, thePath,
4034 theWithContact, theWithCorrection, theName=None):
4036 Create a shape by extrusion of the profile shape along
4037 the path shape. This function is used only for debug pipe
4038 functionality - it is a version of previous function
4039 geompy.MakePipeWithShellSections() which give a possibility to
4040 recieve information about creating pipe between each pair of
4041 sections step by step.
4044 nbsect = len(theSeqBases)
4045 nbsubsect = len(theSeqSubBases)
4046 #print "nbsect = ",nbsect
4047 for i in range(1,nbsect):
4049 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4050 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4052 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4053 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4054 tmpLocations, thePath,
4055 theWithContact, theWithCorrection)
4056 if self.PrimOp.IsDone() == 0:
4057 print "Problems with pipe creation between ",i," and ",i+1," sections"
4058 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4061 print "Pipe between ",i," and ",i+1," sections is OK"
4066 resc = self.MakeCompound(res)
4067 #resc = self.MakeSewing(res, 0.001)
4068 #print "resc: ",resc
4069 self._autoPublish(resc, theName, "pipe")
4072 ## Create solids between given sections
4073 # @param theSeqBases - list of sections (shell or face).
4074 # @param theLocations - list of corresponding vertexes
4075 # @param theName Object name; when specified, this parameter is used
4076 # for result publication in the study. Otherwise, if automatic
4077 # publication is switched on, default value is used for result name.
4079 # @return New GEOM.GEOM_Object, containing the created solids.
4081 # @ref tui_creation_pipe_without_path "Example"
4082 @ManageTransactions("PrimOp")
4083 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
4085 Create solids between given sections
4088 theSeqBases - list of sections (shell or face).
4089 theLocations - list of corresponding vertexes
4090 theName Object name; when specified, this parameter is used
4091 for result publication in the study. Otherwise, if automatic
4092 publication is switched on, default value is used for result name.
4095 New GEOM.GEOM_Object, containing the created solids.
4097 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
4098 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4099 self._autoPublish(anObj, theName, "pipe")
4102 ## Create a shape by extrusion of the base shape along
4103 # the path shape with constant bi-normal direction along the given vector.
4104 # The path shape can be a wire or an edge.
4105 # @param theBase Base shape to be extruded.
4106 # @param thePath Path shape to extrude the base shape along it.
4107 # @param theVec Vector defines a constant binormal direction to keep the
4108 # same angle beetween the direction and the sections
4109 # along the sweep surface.
4110 # @param theName Object name; when specified, this parameter is used
4111 # for result publication in the study. Otherwise, if automatic
4112 # publication is switched on, default value is used for result name.
4114 # @return New GEOM.GEOM_Object, containing the created pipe.
4116 # @ref tui_creation_pipe "Example"
4117 @ManageTransactions("PrimOp")
4118 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
4120 Create a shape by extrusion of the base shape along
4121 the path shape with constant bi-normal direction along the given vector.
4122 The path shape can be a wire or an edge.
4125 theBase Base shape to be extruded.
4126 thePath Path shape to extrude the base shape along it.
4127 theVec Vector defines a constant binormal direction to keep the
4128 same angle beetween the direction and the sections
4129 along the sweep surface.
4130 theName Object name; when specified, this parameter is used
4131 for result publication in the study. Otherwise, if automatic
4132 publication is switched on, default value is used for result name.
4135 New GEOM.GEOM_Object, containing the created pipe.
4137 # Example: see GEOM_TestAll.py
4138 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
4139 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4140 self._autoPublish(anObj, theName, "pipe")
4143 ## Makes a thick solid from a face or a shell
4144 # @param theShape Face or Shell to be thicken
4145 # @param theThickness Thickness of the resulting solid
4146 # @param theName Object name; when specified, this parameter is used
4147 # for result publication in the study. Otherwise, if automatic
4148 # publication is switched on, default value is used for result name.
4150 # @return New GEOM.GEOM_Object, containing the created solid
4152 @ManageTransactions("PrimOp")
4153 def MakeThickSolid(self, theShape, theThickness, theName=None):
4155 Make a thick solid from a face or a shell
4158 theShape Face or Shell to be thicken
4159 theThickness Thickness of the resulting solid
4160 theName Object name; when specified, this parameter is used
4161 for result publication in the study. Otherwise, if automatic
4162 publication is switched on, default value is used for result name.
4165 New GEOM.GEOM_Object, containing the created solid
4167 # Example: see GEOM_TestAll.py
4168 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
4169 RaiseIfFailed("MakeThickening", self.PrimOp)
4170 self._autoPublish(anObj, theName, "pipe")
4174 ## Modifies a face or a shell to make it a thick solid
4175 # @param theShape Face or Shell to be thicken
4176 # @param theThickness Thickness of the resulting solid
4178 # @return The modified shape
4180 @ManageTransactions("PrimOp")
4181 def Thicken(self, theShape, theThickness):
4183 Modifies a face or a shell to make it a thick solid
4186 theBase Base shape to be extruded.
4187 thePath Path shape to extrude the base shape along it.
4188 theName Object name; when specified, this parameter is used
4189 for result publication in the study. Otherwise, if automatic
4190 publication is switched on, default value is used for result name.
4195 # Example: see GEOM_TestAll.py
4196 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
4197 RaiseIfFailed("MakeThickening", self.PrimOp)
4200 ## Build a middle path of a pipe-like shape.
4201 # The path shape can be a wire or an edge.
4202 # @param theShape It can be closed or unclosed pipe-like shell
4203 # or a pipe-like solid.
4204 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4205 # should be wires or faces of theShape.
4206 # @param theName Object name; when specified, this parameter is used
4207 # for result publication in the study. Otherwise, if automatic
4208 # publication is switched on, default value is used for result name.
4210 # @note It is not assumed that exact or approximate copy of theShape
4211 # can be obtained by applying existing Pipe operation on the
4212 # resulting "Path" wire taking theBase1 as the base - it is not
4213 # always possible; though in some particular cases it might work
4214 # it is not guaranteed. Thus, RestorePath function should not be
4215 # considered as an exact reverse operation of the Pipe.
4217 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4218 # source pipe's "path".
4220 # @ref tui_creation_pipe_path "Example"
4221 @ManageTransactions("PrimOp")
4222 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4224 Build a middle path of a pipe-like shape.
4225 The path shape can be a wire or an edge.
4228 theShape It can be closed or unclosed pipe-like shell
4229 or a pipe-like solid.
4230 theBase1, theBase2 Two bases of the supposed pipe. This
4231 should be wires or faces of theShape.
4232 theName Object name; when specified, this parameter is used
4233 for result publication in the study. Otherwise, if automatic
4234 publication is switched on, default value is used for result name.
4237 New GEOM_Object, containing an edge or wire that represent
4240 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4241 RaiseIfFailed("RestorePath", self.PrimOp)
4242 self._autoPublish(anObj, theName, "path")
4245 ## Build a middle path of a pipe-like shape.
4246 # The path shape can be a wire or an edge.
4247 # @param theShape It can be closed or unclosed pipe-like shell
4248 # or a pipe-like solid.
4249 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4250 # should be lists of edges of theShape.
4251 # @param theName Object name; when specified, this parameter is used
4252 # for result publication in the study. Otherwise, if automatic
4253 # publication is switched on, default value is used for result name.
4255 # @note It is not assumed that exact or approximate copy of theShape
4256 # can be obtained by applying existing Pipe operation on the
4257 # resulting "Path" wire taking theBase1 as the base - it is not
4258 # always possible; though in some particular cases it might work
4259 # it is not guaranteed. Thus, RestorePath function should not be
4260 # considered as an exact reverse operation of the Pipe.
4262 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4263 # source pipe's "path".
4265 # @ref tui_creation_pipe_path "Example"
4266 @ManageTransactions("PrimOp")
4267 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4269 Build a middle path of a pipe-like shape.
4270 The path shape can be a wire or an edge.
4273 theShape It can be closed or unclosed pipe-like shell
4274 or a pipe-like solid.
4275 listEdges1, listEdges2 Two bases of the supposed pipe. This
4276 should be lists of edges of theShape.
4277 theName Object name; when specified, this parameter is used
4278 for result publication in the study. Otherwise, if automatic
4279 publication is switched on, default value is used for result name.
4282 New GEOM_Object, containing an edge or wire that represent
4285 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4286 RaiseIfFailed("RestorePath", self.PrimOp)
4287 self._autoPublish(anObj, theName, "path")
4293 ## @addtogroup l3_advanced
4296 ## Create a linear edge with specified ends.
4297 # @param thePnt1 Point for the first end of edge.
4298 # @param thePnt2 Point for the second end of edge.
4299 # @param theName Object name; when specified, this parameter is used
4300 # for result publication in the study. Otherwise, if automatic
4301 # publication is switched on, default value is used for result name.
4303 # @return New GEOM.GEOM_Object, containing the created edge.
4305 # @ref tui_creation_edge "Example"
4306 @ManageTransactions("ShapesOp")
4307 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4309 Create a linear edge with specified ends.
4312 thePnt1 Point for the first end of edge.
4313 thePnt2 Point for the second end of edge.
4314 theName Object name; when specified, this parameter is used
4315 for result publication in the study. Otherwise, if automatic
4316 publication is switched on, default value is used for result name.
4319 New GEOM.GEOM_Object, containing the created edge.
4321 # Example: see GEOM_TestAll.py
4322 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4323 RaiseIfFailed("MakeEdge", self.ShapesOp)
4324 self._autoPublish(anObj, theName, "edge")
4327 ## Create a new edge, corresponding to the given length on the given curve.
4328 # @param theRefCurve The referenced curve (edge).
4329 # @param theLength Length on the referenced curve. It can be negative.
4330 # @param theStartPoint Any point can be selected for it, the new edge will begin
4331 # at the end of \a theRefCurve, close to the selected point.
4332 # If None, start from the first point of \a theRefCurve.
4333 # @param theName Object name; when specified, this parameter is used
4334 # for result publication in the study. Otherwise, if automatic
4335 # publication is switched on, default value is used for result name.
4337 # @return New GEOM.GEOM_Object, containing the created edge.
4339 # @ref tui_creation_edge "Example"
4340 @ManageTransactions("ShapesOp")
4341 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4343 Create a new edge, corresponding to the given length on the given curve.
4346 theRefCurve The referenced curve (edge).
4347 theLength Length on the referenced curve. It can be negative.
4348 theStartPoint Any point can be selected for it, the new edge will begin
4349 at the end of theRefCurve, close to the selected point.
4350 If None, start from the first point of theRefCurve.
4351 theName Object name; when specified, this parameter is used
4352 for result publication in the study. Otherwise, if automatic
4353 publication is switched on, default value is used for result name.
4356 New GEOM.GEOM_Object, containing the created edge.
4358 # Example: see GEOM_TestAll.py
4359 theLength, Parameters = ParseParameters(theLength)
4360 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4361 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4362 anObj.SetParameters(Parameters)
4363 self._autoPublish(anObj, theName, "edge")
4366 ## Create an edge from specified wire.
4367 # @param theWire source Wire
4368 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4369 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4370 # @param theName Object name; when specified, this parameter is used
4371 # for result publication in the study. Otherwise, if automatic
4372 # publication is switched on, default value is used for result name.
4374 # @return New GEOM.GEOM_Object, containing the created edge.
4376 # @ref tui_creation_edge "Example"
4377 @ManageTransactions("ShapesOp")
4378 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4380 Create an edge from specified wire.
4384 theLinearTolerance linear tolerance value (default = 1e-07)
4385 theAngularTolerance angular tolerance value (default = 1e-12)
4386 theName Object name; when specified, this parameter is used
4387 for result publication in the study. Otherwise, if automatic
4388 publication is switched on, default value is used for result name.
4391 New GEOM.GEOM_Object, containing the created edge.
4393 # Example: see GEOM_TestAll.py
4394 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4395 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4396 self._autoPublish(anObj, theName, "edge")
4399 ## Create a wire from the set of edges and wires.
4400 # @param theEdgesAndWires List of edges and/or wires.
4401 # @param theTolerance Maximum distance between vertices, that will be merged.
4402 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4403 # @param theName Object name; when specified, this parameter is used
4404 # for result publication in the study. Otherwise, if automatic
4405 # publication is switched on, default value is used for result name.
4407 # @return New GEOM.GEOM_Object, containing the created wire.
4409 # @ref tui_creation_wire "Example"
4410 @ManageTransactions("ShapesOp")
4411 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4413 Create a wire from the set of edges and wires.
4416 theEdgesAndWires List of edges and/or wires.
4417 theTolerance Maximum distance between vertices, that will be merged.
4418 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4419 theName Object name; when specified, this parameter is used
4420 for result publication in the study. Otherwise, if automatic
4421 publication is switched on, default value is used for result name.
4424 New GEOM.GEOM_Object, containing the created wire.
4426 # Example: see GEOM_TestAll.py
4427 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4428 RaiseIfFailed("MakeWire", self.ShapesOp)
4429 self._autoPublish(anObj, theName, "wire")
4432 ## Create a face on the given wire.
4433 # @param theWire closed Wire or Edge to build the face on.
4434 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4435 # If the tolerance of the obtained planar face is less
4436 # than 1e-06, this face will be returned, otherwise the
4437 # algorithm tries to build any suitable face on the given
4438 # wire and prints a warning message.
4439 # @param theName Object name; when specified, this parameter is used
4440 # for result publication in the study. Otherwise, if automatic
4441 # publication is switched on, default value is used for result name.
4443 # @return New GEOM.GEOM_Object, containing the created face.
4445 # @ref tui_creation_face "Example"
4446 @ManageTransactions("ShapesOp")
4447 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4449 Create a face on the given wire.
4452 theWire closed Wire or Edge to build the face on.
4453 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4454 If the tolerance of the obtained planar face is less
4455 than 1e-06, this face will be returned, otherwise the
4456 algorithm tries to build any suitable face on the given
4457 wire and prints a warning message.
4458 theName Object name; when specified, this parameter is used
4459 for result publication in the study. Otherwise, if automatic
4460 publication is switched on, default value is used for result name.
4463 New GEOM.GEOM_Object, containing the created face.
4465 # Example: see GEOM_TestAll.py
4466 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4467 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4468 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4470 RaiseIfFailed("MakeFace", self.ShapesOp)
4471 self._autoPublish(anObj, theName, "face")
4474 ## Create a face on the given wires set.
4475 # @param theWires List of closed wires or edges to build the face on.
4476 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4477 # If the tolerance of the obtained planar face is less
4478 # than 1e-06, this face will be returned, otherwise the
4479 # algorithm tries to build any suitable face on the given
4480 # wire and prints a warning message.
4481 # @param theName Object name; when specified, this parameter is used
4482 # for result publication in the study. Otherwise, if automatic
4483 # publication is switched on, default value is used for result name.
4485 # @return New GEOM.GEOM_Object, containing the created face.
4487 # @ref tui_creation_face "Example"
4488 @ManageTransactions("ShapesOp")
4489 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4491 Create a face on the given wires set.
4494 theWires List of closed wires or edges to build the face on.
4495 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4496 If the tolerance of the obtained planar face is less
4497 than 1e-06, this face will be returned, otherwise the
4498 algorithm tries to build any suitable face on the given
4499 wire and prints a warning message.
4500 theName Object name; when specified, this parameter is used
4501 for result publication in the study. Otherwise, if automatic
4502 publication is switched on, default value is used for result name.
4505 New GEOM.GEOM_Object, containing the created face.
4507 # Example: see GEOM_TestAll.py
4508 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4509 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4510 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4512 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4513 self._autoPublish(anObj, theName, "face")
4516 ## See MakeFaceWires() method for details.
4518 # @ref tui_creation_face "Example 1"
4519 # \n @ref swig_MakeFaces "Example 2"
4520 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4522 See geompy.MakeFaceWires() method for details.
4524 # Example: see GEOM_TestOthers.py
4525 # note: auto-publishing is done in self.MakeFaceWires()
4526 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4529 ## Create a face based on a surface from given face bounded
4531 # @param theFace the face whose surface is used to create a new face.
4532 # @param theWire the wire that will bound a new face.
4533 # @param theName Object name; when specified, this parameter is used
4534 # for result publication in the study. Otherwise, if automatic
4535 # publication is switched on, default value is used for result name.
4537 # @return New GEOM.GEOM_Object, containing the created face.
4539 # @ref tui_creation_face "Example"
4540 @ManageTransactions("ShapesOp")
4541 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4543 Create a face based on a surface from given face bounded
4547 theFace the face whose surface is used to create a new face.
4548 theWire the wire that will bound a new face.
4549 theName Object name; when specified, this parameter is used
4550 for result publication in the study. Otherwise, if automatic
4551 publication is switched on, default value is used for result name.
4554 New GEOM.GEOM_Object, containing the created face.
4556 # Example: see GEOM_TestAll.py
4557 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4558 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4559 self._autoPublish(anObj, theName, "face")
4562 ## Create a face from a set of edges with the given constraints.
4563 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4564 # - edges should form a closed wire;
4565 # - for each edge, constraint face is optional: if a constraint face is missing
4566 # for some edge, this means that there no constraint associated with this edge.
4567 # @param theName Object name; when specified, this parameter is used
4568 # for result publication in the study. Otherwise, if automatic
4569 # publication is switched on, default value is used for result name.
4571 # @return New GEOM.GEOM_Object, containing the created face.
4573 # @ref tui_creation_face "Example"
4574 @ManageTransactions("ShapesOp")
4575 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4577 Create a face from a set of edges with the given constraints.
4580 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4581 - edges should form a closed wire;
4582 - for each edge, constraint face is optional: if a constraint face is missing
4583 for some edge, this means that there no constraint associated with this edge.
4584 theName Object name; when specified, this parameter is used
4585 for result publication in the study. Otherwise, if automatic
4586 publication is switched on, default value is used for result name.
4589 New GEOM.GEOM_Object, containing the created face.
4591 # Example: see GEOM_TestAll.py
4592 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4594 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4595 self._autoPublish(anObj, theName, "face")
4598 ## Create a shell from the set of faces and shells.
4599 # @param theFacesAndShells List of faces and/or shells.
4600 # @param theName Object name; when specified, this parameter is used
4601 # for result publication in the study. Otherwise, if automatic
4602 # publication is switched on, default value is used for result name.
4604 # @return New GEOM.GEOM_Object, containing the created shell.
4606 # @ref tui_creation_shell "Example"
4607 @ManageTransactions("ShapesOp")
4608 def MakeShell(self, theFacesAndShells, theName=None):
4610 Create a shell from the set of faces and shells.
4613 theFacesAndShells List of faces and/or shells.
4614 theName Object name; when specified, this parameter is used
4615 for result publication in the study. Otherwise, if automatic
4616 publication is switched on, default value is used for result name.
4619 New GEOM.GEOM_Object, containing the created shell.
4621 # Example: see GEOM_TestAll.py
4622 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4623 RaiseIfFailed("MakeShell", self.ShapesOp)
4624 self._autoPublish(anObj, theName, "shell")
4627 ## Create a solid, bounded by the given shells.
4628 # @param theShells Sequence of bounding shells.
4629 # @param theName Object name; when specified, this parameter is used
4630 # for result publication in the study. Otherwise, if automatic
4631 # publication is switched on, default value is used for result name.
4633 # @return New GEOM.GEOM_Object, containing the created solid.
4635 # @ref tui_creation_solid "Example"
4636 @ManageTransactions("ShapesOp")
4637 def MakeSolid(self, theShells, theName=None):
4639 Create a solid, bounded by the given shells.
4642 theShells Sequence of bounding shells.
4643 theName Object name; when specified, this parameter is used
4644 for result publication in the study. Otherwise, if automatic
4645 publication is switched on, default value is used for result name.
4648 New GEOM.GEOM_Object, containing the created solid.
4650 # Example: see GEOM_TestAll.py
4651 theShells = ToList(theShells)
4652 if len(theShells) == 1:
4653 descr = self._IsGoodForSolid(theShells[0])
4655 # raise RuntimeError, "MakeSolidShells : " + descr
4656 if descr == "WRN_SHAPE_UNCLOSED":
4657 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4658 anObj = self.ShapesOp.MakeSolidShells(theShells)
4659 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4660 self._autoPublish(anObj, theName, "solid")
4663 ## Create a compound of the given shapes.
4664 # @param theShapes List of shapes to put in compound.
4665 # @param theName Object name; when specified, this parameter is used
4666 # for result publication in the study. Otherwise, if automatic
4667 # publication is switched on, default value is used for result name.
4669 # @return New GEOM.GEOM_Object, containing the created compound.
4671 # @ref tui_creation_compound "Example"
4672 @ManageTransactions("ShapesOp")
4673 def MakeCompound(self, theShapes, theName=None):
4675 Create a compound of the given shapes.
4678 theShapes List of shapes to put in compound.
4679 theName Object name; when specified, this parameter is used
4680 for result publication in the study. Otherwise, if automatic
4681 publication is switched on, default value is used for result name.
4684 New GEOM.GEOM_Object, containing the created compound.
4686 # Example: see GEOM_TestAll.py
4687 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4688 RaiseIfFailed("MakeCompound", self.ShapesOp)
4689 self._autoPublish(anObj, theName, "compound")
4692 ## Create a solid (or solids) from the set of faces and/or shells.
4693 # @param theFacesOrShells List of faces and/or shells.
4694 # @param isIntersect If TRUE, forces performing intersections
4695 # between arguments; otherwise (default) intersection is not performed.
4696 # @param theName Object name; when specified, this parameter is used
4697 # for result publication in the study. Otherwise, if automatic
4698 # publication is switched on, default value is used for result name.
4700 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4702 # @ref tui_creation_solid_from_faces "Example"
4703 @ManageTransactions("ShapesOp")
4704 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
4706 Create a solid (or solids) from the set of connected faces and/or shells.
4709 theFacesOrShells List of faces and/or shells.
4710 isIntersect If TRUE, forces performing intersections
4711 between arguments; otherwise (default) intersection is not performed
4712 theName Object name; when specified, this parameter is used.
4713 for result publication in the study. Otherwise, if automatic
4714 publication is switched on, default value is used for result name.
4717 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4719 # Example: see GEOM_TestAll.py
4720 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
4721 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
4722 self._autoPublish(anObj, theName, "solid")
4725 # end of l3_advanced
4728 ## @addtogroup l2_measure
4731 ## Gives quantity of faces in the given shape.
4732 # @param theShape Shape to count faces of.
4733 # @return Quantity of faces.
4735 # @ref swig_NumberOf "Example"
4736 @ManageTransactions("ShapesOp")
4737 def NumberOfFaces(self, theShape):
4739 Gives quantity of faces in the given shape.
4742 theShape Shape to count faces of.
4747 # Example: see GEOM_TestOthers.py
4748 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4749 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4752 ## Gives quantity of edges in the given shape.
4753 # @param theShape Shape to count edges of.
4754 # @return Quantity of edges.
4756 # @ref swig_NumberOf "Example"
4757 @ManageTransactions("ShapesOp")
4758 def NumberOfEdges(self, theShape):
4760 Gives quantity of edges in the given shape.
4763 theShape Shape to count edges of.
4768 # Example: see GEOM_TestOthers.py
4769 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4770 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4773 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4774 # @param theShape Shape to count sub-shapes of.
4775 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4776 # @return Quantity of sub-shapes of given type.
4778 # @ref swig_NumberOf "Example"
4779 @ManageTransactions("ShapesOp")
4780 def NumberOfSubShapes(self, theShape, theShapeType):
4782 Gives quantity of sub-shapes of type theShapeType in the given shape.
4785 theShape Shape to count sub-shapes of.
4786 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4789 Quantity of sub-shapes of given type.
4791 # Example: see GEOM_TestOthers.py
4792 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4793 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4796 ## Gives quantity of solids in the given shape.
4797 # @param theShape Shape to count solids in.
4798 # @return Quantity of solids.
4800 # @ref swig_NumberOf "Example"
4801 @ManageTransactions("ShapesOp")
4802 def NumberOfSolids(self, theShape):
4804 Gives quantity of solids in the given shape.
4807 theShape Shape to count solids in.
4812 # Example: see GEOM_TestOthers.py
4813 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
4814 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4820 ## @addtogroup l3_healing
4823 ## Reverses an orientation the given shape.
4824 # @param theShape Shape to be reversed.
4825 # @param theName Object name; when specified, this parameter is used
4826 # for result publication in the study. Otherwise, if automatic
4827 # publication is switched on, default value is used for result name.
4829 # @return The reversed copy of theShape.
4831 # @ref swig_ChangeOrientation "Example"
4832 @ManageTransactions("ShapesOp")
4833 def ChangeOrientation(self, theShape, theName=None):
4835 Reverses an orientation the given shape.
4838 theShape Shape to be reversed.
4839 theName Object name; when specified, this parameter is used
4840 for result publication in the study. Otherwise, if automatic
4841 publication is switched on, default value is used for result name.
4844 The reversed copy of theShape.
4846 # Example: see GEOM_TestAll.py
4847 anObj = self.ShapesOp.ChangeOrientation(theShape)
4848 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4849 self._autoPublish(anObj, theName, "reversed")
4852 ## See ChangeOrientation() method for details.
4854 # @ref swig_OrientationChange "Example"
4855 def OrientationChange(self, theShape, theName=None):
4857 See geompy.ChangeOrientation method for details.
4859 # Example: see GEOM_TestOthers.py
4860 # note: auto-publishing is done in self.ChangeOrientation()
4861 anObj = self.ChangeOrientation(theShape, theName)
4867 ## @addtogroup l4_obtain
4870 ## Retrieve all free faces from the given shape.
4871 # Free face is a face, which is not shared between two shells of the shape.
4872 # @param theShape Shape to find free faces in.
4873 # @return List of IDs of all free faces, contained in theShape.
4875 # @ref tui_free_faces_page "Example"
4876 @ManageTransactions("ShapesOp")
4877 def GetFreeFacesIDs(self,theShape):
4879 Retrieve all free faces from the given shape.
4880 Free face is a face, which is not shared between two shells of the shape.
4883 theShape Shape to find free faces in.
4886 List of IDs of all free faces, contained in theShape.
4888 # Example: see GEOM_TestOthers.py
4889 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4890 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4893 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4894 # @param theShape1 Shape to find sub-shapes in.
4895 # @param theShape2 Shape to find shared sub-shapes with.
4896 # @param theShapeType Type of sub-shapes to be retrieved.
4897 # @param theName Object name; when specified, this parameter is used
4898 # for result publication in the study. Otherwise, if automatic
4899 # publication is switched on, default value is used for result name.
4901 # @return List of sub-shapes of theShape1, shared with theShape2.
4903 # @ref swig_GetSharedShapes "Example"
4904 @ManageTransactions("ShapesOp")
4905 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4907 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4910 theShape1 Shape to find sub-shapes in.
4911 theShape2 Shape to find shared sub-shapes with.
4912 theShapeType Type of sub-shapes to be retrieved.
4913 theName Object name; when specified, this parameter is used
4914 for result publication in the study. Otherwise, if automatic
4915 publication is switched on, default value is used for result name.
4918 List of sub-shapes of theShape1, shared with theShape2.
4920 # Example: see GEOM_TestOthers.py
4921 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4922 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4923 self._autoPublish(aList, theName, "shared")
4926 ## Get sub-shapes, shared by input shapes.
4927 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
4928 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
4929 # @param theMultiShare Specifies what type of shares should be checked:
4930 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
4931 # - @c False: causes to search sub-shapes shared between couples of input shapes.
4932 # @param theName Object name; when specified, this parameter is used
4933 # for result publication in the study. Otherwise, if automatic
4934 # publication is switched on, default value is used for result name.
4936 # @note If @a theShapes contains single compound, the shares between all possible couples of
4937 # its top-level shapes are returned; otherwise, only shares between 1st input shape
4938 # and all rest input shapes are returned.
4940 # @return List of all found sub-shapes.
4943 # - @ref tui_shared_shapes "Example 1"
4944 # - @ref swig_GetSharedShapes "Example 2"
4945 @ManageTransactions("ShapesOp")
4946 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
4948 Get sub-shapes, shared by input shapes.
4951 theShapes Either a list or compound of shapes to find common sub-shapes of.
4952 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
4953 theMultiShare Specifies what type of shares should be checked:
4954 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
4955 - False: causes to search sub-shapes shared between couples of input shapes.
4956 theName Object name; when specified, this parameter is used
4957 for result publication in the study. Otherwise, if automatic
4958 publication is switched on, default value is used for result name.
4960 Note: if theShapes contains single compound, the shares between all possible couples of
4961 its top-level shapes are returned; otherwise, only shares between 1st input shape
4962 and all rest input shapes are returned.
4965 List of all found sub-shapes.
4967 # Example: see GEOM_TestOthers.py
4968 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
4969 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4970 self._autoPublish(aList, theName, "shared")
4973 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4974 # situated relatively the specified plane by the certain way,
4975 # defined through <VAR>theState</VAR> parameter.
4976 # @param theShape Shape to find sub-shapes of.
4977 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4978 # @param theAx1 Vector (or line, or linear edge), specifying normal
4979 # direction and location of the plane to find shapes on.
4980 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4981 # @param theName Object name; when specified, this parameter is used
4982 # for result publication in the study. Otherwise, if automatic
4983 # publication is switched on, default value is used for result name.
4985 # @return List of all found sub-shapes.
4987 # @ref swig_GetShapesOnPlane "Example"
4988 @ManageTransactions("ShapesOp")
4989 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4991 Find in theShape all sub-shapes of type theShapeType,
4992 situated relatively the specified plane by the certain way,
4993 defined through theState parameter.
4996 theShape Shape to find sub-shapes of.
4997 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4998 theAx1 Vector (or line, or linear edge), specifying normal
4999 direction and location of the plane to find shapes on.
5000 theState The state of the sub-shapes to find (see GEOM::shape_state)
5001 theName Object name; when specified, this parameter is used
5002 for result publication in the study. Otherwise, if automatic
5003 publication is switched on, default value is used for result name.
5006 List of all found sub-shapes.
5008 # Example: see GEOM_TestOthers.py
5009 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5010 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5011 self._autoPublish(aList, theName, "shapeOnPlane")
5014 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5015 # situated relatively the specified plane by the certain way,
5016 # defined through <VAR>theState</VAR> parameter.
5017 # @param theShape Shape to find sub-shapes of.
5018 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5019 # @param theAx1 Vector (or line, or linear edge), specifying normal
5020 # direction and location of the plane to find shapes on.
5021 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5023 # @return List of all found sub-shapes indices.
5025 # @ref swig_GetShapesOnPlaneIDs "Example"
5026 @ManageTransactions("ShapesOp")
5027 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5029 Find in theShape all sub-shapes of type theShapeType,
5030 situated relatively the specified plane by the certain way,
5031 defined through theState parameter.
5034 theShape Shape to find sub-shapes of.
5035 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5036 theAx1 Vector (or line, or linear edge), specifying normal
5037 direction and location of the plane to find shapes on.
5038 theState The state of the sub-shapes to find (see GEOM::shape_state)
5041 List of all found sub-shapes indices.
5043 # Example: see GEOM_TestOthers.py
5044 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5045 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5048 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5049 # situated relatively the specified plane by the certain way,
5050 # defined through <VAR>theState</VAR> parameter.
5051 # @param theShape Shape to find sub-shapes of.
5052 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5053 # @param theAx1 Vector (or line, or linear edge), specifying normal
5054 # direction of the plane to find shapes on.
5055 # @param thePnt Point specifying location of the plane to find shapes on.
5056 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5057 # @param theName Object name; when specified, this parameter is used
5058 # for result publication in the study. Otherwise, if automatic
5059 # publication is switched on, default value is used for result name.
5061 # @return List of all found sub-shapes.
5063 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5064 @ManageTransactions("ShapesOp")
5065 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5067 Find in theShape all sub-shapes of type theShapeType,
5068 situated relatively the specified plane by the certain way,
5069 defined through theState parameter.
5072 theShape Shape to find sub-shapes of.
5073 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5074 theAx1 Vector (or line, or linear edge), specifying normal
5075 direction and location of the plane to find shapes on.
5076 thePnt Point specifying location of the plane to find shapes on.
5077 theState The state of the sub-shapes to find (see GEOM::shape_state)
5078 theName Object name; when specified, this parameter is used
5079 for result publication in the study. Otherwise, if automatic
5080 publication is switched on, default value is used for result name.
5083 List of all found sub-shapes.
5085 # Example: see GEOM_TestOthers.py
5086 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5087 theAx1, thePnt, theState)
5088 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5089 self._autoPublish(aList, theName, "shapeOnPlane")
5092 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5093 # situated relatively the specified plane by the certain way,
5094 # defined through <VAR>theState</VAR> parameter.
5095 # @param theShape Shape to find sub-shapes of.
5096 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5097 # @param theAx1 Vector (or line, or linear edge), specifying normal
5098 # direction of the plane to find shapes on.
5099 # @param thePnt Point specifying location of the plane to find shapes on.
5100 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5102 # @return List of all found sub-shapes indices.
5104 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5105 @ManageTransactions("ShapesOp")
5106 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5108 Find in theShape all sub-shapes of type theShapeType,
5109 situated relatively the specified plane by the certain way,
5110 defined through theState parameter.
5113 theShape Shape to find sub-shapes of.
5114 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5115 theAx1 Vector (or line, or linear edge), specifying normal
5116 direction and location of the plane to find shapes on.
5117 thePnt Point specifying location of the plane to find shapes on.
5118 theState The state of the sub-shapes to find (see GEOM::shape_state)
5121 List of all found sub-shapes indices.
5123 # Example: see GEOM_TestOthers.py
5124 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5125 theAx1, thePnt, theState)
5126 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5129 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5130 # the specified cylinder by the certain way, defined through \a theState parameter.
5131 # @param theShape Shape to find sub-shapes of.
5132 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5133 # @param theAxis Vector (or line, or linear edge), specifying
5134 # axis of the cylinder to find shapes on.
5135 # @param theRadius Radius of the cylinder 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_GetShapesOnCylinder "Example"
5144 @ManageTransactions("ShapesOp")
5145 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5147 Find in theShape all sub-shapes of type theShapeType, situated relatively
5148 the specified cylinder 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 theAxis Vector (or line, or linear edge), specifying
5154 axis of the cylinder to find shapes on.
5155 theRadius Radius of the cylinder to find shapes on.
5156 theState The state of the sub-shapes to find (see GEOM::shape_state)
5157 theName Object name; when specified, this parameter is used
5158 for result publication in the study. Otherwise, if automatic
5159 publication is switched on, default value is used for result name.
5162 List of all found sub-shapes.
5164 # Example: see GEOM_TestOthers.py
5165 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5166 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5167 self._autoPublish(aList, theName, "shapeOnCylinder")
5170 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5171 # the specified cylinder by the certain way, defined through \a theState parameter.
5172 # @param theShape Shape to find sub-shapes of.
5173 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5174 # @param theAxis Vector (or line, or linear edge), specifying
5175 # axis of the cylinder to find shapes on.
5176 # @param theRadius Radius of the cylinder to find shapes on.
5177 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5179 # @return List of all found sub-shapes indices.
5181 # @ref swig_GetShapesOnCylinderIDs "Example"
5182 @ManageTransactions("ShapesOp")
5183 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5185 Find in theShape all sub-shapes of type theShapeType, situated relatively
5186 the specified cylinder by the certain way, defined through theState parameter.
5189 theShape Shape to find sub-shapes of.
5190 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5191 theAxis Vector (or line, or linear edge), specifying
5192 axis of the cylinder to find shapes on.
5193 theRadius Radius of the cylinder to find shapes on.
5194 theState The state of the sub-shapes to find (see GEOM::shape_state)
5197 List of all found sub-shapes indices.
5199 # Example: see GEOM_TestOthers.py
5200 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5201 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5204 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5205 # the specified cylinder by the certain way, defined through \a theState parameter.
5206 # @param theShape Shape to find sub-shapes of.
5207 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5208 # @param theAxis Vector (or line, or linear edge), specifying
5209 # axis of the cylinder to find shapes on.
5210 # @param thePnt Point specifying location of the bottom of the cylinder.
5211 # @param theRadius Radius of the cylinder to find shapes on.
5212 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5213 # @param theName Object name; when specified, this parameter is used
5214 # for result publication in the study. Otherwise, if automatic
5215 # publication is switched on, default value is used for result name.
5217 # @return List of all found sub-shapes.
5219 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5220 @ManageTransactions("ShapesOp")
5221 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5223 Find in theShape all sub-shapes of type theShapeType, situated relatively
5224 the specified cylinder by the certain way, defined through theState parameter.
5227 theShape Shape to find sub-shapes of.
5228 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5229 theAxis Vector (or line, or linear edge), specifying
5230 axis of the cylinder to find shapes on.
5231 theRadius Radius of the cylinder to find shapes on.
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.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5242 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5243 self._autoPublish(aList, theName, "shapeOnCylinder")
5246 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5247 # the specified cylinder by the certain way, defined through \a theState parameter.
5248 # @param theShape Shape to find sub-shapes of.
5249 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5250 # @param theAxis Vector (or line, or linear edge), specifying
5251 # axis of the cylinder to find shapes on.
5252 # @param thePnt Point specifying location of the bottom of the cylinder.
5253 # @param theRadius Radius of the cylinder to find shapes on.
5254 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5256 # @return List of all found sub-shapes indices
5258 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5259 @ManageTransactions("ShapesOp")
5260 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5262 Find in theShape all sub-shapes of type theShapeType, situated relatively
5263 the specified cylinder by the certain way, defined through theState parameter.
5266 theShape Shape to find sub-shapes of.
5267 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5268 theAxis Vector (or line, or linear edge), specifying
5269 axis of the cylinder to find shapes on.
5270 theRadius Radius of the cylinder to find shapes on.
5271 theState The state of the sub-shapes to find (see GEOM::shape_state)
5274 List of all found sub-shapes indices.
5276 # Example: see GEOM_TestOthers.py
5277 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5278 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5281 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5282 # the specified sphere by the certain way, defined through \a theState parameter.
5283 # @param theShape Shape to find sub-shapes of.
5284 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5285 # @param theCenter Point, specifying center of the sphere to find shapes on.
5286 # @param theRadius Radius of the sphere to find shapes on.
5287 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5288 # @param theName Object name; when specified, this parameter is used
5289 # for result publication in the study. Otherwise, if automatic
5290 # publication is switched on, default value is used for result name.
5292 # @return List of all found sub-shapes.
5294 # @ref swig_GetShapesOnSphere "Example"
5295 @ManageTransactions("ShapesOp")
5296 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5298 Find in theShape all sub-shapes of type theShapeType, situated relatively
5299 the specified sphere by the certain way, defined through theState parameter.
5302 theShape Shape to find sub-shapes of.
5303 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5304 theCenter Point, specifying center of the sphere to find shapes on.
5305 theRadius Radius of the sphere to find shapes on.
5306 theState The state of the sub-shapes to find (see GEOM::shape_state)
5307 theName Object name; when specified, this parameter is used
5308 for result publication in the study. Otherwise, if automatic
5309 publication is switched on, default value is used for result name.
5312 List of all found sub-shapes.
5314 # Example: see GEOM_TestOthers.py
5315 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5316 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5317 self._autoPublish(aList, theName, "shapeOnSphere")
5320 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5321 # the specified sphere by the certain way, defined through \a theState parameter.
5322 # @param theShape Shape to find sub-shapes of.
5323 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5324 # @param theCenter Point, specifying center of the sphere to find shapes on.
5325 # @param theRadius Radius of the sphere to find shapes on.
5326 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5328 # @return List of all found sub-shapes indices.
5330 # @ref swig_GetShapesOnSphereIDs "Example"
5331 @ManageTransactions("ShapesOp")
5332 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5334 Find in theShape all sub-shapes of type theShapeType, situated relatively
5335 the specified sphere by the certain way, defined through theState parameter.
5338 theShape Shape to find sub-shapes of.
5339 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5340 theCenter Point, specifying center of the sphere to find shapes on.
5341 theRadius Radius of the sphere to find shapes on.
5342 theState The state of the sub-shapes to find (see GEOM::shape_state)
5345 List of all found sub-shapes indices.
5347 # Example: see GEOM_TestOthers.py
5348 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5349 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5352 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5353 # the specified quadrangle by the certain way, defined through \a theState parameter.
5354 # @param theShape Shape to find sub-shapes of.
5355 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5356 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5357 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5358 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5359 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5360 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5361 # @param theName Object name; when specified, this parameter is used
5362 # for result publication in the study. Otherwise, if automatic
5363 # publication is switched on, default value is used for result name.
5365 # @return List of all found sub-shapes.
5367 # @ref swig_GetShapesOnQuadrangle "Example"
5368 @ManageTransactions("ShapesOp")
5369 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5370 theTopLeftPoint, theTopRigthPoint,
5371 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5373 Find in theShape all sub-shapes of type theShapeType, situated relatively
5374 the specified quadrangle by the certain way, defined through theState parameter.
5377 theShape Shape to find sub-shapes of.
5378 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5379 theTopLeftPoint Point, specifying top left corner of a quadrangle
5380 theTopRigthPoint Point, specifying top right corner of a quadrangle
5381 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5382 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5383 theState The state of the sub-shapes to find (see GEOM::shape_state)
5384 theName Object name; when specified, this parameter is used
5385 for result publication in the study. Otherwise, if automatic
5386 publication is switched on, default value is used for result name.
5389 List of all found sub-shapes.
5391 # Example: see GEOM_TestOthers.py
5392 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5393 theTopLeftPoint, theTopRigthPoint,
5394 theBottomLeftPoint, theBottomRigthPoint, theState)
5395 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5396 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5399 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5400 # the specified quadrangle by the certain way, defined through \a theState parameter.
5401 # @param theShape Shape to find sub-shapes of.
5402 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5403 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5404 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5405 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5406 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5407 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5409 # @return List of all found sub-shapes indices.
5411 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5412 @ManageTransactions("ShapesOp")
5413 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5414 theTopLeftPoint, theTopRigthPoint,
5415 theBottomLeftPoint, theBottomRigthPoint, theState):
5417 Find in theShape all sub-shapes of type theShapeType, situated relatively
5418 the specified quadrangle by the certain way, defined through theState parameter.
5421 theShape Shape to find sub-shapes of.
5422 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5423 theTopLeftPoint Point, specifying top left corner of a quadrangle
5424 theTopRigthPoint Point, specifying top right corner of a quadrangle
5425 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5426 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5427 theState The state of the sub-shapes to find (see GEOM::shape_state)
5430 List of all found sub-shapes indices.
5433 # Example: see GEOM_TestOthers.py
5434 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5435 theTopLeftPoint, theTopRigthPoint,
5436 theBottomLeftPoint, theBottomRigthPoint, theState)
5437 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5440 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5441 # the specified \a theBox by the certain way, defined through \a theState parameter.
5442 # @param theBox Shape for relative comparing.
5443 # @param theShape Shape to find sub-shapes of.
5444 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5445 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5446 # @param theName Object name; when specified, this parameter is used
5447 # for result publication in the study. Otherwise, if automatic
5448 # publication is switched on, default value is used for result name.
5450 # @return List of all found sub-shapes.
5452 # @ref swig_GetShapesOnBox "Example"
5453 @ManageTransactions("ShapesOp")
5454 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5456 Find in theShape all sub-shapes of type theShapeType, situated relatively
5457 the specified theBox by the certain way, defined through theState parameter.
5460 theBox Shape for relative comparing.
5461 theShape Shape to find sub-shapes of.
5462 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5463 theState The state of the sub-shapes to find (see GEOM::shape_state)
5464 theName Object name; when specified, this parameter is used
5465 for result publication in the study. Otherwise, if automatic
5466 publication is switched on, default value is used for result name.
5469 List of all found sub-shapes.
5471 # Example: see GEOM_TestOthers.py
5472 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5473 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5474 self._autoPublish(aList, theName, "shapeOnBox")
5477 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5478 # the specified \a theBox by the certain way, defined through \a theState parameter.
5479 # @param theBox Shape for relative comparing.
5480 # @param theShape Shape to find sub-shapes of.
5481 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5482 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5484 # @return List of all found sub-shapes indices.
5486 # @ref swig_GetShapesOnBoxIDs "Example"
5487 @ManageTransactions("ShapesOp")
5488 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5490 Find in theShape all sub-shapes of type theShapeType, situated relatively
5491 the specified theBox by the certain way, defined through theState parameter.
5494 theBox Shape for relative comparing.
5495 theShape Shape to find sub-shapes of.
5496 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5497 theState The state of the sub-shapes to find (see GEOM::shape_state)
5500 List of all found sub-shapes indices.
5502 # Example: see GEOM_TestOthers.py
5503 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5504 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5507 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5508 # situated relatively the specified \a theCheckShape by the
5509 # certain way, defined through \a theState parameter.
5510 # @param theCheckShape Shape for relative comparing. It must be a solid.
5511 # @param theShape Shape to find sub-shapes of.
5512 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5513 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5514 # @param theName Object name; when specified, this parameter is used
5515 # for result publication in the study. Otherwise, if automatic
5516 # publication is switched on, default value is used for result name.
5518 # @return List of all found sub-shapes.
5520 # @ref swig_GetShapesOnShape "Example"
5521 @ManageTransactions("ShapesOp")
5522 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5524 Find in theShape all sub-shapes of type theShapeType,
5525 situated relatively the specified theCheckShape by the
5526 certain way, defined through theState parameter.
5529 theCheckShape Shape for relative comparing. It must be a solid.
5530 theShape Shape to find sub-shapes of.
5531 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5532 theState The state of the sub-shapes to find (see GEOM::shape_state)
5533 theName Object name; when specified, this parameter is used
5534 for result publication in the study. Otherwise, if automatic
5535 publication is switched on, default value is used for result name.
5538 List of all found sub-shapes.
5540 # Example: see GEOM_TestOthers.py
5541 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5542 theShapeType, theState)
5543 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5544 self._autoPublish(aList, theName, "shapeOnShape")
5547 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5548 # situated relatively the specified \a theCheckShape by the
5549 # certain way, defined through \a theState parameter.
5550 # @param theCheckShape Shape for relative comparing. It must be a solid.
5551 # @param theShape Shape to find sub-shapes of.
5552 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5553 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5554 # @param theName Object name; when specified, this parameter is used
5555 # for result publication in the study. Otherwise, if automatic
5556 # publication is switched on, default value is used for result name.
5558 # @return All found sub-shapes as compound.
5560 # @ref swig_GetShapesOnShapeAsCompound "Example"
5561 @ManageTransactions("ShapesOp")
5562 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5564 Find in theShape all sub-shapes of type theShapeType,
5565 situated relatively the specified theCheckShape by the
5566 certain way, defined through theState parameter.
5569 theCheckShape Shape for relative comparing. It must be a solid.
5570 theShape Shape to find sub-shapes of.
5571 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5572 theState The state of the sub-shapes to find (see GEOM::shape_state)
5573 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.
5578 All found sub-shapes as compound.
5580 # Example: see GEOM_TestOthers.py
5581 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5582 theShapeType, theState)
5583 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5584 self._autoPublish(anObj, theName, "shapeOnShape")
5587 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5588 # situated relatively the specified \a theCheckShape by the
5589 # certain way, defined through \a theState parameter.
5590 # @param theCheckShape Shape for relative comparing. It must be a solid.
5591 # @param theShape Shape to find sub-shapes of.
5592 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5593 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5595 # @return List of all found sub-shapes indices.
5597 # @ref swig_GetShapesOnShapeIDs "Example"
5598 @ManageTransactions("ShapesOp")
5599 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5601 Find in theShape all sub-shapes of type theShapeType,
5602 situated relatively the specified theCheckShape by the
5603 certain way, defined through theState parameter.
5606 theCheckShape Shape for relative comparing. It must be a solid.
5607 theShape Shape to find sub-shapes of.
5608 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5609 theState The state of the sub-shapes to find (see GEOM::shape_state)
5612 List of all found sub-shapes indices.
5614 # Example: see GEOM_TestOthers.py
5615 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5616 theShapeType, theState)
5617 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5620 ## Get sub-shape(s) of theShapeWhere, which are
5621 # coincident with \a theShapeWhat or could be a part of it.
5622 # @param theShapeWhere Shape to find sub-shapes of.
5623 # @param theShapeWhat Shape, specifying what to find.
5624 # @param isNewImplementation implementation of GetInPlace functionality
5625 # (default = False, old alghorithm based on shape properties)
5626 # @param theName Object name; when specified, this parameter is used
5627 # for result publication in the study. Otherwise, if automatic
5628 # publication is switched on, default value is used for result name.
5630 # @return Group of all found sub-shapes or a single found sub-shape.
5632 # @note This function has a restriction on argument shapes.
5633 # If \a theShapeWhere has curved parts with significantly
5634 # outstanding centres (i.e. the mass centre of a part is closer to
5635 # \a theShapeWhat than to the part), such parts will not be found.
5636 # @image html get_in_place_lost_part.png
5638 # @ref swig_GetInPlace "Example"
5639 @ManageTransactions("ShapesOp")
5640 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5642 Get sub-shape(s) of theShapeWhere, which are
5643 coincident with theShapeWhat or could be a part of it.
5646 theShapeWhere Shape to find sub-shapes of.
5647 theShapeWhat Shape, specifying what to find.
5648 isNewImplementation Implementation of GetInPlace functionality
5649 (default = False, old alghorithm based on shape properties)
5650 theName Object name; when specified, this parameter is used
5651 for result publication in the study. Otherwise, if automatic
5652 publication is switched on, default value is used for result name.
5655 Group of all found sub-shapes or a single found sub-shape.
5659 This function has a restriction on argument shapes.
5660 If theShapeWhere has curved parts with significantly
5661 outstanding centres (i.e. the mass centre of a part is closer to
5662 theShapeWhat than to the part), such parts will not be found.
5664 # Example: see GEOM_TestOthers.py
5666 if isNewImplementation:
5667 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5669 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5671 RaiseIfFailed("GetInPlace", self.ShapesOp)
5672 self._autoPublish(anObj, theName, "inplace")
5675 ## Get sub-shape(s) of \a theShapeWhere, which are
5676 # coincident with \a theShapeWhat or could be a part of it.
5678 # Implementation of this method is based on a saved history of an operation,
5679 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5680 # arguments (an argument shape or a sub-shape of an argument shape).
5681 # The operation could be the Partition or one of boolean operations,
5682 # performed on simple shapes (not on compounds).
5684 # @param theShapeWhere Shape to find sub-shapes of.
5685 # @param theShapeWhat Shape, specifying what to find (must be in the
5686 # building history of the ShapeWhere).
5687 # @param theName Object name; when specified, this parameter is used
5688 # for result publication in the study. Otherwise, if automatic
5689 # publication is switched on, default value is used for result name.
5691 # @return Group of all found sub-shapes or a single found sub-shape.
5693 # @ref swig_GetInPlace "Example"
5694 @ManageTransactions("ShapesOp")
5695 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5697 Implementation of this method is based on a saved history of an operation,
5698 produced theShapeWhere. The theShapeWhat must be among this operation's
5699 arguments (an argument shape or a sub-shape of an argument shape).
5700 The operation could be the Partition or one of boolean operations,
5701 performed on simple shapes (not on compounds).
5704 theShapeWhere Shape to find sub-shapes of.
5705 theShapeWhat Shape, specifying what to find (must be in the
5706 building history of the ShapeWhere).
5707 theName Object name; when specified, this parameter is used
5708 for result publication in the study. Otherwise, if automatic
5709 publication is switched on, default value is used for result name.
5712 Group of all found sub-shapes or a single found sub-shape.
5714 # Example: see GEOM_TestOthers.py
5715 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5716 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5717 self._autoPublish(anObj, theName, "inplace")
5720 ## Get sub-shape of theShapeWhere, which is
5721 # equal to \a theShapeWhat.
5722 # @param theShapeWhere Shape to find sub-shape of.
5723 # @param theShapeWhat Shape, specifying what to find.
5724 # @param theName Object name; when specified, this parameter is used
5725 # for result publication in the study. Otherwise, if automatic
5726 # publication is switched on, default value is used for result name.
5728 # @return New GEOM.GEOM_Object for found sub-shape.
5730 # @ref swig_GetSame "Example"
5731 @ManageTransactions("ShapesOp")
5732 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5734 Get sub-shape of theShapeWhere, which is
5735 equal to theShapeWhat.
5738 theShapeWhere Shape to find sub-shape of.
5739 theShapeWhat Shape, specifying what to find.
5740 theName Object name; when specified, this parameter is used
5741 for result publication in the study. Otherwise, if automatic
5742 publication is switched on, default value is used for result name.
5745 New GEOM.GEOM_Object for found sub-shape.
5747 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5748 RaiseIfFailed("GetSame", self.ShapesOp)
5749 self._autoPublish(anObj, theName, "sameShape")
5753 ## Get sub-shape indices of theShapeWhere, which is
5754 # equal to \a theShapeWhat.
5755 # @param theShapeWhere Shape to find sub-shape of.
5756 # @param theShapeWhat Shape, specifying what to find.
5757 # @return List of all found sub-shapes indices.
5759 # @ref swig_GetSame "Example"
5760 @ManageTransactions("ShapesOp")
5761 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5763 Get sub-shape indices of theShapeWhere, which is
5764 equal to theShapeWhat.
5767 theShapeWhere Shape to find sub-shape of.
5768 theShapeWhat Shape, specifying what to find.
5771 List of all found sub-shapes indices.
5773 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5774 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5777 ## Resize the input edge with the new Min and Max parameters.
5778 # The input edge parameters range is [0, 1]. If theMin parameter is
5779 # negative, the input edge is extended, otherwise it is shrinked by
5780 # theMin parameter. If theMax is greater than 1, the edge is extended,
5781 # otherwise it is shrinked by theMax parameter.
5782 # @param theEdge the input edge to be resized.
5783 # @param theMin the minimal parameter value.
5784 # @param theMax the maximal parameter value.
5785 # @param theName Object name; when specified, this parameter is used
5786 # for result publication in the study. Otherwise, if automatic
5787 # publication is switched on, default value is used for result name.
5788 # @return New GEOM.GEOM_Object, containing the created edge.
5790 # @ref tui_extend "Example"
5791 @ManageTransactions("ShapesOp")
5792 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
5794 Resize the input edge with the new Min and Max parameters.
5795 The input edge parameters range is [0, 1]. If theMin parameter is
5796 negative, the input edge is extended, otherwise it is shrinked by
5797 theMin parameter. If theMax is greater than 1, the edge is extended,
5798 otherwise it is shrinked by theMax parameter.
5801 theEdge the input edge to be resized.
5802 theMin the minimal parameter value.
5803 theMax the maximal parameter value.
5804 theName Object name; when specified, this parameter is used
5805 for result publication in the study. Otherwise, if automatic
5806 publication is switched on, default value is used for result name.
5809 New GEOM.GEOM_Object, containing the created edge.
5811 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
5812 RaiseIfFailed("ExtendEdge", self.ShapesOp)
5813 self._autoPublish(anObj, theName, "edge")
5816 ## Resize the input face with the new UMin, UMax, VMin and VMax
5817 # parameters. The input face U and V parameters range is [0, 1]. If
5818 # theUMin parameter is negative, the input face is extended, otherwise
5819 # it is shrinked along U direction by theUMin parameter. If theUMax is
5820 # greater than 1, the face is extended, otherwise it is shrinked along
5821 # U direction by theUMax parameter. So as for theVMin, theVMax and
5822 # V direction of the input face.
5823 # @param theFace the input face to be resized.
5824 # @param theUMin the minimal U parameter value.
5825 # @param theUMax the maximal U parameter value.
5826 # @param theVMin the minimal V parameter value.
5827 # @param theVMax the maximal V parameter value.
5828 # @param theName Object name; when specified, this parameter is used
5829 # for result publication in the study. Otherwise, if automatic
5830 # publication is switched on, default value is used for result name.
5831 # @return New GEOM.GEOM_Object, containing the created face.
5833 # @ref tui_extend "Example"
5834 @ManageTransactions("ShapesOp")
5835 def ExtendFace(self, theFace, theUMin, theUMax,
5836 theVMin, theVMax, theName=None):
5838 Resize the input face with the new UMin, UMax, VMin and VMax
5839 parameters. The input face U and V parameters range is [0, 1]. If
5840 theUMin parameter is negative, the input face is extended, otherwise
5841 it is shrinked along U direction by theUMin parameter. If theUMax is
5842 greater than 1, the face is extended, otherwise it is shrinked along
5843 U direction by theUMax parameter. So as for theVMin, theVMax and
5844 V direction of the input face.
5847 theFace the input face to be resized.
5848 theUMin the minimal U parameter value.
5849 theUMax the maximal U parameter value.
5850 theVMin the minimal V parameter value.
5851 theVMax the maximal V parameter value.
5852 theName Object name; when specified, this parameter is used
5853 for result publication in the study. Otherwise, if automatic
5854 publication is switched on, default value is used for result name.
5857 New GEOM.GEOM_Object, containing the created face.
5859 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
5861 RaiseIfFailed("ExtendFace", self.ShapesOp)
5862 self._autoPublish(anObj, theName, "face")
5865 ## This function takes some face as input parameter and creates new
5866 # GEOM_Object, i.e. topological shape by extracting underlying surface
5867 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5868 # parameters of the source face (in the parametrical space).
5869 # @param theFace the input face.
5870 # @param theName Object name; when specified, this parameter is used
5871 # for result publication in the study. Otherwise, if automatic
5872 # publication is switched on, default value is used for result name.
5873 # @return New GEOM.GEOM_Object, containing the created face.
5875 # @ref tui_creation_surface "Example"
5876 @ManageTransactions("ShapesOp")
5877 def MakeSurfaceFromFace(self, theFace, theName=None):
5879 This function takes some face as input parameter and creates new
5880 GEOM_Object, i.e. topological shape by extracting underlying surface
5881 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
5882 parameters of the source face (in the parametrical space).
5885 theFace the input face.
5886 theName Object name; when specified, this parameter is used
5887 for result publication in the study. Otherwise, if automatic
5888 publication is switched on, default value is used for result name.
5891 New GEOM.GEOM_Object, containing the created face.
5893 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
5894 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
5895 self._autoPublish(anObj, theName, "surface")
5901 ## @addtogroup l4_access
5904 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5905 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5906 # @param aShape Shape to get sub-shape of.
5907 # @param ListOfID List of sub-shapes indices.
5908 # @param theName Object name; when specified, this parameter is used
5909 # for result publication in the study. Otherwise, if automatic
5910 # publication is switched on, default value is used for result name.
5912 # @return Found sub-shape.
5914 # @ref swig_all_decompose "Example"
5915 def GetSubShape(self, aShape, ListOfID, theName=None):
5917 Obtain a composite sub-shape of aShape, composed from sub-shapes
5918 of aShape, selected by their unique IDs inside aShape
5921 aShape Shape to get sub-shape of.
5922 ListOfID List of sub-shapes indices.
5923 theName Object name; when specified, this parameter is used
5924 for result publication in the study. Otherwise, if automatic
5925 publication is switched on, default value is used for result name.
5930 # Example: see GEOM_TestAll.py
5931 anObj = self.AddSubShape(aShape,ListOfID)
5932 self._autoPublish(anObj, theName, "subshape")
5935 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5936 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5937 # @param aShape Shape to get sub-shape of.
5938 # @param aSubShape Sub-shapes of aShape.
5939 # @return ID of found sub-shape.
5941 # @ref swig_all_decompose "Example"
5942 @ManageTransactions("LocalOp")
5943 def GetSubShapeID(self, aShape, aSubShape):
5945 Obtain unique ID of sub-shape aSubShape inside aShape
5946 of aShape, selected by their unique IDs inside aShape
5949 aShape Shape to get sub-shape of.
5950 aSubShape Sub-shapes of aShape.
5953 ID of found sub-shape.
5955 # Example: see GEOM_TestAll.py
5956 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5957 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5960 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5961 # This function is provided for performance purpose. The complexity is O(n) with n
5962 # the number of subobjects of aShape
5963 # @param aShape Shape to get sub-shape of.
5964 # @param aSubShapes Sub-shapes of aShape.
5965 # @return list of IDs of found sub-shapes.
5967 # @ref swig_all_decompose "Example"
5968 @ManageTransactions("ShapesOp")
5969 def GetSubShapesIDs(self, aShape, aSubShapes):
5971 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5972 This function is provided for performance purpose. The complexity is O(n) with n
5973 the number of subobjects of aShape
5976 aShape Shape to get sub-shape of.
5977 aSubShapes Sub-shapes of aShape.
5980 List of IDs of found sub-shape.
5982 # Example: see GEOM_TestAll.py
5983 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5984 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5990 ## @addtogroup l4_decompose
5993 ## Get all sub-shapes and groups of \a theShape,
5994 # that were created already by any other methods.
5995 # @param theShape Any shape.
5996 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5997 # returned, else all found sub-shapes and groups.
5998 # @return List of existing sub-objects of \a theShape.
6000 # @ref swig_all_decompose "Example"
6001 @ManageTransactions("ShapesOp")
6002 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6004 Get all sub-shapes and groups of theShape,
6005 that were created already by any other methods.
6009 theGroupsOnly If this parameter is TRUE, only groups will be
6010 returned, else all found sub-shapes and groups.
6013 List of existing sub-objects of theShape.
6015 # Example: see GEOM_TestAll.py
6016 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6017 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6020 ## Get all groups of \a theShape,
6021 # that were created already by any other methods.
6022 # @param theShape Any shape.
6023 # @return List of existing groups of \a theShape.
6025 # @ref swig_all_decompose "Example"
6026 @ManageTransactions("ShapesOp")
6027 def GetGroups(self, theShape):
6029 Get all groups of theShape,
6030 that were created already by any other methods.
6036 List of existing groups of theShape.
6038 # Example: see GEOM_TestAll.py
6039 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6040 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6043 ## Explode a shape on sub-shapes of a given type.
6044 # If the shape itself matches the type, it is also returned.
6045 # @param aShape Shape to be exploded.
6046 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6047 # @param theName Object name; when specified, this parameter is used
6048 # for result publication in the study. Otherwise, if automatic
6049 # publication is switched on, default value is used for result name.
6051 # @return List of sub-shapes of type theShapeType, contained in theShape.
6053 # @ref swig_all_decompose "Example"
6054 @ManageTransactions("ShapesOp")
6055 def SubShapeAll(self, aShape, aType, theName=None):
6057 Explode a shape on sub-shapes of a given type.
6058 If the shape itself matches the type, it is also returned.
6061 aShape Shape to be exploded.
6062 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6063 theName Object name; when specified, this parameter is used
6064 for result publication in the study. Otherwise, if automatic
6065 publication is switched on, default value is used for result name.
6068 List of sub-shapes of type theShapeType, contained in theShape.
6070 # Example: see GEOM_TestAll.py
6071 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6072 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6073 self._autoPublish(ListObj, theName, "subshape")
6076 ## Explode a shape on sub-shapes of a given type.
6077 # @param aShape Shape to be exploded.
6078 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6079 # @return List of IDs of sub-shapes.
6081 # @ref swig_all_decompose "Example"
6082 @ManageTransactions("ShapesOp")
6083 def SubShapeAllIDs(self, aShape, aType):
6085 Explode a shape on sub-shapes of a given type.
6088 aShape Shape to be exploded (see geompy.ShapeType)
6089 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6092 List of IDs of sub-shapes.
6094 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6095 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6098 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6099 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6100 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6101 # @param aShape Shape to get sub-shape of.
6102 # @param ListOfInd List of sub-shapes indices.
6103 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6104 # @param theName Object name; when specified, this parameter is used
6105 # for result publication in the study. Otherwise, if automatic
6106 # publication is switched on, default value is used for result name.
6108 # @return A compound of sub-shapes of aShape.
6110 # @ref swig_all_decompose "Example"
6111 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6113 Obtain a compound of sub-shapes of aShape,
6114 selected by their indices in list of all sub-shapes of type aType.
6115 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6118 aShape Shape to get sub-shape of.
6119 ListOfID List of sub-shapes indices.
6120 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6121 theName Object name; when specified, this parameter is used
6122 for result publication in the study. Otherwise, if automatic
6123 publication is switched on, default value is used for result name.
6126 A compound of sub-shapes of aShape.
6128 # Example: see GEOM_TestAll.py
6130 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6131 for ind in ListOfInd:
6132 ListOfIDs.append(AllShapeIDsList[ind - 1])
6133 # note: auto-publishing is done in self.GetSubShape()
6134 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6137 ## Explode a shape on sub-shapes of a given type.
6138 # Sub-shapes will be sorted taking into account their gravity centers,
6139 # to provide stable order of sub-shapes.
6140 # If the shape itself matches the type, it is also returned.
6141 # @param aShape Shape to be exploded.
6142 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6143 # @param theName Object name; when specified, this parameter is used
6144 # for result publication in the study. Otherwise, if automatic
6145 # publication is switched on, default value is used for result name.
6147 # @return List of sub-shapes of type theShapeType, contained in theShape.
6149 # @ref swig_SubShapeAllSorted "Example"
6150 @ManageTransactions("ShapesOp")
6151 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6153 Explode a shape on sub-shapes of a given type.
6154 Sub-shapes will be sorted taking into account their gravity centers,
6155 to provide stable order of sub-shapes.
6156 If the shape itself matches the type, it is also returned.
6159 aShape Shape to be exploded.
6160 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6161 theName Object name; when specified, this parameter is used
6162 for result publication in the study. Otherwise, if automatic
6163 publication is switched on, default value is used for result name.
6166 List of sub-shapes of type theShapeType, contained in theShape.
6168 # Example: see GEOM_TestAll.py
6169 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6170 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6171 self._autoPublish(ListObj, theName, "subshape")
6174 ## Explode a shape on sub-shapes of a given type.
6175 # Sub-shapes will be sorted taking into account their gravity centers,
6176 # to provide stable order of sub-shapes.
6177 # @param aShape Shape to be exploded.
6178 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6179 # @return List of IDs of sub-shapes.
6181 # @ref swig_all_decompose "Example"
6182 @ManageTransactions("ShapesOp")
6183 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6185 Explode a shape on sub-shapes of a given type.
6186 Sub-shapes will be sorted taking into account their gravity centers,
6187 to provide stable order of sub-shapes.
6190 aShape Shape to be exploded.
6191 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6194 List of IDs of sub-shapes.
6196 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6197 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6200 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6201 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6202 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6203 # @param aShape Shape to get sub-shape of.
6204 # @param ListOfInd List of sub-shapes indices.
6205 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6206 # @param theName Object name; when specified, this parameter is used
6207 # for result publication in the study. Otherwise, if automatic
6208 # publication is switched on, default value is used for result name.
6210 # @return A compound of sub-shapes of aShape.
6212 # @ref swig_all_decompose "Example"
6213 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6215 Obtain a compound of sub-shapes of aShape,
6216 selected by they indices in sorted list of all sub-shapes of type aType.
6217 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6220 aShape Shape to get sub-shape of.
6221 ListOfID List of sub-shapes indices.
6222 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6223 theName Object name; when specified, this parameter is used
6224 for result publication in the study. Otherwise, if automatic
6225 publication is switched on, default value is used for result name.
6228 A compound of sub-shapes of aShape.
6230 # Example: see GEOM_TestAll.py
6232 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6233 for ind in ListOfInd:
6234 ListOfIDs.append(AllShapeIDsList[ind - 1])
6235 # note: auto-publishing is done in self.GetSubShape()
6236 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6239 ## Extract shapes (excluding the main shape) of given type.
6240 # @param aShape The shape.
6241 # @param aType The shape type (see ShapeType())
6242 # @param isSorted Boolean flag to switch sorting on/off.
6243 # @param theName Object name; when specified, this parameter is used
6244 # for result publication in the study. Otherwise, if automatic
6245 # publication is switched on, default value is used for result name.
6247 # @return List of sub-shapes of type aType, contained in aShape.
6249 # @ref swig_FilletChamfer "Example"
6250 @ManageTransactions("ShapesOp")
6251 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6253 Extract shapes (excluding the main shape) of given type.
6257 aType The shape type (see geompy.ShapeType)
6258 isSorted Boolean flag to switch sorting on/off.
6259 theName Object name; when specified, this parameter is used
6260 for result publication in the study. Otherwise, if automatic
6261 publication is switched on, default value is used for result name.
6264 List of sub-shapes of type aType, contained in aShape.
6266 # Example: see GEOM_TestAll.py
6267 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6268 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6269 self._autoPublish(ListObj, theName, "subshape")
6272 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6273 # @param aShape Main shape.
6274 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6275 # @param theName Object name; when specified, this parameter is used
6276 # for result publication in the study. Otherwise, if automatic
6277 # publication is switched on, default value is used for result name.
6278 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6280 # @ref swig_all_decompose "Example"
6281 @ManageTransactions("ShapesOp")
6282 def SubShapes(self, aShape, anIDs, theName=None):
6284 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6288 anIDs List of unique IDs of sub-shapes inside theMainShape.
6289 theName Object name; when specified, this parameter is used
6290 for result publication in the study. Otherwise, if automatic
6291 publication is switched on, default value is used for result name.
6294 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6296 # Example: see GEOM_TestAll.py
6297 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6298 RaiseIfFailed("SubShapes", self.ShapesOp)
6299 self._autoPublish(ListObj, theName, "subshape")
6302 ## Explode a shape into edges sorted in a row from a starting point.
6303 # @param theShape the shape to be exploded on edges.
6304 # @param theStartPoint the starting point.
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.
6308 # @return List of GEOM.GEOM_Object that is actually an ordered list
6309 # of edges sorted in a row from a starting point.
6311 # @ref swig_GetSubShapeEdgeSorted "Example"
6312 @ManageTransactions("ShapesOp")
6313 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6315 Explode a shape into edges sorted in a row from a starting point.
6318 theShape the shape to be exploded on edges.
6319 theStartPoint the starting point.
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 List of GEOM.GEOM_Object that is actually an ordered list
6326 of edges sorted in a row from a starting point.
6328 # Example: see GEOM_TestAll.py
6329 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6330 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6331 self._autoPublish(ListObj, theName, "SortedEdges")
6334 ## Check if the object is a sub-object of another GEOM object.
6335 # @param aSubObject Checked sub-object (or its parent object, in case if
6336 # \a theSubObjectIndex is non-zero).
6337 # @param anObject An object that is checked for ownership (or its parent object,
6338 # in case if \a theObjectIndex is non-zero).
6339 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6340 # identifies a sub-object within its parent specified via \a theSubObject.
6341 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6342 # identifies an object within its parent specified via \a theObject.
6343 # @return TRUE, if the given object contains sub-object.
6344 @ManageTransactions("ShapesOp")
6345 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6347 Check if the object is a sub-object of another GEOM object.
6350 aSubObject Checked sub-object (or its parent object, in case if
6351 \a theSubObjectIndex is non-zero).
6352 anObject An object that is checked for ownership (or its parent object,
6353 in case if \a theObjectIndex is non-zero).
6354 aSubObjectIndex When non-zero, specifies a sub-shape index that
6355 identifies a sub-object within its parent specified via \a theSubObject.
6356 anObjectIndex When non-zero, specifies a sub-shape index that
6357 identifies an object within its parent specified via \a theObject.
6360 TRUE, if the given object contains sub-object.
6362 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6363 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6366 # end of l4_decompose
6369 ## @addtogroup l4_decompose_d
6372 ## Deprecated method
6373 # It works like SubShapeAllSortedCentres(), but wrongly
6374 # defines centres of faces, shells and solids.
6375 @ManageTransactions("ShapesOp")
6376 def SubShapeAllSorted(self, aShape, aType, theName=None):
6379 It works like geompy.SubShapeAllSortedCentres, but wrongly
6380 defines centres of faces, shells and solids.
6382 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6383 RaiseIfFailed("MakeExplode", self.ShapesOp)
6384 self._autoPublish(ListObj, theName, "subshape")
6387 ## Deprecated method
6388 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6389 # defines centres of faces, shells and solids.
6390 @ManageTransactions("ShapesOp")
6391 def SubShapeAllSortedIDs(self, aShape, aType):
6394 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6395 defines centres of faces, shells and solids.
6397 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6398 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6401 ## Deprecated method
6402 # It works like SubShapeSortedCentres(), but has a bug
6403 # (wrongly defines centres of faces, shells and solids).
6404 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6407 It works like geompy.SubShapeSortedCentres, but has a bug
6408 (wrongly defines centres of faces, shells and solids).
6411 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6412 for ind in ListOfInd:
6413 ListOfIDs.append(AllShapeIDsList[ind - 1])
6414 # note: auto-publishing is done in self.GetSubShape()
6415 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6418 # end of l4_decompose_d
6421 ## @addtogroup l3_healing
6424 ## Apply a sequence of Shape Healing operators to the given object.
6425 # @param theShape Shape to be processed.
6426 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6427 # @param theParameters List of names of parameters
6428 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6429 # @param theValues List of values of parameters, in the same order
6430 # as parameters are listed in <VAR>theParameters</VAR> list.
6431 # @param theName Object name; when specified, this parameter is used
6432 # for result publication in the study. Otherwise, if automatic
6433 # publication is switched on, default value is used for result name.
6435 # <b> Operators and Parameters: </b> \n
6437 # * \b FixShape - corrects invalid shapes. \n
6438 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6439 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6441 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6442 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6443 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6444 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6445 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6446 # - \b DropSmallSolids.WidthFactorThreshold - defines maximum value of <em>2V/S</em> of a solid which is considered small, where \a V is volume and \a S is surface area of the solid. \n
6447 # - \b DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria. \n
6448 # - \b DropSmallSolids.MergeSolids - if "1", small solids are removed; if "0" small solids are merged to adjacent non-small solids or left untouched if cannot be merged. \n
6450 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6451 # surfaces in segments using a certain angle. \n
6452 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6453 # if Angle=180, four if Angle=90, etc). \n
6454 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6456 # * \b SplitClosedFaces - splits closed faces in segments.
6457 # The number of segments depends on the number of splitting points.\n
6458 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6460 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6461 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6462 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6463 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6464 # This and the previous parameters can take the following values:\n
6465 # \b Parametric \b Continuity \n
6466 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6467 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6468 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6469 # ruling out sharp edges).\n
6470 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6471 # are of the same magnitude).\n
6472 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6473 # or surfaces (d/du C(u)) are the same at junction. \n
6474 # \b Geometric \b Continuity \n
6475 # \b G1: first derivatives are proportional at junction.\n
6476 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6477 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6478 # \b G2: first and second derivatives are proportional at junction.
6479 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6480 # continuity requires that the underlying parameterization was continuous as well.
6481 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6483 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6484 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6485 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6486 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6487 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6488 # with the specified parameters.\n
6489 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6490 # with the specified parameters.\n
6491 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6492 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6493 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6494 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6496 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6497 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6498 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6499 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6500 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6502 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6503 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6506 # @return New GEOM.GEOM_Object, containing processed shape.
6508 # \n @ref tui_shape_processing "Example"
6509 @ManageTransactions("HealOp")
6510 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6512 Apply a sequence of Shape Healing operators to the given object.
6515 theShape Shape to be processed.
6516 theValues List of values of parameters, in the same order
6517 as parameters are listed in theParameters list.
6518 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6519 theParameters List of names of parameters
6520 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6521 theName Object name; when specified, this parameter is used
6522 for result publication in the study. Otherwise, if automatic
6523 publication is switched on, default value is used for result name.
6525 Operators and Parameters:
6527 * FixShape - corrects invalid shapes.
6528 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6529 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6530 * FixFaceSize - removes small faces, such as spots and strips.
6531 * FixFaceSize.Tolerance - defines minimum possible face size.
6532 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6533 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6534 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6535 * DropSmallSolids.WidthFactorThreshold - defines maximum value of 2V/S of a solid which is considered small, where V is volume and S is surface area of the solid.
6536 * DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria.
6537 * DropSmallSolids.MergeSolids - if '1', small solids are removed; if '0' small solids are merged to adjacent non-small solids or left untouched if cannot be merged.
6539 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6540 in segments using a certain angle.
6541 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6542 if Angle=180, four if Angle=90, etc).
6543 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6544 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6546 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6547 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6548 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6549 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6550 * SplitContinuity.CurveContinuity - required continuity for curves.
6551 This and the previous parameters can take the following values:
6553 Parametric Continuity:
6554 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6555 coincidental. The curves or surfaces may still meet at an angle,
6556 giving rise to a sharp corner or edge).
6557 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6558 are parallel, ruling out sharp edges).
6559 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6560 or surfaces are of the same magnitude).
6561 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6562 curves or surfaces (d/du C(u)) are the same at junction.
6564 Geometric Continuity:
6565 G1: first derivatives are proportional at junction.
6566 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6567 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6568 G2: first and second derivatives are proportional at junction. As the names imply,
6569 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6570 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6571 geometric continuity of order n, but not vice-versa.
6572 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6573 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6574 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6575 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6576 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6577 the specified parameters.
6578 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6579 the specified parameters.
6580 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6581 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6582 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6583 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6584 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6585 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6586 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6587 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6588 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6589 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6590 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6593 New GEOM.GEOM_Object, containing processed shape.
6595 Note: For more information look through SALOME Geometry User's Guide->
6596 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6598 # Example: see GEOM_TestHealing.py
6599 theValues,Parameters = ParseList(theValues)
6600 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6601 # To avoid script failure in case of good argument shape
6602 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6604 RaiseIfFailed("ProcessShape", self.HealOp)
6605 for string in (theOperators + theParameters):
6606 Parameters = ":" + Parameters
6608 anObj.SetParameters(Parameters)
6609 self._autoPublish(anObj, theName, "healed")
6612 ## Remove faces from the given object (shape).
6613 # @param theObject Shape to be processed.
6614 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6615 # removes ALL faces of the given object.
6616 # @param theName Object name; when specified, this parameter is used
6617 # for result publication in the study. Otherwise, if automatic
6618 # publication is switched on, default value is used for result name.
6620 # @return New GEOM.GEOM_Object, containing processed shape.
6622 # @ref tui_suppress_faces "Example"
6623 @ManageTransactions("HealOp")
6624 def SuppressFaces(self, theObject, theFaces, theName=None):
6626 Remove faces from the given object (shape).
6629 theObject Shape to be processed.
6630 theFaces Indices of faces to be removed, if EMPTY then the method
6631 removes ALL faces of the given object.
6632 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.
6637 New GEOM.GEOM_Object, containing processed shape.
6639 # Example: see GEOM_TestHealing.py
6640 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6641 RaiseIfFailed("SuppressFaces", self.HealOp)
6642 self._autoPublish(anObj, theName, "suppressFaces")
6645 ## Sewing of faces into a single shell.
6646 # @param ListShape Shapes to be processed.
6647 # @param theTolerance Required tolerance value.
6648 # @param AllowNonManifold Flag that allows non-manifold sewing.
6649 # @param theName Object name; when specified, this parameter is used
6650 # for result publication in the study. Otherwise, if automatic
6651 # publication is switched on, default value is used for result name.
6653 # @return New GEOM.GEOM_Object, containing a result shell.
6655 # @ref tui_sewing "Example"
6656 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6658 Sewing of faces into a single shell.
6661 ListShape Shapes to be processed.
6662 theTolerance Required tolerance value.
6663 AllowNonManifold Flag that allows non-manifold sewing.
6664 theName Object name; when specified, this parameter is used
6665 for result publication in the study. Otherwise, if automatic
6666 publication is switched on, default value is used for result name.
6669 New GEOM.GEOM_Object, containing containing a result shell.
6671 # Example: see GEOM_TestHealing.py
6672 # note: auto-publishing is done in self.Sew()
6673 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6676 ## Sewing of faces into a single shell.
6677 # @param ListShape Shapes to be processed.
6678 # @param theTolerance Required tolerance value.
6679 # @param AllowNonManifold Flag that allows non-manifold sewing.
6680 # @param 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.
6684 # @return New GEOM.GEOM_Object, containing a result shell.
6685 @ManageTransactions("HealOp")
6686 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6688 Sewing of faces into a single shell.
6691 ListShape Shapes to be processed.
6692 theTolerance Required tolerance value.
6693 AllowNonManifold Flag that allows non-manifold sewing.
6694 theName Object name; when specified, this parameter is used
6695 for result publication in the study. Otherwise, if automatic
6696 publication is switched on, default value is used for result name.
6699 New GEOM.GEOM_Object, containing a result shell.
6701 # Example: see MakeSewing() above
6702 theTolerance,Parameters = ParseParameters(theTolerance)
6703 if AllowNonManifold:
6704 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
6706 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
6707 # To avoid script failure in case of good argument shape
6708 # (Fix of test cases geom/bugs11/L7,L8)
6709 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6711 RaiseIfFailed("Sew", self.HealOp)
6712 anObj.SetParameters(Parameters)
6713 self._autoPublish(anObj, theName, "sewed")
6716 ## Rebuild the topology of theSolids by removing
6717 # the faces that are shared by several solids.
6718 # @param theSolids A compound or a list of solids to be processed.
6719 # @param 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.
6723 # @return New GEOM.GEOM_Object, containing processed shape.
6725 # @ref tui_remove_webs "Example"
6726 @ManageTransactions("HealOp")
6727 def RemoveInternalFaces (self, theSolids, theName=None):
6729 Rebuild the topology of theSolids by removing
6730 the faces that are shared by several solids.
6733 theSolids A compound or a list of solids to be processed.
6734 theName Object name; when specified, this parameter is used
6735 for result publication in the study. Otherwise, if automatic
6736 publication is switched on, default value is used for result name.
6739 New GEOM.GEOM_Object, containing processed shape.
6741 # Example: see GEOM_TestHealing.py
6742 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
6743 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
6744 self._autoPublish(anObj, theName, "removeWebs")
6747 ## Remove internal wires and edges from the given object (face).
6748 # @param theObject Shape to be processed.
6749 # @param theWires Indices of wires to be removed, if EMPTY then the method
6750 # removes ALL internal wires of the given object.
6751 # @param theName Object name; when specified, this parameter is used
6752 # for result publication in the study. Otherwise, if automatic
6753 # publication is switched on, default value is used for result name.
6755 # @return New GEOM.GEOM_Object, containing processed shape.
6757 # @ref tui_suppress_internal_wires "Example"
6758 @ManageTransactions("HealOp")
6759 def SuppressInternalWires(self, theObject, theWires, theName=None):
6761 Remove internal wires and edges from the given object (face).
6764 theObject Shape to be processed.
6765 theWires Indices of wires to be removed, if EMPTY then the method
6766 removes ALL internal wires of the given object.
6767 theName Object name; when specified, this parameter is used
6768 for result publication in the study. Otherwise, if automatic
6769 publication is switched on, default value is used for result name.
6772 New GEOM.GEOM_Object, containing processed shape.
6774 # Example: see GEOM_TestHealing.py
6775 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
6776 RaiseIfFailed("RemoveIntWires", self.HealOp)
6777 self._autoPublish(anObj, theName, "suppressWires")
6780 ## Remove internal closed contours (holes) from the given object.
6781 # @param theObject Shape to be processed.
6782 # @param theWires Indices of wires to be removed, if EMPTY then the method
6783 # removes ALL internal holes of the given object
6784 # @param theName Object name; when specified, this parameter is used
6785 # for result publication in the study. Otherwise, if automatic
6786 # publication is switched on, default value is used for result name.
6788 # @return New GEOM.GEOM_Object, containing processed shape.
6790 # @ref tui_suppress_holes "Example"
6791 @ManageTransactions("HealOp")
6792 def SuppressHoles(self, theObject, theWires, theName=None):
6794 Remove internal closed contours (holes) from the given object.
6797 theObject Shape to be processed.
6798 theWires Indices of wires to be removed, if EMPTY then the method
6799 removes ALL internal holes of the given object
6800 theName Object name; when specified, this parameter is used
6801 for result publication in the study. Otherwise, if automatic
6802 publication is switched on, default value is used for result name.
6805 New GEOM.GEOM_Object, containing processed shape.
6807 # Example: see GEOM_TestHealing.py
6808 anObj = self.HealOp.FillHoles(theObject, theWires)
6809 RaiseIfFailed("FillHoles", self.HealOp)
6810 self._autoPublish(anObj, theName, "suppressHoles")
6813 ## Close an open wire.
6814 # @param theObject Shape to be processed.
6815 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
6816 # if [ ], then <VAR>theObject</VAR> itself is a wire.
6817 # @param isCommonVertex If True : closure by creation of a common vertex,
6818 # If False : closure by creation of an edge between ends.
6819 # @param theName Object name; when specified, this parameter is used
6820 # for result publication in the study. Otherwise, if automatic
6821 # publication is switched on, default value is used for result name.
6823 # @return New GEOM.GEOM_Object, containing processed shape.
6825 # @ref tui_close_contour "Example"
6826 @ManageTransactions("HealOp")
6827 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
6832 theObject Shape to be processed.
6833 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
6834 if [ ], then theObject itself is a wire.
6835 isCommonVertex If True : closure by creation of a common vertex,
6836 If False : closure by creation of an edge between ends.
6837 theName Object name; when specified, this parameter is used
6838 for result publication in the study. Otherwise, if automatic
6839 publication is switched on, default value is used for result name.
6842 New GEOM.GEOM_Object, containing processed shape.
6844 # Example: see GEOM_TestHealing.py
6845 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6846 RaiseIfFailed("CloseContour", self.HealOp)
6847 self._autoPublish(anObj, theName, "closeContour")
6850 ## Addition of a point to a given edge object.
6851 # @param theObject Shape to be processed.
6852 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6853 # if -1, then theObject itself is the edge.
6854 # @param theValue Value of parameter on edge or length parameter,
6855 # depending on \a isByParameter.
6856 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6857 # if FALSE : \a theValue is treated as a length parameter [0..1]
6858 # @param theName Object name; when specified, this parameter is used
6859 # for result publication in the study. Otherwise, if automatic
6860 # publication is switched on, default value is used for result name.
6862 # @return New GEOM.GEOM_Object, containing processed shape.
6864 # @ref tui_add_point_on_edge "Example"
6865 @ManageTransactions("HealOp")
6866 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6868 Addition of a point to a given edge object.
6871 theObject Shape to be processed.
6872 theEdgeIndex Index of edge to be divided within theObject's shape,
6873 if -1, then theObject itself is the edge.
6874 theValue Value of parameter on edge or length parameter,
6875 depending on isByParameter.
6876 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6877 if FALSE : theValue is treated as a length parameter [0..1]
6878 theName Object name; when specified, this parameter is used
6879 for result publication in the study. Otherwise, if automatic
6880 publication is switched on, default value is used for result name.
6883 New GEOM.GEOM_Object, containing processed shape.
6885 # Example: see GEOM_TestHealing.py
6886 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6887 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6888 RaiseIfFailed("DivideEdge", self.HealOp)
6889 anObj.SetParameters(Parameters)
6890 self._autoPublish(anObj, theName, "divideEdge")
6893 ## Addition of points to a given edge of \a theObject by projecting
6894 # other points to the given edge.
6895 # @param theObject Shape to be processed.
6896 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6897 # if -1, then theObject itself is the edge.
6898 # @param thePoints List of points to project to theEdgeIndex-th edge.
6899 # @param theName Object name; when specified, this parameter is used
6900 # for result publication in the study. Otherwise, if automatic
6901 # publication is switched on, default value is used for result name.
6903 # @return New GEOM.GEOM_Object, containing processed shape.
6905 # @ref tui_add_point_on_edge "Example"
6906 @ManageTransactions("HealOp")
6907 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
6909 Addition of points to a given edge of \a theObject by projecting
6910 other points to the given edge.
6913 theObject Shape to be processed.
6914 theEdgeIndex The edge or its index to be divided within theObject's shape,
6915 if -1, then theObject itself is the edge.
6916 thePoints List of points to project to theEdgeIndex-th edge.
6917 theName Object name; when specified, this parameter is used
6918 for result publication in the study. Otherwise, if automatic
6919 publication is switched on, default value is used for result name.
6922 New GEOM.GEOM_Object, containing processed shape.
6924 # Example: see GEOM_TestHealing.py
6925 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
6926 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
6927 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
6928 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
6929 self._autoPublish(anObj, theName, "divideEdge")
6932 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6933 # @param theWire Wire to minimize the number of C1 continuous edges in.
6934 # @param theVertices A list of vertices to suppress. If the list
6935 # is empty, all vertices in a wire will be assumed.
6936 # @param theName Object name; when specified, this parameter is used
6937 # for result publication in the study. Otherwise, if automatic
6938 # publication is switched on, default value is used for result name.
6940 # @return New GEOM.GEOM_Object with modified wire.
6942 # @ref tui_fuse_collinear_edges "Example"
6943 @ManageTransactions("HealOp")
6944 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6946 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6949 theWire Wire to minimize the number of C1 continuous edges in.
6950 theVertices A list of vertices to suppress. If the list
6951 is empty, all vertices in a wire will be assumed.
6952 theName Object name; when specified, this parameter is used
6953 for result publication in the study. Otherwise, if automatic
6954 publication is switched on, default value is used for result name.
6957 New GEOM.GEOM_Object with modified wire.
6959 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6960 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6961 self._autoPublish(anObj, theName, "fuseEdges")
6964 ## Change orientation of the given object. Updates given shape.
6965 # @param theObject Shape to be processed.
6966 # @return Updated <var>theObject</var>
6968 # @ref swig_todo "Example"
6969 @ManageTransactions("HealOp")
6970 def ChangeOrientationShell(self,theObject):
6972 Change orientation of the given object. Updates given shape.
6975 theObject Shape to be processed.
6980 theObject = self.HealOp.ChangeOrientation(theObject)
6981 RaiseIfFailed("ChangeOrientation", self.HealOp)
6984 ## Change orientation of the given object.
6985 # @param theObject Shape to be processed.
6986 # @param theName Object name; when specified, this parameter is used
6987 # for result publication in the study. Otherwise, if automatic
6988 # publication is switched on, default value is used for result name.
6990 # @return New GEOM.GEOM_Object, containing processed shape.
6992 # @ref swig_todo "Example"
6993 @ManageTransactions("HealOp")
6994 def ChangeOrientationShellCopy(self, theObject, theName=None):
6996 Change orientation of the given object.
6999 theObject Shape to be processed.
7000 theName Object name; when specified, this parameter is used
7001 for result publication in the study. Otherwise, if automatic
7002 publication is switched on, default value is used for result name.
7005 New GEOM.GEOM_Object, containing processed shape.
7007 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7008 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7009 self._autoPublish(anObj, theName, "reversed")
7012 ## Try to limit tolerance of the given object by value \a theTolerance.
7013 # @param theObject Shape to be processed.
7014 # @param theTolerance Required tolerance value.
7015 # @param theName Object name; when specified, this parameter is used
7016 # for result publication in the study. Otherwise, if automatic
7017 # publication is switched on, default value is used for result name.
7019 # @return New GEOM.GEOM_Object, containing processed shape.
7021 # @ref tui_limit_tolerance "Example"
7022 @ManageTransactions("HealOp")
7023 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7025 Try to limit tolerance of the given object by value theTolerance.
7028 theObject Shape to be processed.
7029 theTolerance Required tolerance value.
7030 theName Object name; when specified, this parameter is used
7031 for result publication in the study. Otherwise, if automatic
7032 publication is switched on, default value is used for result name.
7035 New GEOM.GEOM_Object, containing processed shape.
7037 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7038 RaiseIfFailed("LimitTolerance", self.HealOp)
7039 self._autoPublish(anObj, theName, "limitTolerance")
7042 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7043 # that constitute a free boundary of the given shape.
7044 # @param theObject Shape to get free boundary of.
7045 # @param theName Object name; when specified, this parameter is used
7046 # for result publication in the study. Otherwise, if automatic
7047 # publication is switched on, default value is used for result name.
7049 # @return [\a status, \a theClosedWires, \a theOpenWires]
7050 # \n \a status: FALSE, if an error(s) occured during the method execution.
7051 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7052 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7054 # @ref tui_free_boundaries_page "Example"
7055 @ManageTransactions("HealOp")
7056 def GetFreeBoundary(self, theObject, theName=None):
7058 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7059 that constitute a free boundary of the given shape.
7062 theObject Shape to get free boundary of.
7063 theName Object name; when specified, this parameter is used
7064 for result publication in the study. Otherwise, if automatic
7065 publication is switched on, default value is used for result name.
7068 [status, theClosedWires, theOpenWires]
7069 status: FALSE, if an error(s) occured during the method execution.
7070 theClosedWires: Closed wires on the free boundary of the given shape.
7071 theOpenWires: Open wires on the free boundary of the given shape.
7073 # Example: see GEOM_TestHealing.py
7074 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7075 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7076 self._autoPublish(anObj[1], theName, "closedWire")
7077 self._autoPublish(anObj[2], theName, "openWire")
7080 ## Replace coincident faces in \a theShapes by one face.
7081 # @param theShapes Initial shapes, either a list or compound of shapes.
7082 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7083 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7084 # otherwise all initial shapes.
7085 # @param theName Object name; when specified, this parameter is used
7086 # for result publication in the study. Otherwise, if automatic
7087 # publication is switched on, default value is used for result name.
7089 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7091 # @ref tui_glue_faces "Example"
7092 @ManageTransactions("ShapesOp")
7093 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7095 Replace coincident faces in theShapes by one face.
7098 theShapes Initial shapes, either a list or compound of shapes.
7099 theTolerance Maximum distance between faces, which can be considered as coincident.
7100 doKeepNonSolids If FALSE, only solids will present in the result,
7101 otherwise all initial shapes.
7102 theName Object name; when specified, this parameter is used
7103 for result publication in the study. Otherwise, if automatic
7104 publication is switched on, default value is used for result name.
7107 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7109 # Example: see GEOM_Spanner.py
7110 theTolerance,Parameters = ParseParameters(theTolerance)
7111 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7113 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
7114 anObj.SetParameters(Parameters)
7115 self._autoPublish(anObj, theName, "glueFaces")
7118 ## Find coincident faces in \a theShapes for possible gluing.
7119 # @param theShapes Initial shapes, either a list or compound of shapes.
7120 # @param theTolerance Maximum distance between faces,
7121 # which can be considered as coincident.
7122 # @param theName Object name; when specified, this parameter is used
7123 # for result publication in the study. Otherwise, if automatic
7124 # publication is switched on, default value is used for result name.
7126 # @return GEOM.ListOfGO
7128 # @ref tui_glue_faces "Example"
7129 @ManageTransactions("ShapesOp")
7130 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7132 Find coincident faces in theShapes for possible gluing.
7135 theShapes Initial shapes, either a list or compound of shapes.
7136 theTolerance Maximum distance between faces,
7137 which can be considered as coincident.
7138 theName Object name; when specified, this parameter is used
7139 for result publication in the study. Otherwise, if automatic
7140 publication is switched on, default value is used for result name.
7145 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7146 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7147 self._autoPublish(anObj, theName, "facesToGlue")
7150 ## Replace coincident faces in \a theShapes by one face
7151 # in compliance with given list of faces
7152 # @param theShapes Initial shapes, either a list or compound of shapes.
7153 # @param theTolerance Maximum distance between faces,
7154 # which can be considered as coincident.
7155 # @param theFaces List of faces for gluing.
7156 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7157 # otherwise all initial shapes.
7158 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7159 # will be glued, otherwise only the edges,
7160 # belonging to <VAR>theFaces</VAR>.
7161 # @param theName Object name; when specified, this parameter is used
7162 # for result publication in the study. Otherwise, if automatic
7163 # publication is switched on, default value is used for result name.
7165 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7167 # @ref tui_glue_faces "Example"
7168 @ManageTransactions("ShapesOp")
7169 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7170 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7172 Replace coincident faces in theShapes by one face
7173 in compliance with given list of faces
7176 theShapes theShapes Initial shapes, either a list or compound of shapes.
7177 theTolerance Maximum distance between faces,
7178 which can be considered as coincident.
7179 theFaces List of faces for gluing.
7180 doKeepNonSolids If FALSE, only solids will present in the result,
7181 otherwise all initial shapes.
7182 doGlueAllEdges If TRUE, all coincident edges of theShape
7183 will be glued, otherwise only the edges,
7184 belonging to theFaces.
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 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7192 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, theFaces,
7193 doKeepNonSolids, doGlueAllEdges)
7195 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
7196 self._autoPublish(anObj, theName, "glueFaces")
7199 ## Replace coincident edges in \a theShapes by one edge.
7200 # @param theShapes Initial shapes, either a list or compound of shapes.
7201 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7202 # @param theName Object name; when specified, this parameter is used
7203 # for result publication in the study. Otherwise, if automatic
7204 # publication is switched on, default value is used for result name.
7206 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7208 # @ref tui_glue_edges "Example"
7209 @ManageTransactions("ShapesOp")
7210 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7212 Replace coincident edges in theShapes by one edge.
7215 theShapes Initial shapes, either a list or compound of shapes.
7216 theTolerance Maximum distance between edges, which can be considered as coincident.
7217 theName Object name; when specified, this parameter is used
7218 for result publication in the study. Otherwise, if automatic
7219 publication is switched on, default value is used for result name.
7222 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7224 theTolerance,Parameters = ParseParameters(theTolerance)
7225 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7227 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
7228 anObj.SetParameters(Parameters)
7229 self._autoPublish(anObj, theName, "glueEdges")
7232 ## Find coincident edges in \a theShapes for possible gluing.
7233 # @param theShapes Initial shapes, either a list or compound of shapes.
7234 # @param theTolerance Maximum distance between edges,
7235 # which can be considered as coincident.
7236 # @param theName Object name; when specified, this parameter is used
7237 # for result publication in the study. Otherwise, if automatic
7238 # publication is switched on, default value is used for result name.
7240 # @return GEOM.ListOfGO
7242 # @ref tui_glue_edges "Example"
7243 @ManageTransactions("ShapesOp")
7244 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7246 Find coincident edges in theShapes for possible gluing.
7249 theShapes Initial shapes, either a list or compound of shapes.
7250 theTolerance Maximum distance between edges,
7251 which can be considered as coincident.
7252 theName Object name; when specified, this parameter is used
7253 for result publication in the study. Otherwise, if automatic
7254 publication is switched on, default value is used for result name.
7259 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7260 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7261 self._autoPublish(anObj, theName, "edgesToGlue")
7264 ## Replace coincident edges in theShapes by one edge
7265 # in compliance with given list of edges.
7266 # @param theShapes Initial shapes, either a list or compound of shapes.
7267 # @param theTolerance Maximum distance between edges,
7268 # which can be considered as coincident.
7269 # @param theEdges List of edges for gluing.
7270 # @param theName Object name; when specified, this parameter is used
7271 # for result publication in the study. Otherwise, if automatic
7272 # publication is switched on, default value is used for result name.
7274 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7276 # @ref tui_glue_edges "Example"
7277 @ManageTransactions("ShapesOp")
7278 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7280 Replace coincident edges in theShapes by one edge
7281 in compliance with given list of edges.
7284 theShapes Initial shapes, either a list or compound of shapes.
7285 theTolerance Maximum distance between edges,
7286 which can be considered as coincident.
7287 theEdges List of edges for gluing.
7288 theName Object name; when specified, this parameter is used
7289 for result publication in the study. Otherwise, if automatic
7290 publication is switched on, default value is used for result name.
7293 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7295 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7297 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
7298 self._autoPublish(anObj, theName, "glueEdges")
7304 ## @addtogroup l3_boolean Boolean Operations
7307 # -----------------------------------------------------------------------------
7308 # Boolean (Common, Cut, Fuse, Section)
7309 # -----------------------------------------------------------------------------
7311 ## Perform one of boolean operations on two given shapes.
7312 # @param theShape1 First argument for boolean operation.
7313 # @param theShape2 Second argument for boolean operation.
7314 # @param theOperation Indicates the operation to be done:\n
7315 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7316 # @param checkSelfInte The flag that tells if the arguments should
7317 # be checked for self-intersection prior to the operation.
7318 # @param theName Object name; when specified, this parameter is used
7319 # for result publication in the study. Otherwise, if automatic
7320 # publication is switched on, default value is used for result name.
7322 # @note This algorithm doesn't find all types of self-intersections.
7323 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7324 # vertex/face and edge/face intersections. Face/face
7325 # intersections detection is switched off as it is a
7326 # time-consuming operation that gives an impact on performance.
7327 # To find all self-intersections please use
7328 # CheckSelfIntersections() method.
7330 # @return New GEOM.GEOM_Object, containing the result shape.
7332 # @ref tui_fuse "Example"
7333 @ManageTransactions("BoolOp")
7334 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7336 Perform one of boolean operations on two given shapes.
7339 theShape1 First argument for boolean operation.
7340 theShape2 Second argument for boolean operation.
7341 theOperation Indicates the operation to be done:
7342 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7343 checkSelfInte The flag that tells if the arguments should
7344 be checked for self-intersection prior to
7346 theName Object name; when specified, this parameter is used
7347 for result publication in the study. Otherwise, if automatic
7348 publication is switched on, default value is used for result name.
7351 This algorithm doesn't find all types of self-intersections.
7352 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7353 vertex/face and edge/face intersections. Face/face
7354 intersections detection is switched off as it is a
7355 time-consuming operation that gives an impact on performance.
7356 To find all self-intersections please use
7357 CheckSelfIntersections() method.
7360 New GEOM.GEOM_Object, containing the result shape.
7362 # Example: see GEOM_TestAll.py
7363 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7364 RaiseIfFailed("MakeBoolean", self.BoolOp)
7365 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7366 self._autoPublish(anObj, theName, def_names[theOperation])
7369 ## Perform Common boolean operation on two given shapes.
7370 # @param theShape1 First argument for boolean operation.
7371 # @param theShape2 Second argument for boolean operation.
7372 # @param checkSelfInte The flag that tells if the arguments should
7373 # be checked for self-intersection prior to the operation.
7374 # @param theName Object name; when specified, this parameter is used
7375 # for result publication in the study. Otherwise, if automatic
7376 # publication is switched on, default value is used for result name.
7378 # @note This algorithm doesn't find all types of self-intersections.
7379 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7380 # vertex/face and edge/face intersections. Face/face
7381 # intersections detection is switched off as it is a
7382 # time-consuming operation that gives an impact on performance.
7383 # To find all self-intersections please use
7384 # CheckSelfIntersections() method.
7386 # @return New GEOM.GEOM_Object, containing the result shape.
7388 # @ref tui_common "Example 1"
7389 # \n @ref swig_MakeCommon "Example 2"
7390 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7392 Perform Common boolean operation on two given shapes.
7395 theShape1 First argument for boolean operation.
7396 theShape2 Second argument for boolean operation.
7397 checkSelfInte The flag that tells if the arguments should
7398 be checked for self-intersection prior to
7400 theName Object name; when specified, this parameter is used
7401 for result publication in the study. Otherwise, if automatic
7402 publication is switched on, default value is used for result name.
7405 This algorithm doesn't find all types of self-intersections.
7406 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7407 vertex/face and edge/face intersections. Face/face
7408 intersections detection is switched off as it is a
7409 time-consuming operation that gives an impact on performance.
7410 To find all self-intersections please use
7411 CheckSelfIntersections() method.
7414 New GEOM.GEOM_Object, containing the result shape.
7416 # Example: see GEOM_TestOthers.py
7417 # note: auto-publishing is done in self.MakeBoolean()
7418 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7420 ## Perform Cut boolean operation on two given shapes.
7421 # @param theShape1 First argument for boolean operation.
7422 # @param theShape2 Second argument for boolean operation.
7423 # @param checkSelfInte The flag that tells if the arguments should
7424 # be checked for self-intersection prior to the operation.
7425 # @param theName Object name; when specified, this parameter is used
7426 # for result publication in the study. Otherwise, if automatic
7427 # publication is switched on, default value is used for result name.
7429 # @note This algorithm doesn't find all types of self-intersections.
7430 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7431 # vertex/face and edge/face intersections. Face/face
7432 # intersections detection is switched off as it is a
7433 # time-consuming operation that gives an impact on performance.
7434 # To find all self-intersections please use
7435 # CheckSelfIntersections() method.
7437 # @return New GEOM.GEOM_Object, containing the result shape.
7439 # @ref tui_cut "Example 1"
7440 # \n @ref swig_MakeCommon "Example 2"
7441 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7443 Perform Cut boolean operation on two given shapes.
7446 theShape1 First argument for boolean operation.
7447 theShape2 Second argument for boolean operation.
7448 checkSelfInte The flag that tells if the arguments should
7449 be checked for self-intersection prior to
7451 theName Object name; when specified, this parameter is used
7452 for result publication in the study. Otherwise, if automatic
7453 publication is switched on, default value is used for result name.
7456 This algorithm doesn't find all types of self-intersections.
7457 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7458 vertex/face and edge/face intersections. Face/face
7459 intersections detection is switched off as it is a
7460 time-consuming operation that gives an impact on performance.
7461 To find all self-intersections please use
7462 CheckSelfIntersections() method.
7465 New GEOM.GEOM_Object, containing the result shape.
7468 # Example: see GEOM_TestOthers.py
7469 # note: auto-publishing is done in self.MakeBoolean()
7470 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7472 ## Perform Fuse boolean operation on two given shapes.
7473 # @param theShape1 First argument for boolean operation.
7474 # @param theShape2 Second argument for boolean operation.
7475 # @param checkSelfInte The flag that tells if the arguments should
7476 # be checked for self-intersection prior to the operation.
7477 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7478 # operation should be performed during the operation.
7479 # @param theName Object name; when specified, this parameter is used
7480 # for result publication in the study. Otherwise, if automatic
7481 # publication is switched on, default value is used for result name.
7483 # @note This algorithm doesn't find all types of self-intersections.
7484 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7485 # vertex/face and edge/face intersections. Face/face
7486 # intersections detection is switched off as it is a
7487 # time-consuming operation that gives an impact on performance.
7488 # To find all self-intersections please use
7489 # CheckSelfIntersections() method.
7491 # @return New GEOM.GEOM_Object, containing the result shape.
7493 # @ref tui_fuse "Example 1"
7494 # \n @ref swig_MakeCommon "Example 2"
7495 @ManageTransactions("BoolOp")
7496 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7497 rmExtraEdges=False, theName=None):
7499 Perform Fuse boolean operation on two given shapes.
7502 theShape1 First argument for boolean operation.
7503 theShape2 Second argument for boolean operation.
7504 checkSelfInte The flag that tells if the arguments should
7505 be checked for self-intersection prior to
7507 rmExtraEdges The flag that tells if Remove Extra Edges
7508 operation should be performed during the operation.
7509 theName Object name; when specified, this parameter is used
7510 for result publication in the study. Otherwise, if automatic
7511 publication is switched on, default value is used for result name.
7514 This algorithm doesn't find all types of self-intersections.
7515 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7516 vertex/face and edge/face intersections. Face/face
7517 intersections detection is switched off as it is a
7518 time-consuming operation that gives an impact on performance.
7519 To find all self-intersections please use
7520 CheckSelfIntersections() method.
7523 New GEOM.GEOM_Object, containing the result shape.
7526 # Example: see GEOM_TestOthers.py
7527 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7528 checkSelfInte, rmExtraEdges)
7529 RaiseIfFailed("MakeFuse", self.BoolOp)
7530 self._autoPublish(anObj, theName, "fuse")
7533 ## Perform Section boolean operation on two given shapes.
7534 # @param theShape1 First argument for boolean operation.
7535 # @param theShape2 Second argument for boolean operation.
7536 # @param checkSelfInte The flag that tells if the arguments should
7537 # be checked for self-intersection prior to the operation.
7538 # If a self-intersection detected the operation fails.
7539 # @param theName Object name; when specified, this parameter is used
7540 # for result publication in the study. Otherwise, if automatic
7541 # publication is switched on, default value is used for result name.
7542 # @return New GEOM.GEOM_Object, containing the result shape.
7544 # @ref tui_section "Example 1"
7545 # \n @ref swig_MakeCommon "Example 2"
7546 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7548 Perform Section boolean operation on two given shapes.
7551 theShape1 First argument for boolean operation.
7552 theShape2 Second argument for boolean operation.
7553 checkSelfInte The flag that tells if the arguments should
7554 be checked for self-intersection prior to the operation.
7555 If a self-intersection detected the operation fails.
7556 theName Object name; when specified, this parameter is used
7557 for result publication in the study. Otherwise, if automatic
7558 publication is switched on, default value is used for result name.
7560 New GEOM.GEOM_Object, containing the result shape.
7563 # Example: see GEOM_TestOthers.py
7564 # note: auto-publishing is done in self.MakeBoolean()
7565 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7567 ## Perform Fuse boolean operation on the list of shapes.
7568 # @param theShapesList Shapes to be fused.
7569 # @param checkSelfInte The flag that tells if the arguments should
7570 # be checked for self-intersection prior to the operation.
7571 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7572 # operation should be performed during the operation.
7573 # @param theName Object name; when specified, this parameter is used
7574 # for result publication in the study. Otherwise, if automatic
7575 # publication is switched on, default value is used for result name.
7577 # @note This algorithm doesn't find all types of self-intersections.
7578 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7579 # vertex/face and edge/face intersections. Face/face
7580 # intersections detection is switched off as it is a
7581 # time-consuming operation that gives an impact on performance.
7582 # To find all self-intersections please use
7583 # CheckSelfIntersections() method.
7585 # @return New GEOM.GEOM_Object, containing the result shape.
7587 # @ref tui_fuse "Example 1"
7588 # \n @ref swig_MakeCommon "Example 2"
7589 @ManageTransactions("BoolOp")
7590 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7591 rmExtraEdges=False, theName=None):
7593 Perform Fuse boolean operation on the list of shapes.
7596 theShapesList Shapes to be fused.
7597 checkSelfInte The flag that tells if the arguments should
7598 be checked for self-intersection prior to
7600 rmExtraEdges The flag that tells if Remove Extra Edges
7601 operation should be performed during the operation.
7602 theName Object name; when specified, this parameter is used
7603 for result publication in the study. Otherwise, if automatic
7604 publication is switched on, default value is used for result name.
7607 This algorithm doesn't find all types of self-intersections.
7608 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7609 vertex/face and edge/face intersections. Face/face
7610 intersections detection is switched off as it is a
7611 time-consuming operation that gives an impact on performance.
7612 To find all self-intersections please use
7613 CheckSelfIntersections() method.
7616 New GEOM.GEOM_Object, containing the result shape.
7619 # Example: see GEOM_TestOthers.py
7620 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7622 RaiseIfFailed("MakeFuseList", self.BoolOp)
7623 self._autoPublish(anObj, theName, "fuse")
7626 ## Perform Common boolean operation on the list of shapes.
7627 # @param theShapesList Shapes for Common operation.
7628 # @param checkSelfInte The flag that tells if the arguments should
7629 # be checked for self-intersection prior to the operation.
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 # @note This algorithm doesn't find all types of self-intersections.
7635 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7636 # vertex/face and edge/face intersections. Face/face
7637 # intersections detection is switched off as it is a
7638 # time-consuming operation that gives an impact on performance.
7639 # To find all self-intersections please use
7640 # CheckSelfIntersections() method.
7642 # @return New GEOM.GEOM_Object, containing the result shape.
7644 # @ref tui_common "Example 1"
7645 # \n @ref swig_MakeCommon "Example 2"
7646 @ManageTransactions("BoolOp")
7647 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7649 Perform Common boolean operation on the list of shapes.
7652 theShapesList Shapes for Common operation.
7653 checkSelfInte The flag that tells if the arguments should
7654 be checked for self-intersection prior to
7656 theName Object name; when specified, this parameter is used
7657 for result publication in the study. Otherwise, if automatic
7658 publication is switched on, default value is used for result name.
7661 This algorithm doesn't find all types of self-intersections.
7662 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7663 vertex/face and edge/face intersections. Face/face
7664 intersections detection is switched off as it is a
7665 time-consuming operation that gives an impact on performance.
7666 To find all self-intersections please use
7667 CheckSelfIntersections() method.
7670 New GEOM.GEOM_Object, containing the result shape.
7673 # Example: see GEOM_TestOthers.py
7674 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7675 RaiseIfFailed("MakeCommonList", self.BoolOp)
7676 self._autoPublish(anObj, theName, "common")
7679 ## Perform Cut boolean operation on one object and the list of tools.
7680 # @param theMainShape The object of the operation.
7681 # @param theShapesList The list of tools of the operation.
7682 # @param checkSelfInte The flag that tells if the arguments should
7683 # be checked for self-intersection prior to the operation.
7684 # @param theName Object name; when specified, this parameter is used
7685 # for result publication in the study. Otherwise, if automatic
7686 # publication is switched on, default value is used for result name.
7688 # @note This algorithm doesn't find all types of self-intersections.
7689 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7690 # vertex/face and edge/face intersections. Face/face
7691 # intersections detection is switched off as it is a
7692 # time-consuming operation that gives an impact on performance.
7693 # To find all self-intersections please use
7694 # CheckSelfIntersections() method.
7696 # @return New GEOM.GEOM_Object, containing the result shape.
7698 # @ref tui_cut "Example 1"
7699 # \n @ref swig_MakeCommon "Example 2"
7700 @ManageTransactions("BoolOp")
7701 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7703 Perform Cut boolean operation on one object and the list of tools.
7706 theMainShape The object of the operation.
7707 theShapesList The list of tools of the operation.
7708 checkSelfInte The flag that tells if the arguments should
7709 be checked for self-intersection prior to
7711 theName Object name; when specified, this parameter is used
7712 for result publication in the study. Otherwise, if automatic
7713 publication is switched on, default value is used for result name.
7716 This algorithm doesn't find all types of self-intersections.
7717 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7718 vertex/face and edge/face intersections. Face/face
7719 intersections detection is switched off as it is a
7720 time-consuming operation that gives an impact on performance.
7721 To find all self-intersections please use
7722 CheckSelfIntersections() method.
7725 New GEOM.GEOM_Object, containing the result shape.
7728 # Example: see GEOM_TestOthers.py
7729 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
7730 RaiseIfFailed("MakeCutList", self.BoolOp)
7731 self._autoPublish(anObj, theName, "cut")
7737 ## @addtogroup l3_basic_op
7740 ## Perform partition operation.
7741 # @param ListShapes Shapes to be intersected.
7742 # @param ListTools Shapes to intersect theShapes.
7743 # @param Limit Type of resulting shapes (see ShapeType()).\n
7744 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
7745 # type will be detected automatically.
7746 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
7747 # target type (equal to Limit) are kept in the result,
7748 # else standalone shapes of lower dimension
7749 # are kept also (if they exist).
7751 # @param theName Object name; when specified, this parameter is used
7752 # for result publication in the study. Otherwise, if automatic
7753 # publication is switched on, default value is used for result name.
7755 # @note Each compound from ListShapes and ListTools will be exploded
7756 # in order to avoid possible intersection between shapes from this compound.
7758 # After implementation new version of PartitionAlgo (October 2006)
7759 # other parameters are ignored by current functionality. They are kept
7760 # in this function only for support old versions.
7761 # @param ListKeepInside Shapes, outside which the results will be deleted.
7762 # Each shape from theKeepInside must belong to theShapes also.
7763 # @param ListRemoveInside Shapes, inside which the results will be deleted.
7764 # Each shape from theRemoveInside must belong to theShapes also.
7765 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
7766 # @param ListMaterials Material indices for each shape. Make sence,
7767 # only if theRemoveWebs is TRUE.
7769 # @return New GEOM.GEOM_Object, containing the result shapes.
7771 # @ref tui_partition "Example"
7772 @ManageTransactions("BoolOp")
7773 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7774 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7775 KeepNonlimitShapes=0, theName=None):
7777 Perform partition operation.
7780 ListShapes Shapes to be intersected.
7781 ListTools Shapes to intersect theShapes.
7782 Limit Type of resulting shapes (see geompy.ShapeType)
7783 If this parameter is set to -1 ("Auto"), most appropriate shape limit
7784 type will be detected automatically.
7785 KeepNonlimitShapes if this parameter == 0, then only shapes of
7786 target type (equal to Limit) are kept in the result,
7787 else standalone shapes of lower dimension
7788 are kept also (if they exist).
7790 theName Object name; when specified, this parameter is used
7791 for result publication in the study. Otherwise, if automatic
7792 publication is switched on, default value is used for result name.
7794 Each compound from ListShapes and ListTools will be exploded
7795 in order to avoid possible intersection between shapes from
7798 After implementation new version of PartitionAlgo (October 2006) other
7799 parameters are ignored by current functionality. They are kept in this
7800 function only for support old versions.
7803 ListKeepInside Shapes, outside which the results will be deleted.
7804 Each shape from theKeepInside must belong to theShapes also.
7805 ListRemoveInside Shapes, inside which the results will be deleted.
7806 Each shape from theRemoveInside must belong to theShapes also.
7807 RemoveWebs If TRUE, perform Glue 3D algorithm.
7808 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
7811 New GEOM.GEOM_Object, containing the result shapes.
7813 # Example: see GEOM_TestAll.py
7814 if Limit == self.ShapeType["AUTO"]:
7815 # automatic detection of the most appropriate shape limit type
7817 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7818 Limit = EnumToLong(lim)
7820 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
7821 ListKeepInside, ListRemoveInside,
7822 Limit, RemoveWebs, ListMaterials,
7823 KeepNonlimitShapes);
7824 RaiseIfFailed("MakePartition", self.BoolOp)
7825 self._autoPublish(anObj, theName, "partition")
7828 ## Perform partition operation.
7829 # This method may be useful if it is needed to make a partition for
7830 # compound contains nonintersected shapes. Performance will be better
7831 # since intersection between shapes from compound is not performed.
7833 # Description of all parameters as in previous method MakePartition().
7834 # One additional parameter is provided:
7835 # @param checkSelfInte The flag that tells if the arguments should
7836 # be checked for self-intersection prior to the operation.
7838 # @note This algorithm doesn't find all types of self-intersections.
7839 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7840 # vertex/face and edge/face intersections. Face/face
7841 # intersections detection is switched off as it is a
7842 # time-consuming operation that gives an impact on performance.
7843 # To find all self-intersections please use
7844 # CheckSelfIntersections() method.
7846 # @note Passed compounds (via ListShapes or via ListTools)
7847 # have to consist of nonintersecting shapes.
7849 # @return New GEOM.GEOM_Object, containing the result shapes.
7851 # @ref swig_todo "Example"
7852 @ManageTransactions("BoolOp")
7853 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
7854 ListKeepInside=[], ListRemoveInside=[],
7855 Limit=ShapeType["AUTO"], RemoveWebs=0,
7856 ListMaterials=[], KeepNonlimitShapes=0,
7857 checkSelfInte=False, theName=None):
7859 Perform partition operation.
7860 This method may be useful if it is needed to make a partition for
7861 compound contains nonintersected shapes. Performance will be better
7862 since intersection between shapes from compound is not performed.
7865 Description of all parameters as in method geompy.MakePartition.
7866 One additional parameter is provided:
7867 checkSelfInte The flag that tells if the arguments should
7868 be checked for self-intersection prior to
7872 This algorithm doesn't find all types of self-intersections.
7873 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7874 vertex/face and edge/face intersections. Face/face
7875 intersections detection is switched off as it is a
7876 time-consuming operation that gives an impact on performance.
7877 To find all self-intersections please use
7878 CheckSelfIntersections() method.
7881 Passed compounds (via ListShapes or via ListTools)
7882 have to consist of nonintersecting shapes.
7885 New GEOM.GEOM_Object, containing the result shapes.
7887 if Limit == self.ShapeType["AUTO"]:
7888 # automatic detection of the most appropriate shape limit type
7890 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
7891 Limit = EnumToLong(lim)
7893 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
7894 ListKeepInside, ListRemoveInside,
7895 Limit, RemoveWebs, ListMaterials,
7896 KeepNonlimitShapes, checkSelfInte);
7897 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
7898 self._autoPublish(anObj, theName, "partition")
7901 ## See method MakePartition() for more information.
7903 # @ref tui_partition "Example 1"
7904 # \n @ref swig_Partition "Example 2"
7905 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
7906 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
7907 KeepNonlimitShapes=0, theName=None):
7909 See method geompy.MakePartition for more information.
7911 # Example: see GEOM_TestOthers.py
7912 # note: auto-publishing is done in self.MakePartition()
7913 anObj = self.MakePartition(ListShapes, ListTools,
7914 ListKeepInside, ListRemoveInside,
7915 Limit, RemoveWebs, ListMaterials,
7916 KeepNonlimitShapes, theName);
7919 ## Perform partition of the Shape with the Plane
7920 # @param theShape Shape to be intersected.
7921 # @param thePlane Tool shape, to intersect theShape.
7922 # @param theName Object name; when specified, this parameter is used
7923 # for result publication in the study. Otherwise, if automatic
7924 # publication is switched on, default value is used for result name.
7926 # @return New GEOM.GEOM_Object, containing the result shape.
7928 # @ref tui_partition "Example"
7929 @ManageTransactions("BoolOp")
7930 def MakeHalfPartition(self, theShape, thePlane, theName=None):
7932 Perform partition of the Shape with the Plane
7935 theShape Shape to be intersected.
7936 thePlane Tool shape, to intersect theShape.
7937 theName Object name; when specified, this parameter is used
7938 for result publication in the study. Otherwise, if automatic
7939 publication is switched on, default value is used for result name.
7942 New GEOM.GEOM_Object, containing the result shape.
7944 # Example: see GEOM_TestAll.py
7945 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
7946 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
7947 self._autoPublish(anObj, theName, "partition")
7950 # end of l3_basic_op
7953 ## @addtogroup l3_transform
7956 ## Translate the given object along the vector, specified
7957 # by its end points.
7958 # @param theObject The object to be translated.
7959 # @param thePoint1 Start point of translation vector.
7960 # @param thePoint2 End point of translation vector.
7961 # @param theCopy Flag used to translate object itself or create a copy.
7962 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7963 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
7964 @ManageTransactions("TrsfOp")
7965 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
7967 Translate the given object along the vector, specified by its end points.
7970 theObject The object to be translated.
7971 thePoint1 Start point of translation vector.
7972 thePoint2 End point of translation vector.
7973 theCopy Flag used to translate object itself or create a copy.
7976 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7977 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
7980 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
7982 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
7983 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
7986 ## Translate the given object along the vector, specified
7987 # by its end points, creating its copy before the translation.
7988 # @param theObject The object to be translated.
7989 # @param thePoint1 Start point of translation vector.
7990 # @param thePoint2 End point of translation vector.
7991 # @param theName Object name; when specified, this parameter is used
7992 # for result publication in the study. Otherwise, if automatic
7993 # publication is switched on, default value is used for result name.
7995 # @return New GEOM.GEOM_Object, containing the translated object.
7997 # @ref tui_translation "Example 1"
7998 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
7999 @ManageTransactions("TrsfOp")
8000 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8002 Translate the given object along the vector, specified
8003 by its end points, creating its copy before the translation.
8006 theObject The object to be translated.
8007 thePoint1 Start point of translation vector.
8008 thePoint2 End point of translation vector.
8009 theName Object name; when specified, this parameter is used
8010 for result publication in the study. Otherwise, if automatic
8011 publication is switched on, default value is used for result name.
8014 New GEOM.GEOM_Object, containing the translated object.
8016 # Example: see GEOM_TestAll.py
8017 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8018 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8019 self._autoPublish(anObj, theName, "translated")
8022 ## Translate the given object along the vector, specified by its components.
8023 # @param theObject The object to be translated.
8024 # @param theDX,theDY,theDZ Components of translation vector.
8025 # @param theCopy Flag used to translate object itself or create a copy.
8026 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8027 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8029 # @ref tui_translation "Example"
8030 @ManageTransactions("TrsfOp")
8031 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8033 Translate the given object along the vector, specified by its components.
8036 theObject The object to be translated.
8037 theDX,theDY,theDZ Components of translation vector.
8038 theCopy Flag used to translate object itself or create a copy.
8041 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8042 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8044 # Example: see GEOM_TestAll.py
8045 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8047 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8049 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8050 anObj.SetParameters(Parameters)
8051 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8054 ## Translate the given object along the vector, specified
8055 # by its components, creating its copy before the translation.
8056 # @param theObject The object to be translated.
8057 # @param theDX,theDY,theDZ Components of translation vector.
8058 # @param theName Object name; when specified, this parameter is used
8059 # for result publication in the study. Otherwise, if automatic
8060 # publication is switched on, default value is used for result name.
8062 # @return New GEOM.GEOM_Object, containing the translated object.
8064 # @ref tui_translation "Example"
8065 @ManageTransactions("TrsfOp")
8066 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8068 Translate the given object along the vector, specified
8069 by its components, creating its copy before the translation.
8072 theObject The object to be translated.
8073 theDX,theDY,theDZ Components of translation vector.
8074 theName Object name; when specified, this parameter is used
8075 for result publication in the study. Otherwise, if automatic
8076 publication is switched on, default value is used for result name.
8079 New GEOM.GEOM_Object, containing the translated object.
8081 # Example: see GEOM_TestAll.py
8082 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8083 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8084 anObj.SetParameters(Parameters)
8085 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8086 self._autoPublish(anObj, theName, "translated")
8089 ## Translate the given object along the given vector.
8090 # @param theObject The object to be translated.
8091 # @param theVector The translation vector.
8092 # @param theCopy Flag used to translate object itself or create a copy.
8093 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8094 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8095 @ManageTransactions("TrsfOp")
8096 def TranslateVector(self, theObject, theVector, theCopy=False):
8098 Translate the given object along the given vector.
8101 theObject The object to be translated.
8102 theVector The translation vector.
8103 theCopy Flag used to translate object itself or create a copy.
8106 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8107 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8110 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8112 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8113 RaiseIfFailed("TranslateVector", self.TrsfOp)
8116 ## Translate the given object along the given vector,
8117 # creating its copy before the translation.
8118 # @param theObject The object to be translated.
8119 # @param theVector The translation vector.
8120 # @param theName Object name; when specified, this parameter is used
8121 # for result publication in the study. Otherwise, if automatic
8122 # publication is switched on, default value is used for result name.
8124 # @return New GEOM.GEOM_Object, containing the translated object.
8126 # @ref tui_translation "Example"
8127 @ManageTransactions("TrsfOp")
8128 def MakeTranslationVector(self, theObject, theVector, theName=None):
8130 Translate the given object along the given vector,
8131 creating its copy before the translation.
8134 theObject The object to be translated.
8135 theVector The translation vector.
8136 theName Object name; when specified, this parameter is used
8137 for result publication in the study. Otherwise, if automatic
8138 publication is switched on, default value is used for result name.
8141 New GEOM.GEOM_Object, containing the translated object.
8143 # Example: see GEOM_TestAll.py
8144 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8145 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8146 self._autoPublish(anObj, theName, "translated")
8149 ## Translate the given object along the given vector on given distance.
8150 # @param theObject The object to be translated.
8151 # @param theVector The translation vector.
8152 # @param theDistance The translation distance.
8153 # @param theCopy Flag used to translate object itself or create a copy.
8154 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8155 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8157 # @ref tui_translation "Example"
8158 @ManageTransactions("TrsfOp")
8159 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8161 Translate the given object along the given vector on given distance.
8164 theObject The object to be translated.
8165 theVector The translation vector.
8166 theDistance The translation distance.
8167 theCopy Flag used to translate object itself or create a copy.
8170 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8171 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8173 # Example: see GEOM_TestAll.py
8174 theDistance,Parameters = ParseParameters(theDistance)
8175 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8176 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8177 anObj.SetParameters(Parameters)
8180 ## Translate the given object along the given vector on given distance,
8181 # creating its copy before the translation.
8182 # @param theObject The object to be translated.
8183 # @param theVector The translation vector.
8184 # @param theDistance The translation distance.
8185 # @param theName Object name; when specified, this parameter is used
8186 # for result publication in the study. Otherwise, if automatic
8187 # publication is switched on, default value is used for result name.
8189 # @return New GEOM.GEOM_Object, containing the translated object.
8191 # @ref tui_translation "Example"
8192 @ManageTransactions("TrsfOp")
8193 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8195 Translate the given object along the given vector on given distance,
8196 creating its copy before the translation.
8199 theObject The object to be translated.
8200 theVector The translation vector.
8201 theDistance The translation distance.
8202 theName Object name; when specified, this parameter is used
8203 for result publication in the study. Otherwise, if automatic
8204 publication is switched on, default value is used for result name.
8207 New GEOM.GEOM_Object, containing the translated object.
8209 # Example: see GEOM_TestAll.py
8210 theDistance,Parameters = ParseParameters(theDistance)
8211 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8212 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8213 anObj.SetParameters(Parameters)
8214 self._autoPublish(anObj, theName, "translated")
8217 ## Rotate the given object around the given axis on the given angle.
8218 # @param theObject The object to be rotated.
8219 # @param theAxis Rotation axis.
8220 # @param theAngle Rotation angle in radians.
8221 # @param theCopy Flag used to rotate object itself or create a copy.
8223 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8224 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8226 # @ref tui_rotation "Example"
8227 @ManageTransactions("TrsfOp")
8228 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8230 Rotate the given object around the given axis on the given angle.
8233 theObject The object to be rotated.
8234 theAxis Rotation axis.
8235 theAngle Rotation angle in radians.
8236 theCopy Flag used to rotate object itself or create a copy.
8239 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8240 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8242 # Example: see GEOM_TestAll.py
8244 if isinstance(theAngle,str):
8246 theAngle, Parameters = ParseParameters(theAngle)
8248 theAngle = theAngle*math.pi/180.0
8250 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8252 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8253 RaiseIfFailed("Rotate", self.TrsfOp)
8254 anObj.SetParameters(Parameters)
8257 ## Rotate the given object around the given axis
8258 # on the given angle, creating its copy before the rotation.
8259 # @param theObject The object to be rotated.
8260 # @param theAxis Rotation axis.
8261 # @param theAngle Rotation angle in radians.
8262 # @param theName Object name; when specified, this parameter is used
8263 # for result publication in the study. Otherwise, if automatic
8264 # publication is switched on, default value is used for result name.
8266 # @return New GEOM.GEOM_Object, containing the rotated object.
8268 # @ref tui_rotation "Example"
8269 @ManageTransactions("TrsfOp")
8270 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8272 Rotate the given object around the given axis
8273 on the given angle, creating its copy before the rotatation.
8276 theObject The object to be rotated.
8277 theAxis Rotation axis.
8278 theAngle Rotation angle in radians.
8279 theName Object name; when specified, this parameter is used
8280 for result publication in the study. Otherwise, if automatic
8281 publication is switched on, default value is used for result name.
8284 New GEOM.GEOM_Object, containing the rotated object.
8286 # Example: see GEOM_TestAll.py
8288 if isinstance(theAngle,str):
8290 theAngle, Parameters = ParseParameters(theAngle)
8292 theAngle = theAngle*math.pi/180.0
8293 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8294 RaiseIfFailed("RotateCopy", self.TrsfOp)
8295 anObj.SetParameters(Parameters)
8296 self._autoPublish(anObj, theName, "rotated")
8299 ## Rotate given object around vector perpendicular to plane
8300 # containing three points.
8301 # @param theObject The object to be rotated.
8302 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8303 # containing the three points.
8304 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8305 # @param theCopy Flag used to rotate object itself or create a copy.
8306 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8307 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8308 @ManageTransactions("TrsfOp")
8309 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8311 Rotate given object around vector perpendicular to plane
8312 containing three points.
8315 theObject The object to be rotated.
8316 theCentPoint central point the axis is the vector perpendicular to the plane
8317 containing the three points.
8318 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8319 theCopy Flag used to rotate object itself or create a copy.
8322 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8323 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8326 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8328 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8329 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8332 ## Rotate given object around vector perpendicular to plane
8333 # containing three points, creating its copy before the rotatation.
8334 # @param theObject The object to be rotated.
8335 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8336 # containing the three points.
8337 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8338 # @param theName Object name; when specified, this parameter is used
8339 # for result publication in the study. Otherwise, if automatic
8340 # publication is switched on, default value is used for result name.
8342 # @return New GEOM.GEOM_Object, containing the rotated object.
8344 # @ref tui_rotation "Example"
8345 @ManageTransactions("TrsfOp")
8346 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8348 Rotate given object around vector perpendicular to plane
8349 containing three points, creating its copy before the rotatation.
8352 theObject The object to be rotated.
8353 theCentPoint central point the axis is the vector perpendicular to the plane
8354 containing the three points.
8355 thePoint1,thePoint2 in a perpendicular plane of the axis.
8356 theName Object name; when specified, this parameter is used
8357 for result publication in the study. Otherwise, if automatic
8358 publication is switched on, default value is used for result name.
8361 New GEOM.GEOM_Object, containing the rotated object.
8363 # Example: see GEOM_TestAll.py
8364 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8365 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8366 self._autoPublish(anObj, theName, "rotated")
8369 ## Scale the given object by the specified factor.
8370 # @param theObject The object to be scaled.
8371 # @param thePoint Center point for scaling.
8372 # Passing None for it means scaling relatively the origin of global CS.
8373 # @param theFactor Scaling factor value.
8374 # @param theCopy Flag used to scale object itself or create a copy.
8375 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8376 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8377 @ManageTransactions("TrsfOp")
8378 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8380 Scale the given object by the specified factor.
8383 theObject The object to be scaled.
8384 thePoint Center point for scaling.
8385 Passing None for it means scaling relatively the origin of global CS.
8386 theFactor Scaling factor value.
8387 theCopy Flag used to scale object itself or create a copy.
8390 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8391 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8393 # Example: see GEOM_TestAll.py
8394 theFactor, Parameters = ParseParameters(theFactor)
8396 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8398 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8399 RaiseIfFailed("Scale", self.TrsfOp)
8400 anObj.SetParameters(Parameters)
8403 ## Scale the given object by the factor, creating its copy before the scaling.
8404 # @param theObject The object to be scaled.
8405 # @param thePoint Center point for scaling.
8406 # Passing None for it means scaling relatively the origin of global CS.
8407 # @param theFactor Scaling factor value.
8408 # @param theName Object name; when specified, this parameter is used
8409 # for result publication in the study. Otherwise, if automatic
8410 # publication is switched on, default value is used for result name.
8412 # @return New GEOM.GEOM_Object, containing the scaled shape.
8414 # @ref tui_scale "Example"
8415 @ManageTransactions("TrsfOp")
8416 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8418 Scale the given object by the factor, creating its copy before the scaling.
8421 theObject The object to be scaled.
8422 thePoint Center point for scaling.
8423 Passing None for it means scaling relatively the origin of global CS.
8424 theFactor Scaling factor value.
8425 theName Object name; when specified, this parameter is used
8426 for result publication in the study. Otherwise, if automatic
8427 publication is switched on, default value is used for result name.
8430 New GEOM.GEOM_Object, containing the scaled shape.
8432 # Example: see GEOM_TestAll.py
8433 theFactor, Parameters = ParseParameters(theFactor)
8434 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8435 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8436 anObj.SetParameters(Parameters)
8437 self._autoPublish(anObj, theName, "scaled")
8440 ## Scale the given object by different factors along coordinate axes.
8441 # @param theObject The object to be scaled.
8442 # @param thePoint Center point for scaling.
8443 # Passing None for it means scaling relatively the origin of global CS.
8444 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8445 # @param theCopy Flag used to scale object itself or create a copy.
8446 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8447 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8448 @ManageTransactions("TrsfOp")
8449 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8451 Scale the given object by different factors along coordinate axes.
8454 theObject The object to be scaled.
8455 thePoint Center point for scaling.
8456 Passing None for it means scaling relatively the origin of global CS.
8457 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8458 theCopy Flag used to scale object itself or create a copy.
8461 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8462 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8464 # Example: see GEOM_TestAll.py
8465 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8467 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8468 theFactorX, theFactorY, theFactorZ)
8470 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8471 theFactorX, theFactorY, theFactorZ)
8472 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8473 anObj.SetParameters(Parameters)
8476 ## Scale the given object by different factors along coordinate axes,
8477 # creating its copy before the scaling.
8478 # @param theObject The object to be scaled.
8479 # @param thePoint Center point for scaling.
8480 # Passing None for it means scaling relatively the origin of global CS.
8481 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8482 # @param theName Object name; when specified, this parameter is used
8483 # for result publication in the study. Otherwise, if automatic
8484 # publication is switched on, default value is used for result name.
8486 # @return New GEOM.GEOM_Object, containing the scaled shape.
8488 # @ref swig_scale "Example"
8489 @ManageTransactions("TrsfOp")
8490 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8492 Scale the given object by different factors along coordinate axes,
8493 creating its copy before the scaling.
8496 theObject The object to be scaled.
8497 thePoint Center point for scaling.
8498 Passing None for it means scaling relatively the origin of global CS.
8499 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8500 theName Object name; when specified, this parameter is used
8501 for result publication in the study. Otherwise, if automatic
8502 publication is switched on, default value is used for result name.
8505 New GEOM.GEOM_Object, containing the scaled shape.
8507 # Example: see GEOM_TestAll.py
8508 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8509 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8510 theFactorX, theFactorY, theFactorZ)
8511 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8512 anObj.SetParameters(Parameters)
8513 self._autoPublish(anObj, theName, "scaled")
8516 ## Mirror an object relatively the given plane.
8517 # @param theObject The object to be mirrored.
8518 # @param thePlane Plane of symmetry.
8519 # @param theCopy Flag used to mirror object itself or create a copy.
8520 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8521 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8522 @ManageTransactions("TrsfOp")
8523 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8525 Mirror an object relatively the given plane.
8528 theObject The object to be mirrored.
8529 thePlane Plane of symmetry.
8530 theCopy Flag used to mirror object itself or create a copy.
8533 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8534 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8537 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8539 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8540 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8543 ## Create an object, symmetrical
8544 # to the given one relatively the given plane.
8545 # @param theObject The object to be mirrored.
8546 # @param thePlane Plane of symmetry.
8547 # @param theName Object name; when specified, this parameter is used
8548 # for result publication in the study. Otherwise, if automatic
8549 # publication is switched on, default value is used for result name.
8551 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8553 # @ref tui_mirror "Example"
8554 @ManageTransactions("TrsfOp")
8555 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8557 Create an object, symmetrical to the given one relatively the given plane.
8560 theObject The object to be mirrored.
8561 thePlane Plane of symmetry.
8562 theName Object name; when specified, this parameter is used
8563 for result publication in the study. Otherwise, if automatic
8564 publication is switched on, default value is used for result name.
8567 New GEOM.GEOM_Object, containing the mirrored shape.
8569 # Example: see GEOM_TestAll.py
8570 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8571 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8572 self._autoPublish(anObj, theName, "mirrored")
8575 ## Mirror an object relatively the given axis.
8576 # @param theObject The object to be mirrored.
8577 # @param theAxis Axis of symmetry.
8578 # @param theCopy Flag used to mirror object itself or create a copy.
8579 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8580 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8581 @ManageTransactions("TrsfOp")
8582 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8584 Mirror an object relatively the given axis.
8587 theObject The object to be mirrored.
8588 theAxis Axis of symmetry.
8589 theCopy Flag used to mirror object itself or create a copy.
8592 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8593 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8596 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8598 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8599 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8602 ## Create an object, symmetrical
8603 # to the given one relatively the given axis.
8604 # @param theObject The object to be mirrored.
8605 # @param theAxis Axis of symmetry.
8606 # @param theName Object name; when specified, this parameter is used
8607 # for result publication in the study. Otherwise, if automatic
8608 # publication is switched on, default value is used for result name.
8610 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8612 # @ref tui_mirror "Example"
8613 @ManageTransactions("TrsfOp")
8614 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8616 Create an object, symmetrical to the given one relatively the given axis.
8619 theObject The object to be mirrored.
8620 theAxis Axis of symmetry.
8621 theName Object name; when specified, this parameter is used
8622 for result publication in the study. Otherwise, if automatic
8623 publication is switched on, default value is used for result name.
8626 New GEOM.GEOM_Object, containing the mirrored shape.
8628 # Example: see GEOM_TestAll.py
8629 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8630 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8631 self._autoPublish(anObj, theName, "mirrored")
8634 ## Mirror an object relatively the given point.
8635 # @param theObject The object to be mirrored.
8636 # @param thePoint Point of symmetry.
8637 # @param theCopy Flag used to mirror object itself or create a copy.
8638 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8639 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8640 @ManageTransactions("TrsfOp")
8641 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8643 Mirror an object relatively the given point.
8646 theObject The object to be mirrored.
8647 thePoint Point of symmetry.
8648 theCopy Flag used to mirror object itself or create a copy.
8651 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8652 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8654 # Example: see GEOM_TestAll.py
8656 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8658 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8659 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8662 ## Create an object, symmetrical
8663 # to the given one relatively the given point.
8664 # @param theObject The object to be mirrored.
8665 # @param thePoint Point of symmetry.
8666 # @param theName Object name; when specified, this parameter is used
8667 # for result publication in the study. Otherwise, if automatic
8668 # publication is switched on, default value is used for result name.
8670 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8672 # @ref tui_mirror "Example"
8673 @ManageTransactions("TrsfOp")
8674 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8676 Create an object, symmetrical
8677 to the given one relatively the given point.
8680 theObject The object to be mirrored.
8681 thePoint Point of symmetry.
8682 theName Object name; when specified, this parameter is used
8683 for result publication in the study. Otherwise, if automatic
8684 publication is switched on, default value is used for result name.
8687 New GEOM.GEOM_Object, containing the mirrored shape.
8689 # Example: see GEOM_TestAll.py
8690 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8691 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
8692 self._autoPublish(anObj, theName, "mirrored")
8695 ## Modify the location of the given object.
8696 # @param theObject The object to be displaced.
8697 # @param theStartLCS Coordinate system to perform displacement from it.\n
8698 # If \a theStartLCS is NULL, displacement
8699 # will be performed from global CS.\n
8700 # If \a theObject itself is used as \a theStartLCS,
8701 # its location will be changed to \a theEndLCS.
8702 # @param theEndLCS Coordinate system to perform displacement to it.
8703 # @param theCopy Flag used to displace object itself or create a copy.
8704 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8705 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
8706 @ManageTransactions("TrsfOp")
8707 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
8709 Modify the Location of the given object by LCS, creating its copy before the setting.
8712 theObject The object to be displaced.
8713 theStartLCS Coordinate system to perform displacement from it.
8714 If theStartLCS is NULL, displacement
8715 will be performed from global CS.
8716 If theObject itself is used as theStartLCS,
8717 its location will be changed to theEndLCS.
8718 theEndLCS Coordinate system to perform displacement to it.
8719 theCopy Flag used to displace object itself or create a copy.
8722 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8723 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
8725 # Example: see GEOM_TestAll.py
8727 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8729 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
8730 RaiseIfFailed("Displace", self.TrsfOp)
8733 ## Modify the Location of the given object by LCS,
8734 # creating its copy before the setting.
8735 # @param theObject The object to be displaced.
8736 # @param theStartLCS Coordinate system to perform displacement from it.\n
8737 # If \a theStartLCS is NULL, displacement
8738 # will be performed from global CS.\n
8739 # If \a theObject itself is used as \a theStartLCS,
8740 # its location will be changed to \a theEndLCS.
8741 # @param theEndLCS Coordinate system to perform displacement to it.
8742 # @param theName Object name; when specified, this parameter is used
8743 # for result publication in the study. Otherwise, if automatic
8744 # publication is switched on, default value is used for result name.
8746 # @return New GEOM.GEOM_Object, containing the displaced shape.
8748 # @ref tui_modify_location "Example"
8749 @ManageTransactions("TrsfOp")
8750 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
8752 Modify the Location of the given object by LCS, creating its copy before the setting.
8755 theObject The object to be displaced.
8756 theStartLCS Coordinate system to perform displacement from it.
8757 If theStartLCS is NULL, displacement
8758 will be performed from global CS.
8759 If theObject itself is used as theStartLCS,
8760 its location will be changed to theEndLCS.
8761 theEndLCS Coordinate system to perform displacement to it.
8762 theName Object name; when specified, this parameter is used
8763 for result publication in the study. Otherwise, if automatic
8764 publication is switched on, default value is used for result name.
8767 New GEOM.GEOM_Object, containing the displaced shape.
8770 # create local coordinate systems
8771 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
8772 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
8773 # modify the location of the given object
8774 position = geompy.MakePosition(cylinder, cs1, cs2)
8776 # Example: see GEOM_TestAll.py
8777 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
8778 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
8779 self._autoPublish(anObj, theName, "displaced")
8782 ## Modify the Location of the given object by Path.
8783 # @param theObject The object to be displaced.
8784 # @param thePath Wire or Edge along that the object will be translated.
8785 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8786 # @param theCopy is to create a copy objects if true.
8787 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8788 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
8789 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
8791 # @ref tui_modify_location "Example"
8792 @ManageTransactions("TrsfOp")
8793 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
8795 Modify the Location of the given object by Path.
8798 theObject The object to be displaced.
8799 thePath Wire or Edge along that the object will be translated.
8800 theDistance progress of Path (0 = start location, 1 = end of path location).
8801 theCopy is to create a copy objects if true.
8802 theReverse 0 - for usual direction, 1 - to reverse path direction.
8805 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
8806 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
8809 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
8811 # Example: see GEOM_TestAll.py
8812 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
8813 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8816 ## Modify the Location of the given object by Path, creating its copy before the operation.
8817 # @param theObject The object to be displaced.
8818 # @param thePath Wire or Edge along that the object will be translated.
8819 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
8820 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
8821 # @param theName Object name; when specified, this parameter is used
8822 # for result publication in the study. Otherwise, if automatic
8823 # publication is switched on, default value is used for result name.
8825 # @return New GEOM.GEOM_Object, containing the displaced shape.
8826 @ManageTransactions("TrsfOp")
8827 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
8829 Modify the Location of the given object by Path, creating its copy before the operation.
8832 theObject The object to be displaced.
8833 thePath Wire or Edge along that the object will be translated.
8834 theDistance progress of Path (0 = start location, 1 = end of path location).
8835 theReverse 0 - for usual direction, 1 - to reverse path direction.
8836 theName Object name; when specified, this parameter is used
8837 for result publication in the study. Otherwise, if automatic
8838 publication is switched on, default value is used for result name.
8841 New GEOM.GEOM_Object, containing the displaced shape.
8843 # Example: see GEOM_TestAll.py
8844 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
8845 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
8846 self._autoPublish(anObj, theName, "displaced")
8849 ## Offset given shape.
8850 # @param theObject The base object for the offset.
8851 # @param theOffset Offset value.
8852 # @param theCopy Flag used to offset object itself or create a copy.
8853 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8854 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
8855 @ManageTransactions("TrsfOp")
8856 def Offset(self, theObject, theOffset, theCopy=False):
8861 theObject The base object for the offset.
8862 theOffset Offset value.
8863 theCopy Flag used to offset object itself or create a copy.
8866 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8867 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
8869 theOffset, Parameters = ParseParameters(theOffset)
8871 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8873 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
8874 RaiseIfFailed("Offset", self.TrsfOp)
8875 anObj.SetParameters(Parameters)
8878 ## Create new object as offset of the given one.
8879 # @param theObject The base object for the offset.
8880 # @param theOffset Offset value.
8881 # @param theName Object name; when specified, this parameter is used
8882 # for result publication in the study. Otherwise, if automatic
8883 # publication is switched on, default value is used for result name.
8885 # @return New GEOM.GEOM_Object, containing the offset object.
8887 # @ref tui_offset "Example"
8888 @ManageTransactions("TrsfOp")
8889 def MakeOffset(self, theObject, theOffset, theName=None):
8891 Create new object as offset of the given one.
8894 theObject The base object for the offset.
8895 theOffset Offset value.
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 the offset object.
8904 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
8905 # create a new object as offset of the given object
8906 offset = geompy.MakeOffset(box, 70.)
8908 # Example: see GEOM_TestAll.py
8909 theOffset, Parameters = ParseParameters(theOffset)
8910 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
8911 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
8912 anObj.SetParameters(Parameters)
8913 self._autoPublish(anObj, theName, "offset")
8916 ## Create new object as projection of the given one on another.
8917 # @param theSource The source object for the projection. It can be a point, edge or wire.
8918 # Edge and wire are acceptable if @a theTarget is a face.
8919 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
8920 # @param theName Object name; when specified, this parameter is used
8921 # for result publication in the study. Otherwise, if automatic
8922 # publication is switched on, default value is used for result name.
8924 # @return New GEOM.GEOM_Object, containing the projection.
8926 # @ref tui_projection "Example"
8927 @ManageTransactions("TrsfOp")
8928 def MakeProjection(self, theSource, theTarget, theName=None):
8930 Create new object as projection of the given one on another.
8933 theSource The source object for the projection. It can be a point, edge or wire.
8934 Edge and wire are acceptable if theTarget is a face.
8935 theTarget The target object. It can be planar or cylindrical face, edge or wire.
8936 theName Object name; when specified, this parameter is used
8937 for result publication in the study. Otherwise, if automatic
8938 publication is switched on, default value is used for result name.
8941 New GEOM.GEOM_Object, containing the projection.
8943 # Example: see GEOM_TestAll.py
8944 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
8945 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
8946 self._autoPublish(anObj, theName, "projection")
8949 ## Create a projection projection of the given point on a wire or an edge.
8950 # If there are no solutions or there are 2 or more solutions It throws an
8952 # @param thePoint the point to be projected.
8953 # @param theWire the wire. The edge is accepted as well.
8954 # @param theName Object name; when specified, this parameter is used
8955 # for result publication in the study. Otherwise, if automatic
8956 # publication is switched on, default value is used for result name.
8958 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
8959 # \n \a u: The parameter of projection point on edge.
8960 # \n \a PointOnEdge: The projection point.
8961 # \n \a EdgeInWireIndex: The index of an edge in a wire.
8963 # @ref tui_projection "Example"
8964 @ManageTransactions("TrsfOp")
8965 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
8967 Create a projection projection of the given point on a wire or an edge.
8968 If there are no solutions or there are 2 or more solutions It throws an
8972 thePoint the point to be projected.
8973 theWire the wire. The edge is accepted as well.
8974 theName Object name; when specified, this parameter is used
8975 for result publication in the study. Otherwise, if automatic
8976 publication is switched on, default value is used for result name.
8979 [u, PointOnEdge, EdgeInWireIndex]
8980 u: The parameter of projection point on edge.
8981 PointOnEdge: The projection point.
8982 EdgeInWireIndex: The index of an edge in a wire.
8984 # Example: see GEOM_TestAll.py
8985 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
8986 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
8987 self._autoPublish(anObj[1], theName, "projection")
8990 # -----------------------------------------------------------------------------
8992 # -----------------------------------------------------------------------------
8994 ## Translate the given object along the given vector a given number times
8995 # @param theObject The object to be translated.
8996 # @param theVector Direction of the translation. DX if None.
8997 # @param theStep Distance to translate on.
8998 # @param theNbTimes Quantity of translations to be done.
8999 # @param theName Object name; when specified, this parameter is used
9000 # for result publication in the study. Otherwise, if automatic
9001 # publication is switched on, default value is used for result name.
9003 # @return New GEOM.GEOM_Object, containing compound of all
9004 # the shapes, obtained after each translation.
9006 # @ref tui_multi_translation "Example"
9007 @ManageTransactions("TrsfOp")
9008 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9010 Translate the given object along the given vector a given number times
9013 theObject The object to be translated.
9014 theVector Direction of the translation. DX if None.
9015 theStep Distance to translate on.
9016 theNbTimes Quantity of translations to be done.
9017 theName Object name; when specified, this parameter is used
9018 for result publication in the study. Otherwise, if automatic
9019 publication is switched on, default value is used for result name.
9022 New GEOM.GEOM_Object, containing compound of all
9023 the shapes, obtained after each translation.
9026 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9028 # Example: see GEOM_TestAll.py
9029 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9030 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9031 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9032 anObj.SetParameters(Parameters)
9033 self._autoPublish(anObj, theName, "multitranslation")
9036 ## Conseqently apply two specified translations to theObject specified number of times.
9037 # @param theObject The object to be translated.
9038 # @param theVector1 Direction of the first translation. DX if None.
9039 # @param theStep1 Step of the first translation.
9040 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9041 # @param theVector2 Direction of the second translation. DY if None.
9042 # @param theStep2 Step of the second translation.
9043 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9044 # @param theName Object name; when specified, this parameter is used
9045 # for result publication in the study. Otherwise, if automatic
9046 # publication is switched on, default value is used for result name.
9048 # @return New GEOM.GEOM_Object, containing compound of all
9049 # the shapes, obtained after each translation.
9051 # @ref tui_multi_translation "Example"
9052 @ManageTransactions("TrsfOp")
9053 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9054 theVector2, theStep2, theNbTimes2, theName=None):
9056 Conseqently apply two specified translations to theObject specified number of times.
9059 theObject The object to be translated.
9060 theVector1 Direction of the first translation. DX if None.
9061 theStep1 Step of the first translation.
9062 theNbTimes1 Quantity of translations to be done along theVector1.
9063 theVector2 Direction of the second translation. DY if None.
9064 theStep2 Step of the second translation.
9065 theNbTimes2 Quantity of translations to be done along theVector2.
9066 theName Object name; when specified, this parameter is used
9067 for result publication in the study. Otherwise, if automatic
9068 publication is switched on, default value is used for result name.
9071 New GEOM.GEOM_Object, containing compound of all
9072 the shapes, obtained after each translation.
9075 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9077 # Example: see GEOM_TestAll.py
9078 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9079 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9080 theVector2, theStep2, theNbTimes2)
9081 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9082 anObj.SetParameters(Parameters)
9083 self._autoPublish(anObj, theName, "multitranslation")
9086 ## Rotate the given object around the given axis a given number times.
9087 # Rotation angle will be 2*PI/theNbTimes.
9088 # @param theObject The object to be rotated.
9089 # @param theAxis The rotation axis. DZ if None.
9090 # @param theNbTimes Quantity of rotations to be done.
9091 # @param theName Object name; when specified, this parameter is used
9092 # for result publication in the study. Otherwise, if automatic
9093 # publication is switched on, default value is used for result name.
9095 # @return New GEOM.GEOM_Object, containing compound of all the
9096 # shapes, obtained after each rotation.
9098 # @ref tui_multi_rotation "Example"
9099 @ManageTransactions("TrsfOp")
9100 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9102 Rotate the given object around the given axis a given number times.
9103 Rotation angle will be 2*PI/theNbTimes.
9106 theObject The object to be rotated.
9107 theAxis The rotation axis. DZ if None.
9108 theNbTimes Quantity of rotations to be done.
9109 theName Object name; when specified, this parameter is used
9110 for result publication in the study. Otherwise, if automatic
9111 publication is switched on, default value is used for result name.
9114 New GEOM.GEOM_Object, containing compound of all the
9115 shapes, obtained after each rotation.
9118 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9120 # Example: see GEOM_TestAll.py
9121 theNbTimes, Parameters = ParseParameters(theNbTimes)
9122 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9123 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9124 anObj.SetParameters(Parameters)
9125 self._autoPublish(anObj, theName, "multirotation")
9128 ## Rotate the given object around the given axis
9129 # a given number times on the given angle.
9130 # @param theObject The object to be rotated.
9131 # @param theAxis The rotation axis. DZ if None.
9132 # @param theAngleStep Rotation angle in radians.
9133 # @param theNbTimes Quantity of rotations to be done.
9134 # @param theName Object name; when specified, this parameter is used
9135 # for result publication in the study. Otherwise, if automatic
9136 # publication is switched on, default value is used for result name.
9138 # @return New GEOM.GEOM_Object, containing compound of all the
9139 # shapes, obtained after each rotation.
9141 # @ref tui_multi_rotation "Example"
9142 @ManageTransactions("TrsfOp")
9143 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9145 Rotate the given object around the given axis
9146 a given number times on the given angle.
9149 theObject The object to be rotated.
9150 theAxis The rotation axis. DZ if None.
9151 theAngleStep Rotation angle in radians.
9152 theNbTimes Quantity of rotations to be done.
9153 theName Object name; when specified, this parameter is used
9154 for result publication in the study. Otherwise, if automatic
9155 publication is switched on, default value is used for result name.
9158 New GEOM.GEOM_Object, containing compound of all the
9159 shapes, obtained after each rotation.
9162 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9164 # Example: see GEOM_TestAll.py
9165 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9166 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9167 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9168 anObj.SetParameters(Parameters)
9169 self._autoPublish(anObj, theName, "multirotation")
9172 ## Rotate the given object around the given axis a given
9173 # number times and multi-translate each rotation result.
9174 # Rotation angle will be 2*PI/theNbTimes1.
9175 # Translation direction passes through center of gravity
9176 # of rotated shape and its projection on the rotation axis.
9177 # @param theObject The object to be rotated.
9178 # @param theAxis Rotation axis. DZ if None.
9179 # @param theNbTimes1 Quantity of rotations to be done.
9180 # @param theRadialStep Translation distance.
9181 # @param theNbTimes2 Quantity of translations to be done.
9182 # @param theName Object name; when specified, this parameter is used
9183 # for result publication in the study. Otherwise, if automatic
9184 # publication is switched on, default value is used for result name.
9186 # @return New GEOM.GEOM_Object, containing compound of all the
9187 # shapes, obtained after each transformation.
9189 # @ref tui_multi_rotation "Example"
9190 @ManageTransactions("TrsfOp")
9191 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9193 Rotate the given object around the
9194 given axis on the given angle a given number
9195 times and multi-translate each rotation result.
9196 Translation direction passes through center of gravity
9197 of rotated shape and its projection on the rotation axis.
9200 theObject The object to be rotated.
9201 theAxis Rotation axis. DZ if None.
9202 theNbTimes1 Quantity of rotations to be done.
9203 theRadialStep Translation distance.
9204 theNbTimes2 Quantity of translations to be done.
9205 theName Object name; when specified, this parameter is used
9206 for result publication in the study. Otherwise, if automatic
9207 publication is switched on, default value is used for result name.
9210 New GEOM.GEOM_Object, containing compound of all the
9211 shapes, obtained after each transformation.
9214 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9216 # Example: see GEOM_TestAll.py
9217 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9218 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9219 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9220 anObj.SetParameters(Parameters)
9221 self._autoPublish(anObj, theName, "multirotation")
9224 ## Rotate the given object around the
9225 # given axis on the given angle a given number
9226 # times and multi-translate each rotation result.
9227 # Translation direction passes through center of gravity
9228 # of rotated shape and its projection on the rotation axis.
9229 # @param theObject The object to be rotated.
9230 # @param theAxis Rotation axis. DZ if None.
9231 # @param theAngleStep Rotation angle in radians.
9232 # @param theNbTimes1 Quantity of rotations to be done.
9233 # @param theRadialStep Translation distance.
9234 # @param theNbTimes2 Quantity of translations to be done.
9235 # @param theName Object name; when specified, this parameter is used
9236 # for result publication in the study. Otherwise, if automatic
9237 # publication is switched on, default value is used for result name.
9239 # @return New GEOM.GEOM_Object, containing compound of all the
9240 # shapes, obtained after each transformation.
9242 # @ref tui_multi_rotation "Example"
9243 @ManageTransactions("TrsfOp")
9244 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9246 Rotate the given object around the
9247 given axis on the given angle a given number
9248 times and multi-translate each rotation result.
9249 Translation direction passes through center of gravity
9250 of rotated shape and its projection on the rotation axis.
9253 theObject The object to be rotated.
9254 theAxis Rotation axis. DZ if None.
9255 theAngleStep Rotation angle in radians.
9256 theNbTimes1 Quantity of rotations to be done.
9257 theRadialStep Translation distance.
9258 theNbTimes2 Quantity of translations to be done.
9259 theName Object name; when specified, this parameter is used
9260 for result publication in the study. Otherwise, if automatic
9261 publication is switched on, default value is used for result name.
9264 New GEOM.GEOM_Object, containing compound of all the
9265 shapes, obtained after each transformation.
9268 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9270 # Example: see GEOM_TestAll.py
9271 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9272 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9273 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9274 anObj.SetParameters(Parameters)
9275 self._autoPublish(anObj, theName, "multirotation")
9278 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9280 # @ref swig_MakeMultiRotation "Example"
9281 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9283 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9286 pz = geompy.MakeVertex(0, 0, 100)
9287 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9288 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9290 # Example: see GEOM_TestOthers.py
9291 aVec = self.MakeLine(aPoint,aDir)
9292 # note: auto-publishing is done in self.MultiRotate1D()
9293 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9296 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9298 # @ref swig_MakeMultiRotation "Example"
9299 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9301 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9304 pz = geompy.MakeVertex(0, 0, 100)
9305 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9306 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9308 # Example: see GEOM_TestOthers.py
9309 aVec = self.MakeLine(aPoint,aDir)
9310 # note: auto-publishing is done in self.MultiRotate1D()
9311 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9314 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9316 # @ref swig_MakeMultiRotation "Example"
9317 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9319 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9322 pz = geompy.MakeVertex(0, 0, 100)
9323 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9324 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9326 # Example: see GEOM_TestOthers.py
9327 aVec = self.MakeLine(aPoint,aDir)
9328 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9329 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9332 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9334 # @ref swig_MakeMultiRotation "Example"
9335 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9337 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9340 pz = geompy.MakeVertex(0, 0, 100)
9341 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9342 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9344 # Example: see GEOM_TestOthers.py
9345 aVec = self.MakeLine(aPoint,aDir)
9346 # note: auto-publishing is done in self.MultiRotate2D()
9347 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9350 # end of l3_transform
9353 ## @addtogroup l3_transform_d
9356 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9357 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9359 Deprecated method. Use MultiRotate1DNbTimes instead.
9361 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9362 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9364 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9365 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9366 @ManageTransactions("TrsfOp")
9367 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9369 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9370 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9373 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9375 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9376 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9377 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9378 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9379 anObj.SetParameters(Parameters)
9380 self._autoPublish(anObj, theName, "multirotation")
9383 ## The same, as MultiRotate1D(), but axis is given by direction and point
9384 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9385 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9387 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9388 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9391 pz = geompy.MakeVertex(0, 0, 100)
9392 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9393 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9395 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9396 aVec = self.MakeLine(aPoint,aDir)
9397 # note: auto-publishing is done in self.MultiRotate1D()
9398 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9401 ## The same, as MultiRotate2D(), but axis is given by direction and point
9402 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9403 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9405 The same, as MultiRotate2D(), but axis is given by direction and point
9406 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9409 pz = geompy.MakeVertex(0, 0, 100)
9410 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9411 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9413 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9414 aVec = self.MakeLine(aPoint,aDir)
9415 # note: auto-publishing is done in self.MultiRotate2D()
9416 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9419 # end of l3_transform_d
9422 ## @addtogroup l3_local
9425 ## Perform a fillet on all edges of the given shape.
9426 # @param theShape Shape, to perform fillet on.
9427 # @param theR Fillet radius.
9428 # @param theName Object name; when specified, this parameter is used
9429 # for result publication in the study. Otherwise, if automatic
9430 # publication is switched on, default value is used for result name.
9432 # @return New GEOM.GEOM_Object, containing the result shape.
9434 # @ref tui_fillet "Example 1"
9435 # \n @ref swig_MakeFilletAll "Example 2"
9436 @ManageTransactions("LocalOp")
9437 def MakeFilletAll(self, theShape, theR, theName=None):
9439 Perform a fillet on all edges of the given shape.
9442 theShape Shape, to perform fillet on.
9444 theName Object name; when specified, this parameter is used
9445 for result publication in the study. Otherwise, if automatic
9446 publication is switched on, default value is used for result name.
9449 New GEOM.GEOM_Object, containing the result shape.
9452 filletall = geompy.MakeFilletAll(prism, 10.)
9454 # Example: see GEOM_TestOthers.py
9455 theR,Parameters = ParseParameters(theR)
9456 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9457 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9458 anObj.SetParameters(Parameters)
9459 self._autoPublish(anObj, theName, "fillet")
9462 ## Perform a fillet on the specified edges/faces of the given shape
9463 # @param theShape Shape, to perform fillet on.
9464 # @param theR Fillet radius.
9465 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9466 # @param theListShapes Global indices of edges/faces to perform fillet on.
9467 # @param theName Object name; when specified, this parameter is used
9468 # for result publication in the study. Otherwise, if automatic
9469 # publication is switched on, default value is used for result name.
9471 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9473 # @return New GEOM.GEOM_Object, containing the result shape.
9475 # @ref tui_fillet "Example"
9476 @ManageTransactions("LocalOp")
9477 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9479 Perform a fillet on the specified edges/faces of the given shape
9482 theShape Shape, to perform fillet on.
9484 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9485 theListShapes Global indices of edges/faces to perform fillet on.
9486 theName Object name; when specified, this parameter is used
9487 for result publication in the study. Otherwise, if automatic
9488 publication is switched on, default value is used for result name.
9491 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9494 New GEOM.GEOM_Object, containing the result shape.
9497 # get the list of IDs (IDList) for the fillet
9498 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9500 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9501 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9502 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9503 # make a fillet on the specified edges of the given shape
9504 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9506 # Example: see GEOM_TestAll.py
9507 theR,Parameters = ParseParameters(theR)
9509 if theShapeType == self.ShapeType["EDGE"]:
9510 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9511 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9513 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9514 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9515 anObj.SetParameters(Parameters)
9516 self._autoPublish(anObj, theName, "fillet")
9519 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9520 @ManageTransactions("LocalOp")
9521 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9523 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9526 # get the list of IDs (IDList) for the fillet
9527 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9529 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9530 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9531 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9532 # make a fillet on the specified edges of the given shape
9533 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9535 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9537 if theShapeType == self.ShapeType["EDGE"]:
9538 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9539 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9541 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9542 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9543 anObj.SetParameters(Parameters)
9544 self._autoPublish(anObj, theName, "fillet")
9547 ## Perform a fillet on the specified edges of the given shape
9548 # @param theShape Wire Shape to perform fillet on.
9549 # @param theR Fillet radius.
9550 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9551 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9552 # \note The list of vertices could be empty,
9553 # in this case fillet will done done at all vertices in wire
9554 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9555 # by the length of the edges, nearest to the fillet vertex.
9556 # But sometimes the next edge is C1 continuous with the one, nearest to
9557 # the fillet point, and such two (or more) edges can be united to allow
9558 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9559 # thus ignoring the secant vertex (vertices).
9560 # @param theName Object name; when specified, this parameter is used
9561 # for result publication in the study. Otherwise, if automatic
9562 # publication is switched on, default value is used for result name.
9564 # @return New GEOM.GEOM_Object, containing the result shape.
9566 # @ref tui_fillet2d "Example"
9567 @ManageTransactions("LocalOp")
9568 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9570 Perform a fillet on the specified edges of the given shape
9573 theShape Wire Shape to perform fillet on.
9575 theListOfVertexes Global indices of vertexes to perform fillet on.
9576 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9577 by the length of the edges, nearest to the fillet vertex.
9578 But sometimes the next edge is C1 continuous with the one, nearest to
9579 the fillet point, and such two (or more) edges can be united to allow
9580 bigger radius. Set this flag to TRUE to allow collinear edges union,
9581 thus ignoring the secant vertex (vertices).
9582 theName Object name; when specified, this parameter is used
9583 for result publication in the study. Otherwise, if automatic
9584 publication is switched on, default value is used for result name.
9586 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9588 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9591 New GEOM.GEOM_Object, containing the result shape.
9595 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
9596 # make fillet at given wire vertices with giver radius
9597 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
9599 # Example: see GEOM_TestAll.py
9600 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
9601 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
9602 RaiseIfFailed("MakeFillet1D", self.LocalOp)
9603 anObj.SetParameters(Parameters)
9604 self._autoPublish(anObj, theName, "fillet")
9607 ## Perform a fillet at the specified vertices of the given face/shell.
9608 # @param theShape Face or Shell shape to perform fillet on.
9609 # @param theR Fillet radius.
9610 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9611 # @param theName Object name; when specified, this parameter is used
9612 # for result publication in the study. Otherwise, if automatic
9613 # publication is switched on, default value is used for result name.
9615 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9617 # @return New GEOM.GEOM_Object, containing the result shape.
9619 # @ref tui_fillet2d "Example"
9620 @ManageTransactions("LocalOp")
9621 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
9623 Perform a fillet at the specified vertices of the given face/shell.
9626 theShape Face or Shell shape to perform fillet on.
9628 theListOfVertexes Global indices of vertexes to perform fillet on.
9629 theName Object name; when specified, this parameter is used
9630 for result publication in the study. Otherwise, if automatic
9631 publication is switched on, default value is used for result name.
9633 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9636 New GEOM.GEOM_Object, containing the result shape.
9639 face = geompy.MakeFaceHW(100, 100, 1)
9640 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
9642 # Example: see GEOM_TestAll.py
9643 theR,Parameters = ParseParameters(theR)
9644 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
9645 RaiseIfFailed("MakeFillet2D", self.LocalOp)
9646 anObj.SetParameters(Parameters)
9647 self._autoPublish(anObj, theName, "fillet")
9650 ## Perform a symmetric chamfer on all edges of the given shape.
9651 # @param theShape Shape, to perform chamfer on.
9652 # @param theD Chamfer size along each face.
9653 # @param theName Object name; when specified, this parameter is used
9654 # for result publication in the study. Otherwise, if automatic
9655 # publication is switched on, default value is used for result name.
9657 # @return New GEOM.GEOM_Object, containing the result shape.
9659 # @ref tui_chamfer "Example 1"
9660 # \n @ref swig_MakeChamferAll "Example 2"
9661 @ManageTransactions("LocalOp")
9662 def MakeChamferAll(self, theShape, theD, theName=None):
9664 Perform a symmetric chamfer on all edges of the given shape.
9667 theShape Shape, to perform chamfer on.
9668 theD Chamfer size along each face.
9669 theName Object name; when specified, this parameter is used
9670 for result publication in the study. Otherwise, if automatic
9671 publication is switched on, default value is used for result name.
9674 New GEOM.GEOM_Object, containing the result shape.
9677 chamfer_all = geompy.MakeChamferAll(prism, 10.)
9679 # Example: see GEOM_TestOthers.py
9680 theD,Parameters = ParseParameters(theD)
9681 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
9682 RaiseIfFailed("MakeChamferAll", self.LocalOp)
9683 anObj.SetParameters(Parameters)
9684 self._autoPublish(anObj, theName, "chamfer")
9687 ## Perform a chamfer on edges, common to the specified faces,
9688 # with distance D1 on the Face1
9689 # @param theShape Shape, to perform chamfer on.
9690 # @param theD1 Chamfer size along \a theFace1.
9691 # @param theD2 Chamfer size along \a theFace2.
9692 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9693 # @param theName Object name; when specified, this parameter is used
9694 # for result publication in the study. Otherwise, if automatic
9695 # publication is switched on, default value is used for result name.
9697 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9699 # @return New GEOM.GEOM_Object, containing the result shape.
9701 # @ref tui_chamfer "Example"
9702 @ManageTransactions("LocalOp")
9703 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
9705 Perform a chamfer on edges, common to the specified faces,
9706 with distance D1 on the Face1
9709 theShape Shape, to perform chamfer on.
9710 theD1 Chamfer size along theFace1.
9711 theD2 Chamfer size along theFace2.
9712 theFace1,theFace2 Global indices of two faces of theShape.
9713 theName Object name; when specified, this parameter is used
9714 for result publication in the study. Otherwise, if automatic
9715 publication is switched on, default value is used for result name.
9718 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9721 New GEOM.GEOM_Object, containing the result shape.
9724 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9725 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9726 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9727 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
9729 # Example: see GEOM_TestAll.py
9730 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9731 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
9732 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
9733 anObj.SetParameters(Parameters)
9734 self._autoPublish(anObj, theName, "chamfer")
9737 ## Perform a chamfer on edges
9738 # @param theShape Shape, to perform chamfer on.
9739 # @param theD Chamfer length
9740 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9741 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
9742 # @param theName Object name; when specified, this parameter is used
9743 # for result publication in the study. Otherwise, if automatic
9744 # publication is switched on, default value is used for result name.
9746 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9748 # @return New GEOM.GEOM_Object, containing the result shape.
9749 @ManageTransactions("LocalOp")
9750 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
9752 Perform a chamfer on edges
9755 theShape Shape, to perform chamfer on.
9756 theD1 Chamfer size along theFace1.
9757 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
9758 theFace1,theFace2 Global indices of two faces of theShape.
9759 theName Object name; when specified, this parameter is used
9760 for result publication in the study. Otherwise, if automatic
9761 publication is switched on, default value is used for result name.
9764 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9767 New GEOM.GEOM_Object, containing the result shape.
9770 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
9771 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
9772 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
9774 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
9777 if isinstance(theAngle,str):
9779 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9781 theAngle = theAngle*math.pi/180.0
9782 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
9783 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
9784 anObj.SetParameters(Parameters)
9785 self._autoPublish(anObj, theName, "chamfer")
9788 ## Perform a chamfer on all edges of the specified faces,
9789 # with distance D1 on the first specified face (if several for one edge)
9790 # @param theShape Shape, to perform chamfer on.
9791 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
9792 # connected to the edge, are in \a theFaces, \a theD1
9793 # will be get along face, which is nearer to \a theFaces beginning.
9794 # @param theD2 Chamfer size along another of two faces, connected to the edge.
9795 # @param theFaces Sequence of global indices of faces of \a theShape.
9796 # @param theName Object name; when specified, this parameter is used
9797 # for result publication in the study. Otherwise, if automatic
9798 # publication is switched on, default value is used for result name.
9800 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9802 # @return New GEOM.GEOM_Object, containing the result shape.
9804 # @ref tui_chamfer "Example"
9805 @ManageTransactions("LocalOp")
9806 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
9808 Perform a chamfer on all edges of the specified faces,
9809 with distance D1 on the first specified face (if several for one edge)
9812 theShape Shape, to perform chamfer on.
9813 theD1 Chamfer size along face from theFaces. If both faces,
9814 connected to the edge, are in theFaces, theD1
9815 will be get along face, which is nearer to theFaces beginning.
9816 theD2 Chamfer size along another of two faces, connected to the edge.
9817 theFaces Sequence of global indices of faces of theShape.
9818 theName Object name; when specified, this parameter is used
9819 for result publication in the study. Otherwise, if automatic
9820 publication is switched on, default value is used for result name.
9822 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
9825 New GEOM.GEOM_Object, containing the result shape.
9827 # Example: see GEOM_TestAll.py
9828 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9829 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
9830 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
9831 anObj.SetParameters(Parameters)
9832 self._autoPublish(anObj, theName, "chamfer")
9835 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
9836 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9838 # @ref swig_FilletChamfer "Example"
9839 @ManageTransactions("LocalOp")
9840 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
9842 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
9843 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9846 if isinstance(theAngle,str):
9848 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9850 theAngle = theAngle*math.pi/180.0
9851 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
9852 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
9853 anObj.SetParameters(Parameters)
9854 self._autoPublish(anObj, theName, "chamfer")
9857 ## Perform a chamfer on edges,
9858 # with distance D1 on the first specified face (if several for one edge)
9859 # @param theShape Shape, to perform chamfer on.
9860 # @param theD1,theD2 Chamfer size
9861 # @param theEdges Sequence of edges of \a theShape.
9862 # @param theName Object name; when specified, this parameter is used
9863 # for result publication in the study. Otherwise, if automatic
9864 # publication is switched on, default value is used for result name.
9866 # @return New GEOM.GEOM_Object, containing the result shape.
9868 # @ref swig_FilletChamfer "Example"
9869 @ManageTransactions("LocalOp")
9870 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
9872 Perform a chamfer on edges,
9873 with distance D1 on the first specified face (if several for one edge)
9876 theShape Shape, to perform chamfer on.
9877 theD1,theD2 Chamfer size
9878 theEdges Sequence of edges of theShape.
9879 theName Object name; when specified, this parameter is used
9880 for result publication in the study. Otherwise, if automatic
9881 publication is switched on, default value is used for result name.
9884 New GEOM.GEOM_Object, containing the result shape.
9886 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
9887 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
9888 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
9889 anObj.SetParameters(Parameters)
9890 self._autoPublish(anObj, theName, "chamfer")
9893 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
9894 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9895 @ManageTransactions("LocalOp")
9896 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
9898 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
9899 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
9902 if isinstance(theAngle,str):
9904 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
9906 theAngle = theAngle*math.pi/180.0
9907 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
9908 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
9909 anObj.SetParameters(Parameters)
9910 self._autoPublish(anObj, theName, "chamfer")
9913 ## @sa MakeChamferEdge(), MakeChamferFaces()
9915 # @ref swig_MakeChamfer "Example"
9916 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
9918 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
9920 # Example: see GEOM_TestOthers.py
9922 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
9923 if aShapeType == self.ShapeType["EDGE"]:
9924 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
9926 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
9929 ## Remove material from a solid by extrusion of the base shape on the given distance.
9930 # @param theInit Shape to remove material from. It must be a solid or
9931 # a compound made of a single solid.
9932 # @param theBase Closed edge or wire defining the base shape to be extruded.
9933 # @param theH Prism dimension along the normal to theBase
9934 # @param theAngle Draft angle in degrees.
9935 # @param theName Object name; when specified, this parameter is used
9936 # for result publication in the study. Otherwise, if automatic
9937 # publication is switched on, default value is used for result name.
9939 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
9941 # @ref tui_creation_prism "Example"
9942 @ManageTransactions("PrimOp")
9943 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
9945 Add material to a solid by extrusion of the base shape on the given distance.
9948 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
9949 theBase Closed edge or wire defining the base shape to be extruded.
9950 theH Prism dimension along the normal to theBase
9951 theAngle Draft angle in degrees.
9952 theName Object name; when specified, this parameter is used
9953 for result publication in the study. Otherwise, if automatic
9954 publication is switched on, default value is used for result name.
9957 New GEOM.GEOM_Object, containing the initial shape with removed material.
9959 # Example: see GEOM_TestAll.py
9960 #theH,Parameters = ParseParameters(theH)
9961 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
9962 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
9963 #anObj.SetParameters(Parameters)
9964 self._autoPublish(anObj, theName, "extrudedCut")
9967 ## Add material to a solid by extrusion of the base shape on the given distance.
9968 # @param theInit Shape to add material to. It must be a solid or
9969 # a compound made of a single solid.
9970 # @param theBase Closed edge or wire defining the base shape to be extruded.
9971 # @param theH Prism dimension along the normal to theBase
9972 # @param theAngle Draft angle in degrees.
9973 # @param theName Object name; when specified, this parameter is used
9974 # for result publication in the study. Otherwise, if automatic
9975 # publication is switched on, default value is used for result name.
9977 # @return New GEOM.GEOM_Object, containing the initial shape with added material
9979 # @ref tui_creation_prism "Example"
9980 @ManageTransactions("PrimOp")
9981 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
9983 Add material to a solid by extrusion of the base shape on the given distance.
9986 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
9987 theBase Closed edge or wire defining the base shape to be extruded.
9988 theH Prism dimension along the normal to theBase
9989 theAngle Draft angle in degrees.
9990 theName Object name; when specified, this parameter is used
9991 for result publication in the study. Otherwise, if automatic
9992 publication is switched on, default value is used for result name.
9995 New GEOM.GEOM_Object, containing the initial shape with added material.
9997 # Example: see GEOM_TestAll.py
9998 #theH,Parameters = ParseParameters(theH)
9999 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
10000 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10001 #anObj.SetParameters(Parameters)
10002 self._autoPublish(anObj, theName, "extrudedBoss")
10008 ## @addtogroup l3_basic_op
10011 ## Perform an Archimde operation on the given shape with given parameters.
10012 # The object presenting the resulting face is returned.
10013 # @param theShape Shape to be put in water.
10014 # @param theWeight Weight of the shape.
10015 # @param theWaterDensity Density of the water.
10016 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10017 # @param theName Object name; when specified, this parameter is used
10018 # for result publication in the study. Otherwise, if automatic
10019 # publication is switched on, default value is used for result name.
10021 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10022 # by a plane, corresponding to water level.
10024 # @ref tui_archimede "Example"
10025 @ManageTransactions("LocalOp")
10026 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10028 Perform an Archimde operation on the given shape with given parameters.
10029 The object presenting the resulting face is returned.
10032 theShape Shape to be put in water.
10033 theWeight Weight of the shape.
10034 theWaterDensity Density of the water.
10035 theMeshDeflection Deflection of the mesh, using to compute the section.
10036 theName Object name; when specified, this parameter is used
10037 for result publication in the study. Otherwise, if automatic
10038 publication is switched on, default value is used for result name.
10041 New GEOM.GEOM_Object, containing a section of theShape
10042 by a plane, corresponding to water level.
10044 # Example: see GEOM_TestAll.py
10045 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10046 theWeight,theWaterDensity,theMeshDeflection)
10047 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10048 RaiseIfFailed("MakeArchimede", self.LocalOp)
10049 anObj.SetParameters(Parameters)
10050 self._autoPublish(anObj, theName, "archimede")
10053 # end of l3_basic_op
10056 ## @addtogroup l2_measure
10059 ## Get point coordinates
10060 # @return [x, y, z]
10062 # @ref tui_point_coordinates_page "Example"
10063 @ManageTransactions("MeasuOp")
10064 def PointCoordinates(self,Point):
10066 Get point coordinates
10071 # Example: see GEOM_TestMeasures.py
10072 aTuple = self.MeasuOp.PointCoordinates(Point)
10073 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10076 ## Get vector coordinates
10077 # @return [x, y, z]
10079 # @ref tui_measurement_tools_page "Example"
10080 def VectorCoordinates(self,Vector):
10082 Get vector coordinates
10088 p1=self.GetFirstVertex(Vector)
10089 p2=self.GetLastVertex(Vector)
10091 X1=self.PointCoordinates(p1)
10092 X2=self.PointCoordinates(p2)
10094 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10097 ## Compute cross product
10098 # @return vector w=u^v
10100 # @ref tui_measurement_tools_page "Example"
10101 def CrossProduct(self, Vector1, Vector2):
10103 Compute cross product
10105 Returns: vector w=u^v
10107 u=self.VectorCoordinates(Vector1)
10108 v=self.VectorCoordinates(Vector2)
10109 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])
10113 ## Compute cross product
10114 # @return dot product p=u.v
10116 # @ref tui_measurement_tools_page "Example"
10117 def DotProduct(self, Vector1, Vector2):
10119 Compute cross product
10121 Returns: dot product p=u.v
10123 u=self.VectorCoordinates(Vector1)
10124 v=self.VectorCoordinates(Vector2)
10125 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10130 ## Get summarized length of all wires,
10131 # area of surface and volume of the given shape.
10132 # @param theShape Shape to define properties of.
10133 # @return [theLength, theSurfArea, theVolume]\n
10134 # theLength: Summarized length of all wires of the given shape.\n
10135 # theSurfArea: Area of surface of the given shape.\n
10136 # theVolume: Volume of the given shape.
10138 # @ref tui_basic_properties_page "Example"
10139 @ManageTransactions("MeasuOp")
10140 def BasicProperties(self,theShape):
10142 Get summarized length of all wires,
10143 area of surface and volume of the given shape.
10146 theShape Shape to define properties of.
10149 [theLength, theSurfArea, theVolume]
10150 theLength: Summarized length of all wires of the given shape.
10151 theSurfArea: Area of surface of the given shape.
10152 theVolume: Volume of the given shape.
10154 # Example: see GEOM_TestMeasures.py
10155 aTuple = self.MeasuOp.GetBasicProperties(theShape)
10156 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10159 ## Get parameters of bounding box of the given shape
10160 # @param theShape Shape to obtain bounding box of.
10161 # @param precise TRUE for precise computation; FALSE for fast one.
10162 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10163 # Xmin,Xmax: Limits of shape along OX axis.
10164 # Ymin,Ymax: Limits of shape along OY axis.
10165 # Zmin,Zmax: Limits of shape along OZ axis.
10167 # @ref tui_bounding_box_page "Example"
10168 @ManageTransactions("MeasuOp")
10169 def BoundingBox (self, theShape, precise=False):
10171 Get parameters of bounding box of the given shape
10174 theShape Shape to obtain bounding box of.
10175 precise TRUE for precise computation; FALSE for fast one.
10178 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10179 Xmin,Xmax: Limits of shape along OX axis.
10180 Ymin,Ymax: Limits of shape along OY axis.
10181 Zmin,Zmax: Limits of shape along OZ axis.
10183 # Example: see GEOM_TestMeasures.py
10184 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10185 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10188 ## Get bounding box of the given shape
10189 # @param theShape Shape to obtain bounding box of.
10190 # @param precise TRUE for precise computation; FALSE for fast one.
10191 # @param theName Object name; when specified, this parameter is used
10192 # for result publication in the study. Otherwise, if automatic
10193 # publication is switched on, default value is used for result name.
10195 # @return New GEOM.GEOM_Object, containing the created box.
10197 # @ref tui_bounding_box_page "Example"
10198 @ManageTransactions("MeasuOp")
10199 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10201 Get bounding box of the given shape
10204 theShape Shape to obtain bounding box of.
10205 precise TRUE for precise computation; FALSE for fast one.
10206 theName Object name; when specified, this parameter is used
10207 for result publication in the study. Otherwise, if automatic
10208 publication is switched on, default value is used for result name.
10211 New GEOM.GEOM_Object, containing the created box.
10213 # Example: see GEOM_TestMeasures.py
10214 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10215 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10216 self._autoPublish(anObj, theName, "bndbox")
10219 ## Get inertia matrix and moments of inertia of theShape.
10220 # @param theShape Shape to calculate inertia of.
10221 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10222 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10223 # Ix,Iy,Iz: Moments of inertia of the given shape.
10225 # @ref tui_inertia_page "Example"
10226 @ManageTransactions("MeasuOp")
10227 def Inertia(self,theShape):
10229 Get inertia matrix and moments of inertia of theShape.
10232 theShape Shape to calculate inertia of.
10235 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10236 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10237 Ix,Iy,Iz: Moments of inertia of the given shape.
10239 # Example: see GEOM_TestMeasures.py
10240 aTuple = self.MeasuOp.GetInertia(theShape)
10241 RaiseIfFailed("GetInertia", self.MeasuOp)
10244 ## Get if coords are included in the shape (ST_IN or ST_ON)
10245 # @param theShape Shape
10246 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10247 # @param tolerance to be used (default is 1.0e-7)
10248 # @return list_of_boolean = [res1, res2, ...]
10249 @ManageTransactions("MeasuOp")
10250 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10252 Get if coords are included in the shape (ST_IN or ST_ON)
10256 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10257 tolerance to be used (default is 1.0e-7)
10260 list_of_boolean = [res1, res2, ...]
10262 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10264 ## Get minimal distance between the given shapes.
10265 # @param theShape1,theShape2 Shapes to find minimal distance between.
10266 # @return Value of the minimal distance between the given shapes.
10268 # @ref tui_min_distance_page "Example"
10269 @ManageTransactions("MeasuOp")
10270 def MinDistance(self, theShape1, theShape2):
10272 Get minimal distance between the given shapes.
10275 theShape1,theShape2 Shapes to find minimal distance between.
10278 Value of the minimal distance between the given shapes.
10280 # Example: see GEOM_TestMeasures.py
10281 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10282 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10285 ## Get minimal distance between the given shapes.
10286 # @param theShape1,theShape2 Shapes to find minimal distance between.
10287 # @return Value of the minimal distance between the given shapes, in form of list
10288 # [Distance, DX, DY, DZ].
10290 # @ref tui_min_distance_page "Example"
10291 @ManageTransactions("MeasuOp")
10292 def MinDistanceComponents(self, theShape1, theShape2):
10294 Get minimal distance between the given shapes.
10297 theShape1,theShape2 Shapes to find minimal distance between.
10300 Value of the minimal distance between the given shapes, in form of list
10301 [Distance, DX, DY, DZ]
10303 # Example: see GEOM_TestMeasures.py
10304 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10305 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10306 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10309 ## Get closest points of the given shapes.
10310 # @param theShape1,theShape2 Shapes to find closest points of.
10311 # @return The number of found solutions (-1 in case of infinite number of
10312 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10314 # @ref tui_min_distance_page "Example"
10315 @ManageTransactions("MeasuOp")
10316 def ClosestPoints (self, theShape1, theShape2):
10318 Get closest points of the given shapes.
10321 theShape1,theShape2 Shapes to find closest points of.
10324 The number of found solutions (-1 in case of infinite number of
10325 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10327 # Example: see GEOM_TestMeasures.py
10328 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10329 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10332 ## Get angle between the given shapes in degrees.
10333 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10334 # @note If both arguments are vectors, the angle is computed in accordance
10335 # with their orientations, otherwise the minimum angle is computed.
10336 # @return Value of the angle between the given shapes in degrees.
10338 # @ref tui_angle_page "Example"
10339 @ManageTransactions("MeasuOp")
10340 def GetAngle(self, theShape1, theShape2):
10342 Get angle between the given shapes in degrees.
10345 theShape1,theShape2 Lines or linear edges to find angle between.
10348 If both arguments are vectors, the angle is computed in accordance
10349 with their orientations, otherwise the minimum angle is computed.
10352 Value of the angle between the given shapes in degrees.
10354 # Example: see GEOM_TestMeasures.py
10355 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10356 RaiseIfFailed("GetAngle", self.MeasuOp)
10359 ## Get angle between the given shapes in radians.
10360 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10361 # @note If both arguments are vectors, the angle is computed in accordance
10362 # with their orientations, otherwise the minimum angle is computed.
10363 # @return Value of the angle between the given shapes in radians.
10365 # @ref tui_angle_page "Example"
10366 @ManageTransactions("MeasuOp")
10367 def GetAngleRadians(self, theShape1, theShape2):
10369 Get angle between the given shapes in radians.
10372 theShape1,theShape2 Lines or linear edges to find angle between.
10376 If both arguments are vectors, the angle is computed in accordance
10377 with their orientations, otherwise the minimum angle is computed.
10380 Value of the angle between the given shapes in radians.
10382 # Example: see GEOM_TestMeasures.py
10383 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10384 RaiseIfFailed("GetAngle", self.MeasuOp)
10387 ## Get angle between the given vectors in degrees.
10388 # @param theShape1,theShape2 Vectors to find angle between.
10389 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10390 # if False, the opposite vector to the normal vector is used.
10391 # @return Value of the angle between the given vectors in degrees.
10393 # @ref tui_angle_page "Example"
10394 @ManageTransactions("MeasuOp")
10395 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10397 Get angle between the given vectors in degrees.
10400 theShape1,theShape2 Vectors to find angle between.
10401 theFlag If True, the normal vector is defined by the two vectors cross,
10402 if False, the opposite vector to the normal vector is used.
10405 Value of the angle between the given vectors in degrees.
10407 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10409 anAngle = 360. - anAngle
10410 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10413 ## The same as GetAngleVectors, but the result is in radians.
10414 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10416 Get angle between the given vectors in radians.
10419 theShape1,theShape2 Vectors to find angle between.
10420 theFlag If True, the normal vector is defined by the two vectors cross,
10421 if False, the opposite vector to the normal vector is used.
10424 Value of the angle between the given vectors in radians.
10426 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10429 ## @name Curve Curvature Measurement
10430 # Methods for receiving radius of curvature of curves
10431 # in the given point
10434 ## Measure curvature of a curve at a point, set by parameter.
10435 # @param theCurve a curve.
10436 # @param theParam parameter.
10437 # @return radius of curvature of \a theCurve.
10439 # @ref swig_todo "Example"
10440 @ManageTransactions("MeasuOp")
10441 def CurveCurvatureByParam(self, theCurve, theParam):
10443 Measure curvature of a curve at a point, set by parameter.
10447 theParam parameter.
10450 radius of curvature of theCurve.
10452 # Example: see GEOM_TestMeasures.py
10453 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10454 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10457 ## Measure curvature of a curve at a point.
10458 # @param theCurve a curve.
10459 # @param thePoint given point.
10460 # @return radius of curvature of \a theCurve.
10462 # @ref swig_todo "Example"
10463 @ManageTransactions("MeasuOp")
10464 def CurveCurvatureByPoint(self, theCurve, thePoint):
10466 Measure curvature of a curve at a point.
10470 thePoint given point.
10473 radius of curvature of theCurve.
10475 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10476 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10480 ## @name Surface Curvature Measurement
10481 # Methods for receiving max and min radius of curvature of surfaces
10482 # in the given point
10485 ## Measure max radius of curvature of surface.
10486 # @param theSurf the given surface.
10487 # @param theUParam Value of U-parameter on the referenced surface.
10488 # @param theVParam Value of V-parameter on the referenced surface.
10489 # @return max radius of curvature of theSurf.
10491 ## @ref swig_todo "Example"
10492 @ManageTransactions("MeasuOp")
10493 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10495 Measure max radius of curvature of surface.
10498 theSurf the given surface.
10499 theUParam Value of U-parameter on the referenced surface.
10500 theVParam Value of V-parameter on the referenced surface.
10503 max radius of curvature of theSurf.
10505 # Example: see GEOM_TestMeasures.py
10506 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10507 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10510 ## Measure max radius of curvature of surface in the given point
10511 # @param theSurf the given surface.
10512 # @param thePoint given point.
10513 # @return max radius of curvature of theSurf.
10515 ## @ref swig_todo "Example"
10516 @ManageTransactions("MeasuOp")
10517 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10519 Measure max radius of curvature of surface in the given point.
10522 theSurf the given surface.
10523 thePoint given point.
10526 max radius of curvature of theSurf.
10528 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10529 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10532 ## Measure min radius of curvature of surface.
10533 # @param theSurf the given surface.
10534 # @param theUParam Value of U-parameter on the referenced surface.
10535 # @param theVParam Value of V-parameter on the referenced surface.
10536 # @return min radius of curvature of theSurf.
10538 ## @ref swig_todo "Example"
10539 @ManageTransactions("MeasuOp")
10540 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10542 Measure min radius of curvature of surface.
10545 theSurf the given surface.
10546 theUParam Value of U-parameter on the referenced surface.
10547 theVParam Value of V-parameter on the referenced surface.
10550 Min radius of curvature of theSurf.
10552 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10553 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10556 ## Measure min radius of curvature of surface in the given point
10557 # @param theSurf the given surface.
10558 # @param thePoint given point.
10559 # @return min radius of curvature of theSurf.
10561 ## @ref swig_todo "Example"
10562 @ManageTransactions("MeasuOp")
10563 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10565 Measure min radius of curvature of surface in the given point.
10568 theSurf the given surface.
10569 thePoint given point.
10572 Min radius of curvature of theSurf.
10574 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10575 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10579 ## Get min and max tolerances of sub-shapes of theShape
10580 # @param theShape Shape, to get tolerances of.
10581 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10582 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10583 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10584 # VertMin,VertMax: Min and max tolerances of the vertices.
10586 # @ref tui_tolerance_page "Example"
10587 @ManageTransactions("MeasuOp")
10588 def Tolerance(self,theShape):
10590 Get min and max tolerances of sub-shapes of theShape
10593 theShape Shape, to get tolerances of.
10596 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
10597 FaceMin,FaceMax: Min and max tolerances of the faces.
10598 EdgeMin,EdgeMax: Min and max tolerances of the edges.
10599 VertMin,VertMax: Min and max tolerances of the vertices.
10601 # Example: see GEOM_TestMeasures.py
10602 aTuple = self.MeasuOp.GetTolerance(theShape)
10603 RaiseIfFailed("GetTolerance", self.MeasuOp)
10606 ## Obtain description of the given shape (number of sub-shapes of each type)
10607 # @param theShape Shape to be described.
10608 # @return Description of the given shape.
10610 # @ref tui_whatis_page "Example"
10611 @ManageTransactions("MeasuOp")
10612 def WhatIs(self,theShape):
10614 Obtain description of the given shape (number of sub-shapes of each type)
10617 theShape Shape to be described.
10620 Description of the given shape.
10622 # Example: see GEOM_TestMeasures.py
10623 aDescr = self.MeasuOp.WhatIs(theShape)
10624 RaiseIfFailed("WhatIs", self.MeasuOp)
10627 ## Obtain quantity of shapes of the given type in \a theShape.
10628 # If \a theShape is of type \a theType, it is also counted.
10629 # @param theShape Shape to be described.
10630 # @param theType the given ShapeType().
10631 # @return Quantity of shapes of type \a theType in \a theShape.
10633 # @ref tui_measurement_tools_page "Example"
10634 def NbShapes (self, theShape, theType):
10636 Obtain quantity of shapes of the given type in theShape.
10637 If theShape is of type theType, it is also counted.
10640 theShape Shape to be described.
10641 theType the given geompy.ShapeType
10644 Quantity of shapes of type theType in theShape.
10646 # Example: see GEOM_TestMeasures.py
10647 listSh = self.SubShapeAllIDs(theShape, theType)
10651 ## Obtain quantity of shapes of each type in \a theShape.
10652 # The \a theShape is also counted.
10653 # @param theShape Shape to be described.
10654 # @return Dictionary of ShapeType() with bound quantities of shapes.
10656 # @ref tui_measurement_tools_page "Example"
10657 def ShapeInfo (self, theShape):
10659 Obtain quantity of shapes of each type in theShape.
10660 The theShape is also counted.
10663 theShape Shape to be described.
10666 Dictionary of geompy.ShapeType with bound quantities of shapes.
10668 # Example: see GEOM_TestMeasures.py
10670 for typeSh in self.ShapeType:
10671 if typeSh in ( "AUTO", "SHAPE" ): continue
10672 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
10678 def GetCreationInformation(self, theShape):
10679 info = theShape.GetCreationInformation()
10681 opName = info.operationName
10682 if not opName: opName = "no info available"
10683 res = "Operation: " + opName
10685 for parVal in info.params:
10686 res += " \n %s = %s" % ( parVal.name, parVal.value )
10689 ## Get a point, situated at the centre of mass of theShape.
10690 # @param theShape Shape to define centre of mass of.
10691 # @param theName Object name; when specified, this parameter is used
10692 # for result publication in the study. Otherwise, if automatic
10693 # publication is switched on, default value is used for result name.
10695 # @return New GEOM.GEOM_Object, containing the created point.
10697 # @ref tui_center_of_mass_page "Example"
10698 @ManageTransactions("MeasuOp")
10699 def MakeCDG(self, theShape, theName=None):
10701 Get a point, situated at the centre of mass of theShape.
10704 theShape Shape to define centre of mass of.
10705 theName Object name; when specified, this parameter is used
10706 for result publication in the study. Otherwise, if automatic
10707 publication is switched on, default value is used for result name.
10710 New GEOM.GEOM_Object, containing the created point.
10712 # Example: see GEOM_TestMeasures.py
10713 anObj = self.MeasuOp.GetCentreOfMass(theShape)
10714 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
10715 self._autoPublish(anObj, theName, "centerOfMass")
10718 ## Get a vertex sub-shape by index depended with orientation.
10719 # @param theShape Shape to find sub-shape.
10720 # @param theIndex Index to find vertex by this index (starting from zero)
10721 # @param theName Object name; when specified, this parameter is used
10722 # for result publication in the study. Otherwise, if automatic
10723 # publication is switched on, default value is used for result name.
10725 # @return New GEOM.GEOM_Object, containing the created vertex.
10727 # @ref tui_measurement_tools_page "Example"
10728 @ManageTransactions("MeasuOp")
10729 def GetVertexByIndex(self, theShape, theIndex, theName=None):
10731 Get a vertex sub-shape by index depended with orientation.
10734 theShape Shape to find sub-shape.
10735 theIndex Index to find vertex by this index (starting from zero)
10736 theName Object name; when specified, this parameter is used
10737 for result publication in the study. Otherwise, if automatic
10738 publication is switched on, default value is used for result name.
10741 New GEOM.GEOM_Object, containing the created vertex.
10743 # Example: see GEOM_TestMeasures.py
10744 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
10745 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
10746 self._autoPublish(anObj, theName, "vertex")
10749 ## Get the first vertex of wire/edge depended orientation.
10750 # @param theShape Shape to find first vertex.
10751 # @param theName Object name; when specified, this parameter is used
10752 # for result publication in the study. Otherwise, if automatic
10753 # publication is switched on, default value is used for result name.
10755 # @return New GEOM.GEOM_Object, containing the created vertex.
10757 # @ref tui_measurement_tools_page "Example"
10758 def GetFirstVertex(self, theShape, theName=None):
10760 Get the first vertex of wire/edge depended orientation.
10763 theShape Shape to find first vertex.
10764 theName Object name; when specified, this parameter is used
10765 for result publication in the study. Otherwise, if automatic
10766 publication is switched on, default value is used for result name.
10769 New GEOM.GEOM_Object, containing the created vertex.
10771 # Example: see GEOM_TestMeasures.py
10772 # note: auto-publishing is done in self.GetVertexByIndex()
10773 return self.GetVertexByIndex(theShape, 0, theName)
10775 ## Get the last vertex of wire/edge depended orientation.
10776 # @param theShape Shape to find last vertex.
10777 # @param theName Object name; when specified, this parameter is used
10778 # for result publication in the study. Otherwise, if automatic
10779 # publication is switched on, default value is used for result name.
10781 # @return New GEOM.GEOM_Object, containing the created vertex.
10783 # @ref tui_measurement_tools_page "Example"
10784 def GetLastVertex(self, theShape, theName=None):
10786 Get the last vertex of wire/edge depended orientation.
10789 theShape Shape to find last vertex.
10790 theName Object name; when specified, this parameter is used
10791 for result publication in the study. Otherwise, if automatic
10792 publication is switched on, default value is used for result name.
10795 New GEOM.GEOM_Object, containing the created vertex.
10797 # Example: see GEOM_TestMeasures.py
10798 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
10799 # note: auto-publishing is done in self.GetVertexByIndex()
10800 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
10802 ## Get a normale to the given face. If the point is not given,
10803 # the normale is calculated at the center of mass.
10804 # @param theFace Face to define normale of.
10805 # @param theOptionalPoint Point to compute the normale at.
10806 # @param theName Object name; when specified, this parameter is used
10807 # for result publication in the study. Otherwise, if automatic
10808 # publication is switched on, default value is used for result name.
10810 # @return New GEOM.GEOM_Object, containing the created vector.
10812 # @ref swig_todo "Example"
10813 @ManageTransactions("MeasuOp")
10814 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
10816 Get a normale to the given face. If the point is not given,
10817 the normale is calculated at the center of mass.
10820 theFace Face to define normale of.
10821 theOptionalPoint Point to compute the normale at.
10822 theName Object name; when specified, this parameter is used
10823 for result publication in the study. Otherwise, if automatic
10824 publication is switched on, default value is used for result name.
10827 New GEOM.GEOM_Object, containing the created vector.
10829 # Example: see GEOM_TestMeasures.py
10830 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
10831 RaiseIfFailed("GetNormal", self.MeasuOp)
10832 self._autoPublish(anObj, theName, "normal")
10835 ## Print shape errors obtained from CheckShape.
10836 # @param theShape Shape that was checked.
10837 # @param theShapeErrors the shape errors obtained by CheckShape.
10838 # @param theReturnStatus If 0 the description of problem is printed.
10839 # If 1 the description of problem is returned.
10840 # @return If theReturnStatus is equal to 1 the description is returned.
10841 # Otherwise doesn't return anything.
10843 # @ref tui_check_shape_page "Example"
10844 @ManageTransactions("MeasuOp")
10845 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
10847 Print shape errors obtained from CheckShape.
10850 theShape Shape that was checked.
10851 theShapeErrors the shape errors obtained by CheckShape.
10852 theReturnStatus If 0 the description of problem is printed.
10853 If 1 the description of problem is returned.
10856 If theReturnStatus is equal to 1 the description is returned.
10857 Otherwise doesn't return anything.
10859 # Example: see GEOM_TestMeasures.py
10860 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
10861 if theReturnStatus == 1:
10866 ## Check a topology of the given shape.
10867 # @param theShape Shape to check validity of.
10868 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
10869 # if TRUE, the shape's geometry will be checked also.
10870 # @param theReturnStatus If 0 and if theShape is invalid, a description
10871 # of problem is printed.
10872 # If 1 isValid flag and the description of
10873 # problem is returned.
10874 # If 2 isValid flag and the list of error data
10876 # @return TRUE, if the shape "seems to be valid".
10877 # If theShape is invalid, prints a description of problem.
10878 # If theReturnStatus is equal to 1 the description is returned
10879 # along with IsValid flag.
10880 # If theReturnStatus is equal to 2 the list of error data is
10881 # returned along with IsValid flag.
10883 # @ref tui_check_shape_page "Example"
10884 @ManageTransactions("MeasuOp")
10885 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
10887 Check a topology of the given shape.
10890 theShape Shape to check validity of.
10891 theIsCheckGeom If FALSE, only the shape's topology will be checked,
10892 if TRUE, the shape's geometry will be checked also.
10893 theReturnStatus If 0 and if theShape is invalid, a description
10894 of problem is printed.
10895 If 1 IsValid flag and the description of
10896 problem is returned.
10897 If 2 IsValid flag and the list of error data
10901 TRUE, if the shape "seems to be valid".
10902 If theShape is invalid, prints a description of problem.
10903 If theReturnStatus is equal to 1 the description is returned
10904 along with IsValid flag.
10905 If theReturnStatus is equal to 2 the list of error data is
10906 returned along with IsValid flag.
10908 # Example: see GEOM_TestMeasures.py
10910 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
10911 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
10913 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
10914 RaiseIfFailed("CheckShape", self.MeasuOp)
10916 if theReturnStatus == 0:
10917 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10919 if theReturnStatus == 1:
10920 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
10921 return (IsValid, Descr)
10922 elif theReturnStatus == 2:
10923 return (IsValid, ShapeErrors)
10926 ## Detect self-intersections in the given shape.
10927 # @param theShape Shape to check.
10928 # @param theCheckLevel is the level of self-intersection check.
10929 # Possible input values are:
10930 # - GEOM.SI_V_V(0) - only V/V interferences
10931 # - GEOM.SI_V_E(1) - V/V and V/E interferences
10932 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10933 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10934 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10935 # - GEOM.SI_ALL(5) - all interferences.
10936 # @return TRUE, if the shape contains no self-intersections.
10938 # @ref tui_check_self_intersections_page "Example"
10939 @ManageTransactions("MeasuOp")
10940 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
10942 Detect self-intersections in the given shape.
10945 theShape Shape to check.
10946 theCheckLevel is the level of self-intersection check.
10947 Possible input values are:
10948 - GEOM.SI_V_V(0) - only V/V interferences
10949 - GEOM.SI_V_E(1) - V/V and V/E interferences
10950 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
10951 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
10952 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
10953 - GEOM.SI_ALL(5) - all interferences.
10956 TRUE, if the shape contains no self-intersections.
10958 # Example: see GEOM_TestMeasures.py
10959 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
10960 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
10963 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
10964 # @param theShape1 First source object
10965 # @param theShape2 Second source object
10966 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
10967 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
10968 # - if \a theTolerance > 0, algorithm detects gaps
10969 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
10970 # - if \a theDeflection <= 0, default deflection 0.001 is used
10971 # @return TRUE, if there are intersections (gaps) between source shapes
10972 # @return List of sub-shapes IDs from 1st shape that localize intersection.
10973 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
10975 # @ref tui_fast_intersection_page "Example"
10976 @ManageTransactions("MeasuOp")
10977 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
10979 Detect intersections of the given shapes with algorithm based on mesh intersections.
10982 theShape1 First source object
10983 theShape2 Second source object
10984 theTolerance Specifies a distance between shapes used for detecting gaps:
10985 - if theTolerance <= 0, algorithm detects intersections (default behavior)
10986 - if theTolerance > 0, algorithm detects gaps
10987 theDeflection Linear deflection coefficient that specifies quality of tesselation:
10988 - if theDeflection <= 0, default deflection 0.001 is used
10991 TRUE, if there are intersections (gaps) between source shapes
10992 List of sub-shapes IDs from 1st shape that localize intersection.
10993 List of sub-shapes IDs from 2nd shape that localize intersection.
10995 # Example: see GEOM_TestMeasures.py
10996 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
10997 RaiseIfFailed("FastIntersect", self.MeasuOp)
10998 return IsOk, Res1, Res2
11000 ## Get position (LCS) of theShape.
11002 # Origin of the LCS is situated at the shape's center of mass.
11003 # Axes of the LCS are obtained from shape's location or,
11004 # if the shape is a planar face, from position of its plane.
11006 # @param theShape Shape to calculate position of.
11007 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11008 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11009 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11010 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11012 # @ref swig_todo "Example"
11013 @ManageTransactions("MeasuOp")
11014 def GetPosition(self,theShape):
11016 Get position (LCS) of theShape.
11017 Origin of the LCS is situated at the shape's center of mass.
11018 Axes of the LCS are obtained from shape's location or,
11019 if the shape is a planar face, from position of its plane.
11022 theShape Shape to calculate position of.
11025 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11026 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11027 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11028 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11030 # Example: see GEOM_TestMeasures.py
11031 aTuple = self.MeasuOp.GetPosition(theShape)
11032 RaiseIfFailed("GetPosition", self.MeasuOp)
11035 ## Get kind of theShape.
11037 # @param theShape Shape to get a kind of.
11038 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11039 # and a list of parameters, describing the shape.
11040 # @note Concrete meaning of each value, returned via \a theIntegers
11041 # or \a theDoubles list depends on the kind() of the shape.
11043 # @ref swig_todo "Example"
11044 @ManageTransactions("MeasuOp")
11045 def KindOfShape(self,theShape):
11047 Get kind of theShape.
11050 theShape Shape to get a kind of.
11053 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11054 and a list of parameters, describing the shape.
11056 Concrete meaning of each value, returned via theIntegers
11057 or theDoubles list depends on the geompy.kind of the shape
11059 # Example: see GEOM_TestMeasures.py
11060 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11061 RaiseIfFailed("KindOfShape", self.MeasuOp)
11063 aKind = aRoughTuple[0]
11064 anInts = aRoughTuple[1]
11065 aDbls = aRoughTuple[2]
11067 # Now there is no exception from this rule:
11068 aKindTuple = [aKind] + aDbls + anInts
11070 # If they are we will regroup parameters for such kind of shape.
11072 #if aKind == kind.SOME_KIND:
11073 # # SOME_KIND int int double int double double
11074 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11078 ## Returns the string that describes if the shell is good for solid.
11079 # This is a support method for MakeSolid.
11081 # @param theShell the shell to be checked.
11082 # @return Returns a string that describes the shell validity for
11083 # solid construction.
11084 @ManageTransactions("MeasuOp")
11085 def _IsGoodForSolid(self, theShell):
11087 Returns the string that describes if the shell is good for solid.
11088 This is a support method for MakeSolid.
11091 theShell the shell to be checked.
11094 Returns a string that describes the shell validity for
11095 solid construction.
11097 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11100 # end of l2_measure
11103 ## @addtogroup l2_import_export
11106 ## Import a shape from the BREP, IGES, STEP or other file
11107 # (depends on given format) with given name.
11109 # Note: this function is deprecated, it is kept for backward compatibility only
11110 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11112 # @param theFileName The file, containing the shape.
11113 # @param theFormatName Specify format for the file reading.
11114 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11115 # If format 'IGES_SCALE' is used instead of 'IGES' or
11116 # format 'STEP_SCALE' is used instead of 'STEP',
11117 # length unit will be set to 'meter' and result model will be scaled.
11118 # @param theName Object name; when specified, this parameter is used
11119 # for result publication in the study. Otherwise, if automatic
11120 # publication is switched on, default value is used for result name.
11122 # @return New GEOM.GEOM_Object, containing the imported shape.
11123 # If material names are imported it returns the list of
11124 # objects. The first one is the imported object followed by
11126 # @note Auto publishing is allowed for the shape itself. Imported
11127 # material groups are not automatically published.
11129 # @ref swig_Import_Export "Example"
11130 @ManageTransactions("InsertOp")
11131 def ImportFile(self, theFileName, theFormatName, theName=None):
11133 Import a shape from the BREP, IGES, STEP or other file
11134 (depends on given format) with given name.
11136 Note: this function is deprecated, it is kept for backward compatibility only
11137 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11140 theFileName The file, containing the shape.
11141 theFormatName Specify format for the file reading.
11142 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11143 If format 'IGES_SCALE' is used instead of 'IGES' or
11144 format 'STEP_SCALE' is used instead of 'STEP',
11145 length unit will be set to 'meter' and result model will be scaled.
11146 theName Object name; when specified, this parameter is used
11147 for result publication in the study. Otherwise, if automatic
11148 publication is switched on, default value is used for result name.
11151 New GEOM.GEOM_Object, containing the imported shape.
11152 If material names are imported it returns the list of
11153 objects. The first one is the imported object followed by
11156 Auto publishing is allowed for the shape itself. Imported
11157 material groups are not automatically published.
11159 # Example: see GEOM_TestOthers.py
11161 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11162 where <FormatName> is a name of desirable format for importing.
11164 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11165 RaiseIfFailed("ImportFile", self.InsertOp)
11166 aNbObj = len(aListObj)
11168 self._autoPublish(aListObj[0], theName, "imported")
11173 ## Deprecated analog of ImportFile()
11174 def Import(self, theFileName, theFormatName, theName=None):
11176 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11178 # note: auto-publishing is done in self.ImportFile()
11179 return self.ImportFile(theFileName, theFormatName, theName)
11181 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11182 # @note This method will not be dumped to the python script by DumpStudy functionality.
11183 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
11184 # @param theStream The BRep binary stream.
11185 # @param theName Object name; when specified, this parameter is used
11186 # for result publication in the study. Otherwise, if automatic
11187 # publication is switched on, default value is used for result name.
11189 # @return New GEOM_Object, containing the shape, read from theStream.
11191 # @ref swig_Import_Export "Example"
11192 @ManageTransactions("InsertOp")
11193 def RestoreShape (self, theStream, theName=None):
11195 Read a shape from the binary stream, containing its bounding representation (BRep).
11198 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11201 theStream The BRep binary stream.
11202 theName Object name; when specified, this parameter is used
11203 for result publication in the study. Otherwise, if automatic
11204 publication is switched on, default value is used for result name.
11207 New GEOM_Object, containing the shape, read from theStream.
11209 # Example: see GEOM_TestOthers.py
11210 anObj = self.InsertOp.RestoreShape(theStream)
11211 RaiseIfFailed("RestoreShape", self.InsertOp)
11212 self._autoPublish(anObj, theName, "restored")
11215 ## Export the given shape into a file with given name.
11217 # Note: this function is deprecated, it is kept for backward compatibility only
11218 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11220 # @param theObject Shape to be stored in the file.
11221 # @param theFileName Name of the file to store the given shape in.
11222 # @param theFormatName Specify format for the shape storage.
11223 # Available formats can be obtained with
11224 # geompy.InsertOp.ExportTranslators()[0] method.
11226 # @ref swig_Import_Export "Example"
11227 @ManageTransactions("InsertOp")
11228 def Export(self, theObject, theFileName, theFormatName):
11230 Export the given shape into a file with given name.
11232 Note: this function is deprecated, it is kept for backward compatibility only
11233 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11236 theObject Shape to be stored in the file.
11237 theFileName Name of the file to store the given shape in.
11238 theFormatName Specify format for the shape storage.
11239 Available formats can be obtained with
11240 geompy.InsertOp.ExportTranslators()[0] method.
11242 # Example: see GEOM_TestOthers.py
11244 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11245 where <FormatName> is a name of desirable format for exporting.
11247 self.InsertOp.Export(theObject, theFileName, theFormatName)
11248 if self.InsertOp.IsDone() == 0:
11249 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
11253 # end of l2_import_export
11256 ## @addtogroup l3_blocks
11259 ## Create a quadrangle face from four edges. Order of Edges is not
11260 # important. It is not necessary that edges share the same vertex.
11261 # @param E1,E2,E3,E4 Edges for the face bound.
11262 # @param theName Object name; when specified, this parameter is used
11263 # for result publication in the study. Otherwise, if automatic
11264 # publication is switched on, default value is used for result name.
11266 # @return New GEOM.GEOM_Object, containing the created face.
11268 # @ref tui_building_by_blocks_page "Example"
11269 @ManageTransactions("BlocksOp")
11270 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11272 Create a quadrangle face from four edges. Order of Edges is not
11273 important. It is not necessary that edges share the same vertex.
11276 E1,E2,E3,E4 Edges for the face bound.
11277 theName Object name; when specified, this parameter is used
11278 for result publication in the study. Otherwise, if automatic
11279 publication is switched on, default value is used for result name.
11282 New GEOM.GEOM_Object, containing the created face.
11285 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11287 # Example: see GEOM_Spanner.py
11288 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11289 RaiseIfFailed("MakeQuad", self.BlocksOp)
11290 self._autoPublish(anObj, theName, "quad")
11293 ## Create a quadrangle face on two edges.
11294 # The missing edges will be built by creating the shortest ones.
11295 # @param E1,E2 Two opposite edges for the face.
11296 # @param theName Object name; when specified, this parameter is used
11297 # for result publication in the study. Otherwise, if automatic
11298 # publication is switched on, default value is used for result name.
11300 # @return New GEOM.GEOM_Object, containing the created face.
11302 # @ref tui_building_by_blocks_page "Example"
11303 @ManageTransactions("BlocksOp")
11304 def MakeQuad2Edges(self, E1, E2, theName=None):
11306 Create a quadrangle face on two edges.
11307 The missing edges will be built by creating the shortest ones.
11310 E1,E2 Two opposite edges for the face.
11311 theName Object name; when specified, this parameter is used
11312 for result publication in the study. Otherwise, if automatic
11313 publication is switched on, default value is used for result name.
11316 New GEOM.GEOM_Object, containing the created face.
11320 p1 = geompy.MakeVertex( 0., 0., 0.)
11321 p2 = geompy.MakeVertex(150., 30., 0.)
11322 p3 = geompy.MakeVertex( 0., 120., 50.)
11323 p4 = geompy.MakeVertex( 0., 40., 70.)
11325 edge1 = geompy.MakeEdge(p1, p2)
11326 edge2 = geompy.MakeEdge(p3, p4)
11327 # create a quadrangle face from two edges
11328 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11330 # Example: see GEOM_Spanner.py
11331 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11332 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11333 self._autoPublish(anObj, theName, "quad")
11336 ## Create a quadrangle face with specified corners.
11337 # The missing edges will be built by creating the shortest ones.
11338 # @param V1,V2,V3,V4 Corner vertices for the face.
11339 # @param theName Object name; when specified, this parameter is used
11340 # for result publication in the study. Otherwise, if automatic
11341 # publication is switched on, default value is used for result name.
11343 # @return New GEOM.GEOM_Object, containing the created face.
11345 # @ref tui_building_by_blocks_page "Example 1"
11346 # \n @ref swig_MakeQuad4Vertices "Example 2"
11347 @ManageTransactions("BlocksOp")
11348 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11350 Create a quadrangle face with specified corners.
11351 The missing edges will be built by creating the shortest ones.
11354 V1,V2,V3,V4 Corner vertices for the face.
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.GEOM_Object, containing the created face.
11364 p1 = geompy.MakeVertex( 0., 0., 0.)
11365 p2 = geompy.MakeVertex(150., 30., 0.)
11366 p3 = geompy.MakeVertex( 0., 120., 50.)
11367 p4 = geompy.MakeVertex( 0., 40., 70.)
11368 # create a quadrangle from four points in its corners
11369 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11371 # Example: see GEOM_Spanner.py
11372 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11373 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11374 self._autoPublish(anObj, theName, "quad")
11377 ## Create a hexahedral solid, bounded by the six given faces. Order of
11378 # faces is not important. It is not necessary that Faces share the same edge.
11379 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11380 # @param theName Object name; when specified, this parameter is used
11381 # for result publication in the study. Otherwise, if automatic
11382 # publication is switched on, default value is used for result name.
11384 # @return New GEOM.GEOM_Object, containing the created solid.
11386 # @ref tui_building_by_blocks_page "Example 1"
11387 # \n @ref swig_MakeHexa "Example 2"
11388 @ManageTransactions("BlocksOp")
11389 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11391 Create a hexahedral solid, bounded by the six given faces. Order of
11392 faces is not important. It is not necessary that Faces share the same edge.
11395 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11396 theName Object name; when specified, this parameter is used
11397 for result publication in the study. Otherwise, if automatic
11398 publication is switched on, default value is used for result name.
11401 New GEOM.GEOM_Object, containing the created solid.
11404 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11406 # Example: see GEOM_Spanner.py
11407 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11408 RaiseIfFailed("MakeHexa", self.BlocksOp)
11409 self._autoPublish(anObj, theName, "hexa")
11412 ## Create a hexahedral solid between two given faces.
11413 # The missing faces will be built by creating the smallest ones.
11414 # @param F1,F2 Two opposite faces for the hexahedral solid.
11415 # @param theName Object name; when specified, this parameter is used
11416 # for result publication in the study. Otherwise, if automatic
11417 # publication is switched on, default value is used for result name.
11419 # @return New GEOM.GEOM_Object, containing the created solid.
11421 # @ref tui_building_by_blocks_page "Example 1"
11422 # \n @ref swig_MakeHexa2Faces "Example 2"
11423 @ManageTransactions("BlocksOp")
11424 def MakeHexa2Faces(self, F1, F2, theName=None):
11426 Create a hexahedral solid between two given faces.
11427 The missing faces will be built by creating the smallest ones.
11430 F1,F2 Two opposite faces for the hexahedral solid.
11431 theName Object name; when specified, this parameter is used
11432 for result publication in the study. Otherwise, if automatic
11433 publication is switched on, default value is used for result name.
11436 New GEOM.GEOM_Object, containing the created solid.
11439 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11441 # Example: see GEOM_Spanner.py
11442 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11443 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11444 self._autoPublish(anObj, theName, "hexa")
11450 ## @addtogroup l3_blocks_op
11453 ## Get a vertex, found in the given shape by its coordinates.
11454 # @param theShape Block or a compound of blocks.
11455 # @param theX,theY,theZ Coordinates of the sought vertex.
11456 # @param theEpsilon Maximum allowed distance between the resulting
11457 # vertex and point with the given coordinates.
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 New GEOM.GEOM_Object, containing the found vertex.
11464 # @ref swig_GetPoint "Example"
11465 @ManageTransactions("BlocksOp")
11466 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11468 Get a vertex, found in the given shape by its coordinates.
11471 theShape Block or a compound of blocks.
11472 theX,theY,theZ Coordinates of the sought vertex.
11473 theEpsilon Maximum allowed distance between the resulting
11474 vertex and point with the given coordinates.
11475 theName Object name; when specified, this parameter is used
11476 for result publication in the study. Otherwise, if automatic
11477 publication is switched on, default value is used for result name.
11480 New GEOM.GEOM_Object, containing the found vertex.
11483 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11485 # Example: see GEOM_TestOthers.py
11486 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11487 RaiseIfFailed("GetPoint", self.BlocksOp)
11488 self._autoPublish(anObj, theName, "vertex")
11491 ## Find a vertex of the given shape, which has minimal distance to the given point.
11492 # @param theShape Any shape.
11493 # @param thePoint Point, close to the desired vertex.
11494 # @param theName Object name; when specified, this parameter is used
11495 # for result publication in the study. Otherwise, if automatic
11496 # publication is switched on, default value is used for result name.
11498 # @return New GEOM.GEOM_Object, containing the found vertex.
11500 # @ref swig_GetVertexNearPoint "Example"
11501 @ManageTransactions("BlocksOp")
11502 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11504 Find a vertex of the given shape, which has minimal distance to the given point.
11507 theShape Any shape.
11508 thePoint Point, close to the desired vertex.
11509 theName Object name; when specified, this parameter is used
11510 for result publication in the study. Otherwise, if automatic
11511 publication is switched on, default value is used for result name.
11514 New GEOM.GEOM_Object, containing the found vertex.
11517 pmidle = geompy.MakeVertex(50, 0, 50)
11518 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11520 # Example: see GEOM_TestOthers.py
11521 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11522 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11523 self._autoPublish(anObj, theName, "vertex")
11526 ## Get an edge, found in the given shape by two given vertices.
11527 # @param theShape Block or a compound of blocks.
11528 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11529 # @param theName Object name; when specified, this parameter is used
11530 # for result publication in the study. Otherwise, if automatic
11531 # publication is switched on, default value is used for result name.
11533 # @return New GEOM.GEOM_Object, containing the found edge.
11535 # @ref swig_GetEdge "Example"
11536 @ManageTransactions("BlocksOp")
11537 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11539 Get an edge, found in the given shape by two given vertices.
11542 theShape Block or a compound of blocks.
11543 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11544 theName Object name; when specified, this parameter is used
11545 for result publication in the study. Otherwise, if automatic
11546 publication is switched on, default value is used for result name.
11549 New GEOM.GEOM_Object, containing the found edge.
11551 # Example: see GEOM_Spanner.py
11552 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11553 RaiseIfFailed("GetEdge", self.BlocksOp)
11554 self._autoPublish(anObj, theName, "edge")
11557 ## Find an edge of the given shape, which has minimal distance to the given point.
11558 # @param theShape Block or a compound of blocks.
11559 # @param thePoint Point, close to the desired edge.
11560 # @param theName Object name; when specified, this parameter is used
11561 # for result publication in the study. Otherwise, if automatic
11562 # publication is switched on, default value is used for result name.
11564 # @return New GEOM.GEOM_Object, containing the found edge.
11566 # @ref swig_GetEdgeNearPoint "Example"
11567 @ManageTransactions("BlocksOp")
11568 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
11570 Find an edge of the given shape, which has minimal distance to the given point.
11573 theShape Block or a compound of blocks.
11574 thePoint Point, close to the desired edge.
11575 theName Object name; when specified, this parameter is used
11576 for result publication in the study. Otherwise, if automatic
11577 publication is switched on, default value is used for result name.
11580 New GEOM.GEOM_Object, containing the found edge.
11582 # Example: see GEOM_TestOthers.py
11583 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
11584 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
11585 self._autoPublish(anObj, theName, "edge")
11588 ## Returns a face, found in the given shape by four given corner vertices.
11589 # @param theShape Block or a compound of blocks.
11590 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11591 # @param theName Object name; when specified, this parameter is used
11592 # for result publication in the study. Otherwise, if automatic
11593 # publication is switched on, default value is used for result name.
11595 # @return New GEOM.GEOM_Object, containing the found face.
11597 # @ref swig_todo "Example"
11598 @ManageTransactions("BlocksOp")
11599 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
11601 Returns a face, found in the given shape by four given corner vertices.
11604 theShape Block or a compound of blocks.
11605 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
11606 theName Object name; when specified, this parameter is used
11607 for result publication in the study. Otherwise, if automatic
11608 publication is switched on, default value is used for result name.
11611 New GEOM.GEOM_Object, containing the found face.
11613 # Example: see GEOM_Spanner.py
11614 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
11615 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
11616 self._autoPublish(anObj, theName, "face")
11619 ## Get a face of block, found in the given shape by two given edges.
11620 # @param theShape Block or a compound of blocks.
11621 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
11622 # @param theName Object name; when specified, this parameter is used
11623 # for result publication in the study. Otherwise, if automatic
11624 # publication is switched on, default value is used for result name.
11626 # @return New GEOM.GEOM_Object, containing the found face.
11628 # @ref swig_todo "Example"
11629 @ManageTransactions("BlocksOp")
11630 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
11632 Get a face of block, found in the given shape by two given edges.
11635 theShape Block or a compound of blocks.
11636 theEdge1,theEdge2 Edges, close to the edges of the desired face.
11637 theName Object name; when specified, this parameter is used
11638 for result publication in the study. Otherwise, if automatic
11639 publication is switched on, default value is used for result name.
11642 New GEOM.GEOM_Object, containing the found face.
11644 # Example: see GEOM_Spanner.py
11645 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
11646 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
11647 self._autoPublish(anObj, theName, "face")
11650 ## Find a face, opposite to the given one in the given block.
11651 # @param theBlock Must be a hexahedral solid.
11652 # @param theFace Face of \a theBlock, opposite to the desired face.
11653 # @param theName Object name; when specified, this parameter is used
11654 # for result publication in the study. Otherwise, if automatic
11655 # publication is switched on, default value is used for result name.
11657 # @return New GEOM.GEOM_Object, containing the found face.
11659 # @ref swig_GetOppositeFace "Example"
11660 @ManageTransactions("BlocksOp")
11661 def GetOppositeFace(self, theBlock, theFace, theName=None):
11663 Find a face, opposite to the given one in the given block.
11666 theBlock Must be a hexahedral solid.
11667 theFace Face of theBlock, opposite to the desired face.
11668 theName Object name; when specified, this parameter is used
11669 for result publication in the study. Otherwise, if automatic
11670 publication is switched on, default value is used for result name.
11673 New GEOM.GEOM_Object, containing the found face.
11675 # Example: see GEOM_Spanner.py
11676 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
11677 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
11678 self._autoPublish(anObj, theName, "face")
11681 ## Find a face of the given shape, which has minimal distance to the given point.
11682 # @param theShape Block or a compound of blocks.
11683 # @param thePoint Point, close to the desired face.
11684 # @param theName Object name; when specified, this parameter is used
11685 # for result publication in the study. Otherwise, if automatic
11686 # publication is switched on, default value is used for result name.
11688 # @return New GEOM.GEOM_Object, containing the found face.
11690 # @ref swig_GetFaceNearPoint "Example"
11691 @ManageTransactions("BlocksOp")
11692 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
11694 Find a face of the given shape, which has minimal distance to the given point.
11697 theShape Block or a compound of blocks.
11698 thePoint Point, close to the desired face.
11699 theName Object name; when specified, this parameter is used
11700 for result publication in the study. Otherwise, if automatic
11701 publication is switched on, default value is used for result name.
11704 New GEOM.GEOM_Object, containing the found face.
11706 # Example: see GEOM_Spanner.py
11707 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
11708 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
11709 self._autoPublish(anObj, theName, "face")
11712 ## Find a face of block, whose outside normale has minimal angle with the given vector.
11713 # @param theBlock Block or a compound of blocks.
11714 # @param theVector Vector, close to the normale of the desired face.
11715 # @param theName Object name; when specified, this parameter is used
11716 # for result publication in the study. Otherwise, if automatic
11717 # publication is switched on, default value is used for result name.
11719 # @return New GEOM.GEOM_Object, containing the found face.
11721 # @ref swig_todo "Example"
11722 @ManageTransactions("BlocksOp")
11723 def GetFaceByNormale(self, theBlock, theVector, theName=None):
11725 Find a face of block, whose outside normale has minimal angle with the given vector.
11728 theBlock Block or a compound of blocks.
11729 theVector Vector, close to the normale of the desired face.
11730 theName Object name; when specified, this parameter is used
11731 for result publication in the study. Otherwise, if automatic
11732 publication is switched on, default value is used for result name.
11735 New GEOM.GEOM_Object, containing the found face.
11737 # Example: see GEOM_Spanner.py
11738 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
11739 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
11740 self._autoPublish(anObj, theName, "face")
11743 ## Find all sub-shapes of type \a theShapeType of the given shape,
11744 # which have minimal distance to the given point.
11745 # @param theShape Any shape.
11746 # @param thePoint Point, close to the desired shape.
11747 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
11748 # @param theTolerance The tolerance for distances comparison. All shapes
11749 # with distances to the given point in interval
11750 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
11751 # @param theName Object name; when specified, this parameter is used
11752 # for result publication in the study. Otherwise, if automatic
11753 # publication is switched on, default value is used for result name.
11755 # @return New GEOM_Object, containing a group of all found shapes.
11757 # @ref swig_GetShapesNearPoint "Example"
11758 @ManageTransactions("BlocksOp")
11759 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
11761 Find all sub-shapes of type theShapeType of the given shape,
11762 which have minimal distance to the given point.
11765 theShape Any shape.
11766 thePoint Point, close to the desired shape.
11767 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
11768 theTolerance The tolerance for distances comparison. All shapes
11769 with distances to the given point in interval
11770 [minimal_distance, minimal_distance + theTolerance] will be gathered.
11771 theName Object name; when specified, this parameter is used
11772 for result publication in the study. Otherwise, if automatic
11773 publication is switched on, default value is used for result name.
11776 New GEOM_Object, containing a group of all found shapes.
11778 # Example: see GEOM_TestOthers.py
11779 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
11780 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
11781 self._autoPublish(anObj, theName, "group")
11784 # end of l3_blocks_op
11787 ## @addtogroup l4_blocks_measure
11790 ## Check, if the compound of blocks is given.
11791 # To be considered as a compound of blocks, the
11792 # given shape must satisfy the following conditions:
11793 # - Each element of the compound should be a Block (6 faces).
11794 # - Each face should be a quadrangle, i.e. it should have only 1 wire
11795 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
11796 # there are more than 4 edges in the only wire of a face,
11797 # this face is considered to be quadrangle if it has 4 bounds
11798 # (1 or more edge) of C1 continuity.
11799 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11800 # - The compound should be connexe.
11801 # - The glue between two quadrangle faces should be applied.
11802 # @param theCompound The compound to check.
11803 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
11804 # taking into account C1 continuity.
11805 # @param theAngTolerance the angular tolerance to check if two neighbor
11806 # edges are codirectional in the common vertex with this
11807 # tolerance. This parameter is used only if
11808 # <VAR>theIsUseC1</VAR> is set to True.
11809 # @return TRUE, if the given shape is a compound of blocks.
11810 # If theCompound is not valid, prints all discovered errors.
11812 # @ref tui_check_compound_of_blocks_page "Example 1"
11813 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
11814 @ManageTransactions("BlocksOp")
11815 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
11816 theAngTolerance = 1.e-12):
11818 Check, if the compound of blocks is given.
11819 To be considered as a compound of blocks, the
11820 given shape must satisfy the following conditions:
11821 - Each element of the compound should be a Block (6 faces).
11822 - Each face should be a quadrangle, i.e. it should have only 1 wire
11823 with 4 edges. If theIsUseC1 is set to True and
11824 there are more than 4 edges in the only wire of a face,
11825 this face is considered to be quadrangle if it has 4 bounds
11826 (1 or more edge) of C1 continuity.
11827 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
11828 - The compound should be connexe.
11829 - The glue between two quadrangle faces should be applied.
11832 theCompound The compound to check.
11833 theIsUseC1 Flag to check if there are 4 bounds on a face
11834 taking into account C1 continuity.
11835 theAngTolerance the angular tolerance to check if two neighbor
11836 edges are codirectional in the common vertex with this
11837 tolerance. This parameter is used only if
11838 theIsUseC1 is set to True.
11841 TRUE, if the given shape is a compound of blocks.
11842 If theCompound is not valid, prints all discovered errors.
11844 # Example: see GEOM_Spanner.py
11847 aTolerance = theAngTolerance
11848 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
11849 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
11851 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
11855 ## Retrieve all non blocks solids and faces from \a theShape.
11856 # @param theShape The shape to explore.
11857 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
11858 # taking into account C1 continuity.
11859 # @param theAngTolerance the angular tolerance to check if two neighbor
11860 # edges are codirectional in the common vertex with this
11861 # tolerance. This parameter is used only if
11862 # <VAR>theIsUseC1</VAR> is set to True.
11863 # @param theName Object name; when specified, this parameter is used
11864 # for result publication in the study. Otherwise, if automatic
11865 # publication is switched on, default value is used for result name.
11867 # @return A tuple of two GEOM_Objects. The first object is a group of all
11868 # non block solids (= not 6 faces, or with 6 faces, but with the
11869 # presence of non-quadrangular faces). The second object is a
11870 # group of all non quadrangular faces (= faces with more then
11871 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
11872 # with 1 wire with not 4 edges that do not form 4 bounds of
11875 # @ref tui_get_non_blocks_page "Example 1"
11876 # \n @ref swig_GetNonBlocks "Example 2"
11877 @ManageTransactions("BlocksOp")
11878 def GetNonBlocks (self, theShape, theIsUseC1 = False,
11879 theAngTolerance = 1.e-12, theName=None):
11881 Retrieve all non blocks solids and faces from theShape.
11884 theShape The shape to explore.
11885 theIsUseC1 Flag to check if there are 4 bounds on a face
11886 taking into account C1 continuity.
11887 theAngTolerance the angular tolerance to check if two neighbor
11888 edges are codirectional in the common vertex with this
11889 tolerance. This parameter is used only if
11890 theIsUseC1 is set to True.
11891 theName Object name; when specified, this parameter is used
11892 for result publication in the study. Otherwise, if automatic
11893 publication is switched on, default value is used for result name.
11896 A tuple of two GEOM_Objects. The first object is a group of all
11897 non block solids (= not 6 faces, or with 6 faces, but with the
11898 presence of non-quadrangular faces). The second object is a
11899 group of all non quadrangular faces (= faces with more then
11900 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
11901 with 1 wire with not 4 edges that do not form 4 bounds of
11905 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
11907 # Example: see GEOM_Spanner.py
11910 aTolerance = theAngTolerance
11911 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
11912 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
11913 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
11916 ## Remove all seam and degenerated edges from \a theShape.
11917 # Unite faces and edges, sharing one surface. It means that
11918 # this faces must have references to one C++ surface object (handle).
11919 # @param theShape The compound or single solid to remove irregular edges from.
11920 # @param doUnionFaces If True, then unite faces. If False (the default value),
11921 # do not unite faces.
11922 # @param theName Object name; when specified, this parameter is used
11923 # for result publication in the study. Otherwise, if automatic
11924 # publication is switched on, default value is used for result name.
11926 # @return Improved shape.
11928 # @ref swig_RemoveExtraEdges "Example"
11929 @ManageTransactions("BlocksOp")
11930 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
11932 Remove all seam and degenerated edges from theShape.
11933 Unite faces and edges, sharing one surface. It means that
11934 this faces must have references to one C++ surface object (handle).
11937 theShape The compound or single solid to remove irregular edges from.
11938 doUnionFaces If True, then unite faces. If False (the default value),
11939 do not unite faces.
11940 theName Object name; when specified, this parameter is used
11941 for result publication in the study. Otherwise, if automatic
11942 publication is switched on, default value is used for result name.
11947 # Example: see GEOM_TestOthers.py
11948 nbFacesOptimum = -1 # -1 means do not unite faces
11949 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
11950 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
11951 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
11952 self._autoPublish(anObj, theName, "removeExtraEdges")
11955 ## Performs union faces of \a theShape
11956 # Unite faces sharing one surface. It means that
11957 # these faces must have references to one C++ surface object (handle).
11958 # @param theShape The compound or single solid that contains faces
11959 # to perform union.
11960 # @param theName Object name; when specified, this parameter is used
11961 # for result publication in the study. Otherwise, if automatic
11962 # publication is switched on, default value is used for result name.
11964 # @return Improved shape.
11966 # @ref swig_UnionFaces "Example"
11967 @ManageTransactions("BlocksOp")
11968 def UnionFaces(self, theShape, theName=None):
11970 Performs union faces of theShape.
11971 Unite faces sharing one surface. It means that
11972 these faces must have references to one C++ surface object (handle).
11975 theShape The compound or single solid that contains faces
11977 theName Object name; when specified, this parameter is used
11978 for result publication in the study. Otherwise, if automatic
11979 publication is switched on, default value is used for result name.
11984 # Example: see GEOM_TestOthers.py
11985 anObj = self.BlocksOp.UnionFaces(theShape)
11986 RaiseIfFailed("UnionFaces", self.BlocksOp)
11987 self._autoPublish(anObj, theName, "unionFaces")
11990 ## Check, if the given shape is a blocks compound.
11991 # Fix all detected errors.
11992 # \note Single block can be also fixed by this method.
11993 # @param theShape The compound to check and improve.
11994 # @param theName Object name; when specified, this parameter is used
11995 # for result publication in the study. Otherwise, if automatic
11996 # publication is switched on, default value is used for result name.
11998 # @return Improved compound.
12000 # @ref swig_CheckAndImprove "Example"
12001 @ManageTransactions("BlocksOp")
12002 def CheckAndImprove(self, theShape, theName=None):
12004 Check, if the given shape is a blocks compound.
12005 Fix all detected errors.
12008 Single block can be also fixed by this method.
12011 theShape The compound to check and improve.
12012 theName Object name; when specified, this parameter is used
12013 for result publication in the study. Otherwise, if automatic
12014 publication is switched on, default value is used for result name.
12019 # Example: see GEOM_TestOthers.py
12020 anObj = self.BlocksOp.CheckAndImprove(theShape)
12021 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12022 self._autoPublish(anObj, theName, "improved")
12025 # end of l4_blocks_measure
12028 ## @addtogroup l3_blocks_op
12031 ## Get all the blocks, contained in the given compound.
12032 # @param theCompound The compound to explode.
12033 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12034 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12035 # @param theName Object name; when specified, this parameter is used
12036 # for result publication in the study. Otherwise, if automatic
12037 # publication is switched on, default value is used for result name.
12039 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12041 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12043 # @ref tui_explode_on_blocks "Example 1"
12044 # \n @ref swig_MakeBlockExplode "Example 2"
12045 @ManageTransactions("BlocksOp")
12046 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12048 Get all the blocks, contained in the given compound.
12051 theCompound The compound to explode.
12052 theMinNbFaces If solid has lower number of faces, it is not a block.
12053 theMaxNbFaces If solid has higher number of faces, it is not a block.
12054 theName Object name; when specified, this parameter is used
12055 for result publication in the study. Otherwise, if automatic
12056 publication is switched on, default value is used for result name.
12059 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12062 List of GEOM.GEOM_Object, containing the retrieved blocks.
12064 # Example: see GEOM_TestOthers.py
12065 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12066 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12067 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12068 for anObj in aList:
12069 anObj.SetParameters(Parameters)
12071 self._autoPublish(aList, theName, "block")
12074 ## Find block, containing the given point inside its volume or on boundary.
12075 # @param theCompound Compound, to find block in.
12076 # @param thePoint Point, close to the desired block. If the point lays on
12077 # boundary between some blocks, we return block with nearest center.
12078 # @param theName Object name; when specified, this parameter is used
12079 # for result publication in the study. Otherwise, if automatic
12080 # publication is switched on, default value is used for result name.
12082 # @return New GEOM.GEOM_Object, containing the found block.
12084 # @ref swig_todo "Example"
12085 @ManageTransactions("BlocksOp")
12086 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12088 Find block, containing the given point inside its volume or on boundary.
12091 theCompound Compound, to find block in.
12092 thePoint Point, close to the desired block. If the point lays on
12093 boundary between some blocks, we return block with nearest center.
12094 theName Object name; when specified, this parameter is used
12095 for result publication in the study. Otherwise, if automatic
12096 publication is switched on, default value is used for result name.
12099 New GEOM.GEOM_Object, containing the found block.
12101 # Example: see GEOM_Spanner.py
12102 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12103 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12104 self._autoPublish(anObj, theName, "block")
12107 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12108 # @param theCompound Compound, to find block in.
12109 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12110 # @param theName Object name; when specified, this parameter is used
12111 # for result publication in the study. Otherwise, if automatic
12112 # publication is switched on, default value is used for result name.
12114 # @return New GEOM.GEOM_Object, containing the found block.
12116 # @ref swig_GetBlockByParts "Example"
12117 @ManageTransactions("BlocksOp")
12118 def GetBlockByParts(self, theCompound, theParts, theName=None):
12120 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12123 theCompound Compound, to find block in.
12124 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12125 theName Object name; when specified, this parameter is used
12126 for result publication in the study. Otherwise, if automatic
12127 publication is switched on, default value is used for result name.
12130 New GEOM_Object, containing the found block.
12132 # Example: see GEOM_TestOthers.py
12133 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12134 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12135 self._autoPublish(anObj, theName, "block")
12138 ## Return all blocks, containing all the elements, passed as the parts.
12139 # @param theCompound Compound, to find blocks in.
12140 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12141 # @param theName Object name; when specified, this parameter is used
12142 # for result publication in the study. Otherwise, if automatic
12143 # publication is switched on, default value is used for result name.
12145 # @return List of GEOM.GEOM_Object, containing the found blocks.
12147 # @ref swig_todo "Example"
12148 @ManageTransactions("BlocksOp")
12149 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12151 Return all blocks, containing all the elements, passed as the parts.
12154 theCompound Compound, to find blocks in.
12155 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12156 theName Object name; when specified, this parameter is used
12157 for result publication in the study. Otherwise, if automatic
12158 publication is switched on, default value is used for result name.
12161 List of GEOM.GEOM_Object, containing the found blocks.
12163 # Example: see GEOM_Spanner.py
12164 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12165 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12166 self._autoPublish(aList, theName, "block")
12169 ## Multi-transformate block and glue the result.
12170 # Transformation is defined so, as to superpose direction faces.
12171 # @param Block Hexahedral solid to be multi-transformed.
12172 # @param DirFace1 ID of First direction face.
12173 # @param DirFace2 ID of Second direction face.
12174 # @param NbTimes Quantity of transformations to be done.
12175 # @param theName Object name; when specified, this parameter is used
12176 # for result publication in the study. Otherwise, if automatic
12177 # publication is switched on, default value is used for result name.
12179 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12181 # @return New GEOM.GEOM_Object, containing the result shape.
12183 # @ref tui_multi_transformation "Example"
12184 @ManageTransactions("BlocksOp")
12185 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12187 Multi-transformate block and glue the result.
12188 Transformation is defined so, as to superpose direction faces.
12191 Block Hexahedral solid to be multi-transformed.
12192 DirFace1 ID of First direction face.
12193 DirFace2 ID of Second direction face.
12194 NbTimes Quantity of transformations to be done.
12195 theName Object name; when specified, this parameter is used
12196 for result publication in the study. Otherwise, if automatic
12197 publication is switched on, default value is used for result name.
12200 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12203 New GEOM.GEOM_Object, containing the result shape.
12205 # Example: see GEOM_Spanner.py
12206 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12207 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12208 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12209 anObj.SetParameters(Parameters)
12210 self._autoPublish(anObj, theName, "transformed")
12213 ## Multi-transformate block and glue the result.
12214 # @param Block Hexahedral solid to be multi-transformed.
12215 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12216 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12217 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12218 # @param theName Object name; when specified, this parameter is used
12219 # for result publication in the study. Otherwise, if automatic
12220 # publication is switched on, default value is used for result name.
12222 # @return New GEOM.GEOM_Object, containing the result shape.
12224 # @ref tui_multi_transformation "Example"
12225 @ManageTransactions("BlocksOp")
12226 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12227 DirFace1V, DirFace2V, NbTimesV, theName=None):
12229 Multi-transformate block and glue the result.
12232 Block Hexahedral solid to be multi-transformed.
12233 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12234 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12235 NbTimesU,NbTimesV Quantity of transformations to be done.
12236 theName Object name; when specified, this parameter is used
12237 for result publication in the study. Otherwise, if automatic
12238 publication is switched on, default value is used for result name.
12241 New GEOM.GEOM_Object, containing the result shape.
12243 # Example: see GEOM_Spanner.py
12244 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12245 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12246 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12247 DirFace1V, DirFace2V, NbTimesV)
12248 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12249 anObj.SetParameters(Parameters)
12250 self._autoPublish(anObj, theName, "transformed")
12253 ## Build all possible propagation groups.
12254 # Propagation group is a set of all edges, opposite to one (main)
12255 # edge of this group directly or through other opposite edges.
12256 # Notion of Opposite Edge make sence only on quadrangle face.
12257 # @param theShape Shape to build propagation groups on.
12258 # @param theName Object name; when specified, this parameter is used
12259 # for result publication in the study. Otherwise, if automatic
12260 # publication is switched on, default value is used for result name.
12262 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12264 # @ref swig_Propagate "Example"
12265 @ManageTransactions("BlocksOp")
12266 def Propagate(self, theShape, theName=None):
12268 Build all possible propagation groups.
12269 Propagation group is a set of all edges, opposite to one (main)
12270 edge of this group directly or through other opposite edges.
12271 Notion of Opposite Edge make sence only on quadrangle face.
12274 theShape Shape to build propagation groups on.
12275 theName Object name; when specified, this parameter is used
12276 for result publication in the study. Otherwise, if automatic
12277 publication is switched on, default value is used for result name.
12280 List of GEOM.GEOM_Object, each of them is a propagation group.
12282 # Example: see GEOM_TestOthers.py
12283 listChains = self.BlocksOp.Propagate(theShape)
12284 RaiseIfFailed("Propagate", self.BlocksOp)
12285 self._autoPublish(listChains, theName, "propagate")
12288 # end of l3_blocks_op
12291 ## @addtogroup l3_groups
12294 ## Creates a new group which will store sub-shapes of theMainShape
12295 # @param theMainShape is a GEOM object on which the group is selected
12296 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12297 # @param theName Object name; when specified, this parameter is used
12298 # for result publication in the study. Otherwise, if automatic
12299 # publication is switched on, default value is used for result name.
12301 # @return a newly created GEOM group (GEOM.GEOM_Object)
12303 # @ref tui_working_with_groups_page "Example 1"
12304 # \n @ref swig_CreateGroup "Example 2"
12305 @ManageTransactions("GroupOp")
12306 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12308 Creates a new group which will store sub-shapes of theMainShape
12311 theMainShape is a GEOM object on which the group is selected
12312 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12313 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12314 theName Object name; when specified, this parameter is used
12315 for result publication in the study. Otherwise, if automatic
12316 publication is switched on, default value is used for result name.
12319 a newly created GEOM group
12322 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12325 # Example: see GEOM_TestOthers.py
12326 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12327 RaiseIfFailed("CreateGroup", self.GroupOp)
12328 self._autoPublish(anObj, theName, "group")
12331 ## Adds a sub-object with ID theSubShapeId to the group
12332 # @param theGroup is a GEOM group to which the new sub-shape is added
12333 # @param theSubShapeID is a sub-shape ID in the main object.
12334 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12336 # @ref tui_working_with_groups_page "Example"
12337 @ManageTransactions("GroupOp")
12338 def AddObject(self,theGroup, theSubShapeID):
12340 Adds a sub-object with ID theSubShapeId to the group
12343 theGroup is a GEOM group to which the new sub-shape is added
12344 theSubShapeID is a sub-shape ID in the main object.
12347 Use method GetSubShapeID() to get an unique ID of the sub-shape
12349 # Example: see GEOM_TestOthers.py
12350 self.GroupOp.AddObject(theGroup, theSubShapeID)
12351 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12352 RaiseIfFailed("AddObject", self.GroupOp)
12356 ## Removes a sub-object with ID \a theSubShapeId from the group
12357 # @param theGroup is a GEOM group from which the new sub-shape is removed
12358 # @param theSubShapeID is a sub-shape ID in the main object.
12359 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12361 # @ref tui_working_with_groups_page "Example"
12362 @ManageTransactions("GroupOp")
12363 def RemoveObject(self,theGroup, theSubShapeID):
12365 Removes a sub-object with ID theSubShapeId from the group
12368 theGroup is a GEOM group from which the new sub-shape is removed
12369 theSubShapeID is a sub-shape ID in the main object.
12372 Use method GetSubShapeID() to get an unique ID of the sub-shape
12374 # Example: see GEOM_TestOthers.py
12375 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12376 RaiseIfFailed("RemoveObject", self.GroupOp)
12379 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12380 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12381 # @param theSubShapes is a list of sub-shapes to be added.
12383 # @ref tui_working_with_groups_page "Example"
12384 @ManageTransactions("GroupOp")
12385 def UnionList (self,theGroup, theSubShapes):
12387 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12390 theGroup is a GEOM group to which the new sub-shapes are added.
12391 theSubShapes is a list of sub-shapes to be added.
12393 # Example: see GEOM_TestOthers.py
12394 self.GroupOp.UnionList(theGroup, theSubShapes)
12395 RaiseIfFailed("UnionList", self.GroupOp)
12398 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12399 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12400 # @param theSubShapes is a list of indices of sub-shapes to be added.
12402 # @ref swig_UnionIDs "Example"
12403 @ManageTransactions("GroupOp")
12404 def UnionIDs(self,theGroup, theSubShapes):
12406 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12409 theGroup is a GEOM group to which the new sub-shapes are added.
12410 theSubShapes is a list of indices of sub-shapes to be added.
12412 # Example: see GEOM_TestOthers.py
12413 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12414 RaiseIfFailed("UnionIDs", self.GroupOp)
12417 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12418 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12419 # @param theSubShapes is a list of sub-shapes to be removed.
12421 # @ref tui_working_with_groups_page "Example"
12422 @ManageTransactions("GroupOp")
12423 def DifferenceList (self,theGroup, theSubShapes):
12425 Removes from the group all the given shapes. No errors, if some shapes are not included.
12428 theGroup is a GEOM group from which the sub-shapes are removed.
12429 theSubShapes is a list of sub-shapes to be removed.
12431 # Example: see GEOM_TestOthers.py
12432 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12433 RaiseIfFailed("DifferenceList", self.GroupOp)
12436 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12437 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12438 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12440 # @ref swig_DifferenceIDs "Example"
12441 @ManageTransactions("GroupOp")
12442 def DifferenceIDs(self,theGroup, theSubShapes):
12444 Removes from the group all the given shapes. No errors, if some shapes are not included.
12447 theGroup is a GEOM group from which the sub-shapes are removed.
12448 theSubShapes is a list of indices of sub-shapes to be removed.
12450 # Example: see GEOM_TestOthers.py
12451 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12452 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12455 ## Union of two groups.
12456 # New group is created. It will contain all entities
12457 # which are present in groups theGroup1 and theGroup2.
12458 # @param theGroup1, theGroup2 are the initial GEOM groups
12459 # to create the united group from.
12460 # @param theName Object name; when specified, this parameter is used
12461 # for result publication in the study. Otherwise, if automatic
12462 # publication is switched on, default value is used for result name.
12464 # @return a newly created GEOM group.
12466 # @ref tui_union_groups_anchor "Example"
12467 @ManageTransactions("GroupOp")
12468 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12470 Union of two groups.
12471 New group is created. It will contain all entities
12472 which are present in groups theGroup1 and theGroup2.
12475 theGroup1, theGroup2 are the initial GEOM groups
12476 to create the united group from.
12477 theName Object name; when specified, this parameter is used
12478 for result publication in the study. Otherwise, if automatic
12479 publication is switched on, default value is used for result name.
12482 a newly created GEOM group.
12484 # Example: see GEOM_TestOthers.py
12485 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12486 RaiseIfFailed("UnionGroups", self.GroupOp)
12487 self._autoPublish(aGroup, theName, "group")
12490 ## Intersection of two groups.
12491 # New group is created. It will contain only those entities
12492 # which are present in both groups theGroup1 and theGroup2.
12493 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12494 # @param theName Object name; when specified, this parameter is used
12495 # for result publication in the study. Otherwise, if automatic
12496 # publication is switched on, default value is used for result name.
12498 # @return a newly created GEOM group.
12500 # @ref tui_intersect_groups_anchor "Example"
12501 @ManageTransactions("GroupOp")
12502 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12504 Intersection of two groups.
12505 New group is created. It will contain only those entities
12506 which are present in both groups theGroup1 and theGroup2.
12509 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12510 theName Object name; when specified, this parameter is used
12511 for result publication in the study. Otherwise, if automatic
12512 publication is switched on, default value is used for result name.
12515 a newly created GEOM group.
12517 # Example: see GEOM_TestOthers.py
12518 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12519 RaiseIfFailed("IntersectGroups", self.GroupOp)
12520 self._autoPublish(aGroup, theName, "group")
12523 ## Cut of two groups.
12524 # New group is created. It will contain entities which are
12525 # present in group theGroup1 but are not present in group theGroup2.
12526 # @param theGroup1 is a GEOM group to include elements of.
12527 # @param theGroup2 is a GEOM group to exclude elements of.
12528 # @param theName Object name; when specified, this parameter is used
12529 # for result publication in the study. Otherwise, if automatic
12530 # publication is switched on, default value is used for result name.
12532 # @return a newly created GEOM group.
12534 # @ref tui_cut_groups_anchor "Example"
12535 @ManageTransactions("GroupOp")
12536 def CutGroups (self, theGroup1, theGroup2, theName=None):
12539 New group is created. It will contain entities which are
12540 present in group theGroup1 but are not present in group theGroup2.
12543 theGroup1 is a GEOM group to include elements of.
12544 theGroup2 is a GEOM group to exclude elements of.
12545 theName Object name; when specified, this parameter is used
12546 for result publication in the study. Otherwise, if automatic
12547 publication is switched on, default value is used for result name.
12550 a newly created GEOM group.
12552 # Example: see GEOM_TestOthers.py
12553 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
12554 RaiseIfFailed("CutGroups", self.GroupOp)
12555 self._autoPublish(aGroup, theName, "group")
12558 ## Union of list of groups.
12559 # New group is created. It will contain all entities that are
12560 # present in groups listed in theGList.
12561 # @param theGList is a list of GEOM groups to create the united group from.
12562 # @param theName Object name; when specified, this parameter is used
12563 # for result publication in the study. Otherwise, if automatic
12564 # publication is switched on, default value is used for result name.
12566 # @return a newly created GEOM group.
12568 # @ref tui_union_groups_anchor "Example"
12569 @ManageTransactions("GroupOp")
12570 def UnionListOfGroups (self, theGList, theName=None):
12572 Union of list of groups.
12573 New group is created. It will contain all entities that are
12574 present in groups listed in theGList.
12577 theGList is a list of GEOM groups to create the united group from.
12578 theName Object name; when specified, this parameter is used
12579 for result publication in the study. Otherwise, if automatic
12580 publication is switched on, default value is used for result name.
12583 a newly created GEOM group.
12585 # Example: see GEOM_TestOthers.py
12586 aGroup = self.GroupOp.UnionListOfGroups(theGList)
12587 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
12588 self._autoPublish(aGroup, theName, "group")
12591 ## Cut of lists of groups.
12592 # New group is created. It will contain only entities
12593 # which are present in groups listed in theGList.
12594 # @param theGList is a list of GEOM groups to include elements of.
12595 # @param theName Object name; when specified, this parameter is used
12596 # for result publication in the study. Otherwise, if automatic
12597 # publication is switched on, default value is used for result name.
12599 # @return a newly created GEOM group.
12601 # @ref tui_intersect_groups_anchor "Example"
12602 @ManageTransactions("GroupOp")
12603 def IntersectListOfGroups (self, theGList, theName=None):
12605 Cut of lists of groups.
12606 New group is created. It will contain only entities
12607 which are present in groups listed in theGList.
12610 theGList is a list of GEOM groups to include elements of.
12611 theName Object name; when specified, this parameter is used
12612 for result publication in the study. Otherwise, if automatic
12613 publication is switched on, default value is used for result name.
12616 a newly created GEOM group.
12618 # Example: see GEOM_TestOthers.py
12619 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
12620 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
12621 self._autoPublish(aGroup, theName, "group")
12624 ## Cut of lists of groups.
12625 # New group is created. It will contain only entities
12626 # which are present in groups listed in theGList1 but
12627 # are not present in groups from theGList2.
12628 # @param theGList1 is a list of GEOM groups to include elements of.
12629 # @param theGList2 is a list of GEOM groups to exclude elements of.
12630 # @param theName Object name; when specified, this parameter is used
12631 # for result publication in the study. Otherwise, if automatic
12632 # publication is switched on, default value is used for result name.
12634 # @return a newly created GEOM group.
12636 # @ref tui_cut_groups_anchor "Example"
12637 @ManageTransactions("GroupOp")
12638 def CutListOfGroups (self, theGList1, theGList2, theName=None):
12640 Cut of lists of groups.
12641 New group is created. It will contain only entities
12642 which are present in groups listed in theGList1 but
12643 are not present in groups from theGList2.
12646 theGList1 is a list of GEOM groups to include elements of.
12647 theGList2 is a list of GEOM groups to exclude elements of.
12648 theName Object name; when specified, this parameter is used
12649 for result publication in the study. Otherwise, if automatic
12650 publication is switched on, default value is used for result name.
12653 a newly created GEOM group.
12655 # Example: see GEOM_TestOthers.py
12656 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
12657 RaiseIfFailed("CutListOfGroups", self.GroupOp)
12658 self._autoPublish(aGroup, theName, "group")
12661 ## Returns a list of sub-objects ID stored in the group
12662 # @param theGroup is a GEOM group for which a list of IDs is requested
12664 # @ref swig_GetObjectIDs "Example"
12665 @ManageTransactions("GroupOp")
12666 def GetObjectIDs(self,theGroup):
12668 Returns a list of sub-objects ID stored in the group
12671 theGroup is a GEOM group for which a list of IDs is requested
12673 # Example: see GEOM_TestOthers.py
12674 ListIDs = self.GroupOp.GetObjects(theGroup)
12675 RaiseIfFailed("GetObjects", self.GroupOp)
12678 ## Returns a type of sub-objects stored in the group
12679 # @param theGroup is a GEOM group which type is returned.
12681 # @ref swig_GetType "Example"
12682 @ManageTransactions("GroupOp")
12683 def GetType(self,theGroup):
12685 Returns a type of sub-objects stored in the group
12688 theGroup is a GEOM group which type is returned.
12690 # Example: see GEOM_TestOthers.py
12691 aType = self.GroupOp.GetType(theGroup)
12692 RaiseIfFailed("GetType", self.GroupOp)
12695 ## Convert a type of geom object from id to string value
12696 # @param theId is a GEOM obect type id.
12697 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12698 # @ref swig_GetType "Example"
12699 def ShapeIdToType(self, theId):
12701 Convert a type of geom object from id to string value
12704 theId is a GEOM obect type id.
12707 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
12734 return "REVOLUTION"
12782 return "FREE_BOUNDS"
12790 return "THRUSECTIONS"
12792 return "COMPOUNDFILTER"
12794 return "SHAPES_ON_SHAPE"
12796 return "ELLIPSE_ARC"
12798 return "3DSKETCHER"
12804 return "PIPETSHAPE"
12805 return "Shape Id not exist."
12807 ## Returns a main shape associated with the group
12808 # @param theGroup is a GEOM group for which a main shape object is requested
12809 # @return a GEOM object which is a main shape for theGroup
12811 # @ref swig_GetMainShape "Example"
12812 @ManageTransactions("GroupOp")
12813 def GetMainShape(self,theGroup):
12815 Returns a main shape associated with the group
12818 theGroup is a GEOM group for which a main shape object is requested
12821 a GEOM object which is a main shape for theGroup
12823 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
12825 # Example: see GEOM_TestOthers.py
12826 anObj = self.GroupOp.GetMainShape(theGroup)
12827 RaiseIfFailed("GetMainShape", self.GroupOp)
12830 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
12831 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12832 # @param theShape given shape (see GEOM.GEOM_Object)
12833 # @param min_length minimum length of edges of theShape
12834 # @param max_length maximum length of edges of theShape
12835 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12836 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12837 # @param theName Object name; when specified, this parameter is used
12838 # for result publication in the study. Otherwise, if automatic
12839 # publication is switched on, default value is used for result name.
12841 # @return a newly created GEOM group of edges
12843 # @@ref swig_todo "Example"
12844 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
12846 Create group of edges of theShape, whose length is in range [min_length, max_length].
12847 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12850 theShape given shape
12851 min_length minimum length of edges of theShape
12852 max_length maximum length of edges of theShape
12853 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12854 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12855 theName Object name; when specified, this parameter is used
12856 for result publication in the study. Otherwise, if automatic
12857 publication is switched on, default value is used for result name.
12860 a newly created GEOM group of edges.
12862 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
12863 edges_in_range = []
12865 Props = self.BasicProperties(edge)
12866 if min_length <= Props[0] and Props[0] <= max_length:
12867 if (not include_min) and (min_length == Props[0]):
12870 if (not include_max) and (Props[0] == max_length):
12873 edges_in_range.append(edge)
12875 if len(edges_in_range) <= 0:
12876 print "No edges found by given criteria"
12879 # note: auto-publishing is done in self.CreateGroup()
12880 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
12881 self.UnionList(group_edges, edges_in_range)
12885 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
12886 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
12887 # @param min_length minimum length of edges of selected shape
12888 # @param max_length maximum length of edges of selected shape
12889 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12890 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12891 # @return a newly created GEOM group of edges
12892 # @ref swig_todo "Example"
12893 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
12895 Create group of edges of selected shape, whose length is in range [min_length, max_length].
12896 If include_min/max == 0, edges with length == min/max_length will not be included in result.
12899 min_length minimum length of edges of selected shape
12900 max_length maximum length of edges of selected shape
12901 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
12902 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
12905 a newly created GEOM group of edges.
12907 nb_selected = sg.SelectedCount()
12908 if nb_selected < 1:
12909 print "Select a shape before calling this function, please."
12911 if nb_selected > 1:
12912 print "Only one shape must be selected"
12915 id_shape = sg.getSelected(0)
12916 shape = IDToObject( id_shape )
12918 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
12922 if include_min: left_str = " <= "
12923 if include_max: right_str = " <= "
12925 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
12926 + left_str + "length" + right_str + `max_length`)
12928 sg.updateObjBrowser(1)
12935 #@@ insert new functions before this line @@ do not remove this line @@#
12937 ## Create a copy of the given object
12939 # @param theOriginal geometry object for copy
12940 # @param theName Object name; when specified, this parameter is used
12941 # for result publication in the study. Otherwise, if automatic
12942 # publication is switched on, default value is used for result name.
12944 # @return New GEOM_Object, containing the copied shape.
12946 # @ingroup l1_geomBuilder_auxiliary
12947 # @ref swig_MakeCopy "Example"
12948 @ManageTransactions("InsertOp")
12949 def MakeCopy(self, theOriginal, theName=None):
12951 Create a copy of the given object
12954 theOriginal geometry object for copy
12955 theName Object name; when specified, this parameter is used
12956 for result publication in the study. Otherwise, if automatic
12957 publication is switched on, default value is used for result name.
12960 New GEOM_Object, containing the copied shape.
12962 Example of usage: Copy = geompy.MakeCopy(Box)
12964 # Example: see GEOM_TestAll.py
12965 anObj = self.InsertOp.MakeCopy(theOriginal)
12966 RaiseIfFailed("MakeCopy", self.InsertOp)
12967 self._autoPublish(anObj, theName, "copy")
12970 ## Add Path to load python scripts from
12971 # @param Path a path to load python scripts from
12972 # @ingroup l1_geomBuilder_auxiliary
12973 def addPath(self,Path):
12975 Add Path to load python scripts from
12978 Path a path to load python scripts from
12980 if (sys.path.count(Path) < 1):
12981 sys.path.append(Path)
12985 ## Load marker texture from the file
12986 # @param Path a path to the texture file
12987 # @return unique texture identifier
12988 # @ingroup l1_geomBuilder_auxiliary
12989 @ManageTransactions("InsertOp")
12990 def LoadTexture(self, Path):
12992 Load marker texture from the file
12995 Path a path to the texture file
12998 unique texture identifier
13000 # Example: see GEOM_TestAll.py
13001 ID = self.InsertOp.LoadTexture(Path)
13002 RaiseIfFailed("LoadTexture", self.InsertOp)
13005 ## Get internal name of the object based on its study entry
13006 # @note This method does not provide an unique identifier of the geometry object.
13007 # @note This is internal function of GEOM component, though it can be used outside it for
13008 # appropriate reason (e.g. for identification of geometry object).
13009 # @param obj geometry object
13010 # @return unique object identifier
13011 # @ingroup l1_geomBuilder_auxiliary
13012 def getObjectID(self, obj):
13014 Get internal name of the object based on its study entry.
13015 Note: this method does not provide an unique identifier of the geometry object.
13016 It is an internal function of GEOM component, though it can be used outside GEOM for
13017 appropriate reason (e.g. for identification of geometry object).
13020 obj geometry object
13023 unique object identifier
13026 entry = salome.ObjectToID(obj)
13027 if entry is not None:
13028 lst = entry.split(":")
13030 ID = lst[-1] # -1 means last item in the list
13031 return "GEOM_" + ID
13036 ## Add marker texture. @a Width and @a Height parameters
13037 # specify width and height of the texture in pixels.
13038 # If @a RowData is @c True, @a Texture parameter should represent texture data
13039 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13040 # parameter should be unpacked string, in which '1' symbols represent opaque
13041 # pixels and '0' represent transparent pixels of the texture bitmap.
13043 # @param Width texture width in pixels
13044 # @param Height texture height in pixels
13045 # @param Texture texture data
13046 # @param RowData if @c True, @a Texture data are packed in the byte stream
13047 # @return unique texture identifier
13048 # @ingroup l1_geomBuilder_auxiliary
13049 @ManageTransactions("InsertOp")
13050 def AddTexture(self, Width, Height, Texture, RowData=False):
13052 Add marker texture. Width and Height parameters
13053 specify width and height of the texture in pixels.
13054 If RowData is True, Texture parameter should represent texture data
13055 packed into the byte array. If RowData is False (default), Texture
13056 parameter should be unpacked string, in which '1' symbols represent opaque
13057 pixels and '0' represent transparent pixels of the texture bitmap.
13060 Width texture width in pixels
13061 Height texture height in pixels
13062 Texture texture data
13063 RowData if True, Texture data are packed in the byte stream
13066 return unique texture identifier
13068 if not RowData: Texture = PackData(Texture)
13069 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13070 RaiseIfFailed("AddTexture", self.InsertOp)
13073 ## Transfer not topological data from one GEOM object to another.
13075 # @param theObjectFrom the source object of non-topological data
13076 # @param theObjectTo the destination object of non-topological data
13077 # @param theFindMethod method to search sub-shapes of theObjectFrom
13078 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13079 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13080 # Other values of GEOM.find_shape_method are not supported.
13082 # @return True in case of success; False otherwise.
13084 # @ingroup l1_geomBuilder_auxiliary
13086 # @ref swig_TransferData "Example"
13087 @ManageTransactions("InsertOp")
13088 def TransferData(self, theObjectFrom, theObjectTo,
13089 theFindMethod=GEOM.FSM_GetInPlace):
13091 Transfer not topological data from one GEOM object to another.
13094 theObjectFrom the source object of non-topological data
13095 theObjectTo the destination object of non-topological data
13096 theFindMethod method to search sub-shapes of theObjectFrom
13097 in shape theObjectTo. Possible values are:
13098 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13099 and GEOM.FSM_GetInPlace_Old. Other values of
13100 GEOM.find_shape_method are not supported.
13103 True in case of success; False otherwise.
13105 # Example: see GEOM_TestOthers.py
13107 # Example: see GEOM_TestAll.py
13108 isOk = self.InsertOp.TransferData(theObjectFrom,
13109 theObjectTo, theFindMethod)
13110 RaiseIfFailed("TransferData", self.InsertOp)
13113 ## Creates a new folder object. It is a container for any GEOM objects.
13114 # @param Name name of the container
13115 # @param Father parent object. If None,
13116 # folder under 'Geometry' root object will be created.
13117 # @return a new created folder
13118 # @ingroup l1_publish_data
13119 def NewFolder(self, Name, Father=None):
13121 Create a new folder object. It is an auxiliary container for any GEOM objects.
13124 Name name of the container
13125 Father parent object. If None,
13126 folder under 'Geometry' root object will be created.
13129 a new created folder
13131 if not Father: Father = self.father
13132 return self.CreateFolder(Name, Father)
13134 ## Move object to the specified folder
13135 # @param Object object to move
13136 # @param Folder target folder
13137 # @ingroup l1_publish_data
13138 def PutToFolder(self, Object, Folder):
13140 Move object to the specified folder
13143 Object object to move
13144 Folder target folder
13146 self.MoveToFolder(Object, Folder)
13149 ## Move list of objects to the specified folder
13150 # @param ListOfSO list of objects to move
13151 # @param Folder target folder
13152 # @ingroup l1_publish_data
13153 def PutListToFolder(self, ListOfSO, Folder):
13155 Move list of objects to the specified folder
13158 ListOfSO list of objects to move
13159 Folder target folder
13161 self.MoveListToFolder(ListOfSO, Folder)
13164 ## @addtogroup l2_field
13168 # @param shape the shape the field lies on
13169 # @param name the field name
13170 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13171 # @param dimension dimension of the shape the field lies on
13172 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13173 # @param componentNames names of components
13174 # @return a created field
13175 @ManageTransactions("FieldOp")
13176 def CreateField(self, shape, name, type, dimension, componentNames):
13181 shape the shape the field lies on
13182 name the field name
13183 type type of field data
13184 dimension dimension of the shape the field lies on
13185 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13186 componentNames names of components
13191 if isinstance( type, int ):
13192 if type < 0 or type > 3:
13193 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13194 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13196 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13197 RaiseIfFailed("CreateField", self.FieldOp)
13199 geom._autoPublish( f, "", name)
13202 ## Removes a field from the GEOM component
13203 # @param field the field to remove
13204 def RemoveField(self, field):
13205 "Removes a field from the GEOM component"
13207 if isinstance( field, GEOM._objref_GEOM_Field ):
13208 geom.RemoveObject( field )
13209 elif isinstance( field, geomField ):
13210 geom.RemoveObject( field.field )
13212 raise RuntimeError, "RemoveField() : the object is not a field"
13215 ## Returns number of fields on a shape
13216 @ManageTransactions("FieldOp")
13217 def CountFields(self, shape):
13218 "Returns number of fields on a shape"
13219 nb = self.FieldOp.CountFields( shape )
13220 RaiseIfFailed("CountFields", self.FieldOp)
13223 ## Returns all fields on a shape
13224 @ManageTransactions("FieldOp")
13225 def GetFields(self, shape):
13226 "Returns all fields on a shape"
13227 ff = self.FieldOp.GetFields( shape )
13228 RaiseIfFailed("GetFields", self.FieldOp)
13231 ## Returns a field on a shape by its name
13232 @ManageTransactions("FieldOp")
13233 def GetField(self, shape, name):
13234 "Returns a field on a shape by its name"
13235 f = self.FieldOp.GetField( shape, name )
13236 RaiseIfFailed("GetField", self.FieldOp)
13244 # Register the new proxy for GEOM_Gen
13245 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13248 ## Field on Geometry
13249 # @ingroup l2_field
13250 class geomField( GEOM._objref_GEOM_Field ):
13252 def __init__(self):
13253 GEOM._objref_GEOM_Field.__init__(self)
13254 self.field = GEOM._objref_GEOM_Field
13257 ## Returns the shape the field lies on
13258 def getShape(self):
13259 "Returns the shape the field lies on"
13260 return self.field.GetShape(self)
13262 ## Returns the field name
13264 "Returns the field name"
13265 return self.field.GetName(self)
13267 ## Returns type of field data as integer [0-3]
13269 "Returns type of field data"
13270 return self.field.GetDataType(self)._v
13272 ## Returns type of field data:
13273 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13274 def getTypeEnum(self):
13275 "Returns type of field data"
13276 return self.field.GetDataType(self)
13278 ## Returns dimension of the shape the field lies on:
13279 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13280 def getDimension(self):
13281 """Returns dimension of the shape the field lies on:
13282 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13283 return self.field.GetDimension(self)
13285 ## Returns names of components
13286 def getComponents(self):
13287 "Returns names of components"
13288 return self.field.GetComponents(self)
13290 ## Adds a time step to the field
13291 # @param step the time step number further used as the step identifier
13292 # @param stamp the time step time
13293 # @param values the values of the time step
13294 def addStep(self, step, stamp, values):
13295 "Adds a time step to the field"
13296 stp = self.field.AddStep( self, step, stamp )
13298 raise RuntimeError, \
13299 "Field.addStep() : Error: step %s already exists in this field"%step
13301 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13302 self.setValues( step, values )
13305 ## Remove a time step from the field
13306 def removeStep(self,step):
13307 "Remove a time step from the field"
13310 stepObj = self.field.GetStep( self, step )
13312 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13315 #traceback.print_exc()
13317 self.field.RemoveStep( self, step )
13319 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13322 ## Returns number of time steps in the field
13323 def countSteps(self):
13324 "Returns number of time steps in the field"
13325 return self.field.CountSteps(self)
13327 ## Returns a list of time step IDs in the field
13328 def getSteps(self):
13329 "Returns a list of time step IDs in the field"
13330 return self.field.GetSteps(self)
13332 ## Returns a time step by its ID
13333 def getStep(self,step):
13334 "Returns a time step by its ID"
13335 stp = self.field.GetStep(self, step)
13337 raise RuntimeError, "Step %s is missing from this field"%step
13340 ## Returns the time of the field step
13341 def getStamp(self,step):
13342 "Returns the time of the field step"
13343 return self.getStep(step).GetStamp()
13345 ## Changes the time of the field step
13346 def setStamp(self, step, stamp):
13347 "Changes the time of the field step"
13348 return self.getStep(step).SetStamp(stamp)
13350 ## Returns values of the field step
13351 def getValues(self, step):
13352 "Returns values of the field step"
13353 return self.getStep(step).GetValues()
13355 ## Changes values of the field step
13356 def setValues(self, step, values):
13357 "Changes values of the field step"
13358 stp = self.getStep(step)
13359 errBeg = "Field.setValues(values) : Error: "
13361 ok = stp.SetValues( values )
13362 except Exception, e:
13364 if excStr.find("WrongPythonType") > 0:
13365 raise RuntimeError, errBeg +\
13366 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13367 raise RuntimeError, errBeg + str(e)
13369 nbOK = self.field.GetArraySize(self)
13372 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13374 raise RuntimeError, errBeg + "failed"
13377 pass # end of class geomField
13379 # Register the new proxy for GEOM_Field
13380 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13383 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13384 # interface to GEOM operations.
13389 # salome.salome_init()
13390 # from salome.geom import geomBuilder
13391 # geompy = geomBuilder.New(salome.myStudy)
13393 # @param study SALOME study, generally obtained by salome.myStudy.
13394 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13395 # @return geomBuilder instance
13396 def New( study, instance=None):
13398 Create a new geomBuilder instance.The geomBuilder class provides the Python
13399 interface to GEOM operations.
13403 salome.salome_init()
13404 from salome.geom import geomBuilder
13405 geompy = geomBuilder.New(salome.myStudy)
13408 study SALOME study, generally obtained by salome.myStudy.
13409 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13411 geomBuilder instance
13413 #print "New geomBuilder ", study, instance
13420 geom = geomBuilder()
13421 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13422 geom.init_geom(study)
13426 # Register methods from the plug-ins in the geomBuilder class
13427 plugins_var = os.environ.get( "GEOM_PluginsList" )
13430 if plugins_var is not None:
13431 plugins = plugins_var.split( ":" )
13432 plugins=filter(lambda x: len(x)>0, plugins)
13433 if plugins is not None:
13434 for pluginName in plugins:
13435 pluginBuilderName = pluginName + "Builder"
13437 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
13438 except Exception, e:
13439 from salome_utils import verbose
13440 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
13442 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
13443 plugin = eval( pluginBuilderName )
13445 # add methods from plugin module to the geomBuilder class
13446 for k in dir( plugin ):
13447 if k[0] == '_': continue
13448 method = getattr( plugin, k )
13449 if type( method ).__name__ == 'function':
13450 if not hasattr( geomBuilder, k ):
13451 setattr( geomBuilder, k, method )