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 not Operation.IsDone() 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]
604 # - LCS: [x y z xx xy xz yx yy yz zx zy zz]
605 # @ingroup l1_geomBuilder_auxiliary
606 kind = GEOM.GEOM_IKindOfShape
613 #print "==== __new__ ", engine, geom, doLcc, created
615 # geom engine is either retrieved from engine, or created
617 # Following test avoids a recursive loop
620 # geom engine not created: existing engine found
622 if doLcc and not created:
624 # FindOrLoadComponent called:
625 # 1. CORBA resolution of server
626 # 2. the __new__ method is called again
627 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
628 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
631 # FindOrLoadComponent not called
633 # geomBuilder instance is created from lcc.FindOrLoadComponent
634 #print "==== super ", engine, geom, doLcc, created
635 geom = super(geomBuilder,cls).__new__(cls)
638 # geom engine not created: existing engine found
639 #print "==== existing ", engine, geom, doLcc, created
641 #print "return geom 1 ", geom
644 #print "return geom 2 ", geom
649 #print "-------- geomBuilder __init__ --- ", created, self
652 GEOM._objref_GEOM_Gen.__init__(self)
653 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
654 self.myBuilder = None
673 ## Process object publication in the study, as follows:
674 # - if @a theName is specified (not None), the object is published in the study
675 # with this name, not taking into account "auto-publishing" option;
676 # - if @a theName is NOT specified, the object is published in the study
677 # (using default name, which can be customized using @a theDefaultName parameter)
678 # only if auto-publishing is switched on.
680 # @param theObj object, a subject for publishing
681 # @param theName object name for study
682 # @param theDefaultName default name for the auto-publishing
684 # @sa addToStudyAuto()
685 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
687 def _item_name(_names, _defname, _idx=-1):
688 if not _names: _names = _defname
689 if type(_names) in [types.ListType, types.TupleType]:
691 if _idx >= len(_names) or not _names[_idx]:
692 if type(_defname) not in [types.ListType, types.TupleType]:
693 _name = "%s_%d"%(_defname, _idx+1)
694 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
695 _name = _defname[_idx]
697 _name = "%noname_%d"%(dn, _idx+1)
703 # must be wrong usage
708 _name = "%s_%d"%(_names, _idx+1)
714 def _publish( _name, _obj ):
716 if isinstance( _obj, GEOM._objref_GEOM_Field ):
717 fatherObj = _obj.GetShape()
718 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
719 fatherObj = _obj.GetField()
720 elif not _obj.IsMainShape():
721 fatherObj = _obj.GetMainShape()
723 if fatherObj and fatherObj.GetStudyEntry():
724 self.addToStudyInFather(fatherObj, _obj, _name)
726 self.addToStudy(_obj, _name)
732 if not theName and not self.myMaxNbSubShapesAllowed:
733 return # nothing to do: auto-publishing is disabled
734 if not theName and not theDefaultName:
735 return # neither theName nor theDefaultName is given
737 if type(theObj) in [types.ListType, types.TupleType]:
738 # list of objects is being published
741 if not obj: continue # bad object
742 name = _item_name(theName, theDefaultName, idx)
743 _publish( name, obj )
745 if not theName and idx == self.myMaxNbSubShapesAllowed: break
749 # single object is published
750 name = _item_name(theName, theDefaultName)
751 _publish( name, theObj )
754 ## @addtogroup l1_geomBuilder_auxiliary
756 def init_geom(self,theStudy):
757 self.myStudy = theStudy
758 self.myStudyId = self.myStudy._get_StudyId()
759 self.myBuilder = self.myStudy.NewBuilder()
760 self.father = self.myStudy.FindComponent("GEOM")
761 notebook.myStudy = theStudy
762 if self.father is None:
763 self.father = self.myBuilder.NewComponent("GEOM")
764 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
765 FName = A1._narrow(SALOMEDS.AttributeName)
766 FName.SetValue("Geometry")
767 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
768 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
769 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
770 self.myBuilder.DefineComponentInstance(self.father,self)
772 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
773 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
774 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
775 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
776 self.HealOp = self.GetIHealingOperations (self.myStudyId)
777 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
778 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
779 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
780 self.LocalOp = self.GetILocalOperations (self.myStudyId)
781 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
782 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
783 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
784 self.FieldOp = self.GetIFieldOperations (self.myStudyId)
786 # set GEOM as root in the use case tree
787 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
788 self.myUseCaseBuilder.SetRootCurrent()
789 self.myUseCaseBuilder.Append(self.father)
791 # load data from the study file, if necessary
792 self.myBuilder.LoadWith(self.father, self)
795 def GetPluginOperations(self, studyID, libraryName):
796 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, studyID, libraryName)
799 ## Enable / disable results auto-publishing
801 # The automatic publishing is managed in the following way:
802 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
803 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
804 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
805 # value passed as parameter has the same effect.
806 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
807 # maximum number of sub-shapes allowed for publishing is set to specified value.
809 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
810 # @ingroup l1_publish_data
811 def addToStudyAuto(self, maxNbSubShapes=-1):
813 Enable / disable results auto-publishing
815 The automatic publishing is managed in the following way:
816 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
817 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
818 maximum number of sub-shapes allowed for publishing is unlimited; any negative
819 value passed as parameter has the same effect.
820 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
821 maximum number of sub-shapes allowed for publishing is set to this value.
824 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
827 geompy.addToStudyAuto() # enable auto-publishing
828 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
829 geompy.addToStudyAuto(0) # disable auto-publishing
831 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
834 ## Dump component to the Python script
835 # This method overrides IDL function to allow default values for the parameters.
836 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
838 Dump component to the Python script
839 This method overrides IDL function to allow default values for the parameters.
841 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
843 ## Get name for sub-shape aSubObj of shape aMainObj
845 # @ref swig_SubShapeName "Example"
846 @ManageTransactions("ShapesOp")
847 def SubShapeName(self,aSubObj, aMainObj):
849 Get name for sub-shape aSubObj of shape aMainObj
851 # Example: see GEOM_TestAll.py
853 #aSubId = orb.object_to_string(aSubObj)
854 #aMainId = orb.object_to_string(aMainObj)
855 #index = gg.getIndexTopology(aSubId, aMainId)
856 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
857 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
858 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
861 ## Publish in study aShape with name aName
863 # \param aShape the shape to be published
864 # \param aName the name for the shape
865 # \param doRestoreSubShapes if True, finds and publishes also
866 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
867 # and published sub-shapes of arguments
868 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
869 # these arguments description
870 # \return study entry of the published shape in form of string
872 # @ingroup l1_publish_data
873 # @ref swig_all_addtostudy "Example"
874 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
875 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
877 Publish in study aShape with name aName
880 aShape the shape to be published
881 aName the name for the shape
882 doRestoreSubShapes if True, finds and publishes also
883 sub-shapes of aShape, corresponding to its arguments
884 and published sub-shapes of arguments
885 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
886 these arguments description
889 study entry of the published shape in form of string
892 id_block1 = geompy.addToStudy(Block1, "Block 1")
894 # Example: see GEOM_TestAll.py
896 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
897 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
898 if doRestoreSubShapes:
899 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
900 theFindMethod, theInheritFirstArg, True )
902 print "addToStudy() failed"
904 return aShape.GetStudyEntry()
906 ## Publish in study aShape with name aName as sub-object of previously published aFather
907 # \param aFather previously published object
908 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
909 # \param aName the name for the shape
911 # \return study entry of the published shape in form of string
913 # @ingroup l1_publish_data
914 # @ref swig_all_addtostudyInFather "Example"
915 def addToStudyInFather(self, aFather, aShape, aName):
917 Publish in study aShape with name aName as sub-object of previously published aFather
920 aFather previously published object
921 aShape the shape to be published as sub-object of aFather
922 aName the name for the shape
925 study entry of the published shape in form of string
927 # Example: see GEOM_TestAll.py
929 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
930 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
932 print "addToStudyInFather() failed"
934 return aShape.GetStudyEntry()
936 ## Unpublish object in study
938 # \param obj the object to be unpublished
939 def hideInStudy(self, obj):
941 Unpublish object in study
944 obj the object to be unpublished
946 ior = salome.orb.object_to_string(obj)
947 aSObject = self.myStudy.FindObjectIOR(ior)
948 if aSObject is not None:
949 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
950 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
951 drwAttribute.SetDrawable(False)
952 # hide references if any
953 vso = self.myStudy.FindDependances(aSObject);
955 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
956 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
957 drwAttribute.SetDrawable(False)
961 # end of l1_geomBuilder_auxiliary
964 ## @addtogroup l3_restore_ss
967 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
968 # To be used from python scripts out of addToStudy() (non-default usage)
969 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
970 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
971 # If this list is empty, all operation arguments will be published
972 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
973 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
974 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
975 # Do not publish sub-shapes in place of arguments, but only
976 # in place of sub-shapes of the first argument,
977 # because the whole shape corresponds to the first argument.
978 # Mainly to be used after transformations, but it also can be
979 # usefull after partition with one object shape, and some other
980 # operations, where only the first argument has to be considered.
981 # If theObject has only one argument shape, this flag is automatically
982 # considered as True, not regarding really passed value.
983 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
984 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
985 # \return list of published sub-shapes
987 # @ref tui_restore_prs_params "Example"
988 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
989 theInheritFirstArg=False, theAddPrefix=True):
991 Publish sub-shapes, standing for arguments and sub-shapes of arguments
992 To be used from python scripts out of geompy.addToStudy (non-default usage)
995 theObject published GEOM.GEOM_Object, arguments of which will be published
996 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
997 If this list is empty, all operation arguments will be published
998 theFindMethod method to search sub-shapes, corresponding to arguments and
999 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1000 theInheritFirstArg set properties of the first argument for theObject.
1001 Do not publish sub-shapes in place of arguments, but only
1002 in place of sub-shapes of the first argument,
1003 because the whole shape corresponds to the first argument.
1004 Mainly to be used after transformations, but it also can be
1005 usefull after partition with one object shape, and some other
1006 operations, where only the first argument has to be considered.
1007 If theObject has only one argument shape, this flag is automatically
1008 considered as True, not regarding really passed value.
1009 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1010 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1012 list of published sub-shapes
1014 # Example: see GEOM_TestAll.py
1015 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
1016 theFindMethod, theInheritFirstArg, theAddPrefix)
1018 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1019 # To be used from python scripts out of addToStudy() (non-default usage)
1020 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1021 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1022 # If this list is empty, all operation arguments will be published
1023 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1024 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1025 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1026 # Do not publish sub-shapes in place of arguments, but only
1027 # in place of sub-shapes of the first argument,
1028 # because the whole shape corresponds to the first argument.
1029 # Mainly to be used after transformations, but it also can be
1030 # usefull after partition with one object shape, and some other
1031 # operations, where only the first argument has to be considered.
1032 # If theObject has only one argument shape, this flag is automatically
1033 # considered as True, not regarding really passed value.
1034 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1035 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1036 # \return list of published sub-shapes
1038 # @ref tui_restore_prs_params "Example"
1039 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1040 theInheritFirstArg=False, theAddPrefix=True):
1042 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1043 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1046 theObject published GEOM.GEOM_Object, arguments of which will be published
1047 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1048 If this list is empty, all operation arguments will be published
1049 theFindMethod method to search sub-shapes, corresponding to arguments and
1050 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1051 theInheritFirstArg set properties of the first argument for theObject.
1052 Do not publish sub-shapes in place of arguments, but only
1053 in place of sub-shapes of the first argument,
1054 because the whole shape corresponds to the first argument.
1055 Mainly to be used after transformations, but it also can be
1056 usefull after partition with one object shape, and some other
1057 operations, where only the first argument has to be considered.
1058 If theObject has only one argument shape, this flag is automatically
1059 considered as True, not regarding really passed value.
1060 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1061 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1064 list of published sub-shapes
1066 # Example: see GEOM_TestAll.py
1067 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
1068 theFindMethod, theInheritFirstArg, theAddPrefix)
1070 # end of l3_restore_ss
1073 ## @addtogroup l3_basic_go
1076 ## Create point by three coordinates.
1077 # @param theX The X coordinate of the point.
1078 # @param theY The Y coordinate of the point.
1079 # @param theZ The Z coordinate of the point.
1080 # @param theName Object name; when specified, this parameter is used
1081 # for result publication in the study. Otherwise, if automatic
1082 # publication is switched on, default value is used for result name.
1084 # @return New GEOM.GEOM_Object, containing the created point.
1086 # @ref tui_creation_point "Example"
1087 @ManageTransactions("BasicOp")
1088 def MakeVertex(self, theX, theY, theZ, theName=None):
1090 Create point by three coordinates.
1093 theX The X coordinate of the point.
1094 theY The Y coordinate of the point.
1095 theZ The Z coordinate of the point.
1096 theName Object name; when specified, this parameter is used
1097 for result publication in the study. Otherwise, if automatic
1098 publication is switched on, default value is used for result name.
1101 New GEOM.GEOM_Object, containing the created point.
1103 # Example: see GEOM_TestAll.py
1104 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1105 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1106 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1107 anObj.SetParameters(Parameters)
1108 self._autoPublish(anObj, theName, "vertex")
1111 ## Create a point, distant from the referenced point
1112 # on the given distances along the coordinate axes.
1113 # @param theReference The referenced point.
1114 # @param theX Displacement from the referenced point along OX axis.
1115 # @param theY Displacement from the referenced point along OY axis.
1116 # @param theZ Displacement from the referenced point along OZ axis.
1117 # @param theName Object name; when specified, this parameter is used
1118 # for result publication in the study. Otherwise, if automatic
1119 # publication is switched on, default value is used for result name.
1121 # @return New GEOM.GEOM_Object, containing the created point.
1123 # @ref tui_creation_point "Example"
1124 @ManageTransactions("BasicOp")
1125 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1127 Create a point, distant from the referenced point
1128 on the given distances along the coordinate axes.
1131 theReference The referenced point.
1132 theX Displacement from the referenced point along OX axis.
1133 theY Displacement from the referenced point along OY axis.
1134 theZ Displacement from the referenced point along OZ axis.
1135 theName Object name; when specified, this parameter is used
1136 for result publication in the study. Otherwise, if automatic
1137 publication is switched on, default value is used for result name.
1140 New GEOM.GEOM_Object, containing the created point.
1142 # Example: see GEOM_TestAll.py
1143 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1144 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1145 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1146 anObj.SetParameters(Parameters)
1147 self._autoPublish(anObj, theName, "vertex")
1150 ## Create a point, corresponding to the given parameter on the given curve.
1151 # @param theRefCurve The referenced curve.
1152 # @param theParameter Value of parameter on the referenced curve.
1153 # @param takeOrientationIntoAccount flag that tells if it is necessary
1154 # to take the curve's orientation into account for the
1155 # operation. I.e. if this flag is set, the results for the same
1156 # parameters (except the value 0.5) is different for forward
1157 # and reversed curves. If it is not set the result is the same.
1158 # @param theName Object name; when specified, this parameter is used
1159 # for result publication in the study. Otherwise, if automatic
1160 # publication is switched on, default value is used for result name.
1162 # @return New GEOM.GEOM_Object, containing the created point.
1164 # @ref tui_creation_point "Example"
1165 @ManageTransactions("BasicOp")
1166 def MakeVertexOnCurve(self, theRefCurve, theParameter,
1167 takeOrientationIntoAccount=False, theName=None):
1169 Create a point, corresponding to the given parameter on the given curve.
1172 theRefCurve The referenced curve.
1173 theParameter Value of parameter on the referenced curve.
1174 takeOrientationIntoAccount flag that tells if it is necessary
1175 to take the curve's orientation into account for the
1176 operation. I.e. if this flag is set, the results for
1177 the same parameters (except the value 0.5) is different
1178 for forward and reversed curves. If it is not set
1179 the result is the same.
1180 theName Object name; when specified, this parameter is used
1181 for result publication in the study. Otherwise, if automatic
1182 publication is switched on, default value is used for result name.
1185 New GEOM.GEOM_Object, containing the created point.
1188 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1190 # Example: see GEOM_TestAll.py
1191 theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1192 theParameter, takeOrientationIntoAccount)
1193 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1194 takeOrientationIntoAccount)
1195 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1196 anObj.SetParameters(Parameters)
1197 self._autoPublish(anObj, theName, "vertex")
1200 ## Create a point by projection give coordinates on the given curve
1201 # @param theRefCurve The referenced curve.
1202 # @param theX X-coordinate in 3D space
1203 # @param theY Y-coordinate in 3D space
1204 # @param theZ Z-coordinate in 3D space
1205 # @param theName Object name; when specified, this parameter is used
1206 # for result publication in the study. Otherwise, if automatic
1207 # publication is switched on, default value is used for result name.
1209 # @return New GEOM.GEOM_Object, containing the created point.
1211 # @ref tui_creation_point "Example"
1212 @ManageTransactions("BasicOp")
1213 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1215 Create a point by projection give coordinates on the given curve
1218 theRefCurve The referenced curve.
1219 theX X-coordinate in 3D space
1220 theY Y-coordinate in 3D space
1221 theZ Z-coordinate in 3D space
1222 theName Object name; when specified, this parameter is used
1223 for result publication in the study. Otherwise, if automatic
1224 publication is switched on, default value is used for result name.
1227 New GEOM.GEOM_Object, containing the created point.
1230 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1232 # Example: see GEOM_TestAll.py
1233 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1234 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1235 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1236 anObj.SetParameters(Parameters)
1237 self._autoPublish(anObj, theName, "vertex")
1240 ## Create a point, corresponding to the given length on the given curve.
1241 # @param theRefCurve The referenced curve.
1242 # @param theLength Length on the referenced curve. It can be negative.
1243 # @param theStartPoint Point allowing to choose the direction for the calculation
1244 # of the length. If None, start from the first point of theRefCurve.
1245 # @param theName Object name; when specified, this parameter is used
1246 # for result publication in the study. Otherwise, if automatic
1247 # publication is switched on, default value is used for result name.
1249 # @return New GEOM.GEOM_Object, containing the created point.
1251 # @ref tui_creation_point "Example"
1252 @ManageTransactions("BasicOp")
1253 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1255 Create a point, corresponding to the given length on the given curve.
1258 theRefCurve The referenced curve.
1259 theLength Length on the referenced curve. It can be negative.
1260 theStartPoint Point allowing to choose the direction for the calculation
1261 of the length. If None, start from the first point of theRefCurve.
1262 theName Object name; when specified, this parameter is used
1263 for result publication in the study. Otherwise, if automatic
1264 publication is switched on, default value is used for result name.
1267 New GEOM.GEOM_Object, containing the created point.
1269 # Example: see GEOM_TestAll.py
1270 theLength, Parameters = ParseParameters(theLength)
1271 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1272 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1273 anObj.SetParameters(Parameters)
1274 self._autoPublish(anObj, theName, "vertex")
1277 ## Create a point, corresponding to the given parameters on the
1279 # @param theRefSurf The referenced surface.
1280 # @param theUParameter Value of U-parameter on the referenced surface.
1281 # @param theVParameter Value of V-parameter on the referenced surface.
1282 # @param theName Object name; when specified, this parameter is used
1283 # for result publication in the study. Otherwise, if automatic
1284 # publication is switched on, default value is used for result name.
1286 # @return New GEOM.GEOM_Object, containing the created point.
1288 # @ref swig_MakeVertexOnSurface "Example"
1289 @ManageTransactions("BasicOp")
1290 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1292 Create a point, corresponding to the given parameters on the
1296 theRefSurf The referenced surface.
1297 theUParameter Value of U-parameter on the referenced surface.
1298 theVParameter Value of V-parameter on the referenced surface.
1299 theName Object name; when specified, this parameter is used
1300 for result publication in the study. Otherwise, if automatic
1301 publication is switched on, default value is used for result name.
1304 New GEOM.GEOM_Object, containing the created point.
1307 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1309 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1310 # Example: see GEOM_TestAll.py
1311 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1312 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1313 anObj.SetParameters(Parameters);
1314 self._autoPublish(anObj, theName, "vertex")
1317 ## Create a point by projection give coordinates on the given surface
1318 # @param theRefSurf The referenced surface.
1319 # @param theX X-coordinate in 3D space
1320 # @param theY Y-coordinate in 3D space
1321 # @param theZ Z-coordinate in 3D space
1322 # @param theName Object name; when specified, this parameter is used
1323 # for result publication in the study. Otherwise, if automatic
1324 # publication is switched on, default value is used for result name.
1326 # @return New GEOM.GEOM_Object, containing the created point.
1328 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1329 @ManageTransactions("BasicOp")
1330 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1332 Create a point by projection give coordinates on the given surface
1335 theRefSurf The referenced surface.
1336 theX X-coordinate in 3D space
1337 theY Y-coordinate in 3D space
1338 theZ Z-coordinate in 3D space
1339 theName Object name; when specified, this parameter is used
1340 for result publication in the study. Otherwise, if automatic
1341 publication is switched on, default value is used for result name.
1344 New GEOM.GEOM_Object, containing the created point.
1347 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1349 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1350 # Example: see GEOM_TestAll.py
1351 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1352 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1353 anObj.SetParameters(Parameters);
1354 self._autoPublish(anObj, theName, "vertex")
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.
1362 # @param theFace The referenced face.
1363 # @param theName Object name; when specified, this parameter is used
1364 # for result publication in the study. Otherwise, if automatic
1365 # publication is switched on, default value is used for result name.
1367 # @return New GEOM.GEOM_Object, containing the created point.
1369 # @ref swig_MakeVertexInsideFace "Example"
1370 @ManageTransactions("BasicOp")
1371 def MakeVertexInsideFace (self, theFace, theName=None):
1373 Create a point, which lays on the given face.
1374 The point will lay in arbitrary place of the face.
1375 The only condition on it is a non-zero distance to the face boundary.
1376 Such point can be used to uniquely identify the face inside any
1377 shape in case, when the shape does not contain overlapped faces.
1380 theFace The referenced face.
1381 theName Object name; when specified, this parameter is used
1382 for result publication in the study. Otherwise, if automatic
1383 publication is switched on, default value is used for result name.
1386 New GEOM.GEOM_Object, containing the created point.
1389 p_on_face = geompy.MakeVertexInsideFace(Face)
1391 # Example: see GEOM_TestAll.py
1392 anObj = self.BasicOp.MakePointOnFace(theFace)
1393 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1394 self._autoPublish(anObj, theName, "vertex")
1397 ## Create a point on intersection of two lines.
1398 # @param theRefLine1, theRefLine2 The referenced lines.
1399 # @param theName Object name; when specified, this parameter is used
1400 # for result publication in the study. Otherwise, if automatic
1401 # publication is switched on, default value is used for result name.
1403 # @return New GEOM.GEOM_Object, containing the created point.
1405 # @ref swig_MakeVertexOnLinesIntersection "Example"
1406 @ManageTransactions("BasicOp")
1407 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1409 Create a point on intersection of two lines.
1412 theRefLine1, theRefLine2 The referenced lines.
1413 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.
1418 New GEOM.GEOM_Object, containing the created point.
1420 # Example: see GEOM_TestAll.py
1421 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1422 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1423 self._autoPublish(anObj, theName, "vertex")
1426 ## Create a tangent, corresponding to the given parameter on the given curve.
1427 # @param theRefCurve The referenced curve.
1428 # @param theParameter Value of parameter on the referenced curve.
1429 # @param theName Object name; when specified, this parameter is used
1430 # for result publication in the study. Otherwise, if automatic
1431 # publication is switched on, default value is used for result name.
1433 # @return New GEOM.GEOM_Object, containing the created tangent.
1435 # @ref swig_MakeTangentOnCurve "Example"
1436 @ManageTransactions("BasicOp")
1437 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1439 Create a tangent, corresponding to the given parameter on the given curve.
1442 theRefCurve The referenced curve.
1443 theParameter Value of parameter on the referenced curve.
1444 theName Object name; when specified, this parameter is used
1445 for result publication in the study. Otherwise, if automatic
1446 publication is switched on, default value is used for result name.
1449 New GEOM.GEOM_Object, containing the created tangent.
1452 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1454 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1455 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1456 self._autoPublish(anObj, theName, "tangent")
1459 ## Create a tangent plane, corresponding to the given parameter on the given face.
1460 # @param theFace The face for which tangent plane should be built.
1461 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1462 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1463 # @param theTrimSize the size of plane.
1464 # @param theName Object name; when specified, this parameter is used
1465 # for result publication in the study. Otherwise, if automatic
1466 # publication is switched on, default value is used for result name.
1468 # @return New GEOM.GEOM_Object, containing the created tangent.
1470 # @ref swig_MakeTangentPlaneOnFace "Example"
1471 @ManageTransactions("BasicOp")
1472 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1474 Create a tangent plane, corresponding to the given parameter on the given face.
1477 theFace The face for which tangent plane should be built.
1478 theParameterV vertical value of the center point (0.0 - 1.0).
1479 theParameterU horisontal value of the center point (0.0 - 1.0).
1480 theTrimSize the size of plane.
1481 theName Object name; when specified, this parameter is used
1482 for result publication in the study. Otherwise, if automatic
1483 publication is switched on, default value is used for result name.
1486 New GEOM.GEOM_Object, containing the created tangent.
1489 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1491 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1492 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1493 self._autoPublish(anObj, theName, "tangent")
1496 ## Create a vector with the given components.
1497 # @param theDX X component of the vector.
1498 # @param theDY Y component of the vector.
1499 # @param theDZ Z component of the vector.
1500 # @param 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.
1504 # @return New GEOM.GEOM_Object, containing the created vector.
1506 # @ref tui_creation_vector "Example"
1507 @ManageTransactions("BasicOp")
1508 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1510 Create a vector with the given components.
1513 theDX X component of the vector.
1514 theDY Y component of the vector.
1515 theDZ Z component of the vector.
1516 theName Object name; when specified, this parameter is used
1517 for result publication in the study. Otherwise, if automatic
1518 publication is switched on, default value is used for result name.
1521 New GEOM.GEOM_Object, containing the created vector.
1523 # Example: see GEOM_TestAll.py
1524 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1525 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1526 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1527 anObj.SetParameters(Parameters)
1528 self._autoPublish(anObj, theName, "vector")
1531 ## Create a vector between two points.
1532 # @param thePnt1 Start point for the vector.
1533 # @param thePnt2 End point for the vector.
1534 # @param theName Object name; when specified, this parameter is used
1535 # for result publication in the study. Otherwise, if automatic
1536 # publication is switched on, default value is used for result name.
1538 # @return New GEOM.GEOM_Object, containing the created vector.
1540 # @ref tui_creation_vector "Example"
1541 @ManageTransactions("BasicOp")
1542 def MakeVector(self, thePnt1, thePnt2, theName=None):
1544 Create a vector between two points.
1547 thePnt1 Start point for the vector.
1548 thePnt2 End point for the vector.
1549 theName Object name; when specified, this parameter is used
1550 for result publication in the study. Otherwise, if automatic
1551 publication is switched on, default value is used for result name.
1554 New GEOM.GEOM_Object, containing the created vector.
1556 # Example: see GEOM_TestAll.py
1557 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1558 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1559 self._autoPublish(anObj, theName, "vector")
1562 ## Create a line, passing through the given point
1563 # and parrallel to the given direction
1564 # @param thePnt Point. The resulting line will pass through it.
1565 # @param theDir Direction. The resulting line will be parallel to it.
1566 # @param 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.
1570 # @return New GEOM.GEOM_Object, containing the created line.
1572 # @ref tui_creation_line "Example"
1573 @ManageTransactions("BasicOp")
1574 def MakeLine(self, thePnt, theDir, theName=None):
1576 Create a line, passing through the given point
1577 and parrallel to the given direction
1580 thePnt Point. The resulting line will pass through it.
1581 theDir Direction. The resulting line will be parallel to it.
1582 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.
1587 New GEOM.GEOM_Object, containing the created line.
1589 # Example: see GEOM_TestAll.py
1590 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1591 RaiseIfFailed("MakeLine", self.BasicOp)
1592 self._autoPublish(anObj, theName, "line")
1595 ## Create a line, passing through the given points
1596 # @param thePnt1 First of two points, defining the line.
1597 # @param thePnt2 Second of two points, defining the line.
1598 # @param theName Object name; when specified, this parameter is used
1599 # for result publication in the study. Otherwise, if automatic
1600 # publication is switched on, default value is used for result name.
1602 # @return New GEOM.GEOM_Object, containing the created line.
1604 # @ref tui_creation_line "Example"
1605 @ManageTransactions("BasicOp")
1606 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1608 Create a line, passing through the given points
1611 thePnt1 First of two points, defining the line.
1612 thePnt2 Second of two points, defining the line.
1613 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.
1618 New GEOM.GEOM_Object, containing the created line.
1620 # Example: see GEOM_TestAll.py
1621 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1622 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1623 self._autoPublish(anObj, theName, "line")
1626 ## Create a line on two faces intersection.
1627 # @param theFace1 First of two faces, defining the line.
1628 # @param theFace2 Second of two faces, defining the line.
1629 # @param theName Object name; when specified, this parameter is used
1630 # for result publication in the study. Otherwise, if automatic
1631 # publication is switched on, default value is used for result name.
1633 # @return New GEOM.GEOM_Object, containing the created line.
1635 # @ref swig_MakeLineTwoFaces "Example"
1636 @ManageTransactions("BasicOp")
1637 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1639 Create a line on two faces intersection.
1642 theFace1 First of two faces, defining the line.
1643 theFace2 Second of two faces, defining the line.
1644 theName Object name; when specified, this parameter is used
1645 for result publication in the study. Otherwise, if automatic
1646 publication is switched on, default value is used for result name.
1649 New GEOM.GEOM_Object, containing the created line.
1651 # Example: see GEOM_TestAll.py
1652 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1653 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1654 self._autoPublish(anObj, theName, "line")
1657 ## Create a plane, passing through the given point
1658 # and normal to the given vector.
1659 # @param thePnt Point, the plane has to pass through.
1660 # @param theVec Vector, defining the plane normal direction.
1661 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1662 # @param theName Object name; when specified, this parameter is used
1663 # for result publication in the study. Otherwise, if automatic
1664 # publication is switched on, default value is used for result name.
1666 # @return New GEOM.GEOM_Object, containing the created plane.
1668 # @ref tui_creation_plane "Example"
1669 @ManageTransactions("BasicOp")
1670 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1672 Create a plane, passing through the given point
1673 and normal to the given vector.
1676 thePnt Point, the plane has to pass through.
1677 theVec Vector, defining the plane normal direction.
1678 theTrimSize Half size of a side of quadrangle face, representing the plane.
1679 theName Object name; when specified, this parameter is used
1680 for result publication in the study. Otherwise, if automatic
1681 publication is switched on, default value is used for result name.
1684 New GEOM.GEOM_Object, containing the created plane.
1686 # Example: see GEOM_TestAll.py
1687 theTrimSize, Parameters = ParseParameters(theTrimSize);
1688 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1689 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1690 anObj.SetParameters(Parameters)
1691 self._autoPublish(anObj, theName, "plane")
1694 ## Create a plane, passing through the three given points
1695 # @param thePnt1 First of three points, defining the plane.
1696 # @param thePnt2 Second of three points, defining the plane.
1697 # @param thePnt3 Fird of three points, defining the plane.
1698 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1699 # @param theName Object name; when specified, this parameter is used
1700 # for result publication in the study. Otherwise, if automatic
1701 # publication is switched on, default value is used for result name.
1703 # @return New GEOM.GEOM_Object, containing the created plane.
1705 # @ref tui_creation_plane "Example"
1706 @ManageTransactions("BasicOp")
1707 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1709 Create a plane, passing through the three given points
1712 thePnt1 First of three points, defining the plane.
1713 thePnt2 Second of three points, defining the plane.
1714 thePnt3 Fird of three points, defining the plane.
1715 theTrimSize Half size of a side of quadrangle face, representing the plane.
1716 theName Object name; when specified, this parameter is used
1717 for result publication in the study. Otherwise, if automatic
1718 publication is switched on, default value is used for result name.
1721 New GEOM.GEOM_Object, containing the created plane.
1723 # Example: see GEOM_TestAll.py
1724 theTrimSize, Parameters = ParseParameters(theTrimSize);
1725 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1726 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1727 anObj.SetParameters(Parameters)
1728 self._autoPublish(anObj, theName, "plane")
1731 ## Create a plane, similar to the existing one, but with another size of representing face.
1732 # @param theFace Referenced plane or LCS(Marker).
1733 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1734 # @param theName Object name; when specified, this parameter is used
1735 # for result publication in the study. Otherwise, if automatic
1736 # publication is switched on, default value is used for result name.
1738 # @return New GEOM.GEOM_Object, containing the created plane.
1740 # @ref tui_creation_plane "Example"
1741 @ManageTransactions("BasicOp")
1742 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1744 Create a plane, similar to the existing one, but with another size of representing face.
1747 theFace Referenced plane or LCS(Marker).
1748 theTrimSize New half size of a side of quadrangle face, representing the plane.
1749 theName Object name; when specified, this parameter is used
1750 for result publication in the study. Otherwise, if automatic
1751 publication is switched on, default value is used for result name.
1754 New GEOM.GEOM_Object, containing the created plane.
1756 # Example: see GEOM_TestAll.py
1757 theTrimSize, Parameters = ParseParameters(theTrimSize);
1758 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1759 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1760 anObj.SetParameters(Parameters)
1761 self._autoPublish(anObj, theName, "plane")
1764 ## Create a plane, passing through the 2 vectors
1765 # with center in a start point of the first vector.
1766 # @param theVec1 Vector, defining center point and plane direction.
1767 # @param theVec2 Vector, defining the plane normal direction.
1768 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1769 # @param theName Object name; when specified, this parameter is used
1770 # for result publication in the study. Otherwise, if automatic
1771 # publication is switched on, default value is used for result name.
1773 # @return New GEOM.GEOM_Object, containing the created plane.
1775 # @ref tui_creation_plane "Example"
1776 @ManageTransactions("BasicOp")
1777 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1779 Create a plane, passing through the 2 vectors
1780 with center in a start point of the first vector.
1783 theVec1 Vector, defining center point and plane direction.
1784 theVec2 Vector, defining the plane normal direction.
1785 theTrimSize Half size of a side of quadrangle face, representing the plane.
1786 theName Object name; when specified, this parameter is used
1787 for result publication in the study. Otherwise, if automatic
1788 publication is switched on, default value is used for result name.
1791 New GEOM.GEOM_Object, containing the created plane.
1793 # Example: see GEOM_TestAll.py
1794 theTrimSize, Parameters = ParseParameters(theTrimSize);
1795 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1796 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1797 anObj.SetParameters(Parameters)
1798 self._autoPublish(anObj, theName, "plane")
1801 ## Create a plane, based on a Local coordinate system.
1802 # @param theLCS coordinate system, defining plane.
1803 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1804 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1805 # @param 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.
1809 # @return New GEOM.GEOM_Object, containing the created plane.
1811 # @ref tui_creation_plane "Example"
1812 @ManageTransactions("BasicOp")
1813 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1815 Create a plane, based on a Local coordinate system.
1818 theLCS coordinate system, defining plane.
1819 theTrimSize Half size of a side of quadrangle face, representing the plane.
1820 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1821 theName Object name; when specified, this parameter is used
1822 for result publication in the study. Otherwise, if automatic
1823 publication is switched on, default value is used for result name.
1826 New GEOM.GEOM_Object, containing the created plane.
1828 # Example: see GEOM_TestAll.py
1829 theTrimSize, Parameters = ParseParameters(theTrimSize);
1830 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1831 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1832 anObj.SetParameters(Parameters)
1833 self._autoPublish(anObj, theName, "plane")
1836 ## Create a local coordinate system.
1837 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1838 # @param XDX,XDY,XDZ Three components of OX direction
1839 # @param YDX,YDY,YDZ Three components of OY direction
1840 # @param 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.
1844 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1846 # @ref swig_MakeMarker "Example"
1847 @ManageTransactions("BasicOp")
1848 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1850 Create a local coordinate system.
1853 OX,OY,OZ Three coordinates of coordinate system origin.
1854 XDX,XDY,XDZ Three components of OX direction
1855 YDX,YDY,YDZ Three components of OY direction
1856 theName Object name; when specified, this parameter is used
1857 for result publication in the study. Otherwise, if automatic
1858 publication is switched on, default value is used for result name.
1861 New GEOM.GEOM_Object, containing the created coordinate system.
1863 # Example: see GEOM_TestAll.py
1864 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1865 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1866 RaiseIfFailed("MakeMarker", self.BasicOp)
1867 anObj.SetParameters(Parameters)
1868 self._autoPublish(anObj, theName, "lcs")
1871 ## Create a local coordinate system from shape.
1872 # @param theShape The initial shape to detect the coordinate system.
1873 # @param theName Object name; when specified, this parameter is used
1874 # for result publication in the study. Otherwise, if automatic
1875 # publication is switched on, default value is used for result name.
1877 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1879 # @ref tui_creation_lcs "Example"
1880 @ManageTransactions("BasicOp")
1881 def MakeMarkerFromShape(self, theShape, theName=None):
1883 Create a local coordinate system from shape.
1886 theShape The initial shape to detect the coordinate system.
1887 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.
1892 New GEOM.GEOM_Object, containing the created coordinate system.
1894 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1895 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1896 self._autoPublish(anObj, theName, "lcs")
1899 ## Create a local coordinate system from point and two vectors.
1900 # @param theOrigin Point of coordinate system origin.
1901 # @param theXVec Vector of X direction
1902 # @param theYVec Vector of Y direction
1903 # @param 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.
1907 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1909 # @ref tui_creation_lcs "Example"
1910 @ManageTransactions("BasicOp")
1911 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1913 Create a local coordinate system from point and two vectors.
1916 theOrigin Point of coordinate system origin.
1917 theXVec Vector of X direction
1918 theYVec Vector of Y direction
1919 theName Object name; when specified, this parameter is used
1920 for result publication in the study. Otherwise, if automatic
1921 publication is switched on, default value is used for result name.
1924 New GEOM.GEOM_Object, containing the created coordinate system.
1927 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1928 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1929 self._autoPublish(anObj, theName, "lcs")
1932 # end of l3_basic_go
1935 ## @addtogroup l4_curves
1938 ## Create an arc of circle, passing through three given points.
1939 # @param thePnt1 Start point of the arc.
1940 # @param thePnt2 Middle point of the arc.
1941 # @param thePnt3 End point of the arc.
1942 # @param 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.
1946 # @return New GEOM.GEOM_Object, containing the created arc.
1948 # @ref swig_MakeArc "Example"
1949 @ManageTransactions("CurvesOp")
1950 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1952 Create an arc of circle, passing through three given points.
1955 thePnt1 Start point of the arc.
1956 thePnt2 Middle point of the arc.
1957 thePnt3 End point of the arc.
1958 theName Object name; when specified, this parameter is used
1959 for result publication in the study. Otherwise, if automatic
1960 publication is switched on, default value is used for result name.
1963 New GEOM.GEOM_Object, containing the created arc.
1965 # Example: see GEOM_TestAll.py
1966 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1967 RaiseIfFailed("MakeArc", self.CurvesOp)
1968 self._autoPublish(anObj, theName, "arc")
1971 ## Create an arc of circle from a center and 2 points.
1972 # @param thePnt1 Center of the arc
1973 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1974 # @param thePnt3 End point of the arc (Gives also a direction)
1975 # @param theSense Orientation of the arc
1976 # @param theName Object name; when specified, this parameter is used
1977 # for result publication in the study. Otherwise, if automatic
1978 # publication is switched on, default value is used for result name.
1980 # @return New GEOM.GEOM_Object, containing the created arc.
1982 # @ref swig_MakeArc "Example"
1983 @ManageTransactions("CurvesOp")
1984 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1986 Create an arc of circle from a center and 2 points.
1989 thePnt1 Center of the arc
1990 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1991 thePnt3 End point of the arc (Gives also a direction)
1992 theSense Orientation of the arc
1993 theName Object name; when specified, this parameter is used
1994 for result publication in the study. Otherwise, if automatic
1995 publication is switched on, default value is used for result name.
1998 New GEOM.GEOM_Object, containing the created arc.
2000 # Example: see GEOM_TestAll.py
2001 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2002 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2003 self._autoPublish(anObj, theName, "arc")
2006 ## Create an arc of ellipse, of center and two points.
2007 # @param theCenter Center of the arc.
2008 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2009 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2010 # @param 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.
2014 # @return New GEOM.GEOM_Object, containing the created arc.
2016 # @ref swig_MakeArc "Example"
2017 @ManageTransactions("CurvesOp")
2018 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2020 Create an arc of ellipse, of center and two points.
2023 theCenter Center of the arc.
2024 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2025 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2026 theName Object name; when specified, this parameter is used
2027 for result publication in the study. Otherwise, if automatic
2028 publication is switched on, default value is used for result name.
2031 New GEOM.GEOM_Object, containing the created arc.
2033 # Example: see GEOM_TestAll.py
2034 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2035 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2036 self._autoPublish(anObj, theName, "arc")
2039 ## Create a circle with given center, normal vector and radius.
2040 # @param thePnt Circle center.
2041 # @param theVec Vector, normal to the plane of the circle.
2042 # @param theR Circle radius.
2043 # @param 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.
2047 # @return New GEOM.GEOM_Object, containing the created circle.
2049 # @ref tui_creation_circle "Example"
2050 @ManageTransactions("CurvesOp")
2051 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2053 Create a circle with given center, normal vector and radius.
2056 thePnt Circle center.
2057 theVec Vector, normal to the plane of the circle.
2059 theName Object name; when specified, this parameter is used
2060 for result publication in the study. Otherwise, if automatic
2061 publication is switched on, default value is used for result name.
2064 New GEOM.GEOM_Object, containing the created circle.
2066 # Example: see GEOM_TestAll.py
2067 theR, Parameters = ParseParameters(theR)
2068 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2069 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2070 anObj.SetParameters(Parameters)
2071 self._autoPublish(anObj, theName, "circle")
2074 ## Create a circle with given radius.
2075 # Center of the circle will be in the origin of global
2076 # coordinate system and normal vector will be codirected with Z axis
2077 # @param theR Circle radius.
2078 # @param theName Object name; when specified, this parameter is used
2079 # for result publication in the study. Otherwise, if automatic
2080 # publication is switched on, default value is used for result name.
2082 # @return New GEOM.GEOM_Object, containing the created circle.
2083 @ManageTransactions("CurvesOp")
2084 def MakeCircleR(self, theR, theName=None):
2086 Create a circle with given radius.
2087 Center of the circle will be in the origin of global
2088 coordinate system and normal vector will be codirected with Z axis
2092 theName Object name; when specified, this parameter is used
2093 for result publication in the study. Otherwise, if automatic
2094 publication is switched on, default value is used for result name.
2097 New GEOM.GEOM_Object, containing the created circle.
2099 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2100 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2101 self._autoPublish(anObj, theName, "circle")
2104 ## Create a circle, passing through three given points
2105 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2106 # @param theName Object name; when specified, this parameter is used
2107 # for result publication in the study. Otherwise, if automatic
2108 # publication is switched on, default value is used for result name.
2110 # @return New GEOM.GEOM_Object, containing the created circle.
2112 # @ref tui_creation_circle "Example"
2113 @ManageTransactions("CurvesOp")
2114 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2116 Create a circle, passing through three given points
2119 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2120 theName Object name; when specified, this parameter is used
2121 for result publication in the study. Otherwise, if automatic
2122 publication is switched on, default value is used for result name.
2125 New GEOM.GEOM_Object, containing the created circle.
2127 # Example: see GEOM_TestAll.py
2128 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2129 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2130 self._autoPublish(anObj, theName, "circle")
2133 ## Create a circle, with given point1 as center,
2134 # passing through the point2 as radius and laying in the plane,
2135 # defined by all three given points.
2136 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2137 # @param 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.
2141 # @return New GEOM.GEOM_Object, containing the created circle.
2143 # @ref swig_MakeCircle "Example"
2144 @ManageTransactions("CurvesOp")
2145 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2147 Create a circle, with given point1 as center,
2148 passing through the point2 as radius and laying in the plane,
2149 defined by all three given points.
2152 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2153 theName Object name; when specified, this parameter is used
2154 for result publication in the study. Otherwise, if automatic
2155 publication is switched on, default value is used for result name.
2158 New GEOM.GEOM_Object, containing the created circle.
2160 # Example: see GEOM_example6.py
2161 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2162 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2163 self._autoPublish(anObj, theName, "circle")
2166 ## Create an ellipse with given center, normal vector and radiuses.
2167 # @param thePnt Ellipse center.
2168 # @param theVec Vector, normal to the plane of the ellipse.
2169 # @param theRMajor Major ellipse radius.
2170 # @param theRMinor Minor ellipse radius.
2171 # @param theVecMaj Vector, direction of the ellipse's main axis.
2172 # @param theName Object name; when specified, this parameter is used
2173 # for result publication in the study. Otherwise, if automatic
2174 # publication is switched on, default value is used for result name.
2176 # @return New GEOM.GEOM_Object, containing the created ellipse.
2178 # @ref tui_creation_ellipse "Example"
2179 @ManageTransactions("CurvesOp")
2180 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2182 Create an ellipse with given center, normal vector and radiuses.
2185 thePnt Ellipse center.
2186 theVec Vector, normal to the plane of the ellipse.
2187 theRMajor Major ellipse radius.
2188 theRMinor Minor ellipse radius.
2189 theVecMaj Vector, direction of the ellipse's main axis.
2190 theName Object name; when specified, this parameter is used
2191 for result publication in the study. Otherwise, if automatic
2192 publication is switched on, default value is used for result name.
2195 New GEOM.GEOM_Object, containing the created ellipse.
2197 # Example: see GEOM_TestAll.py
2198 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2199 if theVecMaj is not None:
2200 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2202 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2204 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2205 anObj.SetParameters(Parameters)
2206 self._autoPublish(anObj, theName, "ellipse")
2209 ## Create an ellipse with given radiuses.
2210 # Center of the ellipse will be in the origin of global
2211 # coordinate system and normal vector will be codirected with Z axis
2212 # @param theRMajor Major ellipse radius.
2213 # @param theRMinor Minor ellipse radius.
2214 # @param theName Object name; when specified, this parameter is used
2215 # for result publication in the study. Otherwise, if automatic
2216 # publication is switched on, default value is used for result name.
2218 # @return New GEOM.GEOM_Object, containing the created ellipse.
2219 @ManageTransactions("CurvesOp")
2220 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2222 Create an ellipse with given radiuses.
2223 Center of the ellipse will be in the origin of global
2224 coordinate system and normal vector will be codirected with Z axis
2227 theRMajor Major ellipse radius.
2228 theRMinor Minor ellipse radius.
2229 theName Object name; when specified, this parameter is used
2230 for result publication in the study. Otherwise, if automatic
2231 publication is switched on, default value is used for result name.
2234 New GEOM.GEOM_Object, containing the created ellipse.
2236 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2237 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2238 self._autoPublish(anObj, theName, "ellipse")
2241 ## Create a polyline on the set of points.
2242 # @param thePoints Sequence of points for the polyline.
2243 # @param theIsClosed If True, build a closed wire.
2244 # @param theName Object name; when specified, this parameter is used
2245 # for result publication in the study. Otherwise, if automatic
2246 # publication is switched on, default value is used for result name.
2248 # @return New GEOM.GEOM_Object, containing the created polyline.
2250 # @ref tui_creation_curve "Example"
2251 @ManageTransactions("CurvesOp")
2252 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2254 Create a polyline on the set of points.
2257 thePoints Sequence of points for the polyline.
2258 theIsClosed If True, build a closed wire.
2259 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.
2264 New GEOM.GEOM_Object, containing the created polyline.
2266 # Example: see GEOM_TestAll.py
2267 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2268 RaiseIfFailed("MakePolyline", self.CurvesOp)
2269 self._autoPublish(anObj, theName, "polyline")
2272 ## Create bezier curve on the set of points.
2273 # @param thePoints Sequence of points for the bezier curve.
2274 # @param theIsClosed If True, build a closed curve.
2275 # @param theName Object name; when specified, this parameter is used
2276 # for result publication in the study. Otherwise, if automatic
2277 # publication is switched on, default value is used for result name.
2279 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2281 # @ref tui_creation_curve "Example"
2282 @ManageTransactions("CurvesOp")
2283 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2285 Create bezier curve on the set of points.
2288 thePoints Sequence of points for the bezier curve.
2289 theIsClosed If True, build a closed curve.
2290 theName Object name; when specified, this parameter is used
2291 for result publication in the study. Otherwise, if automatic
2292 publication is switched on, default value is used for result name.
2295 New GEOM.GEOM_Object, containing the created bezier curve.
2297 # Example: see GEOM_TestAll.py
2298 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2299 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2300 self._autoPublish(anObj, theName, "bezier")
2303 ## Create B-Spline curve on the set of points.
2304 # @param thePoints Sequence of points for the B-Spline curve.
2305 # @param theIsClosed If True, build a closed curve.
2306 # @param theDoReordering If TRUE, the algo does not follow the order of
2307 # \a thePoints but searches for the closest vertex.
2308 # @param theName Object name; when specified, this parameter is used
2309 # for result publication in the study. Otherwise, if automatic
2310 # publication is switched on, default value is used for result name.
2312 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2314 # @ref tui_creation_curve "Example"
2315 @ManageTransactions("CurvesOp")
2316 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2318 Create B-Spline curve on the set of points.
2321 thePoints Sequence of points for the B-Spline curve.
2322 theIsClosed If True, build a closed curve.
2323 theDoReordering If True, the algo does not follow the order of
2324 thePoints but searches for the closest vertex.
2325 theName Object name; when specified, this parameter is used
2326 for result publication in the study. Otherwise, if automatic
2327 publication is switched on, default value is used for result name.
2330 New GEOM.GEOM_Object, containing the created B-Spline curve.
2332 # Example: see GEOM_TestAll.py
2333 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2334 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2335 self._autoPublish(anObj, theName, "bspline")
2338 ## Create B-Spline curve on the set of points.
2339 # @param thePoints Sequence of points for the B-Spline curve.
2340 # @param theFirstVec Vector object, defining the curve direction at its first point.
2341 # @param theLastVec Vector object, defining the curve direction at its last point.
2342 # @param 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.
2346 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2348 # @ref tui_creation_curve "Example"
2349 @ManageTransactions("CurvesOp")
2350 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2352 Create B-Spline curve on the set of points.
2355 thePoints Sequence of points for the B-Spline curve.
2356 theFirstVec Vector object, defining the curve direction at its first point.
2357 theLastVec Vector object, defining the curve direction at its last point.
2358 theName Object name; when specified, this parameter is used
2359 for result publication in the study. Otherwise, if automatic
2360 publication is switched on, default value is used for result name.
2363 New GEOM.GEOM_Object, containing the created B-Spline curve.
2365 # Example: see GEOM_TestAll.py
2366 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2367 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2368 self._autoPublish(anObj, theName, "bspline")
2371 ## Creates a curve using the parametric definition of the basic points.
2372 # @param thexExpr parametric equation of the coordinates X.
2373 # @param theyExpr parametric equation of the coordinates Y.
2374 # @param thezExpr parametric equation of the coordinates Z.
2375 # @param theParamMin the minimal value of the parameter.
2376 # @param theParamMax the maximum value of the parameter.
2377 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2378 # @param theCurveType the type of the curve,
2379 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2380 # @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.
2381 # @param theName Object name; when specified, this parameter is used
2382 # for result publication in the study. Otherwise, if automatic
2383 # publication is switched on, default value is used for result name.
2385 # @return New GEOM.GEOM_Object, containing the created curve.
2387 # @ref tui_creation_curve "Example"
2388 @ManageTransactions("CurvesOp")
2389 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2390 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2392 Creates a curve using the parametric definition of the basic points.
2395 thexExpr parametric equation of the coordinates X.
2396 theyExpr parametric equation of the coordinates Y.
2397 thezExpr parametric equation of the coordinates Z.
2398 theParamMin the minimal value of the parameter.
2399 theParamMax the maximum value of the parameter.
2400 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2401 theCurveType the type of the curve,
2402 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2403 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2404 method is used which can lead to a bug.
2405 theName Object name; when specified, this parameter is used
2406 for result publication in the study. Otherwise, if automatic
2407 publication is switched on, default value is used for result name.
2410 New GEOM.GEOM_Object, containing the created curve.
2412 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2414 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2416 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2417 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2418 anObj.SetParameters(Parameters)
2419 self._autoPublish(anObj, theName, "curve")
2422 ## Create an isoline curve on a face.
2423 # @param theFace the face for which an isoline is created.
2424 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2426 # @param theParameter the U parameter for U-isoline or V parameter
2428 # @param theName Object name; when specified, this parameter is used
2429 # for result publication in the study. Otherwise, if automatic
2430 # publication is switched on, default value is used for result name.
2432 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2433 # a compound of edges.
2435 # @ref tui_creation_curve "Example"
2436 @ManageTransactions("CurvesOp")
2437 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2439 Create an isoline curve on a face.
2442 theFace the face for which an isoline is created.
2443 IsUIsoline True for U-isoline creation; False for V-isoline
2445 theParameter the U parameter for U-isoline or V parameter
2447 theName Object name; when specified, this parameter is used
2448 for result publication in the study. Otherwise, if automatic
2449 publication is switched on, default value is used for result name.
2452 New GEOM.GEOM_Object, containing the created isoline edge or a
2455 # Example: see GEOM_TestAll.py
2456 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2457 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2459 self._autoPublish(anObj, theName, "U-Isoline")
2461 self._autoPublish(anObj, theName, "V-Isoline")
2467 ## @addtogroup l3_sketcher
2470 ## Create a sketcher (wire or face), following the textual description,
2471 # passed through <VAR>theCommand</VAR> argument. \n
2472 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2473 # Format of the description string have to be the following:
2475 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2478 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2480 # - "R angle" : Set the direction by angle
2481 # - "D dx dy" : Set the direction by DX & DY
2484 # - "TT x y" : Create segment by point at X & Y
2485 # - "T dx dy" : Create segment by point with DX & DY
2486 # - "L length" : Create segment by direction & Length
2487 # - "IX x" : Create segment by direction & Intersect. X
2488 # - "IY y" : Create segment by direction & Intersect. Y
2491 # - "C radius length" : Create arc by direction, radius and length(in degree)
2492 # - "AA x y": Create arc by point at X & Y
2493 # - "A dx dy" : Create arc by point with DX & DY
2494 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2495 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2496 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2497 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2500 # - "WW" : Close Wire (to finish)
2501 # - "WF" : Close Wire and build face (to finish)
2504 # - Flag1 (= reverse) is 0 or 2 ...
2505 # - if 0 the drawn arc is the one of lower angle (< Pi)
2506 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2509 # - Flag2 (= control tolerance) is 0 or 1 ...
2510 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2511 # - if 1 the wire is built only if the end point is on the arc
2512 # with a tolerance of 10^-7 on the distance else the creation fails
2514 # @param theCommand String, defining the sketcher in local
2515 # coordinates of the working plane.
2516 # @param theWorkingPlane Nine double values, defining origin,
2517 # OZ and OX directions of the working plane.
2518 # @param theName Object name; when specified, this parameter is used
2519 # for result publication in the study. Otherwise, if automatic
2520 # publication is switched on, default value is used for result name.
2522 # @return New GEOM.GEOM_Object, containing the created wire.
2524 # @ref tui_sketcher_page "Example"
2525 @ManageTransactions("CurvesOp")
2526 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2528 Create a sketcher (wire or face), following the textual description, passed
2529 through theCommand argument.
2530 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2531 Format of the description string have to be the following:
2532 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2534 - x1, y1 are coordinates of the first sketcher point (zero by default),
2536 - "R angle" : Set the direction by angle
2537 - "D dx dy" : Set the direction by DX & DY
2539 - "TT x y" : Create segment by point at X & Y
2540 - "T dx dy" : Create segment by point with DX & DY
2541 - "L length" : Create segment by direction & Length
2542 - "IX x" : Create segment by direction & Intersect. X
2543 - "IY y" : Create segment by direction & Intersect. Y
2545 - "C radius length" : Create arc by direction, radius and length(in degree)
2546 - "AA x y": Create arc by point at X & Y
2547 - "A dx dy" : Create arc by point with DX & DY
2548 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2549 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2550 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2551 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2553 - "WW" : Close Wire (to finish)
2554 - "WF" : Close Wire and build face (to finish)
2556 - Flag1 (= reverse) is 0 or 2 ...
2557 - if 0 the drawn arc is the one of lower angle (< Pi)
2558 - if 2 the drawn arc ius the one of greater angle (> Pi)
2560 - Flag2 (= control tolerance) is 0 or 1 ...
2561 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2562 - if 1 the wire is built only if the end point is on the arc
2563 with a tolerance of 10^-7 on the distance else the creation fails
2566 theCommand String, defining the sketcher in local
2567 coordinates of the working plane.
2568 theWorkingPlane Nine double values, defining origin,
2569 OZ and OX directions of the working plane.
2570 theName Object name; when specified, this parameter is used
2571 for result publication in the study. Otherwise, if automatic
2572 publication is switched on, default value is used for result name.
2575 New GEOM.GEOM_Object, containing the created wire.
2577 # Example: see GEOM_TestAll.py
2578 theCommand,Parameters = ParseSketcherCommand(theCommand)
2579 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2580 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2581 anObj.SetParameters(Parameters)
2582 self._autoPublish(anObj, theName, "wire")
2585 ## Create a sketcher (wire or face), following the textual description,
2586 # passed through <VAR>theCommand</VAR> argument. \n
2587 # For format of the description string see MakeSketcher() method.\n
2588 # @param theCommand String, defining the sketcher in local
2589 # coordinates of the working plane.
2590 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2591 # @param theName Object name; when specified, this parameter is used
2592 # for result publication in the study. Otherwise, if automatic
2593 # publication is switched on, default value is used for result name.
2595 # @return New GEOM.GEOM_Object, containing the created wire.
2597 # @ref tui_sketcher_page "Example"
2598 @ManageTransactions("CurvesOp")
2599 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2601 Create a sketcher (wire or face), following the textual description,
2602 passed through theCommand argument.
2603 For format of the description string see geompy.MakeSketcher() method.
2606 theCommand String, defining the sketcher in local
2607 coordinates of the working plane.
2608 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2609 theName Object name; when specified, this parameter is used
2610 for result publication in the study. Otherwise, if automatic
2611 publication is switched on, default value is used for result name.
2614 New GEOM.GEOM_Object, containing the created wire.
2616 theCommand,Parameters = ParseSketcherCommand(theCommand)
2617 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2618 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2619 anObj.SetParameters(Parameters)
2620 self._autoPublish(anObj, theName, "wire")
2623 ## Obtain a 2D sketcher interface
2624 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2625 def Sketcher2D (self):
2627 Obtain a 2D sketcher interface.
2630 sk = geompy.Sketcher2D()
2632 sk.addSegmentRelative(15, 70)
2633 sk.addSegmentPerpY(50)
2634 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2635 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2636 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2638 Sketch_1 = sk.wire(geomObj_1)
2640 sk = Sketcher2D (self)
2643 ## Create a sketcher wire, following the numerical description,
2644 # passed through <VAR>theCoordinates</VAR> argument. \n
2645 # @param theCoordinates double values, defining points to create a wire,
2647 # @param 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.
2651 # @return New GEOM.GEOM_Object, containing the created wire.
2653 # @ref tui_3dsketcher_page "Example"
2654 @ManageTransactions("CurvesOp")
2655 def Make3DSketcher(self, theCoordinates, theName=None):
2657 Create a sketcher wire, following the numerical description,
2658 passed through theCoordinates argument.
2661 theCoordinates double values, defining points to create a wire,
2663 theName Object name; when specified, this parameter is used
2664 for result publication in the study. Otherwise, if automatic
2665 publication is switched on, default value is used for result name.
2668 New GEOM_Object, containing the created wire.
2670 theCoordinates,Parameters = ParseParameters(theCoordinates)
2671 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2672 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2673 anObj.SetParameters(Parameters)
2674 self._autoPublish(anObj, theName, "wire")
2677 ## Obtain a 3D sketcher interface
2678 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2680 # @ref tui_3dsketcher_page "Example"
2681 def Sketcher3D (self):
2683 Obtain a 3D sketcher interface.
2686 sk = geompy.Sketcher3D()
2687 sk.addPointsAbsolute(0,0,0, 70,0,0)
2688 sk.addPointsRelative(0, 0, 130)
2689 sk.addPointAnglesLength("OXY", 50, 0, 100)
2690 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2692 a3D_Sketcher_1 = sk.wire()
2694 sk = Sketcher3D (self)
2697 ## Obtain a 2D polyline creation interface
2698 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2700 # @ref tui_3dsketcher_page "Example"
2701 def Polyline2D (self):
2703 Obtain a 2D polyline creation interface.
2706 pl = geompy.Polyline2D()
2707 pl.addSection("section 1", GEOM.Polyline, True)
2708 pl.addPoints(0, 0, 10, 0, 10, 10)
2709 pl.addSection("section 2", GEOM.Interpolation, False)
2710 pl.addPoints(20, 0, 30, 0, 30, 10)
2711 resultObj = pl.result(WorkingPlane)
2713 pl = Polyline2D (self)
2716 # end of l3_sketcher
2719 ## @addtogroup l3_3d_primitives
2722 ## Create a box by coordinates of two opposite vertices.
2724 # @param x1,y1,z1 double values, defining first point it.
2725 # @param x2,y2,z2 double values, defining first point it.
2726 # @param theName Object name; when specified, this parameter is used
2727 # for result publication in the study. Otherwise, if automatic
2728 # publication is switched on, default value is used for result name.
2730 # @return New GEOM.GEOM_Object, containing the created box.
2732 # @ref tui_creation_box "Example"
2733 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2735 Create a box by coordinates of two opposite vertices.
2738 x1,y1,z1 double values, defining first point.
2739 x2,y2,z2 double values, defining second point.
2740 theName Object name; when specified, this parameter is used
2741 for result publication in the study. Otherwise, if automatic
2742 publication is switched on, default value is used for result name.
2745 New GEOM.GEOM_Object, containing the created box.
2747 # Example: see GEOM_TestAll.py
2748 pnt1 = self.MakeVertex(x1,y1,z1)
2749 pnt2 = self.MakeVertex(x2,y2,z2)
2750 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2751 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
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).
2756 # @param theDX Length of Box edges, parallel to OX axis.
2757 # @param theDY Length of Box edges, parallel to OY axis.
2758 # @param theDZ Length of Box edges, parallel to OZ axis.
2759 # @param theName Object name; when specified, this parameter is used
2760 # for result publication in the study. Otherwise, if automatic
2761 # publication is switched on, default value is used for result name.
2763 # @return New GEOM.GEOM_Object, containing the created box.
2765 # @ref tui_creation_box "Example"
2766 @ManageTransactions("PrimOp")
2767 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2769 Create a box with specified dimensions along the coordinate axes
2770 and with edges, parallel to the coordinate axes.
2771 Center of the box will be at point (DX/2, DY/2, DZ/2).
2774 theDX Length of Box edges, parallel to OX axis.
2775 theDY Length of Box edges, parallel to OY axis.
2776 theDZ Length of Box edges, parallel to OZ axis.
2777 theName Object name; when specified, this parameter is used
2778 for result publication in the study. Otherwise, if automatic
2779 publication is switched on, default value is used for result name.
2782 New GEOM.GEOM_Object, containing the created box.
2784 # Example: see GEOM_TestAll.py
2785 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2786 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2787 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2788 anObj.SetParameters(Parameters)
2789 self._autoPublish(anObj, theName, "box")
2792 ## Create a box with two specified opposite vertices,
2793 # and with edges, parallel to the coordinate axes
2794 # @param thePnt1 First of two opposite vertices.
2795 # @param thePnt2 Second of two opposite vertices.
2796 # @param 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.
2800 # @return New GEOM.GEOM_Object, containing the created box.
2802 # @ref tui_creation_box "Example"
2803 @ManageTransactions("PrimOp")
2804 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2806 Create a box with two specified opposite vertices,
2807 and with edges, parallel to the coordinate axes
2810 thePnt1 First of two opposite vertices.
2811 thePnt2 Second of two opposite vertices.
2812 theName Object name; when specified, this parameter is used
2813 for result publication in the study. Otherwise, if automatic
2814 publication is switched on, default value is used for result name.
2817 New GEOM.GEOM_Object, containing the created box.
2819 # Example: see GEOM_TestAll.py
2820 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2821 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2822 self._autoPublish(anObj, theName, "box")
2825 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2826 # @param theH height of Face.
2827 # @param theW width of Face.
2828 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2829 # @param 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.
2833 # @return New GEOM.GEOM_Object, containing the created face.
2835 # @ref tui_creation_face "Example"
2836 @ManageTransactions("PrimOp")
2837 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2839 Create a face with specified dimensions with edges parallel to coordinate axes.
2842 theH height of Face.
2844 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2845 theName Object name; when specified, this parameter is used
2846 for result publication in the study. Otherwise, if automatic
2847 publication is switched on, default value is used for result name.
2850 New GEOM.GEOM_Object, containing the created face.
2852 # Example: see GEOM_TestAll.py
2853 theH,theW,Parameters = ParseParameters(theH, theW)
2854 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2855 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2856 anObj.SetParameters(Parameters)
2857 self._autoPublish(anObj, theName, "rectangle")
2860 ## Create a face from another plane and two sizes,
2861 # vertical size and horisontal size.
2862 # @param theObj Normale vector to the creating face or
2864 # @param theH Height (vertical size).
2865 # @param theW Width (horisontal size).
2866 # @param theName Object name; when specified, this parameter is used
2867 # for result publication in the study. Otherwise, if automatic
2868 # publication is switched on, default value is used for result name.
2870 # @return New GEOM.GEOM_Object, containing the created face.
2872 # @ref tui_creation_face "Example"
2873 @ManageTransactions("PrimOp")
2874 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2876 Create a face from another plane and two sizes,
2877 vertical size and horisontal size.
2880 theObj Normale vector to the creating face or
2882 theH Height (vertical size).
2883 theW Width (horisontal size).
2884 theName Object name; when specified, this parameter is used
2885 for result publication in the study. Otherwise, if automatic
2886 publication is switched on, default value is used for result name.
2889 New GEOM_Object, containing the created face.
2891 # Example: see GEOM_TestAll.py
2892 theH,theW,Parameters = ParseParameters(theH, theW)
2893 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2894 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2895 anObj.SetParameters(Parameters)
2896 self._autoPublish(anObj, theName, "rectangle")
2899 ## Create a disk with given center, normal vector and radius.
2900 # @param thePnt Disk center.
2901 # @param theVec Vector, normal to the plane of the disk.
2902 # @param theR Disk radius.
2903 # @param 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.
2907 # @return New GEOM.GEOM_Object, containing the created disk.
2909 # @ref tui_creation_disk "Example"
2910 @ManageTransactions("PrimOp")
2911 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2913 Create a disk with given center, normal vector and radius.
2917 theVec Vector, normal to the plane of the disk.
2919 theName Object name; when specified, this parameter is used
2920 for result publication in the study. Otherwise, if automatic
2921 publication is switched on, default value is used for result name.
2924 New GEOM.GEOM_Object, containing the created disk.
2926 # Example: see GEOM_TestAll.py
2927 theR,Parameters = ParseParameters(theR)
2928 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2929 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2930 anObj.SetParameters(Parameters)
2931 self._autoPublish(anObj, theName, "disk")
2934 ## Create a disk, passing through three given points
2935 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2936 # @param theName Object name; when specified, this parameter is used
2937 # for result publication in the study. Otherwise, if automatic
2938 # publication is switched on, default value is used for result name.
2940 # @return New GEOM.GEOM_Object, containing the created disk.
2942 # @ref tui_creation_disk "Example"
2943 @ManageTransactions("PrimOp")
2944 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2946 Create a disk, passing through three given points
2949 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2950 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.
2955 New GEOM.GEOM_Object, containing the created disk.
2957 # Example: see GEOM_TestAll.py
2958 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2959 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2960 self._autoPublish(anObj, theName, "disk")
2963 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2964 # @param theR Radius of Face.
2965 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2966 # @param theName Object name; when specified, this parameter is used
2967 # for result publication in the study. Otherwise, if automatic
2968 # publication is switched on, default value is used for result name.
2970 # @return New GEOM.GEOM_Object, containing the created disk.
2972 # @ref tui_creation_face "Example"
2973 @ManageTransactions("PrimOp")
2974 def MakeDiskR(self, theR, theOrientation, theName=None):
2976 Create a disk with specified dimensions along OX-OY coordinate axes.
2979 theR Radius of Face.
2980 theOrientation set the orientation belong axis OXY or OYZ or OZX
2981 theName Object name; when specified, this parameter is used
2982 for result publication in the study. Otherwise, if automatic
2983 publication is switched on, default value is used for result name.
2986 New GEOM.GEOM_Object, containing the created disk.
2989 Disk3 = geompy.MakeDiskR(100., 1)
2991 # Example: see GEOM_TestAll.py
2992 theR,Parameters = ParseParameters(theR)
2993 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2994 RaiseIfFailed("MakeDiskR", self.PrimOp)
2995 anObj.SetParameters(Parameters)
2996 self._autoPublish(anObj, theName, "disk")
2999 ## Create a cylinder with given base point, axis, radius and height.
3000 # @param thePnt Central point of cylinder base.
3001 # @param theAxis Cylinder axis.
3002 # @param theR Cylinder radius.
3003 # @param theH Cylinder height.
3004 # @param theName Object name; when specified, this parameter is used
3005 # for result publication in the study. Otherwise, if automatic
3006 # publication is switched on, default value is used for result name.
3008 # @return New GEOM.GEOM_Object, containing the created cylinder.
3010 # @ref tui_creation_cylinder "Example"
3011 @ManageTransactions("PrimOp")
3012 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3014 Create a cylinder with given base point, axis, radius and height.
3017 thePnt Central point of cylinder base.
3018 theAxis Cylinder axis.
3019 theR Cylinder radius.
3020 theH Cylinder height.
3021 theName Object name; when specified, this parameter is used
3022 for result publication in the study. Otherwise, if automatic
3023 publication is switched on, default value is used for result name.
3026 New GEOM.GEOM_Object, containing the created cylinder.
3028 # Example: see GEOM_TestAll.py
3029 theR,theH,Parameters = ParseParameters(theR, theH)
3030 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3031 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3032 anObj.SetParameters(Parameters)
3033 self._autoPublish(anObj, theName, "cylinder")
3036 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3037 # @param thePnt Central point of cylinder base.
3038 # @param theAxis Cylinder axis.
3039 # @param theR Cylinder radius.
3040 # @param theH Cylinder height.
3041 # @param theA Cylinder angle in radians.
3042 # @param theName Object name; when specified, this parameter is used
3043 # for result publication in the study. Otherwise, if automatic
3044 # publication is switched on, default value is used for result name.
3046 # @return New GEOM.GEOM_Object, containing the created cylinder.
3048 # @ref tui_creation_cylinder "Example"
3049 @ManageTransactions("PrimOp")
3050 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3052 Create a portion of cylinder with given base point, axis, radius, height and angle.
3055 thePnt Central point of cylinder base.
3056 theAxis Cylinder axis.
3057 theR Cylinder radius.
3058 theH Cylinder height.
3059 theA Cylinder angle in radians.
3060 theName Object name; when specified, this parameter is used
3061 for result publication in the study. Otherwise, if automatic
3062 publication is switched on, default value is used for result name.
3065 New GEOM.GEOM_Object, containing the created cylinder.
3067 # Example: see GEOM_TestAll.py
3069 if isinstance(theA,str):
3071 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3073 theA = theA*math.pi/180.
3074 if theA<=0. or theA>=2*math.pi:
3075 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3076 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3077 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3078 anObj.SetParameters(Parameters)
3079 self._autoPublish(anObj, theName, "cylinder")
3082 ## Create a cylinder with given radius and height at
3083 # the origin of coordinate system. Axis of the cylinder
3084 # will be collinear to the OZ axis of the coordinate system.
3085 # @param theR Cylinder radius.
3086 # @param theH Cylinder height.
3087 # @param theName Object name; when specified, this parameter is used
3088 # for result publication in the study. Otherwise, if automatic
3089 # publication is switched on, default value is used for result name.
3091 # @return New GEOM.GEOM_Object, containing the created cylinder.
3093 # @ref tui_creation_cylinder "Example"
3094 @ManageTransactions("PrimOp")
3095 def MakeCylinderRH(self, theR, theH, theName=None):
3097 Create a cylinder with given radius and height at
3098 the origin of coordinate system. Axis of the cylinder
3099 will be collinear to the OZ axis of the coordinate system.
3102 theR Cylinder radius.
3103 theH Cylinder height.
3104 theName Object name; when specified, this parameter is used
3105 for result publication in the study. Otherwise, if automatic
3106 publication is switched on, default value is used for result name.
3109 New GEOM.GEOM_Object, containing the created cylinder.
3111 # Example: see GEOM_TestAll.py
3112 theR,theH,Parameters = ParseParameters(theR, theH)
3113 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3114 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3115 anObj.SetParameters(Parameters)
3116 self._autoPublish(anObj, theName, "cylinder")
3119 ## Create a portion of cylinder with given radius, height and angle at
3120 # the origin of coordinate system. Axis of the cylinder
3121 # will be collinear to the OZ axis of the coordinate system.
3122 # @param theR Cylinder radius.
3123 # @param theH Cylinder height.
3124 # @param theA Cylinder angle in radians.
3125 # @param 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.
3129 # @return New GEOM.GEOM_Object, containing the created cylinder.
3131 # @ref tui_creation_cylinder "Example"
3132 @ManageTransactions("PrimOp")
3133 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3135 Create a portion of cylinder with given radius, height and angle at
3136 the origin of coordinate system. Axis of the cylinder
3137 will be collinear to the OZ axis of the coordinate system.
3140 theR Cylinder radius.
3141 theH Cylinder height.
3142 theA Cylinder angle in radians.
3143 theName Object name; when specified, this parameter is used
3144 for result publication in the study. Otherwise, if automatic
3145 publication is switched on, default value is used for result name.
3148 New GEOM.GEOM_Object, containing the created cylinder.
3150 # Example: see GEOM_TestAll.py
3152 if isinstance(theA,str):
3154 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3156 theA = theA*math.pi/180.
3157 if theA<=0. or theA>=2*math.pi:
3158 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3159 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3160 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3161 anObj.SetParameters(Parameters)
3162 self._autoPublish(anObj, theName, "cylinder")
3165 ## Create a sphere with given center and radius.
3166 # @param thePnt Sphere center.
3167 # @param theR Sphere radius.
3168 # @param theName Object name; when specified, this parameter is used
3169 # for result publication in the study. Otherwise, if automatic
3170 # publication is switched on, default value is used for result name.
3172 # @return New GEOM.GEOM_Object, containing the created sphere.
3174 # @ref tui_creation_sphere "Example"
3175 @ManageTransactions("PrimOp")
3176 def MakeSpherePntR(self, thePnt, theR, theName=None):
3178 Create a sphere with given center and radius.
3181 thePnt Sphere center.
3183 theName Object name; when specified, this parameter is used
3184 for result publication in the study. Otherwise, if automatic
3185 publication is switched on, default value is used for result name.
3188 New GEOM.GEOM_Object, containing the created sphere.
3190 # Example: see GEOM_TestAll.py
3191 theR,Parameters = ParseParameters(theR)
3192 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3193 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3194 anObj.SetParameters(Parameters)
3195 self._autoPublish(anObj, theName, "sphere")
3198 ## Create a sphere with given center and radius.
3199 # @param x,y,z Coordinates of sphere center.
3200 # @param theR Sphere radius.
3201 # @param theName Object name; when specified, this parameter is used
3202 # for result publication in the study. Otherwise, if automatic
3203 # publication is switched on, default value is used for result name.
3205 # @return New GEOM.GEOM_Object, containing the created sphere.
3207 # @ref tui_creation_sphere "Example"
3208 def MakeSphere(self, x, y, z, theR, theName=None):
3210 Create a sphere with given center and radius.
3213 x,y,z Coordinates of sphere center.
3215 theName Object name; when specified, this parameter is used
3216 for result publication in the study. Otherwise, if automatic
3217 publication is switched on, default value is used for result name.
3220 New GEOM.GEOM_Object, containing the created sphere.
3222 # Example: see GEOM_TestAll.py
3223 point = self.MakeVertex(x, y, z)
3224 # note: auto-publishing is done in self.MakeSpherePntR()
3225 anObj = self.MakeSpherePntR(point, theR, theName)
3228 ## Create a sphere with given radius at the origin of coordinate system.
3229 # @param theR Sphere radius.
3230 # @param theName Object name; when specified, this parameter is used
3231 # for result publication in the study. Otherwise, if automatic
3232 # publication is switched on, default value is used for result name.
3234 # @return New GEOM.GEOM_Object, containing the created sphere.
3236 # @ref tui_creation_sphere "Example"
3237 @ManageTransactions("PrimOp")
3238 def MakeSphereR(self, theR, theName=None):
3240 Create a sphere with given radius at the origin of coordinate system.
3244 theName Object name; when specified, this parameter is used
3245 for result publication in the study. Otherwise, if automatic
3246 publication is switched on, default value is used for result name.
3249 New GEOM.GEOM_Object, containing the created sphere.
3251 # Example: see GEOM_TestAll.py
3252 theR,Parameters = ParseParameters(theR)
3253 anObj = self.PrimOp.MakeSphereR(theR)
3254 RaiseIfFailed("MakeSphereR", self.PrimOp)
3255 anObj.SetParameters(Parameters)
3256 self._autoPublish(anObj, theName, "sphere")
3259 ## Create a cone with given base point, axis, height and radiuses.
3260 # @param thePnt Central point of the first cone base.
3261 # @param theAxis Cone axis.
3262 # @param theR1 Radius of the first cone base.
3263 # @param theR2 Radius of the second cone base.
3264 # \note If both radiuses are non-zero, the cone will be truncated.
3265 # \note If the radiuses are equal, a cylinder will be created instead.
3266 # @param theH Cone height.
3267 # @param theName Object name; when specified, this parameter is used
3268 # for result publication in the study. Otherwise, if automatic
3269 # publication is switched on, default value is used for result name.
3271 # @return New GEOM.GEOM_Object, containing the created cone.
3273 # @ref tui_creation_cone "Example"
3274 @ManageTransactions("PrimOp")
3275 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3277 Create a cone with given base point, axis, height and radiuses.
3280 thePnt Central point of the first cone base.
3282 theR1 Radius of the first cone base.
3283 theR2 Radius of the second cone base.
3285 theName Object name; when specified, this parameter is used
3286 for result publication in the study. Otherwise, if automatic
3287 publication is switched on, default value is used for result name.
3290 If both radiuses are non-zero, the cone will be truncated.
3291 If the radiuses are equal, a cylinder will be created instead.
3294 New GEOM.GEOM_Object, containing the created cone.
3296 # Example: see GEOM_TestAll.py
3297 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3298 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3299 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3300 anObj.SetParameters(Parameters)
3301 self._autoPublish(anObj, theName, "cone")
3304 ## Create a cone with given height and radiuses at
3305 # the origin of coordinate system. Axis of the cone will
3306 # be collinear to the OZ axis of the coordinate system.
3307 # @param theR1 Radius of the first cone base.
3308 # @param theR2 Radius of the second cone base.
3309 # \note If both radiuses are non-zero, the cone will be truncated.
3310 # \note If the radiuses are equal, a cylinder will be created instead.
3311 # @param theH Cone height.
3312 # @param theName Object name; when specified, this parameter is used
3313 # for result publication in the study. Otherwise, if automatic
3314 # publication is switched on, default value is used for result name.
3316 # @return New GEOM.GEOM_Object, containing the created cone.
3318 # @ref tui_creation_cone "Example"
3319 @ManageTransactions("PrimOp")
3320 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3322 Create a cone with given height and radiuses at
3323 the origin of coordinate system. Axis of the cone will
3324 be collinear to the OZ axis of the coordinate system.
3327 theR1 Radius of the first cone base.
3328 theR2 Radius of the second cone base.
3330 theName Object name; when specified, this parameter is used
3331 for result publication in the study. Otherwise, if automatic
3332 publication is switched on, default value is used for result name.
3335 If both radiuses are non-zero, the cone will be truncated.
3336 If the radiuses are equal, a cylinder will be created instead.
3339 New GEOM.GEOM_Object, containing the created cone.
3341 # Example: see GEOM_TestAll.py
3342 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3343 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3344 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3345 anObj.SetParameters(Parameters)
3346 self._autoPublish(anObj, theName, "cone")
3349 ## Create a torus with given center, normal vector and radiuses.
3350 # @param thePnt Torus central point.
3351 # @param theVec Torus axis of symmetry.
3352 # @param theRMajor Torus major radius.
3353 # @param theRMinor Torus minor radius.
3354 # @param theName Object name; when specified, this parameter is used
3355 # for result publication in the study. Otherwise, if automatic
3356 # publication is switched on, default value is used for result name.
3358 # @return New GEOM.GEOM_Object, containing the created torus.
3360 # @ref tui_creation_torus "Example"
3361 @ManageTransactions("PrimOp")
3362 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3364 Create a torus with given center, normal vector and radiuses.
3367 thePnt Torus central point.
3368 theVec Torus axis of symmetry.
3369 theRMajor Torus major radius.
3370 theRMinor Torus minor radius.
3371 theName Object name; when specified, this parameter is used
3372 for result publication in the study. Otherwise, if automatic
3373 publication is switched on, default value is used for result name.
3376 New GEOM.GEOM_Object, containing the created torus.
3378 # Example: see GEOM_TestAll.py
3379 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3380 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3381 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3382 anObj.SetParameters(Parameters)
3383 self._autoPublish(anObj, theName, "torus")
3386 ## Create a torus with given radiuses at the origin of coordinate system.
3387 # @param theRMajor Torus major radius.
3388 # @param theRMinor Torus minor radius.
3389 # @param theName Object name; when specified, this parameter is used
3390 # for result publication in the study. Otherwise, if automatic
3391 # publication is switched on, default value is used for result name.
3393 # @return New GEOM.GEOM_Object, containing the created torus.
3395 # @ref tui_creation_torus "Example"
3396 @ManageTransactions("PrimOp")
3397 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3399 Create a torus with given radiuses at the origin of coordinate system.
3402 theRMajor Torus major radius.
3403 theRMinor Torus minor radius.
3404 theName Object name; when specified, this parameter is used
3405 for result publication in the study. Otherwise, if automatic
3406 publication is switched on, default value is used for result name.
3409 New GEOM.GEOM_Object, containing the created torus.
3411 # Example: see GEOM_TestAll.py
3412 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3413 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3414 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3415 anObj.SetParameters(Parameters)
3416 self._autoPublish(anObj, theName, "torus")
3419 # end of l3_3d_primitives
3422 ## @addtogroup l3_complex
3425 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3426 # @param theBase Base shape to be extruded.
3427 # @param thePoint1 First end of extrusion vector.
3428 # @param thePoint2 Second end of extrusion vector.
3429 # @param theScaleFactor Use it to make prism with scaled second base.
3430 # Nagative value means not scaled second base.
3431 # @param theName Object name; when specified, this parameter is used
3432 # for result publication in the study. Otherwise, if automatic
3433 # publication is switched on, default value is used for result name.
3435 # @return New GEOM.GEOM_Object, containing the created prism.
3437 # @ref tui_creation_prism "Example"
3438 @ManageTransactions("PrimOp")
3439 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3441 Create a shape by extrusion of the base shape along a vector, defined by two points.
3444 theBase Base shape to be extruded.
3445 thePoint1 First end of extrusion vector.
3446 thePoint2 Second end of extrusion vector.
3447 theScaleFactor Use it to make prism with scaled second base.
3448 Nagative value means not scaled second base.
3449 theName Object name; when specified, this parameter is used
3450 for result publication in the study. Otherwise, if automatic
3451 publication is switched on, default value is used for result name.
3454 New GEOM.GEOM_Object, containing the created prism.
3456 # Example: see GEOM_TestAll.py
3459 if theScaleFactor > 0:
3460 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3461 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3463 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3464 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3465 anObj.SetParameters(Parameters)
3466 self._autoPublish(anObj, theName, "prism")
3469 ## Create a shape by extrusion of the base shape along a
3470 # vector, defined by two points, in 2 Ways (forward/backward).
3471 # @param theBase Base shape to be extruded.
3472 # @param thePoint1 First end of extrusion vector.
3473 # @param thePoint2 Second end of extrusion vector.
3474 # @param theName Object name; when specified, this parameter is used
3475 # for result publication in the study. Otherwise, if automatic
3476 # publication is switched on, default value is used for result name.
3478 # @return New GEOM.GEOM_Object, containing the created prism.
3480 # @ref tui_creation_prism "Example"
3481 @ManageTransactions("PrimOp")
3482 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3484 Create a shape by extrusion of the base shape along a
3485 vector, defined by two points, in 2 Ways (forward/backward).
3488 theBase Base shape to be extruded.
3489 thePoint1 First end of extrusion vector.
3490 thePoint2 Second end of extrusion vector.
3491 theName Object name; when specified, this parameter is used
3492 for result publication in the study. Otherwise, if automatic
3493 publication is switched on, default value is used for result name.
3496 New GEOM.GEOM_Object, containing the created prism.
3498 # Example: see GEOM_TestAll.py
3499 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3500 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3501 self._autoPublish(anObj, theName, "prism")
3504 ## Create a shape by extrusion of the base shape along the vector,
3505 # i.e. all the space, transfixed by the base shape during its translation
3506 # along the vector on the given distance.
3507 # @param theBase Base shape to be extruded.
3508 # @param theVec Direction of extrusion.
3509 # @param theH Prism dimension along theVec.
3510 # @param theScaleFactor Use it to make prism with scaled second base.
3511 # Negative value means not scaled second base.
3512 # @param 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.
3516 # @return New GEOM.GEOM_Object, containing the created prism.
3518 # @ref tui_creation_prism "Example"
3519 @ManageTransactions("PrimOp")
3520 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3522 Create a shape by extrusion of the base shape along the vector,
3523 i.e. all the space, transfixed by the base shape during its translation
3524 along the vector on the given distance.
3527 theBase Base shape to be extruded.
3528 theVec Direction of extrusion.
3529 theH Prism dimension along theVec.
3530 theScaleFactor Use it to make prism with scaled second base.
3531 Negative value means not scaled second base.
3532 theName Object name; when specified, this parameter is used
3533 for result publication in the study. Otherwise, if automatic
3534 publication is switched on, default value is used for result name.
3537 New GEOM.GEOM_Object, containing the created prism.
3539 # Example: see GEOM_TestAll.py
3542 if theScaleFactor > 0:
3543 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3544 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3546 theH,Parameters = ParseParameters(theH)
3547 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3548 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3549 anObj.SetParameters(Parameters)
3550 self._autoPublish(anObj, theName, "prism")
3553 ## Create a shape by extrusion of the base shape along the vector,
3554 # i.e. all the space, transfixed by the base shape during its translation
3555 # along the vector on the given distance in 2 Ways (forward/backward).
3556 # @param theBase Base shape to be extruded.
3557 # @param theVec Direction of extrusion.
3558 # @param theH Prism dimension along theVec in forward direction.
3559 # @param theName Object name; when specified, this parameter is used
3560 # for result publication in the study. Otherwise, if automatic
3561 # publication is switched on, default value is used for result name.
3563 # @return New GEOM.GEOM_Object, containing the created prism.
3565 # @ref tui_creation_prism "Example"
3566 @ManageTransactions("PrimOp")
3567 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3569 Create a shape by extrusion of the base shape along the vector,
3570 i.e. all the space, transfixed by the base shape during its translation
3571 along the vector on the given distance in 2 Ways (forward/backward).
3574 theBase Base shape to be extruded.
3575 theVec Direction of extrusion.
3576 theH Prism dimension along theVec in forward direction.
3577 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.
3582 New GEOM.GEOM_Object, containing the created prism.
3584 # Example: see GEOM_TestAll.py
3585 theH,Parameters = ParseParameters(theH)
3586 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3587 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3588 anObj.SetParameters(Parameters)
3589 self._autoPublish(anObj, theName, "prism")
3592 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3593 # @param theBase Base shape to be extruded.
3594 # @param theDX, theDY, theDZ Directions of extrusion.
3595 # @param theScaleFactor Use it to make prism with scaled second base.
3596 # Nagative value means not scaled second base.
3597 # @param theName Object name; when specified, this parameter is used
3598 # for result publication in the study. Otherwise, if automatic
3599 # publication is switched on, default value is used for result name.
3601 # @return New GEOM.GEOM_Object, containing the created prism.
3603 # @ref tui_creation_prism "Example"
3604 @ManageTransactions("PrimOp")
3605 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3607 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3610 theBase Base shape to be extruded.
3611 theDX, theDY, theDZ Directions of extrusion.
3612 theScaleFactor Use it to make prism with scaled second base.
3613 Nagative value means not scaled second base.
3614 theName Object name; when specified, this parameter is used
3615 for result publication in the study. Otherwise, if automatic
3616 publication is switched on, default value is used for result name.
3619 New GEOM.GEOM_Object, containing the created prism.
3621 # Example: see GEOM_TestAll.py
3624 if theScaleFactor > 0:
3625 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3626 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3628 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3629 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3630 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3631 anObj.SetParameters(Parameters)
3632 self._autoPublish(anObj, theName, "prism")
3635 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3636 # i.e. all the space, transfixed by the base shape during its translation
3637 # along the vector on the given distance in 2 Ways (forward/backward).
3638 # @param theBase Base shape to be extruded.
3639 # @param theDX, theDY, theDZ Directions of extrusion.
3640 # @param theName Object name; when specified, this parameter is used
3641 # for result publication in the study. Otherwise, if automatic
3642 # publication is switched on, default value is used for result name.
3644 # @return New GEOM.GEOM_Object, containing the created prism.
3646 # @ref tui_creation_prism "Example"
3647 @ManageTransactions("PrimOp")
3648 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3650 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3651 i.e. all the space, transfixed by the base shape during its translation
3652 along the vector on the given distance in 2 Ways (forward/backward).
3655 theBase Base shape to be extruded.
3656 theDX, theDY, theDZ Directions of extrusion.
3657 theName Object name; when specified, this parameter is used
3658 for result publication in the study. Otherwise, if automatic
3659 publication is switched on, default value is used for result name.
3662 New GEOM.GEOM_Object, containing the created prism.
3664 # Example: see GEOM_TestAll.py
3665 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3666 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3667 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3668 anObj.SetParameters(Parameters)
3669 self._autoPublish(anObj, theName, "prism")
3672 ## Create a shape by revolution of the base shape around the axis
3673 # on the given angle, i.e. all the space, transfixed by the base
3674 # shape during its rotation around the axis on the given angle.
3675 # @param theBase Base shape to be rotated.
3676 # @param theAxis Rotation axis.
3677 # @param theAngle Rotation angle in radians.
3678 # @param theName Object name; when specified, this parameter is used
3679 # for result publication in the study. Otherwise, if automatic
3680 # publication is switched on, default value is used for result name.
3682 # @return New GEOM.GEOM_Object, containing the created revolution.
3684 # @ref tui_creation_revolution "Example"
3685 @ManageTransactions("PrimOp")
3686 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3688 Create a shape by revolution of the base shape around the axis
3689 on the given angle, i.e. all the space, transfixed by the base
3690 shape during its rotation around the axis on the given angle.
3693 theBase Base shape to be rotated.
3694 theAxis Rotation axis.
3695 theAngle Rotation angle in radians.
3696 theName Object name; when specified, this parameter is used
3697 for result publication in the study. Otherwise, if automatic
3698 publication is switched on, default value is used for result name.
3701 New GEOM.GEOM_Object, containing the created revolution.
3703 # Example: see GEOM_TestAll.py
3704 theAngle,Parameters = ParseParameters(theAngle)
3705 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3706 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3707 anObj.SetParameters(Parameters)
3708 self._autoPublish(anObj, theName, "revolution")
3711 ## Create a shape by revolution of the base shape around the axis
3712 # on the given angle, i.e. all the space, transfixed by the base
3713 # shape during its rotation around the axis on the given angle in
3714 # both directions (forward/backward)
3715 # @param theBase Base shape to be rotated.
3716 # @param theAxis Rotation axis.
3717 # @param theAngle Rotation angle in radians.
3718 # @param theName Object name; when specified, this parameter is used
3719 # for result publication in the study. Otherwise, if automatic
3720 # publication is switched on, default value is used for result name.
3722 # @return New GEOM.GEOM_Object, containing the created revolution.
3724 # @ref tui_creation_revolution "Example"
3725 @ManageTransactions("PrimOp")
3726 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3728 Create a shape by revolution of the base shape around the axis
3729 on the given angle, i.e. all the space, transfixed by the base
3730 shape during its rotation around the axis on the given angle in
3731 both directions (forward/backward).
3734 theBase Base shape to be rotated.
3735 theAxis Rotation axis.
3736 theAngle Rotation angle in radians.
3737 theName Object name; when specified, this parameter is used
3738 for result publication in the study. Otherwise, if automatic
3739 publication is switched on, default value is used for result name.
3742 New GEOM.GEOM_Object, containing the created revolution.
3744 theAngle,Parameters = ParseParameters(theAngle)
3745 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3746 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3747 anObj.SetParameters(Parameters)
3748 self._autoPublish(anObj, theName, "revolution")
3751 ## Create a face from a given set of contours.
3752 # @param theContours either a list or a compound of edges/wires.
3753 # @param theMinDeg a minimal degree of BSpline surface to create.
3754 # @param theMaxDeg a maximal degree of BSpline surface to create.
3755 # @param theTol2D a 2d tolerance to be reached.
3756 # @param theTol3D a 3d tolerance to be reached.
3757 # @param theNbIter a number of iteration of approximation algorithm.
3758 # @param theMethod Kind of method to perform filling operation
3759 # (see GEOM.filling_oper_method enum).
3760 # @param isApprox if True, BSpline curves are generated in the process
3761 # of surface construction. By default it is False, that means
3762 # the surface is created using given curves. The usage of
3763 # Approximation makes the algorithm work slower, but allows
3764 # building the surface for rather complex cases.
3765 # @param theName Object name; when specified, this parameter is used
3766 # for result publication in the study. Otherwise, if automatic
3767 # publication is switched on, default value is used for result name.
3769 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3771 # @ref tui_creation_filling "Example"
3772 @ManageTransactions("PrimOp")
3773 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3774 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3776 Create a face from a given set of contours.
3779 theContours either a list or a compound of edges/wires.
3780 theMinDeg a minimal degree of BSpline surface to create.
3781 theMaxDeg a maximal degree of BSpline surface to create.
3782 theTol2D a 2d tolerance to be reached.
3783 theTol3D a 3d tolerance to be reached.
3784 theNbIter a number of iteration of approximation algorithm.
3785 theMethod Kind of method to perform filling operation
3786 (see GEOM.filling_oper_method enum).
3787 isApprox if True, BSpline curves are generated in the process
3788 of surface construction. By default it is False, that means
3789 the surface is created using given curves. The usage of
3790 Approximation makes the algorithm work slower, but allows
3791 building the surface for rather complex cases.
3792 theName Object name; when specified, this parameter is used
3793 for result publication in the study. Otherwise, if automatic
3794 publication is switched on, default value is used for result name.
3797 New GEOM.GEOM_Object (face), containing the created filling surface.
3800 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3802 # Example: see GEOM_TestAll.py
3803 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3804 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3805 theTol2D, theTol3D, theNbIter,
3806 theMethod, isApprox)
3807 RaiseIfFailed("MakeFilling", self.PrimOp)
3808 anObj.SetParameters(Parameters)
3809 self._autoPublish(anObj, theName, "filling")
3813 ## Create a face from a given set of contours.
3814 # This method corresponds to MakeFilling() with isApprox=True.
3815 # @param theContours either a list or a compound of edges/wires.
3816 # @param theMinDeg a minimal degree of BSpline surface to create.
3817 # @param theMaxDeg a maximal degree of BSpline surface to create.
3818 # @param theTol3D a 3d tolerance to be reached.
3819 # @param theName Object name; when specified, this parameter is used
3820 # for result publication in the study. Otherwise, if automatic
3821 # publication is switched on, default value is used for result name.
3823 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3825 # @ref tui_creation_filling "Example"
3826 @ManageTransactions("PrimOp")
3827 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3829 Create a filling from the given compound of contours.
3830 This method corresponds to MakeFilling() with isApprox=True.
3833 theContours either a list or a compound of edges/wires.
3834 theMinDeg a minimal degree of BSpline surface to create.
3835 theMaxDeg a maximal degree of BSpline surface to create.
3836 theTol3D a 3d tolerance to be reached.
3837 theName Object name; when specified, this parameter is used
3838 for result publication in the study. Otherwise, if automatic
3839 publication is switched on, default value is used for result name.
3842 New GEOM.GEOM_Object (face), containing the created filling surface.
3845 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3847 # Example: see GEOM_TestAll.py
3848 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3849 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3850 0, theTol3D, 0, GEOM.FOM_Default, True)
3851 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3852 anObj.SetParameters(Parameters)
3853 self._autoPublish(anObj, theName, "filling")
3856 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3857 # @param theSeqSections - set of specified sections.
3858 # @param theModeSolid - mode defining building solid or shell
3859 # @param thePreci - precision 3D used for smoothing
3860 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3861 # @param theName Object name; when specified, this parameter is used
3862 # for result publication in the study. Otherwise, if automatic
3863 # publication is switched on, default value is used for result name.
3865 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3867 # @ref swig_todo "Example"
3868 @ManageTransactions("PrimOp")
3869 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3871 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3874 theSeqSections - set of specified sections.
3875 theModeSolid - mode defining building solid or shell
3876 thePreci - precision 3D used for smoothing
3877 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3878 theName Object name; when specified, this parameter is used
3879 for result publication in the study. Otherwise, if automatic
3880 publication is switched on, default value is used for result name.
3883 New GEOM.GEOM_Object, containing the created shell or solid.
3885 # Example: see GEOM_TestAll.py
3886 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3887 RaiseIfFailed("MakeThruSections", self.PrimOp)
3888 self._autoPublish(anObj, theName, "filling")
3891 ## Create a shape by extrusion of the base shape along
3892 # the path shape. The path shape can be a wire or an edge. It is
3893 # possible to generate groups along with the result by means of
3894 # setting the flag \a IsGenerateGroups.<BR>
3895 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3896 # set, an error is occured. If \a thePath is not closed edge/wire,
3897 # the following groups are returned:
3898 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3900 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3903 # "Down" and "Up" groups contain:
3904 # - Edges if \a theBase is edge or wire;
3905 # - Faces if \a theBase is face or shell.<BR>
3907 # "Side1" and "Side2" groups contain edges generated from the first
3908 # and last vertices of \a theBase. The first and last vertices are
3909 # determined taking into account edge/wire orientation.<BR>
3910 # "Other" group represents faces generated from the bounding edges of
3913 # @param theBase Base shape to be extruded.
3914 # @param thePath Path shape to extrude the base shape along it.
3915 # @param IsGenerateGroups flag that tells if it is necessary to
3916 # create groups. It is equal to False by default.
3917 # @param theName Object name; when specified, this parameter is used
3918 # for result publication in the study. Otherwise, if automatic
3919 # publication is switched on, default value is used for result name.
3921 # @return New GEOM.GEOM_Object, containing the created pipe if
3922 # \a IsGenerateGroups is not set. Otherwise it returns new
3923 # GEOM.ListOfGO. Its first element is the created pipe, the
3924 # remaining ones are created groups.
3926 # @ref tui_creation_pipe "Example"
3927 @ManageTransactions("PrimOp")
3928 def MakePipe(self, theBase, thePath,
3929 IsGenerateGroups=False, theName=None):
3931 Create a shape by extrusion of the base shape along
3932 the path shape. The path shape can be a wire or an edge. It is
3933 possible to generate groups along with the result by means of
3934 setting the flag IsGenerateGroups.
3935 If thePath is a closed edge or wire and IsGenerateGroups is
3936 set, an error is occured. If thePath is not closed edge/wire,
3937 the following groups are returned:
3938 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
3940 - If theBase is closed edge or wire, face or shell: "Down", "Up",
3942 "Down" and "Up" groups contain:
3943 - Edges if theBase is edge or wire;
3944 - Faces if theBase is face or shell.
3945 "Side1" and "Side2" groups contain edges generated from the first
3946 and last vertices of theBase. The first and last vertices are
3947 determined taking into account edge/wire orientation.
3948 "Other" group represents faces generated from the bounding edges of
3952 theBase Base shape to be extruded.
3953 thePath Path shape to extrude the base shape along it.
3954 IsGenerateGroups flag that tells if it is necessary to
3955 create groups. It is equal to False by default.
3956 theName Object name; when specified, this parameter is used
3957 for result publication in the study. Otherwise, if automatic
3958 publication is switched on, default value is used for result name.
3961 New GEOM.GEOM_Object, containing the created pipe if
3962 IsGenerateGroups is not set. Otherwise it returns new
3963 GEOM.ListOfGO. Its first element is the created pipe, the
3964 remaining ones are created groups.
3966 # Example: see GEOM_TestAll.py
3967 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
3968 RaiseIfFailed("MakePipe", self.PrimOp)
3970 if IsGenerateGroups:
3971 self._autoPublish(aList, theName, "pipe")
3974 self._autoPublish(aList[0], theName, "pipe")
3977 ## Create a shape by extrusion of the profile shape along
3978 # the path shape. The path shape can be a wire or an edge.
3979 # the several profiles can be specified in the several locations of path.
3980 # It is possible to generate groups along with the result by means of
3981 # setting the flag \a IsGenerateGroups. For detailed information on
3982 # groups that can be created please see the method MakePipe().
3983 # @param theSeqBases - list of Bases shape to be extruded.
3984 # @param theLocations - list of locations on the path corresponding
3985 # specified list of the Bases shapes. Number of locations
3986 # should be equal to number of bases or list of locations can be empty.
3987 # @param thePath - Path shape to extrude the base shape along it.
3988 # @param theWithContact - the mode defining that the section is translated to be in
3989 # contact with the spine.
3990 # @param theWithCorrection - defining that the section is rotated to be
3991 # orthogonal to the spine tangent in the correspondent point
3992 # @param IsGenerateGroups - flag that tells if it is necessary to
3993 # create groups. It is equal to False by default.
3994 # @param theName Object name; when specified, this parameter is used
3995 # for result publication in the study. Otherwise, if automatic
3996 # publication is switched on, default value is used for result name.
3998 # @return New GEOM.GEOM_Object, containing the created pipe if
3999 # \a IsGenerateGroups is not set. Otherwise it returns new
4000 # GEOM.ListOfGO. Its first element is the created pipe, the
4001 # remaining ones are created groups.
4003 # @ref tui_creation_pipe_with_diff_sec "Example"
4004 @ManageTransactions("PrimOp")
4005 def MakePipeWithDifferentSections(self, theSeqBases,
4006 theLocations, thePath,
4007 theWithContact, theWithCorrection,
4008 IsGenerateGroups=False, theName=None):
4010 Create a shape by extrusion of the profile shape along
4011 the path shape. The path shape can be a wire or an edge.
4012 the several profiles can be specified in the several locations of path.
4013 It is possible to generate groups along with the result by means of
4014 setting the flag IsGenerateGroups. For detailed information on
4015 groups that can be created please see the method geompy.MakePipe().
4018 theSeqBases - list of Bases shape to be extruded.
4019 theLocations - list of locations on the path corresponding
4020 specified list of the Bases shapes. Number of locations
4021 should be equal to number of bases or list of locations can be empty.
4022 thePath - Path shape to extrude the base shape along it.
4023 theWithContact - the mode defining that the section is translated to be in
4024 contact with the spine(0/1)
4025 theWithCorrection - defining that the section is rotated to be
4026 orthogonal to the spine tangent in the correspondent point (0/1)
4027 IsGenerateGroups - flag that tells if it is necessary to
4028 create groups. It is equal to False by default.
4029 theName Object name; when specified, this parameter is used
4030 for result publication in the study. Otherwise, if automatic
4031 publication is switched on, default value is used for result name.
4034 New GEOM.GEOM_Object, containing the created pipe if
4035 IsGenerateGroups is not set. Otherwise it returns new
4036 GEOM.ListOfGO. Its first element is the created pipe, the
4037 remaining ones are created groups.
4039 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4040 theLocations, thePath,
4041 theWithContact, theWithCorrection,
4042 False, IsGenerateGroups)
4043 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4045 if IsGenerateGroups:
4046 self._autoPublish(aList, theName, "pipe")
4049 self._autoPublish(aList[0], theName, "pipe")
4052 ## Create a shape by extrusion of the profile shape along
4053 # the path shape. This function is a version of
4054 # MakePipeWithDifferentSections() with the same parameters, except
4055 # eliminated theWithContact and theWithCorrection. So it is
4056 # possible to find the description of all parameters is in this
4057 # method. The difference is that this method performs the operation
4058 # step by step, i.e. it creates pipes between each pair of neighbor
4059 # sections and fuses them into a single shape.
4061 # @ref tui_creation_pipe_with_diff_sec "Example"
4062 @ManageTransactions("PrimOp")
4063 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4064 theLocations, thePath,
4065 IsGenerateGroups=False, theName=None):
4067 Create a shape by extrusion of the profile shape along
4068 the path shape. This function is a version of
4069 MakePipeWithDifferentSections() with the same parameters, except
4070 eliminated theWithContact and theWithCorrection. So it is
4071 possible to find the description of all parameters is in this
4072 method. The difference is that this method performs the operation
4073 step by step, i.e. it creates pipes between each pair of neighbor
4074 sections and fuses them into a single shape.
4076 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4077 theLocations, thePath,
4079 True, IsGenerateGroups)
4080 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4082 if IsGenerateGroups:
4083 self._autoPublish(aList, theName, "pipe")
4086 self._autoPublish(aList[0], theName, "pipe")
4089 ## Create a shape by extrusion of the profile shape along
4090 # the path shape. The path shape can be a wire or an edge.
4091 # the several profiles can be specified in the several locations of path.
4092 # It is possible to generate groups along with the result by means of
4093 # setting the flag \a IsGenerateGroups. For detailed information on
4094 # groups that can be created please see the method MakePipe().
4095 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4096 # shell or face. If number of faces in neighbour sections
4097 # aren't coincided result solid between such sections will
4098 # be created using external boundaries of this shells.
4099 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4100 # This list is used for searching correspondences between
4101 # faces in the sections. Size of this list must be equal
4102 # to size of list of base shapes.
4103 # @param theLocations - list of locations on the path corresponding
4104 # specified list of the Bases shapes. Number of locations
4105 # should be equal to number of bases. First and last
4106 # locations must be coincided with first and last vertexes
4107 # of path correspondingly.
4108 # @param thePath - Path shape to extrude the base shape along it.
4109 # @param theWithContact - the mode defining that the section is translated to be in
4110 # contact with the spine.
4111 # @param theWithCorrection - defining that the section is rotated to be
4112 # orthogonal to the spine tangent in the correspondent point
4113 # @param IsGenerateGroups - flag that tells if it is necessary to
4114 # create groups. It is equal to False by default.
4115 # @param theName Object name; when specified, this parameter is used
4116 # for result publication in the study. Otherwise, if automatic
4117 # publication is switched on, default value is used for result name.
4119 # @return New GEOM.GEOM_Object, containing the created solids if
4120 # \a IsGenerateGroups is not set. Otherwise it returns new
4121 # GEOM.ListOfGO. Its first element is the created solids, the
4122 # remaining ones are created groups.
4124 # @ref tui_creation_pipe_with_shell_sec "Example"
4125 @ManageTransactions("PrimOp")
4126 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4127 theLocations, thePath,
4128 theWithContact, theWithCorrection,
4129 IsGenerateGroups=False, theName=None):
4131 Create a shape by extrusion of the profile shape along
4132 the path shape. The path shape can be a wire or an edge.
4133 the several profiles can be specified in the several locations of path.
4134 It is possible to generate groups along with the result by means of
4135 setting the flag IsGenerateGroups. For detailed information on
4136 groups that can be created please see the method geompy.MakePipe().
4139 theSeqBases - list of Bases shape to be extruded. Base shape must be
4140 shell or face. If number of faces in neighbour sections
4141 aren't coincided result solid between such sections will
4142 be created using external boundaries of this shells.
4143 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4144 This list is used for searching correspondences between
4145 faces in the sections. Size of this list must be equal
4146 to size of list of base shapes.
4147 theLocations - list of locations on the path corresponding
4148 specified list of the Bases shapes. Number of locations
4149 should be equal to number of bases. First and last
4150 locations must be coincided with first and last vertexes
4151 of path correspondingly.
4152 thePath - Path shape to extrude the base shape along it.
4153 theWithContact - the mode defining that the section is translated to be in
4154 contact with the spine (0/1)
4155 theWithCorrection - defining that the section is rotated to be
4156 orthogonal to the spine tangent in the correspondent point (0/1)
4157 IsGenerateGroups - flag that tells if it is necessary to
4158 create groups. It is equal to False by default.
4159 theName Object name; when specified, this parameter is used
4160 for result publication in the study. Otherwise, if automatic
4161 publication is switched on, default value is used for result name.
4164 New GEOM.GEOM_Object, containing the created solids if
4165 IsGenerateGroups is not set. Otherwise it returns new
4166 GEOM.ListOfGO. Its first element is the created solids, the
4167 remaining ones are created groups.
4169 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4170 theLocations, thePath,
4171 theWithContact, theWithCorrection,
4173 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4175 if IsGenerateGroups:
4176 self._autoPublish(aList, theName, "pipe")
4179 self._autoPublish(aList[0], theName, "pipe")
4182 ## Create a shape by extrusion of the profile shape along
4183 # the path shape. This function is used only for debug pipe
4184 # functionality - it is a version of function MakePipeWithShellSections()
4185 # which give a possibility to recieve information about
4186 # creating pipe between each pair of sections step by step.
4187 @ManageTransactions("PrimOp")
4188 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4189 theLocations, thePath,
4190 theWithContact, theWithCorrection,
4191 IsGenerateGroups=False, theName=None):
4193 Create a shape by extrusion of the profile shape along
4194 the path shape. This function is used only for debug pipe
4195 functionality - it is a version of previous function
4196 geompy.MakePipeWithShellSections() which give a possibility to
4197 recieve information about creating pipe between each pair of
4198 sections step by step.
4201 nbsect = len(theSeqBases)
4202 nbsubsect = len(theSeqSubBases)
4203 #print "nbsect = ",nbsect
4204 for i in range(1,nbsect):
4206 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4207 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4209 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4210 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4211 tmpLocations, thePath,
4212 theWithContact, theWithCorrection,
4214 if self.PrimOp.IsDone() == 0:
4215 print "Problems with pipe creation between ",i," and ",i+1," sections"
4216 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4219 print "Pipe between ",i," and ",i+1," sections is OK"
4220 res.append(aList[0])
4224 resc = self.MakeCompound(res)
4225 #resc = self.MakeSewing(res, 0.001)
4226 #print "resc: ",resc
4227 self._autoPublish(resc, theName, "pipe")
4230 ## Create solids between given sections.
4231 # It is possible to generate groups along with the result by means of
4232 # setting the flag \a IsGenerateGroups. For detailed information on
4233 # groups that can be created please see the method MakePipe().
4234 # @param theSeqBases - list of sections (shell or face).
4235 # @param theLocations - list of corresponding vertexes
4236 # @param IsGenerateGroups - flag that tells if it is necessary to
4237 # create groups. It is equal to False by default.
4238 # @param theName Object name; when specified, this parameter is used
4239 # for result publication in the study. Otherwise, if automatic
4240 # publication is switched on, default value is used for result name.
4242 # @return New GEOM.GEOM_Object, containing the created solids if
4243 # \a IsGenerateGroups is not set. Otherwise it returns new
4244 # GEOM.ListOfGO. Its first element is the created solids, the
4245 # remaining ones are created groups.
4247 # @ref tui_creation_pipe_without_path "Example"
4248 @ManageTransactions("PrimOp")
4249 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4250 IsGenerateGroups=False, theName=None):
4252 Create solids between given sections.
4253 It is possible to generate groups along with the result by means of
4254 setting the flag IsGenerateGroups. For detailed information on
4255 groups that can be created please see the method geompy.MakePipe().
4258 theSeqBases - list of sections (shell or face).
4259 theLocations - list of corresponding vertexes
4260 IsGenerateGroups - flag that tells if it is necessary to
4261 create groups. It is equal to False by default.
4262 theName Object name; when specified, this parameter is used
4263 for result publication in the study. Otherwise, if automatic
4264 publication is switched on, default value is used for result name.
4267 New GEOM.GEOM_Object, containing the created solids if
4268 IsGenerateGroups is not set. Otherwise it returns new
4269 GEOM.ListOfGO. Its first element is the created solids, the
4270 remaining ones are created groups.
4272 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4274 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4276 if IsGenerateGroups:
4277 self._autoPublish(aList, theName, "pipe")
4280 self._autoPublish(aList[0], theName, "pipe")
4283 ## Create a shape by extrusion of the base shape along
4284 # the path shape with constant bi-normal direction along the given vector.
4285 # The path shape can be a wire or an edge.
4286 # It is possible to generate groups along with the result by means of
4287 # setting the flag \a IsGenerateGroups. For detailed information on
4288 # groups that can be created please see the method MakePipe().
4289 # @param theBase Base shape to be extruded.
4290 # @param thePath Path shape to extrude the base shape along it.
4291 # @param theVec Vector defines a constant binormal direction to keep the
4292 # same angle beetween the direction and the sections
4293 # along the sweep surface.
4294 # @param IsGenerateGroups flag that tells if it is necessary to
4295 # create groups. It is equal to False by default.
4296 # @param theName Object name; when specified, this parameter is used
4297 # for result publication in the study. Otherwise, if automatic
4298 # publication is switched on, default value is used for result name.
4300 # @return New GEOM.GEOM_Object, containing the created pipe if
4301 # \a IsGenerateGroups is not set. Otherwise it returns new
4302 # GEOM.ListOfGO. Its first element is the created pipe, the
4303 # remaining ones are created groups.
4305 # @ref tui_creation_pipe "Example"
4306 @ManageTransactions("PrimOp")
4307 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4308 IsGenerateGroups=False, theName=None):
4310 Create a shape by extrusion of the base shape along
4311 the path shape with constant bi-normal direction along the given vector.
4312 The path shape can be a wire or an edge.
4313 It is possible to generate groups along with the result by means of
4314 setting the flag IsGenerateGroups. For detailed information on
4315 groups that can be created please see the method geompy.MakePipe().
4318 theBase Base shape to be extruded.
4319 thePath Path shape to extrude the base shape along it.
4320 theVec Vector defines a constant binormal direction to keep the
4321 same angle beetween the direction and the sections
4322 along the sweep surface.
4323 IsGenerateGroups flag that tells if it is necessary to
4324 create groups. It is equal to False by default.
4325 theName Object name; when specified, this parameter is used
4326 for result publication in the study. Otherwise, if automatic
4327 publication is switched on, default value is used for result name.
4330 New GEOM.GEOM_Object, containing the created pipe if
4331 IsGenerateGroups is not set. Otherwise it returns new
4332 GEOM.ListOfGO. Its first element is the created pipe, the
4333 remaining ones are created groups.
4335 # Example: see GEOM_TestAll.py
4336 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4337 theVec, IsGenerateGroups)
4338 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4340 if IsGenerateGroups:
4341 self._autoPublish(aList, theName, "pipe")
4344 self._autoPublish(aList[0], theName, "pipe")
4347 ## Makes a thick solid from a shape. If the input is a surface shape
4348 # (face or shell) the result is a thick solid. If an input shape is
4349 # a solid the result is a hollowed solid with removed faces.
4350 # @param theShape Face or Shell to get thick solid or solid to get
4352 # @param theThickness Thickness of the resulting solid
4353 # @param theFacesIDs the list of face IDs to be removed from the
4354 # result. It is ignored if \a theShape is a face or a shell.
4355 # It is empty by default.
4356 # @param theInside If true the thickness is applied towards inside
4357 # @param theName Object name; when specified, this parameter is used
4358 # for result publication in the study. Otherwise, if automatic
4359 # publication is switched on, default value is used for result name.
4361 # @return New GEOM.GEOM_Object, containing the created solid
4363 # @ref tui_creation_thickness "Example"
4364 @ManageTransactions("PrimOp")
4365 def MakeThickSolid(self, theShape, theThickness,
4366 theFacesIDs=[], theInside=False, theName=None):
4368 Make a thick solid from a shape. If the input is a surface shape
4369 (face or shell) the result is a thick solid. If an input shape is
4370 a solid the result is a hollowed solid with removed faces.
4373 theShape Face or Shell to get thick solid or solid to get
4375 theThickness Thickness of the resulting solid
4376 theFacesIDs the list of face IDs to be removed from the
4377 result. It is ignored if theShape is a face or a
4378 shell. It is empty by default.
4379 theInside If true the thickness is applied towards inside
4380 theName Object name; when specified, this parameter is used
4381 for result publication in the study. Otherwise, if automatic
4382 publication is switched on, default value is used for result name.
4385 New GEOM.GEOM_Object, containing the created solid
4387 # Example: see GEOM_TestAll.py
4388 theThickness,Parameters = ParseParameters(theThickness)
4389 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4390 theThickness, True, theInside)
4391 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4392 anObj.SetParameters(Parameters)
4393 self._autoPublish(anObj, theName, "thickSolid")
4397 ## Modifies a shape to make it a thick solid. If the input is a surface
4398 # shape (face or shell) the result is a thick solid. If an input shape
4399 # is a solid the result is a hollowed solid with removed faces.
4400 # @param theShape Face or Shell to get thick solid or solid to get
4402 # @param theThickness Thickness of the resulting solid
4403 # @param theFacesIDs the list of face IDs to be removed from the
4404 # result. It is ignored if \a theShape is a face or a shell.
4405 # It is empty by default.
4406 # @param theInside If true the thickness is applied towards inside
4408 # @return The modified shape
4410 # @ref tui_creation_thickness "Example"
4411 @ManageTransactions("PrimOp")
4412 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4414 Modifies a shape to make it a thick solid. If the input is a
4415 surface shape (face or shell) the result is a thick solid. If
4416 an input shape is a solid the result is a hollowed solid with
4420 theShape Face or Shell to get thick solid or solid to get
4422 theThickness Thickness of the resulting solid
4423 theFacesIDs the list of face IDs to be removed from the
4424 result. It is ignored if \a theShape is a face or
4425 a shell. It is empty by default.
4426 theInside If true the thickness is applied towards inside
4431 # Example: see GEOM_TestAll.py
4432 theThickness,Parameters = ParseParameters(theThickness)
4433 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4434 theThickness, False, theInside)
4435 RaiseIfFailed("Thicken", self.PrimOp)
4436 anObj.SetParameters(Parameters)
4439 ## Build a middle path of a pipe-like shape.
4440 # The path shape can be a wire or an edge.
4441 # @param theShape It can be closed or unclosed pipe-like shell
4442 # or a pipe-like solid.
4443 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4444 # should be wires or faces of theShape.
4445 # @param theName Object name; when specified, this parameter is used
4446 # for result publication in the study. Otherwise, if automatic
4447 # publication is switched on, default value is used for result name.
4449 # @note It is not assumed that exact or approximate copy of theShape
4450 # can be obtained by applying existing Pipe operation on the
4451 # resulting "Path" wire taking theBase1 as the base - it is not
4452 # always possible; though in some particular cases it might work
4453 # it is not guaranteed. Thus, RestorePath function should not be
4454 # considered as an exact reverse operation of the Pipe.
4456 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4457 # source pipe's "path".
4459 # @ref tui_creation_pipe_path "Example"
4460 @ManageTransactions("PrimOp")
4461 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4463 Build a middle path of a pipe-like shape.
4464 The path shape can be a wire or an edge.
4467 theShape It can be closed or unclosed pipe-like shell
4468 or a pipe-like solid.
4469 theBase1, theBase2 Two bases of the supposed pipe. This
4470 should be wires or faces of theShape.
4471 theName Object name; when specified, this parameter is used
4472 for result publication in the study. Otherwise, if automatic
4473 publication is switched on, default value is used for result name.
4476 New GEOM_Object, containing an edge or wire that represent
4479 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4480 RaiseIfFailed("RestorePath", self.PrimOp)
4481 self._autoPublish(anObj, theName, "path")
4484 ## Build a middle path of a pipe-like shape.
4485 # The path shape can be a wire or an edge.
4486 # @param theShape It can be closed or unclosed pipe-like shell
4487 # or a pipe-like solid.
4488 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4489 # should be lists of edges of theShape.
4490 # @param theName Object name; when specified, this parameter is used
4491 # for result publication in the study. Otherwise, if automatic
4492 # publication is switched on, default value is used for result name.
4494 # @note It is not assumed that exact or approximate copy of theShape
4495 # can be obtained by applying existing Pipe operation on the
4496 # resulting "Path" wire taking theBase1 as the base - it is not
4497 # always possible; though in some particular cases it might work
4498 # it is not guaranteed. Thus, RestorePath function should not be
4499 # considered as an exact reverse operation of the Pipe.
4501 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4502 # source pipe's "path".
4504 # @ref tui_creation_pipe_path "Example"
4505 @ManageTransactions("PrimOp")
4506 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4508 Build a middle path of a pipe-like shape.
4509 The path shape can be a wire or an edge.
4512 theShape It can be closed or unclosed pipe-like shell
4513 or a pipe-like solid.
4514 listEdges1, listEdges2 Two bases of the supposed pipe. This
4515 should be lists of edges of theShape.
4516 theName Object name; when specified, this parameter is used
4517 for result publication in the study. Otherwise, if automatic
4518 publication is switched on, default value is used for result name.
4521 New GEOM_Object, containing an edge or wire that represent
4524 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4525 RaiseIfFailed("RestorePath", self.PrimOp)
4526 self._autoPublish(anObj, theName, "path")
4532 ## @addtogroup l3_basic_go
4535 ## Create a linear edge with specified ends.
4536 # @param thePnt1 Point for the first end of edge.
4537 # @param thePnt2 Point for the second end of edge.
4538 # @param theName Object name; when specified, this parameter is used
4539 # for result publication in the study. Otherwise, if automatic
4540 # publication is switched on, default value is used for result name.
4542 # @return New GEOM.GEOM_Object, containing the created edge.
4544 # @ref tui_creation_edge "Example"
4545 @ManageTransactions("ShapesOp")
4546 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4548 Create a linear edge with specified ends.
4551 thePnt1 Point for the first end of edge.
4552 thePnt2 Point for the second end of edge.
4553 theName Object name; when specified, this parameter is used
4554 for result publication in the study. Otherwise, if automatic
4555 publication is switched on, default value is used for result name.
4558 New GEOM.GEOM_Object, containing the created edge.
4560 # Example: see GEOM_TestAll.py
4561 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4562 RaiseIfFailed("MakeEdge", self.ShapesOp)
4563 self._autoPublish(anObj, theName, "edge")
4566 ## Create a new edge, corresponding to the given length on the given curve.
4567 # @param theRefCurve The referenced curve (edge).
4568 # @param theLength Length on the referenced curve. It can be negative.
4569 # @param theStartPoint Any point can be selected for it, the new edge will begin
4570 # at the end of \a theRefCurve, close to the selected point.
4571 # If None, start from the first point of \a theRefCurve.
4572 # @param theName Object name; when specified, this parameter is used
4573 # for result publication in the study. Otherwise, if automatic
4574 # publication is switched on, default value is used for result name.
4576 # @return New GEOM.GEOM_Object, containing the created edge.
4578 # @ref tui_creation_edge "Example"
4579 @ManageTransactions("ShapesOp")
4580 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4582 Create a new edge, corresponding to the given length on the given curve.
4585 theRefCurve The referenced curve (edge).
4586 theLength Length on the referenced curve. It can be negative.
4587 theStartPoint Any point can be selected for it, the new edge will begin
4588 at the end of theRefCurve, close to the selected point.
4589 If None, start from the first point of theRefCurve.
4590 theName Object name; when specified, this parameter is used
4591 for result publication in the study. Otherwise, if automatic
4592 publication is switched on, default value is used for result name.
4595 New GEOM.GEOM_Object, containing the created edge.
4597 # Example: see GEOM_TestAll.py
4598 theLength, Parameters = ParseParameters(theLength)
4599 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4600 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4601 anObj.SetParameters(Parameters)
4602 self._autoPublish(anObj, theName, "edge")
4605 ## Create an edge from specified wire.
4606 # @param theWire source Wire
4607 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4608 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4609 # @param theName Object name; when specified, this parameter is used
4610 # for result publication in the study. Otherwise, if automatic
4611 # publication is switched on, default value is used for result name.
4613 # @return New GEOM.GEOM_Object, containing the created edge.
4615 # @ref tui_creation_edge "Example"
4616 @ManageTransactions("ShapesOp")
4617 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4619 Create an edge from specified wire.
4623 theLinearTolerance linear tolerance value (default = 1e-07)
4624 theAngularTolerance angular tolerance value (default = 1e-12)
4625 theName Object name; when specified, this parameter is used
4626 for result publication in the study. Otherwise, if automatic
4627 publication is switched on, default value is used for result name.
4630 New GEOM.GEOM_Object, containing the created edge.
4632 # Example: see GEOM_TestAll.py
4633 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4634 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4635 self._autoPublish(anObj, theName, "edge")
4638 ## Create a wire from the set of edges and wires.
4639 # @param theEdgesAndWires List of edges and/or wires.
4640 # @param theTolerance Maximum distance between vertices, that will be merged.
4641 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4642 # @param theName Object name; when specified, this parameter is used
4643 # for result publication in the study. Otherwise, if automatic
4644 # publication is switched on, default value is used for result name.
4646 # @return New GEOM.GEOM_Object, containing the created wire.
4648 # @ref tui_creation_wire "Example"
4649 @ManageTransactions("ShapesOp")
4650 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4652 Create a wire from the set of edges and wires.
4655 theEdgesAndWires List of edges and/or wires.
4656 theTolerance Maximum distance between vertices, that will be merged.
4657 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4658 theName Object name; when specified, this parameter is used
4659 for result publication in the study. Otherwise, if automatic
4660 publication is switched on, default value is used for result name.
4663 New GEOM.GEOM_Object, containing the created wire.
4665 # Example: see GEOM_TestAll.py
4666 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4667 RaiseIfFailed("MakeWire", self.ShapesOp)
4668 self._autoPublish(anObj, theName, "wire")
4671 ## Create a face on the given wire.
4672 # @param theWire closed Wire or Edge to build the face on.
4673 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4674 # If the tolerance of the obtained planar face is less
4675 # than 1e-06, this face will be returned, otherwise the
4676 # algorithm tries to build any suitable face on the given
4677 # wire and prints a warning message.
4678 # @param theName Object name; when specified, this parameter is used
4679 # for result publication in the study. Otherwise, if automatic
4680 # publication is switched on, default value is used for result name.
4682 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4684 # @ref tui_creation_face "Example"
4685 @ManageTransactions("ShapesOp")
4686 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4688 Create a face on the given wire.
4691 theWire closed Wire or Edge to build the face on.
4692 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4693 If the tolerance of the obtained planar face is less
4694 than 1e-06, this face will be returned, otherwise the
4695 algorithm tries to build any suitable face on the given
4696 wire and prints a warning message.
4697 theName Object name; when specified, this parameter is used
4698 for result publication in the study. Otherwise, if automatic
4699 publication is switched on, default value is used for result name.
4702 New GEOM.GEOM_Object, containing the created face (compound of faces).
4704 # Example: see GEOM_TestAll.py
4705 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4706 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4707 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4709 RaiseIfFailed("MakeFace", self.ShapesOp)
4710 self._autoPublish(anObj, theName, "face")
4713 ## Create a face on the given wires set.
4714 # @param theWires List of closed wires or edges to build the face on.
4715 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4716 # If the tolerance of the obtained planar face is less
4717 # than 1e-06, this face will be returned, otherwise the
4718 # algorithm tries to build any suitable face on the given
4719 # wire and prints a warning message.
4720 # @param theName Object name; when specified, this parameter is used
4721 # for result publication in the study. Otherwise, if automatic
4722 # publication is switched on, default value is used for result name.
4724 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4726 # @ref tui_creation_face "Example"
4727 @ManageTransactions("ShapesOp")
4728 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4730 Create a face on the given wires set.
4733 theWires List of closed wires or edges to build the face on.
4734 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4735 If the tolerance of the obtained planar face is less
4736 than 1e-06, this face will be returned, otherwise the
4737 algorithm tries to build any suitable face on the given
4738 wire and prints a warning message.
4739 theName Object name; when specified, this parameter is used
4740 for result publication in the study. Otherwise, if automatic
4741 publication is switched on, default value is used for result name.
4744 New GEOM.GEOM_Object, containing the created face (compound of faces).
4746 # Example: see GEOM_TestAll.py
4747 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4748 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4749 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4751 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4752 self._autoPublish(anObj, theName, "face")
4755 ## See MakeFaceWires() method for details.
4757 # @ref tui_creation_face "Example 1"
4758 # \n @ref swig_MakeFaces "Example 2"
4759 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4761 See geompy.MakeFaceWires() method for details.
4763 # Example: see GEOM_TestOthers.py
4764 # note: auto-publishing is done in self.MakeFaceWires()
4765 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4768 ## Create a face based on a surface from given face bounded
4770 # @param theFace the face whose surface is used to create a new face.
4771 # @param theWire the wire that will bound a new face.
4772 # @param theName Object name; when specified, this parameter is used
4773 # for result publication in the study. Otherwise, if automatic
4774 # publication is switched on, default value is used for result name.
4776 # @return New GEOM.GEOM_Object, containing the created face.
4778 # @ref tui_creation_face "Example"
4779 @ManageTransactions("ShapesOp")
4780 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4782 Create a face based on a surface from given face bounded
4786 theFace the face whose surface is used to create a new face.
4787 theWire the wire that will bound a new face.
4788 theName Object name; when specified, this parameter is used
4789 for result publication in the study. Otherwise, if automatic
4790 publication is switched on, default value is used for result name.
4793 New GEOM.GEOM_Object, containing the created face.
4795 # Example: see GEOM_TestAll.py
4796 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4797 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4798 self._autoPublish(anObj, theName, "face")
4801 ## Create a face from a set of edges with the given constraints.
4802 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4803 # - edges should form a closed wire;
4804 # - for each edge, constraint face is optional: if a constraint face is missing
4805 # for some edge, this means that there no constraint associated with this edge.
4806 # @param theName Object name; when specified, this parameter is used
4807 # for result publication in the study. Otherwise, if automatic
4808 # publication is switched on, default value is used for result name.
4810 # @return New GEOM.GEOM_Object, containing the created face.
4812 # @ref tui_creation_face "Example"
4813 @ManageTransactions("ShapesOp")
4814 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4816 Create a face from a set of edges with the given constraints.
4819 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4820 - edges should form a closed wire;
4821 - for each edge, constraint face is optional: if a constraint face is missing
4822 for some edge, this means that there no constraint associated with this edge.
4823 theName Object name; when specified, this parameter is used
4824 for result publication in the study. Otherwise, if automatic
4825 publication is switched on, default value is used for result name.
4828 New GEOM.GEOM_Object, containing the created face.
4830 # Example: see GEOM_TestAll.py
4831 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4833 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4834 self._autoPublish(anObj, theName, "face")
4837 ## Create a shell from the set of faces and shells.
4838 # @param theFacesAndShells List of faces and/or shells.
4839 # @param 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.
4843 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4845 # @ref tui_creation_shell "Example"
4846 @ManageTransactions("ShapesOp")
4847 def MakeShell(self, theFacesAndShells, theName=None):
4849 Create a shell from the set of faces and shells.
4852 theFacesAndShells List of faces and/or shells.
4853 theName Object name; when specified, this parameter is used
4854 for result publication in the study. Otherwise, if automatic
4855 publication is switched on, default value is used for result name.
4858 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4860 # Example: see GEOM_TestAll.py
4861 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4862 RaiseIfFailed("MakeShell", self.ShapesOp)
4863 self._autoPublish(anObj, theName, "shell")
4866 ## Create a solid, bounded by the given shells.
4867 # @param theShells Sequence of bounding shells.
4868 # @param theName Object name; when specified, this parameter is used
4869 # for result publication in the study. Otherwise, if automatic
4870 # publication is switched on, default value is used for result name.
4872 # @return New GEOM.GEOM_Object, containing the created solid.
4874 # @ref tui_creation_solid "Example"
4875 @ManageTransactions("ShapesOp")
4876 def MakeSolid(self, theShells, theName=None):
4878 Create a solid, bounded by the given shells.
4881 theShells Sequence of bounding shells.
4882 theName Object name; when specified, this parameter is used
4883 for result publication in the study. Otherwise, if automatic
4884 publication is switched on, default value is used for result name.
4887 New GEOM.GEOM_Object, containing the created solid.
4889 # Example: see GEOM_TestAll.py
4890 theShells = ToList(theShells)
4891 if len(theShells) == 1:
4892 descr = self._IsGoodForSolid(theShells[0])
4894 # raise RuntimeError, "MakeSolidShells : " + descr
4895 if descr == "WRN_SHAPE_UNCLOSED":
4896 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4897 anObj = self.ShapesOp.MakeSolidShells(theShells)
4898 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4899 self._autoPublish(anObj, theName, "solid")
4902 ## Create a compound of the given shapes.
4903 # @param theShapes List of shapes to put in compound.
4904 # @param theName Object name; when specified, this parameter is used
4905 # for result publication in the study. Otherwise, if automatic
4906 # publication is switched on, default value is used for result name.
4908 # @return New GEOM.GEOM_Object, containing the created compound.
4910 # @ref tui_creation_compound "Example"
4911 @ManageTransactions("ShapesOp")
4912 def MakeCompound(self, theShapes, theName=None):
4914 Create a compound of the given shapes.
4917 theShapes List of shapes to put in compound.
4918 theName Object name; when specified, this parameter is used
4919 for result publication in the study. Otherwise, if automatic
4920 publication is switched on, default value is used for result name.
4923 New GEOM.GEOM_Object, containing the created compound.
4925 # Example: see GEOM_TestAll.py
4926 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4927 RaiseIfFailed("MakeCompound", self.ShapesOp)
4928 self._autoPublish(anObj, theName, "compound")
4931 ## Create a solid (or solids) from the set of faces and/or shells.
4932 # @param theFacesOrShells List of faces and/or shells.
4933 # @param isIntersect If TRUE, forces performing intersections
4934 # between arguments; otherwise (default) intersection is not performed.
4935 # @param theName Object name; when specified, this parameter is used
4936 # for result publication in the study. Otherwise, if automatic
4937 # publication is switched on, default value is used for result name.
4939 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4941 # @ref tui_creation_solid_from_faces "Example"
4942 @ManageTransactions("ShapesOp")
4943 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
4945 Create a solid (or solids) from the set of connected faces and/or shells.
4948 theFacesOrShells List of faces and/or shells.
4949 isIntersect If TRUE, forces performing intersections
4950 between arguments; otherwise (default) intersection is not performed
4951 theName Object name; when specified, this parameter is used.
4952 for result publication in the study. Otherwise, if automatic
4953 publication is switched on, default value is used for result name.
4956 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
4958 # Example: see GEOM_TestAll.py
4959 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
4960 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
4961 self._autoPublish(anObj, theName, "solid")
4964 # end of l3_basic_go
4967 ## @addtogroup l2_measure
4970 ## Gives quantity of faces in the given shape.
4971 # @param theShape Shape to count faces of.
4972 # @return Quantity of faces.
4974 # @ref swig_NumberOf "Example"
4975 @ManageTransactions("ShapesOp")
4976 def NumberOfFaces(self, theShape):
4978 Gives quantity of faces in the given shape.
4981 theShape Shape to count faces of.
4986 # Example: see GEOM_TestOthers.py
4987 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4988 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4991 ## Gives quantity of edges in the given shape.
4992 # @param theShape Shape to count edges of.
4993 # @return Quantity of edges.
4995 # @ref swig_NumberOf "Example"
4996 @ManageTransactions("ShapesOp")
4997 def NumberOfEdges(self, theShape):
4999 Gives quantity of edges in the given shape.
5002 theShape Shape to count edges of.
5007 # Example: see GEOM_TestOthers.py
5008 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5009 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5012 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5013 # @param theShape Shape to count sub-shapes of.
5014 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5015 # @return Quantity of sub-shapes of given type.
5017 # @ref swig_NumberOf "Example"
5018 @ManageTransactions("ShapesOp")
5019 def NumberOfSubShapes(self, theShape, theShapeType):
5021 Gives quantity of sub-shapes of type theShapeType in the given shape.
5024 theShape Shape to count sub-shapes of.
5025 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5028 Quantity of sub-shapes of given type.
5030 # Example: see GEOM_TestOthers.py
5031 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5032 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5035 ## Gives quantity of solids in the given shape.
5036 # @param theShape Shape to count solids in.
5037 # @return Quantity of solids.
5039 # @ref swig_NumberOf "Example"
5040 @ManageTransactions("ShapesOp")
5041 def NumberOfSolids(self, theShape):
5043 Gives quantity of solids in the given shape.
5046 theShape Shape to count solids in.
5051 # Example: see GEOM_TestOthers.py
5052 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5053 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5059 ## @addtogroup l3_healing
5062 ## Reverses an orientation the given shape.
5063 # @param theShape Shape to be reversed.
5064 # @param theName Object name; when specified, this parameter is used
5065 # for result publication in the study. Otherwise, if automatic
5066 # publication is switched on, default value is used for result name.
5068 # @return The reversed copy of theShape.
5070 # @ref swig_ChangeOrientation "Example"
5071 @ManageTransactions("ShapesOp")
5072 def ChangeOrientation(self, theShape, theName=None):
5074 Reverses an orientation the given shape.
5077 theShape Shape to be reversed.
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 The reversed copy of theShape.
5085 # Example: see GEOM_TestAll.py
5086 anObj = self.ShapesOp.ChangeOrientation(theShape)
5087 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5088 self._autoPublish(anObj, theName, "reversed")
5091 ## See ChangeOrientation() method for details.
5093 # @ref swig_OrientationChange "Example"
5094 def OrientationChange(self, theShape, theName=None):
5096 See geompy.ChangeOrientation method for details.
5098 # Example: see GEOM_TestOthers.py
5099 # note: auto-publishing is done in self.ChangeOrientation()
5100 anObj = self.ChangeOrientation(theShape, theName)
5106 ## @addtogroup l4_obtain
5109 ## Retrieve all free faces from the given shape.
5110 # Free face is a face, which is not shared between two shells of the shape.
5111 # @param theShape Shape to find free faces in.
5112 # @return List of IDs of all free faces, contained in theShape.
5114 # @ref tui_free_faces_page "Example"
5115 @ManageTransactions("ShapesOp")
5116 def GetFreeFacesIDs(self,theShape):
5118 Retrieve all free faces from the given shape.
5119 Free face is a face, which is not shared between two shells of the shape.
5122 theShape Shape to find free faces in.
5125 List of IDs of all free faces, contained in theShape.
5127 # Example: see GEOM_TestOthers.py
5128 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5129 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5132 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5133 # @param theShape1 Shape to find sub-shapes in.
5134 # @param theShape2 Shape to find shared sub-shapes with.
5135 # @param theShapeType Type of sub-shapes to be retrieved.
5136 # @param theName Object name; when specified, this parameter is used
5137 # for result publication in the study. Otherwise, if automatic
5138 # publication is switched on, default value is used for result name.
5140 # @return List of sub-shapes of theShape1, shared with theShape2.
5142 # @ref swig_GetSharedShapes "Example"
5143 @ManageTransactions("ShapesOp")
5144 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5146 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5149 theShape1 Shape to find sub-shapes in.
5150 theShape2 Shape to find shared sub-shapes with.
5151 theShapeType Type of sub-shapes to be retrieved.
5152 theName Object name; when specified, this parameter is used
5153 for result publication in the study. Otherwise, if automatic
5154 publication is switched on, default value is used for result name.
5157 List of sub-shapes of theShape1, shared with theShape2.
5159 # Example: see GEOM_TestOthers.py
5160 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5161 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5162 self._autoPublish(aList, theName, "shared")
5165 ## Get sub-shapes, shared by input shapes.
5166 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5167 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5168 # @param theMultiShare Specifies what type of shares should be checked:
5169 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5170 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5171 # @param theName Object name; when specified, this parameter is used
5172 # for result publication in the study. Otherwise, if automatic
5173 # publication is switched on, default value is used for result name.
5175 # @note If @a theShapes contains single compound, the shares between all possible couples of
5176 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5177 # and all rest input shapes are returned.
5179 # @return List of all found sub-shapes.
5182 # - @ref tui_shared_shapes "Example 1"
5183 # - @ref swig_GetSharedShapes "Example 2"
5184 @ManageTransactions("ShapesOp")
5185 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5187 Get sub-shapes, shared by input shapes.
5190 theShapes Either a list or compound of shapes to find common sub-shapes of.
5191 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5192 theMultiShare Specifies what type of shares should be checked:
5193 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5194 - False: causes to search sub-shapes shared between couples of input shapes.
5195 theName Object name; when specified, this parameter is used
5196 for result publication in the study. Otherwise, if automatic
5197 publication is switched on, default value is used for result name.
5199 Note: if theShapes contains single compound, the shares between all possible couples of
5200 its top-level shapes are returned; otherwise, only shares between 1st input shape
5201 and all rest input shapes are returned.
5204 List of all found sub-shapes.
5206 # Example: see GEOM_TestOthers.py
5207 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5208 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5209 self._autoPublish(aList, theName, "shared")
5212 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5213 # situated relatively the specified plane by the certain way,
5214 # defined through <VAR>theState</VAR> parameter.
5215 # @param theShape Shape to find sub-shapes of.
5216 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5217 # @param theAx1 Vector (or line, or linear edge), specifying normal
5218 # direction and location of the plane to find shapes on.
5219 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5220 # @param theName Object name; when specified, this parameter is used
5221 # for result publication in the study. Otherwise, if automatic
5222 # publication is switched on, default value is used for result name.
5224 # @return List of all found sub-shapes.
5226 # @ref swig_GetShapesOnPlane "Example"
5227 @ManageTransactions("ShapesOp")
5228 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5230 Find in theShape all sub-shapes of type theShapeType,
5231 situated relatively the specified plane by the certain way,
5232 defined through theState parameter.
5235 theShape Shape to find sub-shapes of.
5236 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5237 theAx1 Vector (or line, or linear edge), specifying normal
5238 direction and location of the plane to find shapes on.
5239 theState The state of the sub-shapes to find (see GEOM::shape_state)
5240 theName Object name; when specified, this parameter is used
5241 for result publication in the study. Otherwise, if automatic
5242 publication is switched on, default value is used for result name.
5245 List of all found sub-shapes.
5247 # Example: see GEOM_TestOthers.py
5248 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5249 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5250 self._autoPublish(aList, theName, "shapeOnPlane")
5253 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5254 # situated relatively the specified plane by the certain way,
5255 # defined through <VAR>theState</VAR> parameter.
5256 # @param theShape Shape to find sub-shapes of.
5257 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5258 # @param theAx1 Vector (or line, or linear edge), specifying normal
5259 # direction and location of the plane to find shapes on.
5260 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5262 # @return List of all found sub-shapes indices.
5264 # @ref swig_GetShapesOnPlaneIDs "Example"
5265 @ManageTransactions("ShapesOp")
5266 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5268 Find in theShape all sub-shapes of type theShapeType,
5269 situated relatively the specified plane by the certain way,
5270 defined through theState parameter.
5273 theShape Shape to find sub-shapes of.
5274 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5275 theAx1 Vector (or line, or linear edge), specifying normal
5276 direction and location of the plane to find shapes on.
5277 theState The state of the sub-shapes to find (see GEOM::shape_state)
5280 List of all found sub-shapes indices.
5282 # Example: see GEOM_TestOthers.py
5283 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5284 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5287 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5288 # situated relatively the specified plane by the certain way,
5289 # defined through <VAR>theState</VAR> parameter.
5290 # @param theShape Shape to find sub-shapes of.
5291 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5292 # @param theAx1 Vector (or line, or linear edge), specifying normal
5293 # direction of the plane to find shapes on.
5294 # @param thePnt Point specifying location of the plane to find shapes on.
5295 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5296 # @param theName Object name; when specified, this parameter is used
5297 # for result publication in the study. Otherwise, if automatic
5298 # publication is switched on, default value is used for result name.
5300 # @return List of all found sub-shapes.
5302 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5303 @ManageTransactions("ShapesOp")
5304 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5306 Find in theShape all sub-shapes of type theShapeType,
5307 situated relatively the specified plane by the certain way,
5308 defined through theState parameter.
5311 theShape Shape to find sub-shapes of.
5312 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5313 theAx1 Vector (or line, or linear edge), specifying normal
5314 direction and location of the plane to find shapes on.
5315 thePnt Point specifying location of the plane to find shapes on.
5316 theState The state of the sub-shapes to find (see GEOM::shape_state)
5317 theName Object name; when specified, this parameter is used
5318 for result publication in the study. Otherwise, if automatic
5319 publication is switched on, default value is used for result name.
5322 List of all found sub-shapes.
5324 # Example: see GEOM_TestOthers.py
5325 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5326 theAx1, thePnt, theState)
5327 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5328 self._autoPublish(aList, theName, "shapeOnPlane")
5331 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5332 # situated relatively the specified plane by the certain way,
5333 # defined through <VAR>theState</VAR> parameter.
5334 # @param theShape Shape to find sub-shapes of.
5335 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5336 # @param theAx1 Vector (or line, or linear edge), specifying normal
5337 # direction of the plane to find shapes on.
5338 # @param thePnt Point specifying location of the plane to find shapes on.
5339 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5341 # @return List of all found sub-shapes indices.
5343 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5344 @ManageTransactions("ShapesOp")
5345 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5347 Find in theShape all sub-shapes of type theShapeType,
5348 situated relatively the specified plane by the certain way,
5349 defined through theState parameter.
5352 theShape Shape to find sub-shapes of.
5353 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5354 theAx1 Vector (or line, or linear edge), specifying normal
5355 direction and location of the plane to find shapes on.
5356 thePnt Point specifying location of the plane to find shapes on.
5357 theState The state of the sub-shapes to find (see GEOM::shape_state)
5360 List of all found sub-shapes indices.
5362 # Example: see GEOM_TestOthers.py
5363 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5364 theAx1, thePnt, theState)
5365 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5368 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5369 # the specified cylinder by the certain way, defined through \a theState parameter.
5370 # @param theShape Shape to find sub-shapes of.
5371 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5372 # @param theAxis Vector (or line, or linear edge), specifying
5373 # axis of the cylinder to find shapes on.
5374 # @param theRadius Radius of the cylinder to find shapes on.
5375 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5376 # @param theName Object name; when specified, this parameter is used
5377 # for result publication in the study. Otherwise, if automatic
5378 # publication is switched on, default value is used for result name.
5380 # @return List of all found sub-shapes.
5382 # @ref swig_GetShapesOnCylinder "Example"
5383 @ManageTransactions("ShapesOp")
5384 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5386 Find in theShape all sub-shapes of type theShapeType, situated relatively
5387 the specified cylinder by the certain way, defined through theState parameter.
5390 theShape Shape to find sub-shapes of.
5391 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5392 theAxis Vector (or line, or linear edge), specifying
5393 axis of the cylinder to find shapes on.
5394 theRadius Radius of the cylinder to find shapes on.
5395 theState The state of the sub-shapes to find (see GEOM::shape_state)
5396 theName Object name; when specified, this parameter is used
5397 for result publication in the study. Otherwise, if automatic
5398 publication is switched on, default value is used for result name.
5401 List of all found sub-shapes.
5403 # Example: see GEOM_TestOthers.py
5404 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5405 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5406 self._autoPublish(aList, theName, "shapeOnCylinder")
5409 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5410 # the specified cylinder by the certain way, defined through \a theState parameter.
5411 # @param theShape Shape to find sub-shapes of.
5412 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5413 # @param theAxis Vector (or line, or linear edge), specifying
5414 # axis of the cylinder to find shapes on.
5415 # @param theRadius Radius of the cylinder to find shapes on.
5416 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5418 # @return List of all found sub-shapes indices.
5420 # @ref swig_GetShapesOnCylinderIDs "Example"
5421 @ManageTransactions("ShapesOp")
5422 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5424 Find in theShape all sub-shapes of type theShapeType, situated relatively
5425 the specified cylinder by the certain way, defined through theState parameter.
5428 theShape Shape to find sub-shapes of.
5429 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5430 theAxis Vector (or line, or linear edge), specifying
5431 axis of the cylinder to find shapes on.
5432 theRadius Radius of the cylinder to find shapes on.
5433 theState The state of the sub-shapes to find (see GEOM::shape_state)
5436 List of all found sub-shapes indices.
5438 # Example: see GEOM_TestOthers.py
5439 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5440 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5443 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5444 # the specified cylinder by the certain way, defined through \a theState parameter.
5445 # @param theShape Shape to find sub-shapes of.
5446 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5447 # @param theAxis Vector (or line, or linear edge), specifying
5448 # axis of the cylinder to find shapes on.
5449 # @param thePnt Point specifying location of the bottom of the cylinder.
5450 # @param theRadius Radius of the cylinder to find shapes on.
5451 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5452 # @param theName Object name; when specified, this parameter is used
5453 # for result publication in the study. Otherwise, if automatic
5454 # publication is switched on, default value is used for result name.
5456 # @return List of all found sub-shapes.
5458 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5459 @ManageTransactions("ShapesOp")
5460 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5462 Find in theShape all sub-shapes of type theShapeType, situated relatively
5463 the specified cylinder by the certain way, defined through theState parameter.
5466 theShape Shape to find sub-shapes of.
5467 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5468 theAxis Vector (or line, or linear edge), specifying
5469 axis of the cylinder to find shapes on.
5470 theRadius Radius of the cylinder to find shapes on.
5471 theState The state of the sub-shapes to find (see GEOM::shape_state)
5472 theName Object name; when specified, this parameter is used
5473 for result publication in the study. Otherwise, if automatic
5474 publication is switched on, default value is used for result name.
5477 List of all found sub-shapes.
5479 # Example: see GEOM_TestOthers.py
5480 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5481 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5482 self._autoPublish(aList, theName, "shapeOnCylinder")
5485 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5486 # the specified cylinder by the certain way, defined through \a theState parameter.
5487 # @param theShape Shape to find sub-shapes of.
5488 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5489 # @param theAxis Vector (or line, or linear edge), specifying
5490 # axis of the cylinder to find shapes on.
5491 # @param thePnt Point specifying location of the bottom of the cylinder.
5492 # @param theRadius Radius of the cylinder to find shapes on.
5493 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5495 # @return List of all found sub-shapes indices
5497 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5498 @ManageTransactions("ShapesOp")
5499 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5501 Find in theShape all sub-shapes of type theShapeType, situated relatively
5502 the specified cylinder by the certain way, defined through theState parameter.
5505 theShape Shape to find sub-shapes of.
5506 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5507 theAxis Vector (or line, or linear edge), specifying
5508 axis of the cylinder to find shapes on.
5509 theRadius Radius of the cylinder to find shapes on.
5510 theState The state of the sub-shapes to find (see GEOM::shape_state)
5513 List of all found sub-shapes indices.
5515 # Example: see GEOM_TestOthers.py
5516 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5517 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5520 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5521 # the specified sphere by the certain way, defined through \a theState parameter.
5522 # @param theShape Shape to find sub-shapes of.
5523 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5524 # @param theCenter Point, specifying center of the sphere to find shapes on.
5525 # @param theRadius Radius of the sphere to find shapes on.
5526 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5527 # @param theName Object name; when specified, this parameter is used
5528 # for result publication in the study. Otherwise, if automatic
5529 # publication is switched on, default value is used for result name.
5531 # @return List of all found sub-shapes.
5533 # @ref swig_GetShapesOnSphere "Example"
5534 @ManageTransactions("ShapesOp")
5535 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5537 Find in theShape all sub-shapes of type theShapeType, situated relatively
5538 the specified sphere by the certain way, defined through theState parameter.
5541 theShape Shape to find sub-shapes of.
5542 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5543 theCenter Point, specifying center of the sphere to find shapes on.
5544 theRadius Radius of the sphere to find shapes on.
5545 theState The state of the sub-shapes to find (see GEOM::shape_state)
5546 theName Object name; when specified, this parameter is used
5547 for result publication in the study. Otherwise, if automatic
5548 publication is switched on, default value is used for result name.
5551 List of all found sub-shapes.
5553 # Example: see GEOM_TestOthers.py
5554 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5555 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5556 self._autoPublish(aList, theName, "shapeOnSphere")
5559 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5560 # the specified sphere by the certain way, defined through \a theState parameter.
5561 # @param theShape Shape to find sub-shapes of.
5562 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5563 # @param theCenter Point, specifying center of the sphere to find shapes on.
5564 # @param theRadius Radius of the sphere to find shapes on.
5565 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5567 # @return List of all found sub-shapes indices.
5569 # @ref swig_GetShapesOnSphereIDs "Example"
5570 @ManageTransactions("ShapesOp")
5571 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5573 Find in theShape all sub-shapes of type theShapeType, situated relatively
5574 the specified sphere by the certain way, defined through theState parameter.
5577 theShape Shape to find sub-shapes of.
5578 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5579 theCenter Point, specifying center of the sphere to find shapes on.
5580 theRadius Radius of the sphere to find shapes on.
5581 theState The state of the sub-shapes to find (see GEOM::shape_state)
5584 List of all found sub-shapes indices.
5586 # Example: see GEOM_TestOthers.py
5587 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5588 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5591 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5592 # the specified quadrangle by the certain way, defined through \a theState parameter.
5593 # @param theShape Shape to find sub-shapes of.
5594 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5595 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5596 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5597 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5598 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5599 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5600 # @param theName Object name; when specified, this parameter is used
5601 # for result publication in the study. Otherwise, if automatic
5602 # publication is switched on, default value is used for result name.
5604 # @return List of all found sub-shapes.
5606 # @ref swig_GetShapesOnQuadrangle "Example"
5607 @ManageTransactions("ShapesOp")
5608 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5609 theTopLeftPoint, theTopRigthPoint,
5610 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
5612 Find in theShape all sub-shapes of type theShapeType, situated relatively
5613 the specified quadrangle by the certain way, defined through theState parameter.
5616 theShape Shape to find sub-shapes of.
5617 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5618 theTopLeftPoint Point, specifying top left corner of a quadrangle
5619 theTopRigthPoint Point, specifying top right corner of a quadrangle
5620 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5621 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5622 theState The state of the sub-shapes to find (see GEOM::shape_state)
5623 theName Object name; when specified, this parameter is used
5624 for result publication in the study. Otherwise, if automatic
5625 publication is switched on, default value is used for result name.
5628 List of all found sub-shapes.
5630 # Example: see GEOM_TestOthers.py
5631 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5632 theTopLeftPoint, theTopRigthPoint,
5633 theBottomLeftPoint, theBottomRigthPoint, theState)
5634 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5635 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5638 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5639 # the specified quadrangle by the certain way, defined through \a theState parameter.
5640 # @param theShape Shape to find sub-shapes of.
5641 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5642 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5643 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
5644 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5645 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5646 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5648 # @return List of all found sub-shapes indices.
5650 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5651 @ManageTransactions("ShapesOp")
5652 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5653 theTopLeftPoint, theTopRigthPoint,
5654 theBottomLeftPoint, theBottomRigthPoint, theState):
5656 Find in theShape all sub-shapes of type theShapeType, situated relatively
5657 the specified quadrangle by the certain way, defined through theState parameter.
5660 theShape Shape to find sub-shapes of.
5661 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5662 theTopLeftPoint Point, specifying top left corner of a quadrangle
5663 theTopRigthPoint Point, specifying top right corner of a quadrangle
5664 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5665 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
5666 theState The state of the sub-shapes to find (see GEOM::shape_state)
5669 List of all found sub-shapes indices.
5672 # Example: see GEOM_TestOthers.py
5673 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5674 theTopLeftPoint, theTopRigthPoint,
5675 theBottomLeftPoint, theBottomRigthPoint, theState)
5676 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5679 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5680 # the specified \a theBox by the certain way, defined through \a theState parameter.
5681 # @param theBox Shape for relative comparing.
5682 # @param theShape Shape to find sub-shapes of.
5683 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5684 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5685 # @param theName Object name; when specified, this parameter is used
5686 # for result publication in the study. Otherwise, if automatic
5687 # publication is switched on, default value is used for result name.
5689 # @return List of all found sub-shapes.
5691 # @ref swig_GetShapesOnBox "Example"
5692 @ManageTransactions("ShapesOp")
5693 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5695 Find in theShape all sub-shapes of type theShapeType, situated relatively
5696 the specified theBox by the certain way, defined through theState parameter.
5699 theBox Shape for relative comparing.
5700 theShape Shape to find sub-shapes of.
5701 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5702 theState The state of the sub-shapes to find (see GEOM::shape_state)
5703 theName Object name; when specified, this parameter is used
5704 for result publication in the study. Otherwise, if automatic
5705 publication is switched on, default value is used for result name.
5708 List of all found sub-shapes.
5710 # Example: see GEOM_TestOthers.py
5711 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5712 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5713 self._autoPublish(aList, theName, "shapeOnBox")
5716 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5717 # the specified \a theBox by the certain way, defined through \a theState parameter.
5718 # @param theBox Shape for relative comparing.
5719 # @param theShape Shape to find sub-shapes of.
5720 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5721 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5723 # @return List of all found sub-shapes indices.
5725 # @ref swig_GetShapesOnBoxIDs "Example"
5726 @ManageTransactions("ShapesOp")
5727 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5729 Find in theShape all sub-shapes of type theShapeType, situated relatively
5730 the specified theBox by the certain way, defined through theState parameter.
5733 theBox Shape for relative comparing.
5734 theShape Shape to find sub-shapes of.
5735 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5736 theState The state of the sub-shapes to find (see GEOM::shape_state)
5739 List of all found sub-shapes indices.
5741 # Example: see GEOM_TestOthers.py
5742 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5743 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5746 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5747 # situated relatively the specified \a theCheckShape by the
5748 # certain way, defined through \a theState parameter.
5749 # @param theCheckShape Shape for relative comparing. It must be a solid.
5750 # @param theShape Shape to find sub-shapes of.
5751 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5752 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5753 # @param theName Object name; when specified, this parameter is used
5754 # for result publication in the study. Otherwise, if automatic
5755 # publication is switched on, default value is used for result name.
5757 # @return List of all found sub-shapes.
5759 # @ref swig_GetShapesOnShape "Example"
5760 @ManageTransactions("ShapesOp")
5761 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5763 Find in theShape all sub-shapes of type theShapeType,
5764 situated relatively the specified theCheckShape by the
5765 certain way, defined through theState parameter.
5768 theCheckShape Shape for relative comparing. It must be a solid.
5769 theShape Shape to find sub-shapes of.
5770 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5771 theState The state of the sub-shapes to find (see GEOM::shape_state)
5772 theName Object name; when specified, this parameter is used
5773 for result publication in the study. Otherwise, if automatic
5774 publication is switched on, default value is used for result name.
5777 List of all found sub-shapes.
5779 # Example: see GEOM_TestOthers.py
5780 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5781 theShapeType, theState)
5782 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5783 self._autoPublish(aList, theName, "shapeOnShape")
5786 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5787 # situated relatively the specified \a theCheckShape by the
5788 # certain way, defined through \a theState parameter.
5789 # @param theCheckShape Shape for relative comparing. It must be a solid.
5790 # @param theShape Shape to find sub-shapes of.
5791 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5792 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5793 # @param theName Object name; when specified, this parameter is used
5794 # for result publication in the study. Otherwise, if automatic
5795 # publication is switched on, default value is used for result name.
5797 # @return All found sub-shapes as compound.
5799 # @ref swig_GetShapesOnShapeAsCompound "Example"
5800 @ManageTransactions("ShapesOp")
5801 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5803 Find in theShape all sub-shapes of type theShapeType,
5804 situated relatively the specified theCheckShape by the
5805 certain way, defined through theState parameter.
5808 theCheckShape Shape for relative comparing. It must be a solid.
5809 theShape Shape to find sub-shapes of.
5810 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5811 theState The state of the sub-shapes to find (see GEOM::shape_state)
5812 theName Object name; when specified, this parameter is used
5813 for result publication in the study. Otherwise, if automatic
5814 publication is switched on, default value is used for result name.
5817 All found sub-shapes as compound.
5819 # Example: see GEOM_TestOthers.py
5820 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5821 theShapeType, theState)
5822 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5823 self._autoPublish(anObj, theName, "shapeOnShape")
5826 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5827 # situated relatively the specified \a theCheckShape by the
5828 # certain way, defined through \a theState parameter.
5829 # @param theCheckShape Shape for relative comparing. It must be a solid.
5830 # @param theShape Shape to find sub-shapes of.
5831 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5832 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5834 # @return List of all found sub-shapes indices.
5836 # @ref swig_GetShapesOnShapeIDs "Example"
5837 @ManageTransactions("ShapesOp")
5838 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5840 Find in theShape all sub-shapes of type theShapeType,
5841 situated relatively the specified theCheckShape by the
5842 certain way, defined through theState parameter.
5845 theCheckShape Shape for relative comparing. It must be a solid.
5846 theShape Shape to find sub-shapes of.
5847 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5848 theState The state of the sub-shapes to find (see GEOM::shape_state)
5851 List of all found sub-shapes indices.
5853 # Example: see GEOM_TestOthers.py
5854 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5855 theShapeType, theState)
5856 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5859 ## Get sub-shape(s) of theShapeWhere, which are
5860 # coincident with \a theShapeWhat or could be a part of it.
5861 # @param theShapeWhere Shape to find sub-shapes of.
5862 # @param theShapeWhat Shape, specifying what to find.
5863 # @param isNewImplementation implementation of GetInPlace functionality
5864 # (default = False, old alghorithm based on shape properties)
5865 # @param theName Object name; when specified, this parameter is used
5866 # for result publication in the study. Otherwise, if automatic
5867 # publication is switched on, default value is used for result name.
5869 # @return Group of all found sub-shapes or a single found sub-shape.
5871 # @note This function has a restriction on argument shapes.
5872 # If \a theShapeWhere has curved parts with significantly
5873 # outstanding centres (i.e. the mass centre of a part is closer to
5874 # \a theShapeWhat than to the part), such parts will not be found.
5875 # @image html get_in_place_lost_part.png
5877 # @ref swig_GetInPlace "Example"
5878 @ManageTransactions("ShapesOp")
5879 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5881 Get sub-shape(s) of theShapeWhere, which are
5882 coincident with theShapeWhat or could be a part of it.
5885 theShapeWhere Shape to find sub-shapes of.
5886 theShapeWhat Shape, specifying what to find.
5887 isNewImplementation Implementation of GetInPlace functionality
5888 (default = False, old alghorithm based on shape properties)
5889 theName Object name; when specified, this parameter is used
5890 for result publication in the study. Otherwise, if automatic
5891 publication is switched on, default value is used for result name.
5894 Group of all found sub-shapes or a single found sub-shape.
5898 This function has a restriction on argument shapes.
5899 If theShapeWhere has curved parts with significantly
5900 outstanding centres (i.e. the mass centre of a part is closer to
5901 theShapeWhat than to the part), such parts will not be found.
5903 # Example: see GEOM_TestOthers.py
5905 if isNewImplementation:
5906 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5908 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5910 RaiseIfFailed("GetInPlace", self.ShapesOp)
5911 self._autoPublish(anObj, theName, "inplace")
5914 ## Get sub-shape(s) of \a theShapeWhere, which are
5915 # coincident with \a theShapeWhat or could be a part of it.
5917 # Implementation of this method is based on a saved history of an operation,
5918 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5919 # arguments (an argument shape or a sub-shape of an argument shape).
5920 # The operation could be the Partition or one of boolean operations,
5921 # performed on simple shapes (not on compounds).
5923 # @param theShapeWhere Shape to find sub-shapes of.
5924 # @param theShapeWhat Shape, specifying what to find (must be in the
5925 # building history of the ShapeWhere).
5926 # @param theName Object name; when specified, this parameter is used
5927 # for result publication in the study. Otherwise, if automatic
5928 # publication is switched on, default value is used for result name.
5930 # @return Group of all found sub-shapes or a single found sub-shape.
5932 # @ref swig_GetInPlace "Example"
5933 @ManageTransactions("ShapesOp")
5934 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5936 Implementation of this method is based on a saved history of an operation,
5937 produced theShapeWhere. The theShapeWhat must be among this operation's
5938 arguments (an argument shape or a sub-shape of an argument shape).
5939 The operation could be the Partition or one of boolean operations,
5940 performed on simple shapes (not on compounds).
5943 theShapeWhere Shape to find sub-shapes of.
5944 theShapeWhat Shape, specifying what to find (must be in the
5945 building history of the ShapeWhere).
5946 theName Object name; when specified, this parameter is used
5947 for result publication in the study. Otherwise, if automatic
5948 publication is switched on, default value is used for result name.
5951 Group of all found sub-shapes or a single found sub-shape.
5953 # Example: see GEOM_TestOthers.py
5954 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5955 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5956 self._autoPublish(anObj, theName, "inplace")
5959 ## Get sub-shape of theShapeWhere, which is
5960 # equal to \a theShapeWhat.
5961 # @param theShapeWhere Shape to find sub-shape of.
5962 # @param theShapeWhat Shape, specifying what to find.
5963 # @param theName Object name; when specified, this parameter is used
5964 # for result publication in the study. Otherwise, if automatic
5965 # publication is switched on, default value is used for result name.
5967 # @return New GEOM.GEOM_Object for found sub-shape.
5969 # @ref swig_GetSame "Example"
5970 @ManageTransactions("ShapesOp")
5971 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5973 Get sub-shape of theShapeWhere, which is
5974 equal to theShapeWhat.
5977 theShapeWhere Shape to find sub-shape of.
5978 theShapeWhat Shape, specifying what to find.
5979 theName Object name; when specified, this parameter is used
5980 for result publication in the study. Otherwise, if automatic
5981 publication is switched on, default value is used for result name.
5984 New GEOM.GEOM_Object for found sub-shape.
5986 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5987 RaiseIfFailed("GetSame", self.ShapesOp)
5988 self._autoPublish(anObj, theName, "sameShape")
5992 ## Get sub-shape indices of theShapeWhere, which is
5993 # equal to \a theShapeWhat.
5994 # @param theShapeWhere Shape to find sub-shape of.
5995 # @param theShapeWhat Shape, specifying what to find.
5996 # @return List of all found sub-shapes indices.
5998 # @ref swig_GetSame "Example"
5999 @ManageTransactions("ShapesOp")
6000 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6002 Get sub-shape indices of theShapeWhere, which is
6003 equal to theShapeWhat.
6006 theShapeWhere Shape to find sub-shape of.
6007 theShapeWhat Shape, specifying what to find.
6010 List of all found sub-shapes indices.
6012 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6013 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6016 ## Resize the input edge with the new Min and Max parameters.
6017 # The input edge parameters range is [0, 1]. If theMin parameter is
6018 # negative, the input edge is extended, otherwise it is shrinked by
6019 # theMin parameter. If theMax is greater than 1, the edge is extended,
6020 # otherwise it is shrinked by theMax parameter.
6021 # @param theEdge the input edge to be resized.
6022 # @param theMin the minimal parameter value.
6023 # @param theMax the maximal parameter value.
6024 # @param theName Object name; when specified, this parameter is used
6025 # for result publication in the study. Otherwise, if automatic
6026 # publication is switched on, default value is used for result name.
6027 # @return New GEOM.GEOM_Object, containing the created edge.
6029 # @ref tui_extend "Example"
6030 @ManageTransactions("ShapesOp")
6031 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6033 Resize the input edge with the new Min and Max parameters.
6034 The input edge parameters range is [0, 1]. If theMin parameter is
6035 negative, the input edge is extended, otherwise it is shrinked by
6036 theMin parameter. If theMax is greater than 1, the edge is extended,
6037 otherwise it is shrinked by theMax parameter.
6040 theEdge the input edge to be resized.
6041 theMin the minimal parameter value.
6042 theMax the maximal parameter value.
6043 theName Object name; when specified, this parameter is used
6044 for result publication in the study. Otherwise, if automatic
6045 publication is switched on, default value is used for result name.
6048 New GEOM.GEOM_Object, containing the created edge.
6050 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6051 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6052 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6053 anObj.SetParameters(Parameters)
6054 self._autoPublish(anObj, theName, "edge")
6057 ## Resize the input face with the new UMin, UMax, VMin and VMax
6058 # parameters. The input face U and V parameters range is [0, 1]. If
6059 # theUMin parameter is negative, the input face is extended, otherwise
6060 # it is shrinked along U direction by theUMin parameter. If theUMax is
6061 # greater than 1, the face is extended, otherwise it is shrinked along
6062 # U direction by theUMax parameter. So as for theVMin, theVMax and
6063 # V direction of the input face.
6064 # @param theFace the input face to be resized.
6065 # @param theUMin the minimal U parameter value.
6066 # @param theUMax the maximal U parameter value.
6067 # @param theVMin the minimal V parameter value.
6068 # @param theVMax the maximal V parameter value.
6069 # @param theName Object name; when specified, this parameter is used
6070 # for result publication in the study. Otherwise, if automatic
6071 # publication is switched on, default value is used for result name.
6072 # @return New GEOM.GEOM_Object, containing the created face.
6074 # @ref tui_extend "Example"
6075 @ManageTransactions("ShapesOp")
6076 def ExtendFace(self, theFace, theUMin, theUMax,
6077 theVMin, theVMax, theName=None):
6079 Resize the input face with the new UMin, UMax, VMin and VMax
6080 parameters. The input face U and V parameters range is [0, 1]. If
6081 theUMin parameter is negative, the input face is extended, otherwise
6082 it is shrinked along U direction by theUMin parameter. If theUMax is
6083 greater than 1, the face is extended, otherwise it is shrinked along
6084 U direction by theUMax parameter. So as for theVMin, theVMax and
6085 V direction of the input face.
6088 theFace the input face to be resized.
6089 theUMin the minimal U parameter value.
6090 theUMax the maximal U parameter value.
6091 theVMin the minimal V parameter value.
6092 theVMax the maximal V parameter value.
6093 theName Object name; when specified, this parameter is used
6094 for result publication in the study. Otherwise, if automatic
6095 publication is switched on, default value is used for result name.
6098 New GEOM.GEOM_Object, containing the created face.
6100 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6101 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6103 RaiseIfFailed("ExtendFace", self.ShapesOp)
6104 anObj.SetParameters(Parameters)
6105 self._autoPublish(anObj, theName, "face")
6108 ## This function takes some face as input parameter and creates new
6109 # GEOM_Object, i.e. topological shape by extracting underlying surface
6110 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6111 # parameters of the source face (in the parametrical space).
6112 # @param theFace the input face.
6113 # @param theName Object name; when specified, this parameter is used
6114 # for result publication in the study. Otherwise, if automatic
6115 # publication is switched on, default value is used for result name.
6116 # @return New GEOM.GEOM_Object, containing the created face.
6118 # @ref tui_creation_surface "Example"
6119 @ManageTransactions("ShapesOp")
6120 def MakeSurfaceFromFace(self, theFace, theName=None):
6122 This function takes some face as input parameter and creates new
6123 GEOM_Object, i.e. topological shape by extracting underlying surface
6124 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6125 parameters of the source face (in the parametrical space).
6128 theFace the input face.
6129 theName Object name; when specified, this parameter is used
6130 for result publication in the study. Otherwise, if automatic
6131 publication is switched on, default value is used for result name.
6134 New GEOM.GEOM_Object, containing the created face.
6136 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6137 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6138 self._autoPublish(anObj, theName, "surface")
6144 ## @addtogroup l4_access
6147 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6148 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6149 # @param aShape Shape to get sub-shape of.
6150 # @param ListOfID List of sub-shapes indices.
6151 # @param theName Object name; when specified, this parameter is used
6152 # for result publication in the study. Otherwise, if automatic
6153 # publication is switched on, default value is used for result name.
6155 # @return Found sub-shape.
6157 # @ref swig_all_decompose "Example"
6158 def GetSubShape(self, aShape, ListOfID, theName=None):
6160 Obtain a composite sub-shape of aShape, composed from sub-shapes
6161 of aShape, selected by their unique IDs inside aShape
6164 aShape Shape to get sub-shape of.
6165 ListOfID List of sub-shapes indices.
6166 theName Object name; when specified, this parameter is used
6167 for result publication in the study. Otherwise, if automatic
6168 publication is switched on, default value is used for result name.
6173 # Example: see GEOM_TestAll.py
6174 anObj = self.AddSubShape(aShape,ListOfID)
6175 self._autoPublish(anObj, theName, "subshape")
6178 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6179 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6180 # @param aShape Shape to get sub-shape of.
6181 # @param aSubShape Sub-shapes of aShape.
6182 # @return ID of found sub-shape.
6184 # @ref swig_all_decompose "Example"
6185 @ManageTransactions("LocalOp")
6186 def GetSubShapeID(self, aShape, aSubShape):
6188 Obtain unique ID of sub-shape aSubShape inside aShape
6189 of aShape, selected by their unique IDs inside aShape
6192 aShape Shape to get sub-shape of.
6193 aSubShape Sub-shapes of aShape.
6196 ID of found sub-shape.
6198 # Example: see GEOM_TestAll.py
6199 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6200 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6203 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6204 # This function is provided for performance purpose. The complexity is O(n) with n
6205 # the number of subobjects of aShape
6206 # @param aShape Shape to get sub-shape of.
6207 # @param aSubShapes Sub-shapes of aShape.
6208 # @return list of IDs of found sub-shapes.
6210 # @ref swig_all_decompose "Example"
6211 @ManageTransactions("ShapesOp")
6212 def GetSubShapesIDs(self, aShape, aSubShapes):
6214 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6215 This function is provided for performance purpose. The complexity is O(n) with n
6216 the number of subobjects of aShape
6219 aShape Shape to get sub-shape of.
6220 aSubShapes Sub-shapes of aShape.
6223 List of IDs of found sub-shape.
6225 # Example: see GEOM_TestAll.py
6226 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6227 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6233 ## @addtogroup l4_decompose
6236 ## Get all sub-shapes and groups of \a theShape,
6237 # that were created already by any other methods.
6238 # @param theShape Any shape.
6239 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6240 # returned, else all found sub-shapes and groups.
6241 # @return List of existing sub-objects of \a theShape.
6243 # @ref swig_all_decompose "Example"
6244 @ManageTransactions("ShapesOp")
6245 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6247 Get all sub-shapes and groups of theShape,
6248 that were created already by any other methods.
6252 theGroupsOnly If this parameter is TRUE, only groups will be
6253 returned, else all found sub-shapes and groups.
6256 List of existing sub-objects of theShape.
6258 # Example: see GEOM_TestAll.py
6259 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6260 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6263 ## Get all groups of \a theShape,
6264 # that were created already by any other methods.
6265 # @param theShape Any shape.
6266 # @return List of existing groups of \a theShape.
6268 # @ref swig_all_decompose "Example"
6269 @ManageTransactions("ShapesOp")
6270 def GetGroups(self, theShape):
6272 Get all groups of theShape,
6273 that were created already by any other methods.
6279 List of existing groups of theShape.
6281 # Example: see GEOM_TestAll.py
6282 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6283 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6286 ## Explode a shape on sub-shapes of a given type.
6287 # If the shape itself matches the type, it is also returned.
6288 # @param aShape Shape to be exploded.
6289 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6290 # @param theName Object name; when specified, this parameter is used
6291 # for result publication in the study. Otherwise, if automatic
6292 # publication is switched on, default value is used for result name.
6294 # @return List of sub-shapes of type theShapeType, contained in theShape.
6296 # @ref swig_all_decompose "Example"
6297 @ManageTransactions("ShapesOp")
6298 def SubShapeAll(self, aShape, aType, theName=None):
6300 Explode a shape on sub-shapes of a given type.
6301 If the shape itself matches the type, it is also returned.
6304 aShape Shape to be exploded.
6305 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6306 theName Object name; when specified, this parameter is used
6307 for result publication in the study. Otherwise, if automatic
6308 publication is switched on, default value is used for result name.
6311 List of sub-shapes of type theShapeType, contained in theShape.
6313 # Example: see GEOM_TestAll.py
6314 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6315 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6316 self._autoPublish(ListObj, theName, "subshape")
6319 ## Explode a shape on sub-shapes of a given type.
6320 # @param aShape Shape to be exploded.
6321 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6322 # @return List of IDs of sub-shapes.
6324 # @ref swig_all_decompose "Example"
6325 @ManageTransactions("ShapesOp")
6326 def SubShapeAllIDs(self, aShape, aType):
6328 Explode a shape on sub-shapes of a given type.
6331 aShape Shape to be exploded (see geompy.ShapeType)
6332 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6335 List of IDs of sub-shapes.
6337 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6338 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6341 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6342 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6343 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6344 # @param aShape Shape to get sub-shape of.
6345 # @param ListOfInd List of sub-shapes indices.
6346 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6347 # @param theName Object name; when specified, this parameter is used
6348 # for result publication in the study. Otherwise, if automatic
6349 # publication is switched on, default value is used for result name.
6351 # @return A compound of sub-shapes of aShape.
6353 # @ref swig_all_decompose "Example"
6354 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6356 Obtain a compound of sub-shapes of aShape,
6357 selected by their indices in list of all sub-shapes of type aType.
6358 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6361 aShape Shape to get sub-shape of.
6362 ListOfID List of sub-shapes indices.
6363 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6364 theName Object name; when specified, this parameter is used
6365 for result publication in the study. Otherwise, if automatic
6366 publication is switched on, default value is used for result name.
6369 A compound of sub-shapes of aShape.
6371 # Example: see GEOM_TestAll.py
6373 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6374 for ind in ListOfInd:
6375 ListOfIDs.append(AllShapeIDsList[ind - 1])
6376 # note: auto-publishing is done in self.GetSubShape()
6377 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6380 ## Explode a shape on sub-shapes of a given type.
6381 # Sub-shapes will be sorted taking into account their gravity centers,
6382 # to provide stable order of sub-shapes.
6383 # If the shape itself matches the type, it is also returned.
6384 # @param aShape Shape to be exploded.
6385 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6386 # @param theName Object name; when specified, this parameter is used
6387 # for result publication in the study. Otherwise, if automatic
6388 # publication is switched on, default value is used for result name.
6390 # @return List of sub-shapes of type theShapeType, contained in theShape.
6392 # @ref swig_SubShapeAllSorted "Example"
6393 @ManageTransactions("ShapesOp")
6394 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6396 Explode a shape on sub-shapes of a given type.
6397 Sub-shapes will be sorted taking into account their gravity centers,
6398 to provide stable order of sub-shapes.
6399 If the shape itself matches the type, it is also returned.
6402 aShape Shape to be exploded.
6403 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6404 theName Object name; when specified, this parameter is used
6405 for result publication in the study. Otherwise, if automatic
6406 publication is switched on, default value is used for result name.
6409 List of sub-shapes of type theShapeType, contained in theShape.
6411 # Example: see GEOM_TestAll.py
6412 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6413 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6414 self._autoPublish(ListObj, theName, "subshape")
6417 ## Explode a shape on sub-shapes of a given type.
6418 # Sub-shapes will be sorted taking into account their gravity centers,
6419 # to provide stable order of sub-shapes.
6420 # @param aShape Shape to be exploded.
6421 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6422 # @return List of IDs of sub-shapes.
6424 # @ref swig_all_decompose "Example"
6425 @ManageTransactions("ShapesOp")
6426 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6428 Explode a shape on sub-shapes of a given type.
6429 Sub-shapes will be sorted taking into account their gravity centers,
6430 to provide stable order of sub-shapes.
6433 aShape Shape to be exploded.
6434 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6437 List of IDs of sub-shapes.
6439 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6440 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6443 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6444 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6445 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6446 # @param aShape Shape to get sub-shape of.
6447 # @param ListOfInd List of sub-shapes indices.
6448 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6449 # @param theName Object name; when specified, this parameter is used
6450 # for result publication in the study. Otherwise, if automatic
6451 # publication is switched on, default value is used for result name.
6453 # @return A compound of sub-shapes of aShape.
6455 # @ref swig_all_decompose "Example"
6456 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6458 Obtain a compound of sub-shapes of aShape,
6459 selected by they indices in sorted list of all sub-shapes of type aType.
6460 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6463 aShape Shape to get sub-shape of.
6464 ListOfID List of sub-shapes indices.
6465 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6466 theName Object name; when specified, this parameter is used
6467 for result publication in the study. Otherwise, if automatic
6468 publication is switched on, default value is used for result name.
6471 A compound of sub-shapes of aShape.
6473 # Example: see GEOM_TestAll.py
6475 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6476 for ind in ListOfInd:
6477 ListOfIDs.append(AllShapeIDsList[ind - 1])
6478 # note: auto-publishing is done in self.GetSubShape()
6479 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6482 ## Extract shapes (excluding the main shape) of given type.
6483 # @param aShape The shape.
6484 # @param aType The shape type (see ShapeType())
6485 # @param isSorted Boolean flag to switch sorting on/off.
6486 # @param theName Object name; when specified, this parameter is used
6487 # for result publication in the study. Otherwise, if automatic
6488 # publication is switched on, default value is used for result name.
6490 # @return List of sub-shapes of type aType, contained in aShape.
6492 # @ref swig_FilletChamfer "Example"
6493 @ManageTransactions("ShapesOp")
6494 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6496 Extract shapes (excluding the main shape) of given type.
6500 aType The shape type (see geompy.ShapeType)
6501 isSorted Boolean flag to switch sorting on/off.
6502 theName Object name; when specified, this parameter is used
6503 for result publication in the study. Otherwise, if automatic
6504 publication is switched on, default value is used for result name.
6507 List of sub-shapes of type aType, contained in aShape.
6509 # Example: see GEOM_TestAll.py
6510 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6511 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6512 self._autoPublish(ListObj, theName, "subshape")
6515 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6516 # @param aShape Main shape.
6517 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6518 # @param theName Object name; when specified, this parameter is used
6519 # for result publication in the study. Otherwise, if automatic
6520 # publication is switched on, default value is used for result name.
6521 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6523 # @ref swig_all_decompose "Example"
6524 @ManageTransactions("ShapesOp")
6525 def SubShapes(self, aShape, anIDs, theName=None):
6527 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6531 anIDs List of unique IDs of sub-shapes inside theMainShape.
6532 theName Object name; when specified, this parameter is used
6533 for result publication in the study. Otherwise, if automatic
6534 publication is switched on, default value is used for result name.
6537 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6539 # Example: see GEOM_TestAll.py
6540 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6541 RaiseIfFailed("SubShapes", self.ShapesOp)
6542 self._autoPublish(ListObj, theName, "subshape")
6545 ## Explode a shape into edges sorted in a row from a starting point.
6546 # @param theShape the shape to be exploded on edges.
6547 # @param theStartPoint the starting point.
6548 # @param theName Object name; when specified, this parameter is used
6549 # for result publication in the study. Otherwise, if automatic
6550 # publication is switched on, default value is used for result name.
6551 # @return List of GEOM.GEOM_Object that is actually an ordered list
6552 # of edges sorted in a row from a starting point.
6554 # @ref swig_GetSubShapeEdgeSorted "Example"
6555 @ManageTransactions("ShapesOp")
6556 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6558 Explode a shape into edges sorted in a row from a starting point.
6561 theShape the shape to be exploded on edges.
6562 theStartPoint the starting point.
6563 theName Object name; when specified, this parameter is used
6564 for result publication in the study. Otherwise, if automatic
6565 publication is switched on, default value is used for result name.
6568 List of GEOM.GEOM_Object that is actually an ordered list
6569 of edges sorted in a row from a starting point.
6571 # Example: see GEOM_TestAll.py
6572 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6573 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6574 self._autoPublish(ListObj, theName, "SortedEdges")
6578 # Return the list of subshapes that satisfies a certain tolerance
6579 # criterion. The user defines the type of shapes to be returned, the
6580 # condition and the tolerance value. The operation is defined for
6581 # faces, edges and vertices only. E.g. for theShapeType FACE,
6582 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6583 # all faces of theShape that have tolerances greater then 1.e7.
6585 # @param theShape the shape to be exploded
6586 # @param theShapeType the type of sub-shapes to be returned (see
6587 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6588 # @param theCondition the condition type (see GEOM::comparison_condition).
6589 # @param theTolerance the tolerance filter.
6590 # @param theName Object name; when specified, this parameter is used
6591 # for result publication in the study. Otherwise, if automatic
6592 # publication is switched on, default value is used for result name.
6593 # @return the list of shapes that satisfy the conditions.
6595 # @ref swig_GetSubShapesWithTolerance "Example"
6596 @ManageTransactions("ShapesOp")
6597 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6598 theCondition, theTolerance, theName=None):
6600 Return the list of subshapes that satisfies a certain tolerance
6601 criterion. The user defines the type of shapes to be returned, the
6602 condition and the tolerance value. The operation is defined for
6603 faces, edges and vertices only. E.g. for theShapeType FACE,
6604 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6605 all faces of theShape that have tolerances greater then 1.e7.
6608 theShape the shape to be exploded
6609 theShapeType the type of sub-shapes to be returned (see
6610 ShapeType()). Can have the values FACE,
6611 EDGE and VERTEX only.
6612 theCondition the condition type (see GEOM::comparison_condition).
6613 theTolerance the tolerance filter.
6614 theName Object name; when specified, this parameter is used
6615 for result publication in the study. Otherwise, if automatic
6616 publication is switched on, default value is used for result name.
6619 The list of shapes that satisfy the conditions.
6621 # Example: see GEOM_TestAll.py
6622 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6623 theCondition, theTolerance)
6624 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6625 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6628 ## Check if the object is a sub-object of another GEOM object.
6629 # @param aSubObject Checked sub-object (or its parent object, in case if
6630 # \a theSubObjectIndex is non-zero).
6631 # @param anObject An object that is checked for ownership (or its parent object,
6632 # in case if \a theObjectIndex is non-zero).
6633 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6634 # identifies a sub-object within its parent specified via \a theSubObject.
6635 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6636 # identifies an object within its parent specified via \a theObject.
6637 # @return TRUE, if the given object contains sub-object.
6638 @ManageTransactions("ShapesOp")
6639 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6641 Check if the object is a sub-object of another GEOM object.
6644 aSubObject Checked sub-object (or its parent object, in case if
6645 \a theSubObjectIndex is non-zero).
6646 anObject An object that is checked for ownership (or its parent object,
6647 in case if \a theObjectIndex is non-zero).
6648 aSubObjectIndex When non-zero, specifies a sub-shape index that
6649 identifies a sub-object within its parent specified via \a theSubObject.
6650 anObjectIndex When non-zero, specifies a sub-shape index that
6651 identifies an object within its parent specified via \a theObject.
6654 TRUE, if the given object contains sub-object.
6656 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6657 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6660 # end of l4_decompose
6663 ## @addtogroup l4_decompose_d
6666 ## Deprecated method
6667 # It works like SubShapeAllSortedCentres(), but wrongly
6668 # defines centres of faces, shells and solids.
6669 @ManageTransactions("ShapesOp")
6670 def SubShapeAllSorted(self, aShape, aType, theName=None):
6673 It works like geompy.SubShapeAllSortedCentres, but wrongly
6674 defines centres of faces, shells and solids.
6676 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6677 RaiseIfFailed("MakeExplode", self.ShapesOp)
6678 self._autoPublish(ListObj, theName, "subshape")
6681 ## Deprecated method
6682 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6683 # defines centres of faces, shells and solids.
6684 @ManageTransactions("ShapesOp")
6685 def SubShapeAllSortedIDs(self, aShape, aType):
6688 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6689 defines centres of faces, shells and solids.
6691 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6692 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6695 ## Deprecated method
6696 # It works like SubShapeSortedCentres(), but has a bug
6697 # (wrongly defines centres of faces, shells and solids).
6698 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6701 It works like geompy.SubShapeSortedCentres, but has a bug
6702 (wrongly defines centres of faces, shells and solids).
6705 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6706 for ind in ListOfInd:
6707 ListOfIDs.append(AllShapeIDsList[ind - 1])
6708 # note: auto-publishing is done in self.GetSubShape()
6709 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6712 # end of l4_decompose_d
6715 ## @addtogroup l3_healing
6718 ## Apply a sequence of Shape Healing operators to the given object.
6719 # @param theShape Shape to be processed.
6720 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6721 # @param theParameters List of names of parameters
6722 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6723 # @param theValues List of values of parameters, in the same order
6724 # as parameters are listed in <VAR>theParameters</VAR> list.
6725 # @param theName Object name; when specified, this parameter is used
6726 # for result publication in the study. Otherwise, if automatic
6727 # publication is switched on, default value is used for result name.
6729 # <b> Operators and Parameters: </b> \n
6731 # * \b FixShape - corrects invalid shapes. \n
6732 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6733 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6735 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6736 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6737 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6738 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6739 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6740 # - \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
6741 # - \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
6742 # - \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
6744 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6745 # surfaces in segments using a certain angle. \n
6746 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6747 # if Angle=180, four if Angle=90, etc). \n
6748 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6750 # * \b SplitClosedFaces - splits closed faces in segments.
6751 # The number of segments depends on the number of splitting points.\n
6752 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6754 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6755 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6756 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6757 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6758 # This and the previous parameters can take the following values:\n
6759 # \b Parametric \b Continuity \n
6760 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6761 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6762 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6763 # ruling out sharp edges).\n
6764 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6765 # are of the same magnitude).\n
6766 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6767 # or surfaces (d/du C(u)) are the same at junction. \n
6768 # \b Geometric \b Continuity \n
6769 # \b G1: first derivatives are proportional at junction.\n
6770 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6771 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6772 # \b G2: first and second derivatives are proportional at junction.
6773 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6774 # continuity requires that the underlying parameterization was continuous as well.
6775 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6777 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6778 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6779 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6780 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6781 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6782 # with the specified parameters.\n
6783 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6784 # with the specified parameters.\n
6785 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6786 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6787 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6788 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6790 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6791 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6792 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6793 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6794 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6796 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6797 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6800 # @return New GEOM.GEOM_Object, containing processed shape.
6802 # \n @ref tui_shape_processing "Example"
6803 @ManageTransactions("HealOp")
6804 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6806 Apply a sequence of Shape Healing operators to the given object.
6809 theShape Shape to be processed.
6810 theValues List of values of parameters, in the same order
6811 as parameters are listed in theParameters list.
6812 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6813 theParameters List of names of parameters
6814 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6815 theName Object name; when specified, this parameter is used
6816 for result publication in the study. Otherwise, if automatic
6817 publication is switched on, default value is used for result name.
6819 Operators and Parameters:
6821 * FixShape - corrects invalid shapes.
6822 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6823 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6824 * FixFaceSize - removes small faces, such as spots and strips.
6825 * FixFaceSize.Tolerance - defines minimum possible face size.
6826 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6827 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6828 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6829 * 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.
6830 * 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.
6831 * 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.
6833 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6834 in segments using a certain angle.
6835 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6836 if Angle=180, four if Angle=90, etc).
6837 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6838 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6840 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6841 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6842 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6843 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6844 * SplitContinuity.CurveContinuity - required continuity for curves.
6845 This and the previous parameters can take the following values:
6847 Parametric Continuity:
6848 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6849 coincidental. The curves or surfaces may still meet at an angle,
6850 giving rise to a sharp corner or edge).
6851 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6852 are parallel, ruling out sharp edges).
6853 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6854 or surfaces are of the same magnitude).
6855 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6856 curves or surfaces (d/du C(u)) are the same at junction.
6858 Geometric Continuity:
6859 G1: first derivatives are proportional at junction.
6860 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6861 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6862 G2: first and second derivatives are proportional at junction. As the names imply,
6863 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6864 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6865 geometric continuity of order n, but not vice-versa.
6866 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6867 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6868 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6869 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6870 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6871 the specified parameters.
6872 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6873 the specified parameters.
6874 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6875 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6876 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6877 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6878 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6879 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6880 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6881 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6882 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6883 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6884 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
6887 New GEOM.GEOM_Object, containing processed shape.
6889 Note: For more information look through SALOME Geometry User's Guide->
6890 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
6892 # Example: see GEOM_TestHealing.py
6893 theValues,Parameters = ParseList(theValues)
6894 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
6895 # To avoid script failure in case of good argument shape
6896 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
6898 RaiseIfFailed("ProcessShape", self.HealOp)
6899 for string in (theOperators + theParameters):
6900 Parameters = ":" + Parameters
6902 anObj.SetParameters(Parameters)
6903 self._autoPublish(anObj, theName, "healed")
6906 ## Remove faces from the given object (shape).
6907 # @param theObject Shape to be processed.
6908 # @param theFaces Indices of faces to be removed, if EMPTY then the method
6909 # removes ALL faces of the given object.
6910 # @param theName Object name; when specified, this parameter is used
6911 # for result publication in the study. Otherwise, if automatic
6912 # publication is switched on, default value is used for result name.
6914 # @return New GEOM.GEOM_Object, containing processed shape.
6916 # @ref tui_suppress_faces "Example"
6917 @ManageTransactions("HealOp")
6918 def SuppressFaces(self, theObject, theFaces, theName=None):
6920 Remove faces from the given object (shape).
6923 theObject Shape to be processed.
6924 theFaces Indices of faces to be removed, if EMPTY then the method
6925 removes ALL faces of the given object.
6926 theName Object name; when specified, this parameter is used
6927 for result publication in the study. Otherwise, if automatic
6928 publication is switched on, default value is used for result name.
6931 New GEOM.GEOM_Object, containing processed shape.
6933 # Example: see GEOM_TestHealing.py
6934 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
6935 RaiseIfFailed("SuppressFaces", self.HealOp)
6936 self._autoPublish(anObj, theName, "suppressFaces")
6939 ## Sewing of faces into a single shell.
6940 # @param ListShape Shapes to be processed.
6941 # @param theTolerance Required tolerance value.
6942 # @param AllowNonManifold Flag that allows non-manifold sewing.
6943 # @param theName Object name; when specified, this parameter is used
6944 # for result publication in the study. Otherwise, if automatic
6945 # publication is switched on, default value is used for result name.
6947 # @return New GEOM.GEOM_Object, containing a result shell.
6949 # @ref tui_sewing "Example"
6950 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6952 Sewing of faces into a single shell.
6955 ListShape Shapes to be processed.
6956 theTolerance Required tolerance value.
6957 AllowNonManifold Flag that allows non-manifold sewing.
6958 theName Object name; when specified, this parameter is used
6959 for result publication in the study. Otherwise, if automatic
6960 publication is switched on, default value is used for result name.
6963 New GEOM.GEOM_Object, containing containing a result shell.
6965 # Example: see GEOM_TestHealing.py
6966 # note: auto-publishing is done in self.Sew()
6967 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
6970 ## Sewing of faces into a single shell.
6971 # @param ListShape Shapes to be processed.
6972 # @param theTolerance Required tolerance value.
6973 # @param AllowNonManifold Flag that allows non-manifold sewing.
6974 # @param theName Object name; when specified, this parameter is used
6975 # for result publication in the study. Otherwise, if automatic
6976 # publication is switched on, default value is used for result name.
6978 # @return New GEOM.GEOM_Object, containing a result shell.
6979 @ManageTransactions("HealOp")
6980 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
6982 Sewing of faces into a single shell.
6985 ListShape Shapes to be processed.
6986 theTolerance Required tolerance value.
6987 AllowNonManifold Flag that allows non-manifold sewing.
6988 theName Object name; when specified, this parameter is used
6989 for result publication in the study. Otherwise, if automatic
6990 publication is switched on, default value is used for result name.
6993 New GEOM.GEOM_Object, containing a result shell.
6995 # Example: see MakeSewing() above
6996 theTolerance,Parameters = ParseParameters(theTolerance)
6997 if AllowNonManifold:
6998 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7000 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7001 # To avoid script failure in case of good argument shape
7002 # (Fix of test cases geom/bugs11/L7,L8)
7003 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7005 RaiseIfFailed("Sew", self.HealOp)
7006 anObj.SetParameters(Parameters)
7007 self._autoPublish(anObj, theName, "sewed")
7010 ## Rebuild the topology of theSolids by removing
7011 # the faces that are shared by several solids.
7012 # @param theSolids A compound or a list of solids to be processed.
7013 # @param theName Object name; when specified, this parameter is used
7014 # for result publication in the study. Otherwise, if automatic
7015 # publication is switched on, default value is used for result name.
7017 # @return New GEOM.GEOM_Object, containing processed shape.
7019 # @ref tui_remove_webs "Example"
7020 @ManageTransactions("HealOp")
7021 def RemoveInternalFaces (self, theSolids, theName=None):
7023 Rebuild the topology of theSolids by removing
7024 the faces that are shared by several solids.
7027 theSolids A compound or a list of solids to be processed.
7028 theName Object name; when specified, this parameter is used
7029 for result publication in the study. Otherwise, if automatic
7030 publication is switched on, default value is used for result name.
7033 New GEOM.GEOM_Object, containing processed shape.
7035 # Example: see GEOM_TestHealing.py
7036 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7037 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7038 self._autoPublish(anObj, theName, "removeWebs")
7041 ## Remove internal wires and edges from the given object (face).
7042 # @param theObject Shape to be processed.
7043 # @param theWires Indices of wires to be removed, if EMPTY then the method
7044 # removes ALL internal wires of the given object.
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 New GEOM.GEOM_Object, containing processed shape.
7051 # @ref tui_suppress_internal_wires "Example"
7052 @ManageTransactions("HealOp")
7053 def SuppressInternalWires(self, theObject, theWires, theName=None):
7055 Remove internal wires and edges from the given object (face).
7058 theObject Shape to be processed.
7059 theWires Indices of wires to be removed, if EMPTY then the method
7060 removes ALL internal wires of the given object.
7061 theName Object name; when specified, this parameter is used
7062 for result publication in the study. Otherwise, if automatic
7063 publication is switched on, default value is used for result name.
7066 New GEOM.GEOM_Object, containing processed shape.
7068 # Example: see GEOM_TestHealing.py
7069 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7070 RaiseIfFailed("RemoveIntWires", self.HealOp)
7071 self._autoPublish(anObj, theName, "suppressWires")
7074 ## Remove internal closed contours (holes) from the given object.
7075 # @param theObject Shape to be processed.
7076 # @param theWires Indices of wires to be removed, if EMPTY then the method
7077 # removes ALL internal holes of the given object
7078 # @param theName Object name; when specified, this parameter is used
7079 # for result publication in the study. Otherwise, if automatic
7080 # publication is switched on, default value is used for result name.
7082 # @return New GEOM.GEOM_Object, containing processed shape.
7084 # @ref tui_suppress_holes "Example"
7085 @ManageTransactions("HealOp")
7086 def SuppressHoles(self, theObject, theWires, theName=None):
7088 Remove internal closed contours (holes) from the given object.
7091 theObject Shape to be processed.
7092 theWires Indices of wires to be removed, if EMPTY then the method
7093 removes ALL internal holes of the given object
7094 theName Object name; when specified, this parameter is used
7095 for result publication in the study. Otherwise, if automatic
7096 publication is switched on, default value is used for result name.
7099 New GEOM.GEOM_Object, containing processed shape.
7101 # Example: see GEOM_TestHealing.py
7102 anObj = self.HealOp.FillHoles(theObject, theWires)
7103 RaiseIfFailed("FillHoles", self.HealOp)
7104 self._autoPublish(anObj, theName, "suppressHoles")
7107 ## Close an open wire.
7108 # @param theObject Shape to be processed.
7109 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7110 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7111 # @param isCommonVertex If True : closure by creation of a common vertex,
7112 # If False : closure by creation of an edge between ends.
7113 # @param theName Object name; when specified, this parameter is used
7114 # for result publication in the study. Otherwise, if automatic
7115 # publication is switched on, default value is used for result name.
7117 # @return New GEOM.GEOM_Object, containing processed shape.
7119 # @ref tui_close_contour "Example"
7120 @ManageTransactions("HealOp")
7121 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7126 theObject Shape to be processed.
7127 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7128 if [ ], then theObject itself is a wire.
7129 isCommonVertex If True : closure by creation of a common vertex,
7130 If False : closure by creation of an edge between ends.
7131 theName Object name; when specified, this parameter is used
7132 for result publication in the study. Otherwise, if automatic
7133 publication is switched on, default value is used for result name.
7136 New GEOM.GEOM_Object, containing processed shape.
7138 # Example: see GEOM_TestHealing.py
7139 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7140 RaiseIfFailed("CloseContour", self.HealOp)
7141 self._autoPublish(anObj, theName, "closeContour")
7144 ## Addition of a point to a given edge object.
7145 # @param theObject Shape to be processed.
7146 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7147 # if -1, then theObject itself is the edge.
7148 # @param theValue Value of parameter on edge or length parameter,
7149 # depending on \a isByParameter.
7150 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7151 # if FALSE : \a theValue is treated as a length parameter [0..1]
7152 # @param theName Object name; when specified, this parameter is used
7153 # for result publication in the study. Otherwise, if automatic
7154 # publication is switched on, default value is used for result name.
7156 # @return New GEOM.GEOM_Object, containing processed shape.
7158 # @ref tui_add_point_on_edge "Example"
7159 @ManageTransactions("HealOp")
7160 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7162 Addition of a point to a given edge object.
7165 theObject Shape to be processed.
7166 theEdgeIndex Index of edge to be divided within theObject's shape,
7167 if -1, then theObject itself is the edge.
7168 theValue Value of parameter on edge or length parameter,
7169 depending on isByParameter.
7170 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7171 if FALSE : theValue is treated as a length parameter [0..1]
7172 theName Object name; when specified, this parameter is used
7173 for result publication in the study. Otherwise, if automatic
7174 publication is switched on, default value is used for result name.
7177 New GEOM.GEOM_Object, containing processed shape.
7179 # Example: see GEOM_TestHealing.py
7180 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7181 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7182 RaiseIfFailed("DivideEdge", self.HealOp)
7183 anObj.SetParameters(Parameters)
7184 self._autoPublish(anObj, theName, "divideEdge")
7187 ## Addition of points to a given edge of \a theObject by projecting
7188 # other points to the given edge.
7189 # @param theObject Shape to be processed.
7190 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7191 # if -1, then theObject itself is the edge.
7192 # @param thePoints List of points to project to theEdgeIndex-th edge.
7193 # @param theName Object name; when specified, this parameter is used
7194 # for result publication in the study. Otherwise, if automatic
7195 # publication is switched on, default value is used for result name.
7197 # @return New GEOM.GEOM_Object, containing processed shape.
7199 # @ref tui_add_point_on_edge "Example"
7200 @ManageTransactions("HealOp")
7201 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7203 Addition of points to a given edge of \a theObject by projecting
7204 other points to the given edge.
7207 theObject Shape to be processed.
7208 theEdgeIndex The edge or its index to be divided within theObject's shape,
7209 if -1, then theObject itself is the edge.
7210 thePoints List of points to project to theEdgeIndex-th edge.
7211 theName Object name; when specified, this parameter is used
7212 for result publication in the study. Otherwise, if automatic
7213 publication is switched on, default value is used for result name.
7216 New GEOM.GEOM_Object, containing processed shape.
7218 # Example: see GEOM_TestHealing.py
7219 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7220 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7221 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7222 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7223 self._autoPublish(anObj, theName, "divideEdge")
7226 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7227 # @param theWire Wire to minimize the number of C1 continuous edges in.
7228 # @param theVertices A list of vertices to suppress. If the list
7229 # is empty, all vertices in a wire will be assumed.
7230 # @param theName Object name; when specified, this parameter is used
7231 # for result publication in the study. Otherwise, if automatic
7232 # publication is switched on, default value is used for result name.
7234 # @return New GEOM.GEOM_Object with modified wire.
7236 # @ref tui_fuse_collinear_edges "Example"
7237 @ManageTransactions("HealOp")
7238 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7240 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7243 theWire Wire to minimize the number of C1 continuous edges in.
7244 theVertices A list of vertices to suppress. If the list
7245 is empty, all vertices in a wire will be assumed.
7246 theName Object name; when specified, this parameter is used
7247 for result publication in the study. Otherwise, if automatic
7248 publication is switched on, default value is used for result name.
7251 New GEOM.GEOM_Object with modified wire.
7253 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7254 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7255 self._autoPublish(anObj, theName, "fuseEdges")
7258 ## Change orientation of the given object. Updates given shape.
7259 # @param theObject Shape to be processed.
7260 # @return Updated <var>theObject</var>
7262 # @ref swig_todo "Example"
7263 @ManageTransactions("HealOp")
7264 def ChangeOrientationShell(self,theObject):
7266 Change orientation of the given object. Updates given shape.
7269 theObject Shape to be processed.
7274 theObject = self.HealOp.ChangeOrientation(theObject)
7275 RaiseIfFailed("ChangeOrientation", self.HealOp)
7278 ## Change orientation of the given object.
7279 # @param theObject Shape to be processed.
7280 # @param theName Object name; when specified, this parameter is used
7281 # for result publication in the study. Otherwise, if automatic
7282 # publication is switched on, default value is used for result name.
7284 # @return New GEOM.GEOM_Object, containing processed shape.
7286 # @ref swig_todo "Example"
7287 @ManageTransactions("HealOp")
7288 def ChangeOrientationShellCopy(self, theObject, theName=None):
7290 Change orientation of the given object.
7293 theObject Shape to be processed.
7294 theName Object name; when specified, this parameter is used
7295 for result publication in the study. Otherwise, if automatic
7296 publication is switched on, default value is used for result name.
7299 New GEOM.GEOM_Object, containing processed shape.
7301 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7302 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7303 self._autoPublish(anObj, theName, "reversed")
7306 ## Try to limit tolerance of the given object by value \a theTolerance.
7307 # @param theObject Shape to be processed.
7308 # @param theTolerance Required tolerance value.
7309 # @param theName Object name; when specified, this parameter is used
7310 # for result publication in the study. Otherwise, if automatic
7311 # publication is switched on, default value is used for result name.
7313 # @return New GEOM.GEOM_Object, containing processed shape.
7315 # @ref tui_limit_tolerance "Example"
7316 @ManageTransactions("HealOp")
7317 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7319 Try to limit tolerance of the given object by value theTolerance.
7322 theObject Shape to be processed.
7323 theTolerance Required tolerance value.
7324 theName Object name; when specified, this parameter is used
7325 for result publication in the study. Otherwise, if automatic
7326 publication is switched on, default value is used for result name.
7329 New GEOM.GEOM_Object, containing processed shape.
7331 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7332 RaiseIfFailed("LimitTolerance", self.HealOp)
7333 self._autoPublish(anObj, theName, "limitTolerance")
7336 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7337 # that constitute a free boundary of the given shape.
7338 # @param theObject Shape to get free boundary of.
7339 # @param theName Object name; when specified, this parameter is used
7340 # for result publication in the study. Otherwise, if automatic
7341 # publication is switched on, default value is used for result name.
7343 # @return [\a status, \a theClosedWires, \a theOpenWires]
7344 # \n \a status: FALSE, if an error(s) occured during the method execution.
7345 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7346 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7348 # @ref tui_free_boundaries_page "Example"
7349 @ManageTransactions("HealOp")
7350 def GetFreeBoundary(self, theObject, theName=None):
7352 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7353 that constitute a free boundary of the given shape.
7356 theObject Shape to get free boundary of.
7357 theName Object name; when specified, this parameter is used
7358 for result publication in the study. Otherwise, if automatic
7359 publication is switched on, default value is used for result name.
7362 [status, theClosedWires, theOpenWires]
7363 status: FALSE, if an error(s) occured during the method execution.
7364 theClosedWires: Closed wires on the free boundary of the given shape.
7365 theOpenWires: Open wires on the free boundary of the given shape.
7367 # Example: see GEOM_TestHealing.py
7368 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7369 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7370 self._autoPublish(anObj[1], theName, "closedWire")
7371 self._autoPublish(anObj[2], theName, "openWire")
7374 ## Replace coincident faces in \a theShapes by one face.
7375 # @param theShapes Initial shapes, either a list or compound of shapes.
7376 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7377 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7378 # otherwise all initial shapes.
7379 # @param theName Object name; when specified, this parameter is used
7380 # for result publication in the study. Otherwise, if automatic
7381 # publication is switched on, default value is used for result name.
7383 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7385 # @ref tui_glue_faces "Example"
7386 @ManageTransactions("ShapesOp")
7387 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7389 Replace coincident faces in theShapes by one face.
7392 theShapes Initial shapes, either a list or compound of shapes.
7393 theTolerance Maximum distance between faces, which can be considered as coincident.
7394 doKeepNonSolids If FALSE, only solids will present in the result,
7395 otherwise all initial shapes.
7396 theName Object name; when specified, this parameter is used
7397 for result publication in the study. Otherwise, if automatic
7398 publication is switched on, default value is used for result name.
7401 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7403 # Example: see GEOM_Spanner.py
7404 theTolerance,Parameters = ParseParameters(theTolerance)
7405 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7407 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
7408 anObj.SetParameters(Parameters)
7409 self._autoPublish(anObj, theName, "glueFaces")
7412 ## Find coincident faces in \a theShapes for possible gluing.
7413 # @param theShapes Initial shapes, either a list or compound of shapes.
7414 # @param theTolerance Maximum distance between faces,
7415 # which can be considered as coincident.
7416 # @param theName Object name; when specified, this parameter is used
7417 # for result publication in the study. Otherwise, if automatic
7418 # publication is switched on, default value is used for result name.
7420 # @return GEOM.ListOfGO
7422 # @ref tui_glue_faces "Example"
7423 @ManageTransactions("ShapesOp")
7424 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7426 Find coincident faces in theShapes for possible gluing.
7429 theShapes Initial shapes, either a list or compound of shapes.
7430 theTolerance Maximum distance between faces,
7431 which can be considered as coincident.
7432 theName Object name; when specified, this parameter is used
7433 for result publication in the study. Otherwise, if automatic
7434 publication is switched on, default value is used for result name.
7439 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7440 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7441 self._autoPublish(anObj, theName, "facesToGlue")
7444 ## Replace coincident faces in \a theShapes by one face
7445 # in compliance with given list of faces
7446 # @param theShapes Initial shapes, either a list or compound of shapes.
7447 # @param theTolerance Maximum distance between faces,
7448 # which can be considered as coincident.
7449 # @param theFaces List of faces for gluing.
7450 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7451 # otherwise all initial shapes.
7452 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7453 # will be glued, otherwise only the edges,
7454 # belonging to <VAR>theFaces</VAR>.
7455 # @param theName Object name; when specified, this parameter is used
7456 # for result publication in the study. Otherwise, if automatic
7457 # publication is switched on, default value is used for result name.
7459 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7461 # @ref tui_glue_faces "Example"
7462 @ManageTransactions("ShapesOp")
7463 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7464 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7466 Replace coincident faces in theShapes by one face
7467 in compliance with given list of faces
7470 theShapes theShapes Initial shapes, either a list or compound of shapes.
7471 theTolerance Maximum distance between faces,
7472 which can be considered as coincident.
7473 theFaces List of faces for gluing.
7474 doKeepNonSolids If FALSE, only solids will present in the result,
7475 otherwise all initial shapes.
7476 doGlueAllEdges If TRUE, all coincident edges of theShape
7477 will be glued, otherwise only the edges,
7478 belonging to theFaces.
7479 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.
7484 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7486 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7487 doKeepNonSolids, doGlueAllEdges)
7489 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
7490 self._autoPublish(anObj, theName, "glueFaces")
7493 ## Replace coincident edges in \a theShapes by one edge.
7494 # @param theShapes Initial shapes, either a list or compound of shapes.
7495 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7496 # @param theName Object name; when specified, this parameter is used
7497 # for result publication in the study. Otherwise, if automatic
7498 # publication is switched on, default value is used for result name.
7500 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7502 # @ref tui_glue_edges "Example"
7503 @ManageTransactions("ShapesOp")
7504 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7506 Replace coincident edges in theShapes by one edge.
7509 theShapes Initial shapes, either a list or compound of shapes.
7510 theTolerance Maximum distance between edges, which can be considered as coincident.
7511 theName Object name; when specified, this parameter is used
7512 for result publication in the study. Otherwise, if automatic
7513 publication is switched on, default value is used for result name.
7516 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7518 theTolerance,Parameters = ParseParameters(theTolerance)
7519 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7521 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
7522 anObj.SetParameters(Parameters)
7523 self._autoPublish(anObj, theName, "glueEdges")
7526 ## Find coincident edges in \a theShapes for possible gluing.
7527 # @param theShapes Initial shapes, either a list or compound of shapes.
7528 # @param theTolerance Maximum distance between edges,
7529 # which can be considered as coincident.
7530 # @param theName Object name; when specified, this parameter is used
7531 # for result publication in the study. Otherwise, if automatic
7532 # publication is switched on, default value is used for result name.
7534 # @return GEOM.ListOfGO
7536 # @ref tui_glue_edges "Example"
7537 @ManageTransactions("ShapesOp")
7538 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7540 Find coincident edges in theShapes for possible gluing.
7543 theShapes Initial shapes, either a list or compound of shapes.
7544 theTolerance Maximum distance between edges,
7545 which can be considered as coincident.
7546 theName Object name; when specified, this parameter is used
7547 for result publication in the study. Otherwise, if automatic
7548 publication is switched on, default value is used for result name.
7553 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7554 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7555 self._autoPublish(anObj, theName, "edgesToGlue")
7558 ## Replace coincident edges in theShapes by one edge
7559 # in compliance with given list of edges.
7560 # @param theShapes Initial shapes, either a list or compound of shapes.
7561 # @param theTolerance Maximum distance between edges,
7562 # which can be considered as coincident.
7563 # @param theEdges List of edges for gluing.
7564 # @param theName Object name; when specified, this parameter is used
7565 # for result publication in the study. Otherwise, if automatic
7566 # publication is switched on, default value is used for result name.
7568 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7570 # @ref tui_glue_edges "Example"
7571 @ManageTransactions("ShapesOp")
7572 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7574 Replace coincident edges in theShapes by one edge
7575 in compliance with given list of edges.
7578 theShapes Initial shapes, either a list or compound of shapes.
7579 theTolerance Maximum distance between edges,
7580 which can be considered as coincident.
7581 theEdges List of edges for gluing.
7582 theName Object name; when specified, this parameter is used
7583 for result publication in the study. Otherwise, if automatic
7584 publication is switched on, default value is used for result name.
7587 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7589 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7591 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
7592 self._autoPublish(anObj, theName, "glueEdges")
7598 ## @addtogroup l3_boolean Boolean Operations
7601 # -----------------------------------------------------------------------------
7602 # Boolean (Common, Cut, Fuse, Section)
7603 # -----------------------------------------------------------------------------
7605 ## Perform one of boolean operations on two given shapes.
7606 # @param theShape1 First argument for boolean operation.
7607 # @param theShape2 Second argument for boolean operation.
7608 # @param theOperation Indicates the operation to be done:\n
7609 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7610 # @param checkSelfInte The flag that tells if the arguments should
7611 # be checked for self-intersection prior to the operation.
7612 # @param theName Object name; when specified, this parameter is used
7613 # for result publication in the study. Otherwise, if automatic
7614 # publication is switched on, default value is used for result name.
7616 # @note This algorithm doesn't find all types of self-intersections.
7617 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7618 # vertex/face and edge/face intersections. Face/face
7619 # intersections detection is switched off as it is a
7620 # time-consuming operation that gives an impact on performance.
7621 # To find all self-intersections please use
7622 # CheckSelfIntersections() method.
7624 # @return New GEOM.GEOM_Object, containing the result shape.
7626 # @ref tui_fuse "Example"
7627 @ManageTransactions("BoolOp")
7628 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7630 Perform one of boolean operations on two given shapes.
7633 theShape1 First argument for boolean operation.
7634 theShape2 Second argument for boolean operation.
7635 theOperation Indicates the operation to be done:
7636 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7637 checkSelfInte The flag that tells if the arguments should
7638 be checked for self-intersection prior to
7640 theName Object name; when specified, this parameter is used
7641 for result publication in the study. Otherwise, if automatic
7642 publication is switched on, default value is used for result name.
7645 This algorithm doesn't find all types of self-intersections.
7646 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7647 vertex/face and edge/face intersections. Face/face
7648 intersections detection is switched off as it is a
7649 time-consuming operation that gives an impact on performance.
7650 To find all self-intersections please use
7651 CheckSelfIntersections() method.
7654 New GEOM.GEOM_Object, containing the result shape.
7656 # Example: see GEOM_TestAll.py
7657 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7658 RaiseIfFailed("MakeBoolean", self.BoolOp)
7659 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7660 self._autoPublish(anObj, theName, def_names[theOperation])
7663 ## Perform Common boolean operation on two given shapes.
7664 # @param theShape1 First argument for boolean operation.
7665 # @param theShape2 Second argument for boolean operation.
7666 # @param checkSelfInte The flag that tells if the arguments should
7667 # be checked for self-intersection prior to the operation.
7668 # @param theName Object name; when specified, this parameter is used
7669 # for result publication in the study. Otherwise, if automatic
7670 # publication is switched on, default value is used for result name.
7672 # @note This algorithm doesn't find all types of self-intersections.
7673 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7674 # vertex/face and edge/face intersections. Face/face
7675 # intersections detection is switched off as it is a
7676 # time-consuming operation that gives an impact on performance.
7677 # To find all self-intersections please use
7678 # CheckSelfIntersections() method.
7680 # @return New GEOM.GEOM_Object, containing the result shape.
7682 # @ref tui_common "Example 1"
7683 # \n @ref swig_MakeCommon "Example 2"
7684 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7686 Perform Common boolean operation on two given shapes.
7689 theShape1 First argument for boolean operation.
7690 theShape2 Second argument for boolean operation.
7691 checkSelfInte The flag that tells if the arguments should
7692 be checked for self-intersection prior to
7694 theName Object name; when specified, this parameter is used
7695 for result publication in the study. Otherwise, if automatic
7696 publication is switched on, default value is used for result name.
7699 This algorithm doesn't find all types of self-intersections.
7700 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7701 vertex/face and edge/face intersections. Face/face
7702 intersections detection is switched off as it is a
7703 time-consuming operation that gives an impact on performance.
7704 To find all self-intersections please use
7705 CheckSelfIntersections() method.
7708 New GEOM.GEOM_Object, containing the result shape.
7710 # Example: see GEOM_TestOthers.py
7711 # note: auto-publishing is done in self.MakeBoolean()
7712 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7714 ## Perform Cut boolean operation on two given shapes.
7715 # @param theShape1 First argument for boolean operation.
7716 # @param theShape2 Second argument for boolean operation.
7717 # @param checkSelfInte The flag that tells if the arguments should
7718 # be checked for self-intersection prior to the operation.
7719 # @param theName Object name; when specified, this parameter is used
7720 # for result publication in the study. Otherwise, if automatic
7721 # publication is switched on, default value is used for result name.
7723 # @note This algorithm doesn't find all types of self-intersections.
7724 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7725 # vertex/face and edge/face intersections. Face/face
7726 # intersections detection is switched off as it is a
7727 # time-consuming operation that gives an impact on performance.
7728 # To find all self-intersections please use
7729 # CheckSelfIntersections() method.
7731 # @return New GEOM.GEOM_Object, containing the result shape.
7733 # @ref tui_cut "Example 1"
7734 # \n @ref swig_MakeCommon "Example 2"
7735 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7737 Perform Cut boolean operation on two given shapes.
7740 theShape1 First argument for boolean operation.
7741 theShape2 Second argument for boolean operation.
7742 checkSelfInte The flag that tells if the arguments should
7743 be checked for self-intersection prior to
7745 theName Object name; when specified, this parameter is used
7746 for result publication in the study. Otherwise, if automatic
7747 publication is switched on, default value is used for result name.
7750 This algorithm doesn't find all types of self-intersections.
7751 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7752 vertex/face and edge/face intersections. Face/face
7753 intersections detection is switched off as it is a
7754 time-consuming operation that gives an impact on performance.
7755 To find all self-intersections please use
7756 CheckSelfIntersections() method.
7759 New GEOM.GEOM_Object, containing the result shape.
7762 # Example: see GEOM_TestOthers.py
7763 # note: auto-publishing is done in self.MakeBoolean()
7764 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7766 ## Perform Fuse boolean operation on two given shapes.
7767 # @param theShape1 First argument for boolean operation.
7768 # @param theShape2 Second argument for boolean operation.
7769 # @param checkSelfInte The flag that tells if the arguments should
7770 # be checked for self-intersection prior to the operation.
7771 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7772 # operation should be performed during the operation.
7773 # @param theName Object name; when specified, this parameter is used
7774 # for result publication in the study. Otherwise, if automatic
7775 # publication is switched on, default value is used for result name.
7777 # @note This algorithm doesn't find all types of self-intersections.
7778 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7779 # vertex/face and edge/face intersections. Face/face
7780 # intersections detection is switched off as it is a
7781 # time-consuming operation that gives an impact on performance.
7782 # To find all self-intersections please use
7783 # CheckSelfIntersections() method.
7785 # @return New GEOM.GEOM_Object, containing the result shape.
7787 # @ref tui_fuse "Example 1"
7788 # \n @ref swig_MakeCommon "Example 2"
7789 @ManageTransactions("BoolOp")
7790 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7791 rmExtraEdges=False, theName=None):
7793 Perform Fuse boolean operation on two given shapes.
7796 theShape1 First argument for boolean operation.
7797 theShape2 Second argument for boolean operation.
7798 checkSelfInte The flag that tells if the arguments should
7799 be checked for self-intersection prior to
7801 rmExtraEdges The flag that tells if Remove Extra Edges
7802 operation should be performed during the operation.
7803 theName Object name; when specified, this parameter is used
7804 for result publication in the study. Otherwise, if automatic
7805 publication is switched on, default value is used for result name.
7808 This algorithm doesn't find all types of self-intersections.
7809 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7810 vertex/face and edge/face intersections. Face/face
7811 intersections detection is switched off as it is a
7812 time-consuming operation that gives an impact on performance.
7813 To find all self-intersections please use
7814 CheckSelfIntersections() method.
7817 New GEOM.GEOM_Object, containing the result shape.
7820 # Example: see GEOM_TestOthers.py
7821 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7822 checkSelfInte, rmExtraEdges)
7823 RaiseIfFailed("MakeFuse", self.BoolOp)
7824 self._autoPublish(anObj, theName, "fuse")
7827 ## Perform Section boolean operation on two given shapes.
7828 # @param theShape1 First argument for boolean operation.
7829 # @param theShape2 Second argument for boolean operation.
7830 # @param checkSelfInte The flag that tells if the arguments should
7831 # be checked for self-intersection prior to the operation.
7832 # If a self-intersection detected the operation fails.
7833 # @param theName Object name; when specified, this parameter is used
7834 # for result publication in the study. Otherwise, if automatic
7835 # publication is switched on, default value is used for result name.
7836 # @return New GEOM.GEOM_Object, containing the result shape.
7838 # @ref tui_section "Example 1"
7839 # \n @ref swig_MakeCommon "Example 2"
7840 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7842 Perform Section boolean operation on two given shapes.
7845 theShape1 First argument for boolean operation.
7846 theShape2 Second argument for boolean operation.
7847 checkSelfInte The flag that tells if the arguments should
7848 be checked for self-intersection prior to the operation.
7849 If a self-intersection detected the operation fails.
7850 theName Object name; when specified, this parameter is used
7851 for result publication in the study. Otherwise, if automatic
7852 publication is switched on, default value is used for result name.
7854 New GEOM.GEOM_Object, containing the result shape.
7857 # Example: see GEOM_TestOthers.py
7858 # note: auto-publishing is done in self.MakeBoolean()
7859 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7861 ## Perform Fuse boolean operation on the list of shapes.
7862 # @param theShapesList Shapes to be fused.
7863 # @param checkSelfInte The flag that tells if the arguments should
7864 # be checked for self-intersection prior to the operation.
7865 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7866 # operation should be performed during the operation.
7867 # @param theName Object name; when specified, this parameter is used
7868 # for result publication in the study. Otherwise, if automatic
7869 # publication is switched on, default value is used for result name.
7871 # @note This algorithm doesn't find all types of self-intersections.
7872 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7873 # vertex/face and edge/face intersections. Face/face
7874 # intersections detection is switched off as it is a
7875 # time-consuming operation that gives an impact on performance.
7876 # To find all self-intersections please use
7877 # CheckSelfIntersections() method.
7879 # @return New GEOM.GEOM_Object, containing the result shape.
7881 # @ref tui_fuse "Example 1"
7882 # \n @ref swig_MakeCommon "Example 2"
7883 @ManageTransactions("BoolOp")
7884 def MakeFuseList(self, theShapesList, checkSelfInte=False,
7885 rmExtraEdges=False, theName=None):
7887 Perform Fuse boolean operation on the list of shapes.
7890 theShapesList Shapes to be fused.
7891 checkSelfInte The flag that tells if the arguments should
7892 be checked for self-intersection prior to
7894 rmExtraEdges The flag that tells if Remove Extra Edges
7895 operation should be performed during the operation.
7896 theName Object name; when specified, this parameter is used
7897 for result publication in the study. Otherwise, if automatic
7898 publication is switched on, default value is used for result name.
7901 This algorithm doesn't find all types of self-intersections.
7902 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7903 vertex/face and edge/face intersections. Face/face
7904 intersections detection is switched off as it is a
7905 time-consuming operation that gives an impact on performance.
7906 To find all self-intersections please use
7907 CheckSelfIntersections() method.
7910 New GEOM.GEOM_Object, containing the result shape.
7913 # Example: see GEOM_TestOthers.py
7914 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
7916 RaiseIfFailed("MakeFuseList", self.BoolOp)
7917 self._autoPublish(anObj, theName, "fuse")
7920 ## Perform Common boolean operation on the list of shapes.
7921 # @param theShapesList Shapes for Common operation.
7922 # @param checkSelfInte The flag that tells if the arguments should
7923 # be checked for self-intersection prior to the operation.
7924 # @param theName Object name; when specified, this parameter is used
7925 # for result publication in the study. Otherwise, if automatic
7926 # publication is switched on, default value is used for result name.
7928 # @note This algorithm doesn't find all types of self-intersections.
7929 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7930 # vertex/face and edge/face intersections. Face/face
7931 # intersections detection is switched off as it is a
7932 # time-consuming operation that gives an impact on performance.
7933 # To find all self-intersections please use
7934 # CheckSelfIntersections() method.
7936 # @return New GEOM.GEOM_Object, containing the result shape.
7938 # @ref tui_common "Example 1"
7939 # \n @ref swig_MakeCommon "Example 2"
7940 @ManageTransactions("BoolOp")
7941 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
7943 Perform Common boolean operation on the list of shapes.
7946 theShapesList Shapes for Common operation.
7947 checkSelfInte The flag that tells if the arguments should
7948 be checked for self-intersection prior to
7950 theName Object name; when specified, this parameter is used
7951 for result publication in the study. Otherwise, if automatic
7952 publication is switched on, default value is used for result name.
7955 This algorithm doesn't find all types of self-intersections.
7956 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7957 vertex/face and edge/face intersections. Face/face
7958 intersections detection is switched off as it is a
7959 time-consuming operation that gives an impact on performance.
7960 To find all self-intersections please use
7961 CheckSelfIntersections() method.
7964 New GEOM.GEOM_Object, containing the result shape.
7967 # Example: see GEOM_TestOthers.py
7968 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
7969 RaiseIfFailed("MakeCommonList", self.BoolOp)
7970 self._autoPublish(anObj, theName, "common")
7973 ## Perform Cut boolean operation on one object and the list of tools.
7974 # @param theMainShape The object of the operation.
7975 # @param theShapesList The list of tools of the operation.
7976 # @param checkSelfInte The flag that tells if the arguments should
7977 # be checked for self-intersection prior to the operation.
7978 # @param theName Object name; when specified, this parameter is used
7979 # for result publication in the study. Otherwise, if automatic
7980 # publication is switched on, default value is used for result name.
7982 # @note This algorithm doesn't find all types of self-intersections.
7983 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7984 # vertex/face and edge/face intersections. Face/face
7985 # intersections detection is switched off as it is a
7986 # time-consuming operation that gives an impact on performance.
7987 # To find all self-intersections please use
7988 # CheckSelfIntersections() method.
7990 # @return New GEOM.GEOM_Object, containing the result shape.
7992 # @ref tui_cut "Example 1"
7993 # \n @ref swig_MakeCommon "Example 2"
7994 @ManageTransactions("BoolOp")
7995 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
7997 Perform Cut boolean operation on one object and the list of tools.
8000 theMainShape The object of the operation.
8001 theShapesList The list of tools of the operation.
8002 checkSelfInte The flag that tells if the arguments should
8003 be checked for self-intersection prior to
8005 theName Object name; when specified, this parameter is used
8006 for result publication in the study. Otherwise, if automatic
8007 publication is switched on, default value is used for result name.
8010 This algorithm doesn't find all types of self-intersections.
8011 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8012 vertex/face and edge/face intersections. Face/face
8013 intersections detection is switched off as it is a
8014 time-consuming operation that gives an impact on performance.
8015 To find all self-intersections please use
8016 CheckSelfIntersections() method.
8019 New GEOM.GEOM_Object, containing the result shape.
8022 # Example: see GEOM_TestOthers.py
8023 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8024 RaiseIfFailed("MakeCutList", self.BoolOp)
8025 self._autoPublish(anObj, theName, "cut")
8031 ## @addtogroup l3_basic_op
8034 ## Perform partition operation.
8035 # @param ListShapes Shapes to be intersected.
8036 # @param ListTools Shapes to intersect theShapes.
8037 # @param Limit Type of resulting shapes (see ShapeType()).\n
8038 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8039 # type will be detected automatically.
8040 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8041 # target type (equal to Limit) are kept in the result,
8042 # else standalone shapes of lower dimension
8043 # are kept also (if they exist).
8045 # @param theName Object name; when specified, this parameter is used
8046 # for result publication in the study. Otherwise, if automatic
8047 # publication is switched on, default value is used for result name.
8049 # @note Each compound from ListShapes and ListTools will be exploded
8050 # in order to avoid possible intersection between shapes from this compound.
8052 # After implementation new version of PartitionAlgo (October 2006)
8053 # other parameters are ignored by current functionality. They are kept
8054 # in this function only for support old versions.
8055 # @param ListKeepInside Shapes, outside which the results will be deleted.
8056 # Each shape from theKeepInside must belong to theShapes also.
8057 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8058 # Each shape from theRemoveInside must belong to theShapes also.
8059 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8060 # @param ListMaterials Material indices for each shape. Make sence,
8061 # only if theRemoveWebs is TRUE.
8063 # @return New GEOM.GEOM_Object, containing the result shapes.
8065 # @ref tui_partition "Example"
8066 @ManageTransactions("BoolOp")
8067 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8068 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8069 KeepNonlimitShapes=0, theName=None):
8071 Perform partition operation.
8074 ListShapes Shapes to be intersected.
8075 ListTools Shapes to intersect theShapes.
8076 Limit Type of resulting shapes (see geompy.ShapeType)
8077 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8078 type will be detected automatically.
8079 KeepNonlimitShapes if this parameter == 0, then only shapes of
8080 target type (equal to Limit) are kept in the result,
8081 else standalone shapes of lower dimension
8082 are kept also (if they exist).
8084 theName Object name; when specified, this parameter is used
8085 for result publication in the study. Otherwise, if automatic
8086 publication is switched on, default value is used for result name.
8088 Each compound from ListShapes and ListTools will be exploded
8089 in order to avoid possible intersection between shapes from
8092 After implementation new version of PartitionAlgo (October 2006) other
8093 parameters are ignored by current functionality. They are kept in this
8094 function only for support old versions.
8097 ListKeepInside Shapes, outside which the results will be deleted.
8098 Each shape from theKeepInside must belong to theShapes also.
8099 ListRemoveInside Shapes, inside which the results will be deleted.
8100 Each shape from theRemoveInside must belong to theShapes also.
8101 RemoveWebs If TRUE, perform Glue 3D algorithm.
8102 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
8105 New GEOM.GEOM_Object, containing the result shapes.
8107 # Example: see GEOM_TestAll.py
8108 if Limit == self.ShapeType["AUTO"]:
8109 # automatic detection of the most appropriate shape limit type
8111 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
8112 Limit = EnumToLong(lim)
8114 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8115 ListKeepInside, ListRemoveInside,
8116 Limit, RemoveWebs, ListMaterials,
8117 KeepNonlimitShapes);
8118 RaiseIfFailed("MakePartition", self.BoolOp)
8119 self._autoPublish(anObj, theName, "partition")
8122 ## Perform partition operation.
8123 # This method may be useful if it is needed to make a partition for
8124 # compound contains nonintersected shapes. Performance will be better
8125 # since intersection between shapes from compound is not performed.
8127 # Description of all parameters as in previous method MakePartition().
8128 # One additional parameter is provided:
8129 # @param checkSelfInte The flag that tells if the arguments should
8130 # be checked for self-intersection prior to the operation.
8132 # @note This algorithm doesn't find all types of self-intersections.
8133 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8134 # vertex/face and edge/face intersections. Face/face
8135 # intersections detection is switched off as it is a
8136 # time-consuming operation that gives an impact on performance.
8137 # To find all self-intersections please use
8138 # CheckSelfIntersections() method.
8140 # @note Passed compounds (via ListShapes or via ListTools)
8141 # have to consist of nonintersecting shapes.
8143 # @return New GEOM.GEOM_Object, containing the result shapes.
8145 # @ref swig_todo "Example"
8146 @ManageTransactions("BoolOp")
8147 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8148 ListKeepInside=[], ListRemoveInside=[],
8149 Limit=ShapeType["AUTO"], RemoveWebs=0,
8150 ListMaterials=[], KeepNonlimitShapes=0,
8151 checkSelfInte=False, theName=None):
8153 Perform partition operation.
8154 This method may be useful if it is needed to make a partition for
8155 compound contains nonintersected shapes. Performance will be better
8156 since intersection between shapes from compound is not performed.
8159 Description of all parameters as in method geompy.MakePartition.
8160 One additional parameter is provided:
8161 checkSelfInte The flag that tells if the arguments should
8162 be checked for self-intersection prior to
8166 This algorithm doesn't find all types of self-intersections.
8167 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8168 vertex/face and edge/face intersections. Face/face
8169 intersections detection is switched off as it is a
8170 time-consuming operation that gives an impact on performance.
8171 To find all self-intersections please use
8172 CheckSelfIntersections() method.
8175 Passed compounds (via ListShapes or via ListTools)
8176 have to consist of nonintersecting shapes.
8179 New GEOM.GEOM_Object, containing the result shapes.
8181 if Limit == self.ShapeType["AUTO"]:
8182 # automatic detection of the most appropriate shape limit type
8184 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
8185 Limit = EnumToLong(lim)
8187 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8188 ListKeepInside, ListRemoveInside,
8189 Limit, RemoveWebs, ListMaterials,
8190 KeepNonlimitShapes, checkSelfInte);
8191 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8192 self._autoPublish(anObj, theName, "partition")
8195 ## See method MakePartition() for more information.
8197 # @ref tui_partition "Example 1"
8198 # \n @ref swig_Partition "Example 2"
8199 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8200 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8201 KeepNonlimitShapes=0, theName=None):
8203 See method geompy.MakePartition for more information.
8205 # Example: see GEOM_TestOthers.py
8206 # note: auto-publishing is done in self.MakePartition()
8207 anObj = self.MakePartition(ListShapes, ListTools,
8208 ListKeepInside, ListRemoveInside,
8209 Limit, RemoveWebs, ListMaterials,
8210 KeepNonlimitShapes, theName);
8213 ## Perform partition of the Shape with the Plane
8214 # @param theShape Shape to be intersected.
8215 # @param thePlane Tool shape, to intersect theShape.
8216 # @param theName Object name; when specified, this parameter is used
8217 # for result publication in the study. Otherwise, if automatic
8218 # publication is switched on, default value is used for result name.
8220 # @return New GEOM.GEOM_Object, containing the result shape.
8222 # @note This operation is a shortcut to the more general @ref MakePartition
8223 # operation, where @a theShape specifies single "object" (shape being partitioned)
8224 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8225 # @ref MakePartition operation have default values:
8226 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8227 # - @a KeepNonlimitShapes: 0
8228 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8229 # @a Materials (obsolete parameters): empty
8231 # @note I.e. the following two operations are equivalent:
8233 # Result = geompy.MakeHalfPartition(Object, Plane)
8234 # Result = geompy.MakePartition([Object], [Plane])
8237 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8239 # @ref tui_partition "Example"
8240 @ManageTransactions("BoolOp")
8241 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8243 Perform partition of the Shape with the Plane
8246 theShape Shape to be intersected.
8247 thePlane Tool shape, to intersect theShape.
8248 theName Object name; when specified, this parameter is used
8249 for result publication in the study. Otherwise, if automatic
8250 publication is switched on, default value is used for result name.
8253 New GEOM.GEOM_Object, containing the result shape.
8255 Note: This operation is a shortcut to the more general MakePartition
8256 operation, where theShape specifies single "object" (shape being partitioned)
8257 and thePlane specifies single "tool" (intersector shape). Other parameters of
8258 MakePartition operation have default values:
8259 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8260 - KeepNonlimitShapes: 0
8261 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8263 I.e. the following two operations are equivalent:
8264 Result = geompy.MakeHalfPartition(Object, Plane)
8265 Result = geompy.MakePartition([Object], [Plane])
8267 # Example: see GEOM_TestAll.py
8268 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8269 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8270 self._autoPublish(anObj, theName, "partition")
8273 # end of l3_basic_op
8276 ## @addtogroup l3_transform
8279 ## Translate the given object along the vector, specified
8280 # by its end points.
8281 # @param theObject The object to be translated.
8282 # @param thePoint1 Start point of translation vector.
8283 # @param thePoint2 End point of translation vector.
8284 # @param theCopy Flag used to translate object itself or create a copy.
8285 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8286 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8287 @ManageTransactions("TrsfOp")
8288 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8290 Translate the given object along the vector, specified by its end points.
8293 theObject The object to be translated.
8294 thePoint1 Start point of translation vector.
8295 thePoint2 End point of translation vector.
8296 theCopy Flag used to translate object itself or create a copy.
8299 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8300 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8303 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8305 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8306 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8309 ## Translate the given object along the vector, specified
8310 # by its end points, creating its copy before the translation.
8311 # @param theObject The object to be translated.
8312 # @param thePoint1 Start point of translation vector.
8313 # @param thePoint2 End point of translation vector.
8314 # @param theName Object name; when specified, this parameter is used
8315 # for result publication in the study. Otherwise, if automatic
8316 # publication is switched on, default value is used for result name.
8318 # @return New GEOM.GEOM_Object, containing the translated object.
8320 # @ref tui_translation "Example 1"
8321 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8322 @ManageTransactions("TrsfOp")
8323 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8325 Translate the given object along the vector, specified
8326 by its end points, creating its copy before the translation.
8329 theObject The object to be translated.
8330 thePoint1 Start point of translation vector.
8331 thePoint2 End point of translation vector.
8332 theName Object name; when specified, this parameter is used
8333 for result publication in the study. Otherwise, if automatic
8334 publication is switched on, default value is used for result name.
8337 New GEOM.GEOM_Object, containing the translated object.
8339 # Example: see GEOM_TestAll.py
8340 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8341 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8342 self._autoPublish(anObj, theName, "translated")
8345 ## Translate the given object along the vector, specified by its components.
8346 # @param theObject The object to be translated.
8347 # @param theDX,theDY,theDZ Components of translation vector.
8348 # @param theCopy Flag used to translate object itself or create a copy.
8349 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8350 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8352 # @ref tui_translation "Example"
8353 @ManageTransactions("TrsfOp")
8354 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8356 Translate the given object along the vector, specified by its components.
8359 theObject The object to be translated.
8360 theDX,theDY,theDZ Components of translation vector.
8361 theCopy Flag used to translate object itself or create a copy.
8364 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8365 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8367 # Example: see GEOM_TestAll.py
8368 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8370 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8372 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8373 anObj.SetParameters(Parameters)
8374 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8377 ## Translate the given object along the vector, specified
8378 # by its components, creating its copy before the translation.
8379 # @param theObject The object to be translated.
8380 # @param theDX,theDY,theDZ Components of translation vector.
8381 # @param theName Object name; when specified, this parameter is used
8382 # for result publication in the study. Otherwise, if automatic
8383 # publication is switched on, default value is used for result name.
8385 # @return New GEOM.GEOM_Object, containing the translated object.
8387 # @ref tui_translation "Example"
8388 @ManageTransactions("TrsfOp")
8389 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8391 Translate the given object along the vector, specified
8392 by its components, creating its copy before the translation.
8395 theObject The object to be translated.
8396 theDX,theDY,theDZ Components of translation vector.
8397 theName Object name; when specified, this parameter is used
8398 for result publication in the study. Otherwise, if automatic
8399 publication is switched on, default value is used for result name.
8402 New GEOM.GEOM_Object, containing the translated object.
8404 # Example: see GEOM_TestAll.py
8405 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8406 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8407 anObj.SetParameters(Parameters)
8408 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8409 self._autoPublish(anObj, theName, "translated")
8412 ## Translate the given object along the given vector.
8413 # @param theObject The object to be translated.
8414 # @param theVector The translation vector.
8415 # @param theCopy Flag used to translate object itself or create a copy.
8416 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8417 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8418 @ManageTransactions("TrsfOp")
8419 def TranslateVector(self, theObject, theVector, theCopy=False):
8421 Translate the given object along the given vector.
8424 theObject The object to be translated.
8425 theVector The translation vector.
8426 theCopy Flag used to translate object itself or create a copy.
8429 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8430 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8433 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8435 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8436 RaiseIfFailed("TranslateVector", self.TrsfOp)
8439 ## Translate the given object along the given vector,
8440 # creating its copy before the translation.
8441 # @param theObject The object to be translated.
8442 # @param theVector The translation vector.
8443 # @param theName Object name; when specified, this parameter is used
8444 # for result publication in the study. Otherwise, if automatic
8445 # publication is switched on, default value is used for result name.
8447 # @return New GEOM.GEOM_Object, containing the translated object.
8449 # @ref tui_translation "Example"
8450 @ManageTransactions("TrsfOp")
8451 def MakeTranslationVector(self, theObject, theVector, theName=None):
8453 Translate the given object along the given vector,
8454 creating its copy before the translation.
8457 theObject The object to be translated.
8458 theVector The translation vector.
8459 theName Object name; when specified, this parameter is used
8460 for result publication in the study. Otherwise, if automatic
8461 publication is switched on, default value is used for result name.
8464 New GEOM.GEOM_Object, containing the translated object.
8466 # Example: see GEOM_TestAll.py
8467 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8468 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8469 self._autoPublish(anObj, theName, "translated")
8472 ## Translate the given object along the given vector on given distance.
8473 # @param theObject The object to be translated.
8474 # @param theVector The translation vector.
8475 # @param theDistance The translation distance.
8476 # @param theCopy Flag used to translate object itself or create a copy.
8477 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8478 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8480 # @ref tui_translation "Example"
8481 @ManageTransactions("TrsfOp")
8482 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8484 Translate the given object along the given vector on given distance.
8487 theObject The object to be translated.
8488 theVector The translation vector.
8489 theDistance The translation distance.
8490 theCopy Flag used to translate object itself or create a copy.
8493 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8494 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8496 # Example: see GEOM_TestAll.py
8497 theDistance,Parameters = ParseParameters(theDistance)
8498 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8499 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8500 anObj.SetParameters(Parameters)
8503 ## Translate the given object along the given vector on given distance,
8504 # creating its copy before the translation.
8505 # @param theObject The object to be translated.
8506 # @param theVector The translation vector.
8507 # @param theDistance The translation distance.
8508 # @param theName Object name; when specified, this parameter is used
8509 # for result publication in the study. Otherwise, if automatic
8510 # publication is switched on, default value is used for result name.
8512 # @return New GEOM.GEOM_Object, containing the translated object.
8514 # @ref tui_translation "Example"
8515 @ManageTransactions("TrsfOp")
8516 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8518 Translate the given object along the given vector on given distance,
8519 creating its copy before the translation.
8522 theObject The object to be translated.
8523 theVector The translation vector.
8524 theDistance The translation distance.
8525 theName Object name; when specified, this parameter is used
8526 for result publication in the study. Otherwise, if automatic
8527 publication is switched on, default value is used for result name.
8530 New GEOM.GEOM_Object, containing the translated object.
8532 # Example: see GEOM_TestAll.py
8533 theDistance,Parameters = ParseParameters(theDistance)
8534 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8535 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8536 anObj.SetParameters(Parameters)
8537 self._autoPublish(anObj, theName, "translated")
8540 ## Rotate the given object around the given axis on the given angle.
8541 # @param theObject The object to be rotated.
8542 # @param theAxis Rotation axis.
8543 # @param theAngle Rotation angle in radians.
8544 # @param theCopy Flag used to rotate object itself or create a copy.
8546 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8547 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8549 # @ref tui_rotation "Example"
8550 @ManageTransactions("TrsfOp")
8551 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8553 Rotate the given object around the given axis on the given angle.
8556 theObject The object to be rotated.
8557 theAxis Rotation axis.
8558 theAngle Rotation angle in radians.
8559 theCopy Flag used to rotate object itself or create a copy.
8562 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8563 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8565 # Example: see GEOM_TestAll.py
8567 if isinstance(theAngle,str):
8569 theAngle, Parameters = ParseParameters(theAngle)
8571 theAngle = theAngle*math.pi/180.0
8573 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8575 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8576 RaiseIfFailed("Rotate", self.TrsfOp)
8577 anObj.SetParameters(Parameters)
8580 ## Rotate the given object around the given axis
8581 # on the given angle, creating its copy before the rotation.
8582 # @param theObject The object to be rotated.
8583 # @param theAxis Rotation axis.
8584 # @param theAngle Rotation angle in radians.
8585 # @param theName Object name; when specified, this parameter is used
8586 # for result publication in the study. Otherwise, if automatic
8587 # publication is switched on, default value is used for result name.
8589 # @return New GEOM.GEOM_Object, containing the rotated object.
8591 # @ref tui_rotation "Example"
8592 @ManageTransactions("TrsfOp")
8593 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8595 Rotate the given object around the given axis
8596 on the given angle, creating its copy before the rotatation.
8599 theObject The object to be rotated.
8600 theAxis Rotation axis.
8601 theAngle Rotation angle in radians.
8602 theName Object name; when specified, this parameter is used
8603 for result publication in the study. Otherwise, if automatic
8604 publication is switched on, default value is used for result name.
8607 New GEOM.GEOM_Object, containing the rotated object.
8609 # Example: see GEOM_TestAll.py
8611 if isinstance(theAngle,str):
8613 theAngle, Parameters = ParseParameters(theAngle)
8615 theAngle = theAngle*math.pi/180.0
8616 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8617 RaiseIfFailed("RotateCopy", self.TrsfOp)
8618 anObj.SetParameters(Parameters)
8619 self._autoPublish(anObj, theName, "rotated")
8622 ## Rotate given object around vector perpendicular to plane
8623 # containing three points.
8624 # @param theObject The object to be rotated.
8625 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8626 # containing the three points.
8627 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8628 # @param theCopy Flag used to rotate object itself or create a copy.
8629 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8630 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8631 @ManageTransactions("TrsfOp")
8632 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8634 Rotate given object around vector perpendicular to plane
8635 containing three points.
8638 theObject The object to be rotated.
8639 theCentPoint central point the axis is the vector perpendicular to the plane
8640 containing the three points.
8641 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8642 theCopy Flag used to rotate object itself or create a copy.
8645 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8646 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8649 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8651 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8652 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8655 ## Rotate given object around vector perpendicular to plane
8656 # containing three points, creating its copy before the rotatation.
8657 # @param theObject The object to be rotated.
8658 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8659 # containing the three points.
8660 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8661 # @param theName Object name; when specified, this parameter is used
8662 # for result publication in the study. Otherwise, if automatic
8663 # publication is switched on, default value is used for result name.
8665 # @return New GEOM.GEOM_Object, containing the rotated object.
8667 # @ref tui_rotation "Example"
8668 @ManageTransactions("TrsfOp")
8669 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8671 Rotate given object around vector perpendicular to plane
8672 containing three points, creating its copy before the rotatation.
8675 theObject The object to be rotated.
8676 theCentPoint central point the axis is the vector perpendicular to the plane
8677 containing the three points.
8678 thePoint1,thePoint2 in a perpendicular plane of the axis.
8679 theName Object name; when specified, this parameter is used
8680 for result publication in the study. Otherwise, if automatic
8681 publication is switched on, default value is used for result name.
8684 New GEOM.GEOM_Object, containing the rotated object.
8686 # Example: see GEOM_TestAll.py
8687 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8688 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8689 self._autoPublish(anObj, theName, "rotated")
8692 ## Scale the given object by the specified factor.
8693 # @param theObject The object to be scaled.
8694 # @param thePoint Center point for scaling.
8695 # Passing None for it means scaling relatively the origin of global CS.
8696 # @param theFactor Scaling factor value.
8697 # @param theCopy Flag used to scale object itself or create a copy.
8698 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8699 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8700 @ManageTransactions("TrsfOp")
8701 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8703 Scale the given object by the specified factor.
8706 theObject The object to be scaled.
8707 thePoint Center point for scaling.
8708 Passing None for it means scaling relatively the origin of global CS.
8709 theFactor Scaling factor value.
8710 theCopy Flag used to scale object itself or create a copy.
8713 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8714 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8716 # Example: see GEOM_TestAll.py
8717 theFactor, Parameters = ParseParameters(theFactor)
8719 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8721 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8722 RaiseIfFailed("Scale", self.TrsfOp)
8723 anObj.SetParameters(Parameters)
8726 ## Scale the given object by the factor, creating its copy before the scaling.
8727 # @param theObject The object to be scaled.
8728 # @param thePoint Center point for scaling.
8729 # Passing None for it means scaling relatively the origin of global CS.
8730 # @param theFactor Scaling factor value.
8731 # @param theName Object name; when specified, this parameter is used
8732 # for result publication in the study. Otherwise, if automatic
8733 # publication is switched on, default value is used for result name.
8735 # @return New GEOM.GEOM_Object, containing the scaled shape.
8737 # @ref tui_scale "Example"
8738 @ManageTransactions("TrsfOp")
8739 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8741 Scale the given object by the factor, creating its copy before the scaling.
8744 theObject The object to be scaled.
8745 thePoint Center point for scaling.
8746 Passing None for it means scaling relatively the origin of global CS.
8747 theFactor Scaling factor value.
8748 theName Object name; when specified, this parameter is used
8749 for result publication in the study. Otherwise, if automatic
8750 publication is switched on, default value is used for result name.
8753 New GEOM.GEOM_Object, containing the scaled shape.
8755 # Example: see GEOM_TestAll.py
8756 theFactor, Parameters = ParseParameters(theFactor)
8757 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8758 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8759 anObj.SetParameters(Parameters)
8760 self._autoPublish(anObj, theName, "scaled")
8763 ## Scale the given object by different factors along coordinate axes.
8764 # @param theObject The object to be scaled.
8765 # @param thePoint Center point for scaling.
8766 # Passing None for it means scaling relatively the origin of global CS.
8767 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8768 # @param theCopy Flag used to scale object itself or create a copy.
8769 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8770 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8771 @ManageTransactions("TrsfOp")
8772 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8774 Scale the given object by different factors along coordinate axes.
8777 theObject The object to be scaled.
8778 thePoint Center point for scaling.
8779 Passing None for it means scaling relatively the origin of global CS.
8780 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8781 theCopy Flag used to scale object itself or create a copy.
8784 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8785 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8787 # Example: see GEOM_TestAll.py
8788 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8790 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8791 theFactorX, theFactorY, theFactorZ)
8793 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8794 theFactorX, theFactorY, theFactorZ)
8795 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8796 anObj.SetParameters(Parameters)
8799 ## Scale the given object by different factors along coordinate axes,
8800 # creating its copy before the scaling.
8801 # @param theObject The object to be scaled.
8802 # @param thePoint Center point for scaling.
8803 # Passing None for it means scaling relatively the origin of global CS.
8804 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8805 # @param theName Object name; when specified, this parameter is used
8806 # for result publication in the study. Otherwise, if automatic
8807 # publication is switched on, default value is used for result name.
8809 # @return New GEOM.GEOM_Object, containing the scaled shape.
8811 # @ref swig_scale "Example"
8812 @ManageTransactions("TrsfOp")
8813 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8815 Scale the given object by different factors along coordinate axes,
8816 creating its copy before the scaling.
8819 theObject The object to be scaled.
8820 thePoint Center point for scaling.
8821 Passing None for it means scaling relatively the origin of global CS.
8822 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8823 theName Object name; when specified, this parameter is used
8824 for result publication in the study. Otherwise, if automatic
8825 publication is switched on, default value is used for result name.
8828 New GEOM.GEOM_Object, containing the scaled shape.
8830 # Example: see GEOM_TestAll.py
8831 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8832 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8833 theFactorX, theFactorY, theFactorZ)
8834 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8835 anObj.SetParameters(Parameters)
8836 self._autoPublish(anObj, theName, "scaled")
8839 ## Mirror an object relatively the given plane.
8840 # @param theObject The object to be mirrored.
8841 # @param thePlane Plane of symmetry.
8842 # @param theCopy Flag used to mirror object itself or create a copy.
8843 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8844 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8845 @ManageTransactions("TrsfOp")
8846 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8848 Mirror an object relatively the given plane.
8851 theObject The object to be mirrored.
8852 thePlane Plane of symmetry.
8853 theCopy Flag used to mirror object itself or create a copy.
8856 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8857 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8860 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8862 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8863 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8866 ## Create an object, symmetrical
8867 # to the given one relatively the given plane.
8868 # @param theObject The object to be mirrored.
8869 # @param thePlane Plane of symmetry.
8870 # @param theName Object name; when specified, this parameter is used
8871 # for result publication in the study. Otherwise, if automatic
8872 # publication is switched on, default value is used for result name.
8874 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8876 # @ref tui_mirror "Example"
8877 @ManageTransactions("TrsfOp")
8878 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8880 Create an object, symmetrical to the given one relatively the given plane.
8883 theObject The object to be mirrored.
8884 thePlane Plane of symmetry.
8885 theName Object name; when specified, this parameter is used
8886 for result publication in the study. Otherwise, if automatic
8887 publication is switched on, default value is used for result name.
8890 New GEOM.GEOM_Object, containing the mirrored shape.
8892 # Example: see GEOM_TestAll.py
8893 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8894 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
8895 self._autoPublish(anObj, theName, "mirrored")
8898 ## Mirror an object relatively the given axis.
8899 # @param theObject The object to be mirrored.
8900 # @param theAxis Axis of symmetry.
8901 # @param theCopy Flag used to mirror object itself or create a copy.
8902 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8903 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8904 @ManageTransactions("TrsfOp")
8905 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
8907 Mirror an object relatively the given axis.
8910 theObject The object to be mirrored.
8911 theAxis Axis of symmetry.
8912 theCopy Flag used to mirror object itself or create a copy.
8915 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8916 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8919 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8921 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
8922 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
8925 ## Create an object, symmetrical
8926 # to the given one relatively the given axis.
8927 # @param theObject The object to be mirrored.
8928 # @param theAxis Axis of symmetry.
8929 # @param theName Object name; when specified, this parameter is used
8930 # for result publication in the study. Otherwise, if automatic
8931 # publication is switched on, default value is used for result name.
8933 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8935 # @ref tui_mirror "Example"
8936 @ManageTransactions("TrsfOp")
8937 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
8939 Create an object, symmetrical to the given one relatively the given axis.
8942 theObject The object to be mirrored.
8943 theAxis Axis of symmetry.
8944 theName Object name; when specified, this parameter is used
8945 for result publication in the study. Otherwise, if automatic
8946 publication is switched on, default value is used for result name.
8949 New GEOM.GEOM_Object, containing the mirrored shape.
8951 # Example: see GEOM_TestAll.py
8952 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
8953 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
8954 self._autoPublish(anObj, theName, "mirrored")
8957 ## Mirror an object relatively the given point.
8958 # @param theObject The object to be mirrored.
8959 # @param thePoint Point of symmetry.
8960 # @param theCopy Flag used to mirror object itself or create a copy.
8961 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8962 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8963 @ManageTransactions("TrsfOp")
8964 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
8966 Mirror an object relatively the given point.
8969 theObject The object to be mirrored.
8970 thePoint Point of symmetry.
8971 theCopy Flag used to mirror object itself or create a copy.
8974 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8975 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8977 # Example: see GEOM_TestAll.py
8979 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
8981 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
8982 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
8985 ## Create an object, symmetrical
8986 # to the given one relatively the given point.
8987 # @param theObject The object to be mirrored.
8988 # @param thePoint Point of symmetry.
8989 # @param theName Object name; when specified, this parameter is used
8990 # for result publication in the study. Otherwise, if automatic
8991 # publication is switched on, default value is used for result name.
8993 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8995 # @ref tui_mirror "Example"
8996 @ManageTransactions("TrsfOp")
8997 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
8999 Create an object, symmetrical
9000 to the given one relatively the given point.
9003 theObject The object to be mirrored.
9004 thePoint Point of symmetry.
9005 theName Object name; when specified, this parameter is used
9006 for result publication in the study. Otherwise, if automatic
9007 publication is switched on, default value is used for result name.
9010 New GEOM.GEOM_Object, containing the mirrored shape.
9012 # Example: see GEOM_TestAll.py
9013 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9014 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9015 self._autoPublish(anObj, theName, "mirrored")
9018 ## Modify the location of the given object.
9019 # @param theObject The object to be displaced.
9020 # @param theStartLCS Coordinate system to perform displacement from it.\n
9021 # If \a theStartLCS is NULL, displacement
9022 # will be performed from global CS.\n
9023 # If \a theObject itself is used as \a theStartLCS,
9024 # its location will be changed to \a theEndLCS.
9025 # @param theEndLCS Coordinate system to perform displacement to it.
9026 # @param theCopy Flag used to displace object itself or create a copy.
9027 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9028 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9029 @ManageTransactions("TrsfOp")
9030 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9032 Modify the Location of the given object by LCS, creating its copy before the setting.
9035 theObject The object to be displaced.
9036 theStartLCS Coordinate system to perform displacement from it.
9037 If theStartLCS is NULL, displacement
9038 will be performed from global CS.
9039 If theObject itself is used as theStartLCS,
9040 its location will be changed to theEndLCS.
9041 theEndLCS Coordinate system to perform displacement to it.
9042 theCopy Flag used to displace object itself or create a copy.
9045 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9046 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9048 # Example: see GEOM_TestAll.py
9050 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9052 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9053 RaiseIfFailed("Displace", self.TrsfOp)
9056 ## Modify the Location of the given object by LCS,
9057 # creating its copy before the setting.
9058 # @param theObject The object to be displaced.
9059 # @param theStartLCS Coordinate system to perform displacement from it.\n
9060 # If \a theStartLCS is NULL, displacement
9061 # will be performed from global CS.\n
9062 # If \a theObject itself is used as \a theStartLCS,
9063 # its location will be changed to \a theEndLCS.
9064 # @param theEndLCS Coordinate system to perform displacement to it.
9065 # @param theName Object name; when specified, this parameter is used
9066 # for result publication in the study. Otherwise, if automatic
9067 # publication is switched on, default value is used for result name.
9069 # @return New GEOM.GEOM_Object, containing the displaced shape.
9071 # @ref tui_modify_location "Example"
9072 @ManageTransactions("TrsfOp")
9073 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9075 Modify the Location of the given object by LCS, creating its copy before the setting.
9078 theObject The object to be displaced.
9079 theStartLCS Coordinate system to perform displacement from it.
9080 If theStartLCS is NULL, displacement
9081 will be performed from global CS.
9082 If theObject itself is used as theStartLCS,
9083 its location will be changed to theEndLCS.
9084 theEndLCS Coordinate system to perform displacement to it.
9085 theName Object name; when specified, this parameter is used
9086 for result publication in the study. Otherwise, if automatic
9087 publication is switched on, default value is used for result name.
9090 New GEOM.GEOM_Object, containing the displaced shape.
9093 # create local coordinate systems
9094 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9095 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9096 # modify the location of the given object
9097 position = geompy.MakePosition(cylinder, cs1, cs2)
9099 # Example: see GEOM_TestAll.py
9100 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9101 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9102 self._autoPublish(anObj, theName, "displaced")
9105 ## Modify the Location of the given object by Path.
9106 # @param theObject The object to be displaced.
9107 # @param thePath Wire or Edge along that the object will be translated.
9108 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9109 # @param theCopy is to create a copy objects if true.
9110 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9111 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9112 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9114 # @ref tui_modify_location "Example"
9115 @ManageTransactions("TrsfOp")
9116 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9118 Modify the Location of the given object by Path.
9121 theObject The object to be displaced.
9122 thePath Wire or Edge along that the object will be translated.
9123 theDistance progress of Path (0 = start location, 1 = end of path location).
9124 theCopy is to create a copy objects if true.
9125 theReverse 0 - for usual direction, 1 - to reverse path direction.
9128 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9129 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9132 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9134 # Example: see GEOM_TestAll.py
9135 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9136 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9139 ## Modify the Location of the given object by Path, creating its copy before the operation.
9140 # @param theObject The object to be displaced.
9141 # @param thePath Wire or Edge along that the object will be translated.
9142 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9143 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9144 # @param theName Object name; when specified, this parameter is used
9145 # for result publication in the study. Otherwise, if automatic
9146 # publication is switched on, default value is used for result name.
9148 # @return New GEOM.GEOM_Object, containing the displaced shape.
9149 @ManageTransactions("TrsfOp")
9150 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9152 Modify the Location of the given object by Path, creating its copy before the operation.
9155 theObject The object to be displaced.
9156 thePath Wire or Edge along that the object will be translated.
9157 theDistance progress of Path (0 = start location, 1 = end of path location).
9158 theReverse 0 - for usual direction, 1 - to reverse path direction.
9159 theName Object name; when specified, this parameter is used
9160 for result publication in the study. Otherwise, if automatic
9161 publication is switched on, default value is used for result name.
9164 New GEOM.GEOM_Object, containing the displaced shape.
9166 # Example: see GEOM_TestAll.py
9167 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9168 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9169 self._autoPublish(anObj, theName, "displaced")
9172 ## Offset given shape.
9173 # @param theObject The base object for the offset.
9174 # @param theOffset Offset value.
9175 # @param theCopy Flag used to offset object itself or create a copy.
9176 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9177 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9178 @ManageTransactions("TrsfOp")
9179 def Offset(self, theObject, theOffset, theCopy=False):
9184 theObject The base object for the offset.
9185 theOffset Offset value.
9186 theCopy Flag used to offset object itself or create a copy.
9189 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9190 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9192 theOffset, Parameters = ParseParameters(theOffset)
9194 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
9196 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
9197 RaiseIfFailed("Offset", self.TrsfOp)
9198 anObj.SetParameters(Parameters)
9201 ## Create new object as offset of the given one.
9202 # @param theObject The base object for the offset.
9203 # @param theOffset Offset value.
9204 # @param theName Object name; when specified, this parameter is used
9205 # for result publication in the study. Otherwise, if automatic
9206 # publication is switched on, default value is used for result name.
9208 # @return New GEOM.GEOM_Object, containing the offset object.
9210 # @ref tui_offset "Example"
9211 @ManageTransactions("TrsfOp")
9212 def MakeOffset(self, theObject, theOffset, theName=None):
9214 Create new object as offset of the given one.
9217 theObject The base object for the offset.
9218 theOffset Offset value.
9219 theName Object name; when specified, this parameter is used
9220 for result publication in the study. Otherwise, if automatic
9221 publication is switched on, default value is used for result name.
9224 New GEOM.GEOM_Object, containing the offset object.
9227 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9228 # create a new object as offset of the given object
9229 offset = geompy.MakeOffset(box, 70.)
9231 # Example: see GEOM_TestAll.py
9232 theOffset, Parameters = ParseParameters(theOffset)
9233 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
9234 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9235 anObj.SetParameters(Parameters)
9236 self._autoPublish(anObj, theName, "offset")
9239 ## Create new object as projection of the given one on another.
9240 # @param theSource The source object for the projection. It can be a point, edge or wire.
9241 # Edge and wire are acceptable if @a theTarget is a face.
9242 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9243 # @param theName Object name; when specified, this parameter is used
9244 # for result publication in the study. Otherwise, if automatic
9245 # publication is switched on, default value is used for result name.
9247 # @return New GEOM.GEOM_Object, containing the projection.
9249 # @ref tui_projection "Example"
9250 @ManageTransactions("TrsfOp")
9251 def MakeProjection(self, theSource, theTarget, theName=None):
9253 Create new object as projection of the given one on another.
9256 theSource The source object for the projection. It can be a point, edge or wire.
9257 Edge and wire are acceptable if theTarget is a face.
9258 theTarget The target object. It can be planar or cylindrical face, edge or wire.
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 the projection.
9266 # Example: see GEOM_TestAll.py
9267 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9268 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9269 self._autoPublish(anObj, theName, "projection")
9272 ## Create a projection of the given point on a wire or an edge.
9273 # If there are no solutions or there are 2 or more solutions It throws an
9275 # @param thePoint the point to be projected.
9276 # @param theWire the wire. The edge is accepted as well.
9277 # @param theName Object name; when specified, this parameter is used
9278 # for result publication in the study. Otherwise, if automatic
9279 # publication is switched on, default value is used for result name.
9281 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9282 # \n \a u: The parameter of projection point on edge.
9283 # \n \a PointOnEdge: The projection point.
9284 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9286 # @ref tui_projection "Example"
9287 @ManageTransactions("TrsfOp")
9288 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9290 Create a projection of the given point on a wire or an edge.
9291 If there are no solutions or there are 2 or more solutions It throws an
9295 thePoint the point to be projected.
9296 theWire the wire. The edge is accepted as well.
9297 theName Object name; when specified, this parameter is used
9298 for result publication in the study. Otherwise, if automatic
9299 publication is switched on, default value is used for result name.
9302 [u, PointOnEdge, EdgeInWireIndex]
9303 u: The parameter of projection point on edge.
9304 PointOnEdge: The projection point.
9305 EdgeInWireIndex: The index of an edge in a wire.
9307 # Example: see GEOM_TestAll.py
9308 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9309 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9310 self._autoPublish(anObj[1], theName, "projection")
9313 # -----------------------------------------------------------------------------
9315 # -----------------------------------------------------------------------------
9317 ## Translate the given object along the given vector a given number times
9318 # @param theObject The object to be translated.
9319 # @param theVector Direction of the translation. DX if None.
9320 # @param theStep Distance to translate on.
9321 # @param theNbTimes Quantity of translations to be done.
9322 # @param theName Object name; when specified, this parameter is used
9323 # for result publication in the study. Otherwise, if automatic
9324 # publication is switched on, default value is used for result name.
9326 # @return New GEOM.GEOM_Object, containing compound of all
9327 # the shapes, obtained after each translation.
9329 # @ref tui_multi_translation "Example"
9330 @ManageTransactions("TrsfOp")
9331 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9333 Translate the given object along the given vector a given number times
9336 theObject The object to be translated.
9337 theVector Direction of the translation. DX if None.
9338 theStep Distance to translate on.
9339 theNbTimes Quantity of translations to be done.
9340 theName Object name; when specified, this parameter is used
9341 for result publication in the study. Otherwise, if automatic
9342 publication is switched on, default value is used for result name.
9345 New GEOM.GEOM_Object, containing compound of all
9346 the shapes, obtained after each translation.
9349 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9351 # Example: see GEOM_TestAll.py
9352 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9353 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9354 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9355 anObj.SetParameters(Parameters)
9356 self._autoPublish(anObj, theName, "multitranslation")
9359 ## Conseqently apply two specified translations to theObject specified number of times.
9360 # @param theObject The object to be translated.
9361 # @param theVector1 Direction of the first translation. DX if None.
9362 # @param theStep1 Step of the first translation.
9363 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9364 # @param theVector2 Direction of the second translation. DY if None.
9365 # @param theStep2 Step of the second translation.
9366 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9367 # @param theName Object name; when specified, this parameter is used
9368 # for result publication in the study. Otherwise, if automatic
9369 # publication is switched on, default value is used for result name.
9371 # @return New GEOM.GEOM_Object, containing compound of all
9372 # the shapes, obtained after each translation.
9374 # @ref tui_multi_translation "Example"
9375 @ManageTransactions("TrsfOp")
9376 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9377 theVector2, theStep2, theNbTimes2, theName=None):
9379 Conseqently apply two specified translations to theObject specified number of times.
9382 theObject The object to be translated.
9383 theVector1 Direction of the first translation. DX if None.
9384 theStep1 Step of the first translation.
9385 theNbTimes1 Quantity of translations to be done along theVector1.
9386 theVector2 Direction of the second translation. DY if None.
9387 theStep2 Step of the second translation.
9388 theNbTimes2 Quantity of translations to be done along theVector2.
9389 theName Object name; when specified, this parameter is used
9390 for result publication in the study. Otherwise, if automatic
9391 publication is switched on, default value is used for result name.
9394 New GEOM.GEOM_Object, containing compound of all
9395 the shapes, obtained after each translation.
9398 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9400 # Example: see GEOM_TestAll.py
9401 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9402 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9403 theVector2, theStep2, theNbTimes2)
9404 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9405 anObj.SetParameters(Parameters)
9406 self._autoPublish(anObj, theName, "multitranslation")
9409 ## Rotate the given object around the given axis a given number times.
9410 # Rotation angle will be 2*PI/theNbTimes.
9411 # @param theObject The object to be rotated.
9412 # @param theAxis The rotation axis. DZ if None.
9413 # @param theNbTimes Quantity of rotations to be done.
9414 # @param theName Object name; when specified, this parameter is used
9415 # for result publication in the study. Otherwise, if automatic
9416 # publication is switched on, default value is used for result name.
9418 # @return New GEOM.GEOM_Object, containing compound of all the
9419 # shapes, obtained after each rotation.
9421 # @ref tui_multi_rotation "Example"
9422 @ManageTransactions("TrsfOp")
9423 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9425 Rotate the given object around the given axis a given number times.
9426 Rotation angle will be 2*PI/theNbTimes.
9429 theObject The object to be rotated.
9430 theAxis The rotation axis. DZ if None.
9431 theNbTimes Quantity of rotations to be done.
9432 theName Object name; when specified, this parameter is used
9433 for result publication in the study. Otherwise, if automatic
9434 publication is switched on, default value is used for result name.
9437 New GEOM.GEOM_Object, containing compound of all the
9438 shapes, obtained after each rotation.
9441 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9443 # Example: see GEOM_TestAll.py
9444 theNbTimes, Parameters = ParseParameters(theNbTimes)
9445 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9446 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9447 anObj.SetParameters(Parameters)
9448 self._autoPublish(anObj, theName, "multirotation")
9451 ## Rotate the given object around the given axis
9452 # a given number times on the given angle.
9453 # @param theObject The object to be rotated.
9454 # @param theAxis The rotation axis. DZ if None.
9455 # @param theAngleStep Rotation angle in radians.
9456 # @param theNbTimes Quantity of rotations to be done.
9457 # @param theName Object name; when specified, this parameter is used
9458 # for result publication in the study. Otherwise, if automatic
9459 # publication is switched on, default value is used for result name.
9461 # @return New GEOM.GEOM_Object, containing compound of all the
9462 # shapes, obtained after each rotation.
9464 # @ref tui_multi_rotation "Example"
9465 @ManageTransactions("TrsfOp")
9466 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9468 Rotate the given object around the given axis
9469 a given number times on the given angle.
9472 theObject The object to be rotated.
9473 theAxis The rotation axis. DZ if None.
9474 theAngleStep Rotation angle in radians.
9475 theNbTimes Quantity of rotations to be done.
9476 theName Object name; when specified, this parameter is used
9477 for result publication in the study. Otherwise, if automatic
9478 publication is switched on, default value is used for result name.
9481 New GEOM.GEOM_Object, containing compound of all the
9482 shapes, obtained after each rotation.
9485 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9487 # Example: see GEOM_TestAll.py
9488 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9489 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9490 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9491 anObj.SetParameters(Parameters)
9492 self._autoPublish(anObj, theName, "multirotation")
9495 ## Rotate the given object around the given axis a given
9496 # number times and multi-translate each rotation result.
9497 # Rotation angle will be 2*PI/theNbTimes1.
9498 # Translation direction passes through center of gravity
9499 # of rotated shape and its projection on the rotation axis.
9500 # @param theObject The object to be rotated.
9501 # @param theAxis Rotation axis. DZ if None.
9502 # @param theNbTimes1 Quantity of rotations to be done.
9503 # @param theRadialStep Translation distance.
9504 # @param theNbTimes2 Quantity of translations to be done.
9505 # @param theName Object name; when specified, this parameter is used
9506 # for result publication in the study. Otherwise, if automatic
9507 # publication is switched on, default value is used for result name.
9509 # @return New GEOM.GEOM_Object, containing compound of all the
9510 # shapes, obtained after each transformation.
9512 # @ref tui_multi_rotation "Example"
9513 @ManageTransactions("TrsfOp")
9514 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9516 Rotate the given object around the
9517 given axis on the given angle a given number
9518 times and multi-translate each rotation result.
9519 Translation direction passes through center of gravity
9520 of rotated shape and its projection on the rotation axis.
9523 theObject The object to be rotated.
9524 theAxis Rotation axis. DZ if None.
9525 theNbTimes1 Quantity of rotations to be done.
9526 theRadialStep Translation distance.
9527 theNbTimes2 Quantity of translations to be done.
9528 theName Object name; when specified, this parameter is used
9529 for result publication in the study. Otherwise, if automatic
9530 publication is switched on, default value is used for result name.
9533 New GEOM.GEOM_Object, containing compound of all the
9534 shapes, obtained after each transformation.
9537 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9539 # Example: see GEOM_TestAll.py
9540 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9541 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9542 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9543 anObj.SetParameters(Parameters)
9544 self._autoPublish(anObj, theName, "multirotation")
9547 ## Rotate the given object around the
9548 # given axis on the given angle a given number
9549 # times and multi-translate each rotation result.
9550 # Translation direction passes through center of gravity
9551 # of rotated shape and its projection on the rotation axis.
9552 # @param theObject The object to be rotated.
9553 # @param theAxis Rotation axis. DZ if None.
9554 # @param theAngleStep Rotation angle in radians.
9555 # @param theNbTimes1 Quantity of rotations to be done.
9556 # @param theRadialStep Translation distance.
9557 # @param theNbTimes2 Quantity of translations to be done.
9558 # @param theName Object name; when specified, this parameter is used
9559 # for result publication in the study. Otherwise, if automatic
9560 # publication is switched on, default value is used for result name.
9562 # @return New GEOM.GEOM_Object, containing compound of all the
9563 # shapes, obtained after each transformation.
9565 # @ref tui_multi_rotation "Example"
9566 @ManageTransactions("TrsfOp")
9567 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9569 Rotate the given object around the
9570 given axis on the given angle a given number
9571 times and multi-translate each rotation result.
9572 Translation direction passes through center of gravity
9573 of rotated shape and its projection on the rotation axis.
9576 theObject The object to be rotated.
9577 theAxis Rotation axis. DZ if None.
9578 theAngleStep Rotation angle in radians.
9579 theNbTimes1 Quantity of rotations to be done.
9580 theRadialStep Translation distance.
9581 theNbTimes2 Quantity of translations to be done.
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.
9587 New GEOM.GEOM_Object, containing compound of all the
9588 shapes, obtained after each transformation.
9591 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9593 # Example: see GEOM_TestAll.py
9594 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9595 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9596 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9597 anObj.SetParameters(Parameters)
9598 self._autoPublish(anObj, theName, "multirotation")
9601 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9603 # @ref swig_MakeMultiRotation "Example"
9604 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9606 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9609 pz = geompy.MakeVertex(0, 0, 100)
9610 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9611 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9613 # Example: see GEOM_TestOthers.py
9614 aVec = self.MakeLine(aPoint,aDir)
9615 # note: auto-publishing is done in self.MultiRotate1D()
9616 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9619 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9621 # @ref swig_MakeMultiRotation "Example"
9622 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9624 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9627 pz = geompy.MakeVertex(0, 0, 100)
9628 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9629 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9631 # Example: see GEOM_TestOthers.py
9632 aVec = self.MakeLine(aPoint,aDir)
9633 # note: auto-publishing is done in self.MultiRotate1D()
9634 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9637 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9639 # @ref swig_MakeMultiRotation "Example"
9640 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9642 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9645 pz = geompy.MakeVertex(0, 0, 100)
9646 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9647 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9649 # Example: see GEOM_TestOthers.py
9650 aVec = self.MakeLine(aPoint,aDir)
9651 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9652 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9655 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9657 # @ref swig_MakeMultiRotation "Example"
9658 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9660 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9663 pz = geompy.MakeVertex(0, 0, 100)
9664 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9665 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9667 # Example: see GEOM_TestOthers.py
9668 aVec = self.MakeLine(aPoint,aDir)
9669 # note: auto-publishing is done in self.MultiRotate2D()
9670 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9674 # Compute a wire or a face that represents a projection of the source
9675 # shape onto cylinder. The cylinder's coordinate system is the same
9676 # as the global coordinate system.
9678 # @param theObject The object to be projected. It can be either
9679 # a planar wire or a face.
9680 # @param theRadius The radius of the cylinder.
9681 # @param theStartAngle The starting angle in radians from
9682 # the cylinder's X axis around Z axis. The angle from which
9683 # the projection is started.
9684 # @param theAngleLength The projection length angle in radians.
9685 # The angle in which to project the total length of the wire.
9686 # If it is negative the projection is not scaled and natural
9687 # wire length is kept for the projection.
9688 # @param theAngleRotation The desired angle in radians between
9689 # the tangent vector to the first curve at the first point of
9690 # the theObject's projection in 2D space and U-direction of
9691 # cylinder's 2D space.
9692 # @param theName Object name; when specified, this parameter is used
9693 # for result publication in the study. Otherwise, if automatic
9694 # publication is switched on, default value is used for result name.
9696 # @return New GEOM.GEOM_Object, containing the result shape. The result
9697 # represents a wire or a face that represents a projection of
9698 # the source shape onto a cylinder.
9700 # @ref tui_projection "Example"
9701 def MakeProjectionOnCylinder (self, theObject, theRadius,
9702 theStartAngle=0.0, theAngleLength=-1.0,
9703 theAngleRotation=0.0,
9706 Compute a wire or a face that represents a projection of the source
9707 shape onto cylinder. The cylinder's coordinate system is the same
9708 as the global coordinate system.
9711 theObject The object to be projected. It can be either
9712 a planar wire or a face.
9713 theRadius The radius of the cylinder.
9714 theStartAngle The starting angle in radians from the cylinder's X axis
9715 around Z axis. The angle from which the projection is started.
9716 theAngleLength The projection length angle in radians. The angle in which
9717 to project the total length of the wire. If it is negative the
9718 projection is not scaled and natural wire length is kept for
9720 theAngleRotation The desired angle in radians between
9721 the tangent vector to the first curve at the first
9722 point of the theObject's projection in 2D space and
9723 U-direction of cylinder's 2D space.
9724 theName Object name; when specified, this parameter is used
9725 for result publication in the study. Otherwise, if automatic
9726 publication is switched on, default value is used for result name.
9729 New GEOM.GEOM_Object, containing the result shape. The result
9730 represents a wire or a face that represents a projection of
9731 the source shape onto a cylinder.
9733 # Example: see GEOM_TestAll.py
9734 flagStartAngle = False
9735 if isinstance(theStartAngle,str):
9736 flagStartAngle = True
9737 flagAngleLength = False
9738 if isinstance(theAngleLength,str):
9739 flagAngleLength = True
9740 flagAngleRotation = False
9741 if isinstance(theAngleRotation,str):
9742 flagAngleRotation = True
9743 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9744 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9746 theStartAngle = theStartAngle*math.pi/180.
9748 theAngleLength = theAngleLength*math.pi/180.
9749 if flagAngleRotation:
9750 theAngleRotation = theAngleRotation*math.pi/180.
9751 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9752 theStartAngle, theAngleLength, theAngleRotation)
9753 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9754 anObj.SetParameters(Parameters)
9755 self._autoPublish(anObj, theName, "projection")
9758 # end of l3_transform
9761 ## @addtogroup l3_transform_d
9764 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9765 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9767 Deprecated method. Use MultiRotate1DNbTimes instead.
9769 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
9770 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9772 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9773 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9774 @ManageTransactions("TrsfOp")
9775 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9777 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9778 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9781 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9783 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
9784 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9785 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9786 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9787 anObj.SetParameters(Parameters)
9788 self._autoPublish(anObj, theName, "multirotation")
9791 ## The same, as MultiRotate1D(), but axis is given by direction and point
9792 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9793 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9795 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9796 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9799 pz = geompy.MakeVertex(0, 0, 100)
9800 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9801 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9803 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
9804 aVec = self.MakeLine(aPoint,aDir)
9805 # note: auto-publishing is done in self.MultiRotate1D()
9806 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9809 ## The same, as MultiRotate2D(), but axis is given by direction and point
9810 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9811 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9813 The same, as MultiRotate2D(), but axis is given by direction and point
9814 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9817 pz = geompy.MakeVertex(0, 0, 100)
9818 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9819 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9821 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
9822 aVec = self.MakeLine(aPoint,aDir)
9823 # note: auto-publishing is done in self.MultiRotate2D()
9824 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9827 # end of l3_transform_d
9830 ## @addtogroup l3_local
9833 ## Perform a fillet on all edges of the given shape.
9834 # @param theShape Shape, to perform fillet on.
9835 # @param theR Fillet radius.
9836 # @param theName Object name; when specified, this parameter is used
9837 # for result publication in the study. Otherwise, if automatic
9838 # publication is switched on, default value is used for result name.
9840 # @return New GEOM.GEOM_Object, containing the result shape.
9842 # @ref tui_fillet "Example 1"
9843 # \n @ref swig_MakeFilletAll "Example 2"
9844 @ManageTransactions("LocalOp")
9845 def MakeFilletAll(self, theShape, theR, theName=None):
9847 Perform a fillet on all edges of the given shape.
9850 theShape Shape, to perform fillet on.
9852 theName Object name; when specified, this parameter is used
9853 for result publication in the study. Otherwise, if automatic
9854 publication is switched on, default value is used for result name.
9857 New GEOM.GEOM_Object, containing the result shape.
9860 filletall = geompy.MakeFilletAll(prism, 10.)
9862 # Example: see GEOM_TestOthers.py
9863 theR,Parameters = ParseParameters(theR)
9864 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9865 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9866 anObj.SetParameters(Parameters)
9867 self._autoPublish(anObj, theName, "fillet")
9870 ## Perform a fillet on the specified edges/faces of the given shape
9871 # @param theShape Shape, to perform fillet on.
9872 # @param theR Fillet radius.
9873 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9874 # @param theListShapes Global indices of edges/faces to perform fillet on.
9875 # @param theName Object name; when specified, this parameter is used
9876 # for result publication in the study. Otherwise, if automatic
9877 # publication is switched on, default value is used for result name.
9879 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9881 # @return New GEOM.GEOM_Object, containing the result shape.
9883 # @ref tui_fillet "Example"
9884 @ManageTransactions("LocalOp")
9885 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
9887 Perform a fillet on the specified edges/faces of the given shape
9890 theShape Shape, to perform fillet on.
9892 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
9893 theListShapes Global indices of edges/faces to perform fillet on.
9894 theName Object name; when specified, this parameter is used
9895 for result publication in the study. Otherwise, if automatic
9896 publication is switched on, default value is used for result name.
9899 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9902 New GEOM.GEOM_Object, containing the result shape.
9905 # get the list of IDs (IDList) for the fillet
9906 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9908 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9909 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9910 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9911 # make a fillet on the specified edges of the given shape
9912 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
9914 # Example: see GEOM_TestAll.py
9915 theR,Parameters = ParseParameters(theR)
9917 if theShapeType == self.ShapeType["EDGE"]:
9918 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
9919 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
9921 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
9922 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
9923 anObj.SetParameters(Parameters)
9924 self._autoPublish(anObj, theName, "fillet")
9927 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
9928 @ManageTransactions("LocalOp")
9929 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
9931 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
9934 # get the list of IDs (IDList) for the fillet
9935 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
9937 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
9938 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
9939 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
9940 # make a fillet on the specified edges of the given shape
9941 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
9943 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
9945 if theShapeType == self.ShapeType["EDGE"]:
9946 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
9947 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
9949 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
9950 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
9951 anObj.SetParameters(Parameters)
9952 self._autoPublish(anObj, theName, "fillet")
9955 ## Perform a fillet on the specified edges of the given shape
9956 # @param theShape Wire Shape to perform fillet on.
9957 # @param theR Fillet radius.
9958 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
9959 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
9960 # \note The list of vertices could be empty,
9961 # in this case fillet will done done at all vertices in wire
9962 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
9963 # by the length of the edges, nearest to the fillet vertex.
9964 # But sometimes the next edge is C1 continuous with the one, nearest to
9965 # the fillet point, and such two (or more) edges can be united to allow
9966 # bigger radius. Set this flag to TRUE to allow collinear edges union,
9967 # thus ignoring the secant vertex (vertices).
9968 # @param theName Object name; when specified, this parameter is used
9969 # for result publication in the study. Otherwise, if automatic
9970 # publication is switched on, default value is used for result name.
9972 # @return New GEOM.GEOM_Object, containing the result shape.
9974 # @ref tui_fillet2d "Example"
9975 @ManageTransactions("LocalOp")
9976 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
9978 Perform a fillet on the specified edges of the given shape
9981 theShape Wire Shape to perform fillet on.
9983 theListOfVertexes Global indices of vertexes to perform fillet on.
9984 doIgnoreSecantVertices If FALSE, fillet radius is always limited
9985 by the length of the edges, nearest to the fillet vertex.
9986 But sometimes the next edge is C1 continuous with the one, nearest to
9987 the fillet point, and such two (or more) edges can be united to allow
9988 bigger radius. Set this flag to TRUE to allow collinear edges union,
9989 thus ignoring the secant vertex (vertices).
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.
9994 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
9996 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
9999 New GEOM.GEOM_Object, containing the result shape.
10003 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10004 # make fillet at given wire vertices with giver radius
10005 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10007 # Example: see GEOM_TestAll.py
10008 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10009 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10010 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10011 anObj.SetParameters(Parameters)
10012 self._autoPublish(anObj, theName, "fillet")
10015 ## Perform a fillet at the specified vertices of the given face/shell.
10016 # @param theShape Face or Shell shape to perform fillet on.
10017 # @param theR Fillet radius.
10018 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10019 # @param theName Object name; when specified, this parameter is used
10020 # for result publication in the study. Otherwise, if automatic
10021 # publication is switched on, default value is used for result name.
10023 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10025 # @return New GEOM.GEOM_Object, containing the result shape.
10027 # @ref tui_fillet2d "Example"
10028 @ManageTransactions("LocalOp")
10029 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10031 Perform a fillet at the specified vertices of the given face/shell.
10034 theShape Face or Shell shape to perform fillet on.
10035 theR Fillet radius.
10036 theListOfVertexes Global indices of vertexes to perform fillet on.
10037 theName Object name; when specified, this parameter is used
10038 for result publication in the study. Otherwise, if automatic
10039 publication is switched on, default value is used for result name.
10041 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10044 New GEOM.GEOM_Object, containing the result shape.
10047 face = geompy.MakeFaceHW(100, 100, 1)
10048 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10050 # Example: see GEOM_TestAll.py
10051 theR,Parameters = ParseParameters(theR)
10052 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10053 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10054 anObj.SetParameters(Parameters)
10055 self._autoPublish(anObj, theName, "fillet")
10058 ## Perform a symmetric chamfer on all edges of the given shape.
10059 # @param theShape Shape, to perform chamfer on.
10060 # @param theD Chamfer size along each face.
10061 # @param theName Object name; when specified, this parameter is used
10062 # for result publication in the study. Otherwise, if automatic
10063 # publication is switched on, default value is used for result name.
10065 # @return New GEOM.GEOM_Object, containing the result shape.
10067 # @ref tui_chamfer "Example 1"
10068 # \n @ref swig_MakeChamferAll "Example 2"
10069 @ManageTransactions("LocalOp")
10070 def MakeChamferAll(self, theShape, theD, theName=None):
10072 Perform a symmetric chamfer on all edges of the given shape.
10075 theShape Shape, to perform chamfer on.
10076 theD Chamfer size along each face.
10077 theName Object name; when specified, this parameter is used
10078 for result publication in the study. Otherwise, if automatic
10079 publication is switched on, default value is used for result name.
10082 New GEOM.GEOM_Object, containing the result shape.
10085 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10087 # Example: see GEOM_TestOthers.py
10088 theD,Parameters = ParseParameters(theD)
10089 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10090 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10091 anObj.SetParameters(Parameters)
10092 self._autoPublish(anObj, theName, "chamfer")
10095 ## Perform a chamfer on edges, common to the specified faces,
10096 # with distance D1 on the Face1
10097 # @param theShape Shape, to perform chamfer on.
10098 # @param theD1 Chamfer size along \a theFace1.
10099 # @param theD2 Chamfer size along \a theFace2.
10100 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10101 # @param theName Object name; when specified, this parameter is used
10102 # for result publication in the study. Otherwise, if automatic
10103 # publication is switched on, default value is used for result name.
10105 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10107 # @return New GEOM.GEOM_Object, containing the result shape.
10109 # @ref tui_chamfer "Example"
10110 @ManageTransactions("LocalOp")
10111 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10113 Perform a chamfer on edges, common to the specified faces,
10114 with distance D1 on the Face1
10117 theShape Shape, to perform chamfer on.
10118 theD1 Chamfer size along theFace1.
10119 theD2 Chamfer size along theFace2.
10120 theFace1,theFace2 Global indices of two faces of theShape.
10121 theName Object name; when specified, this parameter is used
10122 for result publication in the study. Otherwise, if automatic
10123 publication is switched on, default value is used for result name.
10126 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10129 New GEOM.GEOM_Object, containing the result shape.
10132 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10133 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10134 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10135 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10137 # Example: see GEOM_TestAll.py
10138 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10139 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10140 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10141 anObj.SetParameters(Parameters)
10142 self._autoPublish(anObj, theName, "chamfer")
10145 ## Perform a chamfer on edges
10146 # @param theShape Shape, to perform chamfer on.
10147 # @param theD Chamfer length
10148 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10149 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10150 # @param theName Object name; when specified, this parameter is used
10151 # for result publication in the study. Otherwise, if automatic
10152 # publication is switched on, default value is used for result name.
10154 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10156 # @return New GEOM.GEOM_Object, containing the result shape.
10157 @ManageTransactions("LocalOp")
10158 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10160 Perform a chamfer on edges
10163 theShape Shape, to perform chamfer on.
10164 theD1 Chamfer size along theFace1.
10165 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10166 theFace1,theFace2 Global indices of two faces of theShape.
10167 theName Object name; when specified, this parameter is used
10168 for result publication in the study. Otherwise, if automatic
10169 publication is switched on, default value is used for result name.
10172 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10175 New GEOM.GEOM_Object, containing the result shape.
10178 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10179 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10180 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10182 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10185 if isinstance(theAngle,str):
10187 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10189 theAngle = theAngle*math.pi/180.0
10190 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10191 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10192 anObj.SetParameters(Parameters)
10193 self._autoPublish(anObj, theName, "chamfer")
10196 ## Perform a chamfer on all edges of the specified faces,
10197 # with distance D1 on the first specified face (if several for one edge)
10198 # @param theShape Shape, to perform chamfer on.
10199 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10200 # connected to the edge, are in \a theFaces, \a theD1
10201 # will be get along face, which is nearer to \a theFaces beginning.
10202 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10203 # @param theFaces Sequence of global indices of faces of \a theShape.
10204 # @param theName Object name; when specified, this parameter is used
10205 # for result publication in the study. Otherwise, if automatic
10206 # publication is switched on, default value is used for result name.
10208 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10210 # @return New GEOM.GEOM_Object, containing the result shape.
10212 # @ref tui_chamfer "Example"
10213 @ManageTransactions("LocalOp")
10214 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10216 Perform a chamfer on all edges of the specified faces,
10217 with distance D1 on the first specified face (if several for one edge)
10220 theShape Shape, to perform chamfer on.
10221 theD1 Chamfer size along face from theFaces. If both faces,
10222 connected to the edge, are in theFaces, theD1
10223 will be get along face, which is nearer to theFaces beginning.
10224 theD2 Chamfer size along another of two faces, connected to the edge.
10225 theFaces Sequence of global indices of faces of theShape.
10226 theName Object name; when specified, this parameter is used
10227 for result publication in the study. Otherwise, if automatic
10228 publication is switched on, default value is used for result name.
10230 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10233 New GEOM.GEOM_Object, containing the result shape.
10235 # Example: see GEOM_TestAll.py
10236 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10237 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10238 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10239 anObj.SetParameters(Parameters)
10240 self._autoPublish(anObj, theName, "chamfer")
10243 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
10244 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10246 # @ref swig_FilletChamfer "Example"
10247 @ManageTransactions("LocalOp")
10248 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10250 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
10251 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10254 if isinstance(theAngle,str):
10256 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10258 theAngle = theAngle*math.pi/180.0
10259 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10260 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10261 anObj.SetParameters(Parameters)
10262 self._autoPublish(anObj, theName, "chamfer")
10265 ## Perform a chamfer on edges,
10266 # with distance D1 on the first specified face (if several for one edge)
10267 # @param theShape Shape, to perform chamfer on.
10268 # @param theD1,theD2 Chamfer size
10269 # @param theEdges Sequence of edges of \a theShape.
10270 # @param theName Object name; when specified, this parameter is used
10271 # for result publication in the study. Otherwise, if automatic
10272 # publication is switched on, default value is used for result name.
10274 # @return New GEOM.GEOM_Object, containing the result shape.
10276 # @ref swig_FilletChamfer "Example"
10277 @ManageTransactions("LocalOp")
10278 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10280 Perform a chamfer on edges,
10281 with distance D1 on the first specified face (if several for one edge)
10284 theShape Shape, to perform chamfer on.
10285 theD1,theD2 Chamfer size
10286 theEdges Sequence of edges of theShape.
10287 theName Object name; when specified, this parameter is used
10288 for result publication in the study. Otherwise, if automatic
10289 publication is switched on, default value is used for result name.
10292 New GEOM.GEOM_Object, containing the result shape.
10294 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10295 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10296 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10297 anObj.SetParameters(Parameters)
10298 self._autoPublish(anObj, theName, "chamfer")
10301 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
10302 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10303 @ManageTransactions("LocalOp")
10304 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10306 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
10307 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10310 if isinstance(theAngle,str):
10312 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10314 theAngle = theAngle*math.pi/180.0
10315 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10316 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10317 anObj.SetParameters(Parameters)
10318 self._autoPublish(anObj, theName, "chamfer")
10321 ## @sa MakeChamferEdge(), MakeChamferFaces()
10323 # @ref swig_MakeChamfer "Example"
10324 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10326 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10328 # Example: see GEOM_TestOthers.py
10330 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10331 if aShapeType == self.ShapeType["EDGE"]:
10332 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10334 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10337 ## Remove material from a solid by extrusion of the base shape on the given distance.
10338 # @param theInit Shape to remove material from. It must be a solid or
10339 # a compound made of a single solid.
10340 # @param theBase Closed edge or wire defining the base shape to be extruded.
10341 # @param theH Prism dimension along the normal to theBase
10342 # @param theAngle Draft angle in degrees.
10343 # @param theInvert If true material changes the direction
10344 # @param theName Object name; when specified, this parameter is used
10345 # for result publication in the study. Otherwise, if automatic
10346 # publication is switched on, default value is used for result name.
10348 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10350 # @ref tui_creation_prism "Example"
10351 @ManageTransactions("PrimOp")
10352 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10354 Add material to a solid by extrusion of the base shape on the given distance.
10357 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10358 theBase Closed edge or wire defining the base shape to be extruded.
10359 theH Prism dimension along the normal to theBase
10360 theAngle Draft angle in degrees.
10361 theInvert If true material changes the direction.
10362 theName Object name; when specified, this parameter is used
10363 for result publication in the study. Otherwise, if automatic
10364 publication is switched on, default value is used for result name.
10367 New GEOM.GEOM_Object, containing the initial shape with removed material.
10369 # Example: see GEOM_TestAll.py
10370 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10371 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10372 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10373 anObj.SetParameters(Parameters)
10374 self._autoPublish(anObj, theName, "extrudedCut")
10377 ## Add material to a solid by extrusion of the base shape on the given distance.
10378 # @param theInit Shape to add material to. It must be a solid or
10379 # a compound made of a single solid.
10380 # @param theBase Closed edge or wire defining the base shape to be extruded.
10381 # @param theH Prism dimension along the normal to theBase
10382 # @param theAngle Draft angle in degrees.
10383 # @param theInvert If true material changes the direction
10384 # @param theName Object name; when specified, this parameter is used
10385 # for result publication in the study. Otherwise, if automatic
10386 # publication is switched on, default value is used for result name.
10388 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10390 # @ref tui_creation_prism "Example"
10391 @ManageTransactions("PrimOp")
10392 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10394 Add material to a solid by extrusion of the base shape on the given distance.
10397 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10398 theBase Closed edge or wire defining the base shape to be extruded.
10399 theH Prism dimension along the normal to theBase
10400 theAngle Draft angle in degrees.
10401 theInvert If true material changes the direction.
10402 theName Object name; when specified, this parameter is used
10403 for result publication in the study. Otherwise, if automatic
10404 publication is switched on, default value is used for result name.
10407 New GEOM.GEOM_Object, containing the initial shape with added material.
10409 # Example: see GEOM_TestAll.py
10410 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10411 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10412 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10413 anObj.SetParameters(Parameters)
10414 self._autoPublish(anObj, theName, "extrudedBoss")
10420 ## @addtogroup l3_basic_op
10423 ## Perform an Archimde operation on the given shape with given parameters.
10424 # The object presenting the resulting face is returned.
10425 # @param theShape Shape to be put in water.
10426 # @param theWeight Weight of the shape.
10427 # @param theWaterDensity Density of the water.
10428 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10429 # @param theName Object name; when specified, this parameter is used
10430 # for result publication in the study. Otherwise, if automatic
10431 # publication is switched on, default value is used for result name.
10433 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10434 # by a plane, corresponding to water level.
10436 # @ref tui_archimede "Example"
10437 @ManageTransactions("LocalOp")
10438 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10440 Perform an Archimde operation on the given shape with given parameters.
10441 The object presenting the resulting face is returned.
10444 theShape Shape to be put in water.
10445 theWeight Weight of the shape.
10446 theWaterDensity Density of the water.
10447 theMeshDeflection Deflection of the mesh, using to compute the section.
10448 theName Object name; when specified, this parameter is used
10449 for result publication in the study. Otherwise, if automatic
10450 publication is switched on, default value is used for result name.
10453 New GEOM.GEOM_Object, containing a section of theShape
10454 by a plane, corresponding to water level.
10456 # Example: see GEOM_TestAll.py
10457 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10458 theWeight,theWaterDensity,theMeshDeflection)
10459 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10460 RaiseIfFailed("MakeArchimede", self.LocalOp)
10461 anObj.SetParameters(Parameters)
10462 self._autoPublish(anObj, theName, "archimede")
10465 # end of l3_basic_op
10468 ## @addtogroup l2_measure
10471 ## Get point coordinates
10472 # @return [x, y, z]
10474 # @ref tui_point_coordinates_page "Example"
10475 @ManageTransactions("MeasuOp")
10476 def PointCoordinates(self,Point):
10478 Get point coordinates
10483 # Example: see GEOM_TestMeasures.py
10484 aTuple = self.MeasuOp.PointCoordinates(Point)
10485 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10488 ## Get vector coordinates
10489 # @return [x, y, z]
10491 # @ref tui_measurement_tools_page "Example"
10492 def VectorCoordinates(self,Vector):
10494 Get vector coordinates
10500 p1=self.GetFirstVertex(Vector)
10501 p2=self.GetLastVertex(Vector)
10503 X1=self.PointCoordinates(p1)
10504 X2=self.PointCoordinates(p2)
10506 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10509 ## Compute cross product
10510 # @return vector w=u^v
10512 # @ref tui_measurement_tools_page "Example"
10513 def CrossProduct(self, Vector1, Vector2):
10515 Compute cross product
10517 Returns: vector w=u^v
10519 u=self.VectorCoordinates(Vector1)
10520 v=self.VectorCoordinates(Vector2)
10521 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])
10525 ## Compute cross product
10526 # @return dot product p=u.v
10528 # @ref tui_measurement_tools_page "Example"
10529 def DotProduct(self, Vector1, Vector2):
10531 Compute cross product
10533 Returns: dot product p=u.v
10535 u=self.VectorCoordinates(Vector1)
10536 v=self.VectorCoordinates(Vector2)
10537 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10542 ## Get summarized length of all wires,
10543 # area of surface and volume of the given shape.
10544 # @param theShape Shape to define properties of.
10545 # @return [theLength, theSurfArea, theVolume]\n
10546 # theLength: Summarized length of all wires of the given shape.\n
10547 # theSurfArea: Area of surface of the given shape.\n
10548 # theVolume: Volume of the given shape.
10550 # @ref tui_basic_properties_page "Example"
10551 @ManageTransactions("MeasuOp")
10552 def BasicProperties(self,theShape):
10554 Get summarized length of all wires,
10555 area of surface and volume of the given shape.
10558 theShape Shape to define properties of.
10561 [theLength, theSurfArea, theVolume]
10562 theLength: Summarized length of all wires of the given shape.
10563 theSurfArea: Area of surface of the given shape.
10564 theVolume: Volume of the given shape.
10566 # Example: see GEOM_TestMeasures.py
10567 aTuple = self.MeasuOp.GetBasicProperties(theShape)
10568 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10571 ## Get parameters of bounding box of the given shape
10572 # @param theShape Shape to obtain bounding box of.
10573 # @param precise TRUE for precise computation; FALSE for fast one.
10574 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10575 # Xmin,Xmax: Limits of shape along OX axis.
10576 # Ymin,Ymax: Limits of shape along OY axis.
10577 # Zmin,Zmax: Limits of shape along OZ axis.
10579 # @ref tui_bounding_box_page "Example"
10580 @ManageTransactions("MeasuOp")
10581 def BoundingBox (self, theShape, precise=False):
10583 Get parameters of bounding box of the given shape
10586 theShape Shape to obtain bounding box of.
10587 precise TRUE for precise computation; FALSE for fast one.
10590 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10591 Xmin,Xmax: Limits of shape along OX axis.
10592 Ymin,Ymax: Limits of shape along OY axis.
10593 Zmin,Zmax: Limits of shape along OZ axis.
10595 # Example: see GEOM_TestMeasures.py
10596 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10597 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10600 ## Get bounding box of the given shape
10601 # @param theShape Shape to obtain bounding box of.
10602 # @param precise TRUE for precise computation; FALSE for fast one.
10603 # @param theName Object name; when specified, this parameter is used
10604 # for result publication in the study. Otherwise, if automatic
10605 # publication is switched on, default value is used for result name.
10607 # @return New GEOM.GEOM_Object, containing the created box.
10609 # @ref tui_bounding_box_page "Example"
10610 @ManageTransactions("MeasuOp")
10611 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10613 Get bounding box of the given shape
10616 theShape Shape to obtain bounding box of.
10617 precise TRUE for precise computation; FALSE for fast one.
10618 theName Object name; when specified, this parameter is used
10619 for result publication in the study. Otherwise, if automatic
10620 publication is switched on, default value is used for result name.
10623 New GEOM.GEOM_Object, containing the created box.
10625 # Example: see GEOM_TestMeasures.py
10626 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10627 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10628 self._autoPublish(anObj, theName, "bndbox")
10631 ## Get inertia matrix and moments of inertia of theShape.
10632 # @param theShape Shape to calculate inertia of.
10633 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10634 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10635 # Ix,Iy,Iz: Moments of inertia of the given shape.
10637 # @ref tui_inertia_page "Example"
10638 @ManageTransactions("MeasuOp")
10639 def Inertia(self,theShape):
10641 Get inertia matrix and moments of inertia of theShape.
10644 theShape Shape to calculate inertia of.
10647 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10648 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10649 Ix,Iy,Iz: Moments of inertia of the given shape.
10651 # Example: see GEOM_TestMeasures.py
10652 aTuple = self.MeasuOp.GetInertia(theShape)
10653 RaiseIfFailed("GetInertia", self.MeasuOp)
10656 ## Get if coords are included in the shape (ST_IN or ST_ON)
10657 # @param theShape Shape
10658 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10659 # @param tolerance to be used (default is 1.0e-7)
10660 # @return list_of_boolean = [res1, res2, ...]
10661 @ManageTransactions("MeasuOp")
10662 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10664 Get if coords are included in the shape (ST_IN or ST_ON)
10668 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10669 tolerance to be used (default is 1.0e-7)
10672 list_of_boolean = [res1, res2, ...]
10674 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10676 ## Get minimal distance between the given shapes.
10677 # @param theShape1,theShape2 Shapes to find minimal distance between.
10678 # @return Value of the minimal distance between the given shapes.
10680 # @ref tui_min_distance_page "Example"
10681 @ManageTransactions("MeasuOp")
10682 def MinDistance(self, theShape1, theShape2):
10684 Get minimal distance between the given shapes.
10687 theShape1,theShape2 Shapes to find minimal distance between.
10690 Value of the minimal distance between the given shapes.
10692 # Example: see GEOM_TestMeasures.py
10693 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10694 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10697 ## Get minimal distance between the given shapes.
10698 # @param theShape1,theShape2 Shapes to find minimal distance between.
10699 # @return Value of the minimal distance between the given shapes, in form of list
10700 # [Distance, DX, DY, DZ].
10702 # @ref tui_min_distance_page "Example"
10703 @ManageTransactions("MeasuOp")
10704 def MinDistanceComponents(self, theShape1, theShape2):
10706 Get minimal distance between the given shapes.
10709 theShape1,theShape2 Shapes to find minimal distance between.
10712 Value of the minimal distance between the given shapes, in form of list
10713 [Distance, DX, DY, DZ]
10715 # Example: see GEOM_TestMeasures.py
10716 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10717 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10718 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10721 ## Get closest points of the given shapes.
10722 # @param theShape1,theShape2 Shapes to find closest points of.
10723 # @return The number of found solutions (-1 in case of infinite number of
10724 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10726 # @ref tui_min_distance_page "Example"
10727 @ManageTransactions("MeasuOp")
10728 def ClosestPoints (self, theShape1, theShape2):
10730 Get closest points of the given shapes.
10733 theShape1,theShape2 Shapes to find closest points of.
10736 The number of found solutions (-1 in case of infinite number of
10737 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10739 # Example: see GEOM_TestMeasures.py
10740 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10741 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10744 ## Get angle between the given shapes in degrees.
10745 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10746 # @note If both arguments are vectors, the angle is computed in accordance
10747 # with their orientations, otherwise the minimum angle is computed.
10748 # @return Value of the angle between the given shapes in degrees.
10750 # @ref tui_angle_page "Example"
10751 @ManageTransactions("MeasuOp")
10752 def GetAngle(self, theShape1, theShape2):
10754 Get angle between the given shapes in degrees.
10757 theShape1,theShape2 Lines or linear edges to find angle between.
10760 If both arguments are vectors, the angle is computed in accordance
10761 with their orientations, otherwise the minimum angle is computed.
10764 Value of the angle between the given shapes in degrees.
10766 # Example: see GEOM_TestMeasures.py
10767 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10768 RaiseIfFailed("GetAngle", self.MeasuOp)
10771 ## Get angle between the given shapes in radians.
10772 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10773 # @note If both arguments are vectors, the angle is computed in accordance
10774 # with their orientations, otherwise the minimum angle is computed.
10775 # @return Value of the angle between the given shapes in radians.
10777 # @ref tui_angle_page "Example"
10778 @ManageTransactions("MeasuOp")
10779 def GetAngleRadians(self, theShape1, theShape2):
10781 Get angle between the given shapes in radians.
10784 theShape1,theShape2 Lines or linear edges to find angle between.
10788 If both arguments are vectors, the angle is computed in accordance
10789 with their orientations, otherwise the minimum angle is computed.
10792 Value of the angle between the given shapes in radians.
10794 # Example: see GEOM_TestMeasures.py
10795 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10796 RaiseIfFailed("GetAngle", self.MeasuOp)
10799 ## Get angle between the given vectors in degrees.
10800 # @param theShape1,theShape2 Vectors to find angle between.
10801 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10802 # if False, the opposite vector to the normal vector is used.
10803 # @return Value of the angle between the given vectors in degrees.
10805 # @ref tui_angle_page "Example"
10806 @ManageTransactions("MeasuOp")
10807 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10809 Get angle between the given vectors in degrees.
10812 theShape1,theShape2 Vectors to find angle between.
10813 theFlag If True, the normal vector is defined by the two vectors cross,
10814 if False, the opposite vector to the normal vector is used.
10817 Value of the angle between the given vectors in degrees.
10819 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10821 anAngle = 360. - anAngle
10822 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10825 ## The same as GetAngleVectors, but the result is in radians.
10826 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10828 Get angle between the given vectors in radians.
10831 theShape1,theShape2 Vectors to find angle between.
10832 theFlag If True, the normal vector is defined by the two vectors cross,
10833 if False, the opposite vector to the normal vector is used.
10836 Value of the angle between the given vectors in radians.
10838 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10841 ## @name Curve Curvature Measurement
10842 # Methods for receiving radius of curvature of curves
10843 # in the given point
10846 ## Measure curvature of a curve at a point, set by parameter.
10847 # @param theCurve a curve.
10848 # @param theParam parameter.
10849 # @return radius of curvature of \a theCurve.
10851 # @ref swig_todo "Example"
10852 @ManageTransactions("MeasuOp")
10853 def CurveCurvatureByParam(self, theCurve, theParam):
10855 Measure curvature of a curve at a point, set by parameter.
10859 theParam parameter.
10862 radius of curvature of theCurve.
10864 # Example: see GEOM_TestMeasures.py
10865 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10866 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10869 ## Measure curvature of a curve at a point.
10870 # @param theCurve a curve.
10871 # @param thePoint given point.
10872 # @return radius of curvature of \a theCurve.
10874 # @ref swig_todo "Example"
10875 @ManageTransactions("MeasuOp")
10876 def CurveCurvatureByPoint(self, theCurve, thePoint):
10878 Measure curvature of a curve at a point.
10882 thePoint given point.
10885 radius of curvature of theCurve.
10887 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
10888 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
10892 ## @name Surface Curvature Measurement
10893 # Methods for receiving max and min radius of curvature of surfaces
10894 # in the given point
10897 ## Measure max radius of curvature of surface.
10898 # @param theSurf the given surface.
10899 # @param theUParam Value of U-parameter on the referenced surface.
10900 # @param theVParam Value of V-parameter on the referenced surface.
10901 # @return max radius of curvature of theSurf.
10903 ## @ref swig_todo "Example"
10904 @ManageTransactions("MeasuOp")
10905 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10907 Measure max radius of curvature of surface.
10910 theSurf the given surface.
10911 theUParam Value of U-parameter on the referenced surface.
10912 theVParam Value of V-parameter on the referenced surface.
10915 max radius of curvature of theSurf.
10917 # Example: see GEOM_TestMeasures.py
10918 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10919 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
10922 ## Measure max radius of curvature of surface in the given point
10923 # @param theSurf the given surface.
10924 # @param thePoint given point.
10925 # @return max radius of curvature of theSurf.
10927 ## @ref swig_todo "Example"
10928 @ManageTransactions("MeasuOp")
10929 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
10931 Measure max radius of curvature of surface in the given point.
10934 theSurf the given surface.
10935 thePoint given point.
10938 max radius of curvature of theSurf.
10940 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
10941 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
10944 ## Measure min radius of curvature of surface.
10945 # @param theSurf the given surface.
10946 # @param theUParam Value of U-parameter on the referenced surface.
10947 # @param theVParam Value of V-parameter on the referenced surface.
10948 # @return min radius of curvature of theSurf.
10950 ## @ref swig_todo "Example"
10951 @ManageTransactions("MeasuOp")
10952 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
10954 Measure min radius of curvature of surface.
10957 theSurf the given surface.
10958 theUParam Value of U-parameter on the referenced surface.
10959 theVParam Value of V-parameter on the referenced surface.
10962 Min radius of curvature of theSurf.
10964 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
10965 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
10968 ## Measure min radius of curvature of surface in the given point
10969 # @param theSurf the given surface.
10970 # @param thePoint given point.
10971 # @return min radius of curvature of theSurf.
10973 ## @ref swig_todo "Example"
10974 @ManageTransactions("MeasuOp")
10975 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
10977 Measure min radius of curvature of surface in the given point.
10980 theSurf the given surface.
10981 thePoint given point.
10984 Min radius of curvature of theSurf.
10986 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
10987 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
10991 ## Get min and max tolerances of sub-shapes of theShape
10992 # @param theShape Shape, to get tolerances of.
10993 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
10994 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
10995 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
10996 # VertMin,VertMax: Min and max tolerances of the vertices.
10998 # @ref tui_tolerance_page "Example"
10999 @ManageTransactions("MeasuOp")
11000 def Tolerance(self,theShape):
11002 Get min and max tolerances of sub-shapes of theShape
11005 theShape Shape, to get tolerances of.
11008 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11009 FaceMin,FaceMax: Min and max tolerances of the faces.
11010 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11011 VertMin,VertMax: Min and max tolerances of the vertices.
11013 # Example: see GEOM_TestMeasures.py
11014 aTuple = self.MeasuOp.GetTolerance(theShape)
11015 RaiseIfFailed("GetTolerance", self.MeasuOp)
11018 ## Obtain description of the given shape (number of sub-shapes of each type)
11019 # @param theShape Shape to be described.
11020 # @return Description of the given shape.
11022 # @ref tui_whatis_page "Example"
11023 @ManageTransactions("MeasuOp")
11024 def WhatIs(self,theShape):
11026 Obtain description of the given shape (number of sub-shapes of each type)
11029 theShape Shape to be described.
11032 Description of the given shape.
11034 # Example: see GEOM_TestMeasures.py
11035 aDescr = self.MeasuOp.WhatIs(theShape)
11036 RaiseIfFailed("WhatIs", self.MeasuOp)
11039 ## Obtain quantity of shapes of the given type in \a theShape.
11040 # If \a theShape is of type \a theType, it is also counted.
11041 # @param theShape Shape to be described.
11042 # @param theType the given ShapeType().
11043 # @return Quantity of shapes of type \a theType in \a theShape.
11045 # @ref tui_measurement_tools_page "Example"
11046 def NbShapes (self, theShape, theType):
11048 Obtain quantity of shapes of the given type in theShape.
11049 If theShape is of type theType, it is also counted.
11052 theShape Shape to be described.
11053 theType the given geompy.ShapeType
11056 Quantity of shapes of type theType in theShape.
11058 # Example: see GEOM_TestMeasures.py
11059 listSh = self.SubShapeAllIDs(theShape, theType)
11063 ## Obtain quantity of shapes of each type in \a theShape.
11064 # The \a theShape is also counted.
11065 # @param theShape Shape to be described.
11066 # @return Dictionary of ShapeType() with bound quantities of shapes.
11068 # @ref tui_measurement_tools_page "Example"
11069 def ShapeInfo (self, theShape):
11071 Obtain quantity of shapes of each type in theShape.
11072 The theShape is also counted.
11075 theShape Shape to be described.
11078 Dictionary of geompy.ShapeType with bound quantities of shapes.
11080 # Example: see GEOM_TestMeasures.py
11082 for typeSh in self.ShapeType:
11083 if typeSh in ( "AUTO", "SHAPE" ): continue
11084 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11090 def GetCreationInformation(self, theShape):
11092 infos = theShape.GetCreationInformation()
11095 opName = info.operationName
11096 if not opName: opName = "no info available"
11097 if res: res += "\n"
11098 res += "Operation: " + opName
11100 for parVal in info.params:
11101 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11104 ## Get a point, situated at the centre of mass of theShape.
11105 # @param theShape Shape to define centre of mass of.
11106 # @param theName Object name; when specified, this parameter is used
11107 # for result publication in the study. Otherwise, if automatic
11108 # publication is switched on, default value is used for result name.
11110 # @return New GEOM.GEOM_Object, containing the created point.
11112 # @ref tui_center_of_mass_page "Example"
11113 @ManageTransactions("MeasuOp")
11114 def MakeCDG(self, theShape, theName=None):
11116 Get a point, situated at the centre of mass of theShape.
11119 theShape Shape to define centre of mass of.
11120 theName Object name; when specified, this parameter is used
11121 for result publication in the study. Otherwise, if automatic
11122 publication is switched on, default value is used for result name.
11125 New GEOM.GEOM_Object, containing the created point.
11127 # Example: see GEOM_TestMeasures.py
11128 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11129 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11130 self._autoPublish(anObj, theName, "centerOfMass")
11133 ## Get a vertex sub-shape by index depended with orientation.
11134 # @param theShape Shape to find sub-shape.
11135 # @param theIndex Index to find vertex by this index (starting from zero)
11136 # @param theName Object name; when specified, this parameter is used
11137 # for result publication in the study. Otherwise, if automatic
11138 # publication is switched on, default value is used for result name.
11140 # @return New GEOM.GEOM_Object, containing the created vertex.
11142 # @ref tui_measurement_tools_page "Example"
11143 @ManageTransactions("MeasuOp")
11144 def GetVertexByIndex(self, theShape, theIndex, theName=None):
11146 Get a vertex sub-shape by index depended with orientation.
11149 theShape Shape to find sub-shape.
11150 theIndex Index to find vertex by this index (starting from zero)
11151 theName Object name; when specified, this parameter is used
11152 for result publication in the study. Otherwise, if automatic
11153 publication is switched on, default value is used for result name.
11156 New GEOM.GEOM_Object, containing the created vertex.
11158 # Example: see GEOM_TestMeasures.py
11159 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
11160 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11161 self._autoPublish(anObj, theName, "vertex")
11164 ## Get the first vertex of wire/edge depended orientation.
11165 # @param theShape Shape to find first vertex.
11166 # @param theName Object name; when specified, this parameter is used
11167 # for result publication in the study. Otherwise, if automatic
11168 # publication is switched on, default value is used for result name.
11170 # @return New GEOM.GEOM_Object, containing the created vertex.
11172 # @ref tui_measurement_tools_page "Example"
11173 def GetFirstVertex(self, theShape, theName=None):
11175 Get the first vertex of wire/edge depended orientation.
11178 theShape Shape to find first vertex.
11179 theName Object name; when specified, this parameter is used
11180 for result publication in the study. Otherwise, if automatic
11181 publication is switched on, default value is used for result name.
11184 New GEOM.GEOM_Object, containing the created vertex.
11186 # Example: see GEOM_TestMeasures.py
11187 # note: auto-publishing is done in self.GetVertexByIndex()
11188 return self.GetVertexByIndex(theShape, 0, theName)
11190 ## Get the last vertex of wire/edge depended orientation.
11191 # @param theShape Shape to find last vertex.
11192 # @param theName Object name; when specified, this parameter is used
11193 # for result publication in the study. Otherwise, if automatic
11194 # publication is switched on, default value is used for result name.
11196 # @return New GEOM.GEOM_Object, containing the created vertex.
11198 # @ref tui_measurement_tools_page "Example"
11199 def GetLastVertex(self, theShape, theName=None):
11201 Get the last vertex of wire/edge depended orientation.
11204 theShape Shape to find last vertex.
11205 theName Object name; when specified, this parameter is used
11206 for result publication in the study. Otherwise, if automatic
11207 publication is switched on, default value is used for result name.
11210 New GEOM.GEOM_Object, containing the created vertex.
11212 # Example: see GEOM_TestMeasures.py
11213 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11214 # note: auto-publishing is done in self.GetVertexByIndex()
11215 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
11217 ## Get a normale to the given face. If the point is not given,
11218 # the normale is calculated at the center of mass.
11219 # @param theFace Face to define normale of.
11220 # @param theOptionalPoint Point to compute the normale at.
11221 # @param theName Object name; when specified, this parameter is used
11222 # for result publication in the study. Otherwise, if automatic
11223 # publication is switched on, default value is used for result name.
11225 # @return New GEOM.GEOM_Object, containing the created vector.
11227 # @ref swig_todo "Example"
11228 @ManageTransactions("MeasuOp")
11229 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11231 Get a normale to the given face. If the point is not given,
11232 the normale is calculated at the center of mass.
11235 theFace Face to define normale of.
11236 theOptionalPoint Point to compute the normale at.
11237 theName Object name; when specified, this parameter is used
11238 for result publication in the study. Otherwise, if automatic
11239 publication is switched on, default value is used for result name.
11242 New GEOM.GEOM_Object, containing the created vector.
11244 # Example: see GEOM_TestMeasures.py
11245 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11246 RaiseIfFailed("GetNormal", self.MeasuOp)
11247 self._autoPublish(anObj, theName, "normal")
11250 ## Print shape errors obtained from CheckShape.
11251 # @param theShape Shape that was checked.
11252 # @param theShapeErrors the shape errors obtained by CheckShape.
11253 # @param theReturnStatus If 0 the description of problem is printed.
11254 # If 1 the description of problem is returned.
11255 # @return If theReturnStatus is equal to 1 the description is returned.
11256 # Otherwise doesn't return anything.
11258 # @ref tui_check_shape_page "Example"
11259 @ManageTransactions("MeasuOp")
11260 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11262 Print shape errors obtained from CheckShape.
11265 theShape Shape that was checked.
11266 theShapeErrors the shape errors obtained by CheckShape.
11267 theReturnStatus If 0 the description of problem is printed.
11268 If 1 the description of problem is returned.
11271 If theReturnStatus is equal to 1 the description is returned.
11272 Otherwise doesn't return anything.
11274 # Example: see GEOM_TestMeasures.py
11275 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11276 if theReturnStatus == 1:
11281 ## Check a topology of the given shape.
11282 # @param theShape Shape to check validity of.
11283 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11284 # if TRUE, the shape's geometry will be checked also.
11285 # @param theReturnStatus If 0 and if theShape is invalid, a description
11286 # of problem is printed.
11287 # If 1 isValid flag and the description of
11288 # problem is returned.
11289 # If 2 isValid flag and the list of error data
11291 # @return TRUE, if the shape "seems to be valid".
11292 # If theShape is invalid, prints a description of problem.
11293 # If theReturnStatus is equal to 1 the description is returned
11294 # along with IsValid flag.
11295 # If theReturnStatus is equal to 2 the list of error data is
11296 # returned along with IsValid flag.
11298 # @ref tui_check_shape_page "Example"
11299 @ManageTransactions("MeasuOp")
11300 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11302 Check a topology of the given shape.
11305 theShape Shape to check validity of.
11306 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11307 if TRUE, the shape's geometry will be checked also.
11308 theReturnStatus If 0 and if theShape is invalid, a description
11309 of problem is printed.
11310 If 1 IsValid flag and the description of
11311 problem is returned.
11312 If 2 IsValid flag and the list of error data
11316 TRUE, if the shape "seems to be valid".
11317 If theShape is invalid, prints a description of problem.
11318 If theReturnStatus is equal to 1 the description is returned
11319 along with IsValid flag.
11320 If theReturnStatus is equal to 2 the list of error data is
11321 returned along with IsValid flag.
11323 # Example: see GEOM_TestMeasures.py
11325 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11326 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11328 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11329 RaiseIfFailed("CheckShape", self.MeasuOp)
11331 if theReturnStatus == 0:
11332 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11334 if theReturnStatus == 1:
11335 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11336 return (IsValid, Descr)
11337 elif theReturnStatus == 2:
11338 return (IsValid, ShapeErrors)
11341 ## Detect self-intersections in the given shape.
11342 # @param theShape Shape to check.
11343 # @param theCheckLevel is the level of self-intersection check.
11344 # Possible input values are:
11345 # - GEOM.SI_V_V(0) - only V/V interferences
11346 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11347 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11348 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11349 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11350 # - GEOM.SI_ALL(5) - all interferences.
11351 # @return TRUE, if the shape contains no self-intersections.
11353 # @ref tui_check_self_intersections_page "Example"
11354 @ManageTransactions("MeasuOp")
11355 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11357 Detect self-intersections in the given shape.
11360 theShape Shape to check.
11361 theCheckLevel is the level of self-intersection check.
11362 Possible input values are:
11363 - GEOM.SI_V_V(0) - only V/V interferences
11364 - GEOM.SI_V_E(1) - V/V and V/E interferences
11365 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11366 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11367 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11368 - GEOM.SI_ALL(5) - all interferences.
11371 TRUE, if the shape contains no self-intersections.
11373 # Example: see GEOM_TestMeasures.py
11374 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11375 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11378 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11379 # @param theShape Shape to check.
11380 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
11381 # - if \a theDeflection <= 0, default deflection 0.001 is used
11382 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11383 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11384 # - if \a theTolerance > 0, algorithm detects gaps
11385 # @return TRUE, if the shape contains no self-intersections.
11387 # @ref tui_check_self_intersections_fast_page "Example"
11388 @ManageTransactions("MeasuOp")
11389 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11391 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11394 theShape Shape to check.
11395 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11396 - if theDeflection <= 0, default deflection 0.001 is used
11397 theTolerance Specifies a distance between shapes used for detecting gaps:
11398 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11399 - if theTolerance > 0, algorithm detects gaps
11402 TRUE, if the shape contains no self-intersections.
11404 # Example: see GEOM_TestMeasures.py
11405 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11406 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11409 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11410 # @param theShape1 First source object
11411 # @param theShape2 Second source object
11412 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11413 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11414 # - if \a theTolerance > 0, algorithm detects gaps
11415 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
11416 # - if \a theDeflection <= 0, default deflection 0.001 is used
11417 # @return TRUE, if there are intersections (gaps) between source shapes
11418 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11419 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11421 # @ref tui_fast_intersection_page "Example"
11422 @ManageTransactions("MeasuOp")
11423 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11425 Detect intersections of the given shapes with algorithm based on mesh intersections.
11428 theShape1 First source object
11429 theShape2 Second source object
11430 theTolerance Specifies a distance between shapes used for detecting gaps:
11431 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11432 - if theTolerance > 0, algorithm detects gaps
11433 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11434 - if theDeflection <= 0, default deflection 0.001 is used
11437 TRUE, if there are intersections (gaps) between source shapes
11438 List of sub-shapes IDs from 1st shape that localize intersection.
11439 List of sub-shapes IDs from 2nd shape that localize intersection.
11441 # Example: see GEOM_TestMeasures.py
11442 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11443 RaiseIfFailed("FastIntersect", self.MeasuOp)
11444 return IsOk, Res1, Res2
11446 ## Get position (LCS) of theShape.
11448 # Origin of the LCS is situated at the shape's center of mass.
11449 # Axes of the LCS are obtained from shape's location or,
11450 # if the shape is a planar face, from position of its plane.
11452 # @param theShape Shape to calculate position of.
11453 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11454 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11455 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11456 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11458 # @ref swig_todo "Example"
11459 @ManageTransactions("MeasuOp")
11460 def GetPosition(self,theShape):
11462 Get position (LCS) of theShape.
11463 Origin of the LCS is situated at the shape's center of mass.
11464 Axes of the LCS are obtained from shape's location or,
11465 if the shape is a planar face, from position of its plane.
11468 theShape Shape to calculate position of.
11471 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11472 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11473 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11474 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11476 # Example: see GEOM_TestMeasures.py
11477 aTuple = self.MeasuOp.GetPosition(theShape)
11478 RaiseIfFailed("GetPosition", self.MeasuOp)
11481 ## Get kind of theShape.
11483 # @param theShape Shape to get a kind of.
11484 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11485 # and a list of parameters, describing the shape.
11486 # @note Concrete meaning of each value, returned via \a theIntegers
11487 # or \a theDoubles list depends on the kind() of the shape.
11489 # @ref swig_todo "Example"
11490 @ManageTransactions("MeasuOp")
11491 def KindOfShape(self,theShape):
11493 Get kind of theShape.
11496 theShape Shape to get a kind of.
11499 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11500 and a list of parameters, describing the shape.
11502 Concrete meaning of each value, returned via theIntegers
11503 or theDoubles list depends on the geompy.kind of the shape
11505 # Example: see GEOM_TestMeasures.py
11506 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11507 RaiseIfFailed("KindOfShape", self.MeasuOp)
11509 aKind = aRoughTuple[0]
11510 anInts = aRoughTuple[1]
11511 aDbls = aRoughTuple[2]
11513 # Now there is no exception from this rule:
11514 aKindTuple = [aKind] + aDbls + anInts
11516 # If they are we will regroup parameters for such kind of shape.
11518 #if aKind == kind.SOME_KIND:
11519 # # SOME_KIND int int double int double double
11520 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11524 ## Returns the string that describes if the shell is good for solid.
11525 # This is a support method for MakeSolid.
11527 # @param theShell the shell to be checked.
11528 # @return Returns a string that describes the shell validity for
11529 # solid construction.
11530 @ManageTransactions("MeasuOp")
11531 def _IsGoodForSolid(self, theShell):
11533 Returns the string that describes if the shell is good for solid.
11534 This is a support method for MakeSolid.
11537 theShell the shell to be checked.
11540 Returns a string that describes the shell validity for
11541 solid construction.
11543 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11546 # end of l2_measure
11549 ## @addtogroup l2_import_export
11552 ## Import a shape from the BREP, IGES, STEP or other file
11553 # (depends on given format) with given name.
11555 # Note: this function is deprecated, it is kept for backward compatibility only
11556 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11558 # @param theFileName The file, containing the shape.
11559 # @param theFormatName Specify format for the file reading.
11560 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11561 # If format 'IGES_SCALE' is used instead of 'IGES' or
11562 # format 'STEP_SCALE' is used instead of 'STEP',
11563 # length unit will be set to 'meter' and result model will be scaled.
11564 # @param theName Object name; when specified, this parameter is used
11565 # for result publication in the study. Otherwise, if automatic
11566 # publication is switched on, default value is used for result name.
11568 # @return New GEOM.GEOM_Object, containing the imported shape.
11569 # If material names are imported it returns the list of
11570 # objects. The first one is the imported object followed by
11572 # @note Auto publishing is allowed for the shape itself. Imported
11573 # material groups are not automatically published.
11575 # @ref swig_Import_Export "Example"
11576 @ManageTransactions("InsertOp")
11577 def ImportFile(self, theFileName, theFormatName, theName=None):
11579 Import a shape from the BREP, IGES, STEP or other file
11580 (depends on given format) with given name.
11582 Note: this function is deprecated, it is kept for backward compatibility only
11583 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11586 theFileName The file, containing the shape.
11587 theFormatName Specify format for the file reading.
11588 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11589 If format 'IGES_SCALE' is used instead of 'IGES' or
11590 format 'STEP_SCALE' is used instead of 'STEP',
11591 length unit will be set to 'meter' and result model will be scaled.
11592 theName Object name; when specified, this parameter is used
11593 for result publication in the study. Otherwise, if automatic
11594 publication is switched on, default value is used for result name.
11597 New GEOM.GEOM_Object, containing the imported shape.
11598 If material names are imported it returns the list of
11599 objects. The first one is the imported object followed by
11602 Auto publishing is allowed for the shape itself. Imported
11603 material groups are not automatically published.
11605 # Example: see GEOM_TestOthers.py
11607 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11608 where <FormatName> is a name of desirable format for importing.
11610 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11611 RaiseIfFailed("ImportFile", self.InsertOp)
11612 aNbObj = len(aListObj)
11614 self._autoPublish(aListObj[0], theName, "imported")
11619 ## Deprecated analog of ImportFile()
11620 def Import(self, theFileName, theFormatName, theName=None):
11622 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11624 # note: auto-publishing is done in self.ImportFile()
11625 return self.ImportFile(theFileName, theFormatName, theName)
11627 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11628 # @note This method will not be dumped to the python script by DumpStudy functionality.
11629 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
11630 # @param theStream The BRep binary stream.
11631 # @param theName Object name; when specified, this parameter is used
11632 # for result publication in the study. Otherwise, if automatic
11633 # publication is switched on, default value is used for result name.
11635 # @return New GEOM_Object, containing the shape, read from theStream.
11637 # @ref swig_Import_Export "Example"
11638 @ManageTransactions("InsertOp")
11639 def RestoreShape (self, theStream, theName=None):
11641 Read a shape from the binary stream, containing its bounding representation (BRep).
11644 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11647 theStream The BRep binary stream.
11648 theName Object name; when specified, this parameter is used
11649 for result publication in the study. Otherwise, if automatic
11650 publication is switched on, default value is used for result name.
11653 New GEOM_Object, containing the shape, read from theStream.
11655 # Example: see GEOM_TestOthers.py
11656 anObj = self.InsertOp.RestoreShape(theStream)
11657 RaiseIfFailed("RestoreShape", self.InsertOp)
11658 self._autoPublish(anObj, theName, "restored")
11661 ## Export the given shape into a file with given name.
11663 # Note: this function is deprecated, it is kept for backward compatibility only
11664 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11666 # @param theObject Shape to be stored in the file.
11667 # @param theFileName Name of the file to store the given shape in.
11668 # @param theFormatName Specify format for the shape storage.
11669 # Available formats can be obtained with
11670 # geompy.InsertOp.ExportTranslators()[0] method.
11672 # @ref swig_Import_Export "Example"
11673 @ManageTransactions("InsertOp")
11674 def Export(self, theObject, theFileName, theFormatName):
11676 Export the given shape into a file with given name.
11678 Note: this function is deprecated, it is kept for backward compatibility only
11679 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11682 theObject Shape to be stored in the file.
11683 theFileName Name of the file to store the given shape in.
11684 theFormatName Specify format for the shape storage.
11685 Available formats can be obtained with
11686 geompy.InsertOp.ExportTranslators()[0] method.
11688 # Example: see GEOM_TestOthers.py
11690 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11691 where <FormatName> is a name of desirable format for exporting.
11693 self.InsertOp.Export(theObject, theFileName, theFormatName)
11694 if self.InsertOp.IsDone() == 0:
11695 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
11699 # end of l2_import_export
11702 ## @addtogroup l3_blocks
11705 ## Create a quadrangle face from four edges. Order of Edges is not
11706 # important. It is not necessary that edges share the same vertex.
11707 # @param E1,E2,E3,E4 Edges for the face bound.
11708 # @param theName Object name; when specified, this parameter is used
11709 # for result publication in the study. Otherwise, if automatic
11710 # publication is switched on, default value is used for result name.
11712 # @return New GEOM.GEOM_Object, containing the created face.
11714 # @ref tui_building_by_blocks_page "Example"
11715 @ManageTransactions("BlocksOp")
11716 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11718 Create a quadrangle face from four edges. Order of Edges is not
11719 important. It is not necessary that edges share the same vertex.
11722 E1,E2,E3,E4 Edges for the face bound.
11723 theName Object name; when specified, this parameter is used
11724 for result publication in the study. Otherwise, if automatic
11725 publication is switched on, default value is used for result name.
11728 New GEOM.GEOM_Object, containing the created face.
11731 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11733 # Example: see GEOM_Spanner.py
11734 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11735 RaiseIfFailed("MakeQuad", self.BlocksOp)
11736 self._autoPublish(anObj, theName, "quad")
11739 ## Create a quadrangle face on two edges.
11740 # The missing edges will be built by creating the shortest ones.
11741 # @param E1,E2 Two opposite edges for the face.
11742 # @param theName Object name; when specified, this parameter is used
11743 # for result publication in the study. Otherwise, if automatic
11744 # publication is switched on, default value is used for result name.
11746 # @return New GEOM.GEOM_Object, containing the created face.
11748 # @ref tui_building_by_blocks_page "Example"
11749 @ManageTransactions("BlocksOp")
11750 def MakeQuad2Edges(self, E1, E2, theName=None):
11752 Create a quadrangle face on two edges.
11753 The missing edges will be built by creating the shortest ones.
11756 E1,E2 Two opposite edges for the face.
11757 theName Object name; when specified, this parameter is used
11758 for result publication in the study. Otherwise, if automatic
11759 publication is switched on, default value is used for result name.
11762 New GEOM.GEOM_Object, containing the created face.
11766 p1 = geompy.MakeVertex( 0., 0., 0.)
11767 p2 = geompy.MakeVertex(150., 30., 0.)
11768 p3 = geompy.MakeVertex( 0., 120., 50.)
11769 p4 = geompy.MakeVertex( 0., 40., 70.)
11771 edge1 = geompy.MakeEdge(p1, p2)
11772 edge2 = geompy.MakeEdge(p3, p4)
11773 # create a quadrangle face from two edges
11774 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11776 # Example: see GEOM_Spanner.py
11777 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11778 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11779 self._autoPublish(anObj, theName, "quad")
11782 ## Create a quadrangle face with specified corners.
11783 # The missing edges will be built by creating the shortest ones.
11784 # @param V1,V2,V3,V4 Corner vertices for the face.
11785 # @param theName Object name; when specified, this parameter is used
11786 # for result publication in the study. Otherwise, if automatic
11787 # publication is switched on, default value is used for result name.
11789 # @return New GEOM.GEOM_Object, containing the created face.
11791 # @ref tui_building_by_blocks_page "Example 1"
11792 # \n @ref swig_MakeQuad4Vertices "Example 2"
11793 @ManageTransactions("BlocksOp")
11794 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11796 Create a quadrangle face with specified corners.
11797 The missing edges will be built by creating the shortest ones.
11800 V1,V2,V3,V4 Corner vertices for the face.
11801 theName Object name; when specified, this parameter is used
11802 for result publication in the study. Otherwise, if automatic
11803 publication is switched on, default value is used for result name.
11806 New GEOM.GEOM_Object, containing the created face.
11810 p1 = geompy.MakeVertex( 0., 0., 0.)
11811 p2 = geompy.MakeVertex(150., 30., 0.)
11812 p3 = geompy.MakeVertex( 0., 120., 50.)
11813 p4 = geompy.MakeVertex( 0., 40., 70.)
11814 # create a quadrangle from four points in its corners
11815 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11817 # Example: see GEOM_Spanner.py
11818 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11819 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11820 self._autoPublish(anObj, theName, "quad")
11823 ## Create a hexahedral solid, bounded by the six given faces. Order of
11824 # faces is not important. It is not necessary that Faces share the same edge.
11825 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11826 # @param theName Object name; when specified, this parameter is used
11827 # for result publication in the study. Otherwise, if automatic
11828 # publication is switched on, default value is used for result name.
11830 # @return New GEOM.GEOM_Object, containing the created solid.
11832 # @ref tui_building_by_blocks_page "Example 1"
11833 # \n @ref swig_MakeHexa "Example 2"
11834 @ManageTransactions("BlocksOp")
11835 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11837 Create a hexahedral solid, bounded by the six given faces. Order of
11838 faces is not important. It is not necessary that Faces share the same edge.
11841 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11842 theName Object name; when specified, this parameter is used
11843 for result publication in the study. Otherwise, if automatic
11844 publication is switched on, default value is used for result name.
11847 New GEOM.GEOM_Object, containing the created solid.
11850 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
11852 # Example: see GEOM_Spanner.py
11853 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
11854 RaiseIfFailed("MakeHexa", self.BlocksOp)
11855 self._autoPublish(anObj, theName, "hexa")
11858 ## Create a hexahedral solid between two given faces.
11859 # The missing faces will be built by creating the smallest ones.
11860 # @param F1,F2 Two opposite faces for the hexahedral solid.
11861 # @param theName Object name; when specified, this parameter is used
11862 # for result publication in the study. Otherwise, if automatic
11863 # publication is switched on, default value is used for result name.
11865 # @return New GEOM.GEOM_Object, containing the created solid.
11867 # @ref tui_building_by_blocks_page "Example 1"
11868 # \n @ref swig_MakeHexa2Faces "Example 2"
11869 @ManageTransactions("BlocksOp")
11870 def MakeHexa2Faces(self, F1, F2, theName=None):
11872 Create a hexahedral solid between two given faces.
11873 The missing faces will be built by creating the smallest ones.
11876 F1,F2 Two opposite faces for the hexahedral solid.
11877 theName Object name; when specified, this parameter is used
11878 for result publication in the study. Otherwise, if automatic
11879 publication is switched on, default value is used for result name.
11882 New GEOM.GEOM_Object, containing the created solid.
11885 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
11887 # Example: see GEOM_Spanner.py
11888 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
11889 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
11890 self._autoPublish(anObj, theName, "hexa")
11896 ## @addtogroup l3_blocks_op
11899 ## Get a vertex, found in the given shape by its coordinates.
11900 # @param theShape Block or a compound of blocks.
11901 # @param theX,theY,theZ Coordinates of the sought vertex.
11902 # @param theEpsilon Maximum allowed distance between the resulting
11903 # vertex and point with the given coordinates.
11904 # @param theName Object name; when specified, this parameter is used
11905 # for result publication in the study. Otherwise, if automatic
11906 # publication is switched on, default value is used for result name.
11908 # @return New GEOM.GEOM_Object, containing the found vertex.
11910 # @ref swig_GetPoint "Example"
11911 @ManageTransactions("BlocksOp")
11912 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
11914 Get a vertex, found in the given shape by its coordinates.
11917 theShape Block or a compound of blocks.
11918 theX,theY,theZ Coordinates of the sought vertex.
11919 theEpsilon Maximum allowed distance between the resulting
11920 vertex and point with the given coordinates.
11921 theName Object name; when specified, this parameter is used
11922 for result publication in the study. Otherwise, if automatic
11923 publication is switched on, default value is used for result name.
11926 New GEOM.GEOM_Object, containing the found vertex.
11929 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
11931 # Example: see GEOM_TestOthers.py
11932 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
11933 RaiseIfFailed("GetPoint", self.BlocksOp)
11934 self._autoPublish(anObj, theName, "vertex")
11937 ## Find a vertex of the given shape, which has minimal distance to the given point.
11938 # @param theShape Any shape.
11939 # @param thePoint Point, close to the desired vertex.
11940 # @param 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.
11944 # @return New GEOM.GEOM_Object, containing the found vertex.
11946 # @ref swig_GetVertexNearPoint "Example"
11947 @ManageTransactions("BlocksOp")
11948 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
11950 Find a vertex of the given shape, which has minimal distance to the given point.
11953 theShape Any shape.
11954 thePoint Point, close to the desired vertex.
11955 theName Object name; when specified, this parameter is used
11956 for result publication in the study. Otherwise, if automatic
11957 publication is switched on, default value is used for result name.
11960 New GEOM.GEOM_Object, containing the found vertex.
11963 pmidle = geompy.MakeVertex(50, 0, 50)
11964 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
11966 # Example: see GEOM_TestOthers.py
11967 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
11968 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
11969 self._autoPublish(anObj, theName, "vertex")
11972 ## Get an edge, found in the given shape by two given vertices.
11973 # @param theShape Block or a compound of blocks.
11974 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
11975 # @param theName Object name; when specified, this parameter is used
11976 # for result publication in the study. Otherwise, if automatic
11977 # publication is switched on, default value is used for result name.
11979 # @return New GEOM.GEOM_Object, containing the found edge.
11981 # @ref swig_GetEdge "Example"
11982 @ManageTransactions("BlocksOp")
11983 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
11985 Get an edge, found in the given shape by two given vertices.
11988 theShape Block or a compound of blocks.
11989 thePoint1,thePoint2 Points, close to the ends of the desired edge.
11990 theName Object name; when specified, this parameter is used
11991 for result publication in the study. Otherwise, if automatic
11992 publication is switched on, default value is used for result name.
11995 New GEOM.GEOM_Object, containing the found edge.
11997 # Example: see GEOM_Spanner.py
11998 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
11999 RaiseIfFailed("GetEdge", self.BlocksOp)
12000 self._autoPublish(anObj, theName, "edge")
12003 ## Find an edge of the given shape, which has minimal distance to the given point.
12004 # @param theShape Block or a compound of blocks.
12005 # @param thePoint Point, close to the desired edge.
12006 # @param theName Object name; when specified, this parameter is used
12007 # for result publication in the study. Otherwise, if automatic
12008 # publication is switched on, default value is used for result name.
12010 # @return New GEOM.GEOM_Object, containing the found edge.
12012 # @ref swig_GetEdgeNearPoint "Example"
12013 @ManageTransactions("BlocksOp")
12014 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12016 Find an edge of the given shape, which has minimal distance to the given point.
12019 theShape Block or a compound of blocks.
12020 thePoint Point, close to the desired edge.
12021 theName Object name; when specified, this parameter is used
12022 for result publication in the study. Otherwise, if automatic
12023 publication is switched on, default value is used for result name.
12026 New GEOM.GEOM_Object, containing the found edge.
12028 # Example: see GEOM_TestOthers.py
12029 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12030 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12031 self._autoPublish(anObj, theName, "edge")
12034 ## Returns a face, found in the given shape by four given corner vertices.
12035 # @param theShape Block or a compound of blocks.
12036 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12037 # @param theName Object name; when specified, this parameter is used
12038 # for result publication in the study. Otherwise, if automatic
12039 # publication is switched on, default value is used for result name.
12041 # @return New GEOM.GEOM_Object, containing the found face.
12043 # @ref swig_todo "Example"
12044 @ManageTransactions("BlocksOp")
12045 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12047 Returns a face, found in the given shape by four given corner vertices.
12050 theShape Block or a compound of blocks.
12051 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12052 theName Object name; when specified, this parameter is used
12053 for result publication in the study. Otherwise, if automatic
12054 publication is switched on, default value is used for result name.
12057 New GEOM.GEOM_Object, containing the found face.
12059 # Example: see GEOM_Spanner.py
12060 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12061 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12062 self._autoPublish(anObj, theName, "face")
12065 ## Get a face of block, found in the given shape by two given edges.
12066 # @param theShape Block or a compound of blocks.
12067 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12068 # @param theName Object name; when specified, this parameter is used
12069 # for result publication in the study. Otherwise, if automatic
12070 # publication is switched on, default value is used for result name.
12072 # @return New GEOM.GEOM_Object, containing the found face.
12074 # @ref swig_todo "Example"
12075 @ManageTransactions("BlocksOp")
12076 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12078 Get a face of block, found in the given shape by two given edges.
12081 theShape Block or a compound of blocks.
12082 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12083 theName Object name; when specified, this parameter is used
12084 for result publication in the study. Otherwise, if automatic
12085 publication is switched on, default value is used for result name.
12088 New GEOM.GEOM_Object, containing the found face.
12090 # Example: see GEOM_Spanner.py
12091 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12092 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12093 self._autoPublish(anObj, theName, "face")
12096 ## Find a face, opposite to the given one in the given block.
12097 # @param theBlock Must be a hexahedral solid.
12098 # @param theFace Face of \a theBlock, opposite to the desired face.
12099 # @param theName Object name; when specified, this parameter is used
12100 # for result publication in the study. Otherwise, if automatic
12101 # publication is switched on, default value is used for result name.
12103 # @return New GEOM.GEOM_Object, containing the found face.
12105 # @ref swig_GetOppositeFace "Example"
12106 @ManageTransactions("BlocksOp")
12107 def GetOppositeFace(self, theBlock, theFace, theName=None):
12109 Find a face, opposite to the given one in the given block.
12112 theBlock Must be a hexahedral solid.
12113 theFace Face of theBlock, opposite to the desired face.
12114 theName Object name; when specified, this parameter is used
12115 for result publication in the study. Otherwise, if automatic
12116 publication is switched on, default value is used for result name.
12119 New GEOM.GEOM_Object, containing the found face.
12121 # Example: see GEOM_Spanner.py
12122 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12123 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12124 self._autoPublish(anObj, theName, "face")
12127 ## Find a face of the given shape, which has minimal distance to the given point.
12128 # @param theShape Block or a compound of blocks.
12129 # @param thePoint Point, close to the desired face.
12130 # @param theName Object name; when specified, this parameter is used
12131 # for result publication in the study. Otherwise, if automatic
12132 # publication is switched on, default value is used for result name.
12134 # @return New GEOM.GEOM_Object, containing the found face.
12136 # @ref swig_GetFaceNearPoint "Example"
12137 @ManageTransactions("BlocksOp")
12138 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12140 Find a face of the given shape, which has minimal distance to the given point.
12143 theShape Block or a compound of blocks.
12144 thePoint Point, close to the desired face.
12145 theName Object name; when specified, this parameter is used
12146 for result publication in the study. Otherwise, if automatic
12147 publication is switched on, default value is used for result name.
12150 New GEOM.GEOM_Object, containing the found face.
12152 # Example: see GEOM_Spanner.py
12153 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12154 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12155 self._autoPublish(anObj, theName, "face")
12158 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12159 # @param theBlock Block or a compound of blocks.
12160 # @param theVector Vector, close to the normale of the desired face.
12161 # @param theName Object name; when specified, this parameter is used
12162 # for result publication in the study. Otherwise, if automatic
12163 # publication is switched on, default value is used for result name.
12165 # @return New GEOM.GEOM_Object, containing the found face.
12167 # @ref swig_todo "Example"
12168 @ManageTransactions("BlocksOp")
12169 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12171 Find a face of block, whose outside normale has minimal angle with the given vector.
12174 theBlock Block or a compound of blocks.
12175 theVector Vector, close to the normale of the desired face.
12176 theName Object name; when specified, this parameter is used
12177 for result publication in the study. Otherwise, if automatic
12178 publication is switched on, default value is used for result name.
12181 New GEOM.GEOM_Object, containing the found face.
12183 # Example: see GEOM_Spanner.py
12184 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12185 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12186 self._autoPublish(anObj, theName, "face")
12189 ## Find all sub-shapes of type \a theShapeType of the given shape,
12190 # which have minimal distance to the given point.
12191 # @param theShape Any shape.
12192 # @param thePoint Point, close to the desired shape.
12193 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12194 # @param theTolerance The tolerance for distances comparison. All shapes
12195 # with distances to the given point in interval
12196 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12197 # @param theName Object name; when specified, this parameter is used
12198 # for result publication in the study. Otherwise, if automatic
12199 # publication is switched on, default value is used for result name.
12201 # @return New GEOM_Object, containing a group of all found shapes.
12203 # @ref swig_GetShapesNearPoint "Example"
12204 @ManageTransactions("BlocksOp")
12205 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12207 Find all sub-shapes of type theShapeType of the given shape,
12208 which have minimal distance to the given point.
12211 theShape Any shape.
12212 thePoint Point, close to the desired shape.
12213 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12214 theTolerance The tolerance for distances comparison. All shapes
12215 with distances to the given point in interval
12216 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12217 theName Object name; when specified, this parameter is used
12218 for result publication in the study. Otherwise, if automatic
12219 publication is switched on, default value is used for result name.
12222 New GEOM_Object, containing a group of all found shapes.
12224 # Example: see GEOM_TestOthers.py
12225 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12226 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12227 self._autoPublish(anObj, theName, "group")
12230 # end of l3_blocks_op
12233 ## @addtogroup l4_blocks_measure
12236 ## Check, if the compound of blocks is given.
12237 # To be considered as a compound of blocks, the
12238 # given shape must satisfy the following conditions:
12239 # - Each element of the compound should be a Block (6 faces).
12240 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12241 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12242 # there are more than 4 edges in the only wire of a face,
12243 # this face is considered to be quadrangle if it has 4 bounds
12244 # (1 or more edge) of C1 continuity.
12245 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12246 # - The compound should be connexe.
12247 # - The glue between two quadrangle faces should be applied.
12248 # @param theCompound The compound to check.
12249 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12250 # taking into account C1 continuity.
12251 # @param theAngTolerance the angular tolerance to check if two neighbor
12252 # edges are codirectional in the common vertex with this
12253 # tolerance. This parameter is used only if
12254 # <VAR>theIsUseC1</VAR> is set to True.
12255 # @return TRUE, if the given shape is a compound of blocks.
12256 # If theCompound is not valid, prints all discovered errors.
12258 # @ref tui_check_compound_of_blocks_page "Example 1"
12259 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12260 @ManageTransactions("BlocksOp")
12261 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12262 theAngTolerance = 1.e-12):
12264 Check, if the compound of blocks is given.
12265 To be considered as a compound of blocks, the
12266 given shape must satisfy the following conditions:
12267 - Each element of the compound should be a Block (6 faces).
12268 - Each face should be a quadrangle, i.e. it should have only 1 wire
12269 with 4 edges. If theIsUseC1 is set to True and
12270 there are more than 4 edges in the only wire of a face,
12271 this face is considered to be quadrangle if it has 4 bounds
12272 (1 or more edge) of C1 continuity.
12273 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12274 - The compound should be connexe.
12275 - The glue between two quadrangle faces should be applied.
12278 theCompound The compound to check.
12279 theIsUseC1 Flag to check if there are 4 bounds on a face
12280 taking into account C1 continuity.
12281 theAngTolerance the angular tolerance to check if two neighbor
12282 edges are codirectional in the common vertex with this
12283 tolerance. This parameter is used only if
12284 theIsUseC1 is set to True.
12287 TRUE, if the given shape is a compound of blocks.
12288 If theCompound is not valid, prints all discovered errors.
12290 # Example: see GEOM_Spanner.py
12293 aTolerance = theAngTolerance
12294 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12295 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12297 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12301 ## Retrieve all non blocks solids and faces from \a theShape.
12302 # @param theShape The shape to explore.
12303 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12304 # taking into account C1 continuity.
12305 # @param theAngTolerance the angular tolerance to check if two neighbor
12306 # edges are codirectional in the common vertex with this
12307 # tolerance. This parameter is used only if
12308 # <VAR>theIsUseC1</VAR> is set to True.
12309 # @param theName Object name; when specified, this parameter is used
12310 # for result publication in the study. Otherwise, if automatic
12311 # publication is switched on, default value is used for result name.
12313 # @return A tuple of two GEOM_Objects. The first object is a group of all
12314 # non block solids (= not 6 faces, or with 6 faces, but with the
12315 # presence of non-quadrangular faces). The second object is a
12316 # group of all non quadrangular faces (= faces with more then
12317 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12318 # with 1 wire with not 4 edges that do not form 4 bounds of
12321 # @ref tui_get_non_blocks_page "Example 1"
12322 # \n @ref swig_GetNonBlocks "Example 2"
12323 @ManageTransactions("BlocksOp")
12324 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12325 theAngTolerance = 1.e-12, theName=None):
12327 Retrieve all non blocks solids and faces from theShape.
12330 theShape The shape to explore.
12331 theIsUseC1 Flag to check if there are 4 bounds on a face
12332 taking into account C1 continuity.
12333 theAngTolerance the angular tolerance to check if two neighbor
12334 edges are codirectional in the common vertex with this
12335 tolerance. This parameter is used only if
12336 theIsUseC1 is set to True.
12337 theName Object name; when specified, this parameter is used
12338 for result publication in the study. Otherwise, if automatic
12339 publication is switched on, default value is used for result name.
12342 A tuple of two GEOM_Objects. The first object is a group of all
12343 non block solids (= not 6 faces, or with 6 faces, but with the
12344 presence of non-quadrangular faces). The second object is a
12345 group of all non quadrangular faces (= faces with more then
12346 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12347 with 1 wire with not 4 edges that do not form 4 bounds of
12351 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12353 # Example: see GEOM_Spanner.py
12356 aTolerance = theAngTolerance
12357 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12358 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12359 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12362 ## Remove all seam and degenerated edges from \a theShape.
12363 # Unite faces and edges, sharing one surface. It means that
12364 # this faces must have references to one C++ surface object (handle).
12365 # @param theShape The compound or single solid to remove irregular edges from.
12366 # @param doUnionFaces If True, then unite faces. If False (the default value),
12367 # do not unite faces.
12368 # @param theName Object name; when specified, this parameter is used
12369 # for result publication in the study. Otherwise, if automatic
12370 # publication is switched on, default value is used for result name.
12372 # @return Improved shape.
12374 # @ref swig_RemoveExtraEdges "Example"
12375 @ManageTransactions("BlocksOp")
12376 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12378 Remove all seam and degenerated edges from theShape.
12379 Unite faces and edges, sharing one surface. It means that
12380 this faces must have references to one C++ surface object (handle).
12383 theShape The compound or single solid to remove irregular edges from.
12384 doUnionFaces If True, then unite faces. If False (the default value),
12385 do not unite faces.
12386 theName Object name; when specified, this parameter is used
12387 for result publication in the study. Otherwise, if automatic
12388 publication is switched on, default value is used for result name.
12393 # Example: see GEOM_TestOthers.py
12394 nbFacesOptimum = -1 # -1 means do not unite faces
12395 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12396 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12397 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12398 self._autoPublish(anObj, theName, "removeExtraEdges")
12401 ## Performs union faces of \a theShape
12402 # Unite faces sharing one surface. It means that
12403 # these faces must have references to one C++ surface object (handle).
12404 # @param theShape The compound or single solid that contains faces
12405 # to perform union.
12406 # @param theName Object name; when specified, this parameter is used
12407 # for result publication in the study. Otherwise, if automatic
12408 # publication is switched on, default value is used for result name.
12410 # @return Improved shape.
12412 # @ref swig_UnionFaces "Example"
12413 @ManageTransactions("BlocksOp")
12414 def UnionFaces(self, theShape, theName=None):
12416 Performs union faces of theShape.
12417 Unite faces sharing one surface. It means that
12418 these faces must have references to one C++ surface object (handle).
12421 theShape The compound or single solid that contains faces
12423 theName Object name; when specified, this parameter is used
12424 for result publication in the study. Otherwise, if automatic
12425 publication is switched on, default value is used for result name.
12430 # Example: see GEOM_TestOthers.py
12431 anObj = self.BlocksOp.UnionFaces(theShape)
12432 RaiseIfFailed("UnionFaces", self.BlocksOp)
12433 self._autoPublish(anObj, theName, "unionFaces")
12436 ## Check, if the given shape is a blocks compound.
12437 # Fix all detected errors.
12438 # \note Single block can be also fixed by this method.
12439 # @param theShape The compound to check and improve.
12440 # @param theName Object name; when specified, this parameter is used
12441 # for result publication in the study. Otherwise, if automatic
12442 # publication is switched on, default value is used for result name.
12444 # @return Improved compound.
12446 # @ref swig_CheckAndImprove "Example"
12447 @ManageTransactions("BlocksOp")
12448 def CheckAndImprove(self, theShape, theName=None):
12450 Check, if the given shape is a blocks compound.
12451 Fix all detected errors.
12454 Single block can be also fixed by this method.
12457 theShape The compound to check and improve.
12458 theName Object name; when specified, this parameter is used
12459 for result publication in the study. Otherwise, if automatic
12460 publication is switched on, default value is used for result name.
12465 # Example: see GEOM_TestOthers.py
12466 anObj = self.BlocksOp.CheckAndImprove(theShape)
12467 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12468 self._autoPublish(anObj, theName, "improved")
12471 # end of l4_blocks_measure
12474 ## @addtogroup l3_blocks_op
12477 ## Get all the blocks, contained in the given compound.
12478 # @param theCompound The compound to explode.
12479 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12480 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12481 # @param theName Object name; when specified, this parameter is used
12482 # for result publication in the study. Otherwise, if automatic
12483 # publication is switched on, default value is used for result name.
12485 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12487 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12489 # @ref tui_explode_on_blocks "Example 1"
12490 # \n @ref swig_MakeBlockExplode "Example 2"
12491 @ManageTransactions("BlocksOp")
12492 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12494 Get all the blocks, contained in the given compound.
12497 theCompound The compound to explode.
12498 theMinNbFaces If solid has lower number of faces, it is not a block.
12499 theMaxNbFaces If solid has higher number of faces, it is not a block.
12500 theName Object name; when specified, this parameter is used
12501 for result publication in the study. Otherwise, if automatic
12502 publication is switched on, default value is used for result name.
12505 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12508 List of GEOM.GEOM_Object, containing the retrieved blocks.
12510 # Example: see GEOM_TestOthers.py
12511 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12512 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12513 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12514 for anObj in aList:
12515 anObj.SetParameters(Parameters)
12517 self._autoPublish(aList, theName, "block")
12520 ## Find block, containing the given point inside its volume or on boundary.
12521 # @param theCompound Compound, to find block in.
12522 # @param thePoint Point, close to the desired block. If the point lays on
12523 # boundary between some blocks, we return block with nearest center.
12524 # @param theName Object name; when specified, this parameter is used
12525 # for result publication in the study. Otherwise, if automatic
12526 # publication is switched on, default value is used for result name.
12528 # @return New GEOM.GEOM_Object, containing the found block.
12530 # @ref swig_todo "Example"
12531 @ManageTransactions("BlocksOp")
12532 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12534 Find block, containing the given point inside its volume or on boundary.
12537 theCompound Compound, to find block in.
12538 thePoint Point, close to the desired block. If the point lays on
12539 boundary between some blocks, we return block with nearest center.
12540 theName Object name; when specified, this parameter is used
12541 for result publication in the study. Otherwise, if automatic
12542 publication is switched on, default value is used for result name.
12545 New GEOM.GEOM_Object, containing the found block.
12547 # Example: see GEOM_Spanner.py
12548 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12549 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12550 self._autoPublish(anObj, theName, "block")
12553 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12554 # @param theCompound Compound, to find block in.
12555 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12556 # @param theName Object name; when specified, this parameter is used
12557 # for result publication in the study. Otherwise, if automatic
12558 # publication is switched on, default value is used for result name.
12560 # @return New GEOM.GEOM_Object, containing the found block.
12562 # @ref swig_GetBlockByParts "Example"
12563 @ManageTransactions("BlocksOp")
12564 def GetBlockByParts(self, theCompound, theParts, theName=None):
12566 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12569 theCompound Compound, to find block in.
12570 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12571 theName Object name; when specified, this parameter is used
12572 for result publication in the study. Otherwise, if automatic
12573 publication is switched on, default value is used for result name.
12576 New GEOM_Object, containing the found block.
12578 # Example: see GEOM_TestOthers.py
12579 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12580 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12581 self._autoPublish(anObj, theName, "block")
12584 ## Return all blocks, containing all the elements, passed as the parts.
12585 # @param theCompound Compound, to find blocks in.
12586 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12587 # @param theName Object name; when specified, this parameter is used
12588 # for result publication in the study. Otherwise, if automatic
12589 # publication is switched on, default value is used for result name.
12591 # @return List of GEOM.GEOM_Object, containing the found blocks.
12593 # @ref swig_todo "Example"
12594 @ManageTransactions("BlocksOp")
12595 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12597 Return all blocks, containing all the elements, passed as the parts.
12600 theCompound Compound, to find blocks in.
12601 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12602 theName Object name; when specified, this parameter is used
12603 for result publication in the study. Otherwise, if automatic
12604 publication is switched on, default value is used for result name.
12607 List of GEOM.GEOM_Object, containing the found blocks.
12609 # Example: see GEOM_Spanner.py
12610 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12611 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12612 self._autoPublish(aList, theName, "block")
12615 ## Multi-transformate block and glue the result.
12616 # Transformation is defined so, as to superpose direction faces.
12617 # @param Block Hexahedral solid to be multi-transformed.
12618 # @param DirFace1 ID of First direction face.
12619 # @param DirFace2 ID of Second direction face.
12620 # @param NbTimes Quantity of transformations to be done.
12621 # @param theName Object name; when specified, this parameter is used
12622 # for result publication in the study. Otherwise, if automatic
12623 # publication is switched on, default value is used for result name.
12625 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12627 # @return New GEOM.GEOM_Object, containing the result shape.
12629 # @ref tui_multi_transformation "Example"
12630 @ManageTransactions("BlocksOp")
12631 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12633 Multi-transformate block and glue the result.
12634 Transformation is defined so, as to superpose direction faces.
12637 Block Hexahedral solid to be multi-transformed.
12638 DirFace1 ID of First direction face.
12639 DirFace2 ID of Second direction face.
12640 NbTimes Quantity of transformations to be done.
12641 theName Object name; when specified, this parameter is used
12642 for result publication in the study. Otherwise, if automatic
12643 publication is switched on, default value is used for result name.
12646 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12649 New GEOM.GEOM_Object, containing the result shape.
12651 # Example: see GEOM_Spanner.py
12652 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12653 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12654 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12655 anObj.SetParameters(Parameters)
12656 self._autoPublish(anObj, theName, "transformed")
12659 ## Multi-transformate block and glue the result.
12660 # @param Block Hexahedral solid to be multi-transformed.
12661 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12662 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12663 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12664 # @param theName Object name; when specified, this parameter is used
12665 # for result publication in the study. Otherwise, if automatic
12666 # publication is switched on, default value is used for result name.
12668 # @return New GEOM.GEOM_Object, containing the result shape.
12670 # @ref tui_multi_transformation "Example"
12671 @ManageTransactions("BlocksOp")
12672 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12673 DirFace1V, DirFace2V, NbTimesV, theName=None):
12675 Multi-transformate block and glue the result.
12678 Block Hexahedral solid to be multi-transformed.
12679 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12680 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12681 NbTimesU,NbTimesV Quantity of transformations to be done.
12682 theName Object name; when specified, this parameter is used
12683 for result publication in the study. Otherwise, if automatic
12684 publication is switched on, default value is used for result name.
12687 New GEOM.GEOM_Object, containing the result shape.
12689 # Example: see GEOM_Spanner.py
12690 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12691 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12692 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12693 DirFace1V, DirFace2V, NbTimesV)
12694 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12695 anObj.SetParameters(Parameters)
12696 self._autoPublish(anObj, theName, "transformed")
12699 ## Build all possible propagation groups.
12700 # Propagation group is a set of all edges, opposite to one (main)
12701 # edge of this group directly or through other opposite edges.
12702 # Notion of Opposite Edge make sence only on quadrangle face.
12703 # @param theShape Shape to build propagation groups on.
12704 # @param theName Object name; when specified, this parameter is used
12705 # for result publication in the study. Otherwise, if automatic
12706 # publication is switched on, default value is used for result name.
12708 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12710 # @ref swig_Propagate "Example"
12711 @ManageTransactions("BlocksOp")
12712 def Propagate(self, theShape, theName=None):
12714 Build all possible propagation groups.
12715 Propagation group is a set of all edges, opposite to one (main)
12716 edge of this group directly or through other opposite edges.
12717 Notion of Opposite Edge make sence only on quadrangle face.
12720 theShape Shape to build propagation groups on.
12721 theName Object name; when specified, this parameter is used
12722 for result publication in the study. Otherwise, if automatic
12723 publication is switched on, default value is used for result name.
12726 List of GEOM.GEOM_Object, each of them is a propagation group.
12728 # Example: see GEOM_TestOthers.py
12729 listChains = self.BlocksOp.Propagate(theShape)
12730 RaiseIfFailed("Propagate", self.BlocksOp)
12731 self._autoPublish(listChains, theName, "propagate")
12734 # end of l3_blocks_op
12737 ## @addtogroup l3_groups
12740 ## Creates a new group which will store sub-shapes of theMainShape
12741 # @param theMainShape is a GEOM object on which the group is selected
12742 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12743 # @param theName Object name; when specified, this parameter is used
12744 # for result publication in the study. Otherwise, if automatic
12745 # publication is switched on, default value is used for result name.
12747 # @return a newly created GEOM group (GEOM.GEOM_Object)
12749 # @ref tui_working_with_groups_page "Example 1"
12750 # \n @ref swig_CreateGroup "Example 2"
12751 @ManageTransactions("GroupOp")
12752 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12754 Creates a new group which will store sub-shapes of theMainShape
12757 theMainShape is a GEOM object on which the group is selected
12758 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12759 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12760 theName Object name; when specified, this parameter is used
12761 for result publication in the study. Otherwise, if automatic
12762 publication is switched on, default value is used for result name.
12765 a newly created GEOM group
12768 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12771 # Example: see GEOM_TestOthers.py
12772 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12773 RaiseIfFailed("CreateGroup", self.GroupOp)
12774 self._autoPublish(anObj, theName, "group")
12777 ## Adds a sub-object with ID theSubShapeId to the group
12778 # @param theGroup is a GEOM group to which the new sub-shape is added
12779 # @param theSubShapeID is a sub-shape ID in the main object.
12780 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12782 # @ref tui_working_with_groups_page "Example"
12783 @ManageTransactions("GroupOp")
12784 def AddObject(self,theGroup, theSubShapeID):
12786 Adds a sub-object with ID theSubShapeId to the group
12789 theGroup is a GEOM group to which the new sub-shape is added
12790 theSubShapeID is a sub-shape ID in the main object.
12793 Use method GetSubShapeID() to get an unique ID of the sub-shape
12795 # Example: see GEOM_TestOthers.py
12796 self.GroupOp.AddObject(theGroup, theSubShapeID)
12797 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12798 RaiseIfFailed("AddObject", self.GroupOp)
12802 ## Removes a sub-object with ID \a theSubShapeId from the group
12803 # @param theGroup is a GEOM group from which the new sub-shape is removed
12804 # @param theSubShapeID is a sub-shape ID in the main object.
12805 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12807 # @ref tui_working_with_groups_page "Example"
12808 @ManageTransactions("GroupOp")
12809 def RemoveObject(self,theGroup, theSubShapeID):
12811 Removes a sub-object with ID theSubShapeId from the group
12814 theGroup is a GEOM group from which the new sub-shape is removed
12815 theSubShapeID is a sub-shape ID in the main object.
12818 Use method GetSubShapeID() to get an unique ID of the sub-shape
12820 # Example: see GEOM_TestOthers.py
12821 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12822 RaiseIfFailed("RemoveObject", self.GroupOp)
12825 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12826 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12827 # @param theSubShapes is a list of sub-shapes to be added.
12829 # @ref tui_working_with_groups_page "Example"
12830 @ManageTransactions("GroupOp")
12831 def UnionList (self,theGroup, theSubShapes):
12833 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12836 theGroup is a GEOM group to which the new sub-shapes are added.
12837 theSubShapes is a list of sub-shapes to be added.
12839 # Example: see GEOM_TestOthers.py
12840 self.GroupOp.UnionList(theGroup, theSubShapes)
12841 RaiseIfFailed("UnionList", self.GroupOp)
12844 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12845 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12846 # @param theSubShapes is a list of indices of sub-shapes to be added.
12848 # @ref swig_UnionIDs "Example"
12849 @ManageTransactions("GroupOp")
12850 def UnionIDs(self,theGroup, theSubShapes):
12852 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12855 theGroup is a GEOM group to which the new sub-shapes are added.
12856 theSubShapes is a list of indices of sub-shapes to be added.
12858 # Example: see GEOM_TestOthers.py
12859 self.GroupOp.UnionIDs(theGroup, theSubShapes)
12860 RaiseIfFailed("UnionIDs", self.GroupOp)
12863 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12864 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12865 # @param theSubShapes is a list of sub-shapes to be removed.
12867 # @ref tui_working_with_groups_page "Example"
12868 @ManageTransactions("GroupOp")
12869 def DifferenceList (self,theGroup, theSubShapes):
12871 Removes from the group all the given shapes. No errors, if some shapes are not included.
12874 theGroup is a GEOM group from which the sub-shapes are removed.
12875 theSubShapes is a list of sub-shapes to be removed.
12877 # Example: see GEOM_TestOthers.py
12878 self.GroupOp.DifferenceList(theGroup, theSubShapes)
12879 RaiseIfFailed("DifferenceList", self.GroupOp)
12882 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
12883 # @param theGroup is a GEOM group from which the sub-shapes are removed.
12884 # @param theSubShapes is a list of indices of sub-shapes to be removed.
12886 # @ref swig_DifferenceIDs "Example"
12887 @ManageTransactions("GroupOp")
12888 def DifferenceIDs(self,theGroup, theSubShapes):
12890 Removes from the group all the given shapes. No errors, if some shapes are not included.
12893 theGroup is a GEOM group from which the sub-shapes are removed.
12894 theSubShapes is a list of indices of sub-shapes to be removed.
12896 # Example: see GEOM_TestOthers.py
12897 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
12898 RaiseIfFailed("DifferenceIDs", self.GroupOp)
12901 ## Union of two groups.
12902 # New group is created. It will contain all entities
12903 # which are present in groups theGroup1 and theGroup2.
12904 # @param theGroup1, theGroup2 are the initial GEOM groups
12905 # to create the united group from.
12906 # @param theName Object name; when specified, this parameter is used
12907 # for result publication in the study. Otherwise, if automatic
12908 # publication is switched on, default value is used for result name.
12910 # @return a newly created GEOM group.
12912 # @ref tui_union_groups_anchor "Example"
12913 @ManageTransactions("GroupOp")
12914 def UnionGroups (self, theGroup1, theGroup2, theName=None):
12916 Union of two groups.
12917 New group is created. It will contain all entities
12918 which are present in groups theGroup1 and theGroup2.
12921 theGroup1, theGroup2 are the initial GEOM groups
12922 to create the united group from.
12923 theName Object name; when specified, this parameter is used
12924 for result publication in the study. Otherwise, if automatic
12925 publication is switched on, default value is used for result name.
12928 a newly created GEOM group.
12930 # Example: see GEOM_TestOthers.py
12931 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
12932 RaiseIfFailed("UnionGroups", self.GroupOp)
12933 self._autoPublish(aGroup, theName, "group")
12936 ## Intersection of two groups.
12937 # New group is created. It will contain only those entities
12938 # which are present in both groups theGroup1 and theGroup2.
12939 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
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 a newly created GEOM group.
12946 # @ref tui_intersect_groups_anchor "Example"
12947 @ManageTransactions("GroupOp")
12948 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
12950 Intersection of two groups.
12951 New group is created. It will contain only those entities
12952 which are present in both groups theGroup1 and theGroup2.
12955 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
12956 theName Object name; when specified, this parameter is used
12957 for result publication in the study. Otherwise, if automatic
12958 publication is switched on, default value is used for result name.
12961 a newly created GEOM group.
12963 # Example: see GEOM_TestOthers.py
12964 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
12965 RaiseIfFailed("IntersectGroups", self.GroupOp)
12966 self._autoPublish(aGroup, theName, "group")
12969 ## Cut of two groups.
12970 # New group is created. It will contain entities which are
12971 # present in group theGroup1 but are not present in group theGroup2.
12972 # @param theGroup1 is a GEOM group to include elements of.
12973 # @param theGroup2 is a GEOM group to exclude elements of.
12974 # @param theName Object name; when specified, this parameter is used
12975 # for result publication in the study. Otherwise, if automatic
12976 # publication is switched on, default value is used for result name.
12978 # @return a newly created GEOM group.
12980 # @ref tui_cut_groups_anchor "Example"
12981 @ManageTransactions("GroupOp")
12982 def CutGroups (self, theGroup1, theGroup2, theName=None):
12985 New group is created. It will contain entities which are
12986 present in group theGroup1 but are not present in group theGroup2.
12989 theGroup1 is a GEOM group to include elements of.
12990 theGroup2 is a GEOM group to exclude elements of.
12991 theName Object name; when specified, this parameter is used
12992 for result publication in the study. Otherwise, if automatic
12993 publication is switched on, default value is used for result name.
12996 a newly created GEOM group.
12998 # Example: see GEOM_TestOthers.py
12999 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13000 RaiseIfFailed("CutGroups", self.GroupOp)
13001 self._autoPublish(aGroup, theName, "group")
13004 ## Union of list of groups.
13005 # New group is created. It will contain all entities that are
13006 # present in groups listed in theGList.
13007 # @param theGList is a list of GEOM groups to create the united group from.
13008 # @param theName Object name; when specified, this parameter is used
13009 # for result publication in the study. Otherwise, if automatic
13010 # publication is switched on, default value is used for result name.
13012 # @return a newly created GEOM group.
13014 # @ref tui_union_groups_anchor "Example"
13015 @ManageTransactions("GroupOp")
13016 def UnionListOfGroups (self, theGList, theName=None):
13018 Union of list of groups.
13019 New group is created. It will contain all entities that are
13020 present in groups listed in theGList.
13023 theGList is a list of GEOM groups to create the united group from.
13024 theName Object name; when specified, this parameter is used
13025 for result publication in the study. Otherwise, if automatic
13026 publication is switched on, default value is used for result name.
13029 a newly created GEOM group.
13031 # Example: see GEOM_TestOthers.py
13032 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13033 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13034 self._autoPublish(aGroup, theName, "group")
13037 ## Cut of lists of groups.
13038 # New group is created. It will contain only entities
13039 # which are present in groups listed in theGList.
13040 # @param theGList is a list of GEOM groups to include elements of.
13041 # @param theName Object name; when specified, this parameter is used
13042 # for result publication in the study. Otherwise, if automatic
13043 # publication is switched on, default value is used for result name.
13045 # @return a newly created GEOM group.
13047 # @ref tui_intersect_groups_anchor "Example"
13048 @ManageTransactions("GroupOp")
13049 def IntersectListOfGroups (self, theGList, theName=None):
13051 Cut of lists of groups.
13052 New group is created. It will contain only entities
13053 which are present in groups listed in theGList.
13056 theGList is a list of GEOM groups to include elements of.
13057 theName Object name; when specified, this parameter is used
13058 for result publication in the study. Otherwise, if automatic
13059 publication is switched on, default value is used for result name.
13062 a newly created GEOM group.
13064 # Example: see GEOM_TestOthers.py
13065 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13066 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13067 self._autoPublish(aGroup, theName, "group")
13070 ## Cut of lists of groups.
13071 # New group is created. It will contain only entities
13072 # which are present in groups listed in theGList1 but
13073 # are not present in groups from theGList2.
13074 # @param theGList1 is a list of GEOM groups to include elements of.
13075 # @param theGList2 is a list of GEOM groups to exclude elements of.
13076 # @param theName Object name; when specified, this parameter is used
13077 # for result publication in the study. Otherwise, if automatic
13078 # publication is switched on, default value is used for result name.
13080 # @return a newly created GEOM group.
13082 # @ref tui_cut_groups_anchor "Example"
13083 @ManageTransactions("GroupOp")
13084 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13086 Cut of lists of groups.
13087 New group is created. It will contain only entities
13088 which are present in groups listed in theGList1 but
13089 are not present in groups from theGList2.
13092 theGList1 is a list of GEOM groups to include elements of.
13093 theGList2 is a list of GEOM groups to exclude elements of.
13094 theName Object name; when specified, this parameter is used
13095 for result publication in the study. Otherwise, if automatic
13096 publication is switched on, default value is used for result name.
13099 a newly created GEOM group.
13101 # Example: see GEOM_TestOthers.py
13102 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13103 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13104 self._autoPublish(aGroup, theName, "group")
13107 ## Returns a list of sub-objects ID stored in the group
13108 # @param theGroup is a GEOM group for which a list of IDs is requested
13110 # @ref swig_GetObjectIDs "Example"
13111 @ManageTransactions("GroupOp")
13112 def GetObjectIDs(self,theGroup):
13114 Returns a list of sub-objects ID stored in the group
13117 theGroup is a GEOM group for which a list of IDs is requested
13119 # Example: see GEOM_TestOthers.py
13120 ListIDs = self.GroupOp.GetObjects(theGroup)
13121 RaiseIfFailed("GetObjects", self.GroupOp)
13124 ## Returns a type of sub-objects stored in the group
13125 # @param theGroup is a GEOM group which type is returned.
13127 # @ref swig_GetType "Example"
13128 @ManageTransactions("GroupOp")
13129 def GetType(self,theGroup):
13131 Returns a type of sub-objects stored in the group
13134 theGroup is a GEOM group which type is returned.
13136 # Example: see GEOM_TestOthers.py
13137 aType = self.GroupOp.GetType(theGroup)
13138 RaiseIfFailed("GetType", self.GroupOp)
13141 ## Convert a type of geom object from id to string value
13142 # @param theId is a GEOM obect type id.
13143 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13144 # @ref swig_GetType "Example"
13145 def ShapeIdToType(self, theId):
13147 Convert a type of geom object from id to string value
13150 theId is a GEOM obect type id.
13153 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13180 return "REVOLUTION"
13228 return "FREE_BOUNDS"
13236 return "THRUSECTIONS"
13238 return "COMPOUNDFILTER"
13240 return "SHAPES_ON_SHAPE"
13242 return "ELLIPSE_ARC"
13244 return "3DSKETCHER"
13250 return "PIPETSHAPE"
13251 return "Shape Id not exist."
13253 ## Returns a main shape associated with the group
13254 # @param theGroup is a GEOM group for which a main shape object is requested
13255 # @return a GEOM object which is a main shape for theGroup
13257 # @ref swig_GetMainShape "Example"
13258 @ManageTransactions("GroupOp")
13259 def GetMainShape(self,theGroup):
13261 Returns a main shape associated with the group
13264 theGroup is a GEOM group for which a main shape object is requested
13267 a GEOM object which is a main shape for theGroup
13269 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13271 # Example: see GEOM_TestOthers.py
13272 anObj = self.GroupOp.GetMainShape(theGroup)
13273 RaiseIfFailed("GetMainShape", self.GroupOp)
13276 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13277 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13278 # @param theShape given shape (see GEOM.GEOM_Object)
13279 # @param min_length minimum length of edges of theShape
13280 # @param max_length maximum length of edges of theShape
13281 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13282 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13283 # @param theName Object name; when specified, this parameter is used
13284 # for result publication in the study. Otherwise, if automatic
13285 # publication is switched on, default value is used for result name.
13287 # @return a newly created GEOM group of edges
13289 # @@ref swig_todo "Example"
13290 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13292 Create group of edges of theShape, whose length is in range [min_length, max_length].
13293 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13296 theShape given shape
13297 min_length minimum length of edges of theShape
13298 max_length maximum length of edges of theShape
13299 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13300 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13301 theName Object name; when specified, this parameter is used
13302 for result publication in the study. Otherwise, if automatic
13303 publication is switched on, default value is used for result name.
13306 a newly created GEOM group of edges.
13308 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13309 edges_in_range = []
13311 Props = self.BasicProperties(edge)
13312 if min_length <= Props[0] and Props[0] <= max_length:
13313 if (not include_min) and (min_length == Props[0]):
13316 if (not include_max) and (Props[0] == max_length):
13319 edges_in_range.append(edge)
13321 if len(edges_in_range) <= 0:
13322 print "No edges found by given criteria"
13325 # note: auto-publishing is done in self.CreateGroup()
13326 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13327 self.UnionList(group_edges, edges_in_range)
13331 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13332 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13333 # @param min_length minimum length of edges of selected shape
13334 # @param max_length maximum length of edges of selected shape
13335 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13336 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13337 # @return a newly created GEOM group of edges
13338 # @ref swig_todo "Example"
13339 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13341 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13342 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13345 min_length minimum length of edges of selected shape
13346 max_length maximum length of edges of selected shape
13347 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13348 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13351 a newly created GEOM group of edges.
13353 nb_selected = sg.SelectedCount()
13354 if nb_selected < 1:
13355 print "Select a shape before calling this function, please."
13357 if nb_selected > 1:
13358 print "Only one shape must be selected"
13361 id_shape = sg.getSelected(0)
13362 shape = IDToObject( id_shape )
13364 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13368 if include_min: left_str = " <= "
13369 if include_max: right_str = " <= "
13371 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
13372 + left_str + "length" + right_str + `max_length`)
13374 sg.updateObjBrowser(1)
13381 #@@ insert new functions before this line @@ do not remove this line @@#
13383 ## Create a copy of the given object
13385 # @param theOriginal geometry object for copy
13386 # @param theName Object name; when specified, this parameter is used
13387 # for result publication in the study. Otherwise, if automatic
13388 # publication is switched on, default value is used for result name.
13390 # @return New GEOM_Object, containing the copied shape.
13392 # @ingroup l1_geomBuilder_auxiliary
13393 # @ref swig_MakeCopy "Example"
13394 @ManageTransactions("InsertOp")
13395 def MakeCopy(self, theOriginal, theName=None):
13397 Create a copy of the given object
13400 theOriginal geometry object for copy
13401 theName Object name; when specified, this parameter is used
13402 for result publication in the study. Otherwise, if automatic
13403 publication is switched on, default value is used for result name.
13406 New GEOM_Object, containing the copied shape.
13408 Example of usage: Copy = geompy.MakeCopy(Box)
13410 # Example: see GEOM_TestAll.py
13411 anObj = self.InsertOp.MakeCopy(theOriginal)
13412 RaiseIfFailed("MakeCopy", self.InsertOp)
13413 self._autoPublish(anObj, theName, "copy")
13416 ## Add Path to load python scripts from
13417 # @param Path a path to load python scripts from
13418 # @ingroup l1_geomBuilder_auxiliary
13419 def addPath(self,Path):
13421 Add Path to load python scripts from
13424 Path a path to load python scripts from
13426 if (sys.path.count(Path) < 1):
13427 sys.path.append(Path)
13431 ## Load marker texture from the file
13432 # @param Path a path to the texture file
13433 # @return unique texture identifier
13434 # @ingroup l1_geomBuilder_auxiliary
13435 @ManageTransactions("InsertOp")
13436 def LoadTexture(self, Path):
13438 Load marker texture from the file
13441 Path a path to the texture file
13444 unique texture identifier
13446 # Example: see GEOM_TestAll.py
13447 ID = self.InsertOp.LoadTexture(Path)
13448 RaiseIfFailed("LoadTexture", self.InsertOp)
13451 ## Get internal name of the object based on its study entry
13452 # @note This method does not provide an unique identifier of the geometry object.
13453 # @note This is internal function of GEOM component, though it can be used outside it for
13454 # appropriate reason (e.g. for identification of geometry object).
13455 # @param obj geometry object
13456 # @return unique object identifier
13457 # @ingroup l1_geomBuilder_auxiliary
13458 def getObjectID(self, obj):
13460 Get internal name of the object based on its study entry.
13461 Note: this method does not provide an unique identifier of the geometry object.
13462 It is an internal function of GEOM component, though it can be used outside GEOM for
13463 appropriate reason (e.g. for identification of geometry object).
13466 obj geometry object
13469 unique object identifier
13472 entry = salome.ObjectToID(obj)
13473 if entry is not None:
13474 lst = entry.split(":")
13476 ID = lst[-1] # -1 means last item in the list
13477 return "GEOM_" + ID
13482 ## Add marker texture. @a Width and @a Height parameters
13483 # specify width and height of the texture in pixels.
13484 # If @a RowData is @c True, @a Texture parameter should represent texture data
13485 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13486 # parameter should be unpacked string, in which '1' symbols represent opaque
13487 # pixels and '0' represent transparent pixels of the texture bitmap.
13489 # @param Width texture width in pixels
13490 # @param Height texture height in pixels
13491 # @param Texture texture data
13492 # @param RowData if @c True, @a Texture data are packed in the byte stream
13493 # @return unique texture identifier
13494 # @ingroup l1_geomBuilder_auxiliary
13495 @ManageTransactions("InsertOp")
13496 def AddTexture(self, Width, Height, Texture, RowData=False):
13498 Add marker texture. Width and Height parameters
13499 specify width and height of the texture in pixels.
13500 If RowData is True, Texture parameter should represent texture data
13501 packed into the byte array. If RowData is False (default), Texture
13502 parameter should be unpacked string, in which '1' symbols represent opaque
13503 pixels and '0' represent transparent pixels of the texture bitmap.
13506 Width texture width in pixels
13507 Height texture height in pixels
13508 Texture texture data
13509 RowData if True, Texture data are packed in the byte stream
13512 return unique texture identifier
13514 if not RowData: Texture = PackData(Texture)
13515 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13516 RaiseIfFailed("AddTexture", self.InsertOp)
13519 ## Transfer not topological data from one GEOM object to another.
13521 # @param theObjectFrom the source object of non-topological data
13522 # @param theObjectTo the destination object of non-topological data
13523 # @param theFindMethod method to search sub-shapes of theObjectFrom
13524 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13525 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13526 # Other values of GEOM.find_shape_method are not supported.
13528 # @return True in case of success; False otherwise.
13530 # @ingroup l1_geomBuilder_auxiliary
13532 # @ref swig_TransferData "Example"
13533 @ManageTransactions("InsertOp")
13534 def TransferData(self, theObjectFrom, theObjectTo,
13535 theFindMethod=GEOM.FSM_GetInPlace):
13537 Transfer not topological data from one GEOM object to another.
13540 theObjectFrom the source object of non-topological data
13541 theObjectTo the destination object of non-topological data
13542 theFindMethod method to search sub-shapes of theObjectFrom
13543 in shape theObjectTo. Possible values are:
13544 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13545 and GEOM.FSM_GetInPlace_Old. Other values of
13546 GEOM.find_shape_method are not supported.
13549 True in case of success; False otherwise.
13551 # Example: see GEOM_TestOthers.py
13553 # Example: see GEOM_TestAll.py
13554 isOk = self.InsertOp.TransferData(theObjectFrom,
13555 theObjectTo, theFindMethod)
13556 RaiseIfFailed("TransferData", self.InsertOp)
13559 ## Creates a new folder object. It is a container for any GEOM objects.
13560 # @param Name name of the container
13561 # @param Father parent object. If None,
13562 # folder under 'Geometry' root object will be created.
13563 # @return a new created folder
13564 # @ingroup l1_publish_data
13565 def NewFolder(self, Name, Father=None):
13567 Create a new folder object. It is an auxiliary container for any GEOM objects.
13570 Name name of the container
13571 Father parent object. If None,
13572 folder under 'Geometry' root object will be created.
13575 a new created folder
13577 if not Father: Father = self.father
13578 return self.CreateFolder(Name, Father)
13580 ## Move object to the specified folder
13581 # @param Object object to move
13582 # @param Folder target folder
13583 # @ingroup l1_publish_data
13584 def PutToFolder(self, Object, Folder):
13586 Move object to the specified folder
13589 Object object to move
13590 Folder target folder
13592 self.MoveToFolder(Object, Folder)
13595 ## Move list of objects to the specified folder
13596 # @param ListOfSO list of objects to move
13597 # @param Folder target folder
13598 # @ingroup l1_publish_data
13599 def PutListToFolder(self, ListOfSO, Folder):
13601 Move list of objects to the specified folder
13604 ListOfSO list of objects to move
13605 Folder target folder
13607 self.MoveListToFolder(ListOfSO, Folder)
13610 ## @addtogroup l2_field
13614 # @param shape the shape the field lies on
13615 # @param name the field name
13616 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13617 # @param dimension dimension of the shape the field lies on
13618 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13619 # @param componentNames names of components
13620 # @return a created field
13621 @ManageTransactions("FieldOp")
13622 def CreateField(self, shape, name, type, dimension, componentNames):
13627 shape the shape the field lies on
13628 name the field name
13629 type type of field data
13630 dimension dimension of the shape the field lies on
13631 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13632 componentNames names of components
13637 if isinstance( type, int ):
13638 if type < 0 or type > 3:
13639 raise RuntimeError, "CreateField : Error: data type must be within [0-3] range"
13640 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13642 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13643 RaiseIfFailed("CreateField", self.FieldOp)
13645 geom._autoPublish( f, "", name)
13648 ## Removes a field from the GEOM component
13649 # @param field the field to remove
13650 def RemoveField(self, field):
13651 "Removes a field from the GEOM component"
13653 if isinstance( field, GEOM._objref_GEOM_Field ):
13654 geom.RemoveObject( field )
13655 elif isinstance( field, geomField ):
13656 geom.RemoveObject( field.field )
13658 raise RuntimeError, "RemoveField() : the object is not a field"
13661 ## Returns number of fields on a shape
13662 @ManageTransactions("FieldOp")
13663 def CountFields(self, shape):
13664 "Returns number of fields on a shape"
13665 nb = self.FieldOp.CountFields( shape )
13666 RaiseIfFailed("CountFields", self.FieldOp)
13669 ## Returns all fields on a shape
13670 @ManageTransactions("FieldOp")
13671 def GetFields(self, shape):
13672 "Returns all fields on a shape"
13673 ff = self.FieldOp.GetFields( shape )
13674 RaiseIfFailed("GetFields", self.FieldOp)
13677 ## Returns a field on a shape by its name
13678 @ManageTransactions("FieldOp")
13679 def GetField(self, shape, name):
13680 "Returns a field on a shape by its name"
13681 f = self.FieldOp.GetField( shape, name )
13682 RaiseIfFailed("GetField", self.FieldOp)
13690 # Register the new proxy for GEOM_Gen
13691 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13694 ## Field on Geometry
13695 # @ingroup l2_field
13696 class geomField( GEOM._objref_GEOM_Field ):
13698 def __init__(self):
13699 GEOM._objref_GEOM_Field.__init__(self)
13700 self.field = GEOM._objref_GEOM_Field
13703 ## Returns the shape the field lies on
13704 def getShape(self):
13705 "Returns the shape the field lies on"
13706 return self.field.GetShape(self)
13708 ## Returns the field name
13710 "Returns the field name"
13711 return self.field.GetName(self)
13713 ## Returns type of field data as integer [0-3]
13715 "Returns type of field data"
13716 return self.field.GetDataType(self)._v
13718 ## Returns type of field data:
13719 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13720 def getTypeEnum(self):
13721 "Returns type of field data"
13722 return self.field.GetDataType(self)
13724 ## Returns dimension of the shape the field lies on:
13725 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13726 def getDimension(self):
13727 """Returns dimension of the shape the field lies on:
13728 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13729 return self.field.GetDimension(self)
13731 ## Returns names of components
13732 def getComponents(self):
13733 "Returns names of components"
13734 return self.field.GetComponents(self)
13736 ## Adds a time step to the field
13737 # @param step the time step number further used as the step identifier
13738 # @param stamp the time step time
13739 # @param values the values of the time step
13740 def addStep(self, step, stamp, values):
13741 "Adds a time step to the field"
13742 stp = self.field.AddStep( self, step, stamp )
13744 raise RuntimeError, \
13745 "Field.addStep() : Error: step %s already exists in this field"%step
13747 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13748 self.setValues( step, values )
13751 ## Remove a time step from the field
13752 def removeStep(self,step):
13753 "Remove a time step from the field"
13756 stepObj = self.field.GetStep( self, step )
13758 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13761 #traceback.print_exc()
13763 self.field.RemoveStep( self, step )
13765 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13768 ## Returns number of time steps in the field
13769 def countSteps(self):
13770 "Returns number of time steps in the field"
13771 return self.field.CountSteps(self)
13773 ## Returns a list of time step IDs in the field
13774 def getSteps(self):
13775 "Returns a list of time step IDs in the field"
13776 return self.field.GetSteps(self)
13778 ## Returns a time step by its ID
13779 def getStep(self,step):
13780 "Returns a time step by its ID"
13781 stp = self.field.GetStep(self, step)
13783 raise RuntimeError, "Step %s is missing from this field"%step
13786 ## Returns the time of the field step
13787 def getStamp(self,step):
13788 "Returns the time of the field step"
13789 return self.getStep(step).GetStamp()
13791 ## Changes the time of the field step
13792 def setStamp(self, step, stamp):
13793 "Changes the time of the field step"
13794 return self.getStep(step).SetStamp(stamp)
13796 ## Returns values of the field step
13797 def getValues(self, step):
13798 "Returns values of the field step"
13799 return self.getStep(step).GetValues()
13801 ## Changes values of the field step
13802 def setValues(self, step, values):
13803 "Changes values of the field step"
13804 stp = self.getStep(step)
13805 errBeg = "Field.setValues(values) : Error: "
13807 ok = stp.SetValues( values )
13808 except Exception, e:
13810 if excStr.find("WrongPythonType") > 0:
13811 raise RuntimeError, errBeg +\
13812 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:]
13813 raise RuntimeError, errBeg + str(e)
13815 nbOK = self.field.GetArraySize(self)
13818 raise RuntimeError, errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO)
13820 raise RuntimeError, errBeg + "failed"
13823 pass # end of class geomField
13825 # Register the new proxy for GEOM_Field
13826 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13829 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13830 # interface to GEOM operations.
13835 # salome.salome_init()
13836 # from salome.geom import geomBuilder
13837 # geompy = geomBuilder.New(salome.myStudy)
13839 # @param study SALOME study, generally obtained by salome.myStudy.
13840 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13841 # @return geomBuilder instance
13842 def New( study, instance=None):
13844 Create a new geomBuilder instance.The geomBuilder class provides the Python
13845 interface to GEOM operations.
13849 salome.salome_init()
13850 from salome.geom import geomBuilder
13851 geompy = geomBuilder.New(salome.myStudy)
13854 study SALOME study, generally obtained by salome.myStudy.
13855 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13857 geomBuilder instance
13859 #print "New geomBuilder ", study, instance
13866 geom = geomBuilder()
13867 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
13868 geom.init_geom(study)
13872 # Register methods from the plug-ins in the geomBuilder class
13873 plugins_var = os.environ.get( "GEOM_PluginsList" )
13876 if plugins_var is not None:
13877 plugins = plugins_var.split( ":" )
13878 plugins=filter(lambda x: len(x)>0, plugins)
13879 if plugins is not None:
13880 for pluginName in plugins:
13881 pluginBuilderName = pluginName + "Builder"
13883 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
13884 except Exception, e:
13885 from salome_utils import verbose
13886 print "Exception while loading %s: %s" % ( pluginBuilderName, e )
13888 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
13889 plugin = eval( pluginBuilderName )
13891 # add methods from plugin module to the geomBuilder class
13892 for k in dir( plugin ):
13893 if k[0] == '_': continue
13894 method = getattr( plugin, k )
13895 if type( method ).__name__ == 'function':
13896 if not hasattr( geomBuilder, k ):
13897 setattr( geomBuilder, k, method )