1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2016 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()
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()
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 contains 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()
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
245 # initialize SALOME session in try/except block
246 # to avoid problems in some cases, e.g. when generating documentation
254 from salome_notebook import *
261 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
263 # In case the omniORBpy EnumItem class does not fully support Python 3
264 # (for instance in version 4.2.1-2), the comparison ordering methods must be
268 GEOM.COMPOUND < GEOM.SOLID
270 def enumitem_eq(self, other):
272 if isinstance(other, omniORB.EnumItem):
273 if other._parent_id == self._parent_id:
274 return self._v == other._v
276 return self._parent_id == other._parent_id
278 return id(self) == id(other)
280 return id(self) == id(other)
282 def enumitem_lt(self, other):
284 if isinstance(other, omniORB.EnumItem):
285 if other._parent_id == self._parent_id:
286 return self._v < other._v
288 return self._parent_id < other._parent_id
290 return id(self) < id(other)
292 return id(self) < id(other)
294 def enumitem_le(self, other):
296 if isinstance(other, omniORB.EnumItem):
297 if other._parent_id == self._parent_id:
298 return self._v <= other._v
300 return self._parent_id <= other._parent_id
302 return id(self) <= id(other)
304 return id(self) <= id(other)
306 def enumitem_gt(self, other):
308 if isinstance(other, omniORB.EnumItem):
309 if other._parent_id == self._parent_id:
310 return self._v > other._v
312 return self._parent_id > other._parent_id
314 return id(self) > id(other)
316 return id(self) > id(other)
318 def enumitem_ge(self, other):
320 if isinstance(other, omniORB.EnumItem):
321 if other._parent_id == self._parent_id:
322 return self._v >= other._v
324 return self._parent_id >= other._parent_id
326 return id(self) >= id(other)
328 return id(self) >= id(other)
330 GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
331 GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
332 GEOM.omniORB.EnumItem.__le__ = enumitem_le
333 GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
334 GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
335 omniORB.EnumItem.__eq__ = enumitem_eq
336 omniORB.EnumItem.__lt__ = enumitem_lt
337 omniORB.EnumItem.__le__ = enumitem_le
338 omniORB.EnumItem.__gt__ = enumitem_gt
339 omniORB.EnumItem.__ge__ = enumitem_ge
342 def _toListOfNames(_names, _size=-1):
345 if type(_names) in [list, tuple]:
346 for i in _names: l.append(i)
349 if l and len(l) < _size:
350 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
353 # Decorator function to manage transactions for all geometric operations.
354 def ManageTransactions(theOpeName):
355 def MTDecorator(theFunction):
356 # To keep the original function name an documentation.
357 @functools.wraps(theFunction)
358 def OpenCallClose(self, *args, **kwargs):
360 anOperation = getattr(self, theOpeName)
361 anOperation.StartOperation()
364 res = theFunction(self, *args, **kwargs)
366 anOperation.FinishOperation()
370 anOperation.AbortOperation()
375 ## Raise an Error, containing the Method_name, if Operation is Failed
376 ## @ingroup l1_geomBuilder_auxiliary
377 def RaiseIfFailed (Method_name, Operation):
378 if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
379 raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
381 ## Return list of variables value from salome notebook
382 ## @ingroup l1_geomBuilder_auxiliary
383 def ParseParameters(*parameters):
386 for parameter in parameters:
387 if isinstance(parameter, list):
388 lResults = ParseParameters(*parameter)
389 if len(lResults) > 0:
390 Result.append(lResults[:-1])
391 StringResult += lResults[-1].split(":")
395 if isinstance(parameter,str):
396 if notebook.isVariable(parameter):
397 Result.append(notebook.get(parameter))
399 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
402 Result.append(parameter)
404 StringResult.append(str(parameter))
408 Result.append(":".join(StringResult))
410 Result = ":".join(StringResult)
413 ## Return list of variables value from salome notebook
414 ## @ingroup l1_geomBuilder_auxiliary
418 for parameter in list:
419 if isinstance(parameter,str) and notebook.isVariable(parameter):
420 Result.append(str(notebook.get(parameter)))
423 Result.append(str(parameter))
426 StringResult = StringResult + str(parameter)
427 StringResult = StringResult + ":"
429 StringResult = StringResult[:len(StringResult)-1]
430 return Result, StringResult
432 ## Return list of variables value from salome notebook
433 ## @ingroup l1_geomBuilder_auxiliary
434 def ParseSketcherCommand(command):
437 sections = command.split(":")
438 for section in sections:
439 parameters = section.split(" ")
441 for parameter in parameters:
442 if paramIndex > 1 and parameter.find("'") != -1:
443 parameter = parameter.replace("'","")
444 if notebook.isVariable(parameter):
445 Result = Result + str(notebook.get(parameter)) + " "
448 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
452 Result = Result + str(parameter) + " "
455 StringResult = StringResult + parameter
456 StringResult = StringResult + ":"
458 paramIndex = paramIndex + 1
460 Result = Result[:len(Result)-1] + ":"
462 Result = Result[:len(Result)-1]
463 return Result, StringResult
465 ## Helper function which can be used to pack the passed string to the byte data.
466 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
467 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
470 ## val = PackData("10001110") # val = 0xAE
471 ## val = PackData("1") # val = 0x80
473 ## @param data unpacked data - a string containing '1' and '0' symbols
474 ## @return data packed to the byte stream
475 ## @ingroup l1_geomBuilder_auxiliary
478 Helper function which can be used to pack the passed string to the byte data.
479 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
480 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
483 data unpacked data - a string containing '1' and '0' symbols
486 data packed to the byte stream
489 val = PackData("10001110") # val = 0xAE
490 val = PackData("1") # val = 0x80
493 if len(data)%8: bytes += 1
495 for b in range(bytes):
496 d = data[b*8:(b+1)*8]
501 if d[i] == "1": val += 1
503 raise "Invalid symbol %s" % d[i]
510 ## Read bitmap texture from the text file.
511 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
512 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
513 ## The function returns width and height of the pixmap in pixels and byte stream representing
514 ## texture bitmap itself.
516 ## This function can be used to read the texture to the byte stream in order to pass it to
517 ## the AddTexture() function of geomBuilder class.
520 ## from salome.geom import geomBuilder
521 ## geompy = geomBuilder.New()
522 ## texture = geompy.readtexture('mytexture.dat')
523 ## texture = geompy.AddTexture(*texture)
524 ## obj.SetMarkerTexture(texture)
526 ## @param fname texture file name
527 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
528 ## @ingroup l1_geomBuilder_auxiliary
529 def ReadTexture(fname):
531 Read bitmap texture from the text file.
532 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
533 A zero symbol ('0') represents transparent pixel of the texture bitmap.
534 The function returns width and height of the pixmap in pixels and byte stream representing
535 texture bitmap itself.
536 This function can be used to read the texture to the byte stream in order to pass it to
537 the AddTexture() function of geomBuilder class.
540 fname texture file name
543 sequence of tree values: texture's width, height in pixels and its byte stream
546 from salome.geom import geomBuilder
547 geompy = geomBuilder.New()
548 texture = geompy.readtexture('mytexture.dat')
549 texture = geompy.AddTexture(*texture)
550 obj.SetMarkerTexture(texture)
554 lines = [ l.strip() for l in f.readlines()]
557 if lines: maxlen = max([len(x) for x in lines])
559 if maxlen%8: lenbytes += 1
563 lenline = (len(line)/8+1)*8
566 lenline = (len(line)/8)*8
568 for i in range(lenline/8):
571 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
574 bytedata += PackData(byte)
576 for i in range(lenline/8, lenbytes):
577 bytedata += PackData("0")
579 return lenbytes*8, len(lines), bytedata
584 ## Returns a long value from enumeration type
585 # Can be used for CORBA enumerator types like GEOM.shape_type
586 # @param theItem enumeration type
587 # @ingroup l1_geomBuilder_auxiliary
588 def EnumToLong(theItem):
590 Returns a long value from enumeration type
591 Can be used for CORBA enumerator types like geomBuilder.ShapeType
594 theItem enumeration type
597 if hasattr(theItem, "_v"): ret = theItem._v
600 ## Pack an argument into a list
602 if isinstance( arg, list ):
604 if hasattr( arg, "__getitem__" ):
608 ## Information about closed/unclosed state of shell or wire
609 # @ingroup l1_geomBuilder_auxiliary
612 Information about closed/unclosed state of shell or wire
618 ## Private class used to bind calls of plugin operations to geomBuilder
619 class PluginOperation:
620 def __init__(self, operation, function):
621 self.operation = operation
622 self.function = function
625 @ManageTransactions("operation")
626 def __call__(self, *args):
627 res = self.function(self.operation, *args)
628 RaiseIfFailed(self.function.__name__, self.operation)
631 # Warning: geom is a singleton
637 class geomBuilder(GEOM._objref_GEOM_Gen):
639 ## Enumeration ShapeType as a dictionary. \n
640 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
641 # @ingroup l1_geomBuilder_auxiliary
642 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
644 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
645 # and a list of parameters, describing the shape.
646 # List of parameters, describing the shape:
647 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
648 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
650 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
652 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
654 # - SPHERE: [xc yc zc R]
655 # - CYLINDER: [xb yb zb dx dy dz R H]
656 # - BOX: [xc yc zc ax ay az]
657 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
658 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
659 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
660 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
661 # - SOLID: [nb_faces nb_edges nb_vertices]
663 # - SPHERE2D: [xc yc zc R]
664 # - CYLINDER2D: [xb yb zb dx dy dz R H]
665 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
666 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
667 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
668 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
669 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
670 # - PLANE: [xo yo zo dx dy dz]
671 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
672 # - FACE: [nb_edges nb_vertices]
674 # - CIRCLE: [xc yc zc dx dy dz R]
675 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
676 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
677 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
678 # - LINE: [xo yo zo dx dy dz]
679 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
680 # - EDGE: [nb_vertices]
684 # - LCS: [x y z xx xy xz yx yy yz zx zy zz]
685 # @ingroup l1_geomBuilder_auxiliary
686 kind = GEOM.GEOM_IKindOfShape
688 def __new__(cls, *args):
693 #print "==== __new__ ", engine, geom, doLcc, created
695 # geom engine is either retrieved from engine, or created
697 # Following test avoids a recursive loop
700 # geom engine not created: existing engine found
702 if doLcc and not created:
704 # FindOrLoadComponent called:
705 # 1. CORBA resolution of server
706 # 2. the __new__ method is called again
707 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
708 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
711 # FindOrLoadComponent not called
713 # geomBuilder instance is created from lcc.FindOrLoadComponent
714 #print "==== super ", engine, geom, doLcc, created
715 geom = super(geomBuilder,cls).__new__(cls)
718 # geom engine not created: existing engine found
719 #print "==== existing ", engine, geom, doLcc, created
721 #print "return geom 1 ", geom
724 #print "return geom 2 ", geom
727 def __init__(self, *args):
729 #print "-------- geomBuilder __init__ --- ", created, self
732 GEOM._objref_GEOM_Gen.__init__(self, *args)
733 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
734 self.myBuilder = None
752 ## Process object publication in the study, as follows:
753 # - if @a theName is specified (not None), the object is published in the study
754 # with this name, not taking into account "auto-publishing" option;
755 # - if @a theName is NOT specified, the object is published in the study
756 # (using default name, which can be customized using @a theDefaultName parameter)
757 # only if auto-publishing is switched on.
759 # @param theObj object, a subject for publishing
760 # @param theName object name for study
761 # @param theDefaultName default name for the auto-publishing
763 # @sa addToStudyAuto()
764 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
766 def _item_name(_names, _defname, _idx=-1):
767 if not _names: _names = _defname
768 if type(_names) in [list, tuple]:
770 if _idx >= len(_names) or not _names[_idx]:
771 if type(_defname) not in [list, tuple]:
772 _name = "%s_%d"%(_defname, _idx+1)
773 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
774 _name = _defname[_idx]
776 _name = "%noname_%d"%(dn, _idx+1)
782 # must be wrong usage
787 _name = "%s_%d"%(_names, _idx+1)
793 def _publish( _name, _obj ):
795 if isinstance( _obj, GEOM._objref_GEOM_Field ):
796 fatherObj = _obj.GetShape()
797 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
798 fatherObj = _obj.GetField()
799 elif not _obj.IsMainShape():
800 fatherObj = _obj.GetMainShape()
802 if fatherObj and fatherObj.GetStudyEntry():
803 self.addToStudyInFather(fatherObj, _obj, _name)
805 self.addToStudy(_obj, _name)
811 if not theName and not self.myMaxNbSubShapesAllowed:
812 return # nothing to do: auto-publishing is disabled
813 if not theName and not theDefaultName:
814 return # neither theName nor theDefaultName is given
816 if type(theObj) in [list, tuple]:
817 # list of objects is being published
820 if not obj: continue # bad object
821 name = _item_name(theName, theDefaultName, idx)
822 _publish( name, obj )
824 if not theName and idx == self.myMaxNbSubShapesAllowed: break
828 # single object is published
829 name = _item_name(theName, theDefaultName)
830 _publish( name, theObj )
833 ## @addtogroup l1_geomBuilder_auxiliary
836 self.myStudy = salome.myStudy
837 self.myBuilder = self.myStudy.NewBuilder()
838 self.father = self.myStudy.FindComponent("GEOM")
839 notebook.myStudy = salome.myStudy
840 if self.father is None:
841 self.father = self.myBuilder.NewComponent("GEOM")
842 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
843 FName = A1._narrow(SALOMEDS.AttributeName)
844 FName.SetValue("Geometry")
845 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
846 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
847 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
848 self.myBuilder.DefineComponentInstance(self.father,self)
850 self.BasicOp = self.GetIBasicOperations ()
851 self.CurvesOp = self.GetICurvesOperations ()
852 self.PrimOp = self.GetI3DPrimOperations ()
853 self.ShapesOp = self.GetIShapesOperations ()
854 self.HealOp = self.GetIHealingOperations ()
855 self.InsertOp = self.GetIInsertOperations ()
856 self.BoolOp = self.GetIBooleanOperations ()
857 self.TrsfOp = self.GetITransformOperations()
858 self.LocalOp = self.GetILocalOperations ()
859 self.MeasuOp = self.GetIMeasureOperations ()
860 self.BlocksOp = self.GetIBlocksOperations ()
861 self.GroupOp = self.GetIGroupOperations ()
862 self.FieldOp = self.GetIFieldOperations ()
864 # set GEOM as root in the use case tree
865 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
866 self.myUseCaseBuilder.SetRootCurrent()
867 self.myUseCaseBuilder.Append(self.father)
869 # load data from the study file, if necessary
870 self.myBuilder.LoadWith(self.father, self)
873 def GetPluginOperations(self, libraryName):
874 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
877 ## Enable / disable results auto-publishing
879 # The automatic publishing is managed in the following way:
880 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
881 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
882 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
883 # value passed as parameter has the same effect.
884 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
885 # maximum number of sub-shapes allowed for publishing is set to specified value.
887 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
888 # @ingroup l1_publish_data
889 def addToStudyAuto(self, maxNbSubShapes=-1):
891 Enable / disable results auto-publishing
893 The automatic publishing is managed in the following way:
894 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
895 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
896 maximum number of sub-shapes allowed for publishing is unlimited; any negative
897 value passed as parameter has the same effect.
898 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
899 maximum number of sub-shapes allowed for publishing is set to this value.
902 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
905 geompy.addToStudyAuto() # enable auto-publishing
906 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
907 geompy.addToStudyAuto(0) # disable auto-publishing
909 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
912 ## Dump component to the Python script
913 # This method overrides IDL function to allow default values for the parameters.
914 def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
916 Dump component to the Python script
917 This method overrides IDL function to allow default values for the parameters.
919 return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
921 ## Get name for sub-shape aSubObj of shape aMainObj
923 # @ref swig_SubShapeName "Example"
924 @ManageTransactions("ShapesOp")
925 def SubShapeName(self,aSubObj, aMainObj):
927 Get name for sub-shape aSubObj of shape aMainObj
929 # Example: see GEOM_TestAll.py
931 #aSubId = orb.object_to_string(aSubObj)
932 #aMainId = orb.object_to_string(aMainObj)
933 #index = gg.getIndexTopology(aSubId, aMainId)
934 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
935 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
936 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
939 ## Publish in study aShape with name aName
941 # \param aShape the shape to be published
942 # \param aName the name for the shape
943 # \param doRestoreSubShapes if True, finds and publishes also
944 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
945 # and published sub-shapes of arguments
946 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
947 # these arguments description
948 # \return study entry of the published shape in form of string
950 # @ingroup l1_publish_data
951 # @ref swig_all_addtostudy "Example"
952 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
953 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
955 Publish in study aShape with name aName
958 aShape the shape to be published
959 aName the name for the shape
960 doRestoreSubShapes if True, finds and publishes also
961 sub-shapes of aShape, corresponding to its arguments
962 and published sub-shapes of arguments
963 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
964 these arguments description
967 study entry of the published shape in form of string
970 id_block1 = geompy.addToStudy(Block1, "Block 1")
972 # Example: see GEOM_TestAll.py
974 aSObject = self.AddInStudy(aShape, aName, None)
975 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
976 if doRestoreSubShapes:
977 self.RestoreSubShapesSO(aSObject, theArgs,
978 theFindMethod, theInheritFirstArg, True )
980 print("addToStudy() failed")
982 return aShape.GetStudyEntry()
984 ## Publish in study aShape with name aName as sub-object of previously published aFather
985 # \param aFather previously published object
986 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
987 # \param aName the name for the shape
989 # \return study entry of the published shape in form of string
991 # @ingroup l1_publish_data
992 # @ref swig_all_addtostudyInFather "Example"
993 def addToStudyInFather(self, aFather, aShape, aName):
995 Publish in study aShape with name aName as sub-object of previously published aFather
998 aFather previously published object
999 aShape the shape to be published as sub-object of aFather
1000 aName the name for the shape
1003 study entry of the published shape in form of string
1005 # Example: see GEOM_TestAll.py
1007 aSObject = self.AddInStudy(aShape, aName, aFather)
1008 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
1010 print("addToStudyInFather() failed")
1012 return aShape.GetStudyEntry()
1014 ## Unpublish object in study
1016 # \param obj the object to be unpublished
1017 def hideInStudy(self, obj):
1019 Unpublish object in study
1022 obj the object to be unpublished
1024 ior = salome.orb.object_to_string(obj)
1025 aSObject = self.myStudy.FindObjectIOR(ior)
1026 if aSObject is not None:
1027 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1028 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1029 drwAttribute.SetDrawable(False)
1030 # hide references if any
1031 vso = self.myStudy.FindDependances(aSObject);
1033 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1034 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1035 drwAttribute.SetDrawable(False)
1039 # end of l1_geomBuilder_auxiliary
1042 ## @addtogroup l3_restore_ss
1045 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1046 # To be used from python scripts out of addToStudy() (non-default usage)
1047 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1048 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1049 # If this list is empty, all operation arguments will be published
1050 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1051 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
1052 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1053 # Do not publish sub-shapes in place of arguments, but only
1054 # in place of sub-shapes of the first argument,
1055 # because the whole shape corresponds to the first argument.
1056 # Mainly to be used after transformations, but it also can be
1057 # useful after partition with one object shape, and some other
1058 # operations, where only the first argument has to be considered.
1059 # If theObject has only one argument shape, this flag is automatically
1060 # considered as True, not regarding really passed value.
1061 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1062 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1063 # \return list of published sub-shapes
1065 # @ref tui_restore_prs_params "Example"
1066 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1067 theInheritFirstArg=False, theAddPrefix=True):
1069 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1070 To be used from python scripts out of geompy.addToStudy (non-default usage)
1073 theObject published GEOM.GEOM_Object, arguments of which will be published
1074 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1075 If this list is empty, all operation arguments will be published
1076 theFindMethod method to search sub-shapes, corresponding to arguments and
1077 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1078 theInheritFirstArg set properties of the first argument for theObject.
1079 Do not publish sub-shapes in place of arguments, but only
1080 in place of sub-shapes of the first argument,
1081 because the whole shape corresponds to the first argument.
1082 Mainly to be used after transformations, but it also can be
1083 useful after partition with one object shape, and some other
1084 operations, where only the first argument has to be considered.
1085 If theObject has only one argument shape, this flag is automatically
1086 considered as True, not regarding really passed value.
1087 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1088 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1090 list of published sub-shapes
1092 # Example: see GEOM_TestAll.py
1093 return self.RestoreSubShapesO(theObject, theArgs,
1094 theFindMethod, theInheritFirstArg, theAddPrefix)
1096 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1097 # To be used from python scripts out of addToStudy() (non-default usage)
1098 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1099 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1100 # If this list is empty, all operation arguments will be published
1101 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1102 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1103 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1104 # Do not publish sub-shapes in place of arguments, but only
1105 # in place of sub-shapes of the first argument,
1106 # because the whole shape corresponds to the first argument.
1107 # Mainly to be used after transformations, but it also can be
1108 # useful after partition with one object shape, and some other
1109 # operations, where only the first argument has to be considered.
1110 # If theObject has only one argument shape, this flag is automatically
1111 # considered as True, not regarding really passed value.
1112 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1113 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1114 # \return list of published sub-shapes
1116 # @ref tui_restore_prs_params "Example"
1117 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1118 theInheritFirstArg=False, theAddPrefix=True):
1120 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1121 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1124 theObject published GEOM.GEOM_Object, arguments of which will be published
1125 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1126 If this list is empty, all operation arguments will be published
1127 theFindMethod method to search sub-shapes, corresponding to arguments and
1128 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1129 theInheritFirstArg set properties of the first argument for theObject.
1130 Do not publish sub-shapes in place of arguments, but only
1131 in place of sub-shapes of the first argument,
1132 because the whole shape corresponds to the first argument.
1133 Mainly to be used after transformations, but it also can be
1134 useful after partition with one object shape, and some other
1135 operations, where only the first argument has to be considered.
1136 If theObject has only one argument shape, this flag is automatically
1137 considered as True, not regarding really passed value.
1138 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1139 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1142 list of published sub-shapes
1144 # Example: see GEOM_TestAll.py
1145 return self.RestoreGivenSubShapesO(theObject, theArgs,
1146 theFindMethod, theInheritFirstArg, theAddPrefix)
1148 # end of l3_restore_ss
1151 ## @addtogroup l3_basic_go
1154 ## Create point by three coordinates.
1155 # @param theX The X coordinate of the point.
1156 # @param theY The Y coordinate of the point.
1157 # @param theZ The Z coordinate of the point.
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 MakeVertex(self, theX, theY, theZ, theName=None):
1168 Create point by three coordinates.
1171 theX The X coordinate of the point.
1172 theY The Y coordinate of the point.
1173 theZ The Z coordinate of the point.
1174 theName Object name; when specified, this parameter is used
1175 for result publication in the study. Otherwise, if automatic
1176 publication is switched on, default value is used for result name.
1179 New GEOM.GEOM_Object, containing the created point.
1181 # Example: see GEOM_TestAll.py
1182 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1183 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1184 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1185 anObj.SetParameters(Parameters)
1186 self._autoPublish(anObj, theName, "vertex")
1189 ## Create a point, distant from the referenced point
1190 # on the given distances along the coordinate axes.
1191 # @param theReference The referenced point.
1192 # @param theX Displacement from the referenced point along OX axis.
1193 # @param theY Displacement from the referenced point along OY axis.
1194 # @param theZ Displacement from the referenced point along OZ axis.
1195 # @param theName Object name; when specified, this parameter is used
1196 # for result publication in the study. Otherwise, if automatic
1197 # publication is switched on, default value is used for result name.
1199 # @return New GEOM.GEOM_Object, containing the created point.
1201 # @ref tui_creation_point "Example"
1202 @ManageTransactions("BasicOp")
1203 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1205 Create a point, distant from the referenced point
1206 on the given distances along the coordinate axes.
1209 theReference The referenced point.
1210 theX Displacement from the referenced point along OX axis.
1211 theY Displacement from the referenced point along OY axis.
1212 theZ Displacement from the referenced point along OZ axis.
1213 theName Object name; when specified, this parameter is used
1214 for result publication in the study. Otherwise, if automatic
1215 publication is switched on, default value is used for result name.
1218 New GEOM.GEOM_Object, containing the created point.
1220 # Example: see GEOM_TestAll.py
1221 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1222 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1223 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1224 anObj.SetParameters(Parameters)
1225 self._autoPublish(anObj, theName, "vertex")
1228 ## Create a point, corresponding to the given parameter on the given curve.
1229 # @param theRefCurve The referenced curve.
1230 # @param theParameter Value of parameter on the referenced curve.
1231 # @param takeOrientationIntoAccount flag that tells if it is necessary
1232 # to take the curve's orientation into account for the
1233 # operation. I.e. if this flag is set, the results for the same
1234 # parameters (except the value 0.5) is different for forward
1235 # and reversed curves. If it is not set the result is the same.
1236 # @param theName Object name; when specified, this parameter is used
1237 # for result publication in the study. Otherwise, if automatic
1238 # publication is switched on, default value is used for result name.
1240 # @return New GEOM.GEOM_Object, containing the created point.
1242 # @ref tui_creation_point "Example"
1243 @ManageTransactions("BasicOp")
1244 def MakeVertexOnCurve(self, theRefCurve, theParameter,
1245 takeOrientationIntoAccount=False, theName=None):
1247 Create a point, corresponding to the given parameter on the given curve.
1250 theRefCurve The referenced curve.
1251 theParameter Value of parameter on the referenced curve.
1252 takeOrientationIntoAccount flag that tells if it is necessary
1253 to take the curve's orientation into account for the
1254 operation. I.e. if this flag is set, the results for
1255 the same parameters (except the value 0.5) is different
1256 for forward and reversed curves. If it is not set
1257 the result is the same.
1258 theName Object name; when specified, this parameter is used
1259 for result publication in the study. Otherwise, if automatic
1260 publication is switched on, default value is used for result name.
1263 New GEOM.GEOM_Object, containing the created point.
1266 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1268 # Example: see GEOM_TestAll.py
1269 theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1270 theParameter, takeOrientationIntoAccount)
1271 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1272 takeOrientationIntoAccount)
1273 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1274 anObj.SetParameters(Parameters)
1275 self._autoPublish(anObj, theName, "vertex")
1278 ## Create a point by projection give coordinates on the given curve
1279 # @param theRefCurve The referenced curve.
1280 # @param theX X-coordinate in 3D space
1281 # @param theY Y-coordinate in 3D space
1282 # @param theZ Z-coordinate in 3D space
1283 # @param theName Object name; when specified, this parameter is used
1284 # for result publication in the study. Otherwise, if automatic
1285 # publication is switched on, default value is used for result name.
1287 # @return New GEOM.GEOM_Object, containing the created point.
1289 # @ref tui_creation_point "Example"
1290 @ManageTransactions("BasicOp")
1291 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1293 Create a point by projection give coordinates on the given curve
1296 theRefCurve The referenced curve.
1297 theX X-coordinate in 3D space
1298 theY Y-coordinate in 3D space
1299 theZ Z-coordinate in 3D space
1300 theName Object name; when specified, this parameter is used
1301 for result publication in the study. Otherwise, if automatic
1302 publication is switched on, default value is used for result name.
1305 New GEOM.GEOM_Object, containing the created point.
1308 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1310 # Example: see GEOM_TestAll.py
1311 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1312 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1313 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1314 anObj.SetParameters(Parameters)
1315 self._autoPublish(anObj, theName, "vertex")
1318 ## Create a point, corresponding to the given length on the given curve.
1319 # @param theRefCurve The referenced curve.
1320 # @param theLength Length on the referenced curve. It can be negative.
1321 # @param theStartPoint Point allowing to choose the direction for the calculation
1322 # of the length. If None, start from the first point of theRefCurve.
1323 # @param theName Object name; when specified, this parameter is used
1324 # for result publication in the study. Otherwise, if automatic
1325 # publication is switched on, default value is used for result name.
1327 # @return New GEOM.GEOM_Object, containing the created point.
1329 # @ref tui_creation_point "Example"
1330 @ManageTransactions("BasicOp")
1331 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1333 Create a point, corresponding to the given length on the given curve.
1336 theRefCurve The referenced curve.
1337 theLength Length on the referenced curve. It can be negative.
1338 theStartPoint Point allowing to choose the direction for the calculation
1339 of the length. If None, start from the first point of theRefCurve.
1340 theName Object name; when specified, this parameter is used
1341 for result publication in the study. Otherwise, if automatic
1342 publication is switched on, default value is used for result name.
1345 New GEOM.GEOM_Object, containing the created point.
1347 # Example: see GEOM_TestAll.py
1348 theLength, Parameters = ParseParameters(theLength)
1349 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1350 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1351 anObj.SetParameters(Parameters)
1352 self._autoPublish(anObj, theName, "vertex")
1355 ## Create a point, corresponding to the given parameters on the
1357 # @param theRefSurf The referenced surface.
1358 # @param theUParameter Value of U-parameter on the referenced surface.
1359 # @param theVParameter Value of V-parameter on the referenced surface.
1360 # @param theName Object name; when specified, this parameter is used
1361 # for result publication in the study. Otherwise, if automatic
1362 # publication is switched on, default value is used for result name.
1364 # @return New GEOM.GEOM_Object, containing the created point.
1366 # @ref swig_MakeVertexOnSurface "Example"
1367 @ManageTransactions("BasicOp")
1368 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1370 Create a point, corresponding to the given parameters on the
1374 theRefSurf The referenced surface.
1375 theUParameter Value of U-parameter on the referenced surface.
1376 theVParameter Value of V-parameter on the referenced surface.
1377 theName Object name; when specified, this parameter is used
1378 for result publication in the study. Otherwise, if automatic
1379 publication is switched on, default value is used for result name.
1382 New GEOM.GEOM_Object, containing the created point.
1385 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1387 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1388 # Example: see GEOM_TestAll.py
1389 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1390 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1391 anObj.SetParameters(Parameters);
1392 self._autoPublish(anObj, theName, "vertex")
1395 ## Create a point by projection give coordinates on the given surface
1396 # @param theRefSurf The referenced surface.
1397 # @param theX X-coordinate in 3D space
1398 # @param theY Y-coordinate in 3D space
1399 # @param theZ Z-coordinate in 3D space
1400 # @param theName Object name; when specified, this parameter is used
1401 # for result publication in the study. Otherwise, if automatic
1402 # publication is switched on, default value is used for result name.
1404 # @return New GEOM.GEOM_Object, containing the created point.
1406 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1407 @ManageTransactions("BasicOp")
1408 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1410 Create a point by projection give coordinates on the given surface
1413 theRefSurf The referenced surface.
1414 theX X-coordinate in 3D space
1415 theY Y-coordinate in 3D space
1416 theZ Z-coordinate in 3D space
1417 theName Object name; when specified, this parameter is used
1418 for result publication in the study. Otherwise, if automatic
1419 publication is switched on, default value is used for result name.
1422 New GEOM.GEOM_Object, containing the created point.
1425 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1427 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1428 # Example: see GEOM_TestAll.py
1429 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1430 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1431 anObj.SetParameters(Parameters);
1432 self._autoPublish(anObj, theName, "vertex")
1435 ## Create a point, which lays on the given face.
1436 # The point will lay in arbitrary place of the face.
1437 # The only condition on it is a non-zero distance to the face boundary.
1438 # Such point can be used to uniquely identify the face inside any
1439 # shape in case, when the shape does not contain overlapped faces.
1440 # @param theFace The referenced face.
1441 # @param theName Object name; when specified, this parameter is used
1442 # for result publication in the study. Otherwise, if automatic
1443 # publication is switched on, default value is used for result name.
1445 # @return New GEOM.GEOM_Object, containing the created point.
1447 # @ref swig_MakeVertexInsideFace "Example"
1448 @ManageTransactions("BasicOp")
1449 def MakeVertexInsideFace (self, theFace, theName=None):
1451 Create a point, which lays on the given face.
1452 The point will lay in arbitrary place of the face.
1453 The only condition on it is a non-zero distance to the face boundary.
1454 Such point can be used to uniquely identify the face inside any
1455 shape in case, when the shape does not contain overlapped faces.
1458 theFace The referenced face.
1459 theName Object name; when specified, this parameter is used
1460 for result publication in the study. Otherwise, if automatic
1461 publication is switched on, default value is used for result name.
1464 New GEOM.GEOM_Object, containing the created point.
1467 p_on_face = geompy.MakeVertexInsideFace(Face)
1469 # Example: see GEOM_TestAll.py
1470 anObj = self.BasicOp.MakePointOnFace(theFace)
1471 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1472 self._autoPublish(anObj, theName, "vertex")
1475 ## Create a point on intersection of two lines.
1476 # @param theRefLine1, theRefLine2 The referenced lines.
1477 # @param theName Object name; when specified, this parameter is used
1478 # for result publication in the study. Otherwise, if automatic
1479 # publication is switched on, default value is used for result name.
1481 # @return New GEOM.GEOM_Object, containing the created point.
1483 # @ref swig_MakeVertexOnLinesIntersection "Example"
1484 @ManageTransactions("BasicOp")
1485 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1487 Create a point on intersection of two lines.
1490 theRefLine1, theRefLine2 The referenced lines.
1491 theName Object name; when specified, this parameter is used
1492 for result publication in the study. Otherwise, if automatic
1493 publication is switched on, default value is used for result name.
1496 New GEOM.GEOM_Object, containing the created point.
1498 # Example: see GEOM_TestAll.py
1499 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1500 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1501 self._autoPublish(anObj, theName, "vertex")
1504 ## Create a tangent, corresponding to the given parameter on the given curve.
1505 # @param theRefCurve The referenced curve.
1506 # @param theParameter Value of parameter on the referenced curve.
1507 # @param theName Object name; when specified, this parameter is used
1508 # for result publication in the study. Otherwise, if automatic
1509 # publication is switched on, default value is used for result name.
1511 # @return New GEOM.GEOM_Object, containing the created tangent.
1513 # @ref swig_MakeTangentOnCurve "Example"
1514 @ManageTransactions("BasicOp")
1515 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1517 Create a tangent, corresponding to the given parameter on the given curve.
1520 theRefCurve The referenced curve.
1521 theParameter Value of parameter on the referenced curve.
1522 theName Object name; when specified, this parameter is used
1523 for result publication in the study. Otherwise, if automatic
1524 publication is switched on, default value is used for result name.
1527 New GEOM.GEOM_Object, containing the created tangent.
1530 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1532 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1533 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1534 self._autoPublish(anObj, theName, "tangent")
1537 ## Create a tangent plane, corresponding to the given parameter on the given face.
1538 # @param theFace The face for which tangent plane should be built.
1539 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1540 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1541 # @param theTrimSize the size of plane.
1542 # @param theName Object name; when specified, this parameter is used
1543 # for result publication in the study. Otherwise, if automatic
1544 # publication is switched on, default value is used for result name.
1546 # @return New GEOM.GEOM_Object, containing the created tangent.
1548 # @ref swig_MakeTangentPlaneOnFace "Example"
1549 @ManageTransactions("BasicOp")
1550 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1552 Create a tangent plane, corresponding to the given parameter on the given face.
1555 theFace The face for which tangent plane should be built.
1556 theParameterV vertical value of the center point (0.0 - 1.0).
1557 theParameterU horisontal value of the center point (0.0 - 1.0).
1558 theTrimSize the size of plane.
1559 theName Object name; when specified, this parameter is used
1560 for result publication in the study. Otherwise, if automatic
1561 publication is switched on, default value is used for result name.
1564 New GEOM.GEOM_Object, containing the created tangent.
1567 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1569 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1570 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1571 self._autoPublish(anObj, theName, "tangent")
1574 ## Create a vector with the given components.
1575 # @param theDX X component of the vector.
1576 # @param theDY Y component of the vector.
1577 # @param theDZ Z component of the vector.
1578 # @param theName Object name; when specified, this parameter is used
1579 # for result publication in the study. Otherwise, if automatic
1580 # publication is switched on, default value is used for result name.
1582 # @return New GEOM.GEOM_Object, containing the created vector.
1584 # @ref tui_creation_vector "Example"
1585 @ManageTransactions("BasicOp")
1586 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1588 Create a vector with the given components.
1591 theDX X component of the vector.
1592 theDY Y component of the vector.
1593 theDZ Z component of the vector.
1594 theName Object name; when specified, this parameter is used
1595 for result publication in the study. Otherwise, if automatic
1596 publication is switched on, default value is used for result name.
1599 New GEOM.GEOM_Object, containing the created vector.
1601 # Example: see GEOM_TestAll.py
1602 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1603 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1604 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1605 anObj.SetParameters(Parameters)
1606 self._autoPublish(anObj, theName, "vector")
1609 ## Create a vector between two points.
1610 # @param thePnt1 Start point for the vector.
1611 # @param thePnt2 End point for the vector.
1612 # @param theName Object name; when specified, this parameter is used
1613 # for result publication in the study. Otherwise, if automatic
1614 # publication is switched on, default value is used for result name.
1616 # @return New GEOM.GEOM_Object, containing the created vector.
1618 # @ref tui_creation_vector "Example"
1619 @ManageTransactions("BasicOp")
1620 def MakeVector(self, thePnt1, thePnt2, theName=None):
1622 Create a vector between two points.
1625 thePnt1 Start point for the vector.
1626 thePnt2 End point for the vector.
1627 theName Object name; when specified, this parameter is used
1628 for result publication in the study. Otherwise, if automatic
1629 publication is switched on, default value is used for result name.
1632 New GEOM.GEOM_Object, containing the created vector.
1634 # Example: see GEOM_TestAll.py
1635 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1636 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1637 self._autoPublish(anObj, theName, "vector")
1640 ## Create a line, passing through the given point
1641 # and parallel to the given direction
1642 # @param thePnt Point. The resulting line will pass through it.
1643 # @param theDir Direction. The resulting line will be parallel to it.
1644 # @param 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.
1648 # @return New GEOM.GEOM_Object, containing the created line.
1650 # @ref tui_creation_line "Example"
1651 @ManageTransactions("BasicOp")
1652 def MakeLine(self, thePnt, theDir, theName=None):
1654 Create a line, passing through the given point
1655 and parallel to the given direction
1658 thePnt Point. The resulting line will pass through it.
1659 theDir Direction. The resulting line will be parallel to it.
1660 theName Object name; when specified, this parameter is used
1661 for result publication in the study. Otherwise, if automatic
1662 publication is switched on, default value is used for result name.
1665 New GEOM.GEOM_Object, containing the created line.
1667 # Example: see GEOM_TestAll.py
1668 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1669 RaiseIfFailed("MakeLine", self.BasicOp)
1670 self._autoPublish(anObj, theName, "line")
1673 ## Create a line, passing through the given points
1674 # @param thePnt1 First of two points, defining the line.
1675 # @param thePnt2 Second of two points, defining the line.
1676 # @param theName Object name; when specified, this parameter is used
1677 # for result publication in the study. Otherwise, if automatic
1678 # publication is switched on, default value is used for result name.
1680 # @return New GEOM.GEOM_Object, containing the created line.
1682 # @ref tui_creation_line "Example"
1683 @ManageTransactions("BasicOp")
1684 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1686 Create a line, passing through the given points
1689 thePnt1 First of two points, defining the line.
1690 thePnt2 Second of two points, defining the line.
1691 theName Object name; when specified, this parameter is used
1692 for result publication in the study. Otherwise, if automatic
1693 publication is switched on, default value is used for result name.
1696 New GEOM.GEOM_Object, containing the created line.
1698 # Example: see GEOM_TestAll.py
1699 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1700 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1701 self._autoPublish(anObj, theName, "line")
1704 ## Create a line on two faces intersection.
1705 # @param theFace1 First of two faces, defining the line.
1706 # @param theFace2 Second of two faces, defining the line.
1707 # @param theName Object name; when specified, this parameter is used
1708 # for result publication in the study. Otherwise, if automatic
1709 # publication is switched on, default value is used for result name.
1711 # @return New GEOM.GEOM_Object, containing the created line.
1713 # @ref swig_MakeLineTwoFaces "Example"
1714 @ManageTransactions("BasicOp")
1715 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1717 Create a line on two faces intersection.
1720 theFace1 First of two faces, defining the line.
1721 theFace2 Second of two faces, defining the line.
1722 theName Object name; when specified, this parameter is used
1723 for result publication in the study. Otherwise, if automatic
1724 publication is switched on, default value is used for result name.
1727 New GEOM.GEOM_Object, containing the created line.
1729 # Example: see GEOM_TestAll.py
1730 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1731 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1732 self._autoPublish(anObj, theName, "line")
1735 ## Create a plane, passing through the given point
1736 # and normal to the given vector.
1737 # @param thePnt Point, the plane has to pass through.
1738 # @param theVec Vector, defining the plane normal direction.
1739 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1740 # @param theName Object name; when specified, this parameter is used
1741 # for result publication in the study. Otherwise, if automatic
1742 # publication is switched on, default value is used for result name.
1744 # @return New GEOM.GEOM_Object, containing the created plane.
1746 # @ref tui_creation_plane "Example"
1747 @ManageTransactions("BasicOp")
1748 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1750 Create a plane, passing through the given point
1751 and normal to the given vector.
1754 thePnt Point, the plane has to pass through.
1755 theVec Vector, defining the plane normal direction.
1756 theTrimSize Half size of a side of quadrangle face, representing the plane.
1757 theName Object name; when specified, this parameter is used
1758 for result publication in the study. Otherwise, if automatic
1759 publication is switched on, default value is used for result name.
1762 New GEOM.GEOM_Object, containing the created plane.
1764 # Example: see GEOM_TestAll.py
1765 theTrimSize, Parameters = ParseParameters(theTrimSize);
1766 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1767 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1768 anObj.SetParameters(Parameters)
1769 self._autoPublish(anObj, theName, "plane")
1772 ## Create a plane, passing through the three given points
1773 # @param thePnt1 First of three points, defining the plane.
1774 # @param thePnt2 Second of three points, defining the plane.
1775 # @param thePnt3 Fird of three points, defining the plane.
1776 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1777 # @param theName Object name; when specified, this parameter is used
1778 # for result publication in the study. Otherwise, if automatic
1779 # publication is switched on, default value is used for result name.
1781 # @return New GEOM.GEOM_Object, containing the created plane.
1783 # @ref tui_creation_plane "Example"
1784 @ManageTransactions("BasicOp")
1785 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1787 Create a plane, passing through the three given points
1790 thePnt1 First of three points, defining the plane.
1791 thePnt2 Second of three points, defining the plane.
1792 thePnt3 Fird of three points, defining the plane.
1793 theTrimSize Half size of a side of quadrangle face, representing the plane.
1794 theName Object name; when specified, this parameter is used
1795 for result publication in the study. Otherwise, if automatic
1796 publication is switched on, default value is used for result name.
1799 New GEOM.GEOM_Object, containing the created plane.
1801 # Example: see GEOM_TestAll.py
1802 theTrimSize, Parameters = ParseParameters(theTrimSize);
1803 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1804 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1805 anObj.SetParameters(Parameters)
1806 self._autoPublish(anObj, theName, "plane")
1809 ## Create a plane, similar to the existing one, but with another size of representing face.
1810 # @param theFace Referenced plane or LCS(Marker).
1811 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1812 # @param theName Object name; when specified, this parameter is used
1813 # for result publication in the study. Otherwise, if automatic
1814 # publication is switched on, default value is used for result name.
1816 # @return New GEOM.GEOM_Object, containing the created plane.
1818 # @ref tui_creation_plane "Example"
1819 @ManageTransactions("BasicOp")
1820 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1822 Create a plane, similar to the existing one, but with another size of representing face.
1825 theFace Referenced plane or LCS(Marker).
1826 theTrimSize New half size of a side of quadrangle face, representing the plane.
1827 theName Object name; when specified, this parameter is used
1828 for result publication in the study. Otherwise, if automatic
1829 publication is switched on, default value is used for result name.
1832 New GEOM.GEOM_Object, containing the created plane.
1834 # Example: see GEOM_TestAll.py
1835 theTrimSize, Parameters = ParseParameters(theTrimSize);
1836 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1837 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1838 anObj.SetParameters(Parameters)
1839 self._autoPublish(anObj, theName, "plane")
1842 ## Create a plane, passing through the 2 vectors
1843 # with center in a start point of the first vector.
1844 # @param theVec1 Vector, defining center point and plane direction.
1845 # @param theVec2 Vector, defining the plane normal direction.
1846 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1847 # @param theName Object name; when specified, this parameter is used
1848 # for result publication in the study. Otherwise, if automatic
1849 # publication is switched on, default value is used for result name.
1851 # @return New GEOM.GEOM_Object, containing the created plane.
1853 # @ref tui_creation_plane "Example"
1854 @ManageTransactions("BasicOp")
1855 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1857 Create a plane, passing through the 2 vectors
1858 with center in a start point of the first vector.
1861 theVec1 Vector, defining center point and plane direction.
1862 theVec2 Vector, defining the plane normal direction.
1863 theTrimSize Half size of a side of quadrangle face, representing the plane.
1864 theName Object name; when specified, this parameter is used
1865 for result publication in the study. Otherwise, if automatic
1866 publication is switched on, default value is used for result name.
1869 New GEOM.GEOM_Object, containing the created plane.
1871 # Example: see GEOM_TestAll.py
1872 theTrimSize, Parameters = ParseParameters(theTrimSize);
1873 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1874 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1875 anObj.SetParameters(Parameters)
1876 self._autoPublish(anObj, theName, "plane")
1879 ## Create a plane, based on a Local coordinate system.
1880 # @param theLCS coordinate system, defining plane.
1881 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1882 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1883 # @param theName Object name; when specified, this parameter is used
1884 # for result publication in the study. Otherwise, if automatic
1885 # publication is switched on, default value is used for result name.
1887 # @return New GEOM.GEOM_Object, containing the created plane.
1889 # @ref tui_creation_plane "Example"
1890 @ManageTransactions("BasicOp")
1891 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1893 Create a plane, based on a Local coordinate system.
1896 theLCS coordinate system, defining plane.
1897 theTrimSize Half size of a side of quadrangle face, representing the plane.
1898 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1899 theName Object name; when specified, this parameter is used
1900 for result publication in the study. Otherwise, if automatic
1901 publication is switched on, default value is used for result name.
1904 New GEOM.GEOM_Object, containing the created plane.
1906 # Example: see GEOM_TestAll.py
1907 theTrimSize, Parameters = ParseParameters(theTrimSize);
1908 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1909 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1910 anObj.SetParameters(Parameters)
1911 self._autoPublish(anObj, theName, "plane")
1914 ## Create a local coordinate system.
1915 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1916 # @param XDX,XDY,XDZ Three components of OX direction
1917 # @param YDX,YDY,YDZ Three components of OY direction
1918 # @param theName Object name; when specified, this parameter is used
1919 # for result publication in the study. Otherwise, if automatic
1920 # publication is switched on, default value is used for result name.
1922 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1924 # @ref swig_MakeMarker "Example"
1925 @ManageTransactions("BasicOp")
1926 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1928 Create a local coordinate system.
1931 OX,OY,OZ Three coordinates of coordinate system origin.
1932 XDX,XDY,XDZ Three components of OX direction
1933 YDX,YDY,YDZ Three components of OY direction
1934 theName Object name; when specified, this parameter is used
1935 for result publication in the study. Otherwise, if automatic
1936 publication is switched on, default value is used for result name.
1939 New GEOM.GEOM_Object, containing the created coordinate system.
1941 # Example: see GEOM_TestAll.py
1942 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1943 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1944 RaiseIfFailed("MakeMarker", self.BasicOp)
1945 anObj.SetParameters(Parameters)
1946 self._autoPublish(anObj, theName, "lcs")
1949 ## Create a local coordinate system from shape.
1950 # @param theShape The initial shape to detect the coordinate system.
1951 # @param theName Object name; when specified, this parameter is used
1952 # for result publication in the study. Otherwise, if automatic
1953 # publication is switched on, default value is used for result name.
1955 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1957 # @ref tui_creation_lcs "Example"
1958 @ManageTransactions("BasicOp")
1959 def MakeMarkerFromShape(self, theShape, theName=None):
1961 Create a local coordinate system from shape.
1964 theShape The initial shape to detect the coordinate system.
1965 theName Object name; when specified, this parameter is used
1966 for result publication in the study. Otherwise, if automatic
1967 publication is switched on, default value is used for result name.
1970 New GEOM.GEOM_Object, containing the created coordinate system.
1972 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1973 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1974 self._autoPublish(anObj, theName, "lcs")
1977 ## Create a local coordinate system from point and two vectors.
1978 # @param theOrigin Point of coordinate system origin.
1979 # @param theXVec Vector of X direction
1980 # @param theYVec Vector of Y direction
1981 # @param theName Object name; when specified, this parameter is used
1982 # for result publication in the study. Otherwise, if automatic
1983 # publication is switched on, default value is used for result name.
1985 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1987 # @ref tui_creation_lcs "Example"
1988 @ManageTransactions("BasicOp")
1989 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1991 Create a local coordinate system from point and two vectors.
1994 theOrigin Point of coordinate system origin.
1995 theXVec Vector of X direction
1996 theYVec Vector of Y direction
1997 theName Object name; when specified, this parameter is used
1998 for result publication in the study. Otherwise, if automatic
1999 publication is switched on, default value is used for result name.
2002 New GEOM.GEOM_Object, containing the created coordinate system.
2005 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
2006 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
2007 self._autoPublish(anObj, theName, "lcs")
2010 # end of l3_basic_go
2013 ## @addtogroup l4_curves
2016 ## Create an arc of circle, passing through three given points.
2017 # @param thePnt1 Start point of the arc.
2018 # @param thePnt2 Middle point of the arc.
2019 # @param thePnt3 End point of the arc.
2020 # @param theName Object name; when specified, this parameter is used
2021 # for result publication in the study. Otherwise, if automatic
2022 # publication is switched on, default value is used for result name.
2024 # @return New GEOM.GEOM_Object, containing the created arc.
2026 # @ref swig_MakeArc "Example"
2027 @ManageTransactions("CurvesOp")
2028 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2030 Create an arc of circle, passing through three given points.
2033 thePnt1 Start point of the arc.
2034 thePnt2 Middle point of the arc.
2035 thePnt3 End point of the arc.
2036 theName Object name; when specified, this parameter is used
2037 for result publication in the study. Otherwise, if automatic
2038 publication is switched on, default value is used for result name.
2041 New GEOM.GEOM_Object, containing the created arc.
2043 # Example: see GEOM_TestAll.py
2044 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2045 RaiseIfFailed("MakeArc", self.CurvesOp)
2046 self._autoPublish(anObj, theName, "arc")
2049 ## Create an arc of circle from a center and 2 points.
2050 # @param thePnt1 Center of the arc
2051 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2052 # @param thePnt3 End point of the arc (Gives also a direction)
2053 # @param theSense Orientation of the arc
2054 # @param theName Object name; when specified, this parameter is used
2055 # for result publication in the study. Otherwise, if automatic
2056 # publication is switched on, default value is used for result name.
2058 # @return New GEOM.GEOM_Object, containing the created arc.
2060 # @ref swig_MakeArc "Example"
2061 @ManageTransactions("CurvesOp")
2062 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2064 Create an arc of circle from a center and 2 points.
2067 thePnt1 Center of the arc
2068 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2069 thePnt3 End point of the arc (Gives also a direction)
2070 theSense Orientation of the arc
2071 theName Object name; when specified, this parameter is used
2072 for result publication in the study. Otherwise, if automatic
2073 publication is switched on, default value is used for result name.
2076 New GEOM.GEOM_Object, containing the created arc.
2078 # Example: see GEOM_TestAll.py
2079 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2080 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2081 self._autoPublish(anObj, theName, "arc")
2084 ## Create an arc of ellipse, of center and two points.
2085 # @param theCenter Center of the arc.
2086 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2087 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2088 # @param theName Object name; when specified, this parameter is used
2089 # for result publication in the study. Otherwise, if automatic
2090 # publication is switched on, default value is used for result name.
2092 # @return New GEOM.GEOM_Object, containing the created arc.
2094 # @ref swig_MakeArc "Example"
2095 @ManageTransactions("CurvesOp")
2096 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2098 Create an arc of ellipse, of center and two points.
2101 theCenter Center of the arc.
2102 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2103 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2104 theName Object name; when specified, this parameter is used
2105 for result publication in the study. Otherwise, if automatic
2106 publication is switched on, default value is used for result name.
2109 New GEOM.GEOM_Object, containing the created arc.
2111 # Example: see GEOM_TestAll.py
2112 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2113 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2114 self._autoPublish(anObj, theName, "arc")
2117 ## Create a circle with given center, normal vector and radius.
2118 # @param thePnt Circle center.
2119 # @param theVec Vector, normal to the plane of the circle.
2120 # @param theR Circle radius.
2121 # @param theName Object name; when specified, this parameter is used
2122 # for result publication in the study. Otherwise, if automatic
2123 # publication is switched on, default value is used for result name.
2125 # @return New GEOM.GEOM_Object, containing the created circle.
2127 # @ref tui_creation_circle "Example"
2128 @ManageTransactions("CurvesOp")
2129 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2131 Create a circle with given center, normal vector and radius.
2134 thePnt Circle center.
2135 theVec Vector, normal to the plane of the circle.
2137 theName Object name; when specified, this parameter is used
2138 for result publication in the study. Otherwise, if automatic
2139 publication is switched on, default value is used for result name.
2142 New GEOM.GEOM_Object, containing the created circle.
2144 # Example: see GEOM_TestAll.py
2145 theR, Parameters = ParseParameters(theR)
2146 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2147 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2148 anObj.SetParameters(Parameters)
2149 self._autoPublish(anObj, theName, "circle")
2152 ## Create a circle with given radius.
2153 # Center of the circle will be in the origin of global
2154 # coordinate system and normal vector will be codirected with Z axis
2155 # @param theR Circle radius.
2156 # @param theName Object name; when specified, this parameter is used
2157 # for result publication in the study. Otherwise, if automatic
2158 # publication is switched on, default value is used for result name.
2160 # @return New GEOM.GEOM_Object, containing the created circle.
2161 @ManageTransactions("CurvesOp")
2162 def MakeCircleR(self, theR, theName=None):
2164 Create a circle with given radius.
2165 Center of the circle will be in the origin of global
2166 coordinate system and normal vector will be codirected with Z axis
2170 theName Object name; when specified, this parameter is used
2171 for result publication in the study. Otherwise, if automatic
2172 publication is switched on, default value is used for result name.
2175 New GEOM.GEOM_Object, containing the created circle.
2177 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2178 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2179 self._autoPublish(anObj, theName, "circle")
2182 ## Create a circle, passing through three given points
2183 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2184 # @param theName Object name; when specified, this parameter is used
2185 # for result publication in the study. Otherwise, if automatic
2186 # publication is switched on, default value is used for result name.
2188 # @return New GEOM.GEOM_Object, containing the created circle.
2190 # @ref tui_creation_circle "Example"
2191 @ManageTransactions("CurvesOp")
2192 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2194 Create a circle, passing through three given points
2197 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2198 theName Object name; when specified, this parameter is used
2199 for result publication in the study. Otherwise, if automatic
2200 publication is switched on, default value is used for result name.
2203 New GEOM.GEOM_Object, containing the created circle.
2205 # Example: see GEOM_TestAll.py
2206 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2207 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2208 self._autoPublish(anObj, theName, "circle")
2211 ## Create a circle, with given point1 as center,
2212 # passing through the point2 as radius and laying in the plane,
2213 # defined by all three given points.
2214 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2215 # @param theName Object name; when specified, this parameter is used
2216 # for result publication in the study. Otherwise, if automatic
2217 # publication is switched on, default value is used for result name.
2219 # @return New GEOM.GEOM_Object, containing the created circle.
2221 # @ref swig_MakeCircle "Example"
2222 @ManageTransactions("CurvesOp")
2223 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2225 Create a circle, with given point1 as center,
2226 passing through the point2 as radius and laying in the plane,
2227 defined by all three given points.
2230 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2231 theName Object name; when specified, this parameter is used
2232 for result publication in the study. Otherwise, if automatic
2233 publication is switched on, default value is used for result name.
2236 New GEOM.GEOM_Object, containing the created circle.
2238 # Example: see GEOM_example6.py
2239 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2240 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2241 self._autoPublish(anObj, theName, "circle")
2244 ## Create an ellipse with given center, normal vector and radiuses.
2245 # @param thePnt Ellipse center.
2246 # @param theVec Vector, normal to the plane of the ellipse.
2247 # @param theRMajor Major ellipse radius.
2248 # @param theRMinor Minor ellipse radius.
2249 # @param theVecMaj Vector, direction of the ellipse's main axis.
2250 # @param theName Object name; when specified, this parameter is used
2251 # for result publication in the study. Otherwise, if automatic
2252 # publication is switched on, default value is used for result name.
2254 # @return New GEOM.GEOM_Object, containing the created ellipse.
2256 # @ref tui_creation_ellipse "Example"
2257 @ManageTransactions("CurvesOp")
2258 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2260 Create an ellipse with given center, normal vector and radiuses.
2263 thePnt Ellipse center.
2264 theVec Vector, normal to the plane of the ellipse.
2265 theRMajor Major ellipse radius.
2266 theRMinor Minor ellipse radius.
2267 theVecMaj Vector, direction of the ellipse's main axis.
2268 theName Object name; when specified, this parameter is used
2269 for result publication in the study. Otherwise, if automatic
2270 publication is switched on, default value is used for result name.
2273 New GEOM.GEOM_Object, containing the created ellipse.
2275 # Example: see GEOM_TestAll.py
2276 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2277 if theVecMaj is not None:
2278 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2280 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2282 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2283 anObj.SetParameters(Parameters)
2284 self._autoPublish(anObj, theName, "ellipse")
2287 ## Create an ellipse with given radiuses.
2288 # Center of the ellipse will be in the origin of global
2289 # coordinate system and normal vector will be codirected with Z axis
2290 # @param theRMajor Major ellipse radius.
2291 # @param theRMinor Minor ellipse radius.
2292 # @param theName Object name; when specified, this parameter is used
2293 # for result publication in the study. Otherwise, if automatic
2294 # publication is switched on, default value is used for result name.
2296 # @return New GEOM.GEOM_Object, containing the created ellipse.
2297 @ManageTransactions("CurvesOp")
2298 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2300 Create an ellipse with given radiuses.
2301 Center of the ellipse will be in the origin of global
2302 coordinate system and normal vector will be codirected with Z axis
2305 theRMajor Major ellipse radius.
2306 theRMinor Minor ellipse radius.
2307 theName Object name; when specified, this parameter is used
2308 for result publication in the study. Otherwise, if automatic
2309 publication is switched on, default value is used for result name.
2312 New GEOM.GEOM_Object, containing the created ellipse.
2314 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2315 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2316 self._autoPublish(anObj, theName, "ellipse")
2319 ## Create a polyline on the set of points.
2320 # @param thePoints Sequence of points for the polyline.
2321 # @param theIsClosed If True, build a closed wire.
2322 # @param theName Object name; when specified, this parameter is used
2323 # for result publication in the study. Otherwise, if automatic
2324 # publication is switched on, default value is used for result name.
2326 # @return New GEOM.GEOM_Object, containing the created polyline.
2328 # @ref tui_creation_curve "Example"
2329 @ManageTransactions("CurvesOp")
2330 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2332 Create a polyline on the set of points.
2335 thePoints Sequence of points for the polyline.
2336 theIsClosed If True, build a closed wire.
2337 theName Object name; when specified, this parameter is used
2338 for result publication in the study. Otherwise, if automatic
2339 publication is switched on, default value is used for result name.
2342 New GEOM.GEOM_Object, containing the created polyline.
2344 # Example: see GEOM_TestAll.py
2345 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2346 RaiseIfFailed("MakePolyline", self.CurvesOp)
2347 self._autoPublish(anObj, theName, "polyline")
2350 ## Create bezier curve on the set of points.
2351 # @param thePoints Sequence of points for the bezier curve.
2352 # @param theIsClosed If True, build a closed curve.
2353 # @param theName Object name; when specified, this parameter is used
2354 # for result publication in the study. Otherwise, if automatic
2355 # publication is switched on, default value is used for result name.
2357 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2359 # @ref tui_creation_curve "Example"
2360 @ManageTransactions("CurvesOp")
2361 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2363 Create bezier curve on the set of points.
2366 thePoints Sequence of points for the bezier curve.
2367 theIsClosed If True, build a closed curve.
2368 theName Object name; when specified, this parameter is used
2369 for result publication in the study. Otherwise, if automatic
2370 publication is switched on, default value is used for result name.
2373 New GEOM.GEOM_Object, containing the created bezier curve.
2375 # Example: see GEOM_TestAll.py
2376 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2377 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2378 self._autoPublish(anObj, theName, "bezier")
2381 ## Create B-Spline curve on the set of points.
2382 # @param thePoints Sequence of points for the B-Spline curve.
2383 # @param theIsClosed If True, build a closed curve.
2384 # @param theDoReordering If TRUE, the algo does not follow the order of
2385 # \a thePoints but searches for the closest vertex.
2386 # @param theName Object name; when specified, this parameter is used
2387 # for result publication in the study. Otherwise, if automatic
2388 # publication is switched on, default value is used for result name.
2390 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2392 # @ref tui_creation_curve "Example"
2393 @ManageTransactions("CurvesOp")
2394 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2396 Create B-Spline curve on the set of points.
2399 thePoints Sequence of points for the B-Spline curve.
2400 theIsClosed If True, build a closed curve.
2401 theDoReordering If True, the algo does not follow the order of
2402 thePoints but searches for the closest vertex.
2403 theName Object name; when specified, this parameter is used
2404 for result publication in the study. Otherwise, if automatic
2405 publication is switched on, default value is used for result name.
2408 New GEOM.GEOM_Object, containing the created B-Spline curve.
2410 # Example: see GEOM_TestAll.py
2411 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2412 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2413 self._autoPublish(anObj, theName, "bspline")
2416 ## Create B-Spline curve on the set of points.
2417 # @param thePoints Sequence of points for the B-Spline curve.
2418 # @param theFirstVec Vector object, defining the curve direction at its first point.
2419 # @param theLastVec Vector object, defining the curve direction at its last point.
2420 # @param theName Object name; when specified, this parameter is used
2421 # for result publication in the study. Otherwise, if automatic
2422 # publication is switched on, default value is used for result name.
2424 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2426 # @ref tui_creation_curve "Example"
2427 @ManageTransactions("CurvesOp")
2428 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2430 Create B-Spline curve on the set of points.
2433 thePoints Sequence of points for the B-Spline curve.
2434 theFirstVec Vector object, defining the curve direction at its first point.
2435 theLastVec Vector object, defining the curve direction at its last point.
2436 theName Object name; when specified, this parameter is used
2437 for result publication in the study. Otherwise, if automatic
2438 publication is switched on, default value is used for result name.
2441 New GEOM.GEOM_Object, containing the created B-Spline curve.
2443 # Example: see GEOM_TestAll.py
2444 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2445 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2446 self._autoPublish(anObj, theName, "bspline")
2449 ## Creates a curve using the parametric definition of the basic points.
2450 # @param thexExpr parametric equation of the coordinates X.
2451 # @param theyExpr parametric equation of the coordinates Y.
2452 # @param thezExpr parametric equation of the coordinates Z.
2453 # @param theParamMin the minimal value of the parameter.
2454 # @param theParamMax the maximum value of the parameter.
2455 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2456 # @param theCurveType the type of the curve,
2457 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2458 # @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.
2459 # @param theName Object name; when specified, this parameter is used
2460 # for result publication in the study. Otherwise, if automatic
2461 # publication is switched on, default value is used for result name.
2463 # @return New GEOM.GEOM_Object, containing the created curve.
2465 # @ref tui_creation_curve "Example"
2466 @ManageTransactions("CurvesOp")
2467 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2468 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2470 Creates a curve using the parametric definition of the basic points.
2473 thexExpr parametric equation of the coordinates X.
2474 theyExpr parametric equation of the coordinates Y.
2475 thezExpr parametric equation of the coordinates Z.
2476 theParamMin the minimal value of the parameter.
2477 theParamMax the maximum value of the parameter.
2478 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2479 theCurveType the type of the curve,
2480 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2481 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2482 method is used which can lead to a bug.
2483 theName Object name; when specified, this parameter is used
2484 for result publication in the study. Otherwise, if automatic
2485 publication is switched on, default value is used for result name.
2488 New GEOM.GEOM_Object, containing the created curve.
2490 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2492 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2494 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2495 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2496 anObj.SetParameters(Parameters)
2497 self._autoPublish(anObj, theName, "curve")
2500 ## Create an isoline curve on a face.
2501 # @param theFace the face for which an isoline is created.
2502 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2504 # @param theParameter the U parameter for U-isoline or V parameter
2506 # @param theName Object name; when specified, this parameter is used
2507 # for result publication in the study. Otherwise, if automatic
2508 # publication is switched on, default value is used for result name.
2510 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2511 # a compound of edges.
2513 # @ref tui_creation_curve "Example"
2514 @ManageTransactions("CurvesOp")
2515 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2517 Create an isoline curve on a face.
2520 theFace the face for which an isoline is created.
2521 IsUIsoline True for U-isoline creation; False for V-isoline
2523 theParameter the U parameter for U-isoline or V parameter
2525 theName Object name; when specified, this parameter is used
2526 for result publication in the study. Otherwise, if automatic
2527 publication is switched on, default value is used for result name.
2530 New GEOM.GEOM_Object, containing the created isoline edge or a
2533 # Example: see GEOM_TestAll.py
2534 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2535 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2537 self._autoPublish(anObj, theName, "U-Isoline")
2539 self._autoPublish(anObj, theName, "V-Isoline")
2545 ## @addtogroup l3_sketcher
2548 ## Create a sketcher (wire or face), following the textual description,
2549 # passed through <VAR>theCommand</VAR> argument. \n
2550 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2551 # Format of the description string have to be the following:
2553 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2556 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2558 # - "R angle" : Set the direction by angle
2559 # - "D dx dy" : Set the direction by DX & DY
2562 # - "TT x y" : Create segment by point at X & Y
2563 # - "T dx dy" : Create segment by point with DX & DY
2564 # - "L length" : Create segment by direction & Length
2565 # - "IX x" : Create segment by direction & Intersect. X
2566 # - "IY y" : Create segment by direction & Intersect. Y
2569 # - "C radius length" : Create arc by direction, radius and length(in degree)
2570 # - "AA x y": Create arc by point at X & Y
2571 # - "A dx dy" : Create arc by point with DX & DY
2572 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2573 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2574 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2575 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2578 # - "WW" : Close Wire (to finish)
2579 # - "WF" : Close Wire and build face (to finish)
2582 # - Flag1 (= reverse) is 0 or 2 ...
2583 # - if 0 the drawn arc is the one of lower angle (< Pi)
2584 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2587 # - Flag2 (= control tolerance) is 0 or 1 ...
2588 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2589 # - if 1 the wire is built only if the end point is on the arc
2590 # with a tolerance of 10^-7 on the distance else the creation fails
2592 # @param theCommand String, defining the sketcher in local
2593 # coordinates of the working plane.
2594 # @param theWorkingPlane Nine double values, defining origin,
2595 # OZ and OX directions of the working plane.
2596 # @param theName Object name; when specified, this parameter is used
2597 # for result publication in the study. Otherwise, if automatic
2598 # publication is switched on, default value is used for result name.
2600 # @return New GEOM.GEOM_Object, containing the created wire.
2602 # @ref tui_sketcher_page "Example"
2603 @ManageTransactions("CurvesOp")
2604 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2606 Create a sketcher (wire or face), following the textual description, passed
2607 through theCommand argument.
2608 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2609 Format of the description string have to be the following:
2610 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2612 - x1, y1 are coordinates of the first sketcher point (zero by default),
2614 - "R angle" : Set the direction by angle
2615 - "D dx dy" : Set the direction by DX & DY
2617 - "TT x y" : Create segment by point at X & Y
2618 - "T dx dy" : Create segment by point with DX & DY
2619 - "L length" : Create segment by direction & Length
2620 - "IX x" : Create segment by direction & Intersect. X
2621 - "IY y" : Create segment by direction & Intersect. Y
2623 - "C radius length" : Create arc by direction, radius and length(in degree)
2624 - "AA x y": Create arc by point at X & Y
2625 - "A dx dy" : Create arc by point with DX & DY
2626 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2627 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2628 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2629 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2631 - "WW" : Close Wire (to finish)
2632 - "WF" : Close Wire and build face (to finish)
2634 - Flag1 (= reverse) is 0 or 2 ...
2635 - if 0 the drawn arc is the one of lower angle (< Pi)
2636 - if 2 the drawn arc ius the one of greater angle (> Pi)
2638 - Flag2 (= control tolerance) is 0 or 1 ...
2639 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2640 - if 1 the wire is built only if the end point is on the arc
2641 with a tolerance of 10^-7 on the distance else the creation fails
2644 theCommand String, defining the sketcher in local
2645 coordinates of the working plane.
2646 theWorkingPlane Nine double values, defining origin,
2647 OZ and OX directions of the working plane.
2648 theName Object name; when specified, this parameter is used
2649 for result publication in the study. Otherwise, if automatic
2650 publication is switched on, default value is used for result name.
2653 New GEOM.GEOM_Object, containing the created wire.
2655 # Example: see GEOM_TestAll.py
2656 theCommand,Parameters = ParseSketcherCommand(theCommand)
2657 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2658 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2659 anObj.SetParameters(Parameters)
2660 self._autoPublish(anObj, theName, "wire")
2663 ## Create a sketcher (wire or face), following the textual description,
2664 # passed through <VAR>theCommand</VAR> argument. \n
2665 # For format of the description string see MakeSketcher() method.\n
2666 # @param theCommand String, defining the sketcher in local
2667 # coordinates of the working plane.
2668 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2669 # @param theName Object name; when specified, this parameter is used
2670 # for result publication in the study. Otherwise, if automatic
2671 # publication is switched on, default value is used for result name.
2673 # @return New GEOM.GEOM_Object, containing the created wire.
2675 # @ref tui_sketcher_page "Example"
2676 @ManageTransactions("CurvesOp")
2677 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2679 Create a sketcher (wire or face), following the textual description,
2680 passed through theCommand argument.
2681 For format of the description string see geompy.MakeSketcher() method.
2684 theCommand String, defining the sketcher in local
2685 coordinates of the working plane.
2686 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2687 theName Object name; when specified, this parameter is used
2688 for result publication in the study. Otherwise, if automatic
2689 publication is switched on, default value is used for result name.
2692 New GEOM.GEOM_Object, containing the created wire.
2694 theCommand,Parameters = ParseSketcherCommand(theCommand)
2695 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2696 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2697 anObj.SetParameters(Parameters)
2698 self._autoPublish(anObj, theName, "wire")
2701 ## Obtain a 2D sketcher interface
2702 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2703 def Sketcher2D (self):
2705 Obtain a 2D sketcher interface.
2708 sk = geompy.Sketcher2D()
2710 sk.addSegmentRelative(15, 70)
2711 sk.addSegmentPerpY(50)
2712 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2713 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2714 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2716 Sketch_1 = sk.wire(geomObj_1)
2718 sk = Sketcher2D (self)
2721 ## Create a sketcher wire, following the numerical description,
2722 # passed through <VAR>theCoordinates</VAR> argument. \n
2723 # @param theCoordinates double values, defining points to create a wire,
2725 # @param theName Object name; when specified, this parameter is used
2726 # for result publication in the study. Otherwise, if automatic
2727 # publication is switched on, default value is used for result name.
2729 # @return New GEOM.GEOM_Object, containing the created wire.
2731 # @ref tui_3dsketcher_page "Example"
2732 @ManageTransactions("CurvesOp")
2733 def Make3DSketcher(self, theCoordinates, theName=None):
2735 Create a sketcher wire, following the numerical description,
2736 passed through theCoordinates argument.
2739 theCoordinates double values, defining points to create a wire,
2741 theName Object name; when specified, this parameter is used
2742 for result publication in the study. Otherwise, if automatic
2743 publication is switched on, default value is used for result name.
2746 New GEOM_Object, containing the created wire.
2748 theCoordinates,Parameters = ParseParameters(theCoordinates)
2749 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2750 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2751 anObj.SetParameters(Parameters)
2752 self._autoPublish(anObj, theName, "wire")
2755 ## Obtain a 3D sketcher interface
2756 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2758 # @ref tui_3dsketcher_page "Example"
2759 def Sketcher3D (self):
2761 Obtain a 3D sketcher interface.
2764 sk = geompy.Sketcher3D()
2765 sk.addPointsAbsolute(0,0,0, 70,0,0)
2766 sk.addPointsRelative(0, 0, 130)
2767 sk.addPointAnglesLength("OXY", 50, 0, 100)
2768 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2770 a3D_Sketcher_1 = sk.wire()
2772 sk = Sketcher3D (self)
2775 ## Obtain a 2D polyline creation interface
2776 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2778 # @ref tui_3dsketcher_page "Example"
2779 def Polyline2D (self):
2781 Obtain a 2D polyline creation interface.
2784 pl = geompy.Polyline2D()
2785 pl.addSection("section 1", GEOM.Polyline, True)
2786 pl.addPoints(0, 0, 10, 0, 10, 10)
2787 pl.addSection("section 2", GEOM.Interpolation, False)
2788 pl.addPoints(20, 0, 30, 0, 30, 10)
2789 resultObj = pl.result(WorkingPlane)
2791 pl = Polyline2D (self)
2794 # end of l3_sketcher
2797 ## @addtogroup l3_3d_primitives
2800 ## Create a box by coordinates of two opposite vertices.
2802 # @param x1,y1,z1 double values, defining first point it.
2803 # @param x2,y2,z2 double values, defining first point it.
2804 # @param theName Object name; when specified, this parameter is used
2805 # for result publication in the study. Otherwise, if automatic
2806 # publication is switched on, default value is used for result name.
2808 # @return New GEOM.GEOM_Object, containing the created box.
2810 # @ref tui_creation_box "Example"
2811 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2813 Create a box by coordinates of two opposite vertices.
2816 x1,y1,z1 double values, defining first point.
2817 x2,y2,z2 double values, defining second point.
2818 theName Object name; when specified, this parameter is used
2819 for result publication in the study. Otherwise, if automatic
2820 publication is switched on, default value is used for result name.
2823 New GEOM.GEOM_Object, containing the created box.
2825 # Example: see GEOM_TestAll.py
2826 pnt1 = self.MakeVertex(x1,y1,z1)
2827 pnt2 = self.MakeVertex(x2,y2,z2)
2828 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2829 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2831 ## Create a box with specified dimensions along the coordinate axes
2832 # and with edges, parallel to the coordinate axes.
2833 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2834 # @param theDX Length of Box edges, parallel to OX axis.
2835 # @param theDY Length of Box edges, parallel to OY axis.
2836 # @param theDZ Length of Box edges, parallel to OZ axis.
2837 # @param theName Object name; when specified, this parameter is used
2838 # for result publication in the study. Otherwise, if automatic
2839 # publication is switched on, default value is used for result name.
2841 # @return New GEOM.GEOM_Object, containing the created box.
2843 # @ref tui_creation_box "Example"
2844 @ManageTransactions("PrimOp")
2845 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2847 Create a box with specified dimensions along the coordinate axes
2848 and with edges, parallel to the coordinate axes.
2849 Center of the box will be at point (DX/2, DY/2, DZ/2).
2852 theDX Length of Box edges, parallel to OX axis.
2853 theDY Length of Box edges, parallel to OY axis.
2854 theDZ Length of Box edges, parallel to OZ axis.
2855 theName Object name; when specified, this parameter is used
2856 for result publication in the study. Otherwise, if automatic
2857 publication is switched on, default value is used for result name.
2860 New GEOM.GEOM_Object, containing the created box.
2862 # Example: see GEOM_TestAll.py
2863 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2864 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2865 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2866 anObj.SetParameters(Parameters)
2867 self._autoPublish(anObj, theName, "box")
2870 ## Create a box with two specified opposite vertices,
2871 # and with edges, parallel to the coordinate axes
2872 # @param thePnt1 First of two opposite vertices.
2873 # @param thePnt2 Second of two opposite vertices.
2874 # @param theName Object name; when specified, this parameter is used
2875 # for result publication in the study. Otherwise, if automatic
2876 # publication is switched on, default value is used for result name.
2878 # @return New GEOM.GEOM_Object, containing the created box.
2880 # @ref tui_creation_box "Example"
2881 @ManageTransactions("PrimOp")
2882 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2884 Create a box with two specified opposite vertices,
2885 and with edges, parallel to the coordinate axes
2888 thePnt1 First of two opposite vertices.
2889 thePnt2 Second of two opposite vertices.
2890 theName Object name; when specified, this parameter is used
2891 for result publication in the study. Otherwise, if automatic
2892 publication is switched on, default value is used for result name.
2895 New GEOM.GEOM_Object, containing the created box.
2897 # Example: see GEOM_TestAll.py
2898 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2899 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2900 self._autoPublish(anObj, theName, "box")
2903 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2904 # @param theH height of Face.
2905 # @param theW width of Face.
2906 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2907 # @param theName Object name; when specified, this parameter is used
2908 # for result publication in the study. Otherwise, if automatic
2909 # publication is switched on, default value is used for result name.
2911 # @return New GEOM.GEOM_Object, containing the created face.
2913 # @ref tui_creation_face "Example"
2914 @ManageTransactions("PrimOp")
2915 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2917 Create a face with specified dimensions with edges parallel to coordinate axes.
2920 theH height of Face.
2922 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2923 theName Object name; when specified, this parameter is used
2924 for result publication in the study. Otherwise, if automatic
2925 publication is switched on, default value is used for result name.
2928 New GEOM.GEOM_Object, containing the created face.
2930 # Example: see GEOM_TestAll.py
2931 theH,theW,Parameters = ParseParameters(theH, theW)
2932 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2933 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2934 anObj.SetParameters(Parameters)
2935 self._autoPublish(anObj, theName, "rectangle")
2938 ## Create a face from another plane and two sizes,
2939 # vertical size and horisontal size.
2940 # @param theObj Normale vector to the creating face or
2942 # @param theH Height (vertical size).
2943 # @param theW Width (horisontal size).
2944 # @param theName Object name; when specified, this parameter is used
2945 # for result publication in the study. Otherwise, if automatic
2946 # publication is switched on, default value is used for result name.
2948 # @return New GEOM.GEOM_Object, containing the created face.
2950 # @ref tui_creation_face "Example"
2951 @ManageTransactions("PrimOp")
2952 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2954 Create a face from another plane and two sizes,
2955 vertical size and horisontal size.
2958 theObj Normale vector to the creating face or
2960 theH Height (vertical size).
2961 theW Width (horisontal size).
2962 theName Object name; when specified, this parameter is used
2963 for result publication in the study. Otherwise, if automatic
2964 publication is switched on, default value is used for result name.
2967 New GEOM_Object, containing the created face.
2969 # Example: see GEOM_TestAll.py
2970 theH,theW,Parameters = ParseParameters(theH, theW)
2971 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2972 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2973 anObj.SetParameters(Parameters)
2974 self._autoPublish(anObj, theName, "rectangle")
2977 ## Create a disk with given center, normal vector and radius.
2978 # @param thePnt Disk center.
2979 # @param theVec Vector, normal to the plane of the disk.
2980 # @param theR Disk radius.
2981 # @param 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.
2985 # @return New GEOM.GEOM_Object, containing the created disk.
2987 # @ref tui_creation_disk "Example"
2988 @ManageTransactions("PrimOp")
2989 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2991 Create a disk with given center, normal vector and radius.
2995 theVec Vector, normal to the plane of the disk.
2997 theName Object name; when specified, this parameter is used
2998 for result publication in the study. Otherwise, if automatic
2999 publication is switched on, default value is used for result name.
3002 New GEOM.GEOM_Object, containing the created disk.
3004 # Example: see GEOM_TestAll.py
3005 theR,Parameters = ParseParameters(theR)
3006 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
3007 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
3008 anObj.SetParameters(Parameters)
3009 self._autoPublish(anObj, theName, "disk")
3012 ## Create a disk, passing through three given points
3013 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3014 # @param theName Object name; when specified, this parameter is used
3015 # for result publication in the study. Otherwise, if automatic
3016 # publication is switched on, default value is used for result name.
3018 # @return New GEOM.GEOM_Object, containing the created disk.
3020 # @ref tui_creation_disk "Example"
3021 @ManageTransactions("PrimOp")
3022 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3024 Create a disk, passing through three given points
3027 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3028 theName Object name; when specified, this parameter is used
3029 for result publication in the study. Otherwise, if automatic
3030 publication is switched on, default value is used for result name.
3033 New GEOM.GEOM_Object, containing the created disk.
3035 # Example: see GEOM_TestAll.py
3036 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3037 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3038 self._autoPublish(anObj, theName, "disk")
3041 ## Create a disk with specified dimensions along OX-OY coordinate axes.
3042 # @param theR Radius of Face.
3043 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3044 # @param theName Object name; when specified, this parameter is used
3045 # for result publication in the study. Otherwise, if automatic
3046 # publication is switched on, default value is used for result name.
3048 # @return New GEOM.GEOM_Object, containing the created disk.
3050 # @ref tui_creation_face "Example"
3051 @ManageTransactions("PrimOp")
3052 def MakeDiskR(self, theR, theOrientation, theName=None):
3054 Create a disk with specified dimensions along OX-OY coordinate axes.
3057 theR Radius of Face.
3058 theOrientation set the orientation belong axis OXY or OYZ or OZX
3059 theName Object name; when specified, this parameter is used
3060 for result publication in the study. Otherwise, if automatic
3061 publication is switched on, default value is used for result name.
3064 New GEOM.GEOM_Object, containing the created disk.
3067 Disk3 = geompy.MakeDiskR(100., 1)
3069 # Example: see GEOM_TestAll.py
3070 theR,Parameters = ParseParameters(theR)
3071 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3072 RaiseIfFailed("MakeDiskR", self.PrimOp)
3073 anObj.SetParameters(Parameters)
3074 self._autoPublish(anObj, theName, "disk")
3077 ## Create a cylinder with given base point, axis, radius and height.
3078 # @param thePnt Central point of cylinder base.
3079 # @param theAxis Cylinder axis.
3080 # @param theR Cylinder radius.
3081 # @param theH Cylinder height.
3082 # @param theName Object name; when specified, this parameter is used
3083 # for result publication in the study. Otherwise, if automatic
3084 # publication is switched on, default value is used for result name.
3086 # @return New GEOM.GEOM_Object, containing the created cylinder.
3088 # @ref tui_creation_cylinder "Example"
3089 @ManageTransactions("PrimOp")
3090 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3092 Create a cylinder with given base point, axis, radius and height.
3095 thePnt Central point of cylinder base.
3096 theAxis Cylinder axis.
3097 theR Cylinder radius.
3098 theH Cylinder height.
3099 theName Object name; when specified, this parameter is used
3100 for result publication in the study. Otherwise, if automatic
3101 publication is switched on, default value is used for result name.
3104 New GEOM.GEOM_Object, containing the created cylinder.
3106 # Example: see GEOM_TestAll.py
3107 theR,theH,Parameters = ParseParameters(theR, theH)
3108 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3109 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3110 anObj.SetParameters(Parameters)
3111 self._autoPublish(anObj, theName, "cylinder")
3114 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3115 # @param thePnt Central point of cylinder base.
3116 # @param theAxis Cylinder axis.
3117 # @param theR Cylinder radius.
3118 # @param theH Cylinder height.
3119 # @param theA Cylinder angle in radians.
3120 # @param theName Object name; when specified, this parameter is used
3121 # for result publication in the study. Otherwise, if automatic
3122 # publication is switched on, default value is used for result name.
3124 # @return New GEOM.GEOM_Object, containing the created cylinder.
3126 # @ref tui_creation_cylinder "Example"
3127 @ManageTransactions("PrimOp")
3128 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3130 Create a portion of cylinder with given base point, axis, radius, height and angle.
3133 thePnt Central point of cylinder base.
3134 theAxis Cylinder axis.
3135 theR Cylinder radius.
3136 theH Cylinder height.
3137 theA Cylinder angle in radians.
3138 theName Object name; when specified, this parameter is used
3139 for result publication in the study. Otherwise, if automatic
3140 publication is switched on, default value is used for result name.
3143 New GEOM.GEOM_Object, containing the created cylinder.
3145 # Example: see GEOM_TestAll.py
3147 if isinstance(theA,str):
3149 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3151 theA = theA*math.pi/180.
3152 if theA<=0. or theA>=2*math.pi:
3153 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3154 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3155 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3156 anObj.SetParameters(Parameters)
3157 self._autoPublish(anObj, theName, "cylinder")
3160 ## Create a cylinder with given radius and height at
3161 # the origin of coordinate system. Axis of the cylinder
3162 # will be collinear to the OZ axis of the coordinate system.
3163 # @param theR Cylinder radius.
3164 # @param theH Cylinder height.
3165 # @param theName Object name; when specified, this parameter is used
3166 # for result publication in the study. Otherwise, if automatic
3167 # publication is switched on, default value is used for result name.
3169 # @return New GEOM.GEOM_Object, containing the created cylinder.
3171 # @ref tui_creation_cylinder "Example"
3172 @ManageTransactions("PrimOp")
3173 def MakeCylinderRH(self, theR, theH, theName=None):
3175 Create a cylinder with given radius and height at
3176 the origin of coordinate system. Axis of the cylinder
3177 will be collinear to the OZ axis of the coordinate system.
3180 theR Cylinder radius.
3181 theH Cylinder height.
3182 theName Object name; when specified, this parameter is used
3183 for result publication in the study. Otherwise, if automatic
3184 publication is switched on, default value is used for result name.
3187 New GEOM.GEOM_Object, containing the created cylinder.
3189 # Example: see GEOM_TestAll.py
3190 theR,theH,Parameters = ParseParameters(theR, theH)
3191 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3192 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3193 anObj.SetParameters(Parameters)
3194 self._autoPublish(anObj, theName, "cylinder")
3197 ## Create a portion of cylinder with given radius, height and angle at
3198 # the origin of coordinate system. Axis of the cylinder
3199 # will be collinear to the OZ axis of the coordinate system.
3200 # @param theR Cylinder radius.
3201 # @param theH Cylinder height.
3202 # @param theA Cylinder angle in radians.
3203 # @param theName Object name; when specified, this parameter is used
3204 # for result publication in the study. Otherwise, if automatic
3205 # publication is switched on, default value is used for result name.
3207 # @return New GEOM.GEOM_Object, containing the created cylinder.
3209 # @ref tui_creation_cylinder "Example"
3210 @ManageTransactions("PrimOp")
3211 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3213 Create a portion of cylinder with given radius, height and angle at
3214 the origin of coordinate system. Axis of the cylinder
3215 will be collinear to the OZ axis of the coordinate system.
3218 theR Cylinder radius.
3219 theH Cylinder height.
3220 theA Cylinder angle in radians.
3221 theName Object name; when specified, this parameter is used
3222 for result publication in the study. Otherwise, if automatic
3223 publication is switched on, default value is used for result name.
3226 New GEOM.GEOM_Object, containing the created cylinder.
3228 # Example: see GEOM_TestAll.py
3230 if isinstance(theA,str):
3232 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3234 theA = theA*math.pi/180.
3235 if theA<=0. or theA>=2*math.pi:
3236 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3237 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3238 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3239 anObj.SetParameters(Parameters)
3240 self._autoPublish(anObj, theName, "cylinder")
3243 ## Create a sphere with given center and radius.
3244 # @param thePnt Sphere center.
3245 # @param theR Sphere radius.
3246 # @param theName Object name; when specified, this parameter is used
3247 # for result publication in the study. Otherwise, if automatic
3248 # publication is switched on, default value is used for result name.
3250 # @return New GEOM.GEOM_Object, containing the created sphere.
3252 # @ref tui_creation_sphere "Example"
3253 @ManageTransactions("PrimOp")
3254 def MakeSpherePntR(self, thePnt, theR, theName=None):
3256 Create a sphere with given center and radius.
3259 thePnt Sphere center.
3261 theName Object name; when specified, this parameter is used
3262 for result publication in the study. Otherwise, if automatic
3263 publication is switched on, default value is used for result name.
3266 New GEOM.GEOM_Object, containing the created sphere.
3268 # Example: see GEOM_TestAll.py
3269 theR,Parameters = ParseParameters(theR)
3270 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3271 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3272 anObj.SetParameters(Parameters)
3273 self._autoPublish(anObj, theName, "sphere")
3276 ## Create a sphere with given center and radius.
3277 # @param x,y,z Coordinates of sphere center.
3278 # @param theR Sphere radius.
3279 # @param theName Object name; when specified, this parameter is used
3280 # for result publication in the study. Otherwise, if automatic
3281 # publication is switched on, default value is used for result name.
3283 # @return New GEOM.GEOM_Object, containing the created sphere.
3285 # @ref tui_creation_sphere "Example"
3286 def MakeSphere(self, x, y, z, theR, theName=None):
3288 Create a sphere with given center and radius.
3291 x,y,z Coordinates of sphere center.
3293 theName Object name; when specified, this parameter is used
3294 for result publication in the study. Otherwise, if automatic
3295 publication is switched on, default value is used for result name.
3298 New GEOM.GEOM_Object, containing the created sphere.
3300 # Example: see GEOM_TestAll.py
3301 point = self.MakeVertex(x, y, z)
3302 # note: auto-publishing is done in self.MakeSpherePntR()
3303 anObj = self.MakeSpherePntR(point, theR, theName)
3306 ## Create a sphere with given radius at the origin of coordinate system.
3307 # @param theR Sphere radius.
3308 # @param theName Object name; when specified, this parameter is used
3309 # for result publication in the study. Otherwise, if automatic
3310 # publication is switched on, default value is used for result name.
3312 # @return New GEOM.GEOM_Object, containing the created sphere.
3314 # @ref tui_creation_sphere "Example"
3315 @ManageTransactions("PrimOp")
3316 def MakeSphereR(self, theR, theName=None):
3318 Create a sphere with given radius at the origin of coordinate system.
3322 theName Object name; when specified, this parameter is used
3323 for result publication in the study. Otherwise, if automatic
3324 publication is switched on, default value is used for result name.
3327 New GEOM.GEOM_Object, containing the created sphere.
3329 # Example: see GEOM_TestAll.py
3330 theR,Parameters = ParseParameters(theR)
3331 anObj = self.PrimOp.MakeSphereR(theR)
3332 RaiseIfFailed("MakeSphereR", self.PrimOp)
3333 anObj.SetParameters(Parameters)
3334 self._autoPublish(anObj, theName, "sphere")
3337 ## Create a cone with given base point, axis, height and radiuses.
3338 # @param thePnt Central point of the first cone base.
3339 # @param theAxis Cone axis.
3340 # @param theR1 Radius of the first cone base.
3341 # @param theR2 Radius of the second cone base.
3342 # \note If both radiuses are non-zero, the cone will be truncated.
3343 # \note If the radiuses are equal, a cylinder will be created instead.
3344 # @param theH Cone height.
3345 # @param theName Object name; when specified, this parameter is used
3346 # for result publication in the study. Otherwise, if automatic
3347 # publication is switched on, default value is used for result name.
3349 # @return New GEOM.GEOM_Object, containing the created cone.
3351 # @ref tui_creation_cone "Example"
3352 @ManageTransactions("PrimOp")
3353 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3355 Create a cone with given base point, axis, height and radiuses.
3358 thePnt Central point of the first cone base.
3360 theR1 Radius of the first cone base.
3361 theR2 Radius of the second cone base.
3363 theName Object name; when specified, this parameter is used
3364 for result publication in the study. Otherwise, if automatic
3365 publication is switched on, default value is used for result name.
3368 If both radiuses are non-zero, the cone will be truncated.
3369 If the radiuses are equal, a cylinder will be created instead.
3372 New GEOM.GEOM_Object, containing the created cone.
3374 # Example: see GEOM_TestAll.py
3375 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3376 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3377 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3378 anObj.SetParameters(Parameters)
3379 self._autoPublish(anObj, theName, "cone")
3382 ## Create a cone with given height and radiuses at
3383 # the origin of coordinate system. Axis of the cone will
3384 # be collinear to the OZ axis of the coordinate system.
3385 # @param theR1 Radius of the first cone base.
3386 # @param theR2 Radius of the second cone base.
3387 # \note If both radiuses are non-zero, the cone will be truncated.
3388 # \note If the radiuses are equal, a cylinder will be created instead.
3389 # @param theH Cone height.
3390 # @param theName Object name; when specified, this parameter is used
3391 # for result publication in the study. Otherwise, if automatic
3392 # publication is switched on, default value is used for result name.
3394 # @return New GEOM.GEOM_Object, containing the created cone.
3396 # @ref tui_creation_cone "Example"
3397 @ManageTransactions("PrimOp")
3398 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3400 Create a cone with given height and radiuses at
3401 the origin of coordinate system. Axis of the cone will
3402 be collinear to the OZ axis of the coordinate system.
3405 theR1 Radius of the first cone base.
3406 theR2 Radius of the second cone base.
3408 theName Object name; when specified, this parameter is used
3409 for result publication in the study. Otherwise, if automatic
3410 publication is switched on, default value is used for result name.
3413 If both radiuses are non-zero, the cone will be truncated.
3414 If the radiuses are equal, a cylinder will be created instead.
3417 New GEOM.GEOM_Object, containing the created cone.
3419 # Example: see GEOM_TestAll.py
3420 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3421 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3422 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3423 anObj.SetParameters(Parameters)
3424 self._autoPublish(anObj, theName, "cone")
3427 ## Create a torus with given center, normal vector and radiuses.
3428 # @param thePnt Torus central point.
3429 # @param theVec Torus axis of symmetry.
3430 # @param theRMajor Torus major radius.
3431 # @param theRMinor Torus minor radius.
3432 # @param theName Object name; when specified, this parameter is used
3433 # for result publication in the study. Otherwise, if automatic
3434 # publication is switched on, default value is used for result name.
3436 # @return New GEOM.GEOM_Object, containing the created torus.
3438 # @ref tui_creation_torus "Example"
3439 @ManageTransactions("PrimOp")
3440 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3442 Create a torus with given center, normal vector and radiuses.
3445 thePnt Torus central point.
3446 theVec Torus axis of symmetry.
3447 theRMajor Torus major radius.
3448 theRMinor Torus minor radius.
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 torus.
3456 # Example: see GEOM_TestAll.py
3457 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3458 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3459 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3460 anObj.SetParameters(Parameters)
3461 self._autoPublish(anObj, theName, "torus")
3464 ## Create a torus with given radiuses at the origin of coordinate system.
3465 # @param theRMajor Torus major radius.
3466 # @param theRMinor Torus minor radius.
3467 # @param theName Object name; when specified, this parameter is used
3468 # for result publication in the study. Otherwise, if automatic
3469 # publication is switched on, default value is used for result name.
3471 # @return New GEOM.GEOM_Object, containing the created torus.
3473 # @ref tui_creation_torus "Example"
3474 @ManageTransactions("PrimOp")
3475 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3477 Create a torus with given radiuses at the origin of coordinate system.
3480 theRMajor Torus major radius.
3481 theRMinor Torus minor radius.
3482 theName Object name; when specified, this parameter is used
3483 for result publication in the study. Otherwise, if automatic
3484 publication is switched on, default value is used for result name.
3487 New GEOM.GEOM_Object, containing the created torus.
3489 # Example: see GEOM_TestAll.py
3490 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3491 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3492 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3493 anObj.SetParameters(Parameters)
3494 self._autoPublish(anObj, theName, "torus")
3497 # end of l3_3d_primitives
3500 ## @addtogroup l3_complex
3503 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3504 # @param theBase Base shape to be extruded.
3505 # @param thePoint1 First end of extrusion vector.
3506 # @param thePoint2 Second end of extrusion vector.
3507 # @param theScaleFactor Use it to make prism with scaled second base.
3508 # Nagative value means not scaled second base.
3509 # @param theName Object name; when specified, this parameter is used
3510 # for result publication in the study. Otherwise, if automatic
3511 # publication is switched on, default value is used for result name.
3513 # @return New GEOM.GEOM_Object, containing the created prism.
3515 # @ref tui_creation_prism "Example"
3516 @ManageTransactions("PrimOp")
3517 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3519 Create a shape by extrusion of the base shape along a vector, defined by two points.
3522 theBase Base shape to be extruded.
3523 thePoint1 First end of extrusion vector.
3524 thePoint2 Second end of extrusion vector.
3525 theScaleFactor Use it to make prism with scaled second base.
3526 Nagative value means not scaled second base.
3527 theName Object name; when specified, this parameter is used
3528 for result publication in the study. Otherwise, if automatic
3529 publication is switched on, default value is used for result name.
3532 New GEOM.GEOM_Object, containing the created prism.
3534 # Example: see GEOM_TestAll.py
3537 if theScaleFactor > 0:
3538 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3539 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3541 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3542 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3543 anObj.SetParameters(Parameters)
3544 self._autoPublish(anObj, theName, "prism")
3547 ## Create a shape by extrusion of the base shape along a
3548 # vector, defined by two points, in 2 Ways (forward/backward).
3549 # @param theBase Base shape to be extruded.
3550 # @param thePoint1 First end of extrusion vector.
3551 # @param thePoint2 Second end of extrusion vector.
3552 # @param theName Object name; when specified, this parameter is used
3553 # for result publication in the study. Otherwise, if automatic
3554 # publication is switched on, default value is used for result name.
3556 # @return New GEOM.GEOM_Object, containing the created prism.
3558 # @ref tui_creation_prism "Example"
3559 @ManageTransactions("PrimOp")
3560 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3562 Create a shape by extrusion of the base shape along a
3563 vector, defined by two points, in 2 Ways (forward/backward).
3566 theBase Base shape to be extruded.
3567 thePoint1 First end of extrusion vector.
3568 thePoint2 Second end of extrusion vector.
3569 theName Object name; when specified, this parameter is used
3570 for result publication in the study. Otherwise, if automatic
3571 publication is switched on, default value is used for result name.
3574 New GEOM.GEOM_Object, containing the created prism.
3576 # Example: see GEOM_TestAll.py
3577 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3578 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3579 self._autoPublish(anObj, theName, "prism")
3582 ## Create a shape by extrusion of the base shape along the vector,
3583 # i.e. all the space, transfixed by the base shape during its translation
3584 # along the vector on the given distance.
3585 # @param theBase Base shape to be extruded.
3586 # @param theVec Direction of extrusion.
3587 # @param theH Prism dimension along theVec.
3588 # @param theScaleFactor Use it to make prism with scaled second base.
3589 # Negative value means not scaled second base.
3590 # @param theName Object name; when specified, this parameter is used
3591 # for result publication in the study. Otherwise, if automatic
3592 # publication is switched on, default value is used for result name.
3594 # @return New GEOM.GEOM_Object, containing the created prism.
3596 # @ref tui_creation_prism "Example"
3597 @ManageTransactions("PrimOp")
3598 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3600 Create a shape by extrusion of the base shape along the vector,
3601 i.e. all the space, transfixed by the base shape during its translation
3602 along the vector on the given distance.
3605 theBase Base shape to be extruded.
3606 theVec Direction of extrusion.
3607 theH Prism dimension along theVec.
3608 theScaleFactor Use it to make prism with scaled second base.
3609 Negative value means not scaled second base.
3610 theName Object name; when specified, this parameter is used
3611 for result publication in the study. Otherwise, if automatic
3612 publication is switched on, default value is used for result name.
3615 New GEOM.GEOM_Object, containing the created prism.
3617 # Example: see GEOM_TestAll.py
3620 if theScaleFactor > 0:
3621 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3622 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3624 theH,Parameters = ParseParameters(theH)
3625 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3626 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3627 anObj.SetParameters(Parameters)
3628 self._autoPublish(anObj, theName, "prism")
3631 ## Create a shape by extrusion of the base shape along the vector,
3632 # i.e. all the space, transfixed by the base shape during its translation
3633 # along the vector on the given distance in 2 Ways (forward/backward).
3634 # @param theBase Base shape to be extruded.
3635 # @param theVec Direction of extrusion.
3636 # @param theH Prism dimension along theVec in forward direction.
3637 # @param theName Object name; when specified, this parameter is used
3638 # for result publication in the study. Otherwise, if automatic
3639 # publication is switched on, default value is used for result name.
3641 # @return New GEOM.GEOM_Object, containing the created prism.
3643 # @ref tui_creation_prism "Example"
3644 @ManageTransactions("PrimOp")
3645 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3647 Create a shape by extrusion of the base shape along the vector,
3648 i.e. all the space, transfixed by the base shape during its translation
3649 along the vector on the given distance in 2 Ways (forward/backward).
3652 theBase Base shape to be extruded.
3653 theVec Direction of extrusion.
3654 theH Prism dimension along theVec in forward direction.
3655 theName Object name; when specified, this parameter is used
3656 for result publication in the study. Otherwise, if automatic
3657 publication is switched on, default value is used for result name.
3660 New GEOM.GEOM_Object, containing the created prism.
3662 # Example: see GEOM_TestAll.py
3663 theH,Parameters = ParseParameters(theH)
3664 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3665 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3666 anObj.SetParameters(Parameters)
3667 self._autoPublish(anObj, theName, "prism")
3670 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3671 # @param theBase Base shape to be extruded.
3672 # @param theDX, theDY, theDZ Directions of extrusion.
3673 # @param theScaleFactor Use it to make prism with scaled second base.
3674 # Nagative value means not scaled second base.
3675 # @param theName Object name; when specified, this parameter is used
3676 # for result publication in the study. Otherwise, if automatic
3677 # publication is switched on, default value is used for result name.
3679 # @return New GEOM.GEOM_Object, containing the created prism.
3681 # @ref tui_creation_prism "Example"
3682 @ManageTransactions("PrimOp")
3683 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3685 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3688 theBase Base shape to be extruded.
3689 theDX, theDY, theDZ Directions of extrusion.
3690 theScaleFactor Use it to make prism with scaled second base.
3691 Nagative value means not scaled second base.
3692 theName Object name; when specified, this parameter is used
3693 for result publication in the study. Otherwise, if automatic
3694 publication is switched on, default value is used for result name.
3697 New GEOM.GEOM_Object, containing the created prism.
3699 # Example: see GEOM_TestAll.py
3702 if theScaleFactor > 0:
3703 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3704 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3706 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3707 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3708 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3709 anObj.SetParameters(Parameters)
3710 self._autoPublish(anObj, theName, "prism")
3713 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3714 # i.e. all the space, transfixed by the base shape during its translation
3715 # along the vector on the given distance in 2 Ways (forward/backward).
3716 # @param theBase Base shape to be extruded.
3717 # @param theDX, theDY, theDZ Directions of extrusion.
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 prism.
3724 # @ref tui_creation_prism "Example"
3725 @ManageTransactions("PrimOp")
3726 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3728 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3729 i.e. all the space, transfixed by the base shape during its translation
3730 along the vector on the given distance in 2 Ways (forward/backward).
3733 theBase Base shape to be extruded.
3734 theDX, theDY, theDZ Directions of extrusion.
3735 theName Object name; when specified, this parameter is used
3736 for result publication in the study. Otherwise, if automatic
3737 publication is switched on, default value is used for result name.
3740 New GEOM.GEOM_Object, containing the created prism.
3742 # Example: see GEOM_TestAll.py
3743 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3744 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3745 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3746 anObj.SetParameters(Parameters)
3747 self._autoPublish(anObj, theName, "prism")
3750 ## Create a shape by revolution of the base shape around the axis
3751 # on the given angle, i.e. all the space, transfixed by the base
3752 # shape during its rotation around the axis on the given angle.
3753 # @param theBase Base shape to be rotated.
3754 # @param theAxis Rotation axis.
3755 # @param theAngle Rotation angle in radians.
3756 # @param theName Object name; when specified, this parameter is used
3757 # for result publication in the study. Otherwise, if automatic
3758 # publication is switched on, default value is used for result name.
3760 # @return New GEOM.GEOM_Object, containing the created revolution.
3762 # @ref tui_creation_revolution "Example"
3763 @ManageTransactions("PrimOp")
3764 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3766 Create a shape by revolution of the base shape around the axis
3767 on the given angle, i.e. all the space, transfixed by the base
3768 shape during its rotation around the axis on the given angle.
3771 theBase Base shape to be rotated.
3772 theAxis Rotation axis.
3773 theAngle Rotation angle in radians.
3774 theName Object name; when specified, this parameter is used
3775 for result publication in the study. Otherwise, if automatic
3776 publication is switched on, default value is used for result name.
3779 New GEOM.GEOM_Object, containing the created revolution.
3781 # Example: see GEOM_TestAll.py
3782 theAngle,Parameters = ParseParameters(theAngle)
3783 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3784 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3785 anObj.SetParameters(Parameters)
3786 self._autoPublish(anObj, theName, "revolution")
3789 ## Create a shape by revolution of the base shape around the axis
3790 # on the given angle, i.e. all the space, transfixed by the base
3791 # shape during its rotation around the axis on the given angle in
3792 # both directions (forward/backward)
3793 # @param theBase Base shape to be rotated.
3794 # @param theAxis Rotation axis.
3795 # @param theAngle Rotation angle in radians.
3796 # @param theName Object name; when specified, this parameter is used
3797 # for result publication in the study. Otherwise, if automatic
3798 # publication is switched on, default value is used for result name.
3800 # @return New GEOM.GEOM_Object, containing the created revolution.
3802 # @ref tui_creation_revolution "Example"
3803 @ManageTransactions("PrimOp")
3804 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3806 Create a shape by revolution of the base shape around the axis
3807 on the given angle, i.e. all the space, transfixed by the base
3808 shape during its rotation around the axis on the given angle in
3809 both directions (forward/backward).
3812 theBase Base shape to be rotated.
3813 theAxis Rotation axis.
3814 theAngle Rotation angle in radians.
3815 theName Object name; when specified, this parameter is used
3816 for result publication in the study. Otherwise, if automatic
3817 publication is switched on, default value is used for result name.
3820 New GEOM.GEOM_Object, containing the created revolution.
3822 theAngle,Parameters = ParseParameters(theAngle)
3823 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3824 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3825 anObj.SetParameters(Parameters)
3826 self._autoPublish(anObj, theName, "revolution")
3829 ## Create a face from a given set of contours.
3830 # @param theContours either a list or a compound of edges/wires.
3831 # @param theMinDeg a minimal degree of BSpline surface to create.
3832 # @param theMaxDeg a maximal degree of BSpline surface to create.
3833 # @param theTol2D a 2d tolerance to be reached.
3834 # @param theTol3D a 3d tolerance to be reached.
3835 # @param theNbIter a number of iteration of approximation algorithm.
3836 # @param theMethod Kind of method to perform filling operation
3837 # (see GEOM.filling_oper_method enum).
3838 # @param isApprox if True, BSpline curves are generated in the process
3839 # of surface construction. By default it is False, that means
3840 # the surface is created using given curves. The usage of
3841 # Approximation makes the algorithm work slower, but allows
3842 # building the surface for rather complex cases.
3843 # @param theName Object name; when specified, this parameter is used
3844 # for result publication in the study. Otherwise, if automatic
3845 # publication is switched on, default value is used for result name.
3847 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3849 # @ref tui_creation_filling "Example"
3850 @ManageTransactions("PrimOp")
3851 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3852 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3854 Create a face from a given set of contours.
3857 theContours either a list or a compound of edges/wires.
3858 theMinDeg a minimal degree of BSpline surface to create.
3859 theMaxDeg a maximal degree of BSpline surface to create.
3860 theTol2D a 2d tolerance to be reached.
3861 theTol3D a 3d tolerance to be reached.
3862 theNbIter a number of iteration of approximation algorithm.
3863 theMethod Kind of method to perform filling operation
3864 (see GEOM.filling_oper_method enum).
3865 isApprox if True, BSpline curves are generated in the process
3866 of surface construction. By default it is False, that means
3867 the surface is created using given curves. The usage of
3868 Approximation makes the algorithm work slower, but allows
3869 building the surface for rather complex cases.
3870 theName Object name; when specified, this parameter is used
3871 for result publication in the study. Otherwise, if automatic
3872 publication is switched on, default value is used for result name.
3875 New GEOM.GEOM_Object (face), containing the created filling surface.
3878 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3880 # Example: see GEOM_TestAll.py
3881 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3882 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3883 theTol2D, theTol3D, theNbIter,
3884 theMethod, isApprox)
3885 RaiseIfFailed("MakeFilling", self.PrimOp)
3886 anObj.SetParameters(Parameters)
3887 self._autoPublish(anObj, theName, "filling")
3891 ## Create a face from a given set of contours.
3892 # This method corresponds to MakeFilling() with isApprox=True.
3893 # @param theContours either a list or a compound of edges/wires.
3894 # @param theMinDeg a minimal degree of BSpline surface to create.
3895 # @param theMaxDeg a maximal degree of BSpline surface to create.
3896 # @param theTol3D a 3d tolerance to be reached.
3897 # @param theName Object name; when specified, this parameter is used
3898 # for result publication in the study. Otherwise, if automatic
3899 # publication is switched on, default value is used for result name.
3901 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3903 # @ref tui_creation_filling "Example"
3904 @ManageTransactions("PrimOp")
3905 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3907 Create a filling from the given compound of contours.
3908 This method corresponds to MakeFilling() with isApprox=True.
3911 theContours either a list or a compound of edges/wires.
3912 theMinDeg a minimal degree of BSpline surface to create.
3913 theMaxDeg a maximal degree of BSpline surface to create.
3914 theTol3D a 3d tolerance to be reached.
3915 theName Object name; when specified, this parameter is used
3916 for result publication in the study. Otherwise, if automatic
3917 publication is switched on, default value is used for result name.
3920 New GEOM.GEOM_Object (face), containing the created filling surface.
3923 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3925 # Example: see GEOM_TestAll.py
3926 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3927 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3928 0, theTol3D, 0, GEOM.FOM_Default, True)
3929 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3930 anObj.SetParameters(Parameters)
3931 self._autoPublish(anObj, theName, "filling")
3934 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3935 # @param theSeqSections - set of specified sections.
3936 # @param theModeSolid - mode defining building solid or shell
3937 # @param thePreci - precision 3D used for smoothing
3938 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3939 # @param theName Object name; when specified, this parameter is used
3940 # for result publication in the study. Otherwise, if automatic
3941 # publication is switched on, default value is used for result name.
3943 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3945 # @ref swig_todo "Example"
3946 @ManageTransactions("PrimOp")
3947 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3949 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3952 theSeqSections - set of specified sections.
3953 theModeSolid - mode defining building solid or shell
3954 thePreci - precision 3D used for smoothing
3955 theRuled - mode defining type of the result surfaces (ruled or smoothed).
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 shell or solid.
3963 # Example: see GEOM_TestAll.py
3964 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3965 RaiseIfFailed("MakeThruSections", self.PrimOp)
3966 self._autoPublish(anObj, theName, "filling")
3969 ## Create a shape by extrusion of the base shape along
3970 # the path shape. The path shape can be a wire or an edge. It is
3971 # possible to generate groups along with the result by means of
3972 # setting the flag \a IsGenerateGroups.<BR>
3973 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3974 # set, an error is occurred. If \a thePath is not closed edge/wire,
3975 # the following groups are returned:
3976 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3978 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3981 # "Down" and "Up" groups contain:
3982 # - Edges if \a theBase is edge or wire;
3983 # - Faces if \a theBase is face or shell.<BR>
3985 # "Side1" and "Side2" groups contain edges generated from the first
3986 # and last vertices of \a theBase. The first and last vertices are
3987 # determined taking into account edge/wire orientation.<BR>
3988 # "Other" group represents faces generated from the bounding edges of
3991 # @param theBase Base shape to be extruded.
3992 # @param thePath Path shape to extrude the base shape along it.
3993 # @param IsGenerateGroups flag that tells if it is necessary to
3994 # create groups. It is equal to False by default.
3995 # @param theName Object name; when specified, this parameter is used
3996 # for result publication in the study. Otherwise, if automatic
3997 # publication is switched on, default value is used for result name.
3999 # @return New GEOM.GEOM_Object, containing the created pipe if
4000 # \a IsGenerateGroups is not set. Otherwise it returns a
4001 # list of GEOM.GEOM_Object. Its first element is the created pipe, the
4002 # remaining ones are created groups.
4004 # @ref tui_creation_pipe "Example"
4005 @ManageTransactions("PrimOp")
4006 def MakePipe(self, theBase, thePath,
4007 IsGenerateGroups=False, theName=None):
4009 Create a shape by extrusion of the base shape along
4010 the path shape. The path shape can be a wire or an edge. It is
4011 possible to generate groups along with the result by means of
4012 setting the flag IsGenerateGroups.
4013 If thePath is a closed edge or wire and IsGenerateGroups is
4014 set, an error is occurred. If thePath is not closed edge/wire,
4015 the following groups are returned:
4016 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4018 - If theBase is closed edge or wire, face or shell: "Down", "Up",
4020 "Down" and "Up" groups contain:
4021 - Edges if theBase is edge or wire;
4022 - Faces if theBase is face or shell.
4023 "Side1" and "Side2" groups contain edges generated from the first
4024 and last vertices of theBase. The first and last vertices are
4025 determined taking into account edge/wire orientation.
4026 "Other" group represents faces generated from the bounding edges of
4030 theBase Base shape to be extruded.
4031 thePath Path shape to extrude the base shape along it.
4032 IsGenerateGroups flag that tells if it is necessary to
4033 create groups. It is equal to False by default.
4034 theName Object name; when specified, this parameter is used
4035 for result publication in the study. Otherwise, if automatic
4036 publication is switched on, default value is used for result name.
4039 New GEOM.GEOM_Object, containing the created pipe if
4040 IsGenerateGroups is not set. Otherwise it returns a
4041 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4042 remaining ones are created groups.
4044 # Example: see GEOM_TestAll.py
4045 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4046 RaiseIfFailed("MakePipe", self.PrimOp)
4048 if IsGenerateGroups:
4049 self._autoPublish(aList, theName, "pipe")
4052 self._autoPublish(aList[0], theName, "pipe")
4055 ## Create a shape by extrusion of the profile shape along
4056 # the path shape. The path shape can be a wire or an edge.
4057 # the several profiles can be specified in the several locations of path.
4058 # It is possible to generate groups along with the result by means of
4059 # setting the flag \a IsGenerateGroups. For detailed information on
4060 # groups that can be created please see the method MakePipe().
4061 # @param theSeqBases - list of Bases shape to be extruded.
4062 # @param theLocations - list of locations on the path corresponding
4063 # specified list of the Bases shapes. Number of locations
4064 # should be equal to number of bases or list of locations can be empty.
4065 # @param thePath - Path shape to extrude the base shape along it.
4066 # @param theWithContact - the mode defining that the section is translated to be in
4067 # contact with the spine.
4068 # @param theWithCorrection - defining that the section is rotated to be
4069 # orthogonal to the spine tangent in the correspondent point
4070 # @param IsGenerateGroups - flag that tells if it is necessary to
4071 # create groups. It is equal to False by default.
4072 # @param theName Object name; when specified, this parameter is used
4073 # for result publication in the study. Otherwise, if automatic
4074 # publication is switched on, default value is used for result name.
4076 # @return New GEOM.GEOM_Object, containing the created pipe if
4077 # \a IsGenerateGroups is not set. Otherwise it returns new
4078 # GEOM.ListOfGO. Its first element is the created pipe, the
4079 # remaining ones are created groups.
4081 # @ref tui_creation_pipe_with_diff_sec "Example"
4082 @ManageTransactions("PrimOp")
4083 def MakePipeWithDifferentSections(self, theSeqBases,
4084 theLocations, thePath,
4085 theWithContact, theWithCorrection,
4086 IsGenerateGroups=False, theName=None):
4088 Create a shape by extrusion of the profile shape along
4089 the path shape. The path shape can be a wire or an edge.
4090 the several profiles can be specified in the several locations of path.
4091 It is possible to generate groups along with the result by means of
4092 setting the flag IsGenerateGroups. For detailed information on
4093 groups that can be created please see the method geompy.MakePipe().
4096 theSeqBases - list of Bases shape to be extruded.
4097 theLocations - list of locations on the path corresponding
4098 specified list of the Bases shapes. Number of locations
4099 should be equal to number of bases or list of locations can be empty.
4100 thePath - Path shape to extrude the base shape along it.
4101 theWithContact - the mode defining that the section is translated to be in
4102 contact with the spine(0/1)
4103 theWithCorrection - defining that the section is rotated to be
4104 orthogonal to the spine tangent in the correspondent point (0/1)
4105 IsGenerateGroups - flag that tells if it is necessary to
4106 create groups. It is equal to False by default.
4107 theName Object name; when specified, this parameter is used
4108 for result publication in the study. Otherwise, if automatic
4109 publication is switched on, default value is used for result name.
4112 New GEOM.GEOM_Object, containing the created pipe if
4113 IsGenerateGroups is not set. Otherwise it returns new
4114 GEOM.ListOfGO. Its first element is the created pipe, the
4115 remaining ones are created groups.
4117 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4118 theLocations, thePath,
4119 theWithContact, theWithCorrection,
4120 False, IsGenerateGroups)
4121 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4123 if IsGenerateGroups:
4124 self._autoPublish(aList, theName, "pipe")
4127 self._autoPublish(aList[0], theName, "pipe")
4130 ## Create a shape by extrusion of the profile shape along
4131 # the path shape. This function is a version of
4132 # MakePipeWithDifferentSections() with the same parameters, except
4133 # eliminated theWithContact and theWithCorrection. So it is
4134 # possible to find the description of all parameters is in this
4135 # method. The difference is that this method performs the operation
4136 # step by step, i.e. it creates pipes between each pair of neighbor
4137 # sections and fuses them into a single shape.
4139 # @ref tui_creation_pipe_with_diff_sec "Example"
4140 @ManageTransactions("PrimOp")
4141 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4142 theLocations, thePath,
4143 IsGenerateGroups=False, theName=None):
4145 Create a shape by extrusion of the profile shape along
4146 the path shape. This function is a version of
4147 MakePipeWithDifferentSections() with the same parameters, except
4148 eliminated theWithContact and theWithCorrection. So it is
4149 possible to find the description of all parameters is in this
4150 method. The difference is that this method performs the operation
4151 step by step, i.e. it creates pipes between each pair of neighbor
4152 sections and fuses them into a single shape.
4154 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4155 theLocations, thePath,
4157 True, IsGenerateGroups)
4158 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4160 if IsGenerateGroups:
4161 self._autoPublish(aList, theName, "pipe")
4164 self._autoPublish(aList[0], theName, "pipe")
4167 ## Create a shape by extrusion of the profile shape along
4168 # the path shape. The path shape can be a wire or an edge.
4169 # the several profiles can be specified in the several locations of path.
4170 # It is possible to generate groups along with the result by means of
4171 # setting the flag \a IsGenerateGroups. For detailed information on
4172 # groups that can be created please see the method MakePipe().
4173 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4174 # shell or face. If number of faces in neighbour sections
4175 # aren't coincided result solid between such sections will
4176 # be created using external boundaries of this shells.
4177 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4178 # This list is used for searching correspondences between
4179 # faces in the sections. Size of this list must be equal
4180 # to size of list of base shapes.
4181 # @param theLocations - list of locations on the path corresponding
4182 # specified list of the Bases shapes. Number of locations
4183 # should be equal to number of bases. First and last
4184 # locations must be coincided with first and last vertexes
4185 # of path correspondingly.
4186 # @param thePath - Path shape to extrude the base shape along it.
4187 # @param theWithContact - the mode defining that the section is translated to be in
4188 # contact with the spine.
4189 # @param theWithCorrection - defining that the section is rotated to be
4190 # orthogonal to the spine tangent in the correspondent point
4191 # @param IsGenerateGroups - flag that tells if it is necessary to
4192 # create groups. It is equal to False by default.
4193 # @param theName Object name; when specified, this parameter is used
4194 # for result publication in the study. Otherwise, if automatic
4195 # publication is switched on, default value is used for result name.
4197 # @return New GEOM.GEOM_Object, containing the created solids if
4198 # \a IsGenerateGroups is not set. Otherwise it returns new
4199 # GEOM.ListOfGO. Its first element is the created solids, the
4200 # remaining ones are created groups.
4202 # @ref tui_creation_pipe_with_shell_sec "Example"
4203 @ManageTransactions("PrimOp")
4204 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4205 theLocations, thePath,
4206 theWithContact, theWithCorrection,
4207 IsGenerateGroups=False, theName=None):
4209 Create a shape by extrusion of the profile shape along
4210 the path shape. The path shape can be a wire or an edge.
4211 the several profiles can be specified in the several locations of path.
4212 It is possible to generate groups along with the result by means of
4213 setting the flag IsGenerateGroups. For detailed information on
4214 groups that can be created please see the method geompy.MakePipe().
4217 theSeqBases - list of Bases shape to be extruded. Base shape must be
4218 shell or face. If number of faces in neighbour sections
4219 aren't coincided result solid between such sections will
4220 be created using external boundaries of this shells.
4221 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4222 This list is used for searching correspondences between
4223 faces in the sections. Size of this list must be equal
4224 to size of list of base shapes.
4225 theLocations - list of locations on the path corresponding
4226 specified list of the Bases shapes. Number of locations
4227 should be equal to number of bases. First and last
4228 locations must be coincided with first and last vertexes
4229 of path correspondingly.
4230 thePath - Path shape to extrude the base shape along it.
4231 theWithContact - the mode defining that the section is translated to be in
4232 contact with the spine (0/1)
4233 theWithCorrection - defining that the section is rotated to be
4234 orthogonal to the spine tangent in the correspondent point (0/1)
4235 IsGenerateGroups - flag that tells if it is necessary to
4236 create groups. It is equal to False by default.
4237 theName Object name; when specified, this parameter is used
4238 for result publication in the study. Otherwise, if automatic
4239 publication is switched on, default value is used for result name.
4242 New GEOM.GEOM_Object, containing the created solids if
4243 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 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4248 theLocations, thePath,
4249 theWithContact, theWithCorrection,
4251 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4253 if IsGenerateGroups:
4254 self._autoPublish(aList, theName, "pipe")
4257 self._autoPublish(aList[0], theName, "pipe")
4260 ## Create a shape by extrusion of the profile shape along
4261 # the path shape. This function is used only for debug pipe
4262 # functionality - it is a version of function MakePipeWithShellSections()
4263 # which give a possibility to receive information about
4264 # creating pipe between each pair of sections step by step.
4265 @ManageTransactions("PrimOp")
4266 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4267 theLocations, thePath,
4268 theWithContact, theWithCorrection,
4269 IsGenerateGroups=False, theName=None):
4271 Create a shape by extrusion of the profile shape along
4272 the path shape. This function is used only for debug pipe
4273 functionality - it is a version of previous function
4274 geompy.MakePipeWithShellSections() which give a possibility to
4275 receive information about creating pipe between each pair of
4276 sections step by step.
4279 nbsect = len(theSeqBases)
4280 nbsubsect = len(theSeqSubBases)
4281 #print "nbsect = ",nbsect
4282 for i in range(1,nbsect):
4284 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4285 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4287 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4288 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4289 tmpLocations, thePath,
4290 theWithContact, theWithCorrection,
4292 if self.PrimOp.IsDone() == 0:
4293 print("Problems with pipe creation between ",i," and ",i+1," sections")
4294 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4297 print("Pipe between ",i," and ",i+1," sections is OK")
4298 res.append(aList[0])
4302 resc = self.MakeCompound(res)
4303 #resc = self.MakeSewing(res, 0.001)
4304 #print "resc: ",resc
4305 self._autoPublish(resc, theName, "pipe")
4308 ## Create solids between given sections.
4309 # It is possible to generate groups along with the result by means of
4310 # setting the flag \a IsGenerateGroups. For detailed information on
4311 # groups that can be created please see the method MakePipe().
4312 # @param theSeqBases - list of sections (shell or face).
4313 # @param theLocations - list of corresponding vertexes
4314 # @param IsGenerateGroups - flag that tells if it is necessary to
4315 # create groups. It is equal to False by default.
4316 # @param theName Object name; when specified, this parameter is used
4317 # for result publication in the study. Otherwise, if automatic
4318 # publication is switched on, default value is used for result name.
4320 # @return New GEOM.GEOM_Object, containing the created solids if
4321 # \a IsGenerateGroups is not set. Otherwise it returns new
4322 # GEOM.ListOfGO. Its first element is the created solids, the
4323 # remaining ones are created groups.
4325 # @ref tui_creation_pipe_without_path "Example"
4326 @ManageTransactions("PrimOp")
4327 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4328 IsGenerateGroups=False, theName=None):
4330 Create solids between given sections.
4331 It is possible to generate groups along with the result by means of
4332 setting the flag IsGenerateGroups. For detailed information on
4333 groups that can be created please see the method geompy.MakePipe().
4336 theSeqBases - list of sections (shell or face).
4337 theLocations - list of corresponding vertexes
4338 IsGenerateGroups - flag that tells if it is necessary to
4339 create groups. It is equal to False by default.
4340 theName Object name; when specified, this parameter is used
4341 for result publication in the study. Otherwise, if automatic
4342 publication is switched on, default value is used for result name.
4345 New GEOM.GEOM_Object, containing the created solids if
4346 IsGenerateGroups is not set. Otherwise it returns new
4347 GEOM.ListOfGO. Its first element is the created solids, the
4348 remaining ones are created groups.
4350 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4352 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4354 if IsGenerateGroups:
4355 self._autoPublish(aList, theName, "pipe")
4358 self._autoPublish(aList[0], theName, "pipe")
4361 ## Create a shape by extrusion of the base shape along
4362 # the path shape with constant bi-normal direction along the given vector.
4363 # The path shape can be a wire or an edge.
4364 # It is possible to generate groups along with the result by means of
4365 # setting the flag \a IsGenerateGroups. For detailed information on
4366 # groups that can be created please see the method MakePipe().
4367 # @param theBase Base shape to be extruded.
4368 # @param thePath Path shape to extrude the base shape along it.
4369 # @param theVec Vector defines a constant binormal direction to keep the
4370 # same angle between the direction and the sections
4371 # along the sweep surface.
4372 # @param IsGenerateGroups flag that tells if it is necessary to
4373 # create groups. It is equal to False by default.
4374 # @param theName Object name; when specified, this parameter is used
4375 # for result publication in the study. Otherwise, if automatic
4376 # publication is switched on, default value is used for result name.
4378 # @return New GEOM.GEOM_Object, containing the created pipe if
4379 # \a IsGenerateGroups is not set. Otherwise it returns new
4380 # GEOM.ListOfGO. Its first element is the created pipe, the
4381 # remaining ones are created groups.
4383 # @ref tui_creation_pipe "Example"
4384 @ManageTransactions("PrimOp")
4385 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4386 IsGenerateGroups=False, theName=None):
4388 Create a shape by extrusion of the base shape along
4389 the path shape with constant bi-normal direction along the given vector.
4390 The path shape can be a wire or an edge.
4391 It is possible to generate groups along with the result by means of
4392 setting the flag IsGenerateGroups. For detailed information on
4393 groups that can be created please see the method geompy.MakePipe().
4396 theBase Base shape to be extruded.
4397 thePath Path shape to extrude the base shape along it.
4398 theVec Vector defines a constant binormal direction to keep the
4399 same angle between the direction and the sections
4400 along the sweep surface.
4401 IsGenerateGroups flag that tells if it is necessary to
4402 create groups. It is equal to False by default.
4403 theName Object name; when specified, this parameter is used
4404 for result publication in the study. Otherwise, if automatic
4405 publication is switched on, default value is used for result name.
4408 New GEOM.GEOM_Object, containing the created pipe if
4409 IsGenerateGroups is not set. Otherwise it returns new
4410 GEOM.ListOfGO. Its first element is the created pipe, the
4411 remaining ones are created groups.
4413 # Example: see GEOM_TestAll.py
4414 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4415 theVec, IsGenerateGroups)
4416 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4418 if IsGenerateGroups:
4419 self._autoPublish(aList, theName, "pipe")
4422 self._autoPublish(aList[0], theName, "pipe")
4425 ## Makes a thick solid from a shape. If the input is a surface shape
4426 # (face or shell) the result is a thick solid. If an input shape is
4427 # a solid the result is a hollowed solid with removed faces.
4428 # @param theShape Face or Shell to get thick solid or solid to get
4430 # @param theThickness Thickness of the resulting solid
4431 # @param theFacesIDs the list of face IDs to be removed from the
4432 # result. It is ignored if \a theShape is a face or a shell.
4433 # It is empty by default.
4434 # @param theInside If true the thickness is applied towards inside
4435 # @param theName Object name; when specified, this parameter is used
4436 # for result publication in the study. Otherwise, if automatic
4437 # publication is switched on, default value is used for result name.
4439 # @return New GEOM.GEOM_Object, containing the created solid
4441 # @ref tui_creation_thickness "Example"
4442 @ManageTransactions("PrimOp")
4443 def MakeThickSolid(self, theShape, theThickness,
4444 theFacesIDs=[], theInside=False, theName=None):
4446 Make a thick solid from a shape. If the input is a surface shape
4447 (face or shell) the result is a thick solid. If an input shape is
4448 a solid the result is a hollowed solid with removed faces.
4451 theShape Face or Shell to get thick solid or solid to get
4453 theThickness Thickness of the resulting solid
4454 theFacesIDs the list of face IDs to be removed from the
4455 result. It is ignored if theShape is a face or a
4456 shell. It is empty by default.
4457 theInside If true the thickness is applied towards inside
4458 theName Object name; when specified, this parameter is used
4459 for result publication in the study. Otherwise, if automatic
4460 publication is switched on, default value is used for result name.
4463 New GEOM.GEOM_Object, containing the created solid
4465 # Example: see GEOM_TestAll.py
4466 theThickness,Parameters = ParseParameters(theThickness)
4467 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4468 theThickness, True, theInside)
4469 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4470 anObj.SetParameters(Parameters)
4471 self._autoPublish(anObj, theName, "thickSolid")
4475 ## Modifies a shape to make it a thick solid. If the input is a surface
4476 # shape (face or shell) the result is a thick solid. If an input shape
4477 # is a solid the result is a hollowed solid with removed faces.
4478 # @param theShape Face or Shell to get thick solid or solid to get
4480 # @param theThickness Thickness of the resulting solid
4481 # @param theFacesIDs the list of face IDs to be removed from the
4482 # result. It is ignored if \a theShape is a face or a shell.
4483 # It is empty by default.
4484 # @param theInside If true the thickness is applied towards inside
4486 # @return The modified shape
4488 # @ref tui_creation_thickness "Example"
4489 @ManageTransactions("PrimOp")
4490 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4492 Modifies a shape to make it a thick solid. If the input is a
4493 surface shape (face or shell) the result is a thick solid. If
4494 an input shape is a solid the result is a hollowed solid with
4498 theShape Face or Shell to get thick solid or solid to get
4500 theThickness Thickness of the resulting solid
4501 theFacesIDs the list of face IDs to be removed from the
4502 result. It is ignored if \a theShape is a face or
4503 a shell. It is empty by default.
4504 theInside If true the thickness is applied towards inside
4509 # Example: see GEOM_TestAll.py
4510 theThickness,Parameters = ParseParameters(theThickness)
4511 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4512 theThickness, False, theInside)
4513 RaiseIfFailed("Thicken", self.PrimOp)
4514 anObj.SetParameters(Parameters)
4517 ## Build a middle path of a pipe-like shape.
4518 # The path shape can be a wire or an edge.
4519 # @param theShape It can be closed or unclosed pipe-like shell
4520 # or a pipe-like solid.
4521 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4522 # should be wires or faces of theShape.
4523 # @param theName Object name; when specified, this parameter is used
4524 # for result publication in the study. Otherwise, if automatic
4525 # publication is switched on, default value is used for result name.
4527 # @note It is not assumed that exact or approximate copy of theShape
4528 # can be obtained by applying existing Pipe operation on the
4529 # resulting "Path" wire taking theBase1 as the base - it is not
4530 # always possible; though in some particular cases it might work
4531 # it is not guaranteed. Thus, RestorePath function should not be
4532 # considered as an exact reverse operation of the Pipe.
4534 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4535 # source pipe's "path".
4537 # @ref tui_creation_pipe_path "Example"
4538 @ManageTransactions("PrimOp")
4539 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4541 Build a middle path of a pipe-like shape.
4542 The path shape can be a wire or an edge.
4545 theShape It can be closed or unclosed pipe-like shell
4546 or a pipe-like solid.
4547 theBase1, theBase2 Two bases of the supposed pipe. This
4548 should be wires or faces of theShape.
4549 theName Object name; when specified, this parameter is used
4550 for result publication in the study. Otherwise, if automatic
4551 publication is switched on, default value is used for result name.
4554 New GEOM_Object, containing an edge or wire that represent
4557 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4558 RaiseIfFailed("RestorePath", self.PrimOp)
4559 self._autoPublish(anObj, theName, "path")
4562 ## Build a middle path of a pipe-like shape.
4563 # The path shape can be a wire or an edge.
4564 # @param theShape It can be closed or unclosed pipe-like shell
4565 # or a pipe-like solid.
4566 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4567 # should be lists of edges of theShape.
4568 # @param theName Object name; when specified, this parameter is used
4569 # for result publication in the study. Otherwise, if automatic
4570 # publication is switched on, default value is used for result name.
4572 # @note It is not assumed that exact or approximate copy of theShape
4573 # can be obtained by applying existing Pipe operation on the
4574 # resulting "Path" wire taking theBase1 as the base - it is not
4575 # always possible; though in some particular cases it might work
4576 # it is not guaranteed. Thus, RestorePath function should not be
4577 # considered as an exact reverse operation of the Pipe.
4579 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4580 # source pipe's "path".
4582 # @ref tui_creation_pipe_path "Example"
4583 @ManageTransactions("PrimOp")
4584 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4586 Build a middle path of a pipe-like shape.
4587 The path shape can be a wire or an edge.
4590 theShape It can be closed or unclosed pipe-like shell
4591 or a pipe-like solid.
4592 listEdges1, listEdges2 Two bases of the supposed pipe. This
4593 should be lists of edges of theShape.
4594 theName Object name; when specified, this parameter is used
4595 for result publication in the study. Otherwise, if automatic
4596 publication is switched on, default value is used for result name.
4599 New GEOM_Object, containing an edge or wire that represent
4602 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4603 RaiseIfFailed("RestorePath", self.PrimOp)
4604 self._autoPublish(anObj, theName, "path")
4610 ## @addtogroup l3_basic_go
4613 ## Create a linear edge with specified ends.
4614 # @param thePnt1 Point for the first end of edge.
4615 # @param thePnt2 Point for the second end of edge.
4616 # @param theName Object name; when specified, this parameter is used
4617 # for result publication in the study. Otherwise, if automatic
4618 # publication is switched on, default value is used for result name.
4620 # @return New GEOM.GEOM_Object, containing the created edge.
4622 # @ref tui_creation_edge "Example"
4623 @ManageTransactions("ShapesOp")
4624 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4626 Create a linear edge with specified ends.
4629 thePnt1 Point for the first end of edge.
4630 thePnt2 Point for the second end of edge.
4631 theName Object name; when specified, this parameter is used
4632 for result publication in the study. Otherwise, if automatic
4633 publication is switched on, default value is used for result name.
4636 New GEOM.GEOM_Object, containing the created edge.
4638 # Example: see GEOM_TestAll.py
4639 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4640 RaiseIfFailed("MakeEdge", self.ShapesOp)
4641 self._autoPublish(anObj, theName, "edge")
4644 ## Create a new edge, corresponding to the given length on the given curve.
4645 # @param theRefCurve The referenced curve (edge).
4646 # @param theLength Length on the referenced curve. It can be negative.
4647 # @param theStartPoint Any point can be selected for it, the new edge will begin
4648 # at the end of \a theRefCurve, close to the selected point.
4649 # If None, start from the first point of \a theRefCurve.
4650 # @param theName Object name; when specified, this parameter is used
4651 # for result publication in the study. Otherwise, if automatic
4652 # publication is switched on, default value is used for result name.
4654 # @return New GEOM.GEOM_Object, containing the created edge.
4656 # @ref tui_creation_edge "Example"
4657 @ManageTransactions("ShapesOp")
4658 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4660 Create a new edge, corresponding to the given length on the given curve.
4663 theRefCurve The referenced curve (edge).
4664 theLength Length on the referenced curve. It can be negative.
4665 theStartPoint Any point can be selected for it, the new edge will begin
4666 at the end of theRefCurve, close to the selected point.
4667 If None, start from the first point of theRefCurve.
4668 theName Object name; when specified, this parameter is used
4669 for result publication in the study. Otherwise, if automatic
4670 publication is switched on, default value is used for result name.
4673 New GEOM.GEOM_Object, containing the created edge.
4675 # Example: see GEOM_TestAll.py
4676 theLength, Parameters = ParseParameters(theLength)
4677 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4678 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4679 anObj.SetParameters(Parameters)
4680 self._autoPublish(anObj, theName, "edge")
4683 ## Create an edge from specified wire.
4684 # @param theWire source Wire
4685 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4686 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4687 # @param theName Object name; when specified, this parameter is used
4688 # for result publication in the study. Otherwise, if automatic
4689 # publication is switched on, default value is used for result name.
4691 # @return New GEOM.GEOM_Object, containing the created edge.
4693 # @ref tui_creation_edge "Example"
4694 @ManageTransactions("ShapesOp")
4695 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4697 Create an edge from specified wire.
4701 theLinearTolerance linear tolerance value (default = 1e-07)
4702 theAngularTolerance angular tolerance value (default = 1e-12)
4703 theName Object name; when specified, this parameter is used
4704 for result publication in the study. Otherwise, if automatic
4705 publication is switched on, default value is used for result name.
4708 New GEOM.GEOM_Object, containing the created edge.
4710 # Example: see GEOM_TestAll.py
4711 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4712 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4713 self._autoPublish(anObj, theName, "edge")
4716 ## Create a wire from the set of edges and wires.
4717 # @param theEdgesAndWires List of edges and/or wires.
4718 # @param theTolerance Maximum distance between vertices, that will be merged.
4719 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
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 wire.
4726 # @ref tui_creation_wire "Example"
4727 @ManageTransactions("ShapesOp")
4728 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4730 Create a wire from the set of edges and wires.
4733 theEdgesAndWires List of edges and/or wires.
4734 theTolerance Maximum distance between vertices, that will be merged.
4735 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4736 theName Object name; when specified, this parameter is used
4737 for result publication in the study. Otherwise, if automatic
4738 publication is switched on, default value is used for result name.
4741 New GEOM.GEOM_Object, containing the created wire.
4743 # Example: see GEOM_TestAll.py
4744 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4745 RaiseIfFailed("MakeWire", self.ShapesOp)
4746 self._autoPublish(anObj, theName, "wire")
4749 ## Create a face on the given wire.
4750 # @param theWire closed Wire or Edge to build the face on.
4751 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4752 # If the tolerance of the obtained planar face is less
4753 # than 1e-06, this face will be returned, otherwise the
4754 # algorithm tries to build any suitable face on the given
4755 # wire and prints a warning message.
4756 # @param theName Object name; when specified, this parameter is used
4757 # for result publication in the study. Otherwise, if automatic
4758 # publication is switched on, default value is used for result name.
4760 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4762 # @ref tui_creation_face "Example"
4763 @ManageTransactions("ShapesOp")
4764 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4766 Create a face on the given wire.
4769 theWire closed Wire or Edge to build the face on.
4770 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4771 If the tolerance of the obtained planar face is less
4772 than 1e-06, this face will be returned, otherwise the
4773 algorithm tries to build any suitable face on the given
4774 wire and prints a warning message.
4775 theName Object name; when specified, this parameter is used
4776 for result publication in the study. Otherwise, if automatic
4777 publication is switched on, default value is used for result name.
4780 New GEOM.GEOM_Object, containing the created face (compound of faces).
4782 # Example: see GEOM_TestAll.py
4783 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4784 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4785 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4787 RaiseIfFailed("MakeFace", self.ShapesOp)
4788 self._autoPublish(anObj, theName, "face")
4791 ## Create a face on the given wires set.
4792 # @param theWires List of closed wires or edges to build the face on.
4793 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4794 # If the tolerance of the obtained planar face is less
4795 # than 1e-06, this face will be returned, otherwise the
4796 # algorithm tries to build any suitable face on the given
4797 # wire and prints a warning message.
4798 # @param theName Object name; when specified, this parameter is used
4799 # for result publication in the study. Otherwise, if automatic
4800 # publication is switched on, default value is used for result name.
4802 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4804 # @ref tui_creation_face "Example"
4805 @ManageTransactions("ShapesOp")
4806 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4808 Create a face on the given wires set.
4811 theWires List of closed wires or edges to build the face on.
4812 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4813 If the tolerance of the obtained planar face is less
4814 than 1e-06, this face will be returned, otherwise the
4815 algorithm tries to build any suitable face on the given
4816 wire and prints a warning message.
4817 theName Object name; when specified, this parameter is used
4818 for result publication in the study. Otherwise, if automatic
4819 publication is switched on, default value is used for result name.
4822 New GEOM.GEOM_Object, containing the created face (compound of faces).
4824 # Example: see GEOM_TestAll.py
4825 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4826 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4827 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4829 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4830 self._autoPublish(anObj, theName, "face")
4833 ## See MakeFaceWires() method for details.
4835 # @ref tui_creation_face "Example 1"
4836 # \n @ref swig_MakeFaces "Example 2"
4837 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4839 See geompy.MakeFaceWires() method for details.
4841 # Example: see GEOM_TestOthers.py
4842 # note: auto-publishing is done in self.MakeFaceWires()
4843 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4846 ## Create a face based on a surface from given face bounded
4848 # @param theFace the face whose surface is used to create a new face.
4849 # @param theWire the wire that will bound a new face.
4850 # @param theName Object name; when specified, this parameter is used
4851 # for result publication in the study. Otherwise, if automatic
4852 # publication is switched on, default value is used for result name.
4854 # @return New GEOM.GEOM_Object, containing the created face.
4856 # @ref tui_creation_face "Example"
4857 @ManageTransactions("ShapesOp")
4858 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4860 Create a face based on a surface from given face bounded
4864 theFace the face whose surface is used to create a new face.
4865 theWire the wire that will bound a new face.
4866 theName Object name; when specified, this parameter is used
4867 for result publication in the study. Otherwise, if automatic
4868 publication is switched on, default value is used for result name.
4871 New GEOM.GEOM_Object, containing the created face.
4873 # Example: see GEOM_TestAll.py
4874 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4875 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4876 self._autoPublish(anObj, theName, "face")
4879 ## Create a face from a set of edges with the given constraints.
4880 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4881 # - edges should form a closed wire;
4882 # - for each edge, constraint face is optional: if a constraint face is missing
4883 # for some edge, this means that there no constraint associated with this edge.
4884 # @param theName Object name; when specified, this parameter is used
4885 # for result publication in the study. Otherwise, if automatic
4886 # publication is switched on, default value is used for result name.
4888 # @return New GEOM.GEOM_Object, containing the created face.
4890 # @ref tui_creation_face "Example"
4891 @ManageTransactions("ShapesOp")
4892 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4894 Create a face from a set of edges with the given constraints.
4897 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4898 - edges should form a closed wire;
4899 - for each edge, constraint face is optional: if a constraint face is missing
4900 for some edge, this means that there no constraint associated with this edge.
4901 theName Object name; when specified, this parameter is used
4902 for result publication in the study. Otherwise, if automatic
4903 publication is switched on, default value is used for result name.
4906 New GEOM.GEOM_Object, containing the created face.
4908 # Example: see GEOM_TestAll.py
4909 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4911 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4912 self._autoPublish(anObj, theName, "face")
4915 ## Create a shell from the set of faces, shells and/or compounds of faces.
4916 # @param theFacesAndShells List of faces, shells and/or compounds of faces.
4917 # @param theName Object name; when specified, this parameter is used
4918 # for result publication in the study. Otherwise, if automatic
4919 # publication is switched on, default value is used for result name.
4921 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4923 # @ref tui_creation_shell "Example"
4924 @ManageTransactions("ShapesOp")
4925 def MakeShell(self, theFacesAndShells, theName=None):
4927 Create a shell from the set of faces and shells.
4930 theFacesAndShells List of faces and/or shells.
4931 theName Object name; when specified, this parameter is used
4932 for result publication in the study. Otherwise, if automatic
4933 publication is switched on, default value is used for result name.
4936 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4938 # Example: see GEOM_TestAll.py
4939 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4940 RaiseIfFailed("MakeShell", self.ShapesOp)
4941 self._autoPublish(anObj, theName, "shell")
4944 ## Create a solid, bounded by the given shells.
4945 # @param theShells Sequence of bounding shells.
4946 # @param theName Object name; when specified, this parameter is used
4947 # for result publication in the study. Otherwise, if automatic
4948 # publication is switched on, default value is used for result name.
4950 # @return New GEOM.GEOM_Object, containing the created solid.
4952 # @ref tui_creation_solid "Example"
4953 @ManageTransactions("ShapesOp")
4954 def MakeSolid(self, theShells, theName=None):
4956 Create a solid, bounded by the given shells.
4959 theShells Sequence of bounding shells.
4960 theName Object name; when specified, this parameter is used
4961 for result publication in the study. Otherwise, if automatic
4962 publication is switched on, default value is used for result name.
4965 New GEOM.GEOM_Object, containing the created solid.
4967 # Example: see GEOM_TestAll.py
4968 theShells = ToList(theShells)
4969 if len(theShells) == 1:
4970 descr = self._IsGoodForSolid(theShells[0])
4972 # raise RuntimeError, "MakeSolidShells : " + descr
4973 if descr == "WRN_SHAPE_UNCLOSED":
4974 raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4975 anObj = self.ShapesOp.MakeSolidShells(theShells)
4976 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4977 self._autoPublish(anObj, theName, "solid")
4980 ## Create a compound of the given shapes.
4981 # @param theShapes List of shapes to put in compound.
4982 # @param theName Object name; when specified, this parameter is used
4983 # for result publication in the study. Otherwise, if automatic
4984 # publication is switched on, default value is used for result name.
4986 # @return New GEOM.GEOM_Object, containing the created compound.
4988 # @ref tui_creation_compound "Example"
4989 @ManageTransactions("ShapesOp")
4990 def MakeCompound(self, theShapes, theName=None):
4992 Create a compound of the given shapes.
4995 theShapes List of shapes to put in compound.
4996 theName Object name; when specified, this parameter is used
4997 for result publication in the study. Otherwise, if automatic
4998 publication is switched on, default value is used for result name.
5001 New GEOM.GEOM_Object, containing the created compound.
5003 # Example: see GEOM_TestAll.py
5004 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
5005 RaiseIfFailed("MakeCompound", self.ShapesOp)
5006 self._autoPublish(anObj, theName, "compound")
5009 ## Create a solid (or solids) from the set of faces and/or shells.
5010 # @param theFacesOrShells List of faces and/or shells.
5011 # @param isIntersect If TRUE, forces performing intersections
5012 # between arguments; otherwise (default) intersection is not performed.
5013 # @param theName Object name; when specified, this parameter is used
5014 # for result publication in the study. Otherwise, if automatic
5015 # publication is switched on, default value is used for result name.
5017 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5019 # @ref tui_creation_solid_from_faces "Example"
5020 @ManageTransactions("ShapesOp")
5021 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5023 Create a solid (or solids) from the set of connected faces and/or shells.
5026 theFacesOrShells List of faces and/or shells.
5027 isIntersect If TRUE, forces performing intersections
5028 between arguments; otherwise (default) intersection is not performed
5029 theName Object name; when specified, this parameter is used.
5030 for result publication in the study. Otherwise, if automatic
5031 publication is switched on, default value is used for result name.
5034 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5036 # Example: see GEOM_TestAll.py
5037 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5038 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5039 self._autoPublish(anObj, theName, "solid")
5042 # end of l3_basic_go
5045 ## @addtogroup l2_measure
5048 ## Gives quantity of faces in the given shape.
5049 # @param theShape Shape to count faces of.
5050 # @return Quantity of faces.
5052 # @ref swig_NumberOf "Example"
5053 @ManageTransactions("ShapesOp")
5054 def NumberOfFaces(self, theShape):
5056 Gives quantity of faces in the given shape.
5059 theShape Shape to count faces of.
5064 # Example: see GEOM_TestOthers.py
5065 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5066 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5069 ## Gives quantity of edges in the given shape.
5070 # @param theShape Shape to count edges of.
5071 # @return Quantity of edges.
5073 # @ref swig_NumberOf "Example"
5074 @ManageTransactions("ShapesOp")
5075 def NumberOfEdges(self, theShape):
5077 Gives quantity of edges in the given shape.
5080 theShape Shape to count edges of.
5085 # Example: see GEOM_TestOthers.py
5086 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5087 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5090 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5091 # @param theShape Shape to count sub-shapes of.
5092 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5093 # @return Quantity of sub-shapes of given type.
5095 # @ref swig_NumberOf "Example"
5096 @ManageTransactions("ShapesOp")
5097 def NumberOfSubShapes(self, theShape, theShapeType):
5099 Gives quantity of sub-shapes of type theShapeType in the given shape.
5102 theShape Shape to count sub-shapes of.
5103 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5106 Quantity of sub-shapes of given type.
5108 # Example: see GEOM_TestOthers.py
5109 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5110 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5113 ## Gives quantity of solids in the given shape.
5114 # @param theShape Shape to count solids in.
5115 # @return Quantity of solids.
5117 # @ref swig_NumberOf "Example"
5118 @ManageTransactions("ShapesOp")
5119 def NumberOfSolids(self, theShape):
5121 Gives quantity of solids in the given shape.
5124 theShape Shape to count solids in.
5129 # Example: see GEOM_TestOthers.py
5130 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5131 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5137 ## @addtogroup l3_healing
5140 ## Reverses an orientation the given shape.
5141 # @param theShape Shape to be reversed.
5142 # @param theName Object name; when specified, this parameter is used
5143 # for result publication in the study. Otherwise, if automatic
5144 # publication is switched on, default value is used for result name.
5146 # @return The reversed copy of theShape.
5148 # @ref swig_ChangeOrientation "Example"
5149 @ManageTransactions("ShapesOp")
5150 def ChangeOrientation(self, theShape, theName=None):
5152 Reverses an orientation the given shape.
5155 theShape Shape to be reversed.
5156 theName Object name; when specified, this parameter is used
5157 for result publication in the study. Otherwise, if automatic
5158 publication is switched on, default value is used for result name.
5161 The reversed copy of theShape.
5163 # Example: see GEOM_TestAll.py
5164 anObj = self.ShapesOp.ChangeOrientation(theShape)
5165 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5166 self._autoPublish(anObj, theName, "reversed")
5169 ## See ChangeOrientation() method for details.
5171 # @ref swig_OrientationChange "Example"
5172 def OrientationChange(self, theShape, theName=None):
5174 See geompy.ChangeOrientation method for details.
5176 # Example: see GEOM_TestOthers.py
5177 # note: auto-publishing is done in self.ChangeOrientation()
5178 anObj = self.ChangeOrientation(theShape, theName)
5184 ## @addtogroup l4_obtain
5187 ## Retrieve all free faces from the given shape.
5188 # Free face is a face, which is not shared between two shells of the shape.
5189 # @param theShape Shape to find free faces in.
5190 # @return List of IDs of all free faces, contained in theShape.
5192 # @ref tui_free_faces_page "Example"
5193 @ManageTransactions("ShapesOp")
5194 def GetFreeFacesIDs(self,theShape):
5196 Retrieve all free faces from the given shape.
5197 Free face is a face, which is not shared between two shells of the shape.
5200 theShape Shape to find free faces in.
5203 List of IDs of all free faces, contained in theShape.
5205 # Example: see GEOM_TestOthers.py
5206 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5207 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5210 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5211 # @param theShape1 Shape to find sub-shapes in.
5212 # @param theShape2 Shape to find shared sub-shapes with.
5213 # @param theShapeType Type of sub-shapes to be retrieved.
5214 # @param theName Object name; when specified, this parameter is used
5215 # for result publication in the study. Otherwise, if automatic
5216 # publication is switched on, default value is used for result name.
5218 # @return List of sub-shapes of theShape1, shared with theShape2.
5220 # @ref swig_GetSharedShapes "Example"
5221 @ManageTransactions("ShapesOp")
5222 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5224 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5227 theShape1 Shape to find sub-shapes in.
5228 theShape2 Shape to find shared sub-shapes with.
5229 theShapeType Type of sub-shapes to be retrieved.
5230 theName Object name; when specified, this parameter is used
5231 for result publication in the study. Otherwise, if automatic
5232 publication is switched on, default value is used for result name.
5235 List of sub-shapes of theShape1, shared with theShape2.
5237 # Example: see GEOM_TestOthers.py
5238 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5239 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5240 self._autoPublish(aList, theName, "shared")
5243 ## Get sub-shapes, shared by input shapes.
5244 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5245 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5246 # @param theMultiShare Specifies what type of shares should be checked:
5247 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5248 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5249 # @param theName Object name; when specified, this parameter is used
5250 # for result publication in the study. Otherwise, if automatic
5251 # publication is switched on, default value is used for result name.
5253 # @note If @a theShapes contains single compound, the shares between all possible couples of
5254 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5255 # and all rest input shapes are returned.
5257 # @return List of all found sub-shapes.
5260 # - @ref tui_shared_shapes "Example 1"
5261 # - @ref swig_GetSharedShapes "Example 2"
5262 @ManageTransactions("ShapesOp")
5263 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5265 Get sub-shapes, shared by input shapes.
5268 theShapes Either a list or compound of shapes to find common sub-shapes of.
5269 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5270 theMultiShare Specifies what type of shares should be checked:
5271 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5272 - False: causes to search sub-shapes shared between couples of input shapes.
5273 theName Object name; when specified, this parameter is used
5274 for result publication in the study. Otherwise, if automatic
5275 publication is switched on, default value is used for result name.
5277 Note: if theShapes contains single compound, the shares between all possible couples of
5278 its top-level shapes are returned; otherwise, only shares between 1st input shape
5279 and all rest input shapes are returned.
5282 List of all found sub-shapes.
5284 # Example: see GEOM_TestOthers.py
5285 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5286 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5287 self._autoPublish(aList, theName, "shared")
5290 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5291 # situated relatively the specified plane by the certain way,
5292 # defined through <VAR>theState</VAR> parameter.
5293 # @param theShape Shape to find sub-shapes of.
5294 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5295 # @param theAx1 Vector (or line, or linear edge), specifying normal
5296 # direction and location of the plane to find shapes on.
5297 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5298 # @param theName Object name; when specified, this parameter is used
5299 # for result publication in the study. Otherwise, if automatic
5300 # publication is switched on, default value is used for result name.
5302 # @return List of all found sub-shapes.
5304 # @ref swig_GetShapesOnPlane "Example"
5305 @ManageTransactions("ShapesOp")
5306 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5308 Find in theShape all sub-shapes of type theShapeType,
5309 situated relatively the specified plane by the certain way,
5310 defined through theState parameter.
5313 theShape Shape to find sub-shapes of.
5314 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5315 theAx1 Vector (or line, or linear edge), specifying normal
5316 direction and location of the plane to find shapes on.
5317 theState The state of the sub-shapes to find (see GEOM::shape_state)
5318 theName Object name; when specified, this parameter is used
5319 for result publication in the study. Otherwise, if automatic
5320 publication is switched on, default value is used for result name.
5323 List of all found sub-shapes.
5325 # Example: see GEOM_TestOthers.py
5326 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5327 RaiseIfFailed("GetShapesOnPlane", 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 and location of the plane to find shapes on.
5338 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5340 # @return List of all found sub-shapes indices.
5342 # @ref swig_GetShapesOnPlaneIDs "Example"
5343 @ManageTransactions("ShapesOp")
5344 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5346 Find in theShape all sub-shapes of type theShapeType,
5347 situated relatively the specified plane by the certain way,
5348 defined through theState parameter.
5351 theShape Shape to find sub-shapes of.
5352 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5353 theAx1 Vector (or line, or linear edge), specifying normal
5354 direction and location of the plane to find shapes on.
5355 theState The state of the sub-shapes to find (see GEOM::shape_state)
5358 List of all found sub-shapes indices.
5360 # Example: see GEOM_TestOthers.py
5361 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5362 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5365 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5366 # situated relatively the specified plane by the certain way,
5367 # defined through <VAR>theState</VAR> parameter.
5368 # @param theShape Shape to find sub-shapes of.
5369 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5370 # @param theAx1 Vector (or line, or linear edge), specifying normal
5371 # direction of the plane to find shapes on.
5372 # @param thePnt Point specifying location of the plane to find shapes on.
5373 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5374 # @param theName Object name; when specified, this parameter is used
5375 # for result publication in the study. Otherwise, if automatic
5376 # publication is switched on, default value is used for result name.
5378 # @return List of all found sub-shapes.
5380 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5381 @ManageTransactions("ShapesOp")
5382 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5384 Find in theShape all sub-shapes of type theShapeType,
5385 situated relatively the specified plane by the certain way,
5386 defined through theState parameter.
5389 theShape Shape to find sub-shapes of.
5390 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5391 theAx1 Vector (or line, or linear edge), specifying normal
5392 direction and location of the plane to find shapes on.
5393 thePnt Point specifying location of the plane to find shapes on.
5394 theState The state of the sub-shapes to find (see GEOM::shape_state)
5395 theName Object name; when specified, this parameter is used
5396 for result publication in the study. Otherwise, if automatic
5397 publication is switched on, default value is used for result name.
5400 List of all found sub-shapes.
5402 # Example: see GEOM_TestOthers.py
5403 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5404 theAx1, thePnt, theState)
5405 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5406 self._autoPublish(aList, theName, "shapeOnPlane")
5409 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5410 # situated relatively the specified plane by the certain way,
5411 # defined through <VAR>theState</VAR> parameter.
5412 # @param theShape Shape to find sub-shapes of.
5413 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5414 # @param theAx1 Vector (or line, or linear edge), specifying normal
5415 # direction of the plane to find shapes on.
5416 # @param thePnt Point specifying location of the plane to find shapes on.
5417 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5419 # @return List of all found sub-shapes indices.
5421 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5422 @ManageTransactions("ShapesOp")
5423 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5425 Find in theShape all sub-shapes of type theShapeType,
5426 situated relatively the specified plane by the certain way,
5427 defined through theState parameter.
5430 theShape Shape to find sub-shapes of.
5431 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5432 theAx1 Vector (or line, or linear edge), specifying normal
5433 direction and location of the plane to find shapes on.
5434 thePnt Point specifying location of the plane to find shapes on.
5435 theState The state of the sub-shapes to find (see GEOM::shape_state)
5438 List of all found sub-shapes indices.
5440 # Example: see GEOM_TestOthers.py
5441 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5442 theAx1, thePnt, theState)
5443 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5446 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5447 # the specified cylinder by the certain way, defined through \a theState parameter.
5448 # @param theShape Shape to find sub-shapes of.
5449 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5450 # @param theAxis Vector (or line, or linear edge), specifying
5451 # axis of the cylinder to find shapes on.
5452 # @param theRadius Radius of the cylinder to find shapes on.
5453 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5454 # @param theName Object name; when specified, this parameter is used
5455 # for result publication in the study. Otherwise, if automatic
5456 # publication is switched on, default value is used for result name.
5458 # @return List of all found sub-shapes.
5460 # @ref swig_GetShapesOnCylinder "Example"
5461 @ManageTransactions("ShapesOp")
5462 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5464 Find in theShape all sub-shapes of type theShapeType, situated relatively
5465 the specified cylinder by the certain way, defined through theState parameter.
5468 theShape Shape to find sub-shapes of.
5469 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5470 theAxis Vector (or line, or linear edge), specifying
5471 axis of the cylinder to find shapes on.
5472 theRadius Radius of the cylinder to find shapes on.
5473 theState The state of the sub-shapes to find (see GEOM::shape_state)
5474 theName Object name; when specified, this parameter is used
5475 for result publication in the study. Otherwise, if automatic
5476 publication is switched on, default value is used for result name.
5479 List of all found sub-shapes.
5481 # Example: see GEOM_TestOthers.py
5482 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5483 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5484 self._autoPublish(aList, theName, "shapeOnCylinder")
5487 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5488 # the specified cylinder by the certain way, defined through \a theState parameter.
5489 # @param theShape Shape to find sub-shapes of.
5490 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5491 # @param theAxis Vector (or line, or linear edge), specifying
5492 # axis of the cylinder to find shapes on.
5493 # @param theRadius Radius of the cylinder to find shapes on.
5494 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5496 # @return List of all found sub-shapes indices.
5498 # @ref swig_GetShapesOnCylinderIDs "Example"
5499 @ManageTransactions("ShapesOp")
5500 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5502 Find in theShape all sub-shapes of type theShapeType, situated relatively
5503 the specified cylinder by the certain way, defined through theState parameter.
5506 theShape Shape to find sub-shapes of.
5507 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5508 theAxis Vector (or line, or linear edge), specifying
5509 axis of the cylinder to find shapes on.
5510 theRadius Radius of the cylinder to find shapes on.
5511 theState The state of the sub-shapes to find (see GEOM::shape_state)
5514 List of all found sub-shapes indices.
5516 # Example: see GEOM_TestOthers.py
5517 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5518 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5521 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5522 # the specified cylinder by the certain way, defined through \a theState parameter.
5523 # @param theShape Shape to find sub-shapes of.
5524 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5525 # @param theAxis Vector (or line, or linear edge), specifying
5526 # axis of the cylinder to find shapes on.
5527 # @param thePnt Point specifying location of the bottom of the cylinder.
5528 # @param theRadius Radius of the cylinder to find shapes on.
5529 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5530 # @param theName Object name; when specified, this parameter is used
5531 # for result publication in the study. Otherwise, if automatic
5532 # publication is switched on, default value is used for result name.
5534 # @return List of all found sub-shapes.
5536 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5537 @ManageTransactions("ShapesOp")
5538 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5540 Find in theShape all sub-shapes of type theShapeType, situated relatively
5541 the specified cylinder by the certain way, defined through theState parameter.
5544 theShape Shape to find sub-shapes of.
5545 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5546 theAxis Vector (or line, or linear edge), specifying
5547 axis of the cylinder to find shapes on.
5548 theRadius Radius of the cylinder to find shapes on.
5549 theState The state of the sub-shapes to find (see GEOM::shape_state)
5550 theName Object name; when specified, this parameter is used
5551 for result publication in the study. Otherwise, if automatic
5552 publication is switched on, default value is used for result name.
5555 List of all found sub-shapes.
5557 # Example: see GEOM_TestOthers.py
5558 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5559 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5560 self._autoPublish(aList, theName, "shapeOnCylinder")
5563 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5564 # the specified cylinder by the certain way, defined through \a theState parameter.
5565 # @param theShape Shape to find sub-shapes of.
5566 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5567 # @param theAxis Vector (or line, or linear edge), specifying
5568 # axis of the cylinder to find shapes on.
5569 # @param thePnt Point specifying location of the bottom of the cylinder.
5570 # @param theRadius Radius of the cylinder to find shapes on.
5571 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5573 # @return List of all found sub-shapes indices
5575 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5576 @ManageTransactions("ShapesOp")
5577 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5579 Find in theShape all sub-shapes of type theShapeType, situated relatively
5580 the specified cylinder by the certain way, defined through theState parameter.
5583 theShape Shape to find sub-shapes of.
5584 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5585 theAxis Vector (or line, or linear edge), specifying
5586 axis of the cylinder to find shapes on.
5587 theRadius Radius of the cylinder to find shapes on.
5588 theState The state of the sub-shapes to find (see GEOM::shape_state)
5591 List of all found sub-shapes indices.
5593 # Example: see GEOM_TestOthers.py
5594 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5595 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5598 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5599 # the specified sphere by the certain way, defined through \a theState parameter.
5600 # @param theShape Shape to find sub-shapes of.
5601 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5602 # @param theCenter Point, specifying center of the sphere to find shapes on.
5603 # @param theRadius Radius of the sphere to find shapes on.
5604 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5605 # @param theName Object name; when specified, this parameter is used
5606 # for result publication in the study. Otherwise, if automatic
5607 # publication is switched on, default value is used for result name.
5609 # @return List of all found sub-shapes.
5611 # @ref swig_GetShapesOnSphere "Example"
5612 @ManageTransactions("ShapesOp")
5613 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5615 Find in theShape all sub-shapes of type theShapeType, situated relatively
5616 the specified sphere by the certain way, defined through theState parameter.
5619 theShape Shape to find sub-shapes of.
5620 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5621 theCenter Point, specifying center of the sphere to find shapes on.
5622 theRadius Radius of the sphere to find shapes on.
5623 theState The state of the sub-shapes to find (see GEOM::shape_state)
5624 theName Object name; when specified, this parameter is used
5625 for result publication in the study. Otherwise, if automatic
5626 publication is switched on, default value is used for result name.
5629 List of all found sub-shapes.
5631 # Example: see GEOM_TestOthers.py
5632 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5633 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5634 self._autoPublish(aList, theName, "shapeOnSphere")
5637 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5638 # the specified sphere by the certain way, defined through \a theState parameter.
5639 # @param theShape Shape to find sub-shapes of.
5640 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5641 # @param theCenter Point, specifying center of the sphere to find shapes on.
5642 # @param theRadius Radius of the sphere to find shapes on.
5643 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5645 # @return List of all found sub-shapes indices.
5647 # @ref swig_GetShapesOnSphereIDs "Example"
5648 @ManageTransactions("ShapesOp")
5649 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5651 Find in theShape all sub-shapes of type theShapeType, situated relatively
5652 the specified sphere by the certain way, defined through theState parameter.
5655 theShape Shape to find sub-shapes of.
5656 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5657 theCenter Point, specifying center of the sphere to find shapes on.
5658 theRadius Radius of the sphere to find shapes on.
5659 theState The state of the sub-shapes to find (see GEOM::shape_state)
5662 List of all found sub-shapes indices.
5664 # Example: see GEOM_TestOthers.py
5665 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5666 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5669 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5670 # the specified quadrangle by the certain way, defined through \a theState parameter.
5671 # @param theShape Shape to find sub-shapes of.
5672 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5673 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5674 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5675 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5676 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5677 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5678 # @param theName Object name; when specified, this parameter is used
5679 # for result publication in the study. Otherwise, if automatic
5680 # publication is switched on, default value is used for result name.
5682 # @return List of all found sub-shapes.
5684 # @ref swig_GetShapesOnQuadrangle "Example"
5685 @ManageTransactions("ShapesOp")
5686 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5687 theTopLeftPoint, theTopRightPoint,
5688 theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5690 Find in theShape all sub-shapes of type theShapeType, situated relatively
5691 the specified quadrangle by the certain way, defined through theState parameter.
5694 theShape Shape to find sub-shapes of.
5695 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5696 theTopLeftPoint Point, specifying top left corner of a quadrangle
5697 theTopRightPoint Point, specifying top right corner of a quadrangle
5698 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5699 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5700 theState The state of the sub-shapes to find (see GEOM::shape_state)
5701 theName Object name; when specified, this parameter is used
5702 for result publication in the study. Otherwise, if automatic
5703 publication is switched on, default value is used for result name.
5706 List of all found sub-shapes.
5708 # Example: see GEOM_TestOthers.py
5709 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5710 theTopLeftPoint, theTopRightPoint,
5711 theBottomLeftPoint, theBottomRightPoint, theState)
5712 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5713 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5716 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5717 # the specified quadrangle by the certain way, defined through \a theState parameter.
5718 # @param theShape Shape to find sub-shapes of.
5719 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5720 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5721 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5722 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5723 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5724 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5726 # @return List of all found sub-shapes indices.
5728 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5729 @ManageTransactions("ShapesOp")
5730 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5731 theTopLeftPoint, theTopRightPoint,
5732 theBottomLeftPoint, theBottomRightPoint, theState):
5734 Find in theShape all sub-shapes of type theShapeType, situated relatively
5735 the specified quadrangle by the certain way, defined through theState parameter.
5738 theShape Shape to find sub-shapes of.
5739 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5740 theTopLeftPoint Point, specifying top left corner of a quadrangle
5741 theTopRightPoint Point, specifying top right corner of a quadrangle
5742 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5743 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5744 theState The state of the sub-shapes to find (see GEOM::shape_state)
5747 List of all found sub-shapes indices.
5750 # Example: see GEOM_TestOthers.py
5751 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5752 theTopLeftPoint, theTopRightPoint,
5753 theBottomLeftPoint, theBottomRightPoint, theState)
5754 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5757 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5758 # the specified \a theBox by the certain way, defined through \a theState parameter.
5759 # @param theBox Shape for relative comparing.
5760 # @param theShape Shape to find sub-shapes of.
5761 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5762 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5763 # @param theName Object name; when specified, this parameter is used
5764 # for result publication in the study. Otherwise, if automatic
5765 # publication is switched on, default value is used for result name.
5767 # @return List of all found sub-shapes.
5769 # @ref swig_GetShapesOnBox "Example"
5770 @ManageTransactions("ShapesOp")
5771 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5773 Find in theShape all sub-shapes of type theShapeType, situated relatively
5774 the specified theBox by the certain way, defined through theState parameter.
5777 theBox Shape for relative comparing.
5778 theShape Shape to find sub-shapes of.
5779 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5780 theState The state of the sub-shapes to find (see GEOM::shape_state)
5781 theName Object name; when specified, this parameter is used
5782 for result publication in the study. Otherwise, if automatic
5783 publication is switched on, default value is used for result name.
5786 List of all found sub-shapes.
5788 # Example: see GEOM_TestOthers.py
5789 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5790 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5791 self._autoPublish(aList, theName, "shapeOnBox")
5794 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5795 # the specified \a theBox by the certain way, defined through \a theState parameter.
5796 # @param theBox Shape for relative comparing.
5797 # @param theShape Shape to find sub-shapes of.
5798 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5799 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5801 # @return List of all found sub-shapes indices.
5803 # @ref swig_GetShapesOnBoxIDs "Example"
5804 @ManageTransactions("ShapesOp")
5805 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5807 Find in theShape all sub-shapes of type theShapeType, situated relatively
5808 the specified theBox by the certain way, defined through theState parameter.
5811 theBox Shape for relative comparing.
5812 theShape Shape to find sub-shapes of.
5813 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5814 theState The state of the sub-shapes to find (see GEOM::shape_state)
5817 List of all found sub-shapes indices.
5819 # Example: see GEOM_TestOthers.py
5820 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5821 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5824 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5825 # situated relatively the specified \a theCheckShape by the
5826 # certain way, defined through \a theState parameter.
5827 # @param theCheckShape Shape for relative comparing. It must be a solid.
5828 # @param theShape Shape to find sub-shapes of.
5829 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5830 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5831 # @param theName Object name; when specified, this parameter is used
5832 # for result publication in the study. Otherwise, if automatic
5833 # publication is switched on, default value is used for result name.
5835 # @return List of all found sub-shapes.
5837 # @ref swig_GetShapesOnShape "Example"
5838 @ManageTransactions("ShapesOp")
5839 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5841 Find in theShape all sub-shapes of type theShapeType,
5842 situated relatively the specified theCheckShape by the
5843 certain way, defined through theState parameter.
5846 theCheckShape Shape for relative comparing. It must be a solid.
5847 theShape Shape to find sub-shapes of.
5848 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5849 theState The state of the sub-shapes to find (see GEOM::shape_state)
5850 theName Object name; when specified, this parameter is used
5851 for result publication in the study. Otherwise, if automatic
5852 publication is switched on, default value is used for result name.
5855 List of all found sub-shapes.
5857 # Example: see GEOM_TestOthers.py
5858 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5859 theShapeType, theState)
5860 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5861 self._autoPublish(aList, theName, "shapeOnShape")
5864 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5865 # situated relatively the specified \a theCheckShape by the
5866 # certain way, defined through \a theState parameter.
5867 # @param theCheckShape Shape for relative comparing. It must be a solid.
5868 # @param theShape Shape to find sub-shapes of.
5869 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5870 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5871 # @param theName Object name; when specified, this parameter is used
5872 # for result publication in the study. Otherwise, if automatic
5873 # publication is switched on, default value is used for result name.
5875 # @return All found sub-shapes as compound.
5877 # @ref swig_GetShapesOnShapeAsCompound "Example"
5878 @ManageTransactions("ShapesOp")
5879 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5881 Find in theShape all sub-shapes of type theShapeType,
5882 situated relatively the specified theCheckShape by the
5883 certain way, defined through theState parameter.
5886 theCheckShape Shape for relative comparing. It must be a solid.
5887 theShape Shape to find sub-shapes of.
5888 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5889 theState The state of the sub-shapes to find (see GEOM::shape_state)
5890 theName Object name; when specified, this parameter is used
5891 for result publication in the study. Otherwise, if automatic
5892 publication is switched on, default value is used for result name.
5895 All found sub-shapes as compound.
5897 # Example: see GEOM_TestOthers.py
5898 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5899 theShapeType, theState)
5900 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5901 self._autoPublish(anObj, theName, "shapeOnShape")
5904 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5905 # situated relatively the specified \a theCheckShape by the
5906 # certain way, defined through \a theState parameter.
5907 # @param theCheckShape Shape for relative comparing. It must be a solid.
5908 # @param theShape Shape to find sub-shapes of.
5909 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5910 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5912 # @return List of all found sub-shapes indices.
5914 # @ref swig_GetShapesOnShapeIDs "Example"
5915 @ManageTransactions("ShapesOp")
5916 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5918 Find in theShape all sub-shapes of type theShapeType,
5919 situated relatively the specified theCheckShape by the
5920 certain way, defined through theState parameter.
5923 theCheckShape Shape for relative comparing. It must be a solid.
5924 theShape Shape to find sub-shapes of.
5925 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5926 theState The state of the sub-shapes to find (see GEOM::shape_state)
5929 List of all found sub-shapes indices.
5931 # Example: see GEOM_TestOthers.py
5932 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5933 theShapeType, theState)
5934 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5937 ## Get sub-shape(s) of theShapeWhere, which are
5938 # coincident with \a theShapeWhat or could be a part of it.
5939 # @param theShapeWhere Shape to find sub-shapes of.
5940 # @param theShapeWhat Shape, specifying what to find.
5941 # @param isNewImplementation implementation of GetInPlace functionality
5942 # (default = False, old alghorithm based on shape properties)
5943 # @param theName Object name; when specified, this parameter is used
5944 # for result publication in the study. Otherwise, if automatic
5945 # publication is switched on, default value is used for result name.
5947 # @return Compound which includes all found sub-shapes if they have different types;
5948 # or group of all found shapes of the equal type; or a single found sub-shape.
5950 # @note This function has a restriction on argument shapes.
5951 # If \a theShapeWhere has curved parts with significantly
5952 # outstanding centres (i.e. the mass centre of a part is closer to
5953 # \a theShapeWhat than to the part), such parts will not be found.
5954 # @image html get_in_place_lost_part.png
5956 # @ref swig_GetInPlace "Example"
5957 @ManageTransactions("ShapesOp")
5958 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5960 Get sub-shape(s) of theShapeWhere, which are
5961 coincident with theShapeWhat or could be a part of it.
5964 theShapeWhere Shape to find sub-shapes of.
5965 theShapeWhat Shape, specifying what to find.
5966 isNewImplementation Implementation of GetInPlace functionality
5967 (default = False, old alghorithm based on shape properties)
5968 theName Object name; when specified, this parameter is used
5969 for result publication in the study. Otherwise, if automatic
5970 publication is switched on, default value is used for result name.
5973 Compound which includes all found sub-shapes if they have different types;
5974 or group of all found shapes of the equal type; or a single found sub-shape.
5978 This function has a restriction on argument shapes.
5979 If theShapeWhere has curved parts with significantly
5980 outstanding centres (i.e. the mass centre of a part is closer to
5981 theShapeWhat than to the part), such parts will not be found.
5983 # Example: see GEOM_TestOthers.py
5985 if isNewImplementation:
5986 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5988 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5990 RaiseIfFailed("GetInPlace", self.ShapesOp)
5991 self._autoPublish(anObj, theName, "inplace")
5994 ## Get sub-shape(s) of \a theShapeWhere, which are
5995 # coincident with \a theShapeWhat or could be a part of it.
5997 # Implementation of this method is based on a saved history of an operation,
5998 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5999 # arguments (an argument shape or a sub-shape of an argument shape).
6000 # The operation could be the Partition or one of boolean operations,
6001 # performed on simple shapes (not on compounds).
6003 # @param theShapeWhere Shape to find sub-shapes of.
6004 # @param theShapeWhat Shape, specifying what to find (must be in the
6005 # building history of the ShapeWhere).
6006 # @param theName Object name; when specified, this parameter is used
6007 # for result publication in the study. Otherwise, if automatic
6008 # publication is switched on, default value is used for result name.
6010 # @return Compound which includes all found sub-shapes if they have different types;
6011 # or group of all found shapes of the equal type; or a single found sub-shape.
6013 # @ref swig_GetInPlace "Example"
6014 @ManageTransactions("ShapesOp")
6015 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6017 Implementation of this method is based on a saved history of an operation,
6018 produced theShapeWhere. The theShapeWhat must be among this operation's
6019 arguments (an argument shape or a sub-shape of an argument shape).
6020 The operation could be the Partition or one of boolean operations,
6021 performed on simple shapes (not on compounds).
6024 theShapeWhere Shape to find sub-shapes of.
6025 theShapeWhat Shape, specifying what to find (must be in the
6026 building history of the ShapeWhere).
6027 theName Object name; when specified, this parameter is used
6028 for result publication in the study. Otherwise, if automatic
6029 publication is switched on, default value is used for result name.
6032 Compound which includes all found sub-shapes if they have different types;
6033 or group of all found shapes of the equal type; or a single found sub-shape.
6035 # Example: see GEOM_TestOthers.py
6036 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6037 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6038 self._autoPublish(anObj, theName, "inplace")
6041 ## Get sub-shape of theShapeWhere, which is
6042 # equal to \a theShapeWhat.
6043 # @param theShapeWhere Shape to find sub-shape of.
6044 # @param theShapeWhat Shape, specifying what to find.
6045 # @param theName Object name; when specified, this parameter is used
6046 # for result publication in the study. Otherwise, if automatic
6047 # publication is switched on, default value is used for result name.
6049 # @return New GEOM.GEOM_Object for found sub-shape.
6051 # @ref swig_GetSame "Example"
6052 @ManageTransactions("ShapesOp")
6053 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6055 Get sub-shape of theShapeWhere, which is
6056 equal to theShapeWhat.
6059 theShapeWhere Shape to find sub-shape of.
6060 theShapeWhat Shape, specifying what to find.
6061 theName Object name; when specified, this parameter is used
6062 for result publication in the study. Otherwise, if automatic
6063 publication is switched on, default value is used for result name.
6066 New GEOM.GEOM_Object for found sub-shape.
6068 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6069 RaiseIfFailed("GetSame", self.ShapesOp)
6070 self._autoPublish(anObj, theName, "sameShape")
6074 ## Get sub-shape indices of theShapeWhere, which is
6075 # equal to \a theShapeWhat.
6076 # @param theShapeWhere Shape to find sub-shape of.
6077 # @param theShapeWhat Shape, specifying what to find.
6078 # @return List of all found sub-shapes indices.
6080 # @ref swig_GetSame "Example"
6081 @ManageTransactions("ShapesOp")
6082 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6084 Get sub-shape indices of theShapeWhere, which is
6085 equal to theShapeWhat.
6088 theShapeWhere Shape to find sub-shape of.
6089 theShapeWhat Shape, specifying what to find.
6092 List of all found sub-shapes indices.
6094 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6095 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6098 ## Resize the input edge with the new Min and Max parameters.
6099 # The input edge parameters range is [0, 1]. If theMin parameter is
6100 # negative, the input edge is extended, otherwise it is shrinked by
6101 # theMin parameter. If theMax is greater than 1, the edge is extended,
6102 # otherwise it is shrinked by theMax parameter.
6103 # @param theEdge the input edge to be resized.
6104 # @param theMin the minimal parameter value.
6105 # @param theMax the maximal parameter value.
6106 # @param theName Object name; when specified, this parameter is used
6107 # for result publication in the study. Otherwise, if automatic
6108 # publication is switched on, default value is used for result name.
6109 # @return New GEOM.GEOM_Object, containing the created edge.
6111 # @ref tui_extend "Example"
6112 @ManageTransactions("ShapesOp")
6113 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6115 Resize the input edge with the new Min and Max parameters.
6116 The input edge parameters range is [0, 1]. If theMin parameter is
6117 negative, the input edge is extended, otherwise it is shrinked by
6118 theMin parameter. If theMax is greater than 1, the edge is extended,
6119 otherwise it is shrinked by theMax parameter.
6122 theEdge the input edge to be resized.
6123 theMin the minimal parameter value.
6124 theMax the maximal parameter value.
6125 theName Object name; when specified, this parameter is used
6126 for result publication in the study. Otherwise, if automatic
6127 publication is switched on, default value is used for result name.
6130 New GEOM.GEOM_Object, containing the created edge.
6132 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6133 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6134 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6135 anObj.SetParameters(Parameters)
6136 self._autoPublish(anObj, theName, "edge")
6139 ## Resize the input face with the new UMin, UMax, VMin and VMax
6140 # parameters. The input face U and V parameters range is [0, 1]. If
6141 # theUMin parameter is negative, the input face is extended, otherwise
6142 # it is shrinked along U direction by theUMin parameter. If theUMax is
6143 # greater than 1, the face is extended, otherwise it is shrinked along
6144 # U direction by theUMax parameter. So as for theVMin, theVMax and
6145 # V direction of the input face.
6146 # @param theFace the input face to be resized.
6147 # @param theUMin the minimal U parameter value.
6148 # @param theUMax the maximal U parameter value.
6149 # @param theVMin the minimal V parameter value.
6150 # @param theVMax the maximal V parameter value.
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.
6154 # @return New GEOM.GEOM_Object, containing the created face.
6156 # @ref tui_extend "Example"
6157 @ManageTransactions("ShapesOp")
6158 def ExtendFace(self, theFace, theUMin, theUMax,
6159 theVMin, theVMax, theName=None):
6161 Resize the input face with the new UMin, UMax, VMin and VMax
6162 parameters. The input face U and V parameters range is [0, 1]. If
6163 theUMin parameter is negative, the input face is extended, otherwise
6164 it is shrinked along U direction by theUMin parameter. If theUMax is
6165 greater than 1, the face is extended, otherwise it is shrinked along
6166 U direction by theUMax parameter. So as for theVMin, theVMax and
6167 V direction of the input face.
6170 theFace the input face to be resized.
6171 theUMin the minimal U parameter value.
6172 theUMax the maximal U parameter value.
6173 theVMin the minimal V parameter value.
6174 theVMax the maximal V parameter value.
6175 theName Object name; when specified, this parameter is used
6176 for result publication in the study. Otherwise, if automatic
6177 publication is switched on, default value is used for result name.
6180 New GEOM.GEOM_Object, containing the created face.
6182 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6183 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6185 RaiseIfFailed("ExtendFace", self.ShapesOp)
6186 anObj.SetParameters(Parameters)
6187 self._autoPublish(anObj, theName, "face")
6190 ## This function takes some face as input parameter and creates new
6191 # GEOM_Object, i.e. topological shape by extracting underlying surface
6192 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6193 # parameters of the source face (in the parametrical space).
6194 # @param theFace the input face.
6195 # @param theName Object name; when specified, this parameter is used
6196 # for result publication in the study. Otherwise, if automatic
6197 # publication is switched on, default value is used for result name.
6198 # @return New GEOM.GEOM_Object, containing the created face.
6200 # @ref tui_creation_surface "Example"
6201 @ManageTransactions("ShapesOp")
6202 def MakeSurfaceFromFace(self, theFace, theName=None):
6204 This function takes some face as input parameter and creates new
6205 GEOM_Object, i.e. topological shape by extracting underlying surface
6206 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6207 parameters of the source face (in the parametrical space).
6210 theFace the input face.
6211 theName Object name; when specified, this parameter is used
6212 for result publication in the study. Otherwise, if automatic
6213 publication is switched on, default value is used for result name.
6216 New GEOM.GEOM_Object, containing the created face.
6218 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6219 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6220 self._autoPublish(anObj, theName, "surface")
6226 ## @addtogroup l4_access
6229 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6230 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6231 # @param aShape Shape to get sub-shape of.
6232 # @param ListOfID List of sub-shapes indices.
6233 # @param theName Object name; when specified, this parameter is used
6234 # for result publication in the study. Otherwise, if automatic
6235 # publication is switched on, default value is used for result name.
6237 # @return Found sub-shape.
6239 # @ref swig_all_decompose "Example"
6240 def GetSubShape(self, aShape, ListOfID, theName=None):
6242 Obtain a composite sub-shape of aShape, composed from sub-shapes
6243 of aShape, selected by their unique IDs inside aShape
6246 aShape Shape to get sub-shape of.
6247 ListOfID List of sub-shapes indices.
6248 theName Object name; when specified, this parameter is used
6249 for result publication in the study. Otherwise, if automatic
6250 publication is switched on, default value is used for result name.
6255 # Example: see GEOM_TestAll.py
6256 anObj = self.AddSubShape(aShape,ListOfID)
6257 self._autoPublish(anObj, theName, "subshape")
6260 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6261 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6262 # @param aShape Shape to get sub-shape of.
6263 # @param aSubShape Sub-shapes of aShape.
6264 # @return ID of found sub-shape.
6266 # @ref swig_all_decompose "Example"
6267 @ManageTransactions("LocalOp")
6268 def GetSubShapeID(self, aShape, aSubShape):
6270 Obtain unique ID of sub-shape aSubShape inside aShape
6271 of aShape, selected by their unique IDs inside aShape
6274 aShape Shape to get sub-shape of.
6275 aSubShape Sub-shapes of aShape.
6278 ID of found sub-shape.
6280 # Example: see GEOM_TestAll.py
6281 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6282 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6285 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6286 # This function is provided for performance purpose. The complexity is O(n) with n
6287 # the number of subobjects of aShape
6288 # @param aShape Shape to get sub-shape of.
6289 # @param aSubShapes Sub-shapes of aShape.
6290 # @return list of IDs of found sub-shapes.
6292 # @ref swig_all_decompose "Example"
6293 @ManageTransactions("ShapesOp")
6294 def GetSubShapesIDs(self, aShape, aSubShapes):
6296 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6297 This function is provided for performance purpose. The complexity is O(n) with n
6298 the number of subobjects of aShape
6301 aShape Shape to get sub-shape of.
6302 aSubShapes Sub-shapes of aShape.
6305 List of IDs of found sub-shape.
6307 # Example: see GEOM_TestAll.py
6308 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6309 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6315 ## @addtogroup l4_decompose
6318 ## Get all sub-shapes and groups of \a theShape,
6319 # that were created already by any other methods.
6320 # @param theShape Any shape.
6321 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6322 # returned, else all found sub-shapes and groups.
6323 # @return List of existing sub-objects of \a theShape.
6325 # @ref swig_all_decompose "Example"
6326 @ManageTransactions("ShapesOp")
6327 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6329 Get all sub-shapes and groups of theShape,
6330 that were created already by any other methods.
6334 theGroupsOnly If this parameter is TRUE, only groups will be
6335 returned, else all found sub-shapes and groups.
6338 List of existing sub-objects of theShape.
6340 # Example: see GEOM_TestAll.py
6341 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6342 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6345 ## Get all groups of \a theShape,
6346 # that were created already by any other methods.
6347 # @param theShape Any shape.
6348 # @return List of existing groups of \a theShape.
6350 # @ref swig_all_decompose "Example"
6351 @ManageTransactions("ShapesOp")
6352 def GetGroups(self, theShape):
6354 Get all groups of theShape,
6355 that were created already by any other methods.
6361 List of existing groups of theShape.
6363 # Example: see GEOM_TestAll.py
6364 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6365 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6368 ## Explode a shape on sub-shapes of a given type.
6369 # If the shape itself matches the type, it is also returned.
6370 # @param aShape Shape to be exploded.
6371 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6372 # @param theName Object name; when specified, this parameter is used
6373 # for result publication in the study. Otherwise, if automatic
6374 # publication is switched on, default value is used for result name.
6376 # @return List of sub-shapes of type theShapeType, contained in theShape.
6378 # @ref swig_all_decompose "Example"
6379 @ManageTransactions("ShapesOp")
6380 def SubShapeAll(self, aShape, aType, theName=None):
6382 Explode a shape on sub-shapes of a given type.
6383 If the shape itself matches the type, it is also returned.
6386 aShape Shape to be exploded.
6387 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6388 theName Object name; when specified, this parameter is used
6389 for result publication in the study. Otherwise, if automatic
6390 publication is switched on, default value is used for result name.
6393 List of sub-shapes of type theShapeType, contained in theShape.
6395 # Example: see GEOM_TestAll.py
6396 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6397 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6398 self._autoPublish(ListObj, theName, "subshape")
6401 ## Explode a shape on sub-shapes of a given type.
6402 # @param aShape Shape to be exploded.
6403 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6404 # @return List of IDs of sub-shapes.
6406 # @ref swig_all_decompose "Example"
6407 @ManageTransactions("ShapesOp")
6408 def SubShapeAllIDs(self, aShape, aType):
6410 Explode a shape on sub-shapes of a given type.
6413 aShape Shape to be exploded (see geompy.ShapeType)
6414 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6417 List of IDs of sub-shapes.
6419 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6420 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6423 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6424 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6425 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6426 # @param aShape Shape to get sub-shape of.
6427 # @param ListOfInd List of sub-shapes indices.
6428 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6429 # @param theName Object name; when specified, this parameter is used
6430 # for result publication in the study. Otherwise, if automatic
6431 # publication is switched on, default value is used for result name.
6433 # @return A compound of sub-shapes of aShape.
6435 # @ref swig_all_decompose "Example"
6436 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6438 Obtain a compound of sub-shapes of aShape,
6439 selected by their indices in list of all sub-shapes of type aType.
6440 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6443 aShape Shape to get sub-shape of.
6444 ListOfID List of sub-shapes indices.
6445 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6446 theName Object name; when specified, this parameter is used
6447 for result publication in the study. Otherwise, if automatic
6448 publication is switched on, default value is used for result name.
6451 A compound of sub-shapes of aShape.
6453 # Example: see GEOM_TestAll.py
6455 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6456 for ind in ListOfInd:
6457 ListOfIDs.append(AllShapeIDsList[ind - 1])
6458 # note: auto-publishing is done in self.GetSubShape()
6459 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6462 ## Explode a shape on sub-shapes of a given type.
6463 # Sub-shapes will be sorted taking into account their gravity centers,
6464 # to provide stable order of sub-shapes. Please see
6465 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6466 # If the shape itself matches the type, it is also returned.
6467 # @param aShape Shape to be exploded.
6468 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6469 # @param theName Object name; when specified, this parameter is used
6470 # for result publication in the study. Otherwise, if automatic
6471 # publication is switched on, default value is used for result name.
6473 # @return List of sub-shapes of type theShapeType, contained in theShape.
6475 # @ref swig_SubShapeAllSorted "Example"
6476 @ManageTransactions("ShapesOp")
6477 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6479 Explode a shape on sub-shapes of a given type.
6480 Sub-shapes will be sorted taking into account their gravity centers,
6481 to provide stable order of sub-shapes.
6482 If the shape itself matches the type, it is also returned.
6485 aShape Shape to be exploded.
6486 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6487 theName Object name; when specified, this parameter is used
6488 for result publication in the study. Otherwise, if automatic
6489 publication is switched on, default value is used for result name.
6492 List of sub-shapes of type theShapeType, contained in theShape.
6494 # Example: see GEOM_TestAll.py
6495 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6496 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6497 self._autoPublish(ListObj, theName, "subshape")
6500 ## Explode a shape on sub-shapes of a given type.
6501 # Sub-shapes will be sorted taking into account their gravity centers,
6502 # to provide stable order of sub-shapes. Please see
6503 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6504 # @param aShape Shape to be exploded.
6505 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6506 # @return List of IDs of sub-shapes.
6508 # @ref swig_all_decompose "Example"
6509 @ManageTransactions("ShapesOp")
6510 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6512 Explode a shape on sub-shapes of a given type.
6513 Sub-shapes will be sorted taking into account their gravity centers,
6514 to provide stable order of sub-shapes.
6517 aShape Shape to be exploded.
6518 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6521 List of IDs of sub-shapes.
6523 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6524 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6527 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6528 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6529 # Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6530 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6531 # @param aShape Shape to get sub-shape of.
6532 # @param ListOfInd List of sub-shapes indices.
6533 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6534 # @param theName Object name; when specified, this parameter is used
6535 # for result publication in the study. Otherwise, if automatic
6536 # publication is switched on, default value is used for result name.
6538 # @return A compound of sub-shapes of aShape.
6540 # @ref swig_all_decompose "Example"
6541 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6543 Obtain a compound of sub-shapes of aShape,
6544 selected by they indices in sorted list of all sub-shapes of type aType.
6545 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6548 aShape Shape to get sub-shape of.
6549 ListOfID List of sub-shapes indices.
6550 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6551 theName Object name; when specified, this parameter is used
6552 for result publication in the study. Otherwise, if automatic
6553 publication is switched on, default value is used for result name.
6556 A compound of sub-shapes of aShape.
6558 # Example: see GEOM_TestAll.py
6560 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6561 for ind in ListOfInd:
6562 ListOfIDs.append(AllShapeIDsList[ind - 1])
6563 # note: auto-publishing is done in self.GetSubShape()
6564 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6567 ## Extract shapes (excluding the main shape) of given type.
6568 # @param aShape The shape.
6569 # @param aType The shape type (see ShapeType())
6570 # @param isSorted Boolean flag to switch sorting on/off. Please see
6571 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6572 # @param theName Object name; when specified, this parameter is used
6573 # for result publication in the study. Otherwise, if automatic
6574 # publication is switched on, default value is used for result name.
6576 # @return List of sub-shapes of type aType, contained in aShape.
6578 # @ref swig_FilletChamfer "Example"
6579 @ManageTransactions("ShapesOp")
6580 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6582 Extract shapes (excluding the main shape) of given type.
6586 aType The shape type (see geompy.ShapeType)
6587 isSorted Boolean flag to switch sorting on/off.
6588 theName Object name; when specified, this parameter is used
6589 for result publication in the study. Otherwise, if automatic
6590 publication is switched on, default value is used for result name.
6593 List of sub-shapes of type aType, contained in aShape.
6595 # Example: see GEOM_TestAll.py
6596 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6597 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6598 self._autoPublish(ListObj, theName, "subshape")
6601 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6602 # @param aShape Main shape.
6603 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6604 # @param theName Object name; when specified, this parameter is used
6605 # for result publication in the study. Otherwise, if automatic
6606 # publication is switched on, default value is used for result name.
6607 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6609 # @ref swig_all_decompose "Example"
6610 @ManageTransactions("ShapesOp")
6611 def SubShapes(self, aShape, anIDs, theName=None):
6613 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6617 anIDs List of unique IDs of sub-shapes inside theMainShape.
6618 theName Object name; when specified, this parameter is used
6619 for result publication in the study. Otherwise, if automatic
6620 publication is switched on, default value is used for result name.
6623 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6625 # Example: see GEOM_TestAll.py
6626 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6627 RaiseIfFailed("SubShapes", self.ShapesOp)
6628 self._autoPublish(ListObj, theName, "subshape")
6631 ## Explode a shape into edges sorted in a row from a starting point.
6632 # @param theShape the shape to be exploded on edges.
6633 # @param theStartPoint the starting point.
6634 # @param theName Object name; when specified, this parameter is used
6635 # for result publication in the study. Otherwise, if automatic
6636 # publication is switched on, default value is used for result name.
6637 # @return List of GEOM.GEOM_Object that is actually an ordered list
6638 # of edges sorted in a row from a starting point.
6640 # @ref swig_GetSubShapeEdgeSorted "Example"
6641 @ManageTransactions("ShapesOp")
6642 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6644 Explode a shape into edges sorted in a row from a starting point.
6647 theShape the shape to be exploded on edges.
6648 theStartPoint the starting point.
6649 theName Object name; when specified, this parameter is used
6650 for result publication in the study. Otherwise, if automatic
6651 publication is switched on, default value is used for result name.
6654 List of GEOM.GEOM_Object that is actually an ordered list
6655 of edges sorted in a row from a starting point.
6657 # Example: see GEOM_TestAll.py
6658 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6659 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6660 self._autoPublish(ListObj, theName, "SortedEdges")
6664 # Return the list of subshapes that satisfies a certain tolerance
6665 # criterion. The user defines the type of shapes to be returned, the
6666 # condition and the tolerance value. The operation is defined for
6667 # faces, edges and vertices only. E.g. for theShapeType FACE,
6668 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6669 # all faces of theShape that have tolerances greater then 1.e7.
6671 # @param theShape the shape to be exploded
6672 # @param theShapeType the type of sub-shapes to be returned (see
6673 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6674 # @param theCondition the condition type (see GEOM::comparison_condition).
6675 # @param theTolerance the tolerance filter.
6676 # @param theName Object name; when specified, this parameter is used
6677 # for result publication in the study. Otherwise, if automatic
6678 # publication is switched on, default value is used for result name.
6679 # @return the list of shapes that satisfy the conditions.
6681 # @ref swig_GetSubShapesWithTolerance "Example"
6682 @ManageTransactions("ShapesOp")
6683 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6684 theCondition, theTolerance, theName=None):
6686 Return the list of subshapes that satisfies a certain tolerance
6687 criterion. The user defines the type of shapes to be returned, the
6688 condition and the tolerance value. The operation is defined for
6689 faces, edges and vertices only. E.g. for theShapeType FACE,
6690 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6691 all faces of theShape that have tolerances greater then 1.e7.
6694 theShape the shape to be exploded
6695 theShapeType the type of sub-shapes to be returned (see
6696 ShapeType()). Can have the values FACE,
6697 EDGE and VERTEX only.
6698 theCondition the condition type (see GEOM::comparison_condition).
6699 theTolerance the tolerance filter.
6700 theName Object name; when specified, this parameter is used
6701 for result publication in the study. Otherwise, if automatic
6702 publication is switched on, default value is used for result name.
6705 The list of shapes that satisfy the conditions.
6707 # Example: see GEOM_TestAll.py
6708 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6709 theCondition, theTolerance)
6710 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6711 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6714 ## Check if the object is a sub-object of another GEOM object.
6715 # @param aSubObject Checked sub-object (or its parent object, in case if
6716 # \a theSubObjectIndex is non-zero).
6717 # @param anObject An object that is checked for ownership (or its parent object,
6718 # in case if \a theObjectIndex is non-zero).
6719 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6720 # identifies a sub-object within its parent specified via \a theSubObject.
6721 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6722 # identifies an object within its parent specified via \a theObject.
6723 # @return TRUE, if the given object contains sub-object.
6724 @ManageTransactions("ShapesOp")
6725 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6727 Check if the object is a sub-object of another GEOM object.
6730 aSubObject Checked sub-object (or its parent object, in case if
6731 \a theSubObjectIndex is non-zero).
6732 anObject An object that is checked for ownership (or its parent object,
6733 in case if \a theObjectIndex is non-zero).
6734 aSubObjectIndex When non-zero, specifies a sub-shape index that
6735 identifies a sub-object within its parent specified via \a theSubObject.
6736 anObjectIndex When non-zero, specifies a sub-shape index that
6737 identifies an object within its parent specified via \a theObject.
6740 TRUE, if the given object contains sub-object.
6742 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6743 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6746 ## Perform extraction of sub-shapes from the main shape.
6748 # @param theShape the main shape
6749 # @param theListOfID the list of sub-shape IDs to be extracted from
6751 # @return New GEOM.GEOM_Object, containing the shape without
6752 # extracted sub-shapes.
6754 # @ref swig_MakeExtraction "Example"
6755 @ManageTransactions("ShapesOp")
6756 def MakeExtraction(self, theShape, theListOfID, theName=None):
6758 Perform extraction of sub-shapes from the main shape.
6761 theShape the main shape
6762 theListOfID the list of sub-shape IDs to be extracted from
6766 New GEOM.GEOM_Object, containing the shape without
6767 extracted sub-shapes.
6769 # Example: see GEOM_TestAll.py
6770 (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6771 RaiseIfFailed("MakeExtraction", self.ShapesOp)
6772 self._autoPublish(anObj, theName, "Extraction")
6775 # end of l4_decompose
6778 ## @addtogroup l4_decompose_d
6781 ## Deprecated method
6782 # It works like SubShapeAllSortedCentres(), but wrongly
6783 # defines centres of faces, shells and solids.
6784 @ManageTransactions("ShapesOp")
6785 def SubShapeAllSorted(self, aShape, aType, theName=None):
6788 It works like geompy.SubShapeAllSortedCentres, but wrongly
6789 defines centres of faces, shells and solids.
6791 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6792 RaiseIfFailed("MakeExplode", self.ShapesOp)
6793 self._autoPublish(ListObj, theName, "subshape")
6796 ## Deprecated method
6797 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6798 # defines centres of faces, shells and solids.
6799 @ManageTransactions("ShapesOp")
6800 def SubShapeAllSortedIDs(self, aShape, aType):
6803 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6804 defines centres of faces, shells and solids.
6806 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6807 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6810 ## Deprecated method
6811 # It works like SubShapeSortedCentres(), but has a bug
6812 # (wrongly defines centres of faces, shells and solids).
6813 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6816 It works like geompy.SubShapeSortedCentres, but has a bug
6817 (wrongly defines centres of faces, shells and solids).
6820 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6821 for ind in ListOfInd:
6822 ListOfIDs.append(AllShapeIDsList[ind - 1])
6823 # note: auto-publishing is done in self.GetSubShape()
6824 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6827 # end of l4_decompose_d
6830 ## @addtogroup l3_healing
6833 ## Apply a sequence of Shape Healing operators to the given object.
6834 # @param theShape Shape to be processed.
6835 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6836 # @param theParameters List of names of parameters
6837 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6838 # @param theValues List of values of parameters, in the same order
6839 # as parameters are listed in <VAR>theParameters</VAR> list.
6840 # @param theName Object name; when specified, this parameter is used
6841 # for result publication in the study. Otherwise, if automatic
6842 # publication is switched on, default value is used for result name.
6844 # <b> Operators and Parameters: </b> \n
6846 # * \b FixShape - corrects invalid shapes. \n
6847 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6848 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6850 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6851 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6852 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6853 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6854 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6855 # - \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
6856 # - \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
6857 # - \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
6859 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6860 # surfaces in segments using a certain angle. \n
6861 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6862 # if Angle=180, four if Angle=90, etc). \n
6863 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6865 # * \b SplitClosedFaces - splits closed faces in segments.
6866 # The number of segments depends on the number of splitting points.\n
6867 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6869 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6870 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6871 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6872 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6873 # This and the previous parameters can take the following values:\n
6874 # \b Parametric \b Continuity \n
6875 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6876 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6877 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6878 # ruling out sharp edges).\n
6879 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6880 # are of the same magnitude).\n
6881 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6882 # or surfaces (d/du C(u)) are the same at junction. \n
6883 # \b Geometric \b Continuity \n
6884 # \b G1: first derivatives are proportional at junction.\n
6885 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6886 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6887 # \b G2: first and second derivatives are proportional at junction.
6888 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6889 # continuity requires that the underlying parameterization was continuous as well.
6890 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6892 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6893 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6894 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6895 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6896 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6897 # with the specified parameters.\n
6898 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6899 # with the specified parameters.\n
6900 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6901 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6902 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6903 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6905 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6906 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6907 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6908 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6909 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6911 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6912 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6915 # @return New GEOM.GEOM_Object, containing processed shape.
6917 # \n @ref tui_shape_processing "Example"
6918 @ManageTransactions("HealOp")
6919 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6921 Apply a sequence of Shape Healing operators to the given object.
6924 theShape Shape to be processed.
6925 theValues List of values of parameters, in the same order
6926 as parameters are listed in theParameters list.
6927 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6928 theParameters List of names of parameters
6929 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6930 theName Object name; when specified, this parameter is used
6931 for result publication in the study. Otherwise, if automatic
6932 publication is switched on, default value is used for result name.
6934 Operators and Parameters:
6936 * FixShape - corrects invalid shapes.
6937 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6938 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6939 * FixFaceSize - removes small faces, such as spots and strips.
6940 * FixFaceSize.Tolerance - defines minimum possible face size.
6941 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6942 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6943 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6944 * 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.
6945 * 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.
6946 * 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.
6948 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6949 in segments using a certain angle.
6950 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6951 if Angle=180, four if Angle=90, etc).
6952 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6953 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6955 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6956 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6957 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6958 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6959 * SplitContinuity.CurveContinuity - required continuity for curves.
6960 This and the previous parameters can take the following values:
6962 Parametric Continuity:
6963 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6964 coincidental. The curves or surfaces may still meet at an angle,
6965 giving rise to a sharp corner or edge).
6966 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6967 are parallel, ruling out sharp edges).
6968 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6969 or surfaces are of the same magnitude).
6970 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6971 curves or surfaces (d/du C(u)) are the same at junction.
6973 Geometric Continuity:
6974 G1: first derivatives are proportional at junction.
6975 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6976 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6977 G2: first and second derivatives are proportional at junction. As the names imply,
6978 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6979 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6980 geometric continuity of order n, but not vice-versa.
6981 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
6982 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
6983 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
6984 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
6985 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
6986 the specified parameters.
6987 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
6988 the specified parameters.
6989 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
6990 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
6991 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
6992 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
6993 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
6994 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
6995 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
6996 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
6997 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
6998 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
6999 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7002 New GEOM.GEOM_Object, containing processed shape.
7004 Note: For more information look through SALOME Geometry User's Guide->
7005 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7007 # Example: see GEOM_TestHealing.py
7008 theValues,Parameters = ParseList(theValues)
7009 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7010 # To avoid script failure in case of good argument shape
7011 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7013 RaiseIfFailed("ProcessShape", self.HealOp)
7014 for string in (theOperators + theParameters):
7015 Parameters = ":" + Parameters
7017 anObj.SetParameters(Parameters)
7018 self._autoPublish(anObj, theName, "healed")
7021 ## Remove faces from the given object (shape).
7022 # @param theObject Shape to be processed.
7023 # @param theFaces Indices of faces to be removed, if EMPTY then the method
7024 # removes ALL faces of the given object.
7025 # @param theName Object name; when specified, this parameter is used
7026 # for result publication in the study. Otherwise, if automatic
7027 # publication is switched on, default value is used for result name.
7029 # @return New GEOM.GEOM_Object, containing processed shape.
7031 # @ref tui_suppress_faces "Example"
7032 @ManageTransactions("HealOp")
7033 def SuppressFaces(self, theObject, theFaces, theName=None):
7035 Remove faces from the given object (shape).
7038 theObject Shape to be processed.
7039 theFaces Indices of faces to be removed, if EMPTY then the method
7040 removes ALL faces of the given object.
7041 theName Object name; when specified, this parameter is used
7042 for result publication in the study. Otherwise, if automatic
7043 publication is switched on, default value is used for result name.
7046 New GEOM.GEOM_Object, containing processed shape.
7048 # Example: see GEOM_TestHealing.py
7049 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7050 RaiseIfFailed("SuppressFaces", self.HealOp)
7051 self._autoPublish(anObj, theName, "suppressFaces")
7054 ## Sewing of faces into a single shell.
7055 # @param ListShape Shapes to be processed.
7056 # @param theTolerance Required tolerance value.
7057 # @param AllowNonManifold Flag that allows non-manifold sewing.
7058 # @param theName Object name; when specified, this parameter is used
7059 # for result publication in the study. Otherwise, if automatic
7060 # publication is switched on, default value is used for result name.
7062 # @return New GEOM.GEOM_Object, containing a result shell.
7064 # @ref tui_sewing "Example"
7065 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7067 Sewing of faces into a single shell.
7070 ListShape Shapes to be processed.
7071 theTolerance Required tolerance value.
7072 AllowNonManifold Flag that allows non-manifold sewing.
7073 theName Object name; when specified, this parameter is used
7074 for result publication in the study. Otherwise, if automatic
7075 publication is switched on, default value is used for result name.
7078 New GEOM.GEOM_Object, containing containing a result shell.
7080 # Example: see GEOM_TestHealing.py
7081 # note: auto-publishing is done in self.Sew()
7082 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7085 ## Sewing of faces into a single shell.
7086 # @param ListShape Shapes to be processed.
7087 # @param theTolerance Required tolerance value.
7088 # @param AllowNonManifold Flag that allows non-manifold sewing.
7089 # @param theName Object name; when specified, this parameter is used
7090 # for result publication in the study. Otherwise, if automatic
7091 # publication is switched on, default value is used for result name.
7093 # @return New GEOM.GEOM_Object, containing a result shell.
7094 @ManageTransactions("HealOp")
7095 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7097 Sewing of faces into a single shell.
7100 ListShape Shapes to be processed.
7101 theTolerance Required tolerance value.
7102 AllowNonManifold Flag that allows non-manifold sewing.
7103 theName Object name; when specified, this parameter is used
7104 for result publication in the study. Otherwise, if automatic
7105 publication is switched on, default value is used for result name.
7108 New GEOM.GEOM_Object, containing a result shell.
7110 # Example: see MakeSewing() above
7111 theTolerance,Parameters = ParseParameters(theTolerance)
7112 if AllowNonManifold:
7113 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7115 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7116 # To avoid script failure in case of good argument shape
7117 # (Fix of test cases geom/bugs11/L7,L8)
7118 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7120 RaiseIfFailed("Sew", self.HealOp)
7121 anObj.SetParameters(Parameters)
7122 self._autoPublish(anObj, theName, "sewed")
7125 ## Rebuild the topology of theSolids by removing
7126 # the faces that are shared by several solids.
7127 # @param theSolids A compound or a list of solids to be processed.
7128 # @param theName Object name; when specified, this parameter is used
7129 # for result publication in the study. Otherwise, if automatic
7130 # publication is switched on, default value is used for result name.
7132 # @return New GEOM.GEOM_Object, containing processed shape.
7134 # @ref tui_remove_webs "Example"
7135 @ManageTransactions("HealOp")
7136 def RemoveInternalFaces (self, theSolids, theName=None):
7138 Rebuild the topology of theSolids by removing
7139 the faces that are shared by several solids.
7142 theSolids A compound or a list of solids to be processed.
7143 theName Object name; when specified, this parameter is used
7144 for result publication in the study. Otherwise, if automatic
7145 publication is switched on, default value is used for result name.
7148 New GEOM.GEOM_Object, containing processed shape.
7150 # Example: see GEOM_TestHealing.py
7151 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7152 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7153 self._autoPublish(anObj, theName, "removeWebs")
7156 ## Remove internal wires and edges from the given object (face).
7157 # @param theObject Shape to be processed.
7158 # @param theWires Indices of wires to be removed, if EMPTY then the method
7159 # removes ALL internal wires of the given object.
7160 # @param theName Object name; when specified, this parameter is used
7161 # for result publication in the study. Otherwise, if automatic
7162 # publication is switched on, default value is used for result name.
7164 # @return New GEOM.GEOM_Object, containing processed shape.
7166 # @ref tui_suppress_internal_wires "Example"
7167 @ManageTransactions("HealOp")
7168 def SuppressInternalWires(self, theObject, theWires, theName=None):
7170 Remove internal wires and edges from the given object (face).
7173 theObject Shape to be processed.
7174 theWires Indices of wires to be removed, if EMPTY then the method
7175 removes ALL internal wires of the given object.
7176 theName Object name; when specified, this parameter is used
7177 for result publication in the study. Otherwise, if automatic
7178 publication is switched on, default value is used for result name.
7181 New GEOM.GEOM_Object, containing processed shape.
7183 # Example: see GEOM_TestHealing.py
7184 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7185 RaiseIfFailed("RemoveIntWires", self.HealOp)
7186 self._autoPublish(anObj, theName, "suppressWires")
7189 ## Remove internal closed contours (holes) from the given object.
7190 # @param theObject Shape to be processed.
7191 # @param theWires Indices of wires to be removed, if EMPTY then the method
7192 # removes ALL internal holes of the given object
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_suppress_holes "Example"
7200 @ManageTransactions("HealOp")
7201 def SuppressHoles(self, theObject, theWires, theName=None):
7203 Remove internal closed contours (holes) from the given object.
7206 theObject Shape to be processed.
7207 theWires Indices of wires to be removed, if EMPTY then the method
7208 removes ALL internal holes of the given object
7209 theName Object name; when specified, this parameter is used
7210 for result publication in the study. Otherwise, if automatic
7211 publication is switched on, default value is used for result name.
7214 New GEOM.GEOM_Object, containing processed shape.
7216 # Example: see GEOM_TestHealing.py
7217 anObj = self.HealOp.FillHoles(theObject, theWires)
7218 RaiseIfFailed("FillHoles", self.HealOp)
7219 self._autoPublish(anObj, theName, "suppressHoles")
7222 ## Close an open wire.
7223 # @param theObject Shape to be processed.
7224 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7225 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7226 # @param isCommonVertex If True : closure by creation of a common vertex,
7227 # If False : closure by creation of an edge between ends.
7228 # @param theName Object name; when specified, this parameter is used
7229 # for result publication in the study. Otherwise, if automatic
7230 # publication is switched on, default value is used for result name.
7232 # @return New GEOM.GEOM_Object, containing processed shape.
7234 # @ref tui_close_contour "Example"
7235 @ManageTransactions("HealOp")
7236 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7241 theObject Shape to be processed.
7242 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7243 if [ ], then theObject itself is a wire.
7244 isCommonVertex If True : closure by creation of a common vertex,
7245 If False : closure by creation of an edge between ends.
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, containing processed shape.
7253 # Example: see GEOM_TestHealing.py
7254 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7255 RaiseIfFailed("CloseContour", self.HealOp)
7256 self._autoPublish(anObj, theName, "closeContour")
7259 ## Addition of a point to a given edge object.
7260 # @param theObject Shape to be processed.
7261 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7262 # if -1, then theObject itself is the edge.
7263 # @param theValue Value of parameter on edge or length parameter,
7264 # depending on \a isByParameter.
7265 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7266 # if FALSE : \a theValue is treated as a length parameter [0..1]
7267 # @param theName Object name; when specified, this parameter is used
7268 # for result publication in the study. Otherwise, if automatic
7269 # publication is switched on, default value is used for result name.
7271 # @return New GEOM.GEOM_Object, containing processed shape.
7273 # @ref tui_add_point_on_edge "Example"
7274 @ManageTransactions("HealOp")
7275 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7277 Addition of a point to a given edge object.
7280 theObject Shape to be processed.
7281 theEdgeIndex Index of edge to be divided within theObject's shape,
7282 if -1, then theObject itself is the edge.
7283 theValue Value of parameter on edge or length parameter,
7284 depending on isByParameter.
7285 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7286 if FALSE : theValue is treated as a length parameter [0..1]
7287 theName Object name; when specified, this parameter is used
7288 for result publication in the study. Otherwise, if automatic
7289 publication is switched on, default value is used for result name.
7292 New GEOM.GEOM_Object, containing processed shape.
7294 # Example: see GEOM_TestHealing.py
7295 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7296 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7297 RaiseIfFailed("DivideEdge", self.HealOp)
7298 anObj.SetParameters(Parameters)
7299 self._autoPublish(anObj, theName, "divideEdge")
7302 ## Addition of points to a given edge of \a theObject by projecting
7303 # other points to the given edge.
7304 # @param theObject Shape to be processed.
7305 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7306 # if -1, then theObject itself is the edge.
7307 # @param thePoints List of points to project to theEdgeIndex-th edge.
7308 # @param theName Object name; when specified, this parameter is used
7309 # for result publication in the study. Otherwise, if automatic
7310 # publication is switched on, default value is used for result name.
7312 # @return New GEOM.GEOM_Object, containing processed shape.
7314 # @ref tui_add_point_on_edge "Example"
7315 @ManageTransactions("HealOp")
7316 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7318 Addition of points to a given edge of \a theObject by projecting
7319 other points to the given edge.
7322 theObject Shape to be processed.
7323 theEdgeIndex The edge or its index to be divided within theObject's shape,
7324 if -1, then theObject itself is the edge.
7325 thePoints List of points to project to theEdgeIndex-th edge.
7326 theName Object name; when specified, this parameter is used
7327 for result publication in the study. Otherwise, if automatic
7328 publication is switched on, default value is used for result name.
7331 New GEOM.GEOM_Object, containing processed shape.
7333 # Example: see GEOM_TestHealing.py
7334 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7335 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7336 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7337 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7338 self._autoPublish(anObj, theName, "divideEdge")
7341 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7342 # @param theWire Wire to minimize the number of C1 continuous edges in.
7343 # @param theVertices A list of vertices to suppress. If the list
7344 # is empty, all vertices in a wire will be assumed.
7345 # @param theName Object name; when specified, this parameter is used
7346 # for result publication in the study. Otherwise, if automatic
7347 # publication is switched on, default value is used for result name.
7349 # @return New GEOM.GEOM_Object with modified wire.
7351 # @ref tui_fuse_collinear_edges "Example"
7352 @ManageTransactions("HealOp")
7353 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7355 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7358 theWire Wire to minimize the number of C1 continuous edges in.
7359 theVertices A list of vertices to suppress. If the list
7360 is empty, all vertices in a wire will be assumed.
7361 theName Object name; when specified, this parameter is used
7362 for result publication in the study. Otherwise, if automatic
7363 publication is switched on, default value is used for result name.
7366 New GEOM.GEOM_Object with modified wire.
7368 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7369 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7370 self._autoPublish(anObj, theName, "fuseEdges")
7373 ## Change orientation of the given object. Updates given shape.
7374 # @param theObject Shape to be processed.
7375 # @return Updated <var>theObject</var>
7377 # @ref swig_todo "Example"
7378 @ManageTransactions("HealOp")
7379 def ChangeOrientationShell(self,theObject):
7381 Change orientation of the given object. Updates given shape.
7384 theObject Shape to be processed.
7389 theObject = self.HealOp.ChangeOrientation(theObject)
7390 RaiseIfFailed("ChangeOrientation", self.HealOp)
7393 ## Change orientation of the given object.
7394 # @param theObject Shape to be processed.
7395 # @param theName Object name; when specified, this parameter is used
7396 # for result publication in the study. Otherwise, if automatic
7397 # publication is switched on, default value is used for result name.
7399 # @return New GEOM.GEOM_Object, containing processed shape.
7401 # @ref swig_todo "Example"
7402 @ManageTransactions("HealOp")
7403 def ChangeOrientationShellCopy(self, theObject, theName=None):
7405 Change orientation of the given object.
7408 theObject Shape to be processed.
7409 theName Object name; when specified, this parameter is used
7410 for result publication in the study. Otherwise, if automatic
7411 publication is switched on, default value is used for result name.
7414 New GEOM.GEOM_Object, containing processed shape.
7416 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7417 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7418 self._autoPublish(anObj, theName, "reversed")
7421 ## Try to limit tolerance of the given object by value \a theTolerance.
7422 # @param theObject Shape to be processed.
7423 # @param theTolerance Required tolerance value.
7424 # @param theName Object name; when specified, this parameter is used
7425 # for result publication in the study. Otherwise, if automatic
7426 # publication is switched on, default value is used for result name.
7428 # @return New GEOM.GEOM_Object, containing processed shape.
7430 # @ref tui_limit_tolerance "Example"
7431 @ManageTransactions("HealOp")
7432 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7434 Try to limit tolerance of the given object by value theTolerance.
7437 theObject Shape to be processed.
7438 theTolerance Required tolerance value.
7439 theName Object name; when specified, this parameter is used
7440 for result publication in the study. Otherwise, if automatic
7441 publication is switched on, default value is used for result name.
7444 New GEOM.GEOM_Object, containing processed shape.
7446 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7447 RaiseIfFailed("LimitTolerance", self.HealOp)
7448 self._autoPublish(anObj, theName, "limitTolerance")
7451 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7452 # that constitute a free boundary of the given shape.
7453 # @param theObject Shape to get free boundary of.
7454 # @param theName Object name; when specified, this parameter is used
7455 # for result publication in the study. Otherwise, if automatic
7456 # publication is switched on, default value is used for result name.
7458 # @return [\a status, \a theClosedWires, \a theOpenWires]
7459 # \n \a status: FALSE, if an error(s) occurred during the method execution.
7460 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7461 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7463 # @ref tui_free_boundaries_page "Example"
7464 @ManageTransactions("HealOp")
7465 def GetFreeBoundary(self, theObject, theName=None):
7467 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7468 that constitute a free boundary of the given shape.
7471 theObject Shape to get free boundary of.
7472 theName Object name; when specified, this parameter is used
7473 for result publication in the study. Otherwise, if automatic
7474 publication is switched on, default value is used for result name.
7477 [status, theClosedWires, theOpenWires]
7478 status: FALSE, if an error(s) occurred during the method execution.
7479 theClosedWires: Closed wires on the free boundary of the given shape.
7480 theOpenWires: Open wires on the free boundary of the given shape.
7482 # Example: see GEOM_TestHealing.py
7483 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7484 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7485 self._autoPublish(anObj[1], theName, "closedWire")
7486 self._autoPublish(anObj[2], theName, "openWire")
7489 ## Replace coincident faces in \a theShapes by one face.
7490 # @param theShapes Initial shapes, either a list or compound of shapes.
7491 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7492 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7493 # otherwise all initial shapes.
7494 # @param theName Object name; when specified, this parameter is used
7495 # for result publication in the study. Otherwise, if automatic
7496 # publication is switched on, default value is used for result name.
7498 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7500 # @ref tui_glue_faces "Example"
7501 @ManageTransactions("ShapesOp")
7502 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7504 Replace coincident faces in theShapes by one face.
7507 theShapes Initial shapes, either a list or compound of shapes.
7508 theTolerance Maximum distance between faces, which can be considered as coincident.
7509 doKeepNonSolids If FALSE, only solids will present in the result,
7510 otherwise all initial shapes.
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 faces.
7518 # Example: see GEOM_Spanner.py
7519 theTolerance,Parameters = ParseParameters(theTolerance)
7520 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7522 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7523 anObj.SetParameters(Parameters)
7524 self._autoPublish(anObj, theName, "glueFaces")
7527 ## Find coincident faces in \a theShapes for possible gluing.
7528 # @param theShapes Initial shapes, either a list or compound of shapes.
7529 # @param theTolerance Maximum distance between faces,
7530 # which can be considered as coincident.
7531 # @param theName Object name; when specified, this parameter is used
7532 # for result publication in the study. Otherwise, if automatic
7533 # publication is switched on, default value is used for result name.
7535 # @return GEOM.ListOfGO
7537 # @ref tui_glue_faces "Example"
7538 @ManageTransactions("ShapesOp")
7539 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7541 Find coincident faces in theShapes for possible gluing.
7544 theShapes Initial shapes, either a list or compound of shapes.
7545 theTolerance Maximum distance between faces,
7546 which can be considered as coincident.
7547 theName Object name; when specified, this parameter is used
7548 for result publication in the study. Otherwise, if automatic
7549 publication is switched on, default value is used for result name.
7554 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7555 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7556 self._autoPublish(anObj, theName, "facesToGlue")
7559 ## Replace coincident faces in \a theShapes by one face
7560 # in compliance with given list of faces
7561 # @param theShapes Initial shapes, either a list or compound of shapes.
7562 # @param theTolerance Maximum distance between faces,
7563 # which can be considered as coincident.
7564 # @param theFaces List of faces for gluing.
7565 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7566 # otherwise all initial shapes.
7567 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7568 # will be glued, otherwise only the edges,
7569 # belonging to <VAR>theFaces</VAR>.
7570 # @param theName Object name; when specified, this parameter is used
7571 # for result publication in the study. Otherwise, if automatic
7572 # publication is switched on, default value is used for result name.
7574 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7576 # @ref tui_glue_faces "Example"
7577 @ManageTransactions("ShapesOp")
7578 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7579 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7581 Replace coincident faces in theShapes by one face
7582 in compliance with given list of faces
7585 theShapes theShapes Initial shapes, either a list or compound of shapes.
7586 theTolerance Maximum distance between faces,
7587 which can be considered as coincident.
7588 theFaces List of faces for gluing.
7589 doKeepNonSolids If FALSE, only solids will present in the result,
7590 otherwise all initial shapes.
7591 doGlueAllEdges If TRUE, all coincident edges of theShape
7592 will be glued, otherwise only the edges,
7593 belonging to theFaces.
7594 theName Object name; when specified, this parameter is used
7595 for result publication in the study. Otherwise, if automatic
7596 publication is switched on, default value is used for result name.
7599 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7601 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7602 doKeepNonSolids, doGlueAllEdges)
7604 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7605 self._autoPublish(anObj, theName, "glueFaces")
7608 ## Replace coincident edges in \a theShapes by one edge.
7609 # @param theShapes Initial shapes, either a list or compound of shapes.
7610 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7611 # @param theName Object name; when specified, this parameter is used
7612 # for result publication in the study. Otherwise, if automatic
7613 # publication is switched on, default value is used for result name.
7615 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7617 # @ref tui_glue_edges "Example"
7618 @ManageTransactions("ShapesOp")
7619 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7621 Replace coincident edges in theShapes by one edge.
7624 theShapes Initial shapes, either a list or compound of shapes.
7625 theTolerance Maximum distance between edges, which can be considered as coincident.
7626 theName Object name; when specified, this parameter is used
7627 for result publication in the study. Otherwise, if automatic
7628 publication is switched on, default value is used for result name.
7631 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7633 theTolerance,Parameters = ParseParameters(theTolerance)
7634 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7636 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7637 anObj.SetParameters(Parameters)
7638 self._autoPublish(anObj, theName, "glueEdges")
7641 ## Find coincident edges in \a theShapes for possible gluing.
7642 # @param theShapes Initial shapes, either a list or compound of shapes.
7643 # @param theTolerance Maximum distance between edges,
7644 # which can be considered as coincident.
7645 # @param theName Object name; when specified, this parameter is used
7646 # for result publication in the study. Otherwise, if automatic
7647 # publication is switched on, default value is used for result name.
7649 # @return GEOM.ListOfGO
7651 # @ref tui_glue_edges "Example"
7652 @ManageTransactions("ShapesOp")
7653 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7655 Find coincident edges in theShapes for possible gluing.
7658 theShapes Initial shapes, either a list or compound of shapes.
7659 theTolerance Maximum distance between edges,
7660 which can be considered as coincident.
7661 theName Object name; when specified, this parameter is used
7662 for result publication in the study. Otherwise, if automatic
7663 publication is switched on, default value is used for result name.
7668 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7669 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7670 self._autoPublish(anObj, theName, "edgesToGlue")
7673 ## Replace coincident edges in theShapes by one edge
7674 # in compliance with given list of edges.
7675 # @param theShapes Initial shapes, either a list or compound of shapes.
7676 # @param theTolerance Maximum distance between edges,
7677 # which can be considered as coincident.
7678 # @param theEdges List of edges for gluing.
7679 # @param theName Object name; when specified, this parameter is used
7680 # for result publication in the study. Otherwise, if automatic
7681 # publication is switched on, default value is used for result name.
7683 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7685 # @ref tui_glue_edges "Example"
7686 @ManageTransactions("ShapesOp")
7687 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7689 Replace coincident edges in theShapes by one edge
7690 in compliance with given list of edges.
7693 theShapes Initial shapes, either a list or compound of shapes.
7694 theTolerance Maximum distance between edges,
7695 which can be considered as coincident.
7696 theEdges List of edges for gluing.
7697 theName Object name; when specified, this parameter is used
7698 for result publication in the study. Otherwise, if automatic
7699 publication is switched on, default value is used for result name.
7702 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7704 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7706 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7707 self._autoPublish(anObj, theName, "glueEdges")
7713 ## @addtogroup l3_boolean Boolean Operations
7716 # -----------------------------------------------------------------------------
7717 # Boolean (Common, Cut, Fuse, Section)
7718 # -----------------------------------------------------------------------------
7720 ## Perform one of boolean operations on two given shapes.
7721 # @param theShape1 First argument for boolean operation.
7722 # @param theShape2 Second argument for boolean operation.
7723 # @param theOperation Indicates the operation to be done:\n
7724 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7725 # @param checkSelfInte The flag that tells if the arguments should
7726 # be checked for self-intersection prior to the operation.
7727 # @param theName Object name; when specified, this parameter is used
7728 # for result publication in the study. Otherwise, if automatic
7729 # publication is switched on, default value is used for result name.
7731 # @note This algorithm doesn't find all types of self-intersections.
7732 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7733 # vertex/face and edge/face intersections. Face/face
7734 # intersections detection is switched off as it is a
7735 # time-consuming operation that gives an impact on performance.
7736 # To find all self-intersections please use
7737 # CheckSelfIntersections() method.
7739 # @return New GEOM.GEOM_Object, containing the result shape.
7741 # @ref tui_fuse "Example"
7742 @ManageTransactions("BoolOp")
7743 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7745 Perform one of boolean operations on two given shapes.
7748 theShape1 First argument for boolean operation.
7749 theShape2 Second argument for boolean operation.
7750 theOperation Indicates the operation to be done:
7751 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7752 checkSelfInte The flag that tells if the arguments should
7753 be checked for self-intersection prior to
7755 theName Object name; when specified, this parameter is used
7756 for result publication in the study. Otherwise, if automatic
7757 publication is switched on, default value is used for result name.
7760 This algorithm doesn't find all types of self-intersections.
7761 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7762 vertex/face and edge/face intersections. Face/face
7763 intersections detection is switched off as it is a
7764 time-consuming operation that gives an impact on performance.
7765 To find all self-intersections please use
7766 CheckSelfIntersections() method.
7769 New GEOM.GEOM_Object, containing the result shape.
7771 # Example: see GEOM_TestAll.py
7772 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7773 RaiseIfFailed("MakeBoolean", self.BoolOp)
7774 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7775 self._autoPublish(anObj, theName, def_names[theOperation])
7778 ## Perform Common boolean operation on two given shapes.
7779 # @param theShape1 First argument for boolean operation.
7780 # @param theShape2 Second argument for boolean operation.
7781 # @param checkSelfInte The flag that tells if the arguments should
7782 # be checked for self-intersection prior to the operation.
7783 # @param theName Object name; when specified, this parameter is used
7784 # for result publication in the study. Otherwise, if automatic
7785 # publication is switched on, default value is used for result name.
7787 # @note This algorithm doesn't find all types of self-intersections.
7788 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7789 # vertex/face and edge/face intersections. Face/face
7790 # intersections detection is switched off as it is a
7791 # time-consuming operation that gives an impact on performance.
7792 # To find all self-intersections please use
7793 # CheckSelfIntersections() method.
7795 # @return New GEOM.GEOM_Object, containing the result shape.
7797 # @ref tui_common "Example 1"
7798 # \n @ref swig_MakeCommon "Example 2"
7799 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7801 Perform Common boolean operation on two given shapes.
7804 theShape1 First argument for boolean operation.
7805 theShape2 Second argument for boolean operation.
7806 checkSelfInte The flag that tells if the arguments should
7807 be checked for self-intersection prior to
7809 theName Object name; when specified, this parameter is used
7810 for result publication in the study. Otherwise, if automatic
7811 publication is switched on, default value is used for result name.
7814 This algorithm doesn't find all types of self-intersections.
7815 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7816 vertex/face and edge/face intersections. Face/face
7817 intersections detection is switched off as it is a
7818 time-consuming operation that gives an impact on performance.
7819 To find all self-intersections please use
7820 CheckSelfIntersections() method.
7823 New GEOM.GEOM_Object, containing the result shape.
7825 # Example: see GEOM_TestOthers.py
7826 # note: auto-publishing is done in self.MakeBoolean()
7827 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7829 ## Perform Cut boolean operation on two given shapes.
7830 # @param theShape1 First argument for boolean operation.
7831 # @param theShape2 Second argument for boolean operation.
7832 # @param checkSelfInte The flag that tells if the arguments should
7833 # be checked for self-intersection prior to the operation.
7834 # @param theName Object name; when specified, this parameter is used
7835 # for result publication in the study. Otherwise, if automatic
7836 # publication is switched on, default value is used for result name.
7838 # @note This algorithm doesn't find all types of self-intersections.
7839 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7840 # vertex/face and edge/face intersections. Face/face
7841 # intersections detection is switched off as it is a
7842 # time-consuming operation that gives an impact on performance.
7843 # To find all self-intersections please use
7844 # CheckSelfIntersections() method.
7846 # @return New GEOM.GEOM_Object, containing the result shape.
7848 # @ref tui_cut "Example 1"
7849 # \n @ref swig_MakeCommon "Example 2"
7850 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7852 Perform Cut boolean operation on two given shapes.
7855 theShape1 First argument for boolean operation.
7856 theShape2 Second argument for boolean operation.
7857 checkSelfInte The flag that tells if the arguments should
7858 be checked for self-intersection prior to
7860 theName Object name; when specified, this parameter is used
7861 for result publication in the study. Otherwise, if automatic
7862 publication is switched on, default value is used for result name.
7865 This algorithm doesn't find all types of self-intersections.
7866 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7867 vertex/face and edge/face intersections. Face/face
7868 intersections detection is switched off as it is a
7869 time-consuming operation that gives an impact on performance.
7870 To find all self-intersections please use
7871 CheckSelfIntersections() method.
7874 New GEOM.GEOM_Object, containing the result shape.
7877 # Example: see GEOM_TestOthers.py
7878 # note: auto-publishing is done in self.MakeBoolean()
7879 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7881 ## Perform Fuse boolean operation on two given shapes.
7882 # @param theShape1 First argument for boolean operation.
7883 # @param theShape2 Second argument for boolean operation.
7884 # @param checkSelfInte The flag that tells if the arguments should
7885 # be checked for self-intersection prior to the operation.
7886 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7887 # operation should be performed during the operation.
7888 # @param theName Object name; when specified, this parameter is used
7889 # for result publication in the study. Otherwise, if automatic
7890 # publication is switched on, default value is used for result name.
7892 # @note This algorithm doesn't find all types of self-intersections.
7893 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7894 # vertex/face and edge/face intersections. Face/face
7895 # intersections detection is switched off as it is a
7896 # time-consuming operation that gives an impact on performance.
7897 # To find all self-intersections please use
7898 # CheckSelfIntersections() method.
7900 # @return New GEOM.GEOM_Object, containing the result shape.
7902 # @ref tui_fuse "Example 1"
7903 # \n @ref swig_MakeCommon "Example 2"
7904 @ManageTransactions("BoolOp")
7905 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7906 rmExtraEdges=False, theName=None):
7908 Perform Fuse boolean operation on two given shapes.
7911 theShape1 First argument for boolean operation.
7912 theShape2 Second argument for boolean operation.
7913 checkSelfInte The flag that tells if the arguments should
7914 be checked for self-intersection prior to
7916 rmExtraEdges The flag that tells if Remove Extra Edges
7917 operation should be performed during the operation.
7918 theName Object name; when specified, this parameter is used
7919 for result publication in the study. Otherwise, if automatic
7920 publication is switched on, default value is used for result name.
7923 This algorithm doesn't find all types of self-intersections.
7924 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7925 vertex/face and edge/face intersections. Face/face
7926 intersections detection is switched off as it is a
7927 time-consuming operation that gives an impact on performance.
7928 To find all self-intersections please use
7929 CheckSelfIntersections() method.
7932 New GEOM.GEOM_Object, containing the result shape.
7935 # Example: see GEOM_TestOthers.py
7936 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7937 checkSelfInte, rmExtraEdges)
7938 RaiseIfFailed("MakeFuse", self.BoolOp)
7939 self._autoPublish(anObj, theName, "fuse")
7942 ## Perform Section boolean operation on two given shapes.
7943 # @param theShape1 First argument for boolean operation.
7944 # @param theShape2 Second argument for boolean operation.
7945 # @param checkSelfInte The flag that tells if the arguments should
7946 # be checked for self-intersection prior to the operation.
7947 # If a self-intersection detected the operation fails.
7948 # @param theName Object name; when specified, this parameter is used
7949 # for result publication in the study. Otherwise, if automatic
7950 # publication is switched on, default value is used for result name.
7951 # @return New GEOM.GEOM_Object, containing the result shape.
7953 # @ref tui_section "Example 1"
7954 # \n @ref swig_MakeCommon "Example 2"
7955 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7957 Perform Section boolean operation on two given shapes.
7960 theShape1 First argument for boolean operation.
7961 theShape2 Second argument for boolean operation.
7962 checkSelfInte The flag that tells if the arguments should
7963 be checked for self-intersection prior to the operation.
7964 If a self-intersection detected the operation fails.
7965 theName Object name; when specified, this parameter is used
7966 for result publication in the study. Otherwise, if automatic
7967 publication is switched on, default value is used for result name.
7969 New GEOM.GEOM_Object, containing the result shape.
7972 # Example: see GEOM_TestOthers.py
7973 # note: auto-publishing is done in self.MakeBoolean()
7974 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7976 ## Perform Fuse boolean operation on the list of shapes.
7977 # @param theShapesList Shapes to be fused.
7978 # @param checkSelfInte The flag that tells if the arguments should
7979 # be checked for self-intersection prior to the operation.
7980 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7981 # operation should be performed during the operation.
7982 # @param theName Object name; when specified, this parameter is used
7983 # for result publication in the study. Otherwise, if automatic
7984 # publication is switched on, default value is used for result name.
7986 # @note This algorithm doesn't find all types of self-intersections.
7987 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7988 # vertex/face and edge/face intersections. Face/face
7989 # intersections detection is switched off as it is a
7990 # time-consuming operation that gives an impact on performance.
7991 # To find all self-intersections please use
7992 # CheckSelfIntersections() method.
7994 # @return New GEOM.GEOM_Object, containing the result shape.
7996 # @ref tui_fuse "Example 1"
7997 # \n @ref swig_MakeCommon "Example 2"
7998 @ManageTransactions("BoolOp")
7999 def MakeFuseList(self, theShapesList, checkSelfInte=False,
8000 rmExtraEdges=False, theName=None):
8002 Perform Fuse boolean operation on the list of shapes.
8005 theShapesList Shapes to be fused.
8006 checkSelfInte The flag that tells if the arguments should
8007 be checked for self-intersection prior to
8009 rmExtraEdges The flag that tells if Remove Extra Edges
8010 operation should be performed during the operation.
8011 theName Object name; when specified, this parameter is used
8012 for result publication in the study. Otherwise, if automatic
8013 publication is switched on, default value is used for result name.
8016 This algorithm doesn't find all types of self-intersections.
8017 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8018 vertex/face and edge/face intersections. Face/face
8019 intersections detection is switched off as it is a
8020 time-consuming operation that gives an impact on performance.
8021 To find all self-intersections please use
8022 CheckSelfIntersections() method.
8025 New GEOM.GEOM_Object, containing the result shape.
8028 # Example: see GEOM_TestOthers.py
8029 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8031 RaiseIfFailed("MakeFuseList", self.BoolOp)
8032 self._autoPublish(anObj, theName, "fuse")
8035 ## Perform Common boolean operation on the list of shapes.
8036 # @param theShapesList Shapes for Common operation.
8037 # @param checkSelfInte The flag that tells if the arguments should
8038 # be checked for self-intersection prior to the operation.
8039 # @param theName Object name; when specified, this parameter is used
8040 # for result publication in the study. Otherwise, if automatic
8041 # publication is switched on, default value is used for result name.
8043 # @note This algorithm doesn't find all types of self-intersections.
8044 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8045 # vertex/face and edge/face intersections. Face/face
8046 # intersections detection is switched off as it is a
8047 # time-consuming operation that gives an impact on performance.
8048 # To find all self-intersections please use
8049 # CheckSelfIntersections() method.
8051 # @return New GEOM.GEOM_Object, containing the result shape.
8053 # @ref tui_common "Example 1"
8054 # \n @ref swig_MakeCommon "Example 2"
8055 @ManageTransactions("BoolOp")
8056 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8058 Perform Common boolean operation on the list of shapes.
8061 theShapesList Shapes for Common operation.
8062 checkSelfInte The flag that tells if the arguments should
8063 be checked for self-intersection prior to
8065 theName Object name; when specified, this parameter is used
8066 for result publication in the study. Otherwise, if automatic
8067 publication is switched on, default value is used for result name.
8070 This algorithm doesn't find all types of self-intersections.
8071 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8072 vertex/face and edge/face intersections. Face/face
8073 intersections detection is switched off as it is a
8074 time-consuming operation that gives an impact on performance.
8075 To find all self-intersections please use
8076 CheckSelfIntersections() method.
8079 New GEOM.GEOM_Object, containing the result shape.
8082 # Example: see GEOM_TestOthers.py
8083 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8084 RaiseIfFailed("MakeCommonList", self.BoolOp)
8085 self._autoPublish(anObj, theName, "common")
8088 ## Perform Cut boolean operation on one object and the list of tools.
8089 # @param theMainShape The object of the operation.
8090 # @param theShapesList The list of tools of the operation.
8091 # @param checkSelfInte The flag that tells if the arguments should
8092 # be checked for self-intersection prior to the operation.
8093 # @param theName Object name; when specified, this parameter is used
8094 # for result publication in the study. Otherwise, if automatic
8095 # publication is switched on, default value is used for result name.
8097 # @note This algorithm doesn't find all types of self-intersections.
8098 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8099 # vertex/face and edge/face intersections. Face/face
8100 # intersections detection is switched off as it is a
8101 # time-consuming operation that gives an impact on performance.
8102 # To find all self-intersections please use
8103 # CheckSelfIntersections() method.
8105 # @return New GEOM.GEOM_Object, containing the result shape.
8107 # @ref tui_cut "Example 1"
8108 # \n @ref swig_MakeCommon "Example 2"
8109 @ManageTransactions("BoolOp")
8110 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8112 Perform Cut boolean operation on one object and the list of tools.
8115 theMainShape The object of the operation.
8116 theShapesList The list of tools of the operation.
8117 checkSelfInte The flag that tells if the arguments should
8118 be checked for self-intersection prior to
8120 theName Object name; when specified, this parameter is used
8121 for result publication in the study. Otherwise, if automatic
8122 publication is switched on, default value is used for result name.
8125 This algorithm doesn't find all types of self-intersections.
8126 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8127 vertex/face and edge/face intersections. Face/face
8128 intersections detection is switched off as it is a
8129 time-consuming operation that gives an impact on performance.
8130 To find all self-intersections please use
8131 CheckSelfIntersections() method.
8134 New GEOM.GEOM_Object, containing the result shape.
8137 # Example: see GEOM_TestOthers.py
8138 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8139 RaiseIfFailed("MakeCutList", self.BoolOp)
8140 self._autoPublish(anObj, theName, "cut")
8146 ## @addtogroup l3_basic_op
8149 ## Perform partition operation.
8150 # @param ListShapes Shapes to be intersected.
8151 # @param ListTools Shapes to intersect theShapes.
8152 # @param Limit Type of resulting shapes (see ShapeType()).\n
8153 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8154 # type will be detected automatically.
8155 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8156 # target type (equal to Limit) are kept in the result,
8157 # else standalone shapes of lower dimension
8158 # are kept also (if they exist).
8160 # @param theName Object name; when specified, this parameter is used
8161 # for result publication in the study. Otherwise, if automatic
8162 # publication is switched on, default value is used for result name.
8164 # @note Each compound from ListShapes and ListTools will be exploded
8165 # in order to avoid possible intersection between shapes from this compound.
8167 # After implementation new version of PartitionAlgo (October 2006)
8168 # other parameters are ignored by current functionality. They are kept
8169 # in this function only for support old versions.
8170 # @param ListKeepInside Shapes, outside which the results will be deleted.
8171 # Each shape from theKeepInside must belong to theShapes also.
8172 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8173 # Each shape from theRemoveInside must belong to theShapes also.
8174 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8175 # @param ListMaterials Material indices for each shape. Make sense,
8176 # only if theRemoveWebs is TRUE.
8178 # @return New GEOM.GEOM_Object, containing the result shapes.
8180 # @ref tui_partition "Example"
8181 @ManageTransactions("BoolOp")
8182 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8183 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8184 KeepNonlimitShapes=0, theName=None):
8186 Perform partition operation.
8189 ListShapes Shapes to be intersected.
8190 ListTools Shapes to intersect theShapes.
8191 Limit Type of resulting shapes (see geompy.ShapeType)
8192 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8193 type will be detected automatically.
8194 KeepNonlimitShapes if this parameter == 0, then only shapes of
8195 target type (equal to Limit) are kept in the result,
8196 else standalone shapes of lower dimension
8197 are kept also (if they exist).
8199 theName Object name; when specified, this parameter is used
8200 for result publication in the study. Otherwise, if automatic
8201 publication is switched on, default value is used for result name.
8203 Each compound from ListShapes and ListTools will be exploded
8204 in order to avoid possible intersection between shapes from
8207 After implementation new version of PartitionAlgo (October 2006) other
8208 parameters are ignored by current functionality. They are kept in this
8209 function only for support old versions.
8212 ListKeepInside Shapes, outside which the results will be deleted.
8213 Each shape from theKeepInside must belong to theShapes also.
8214 ListRemoveInside Shapes, inside which the results will be deleted.
8215 Each shape from theRemoveInside must belong to theShapes also.
8216 RemoveWebs If TRUE, perform Glue 3D algorithm.
8217 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8220 New GEOM.GEOM_Object, containing the result shapes.
8222 # Example: see GEOM_TestAll.py
8223 if Limit == self.ShapeType["AUTO"]:
8224 # automatic detection of the most appropriate shape limit type
8226 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8227 Limit = EnumToLong(lim)
8229 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8230 ListKeepInside, ListRemoveInside,
8231 Limit, RemoveWebs, ListMaterials,
8232 KeepNonlimitShapes);
8233 RaiseIfFailed("MakePartition", self.BoolOp)
8234 self._autoPublish(anObj, theName, "partition")
8237 ## Perform partition operation.
8238 # This method may be useful if it is needed to make a partition for
8239 # compound contains nonintersected shapes. Performance will be better
8240 # since intersection between shapes from compound is not performed.
8242 # Description of all parameters as in previous method MakePartition().
8243 # One additional parameter is provided:
8244 # @param checkSelfInte The flag that tells if the arguments should
8245 # be checked for self-intersection prior to the operation.
8247 # @note This algorithm doesn't find all types of self-intersections.
8248 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8249 # vertex/face and edge/face intersections. Face/face
8250 # intersections detection is switched off as it is a
8251 # time-consuming operation that gives an impact on performance.
8252 # To find all self-intersections please use
8253 # CheckSelfIntersections() method.
8255 # @note Passed compounds (via ListShapes or via ListTools)
8256 # have to consist of nonintersecting shapes.
8258 # @return New GEOM.GEOM_Object, containing the result shapes.
8260 # @ref swig_todo "Example"
8261 @ManageTransactions("BoolOp")
8262 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8263 ListKeepInside=[], ListRemoveInside=[],
8264 Limit=ShapeType["AUTO"], RemoveWebs=0,
8265 ListMaterials=[], KeepNonlimitShapes=0,
8266 checkSelfInte=False, theName=None):
8268 Perform partition operation.
8269 This method may be useful if it is needed to make a partition for
8270 compound contains nonintersected shapes. Performance will be better
8271 since intersection between shapes from compound is not performed.
8274 Description of all parameters as in method geompy.MakePartition.
8275 One additional parameter is provided:
8276 checkSelfInte The flag that tells if the arguments should
8277 be checked for self-intersection prior to
8281 This algorithm doesn't find all types of self-intersections.
8282 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8283 vertex/face and edge/face intersections. Face/face
8284 intersections detection is switched off as it is a
8285 time-consuming operation that gives an impact on performance.
8286 To find all self-intersections please use
8287 CheckSelfIntersections() method.
8290 Passed compounds (via ListShapes or via ListTools)
8291 have to consist of nonintersecting shapes.
8294 New GEOM.GEOM_Object, containing the result shapes.
8296 if Limit == self.ShapeType["AUTO"]:
8297 # automatic detection of the most appropriate shape limit type
8299 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8300 Limit = EnumToLong(lim)
8302 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8303 ListKeepInside, ListRemoveInside,
8304 Limit, RemoveWebs, ListMaterials,
8305 KeepNonlimitShapes, checkSelfInte);
8306 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8307 self._autoPublish(anObj, theName, "partition")
8310 ## See method MakePartition() for more information.
8312 # @ref tui_partition "Example 1"
8313 # \n @ref swig_Partition "Example 2"
8314 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8315 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8316 KeepNonlimitShapes=0, theName=None):
8318 See method geompy.MakePartition for more information.
8320 # Example: see GEOM_TestOthers.py
8321 # note: auto-publishing is done in self.MakePartition()
8322 anObj = self.MakePartition(ListShapes, ListTools,
8323 ListKeepInside, ListRemoveInside,
8324 Limit, RemoveWebs, ListMaterials,
8325 KeepNonlimitShapes, theName);
8328 ## Perform partition of the Shape with the Plane
8329 # @param theShape Shape to be intersected.
8330 # @param thePlane Tool shape, to intersect theShape.
8331 # @param theName Object name; when specified, this parameter is used
8332 # for result publication in the study. Otherwise, if automatic
8333 # publication is switched on, default value is used for result name.
8335 # @return New GEOM.GEOM_Object, containing the result shape.
8337 # @note This operation is a shortcut to the more general @ref MakePartition
8338 # operation, where @a theShape specifies single "object" (shape being partitioned)
8339 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8340 # @ref MakePartition operation have default values:
8341 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8342 # - @a KeepNonlimitShapes: 0
8343 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8344 # @a Materials (obsolete parameters): empty
8346 # @note I.e. the following two operations are equivalent:
8348 # Result = geompy.MakeHalfPartition(Object, Plane)
8349 # Result = geompy.MakePartition([Object], [Plane])
8352 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8354 # @ref tui_partition "Example"
8355 @ManageTransactions("BoolOp")
8356 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8358 Perform partition of the Shape with the Plane
8361 theShape Shape to be intersected.
8362 thePlane Tool shape, to intersect theShape.
8363 theName Object name; when specified, this parameter is used
8364 for result publication in the study. Otherwise, if automatic
8365 publication is switched on, default value is used for result name.
8368 New GEOM.GEOM_Object, containing the result shape.
8370 Note: This operation is a shortcut to the more general MakePartition
8371 operation, where theShape specifies single "object" (shape being partitioned)
8372 and thePlane specifies single "tool" (intersector shape). Other parameters of
8373 MakePartition operation have default values:
8374 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8375 - KeepNonlimitShapes: 0
8376 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8378 I.e. the following two operations are equivalent:
8379 Result = geompy.MakeHalfPartition(Object, Plane)
8380 Result = geompy.MakePartition([Object], [Plane])
8382 # Example: see GEOM_TestAll.py
8383 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8384 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8385 self._autoPublish(anObj, theName, "partition")
8388 # end of l3_basic_op
8391 ## @addtogroup l3_transform
8394 ## Translate the given object along the vector, specified
8395 # by its end points.
8396 # @param theObject The object to be translated.
8397 # @param thePoint1 Start point of translation vector.
8398 # @param thePoint2 End point of translation vector.
8399 # @param theCopy Flag used to translate object itself or create a copy.
8400 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8401 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8402 @ManageTransactions("TrsfOp")
8403 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8405 Translate the given object along the vector, specified by its end points.
8408 theObject The object to be translated.
8409 thePoint1 Start point of translation vector.
8410 thePoint2 End point of translation vector.
8411 theCopy Flag used to translate object itself or create a copy.
8414 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8415 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8418 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8420 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8421 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8424 ## Translate the given object along the vector, specified
8425 # by its end points, creating its copy before the translation.
8426 # @param theObject The object to be translated.
8427 # @param thePoint1 Start point of translation vector.
8428 # @param thePoint2 End point of translation vector.
8429 # @param theName Object name; when specified, this parameter is used
8430 # for result publication in the study. Otherwise, if automatic
8431 # publication is switched on, default value is used for result name.
8433 # @return New GEOM.GEOM_Object, containing the translated object.
8435 # @ref tui_translation "Example 1"
8436 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8437 @ManageTransactions("TrsfOp")
8438 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8440 Translate the given object along the vector, specified
8441 by its end points, creating its copy before the translation.
8444 theObject The object to be translated.
8445 thePoint1 Start point of translation vector.
8446 thePoint2 End point of translation vector.
8447 theName Object name; when specified, this parameter is used
8448 for result publication in the study. Otherwise, if automatic
8449 publication is switched on, default value is used for result name.
8452 New GEOM.GEOM_Object, containing the translated object.
8454 # Example: see GEOM_TestAll.py
8455 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8456 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8457 self._autoPublish(anObj, theName, "translated")
8460 ## Translate the given object along the vector, specified by its components.
8461 # @param theObject The object to be translated.
8462 # @param theDX,theDY,theDZ Components of translation vector.
8463 # @param theCopy Flag used to translate object itself or create a copy.
8464 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8465 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8467 # @ref tui_translation "Example"
8468 @ManageTransactions("TrsfOp")
8469 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8471 Translate the given object along the vector, specified by its components.
8474 theObject The object to be translated.
8475 theDX,theDY,theDZ Components of translation vector.
8476 theCopy Flag used to translate object itself or create a copy.
8479 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8480 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8482 # Example: see GEOM_TestAll.py
8483 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8485 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8487 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8488 anObj.SetParameters(Parameters)
8489 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8492 ## Translate the given object along the vector, specified
8493 # by its components, creating its copy before the translation.
8494 # @param theObject The object to be translated.
8495 # @param theDX,theDY,theDZ Components of translation vector.
8496 # @param theName Object name; when specified, this parameter is used
8497 # for result publication in the study. Otherwise, if automatic
8498 # publication is switched on, default value is used for result name.
8500 # @return New GEOM.GEOM_Object, containing the translated object.
8502 # @ref tui_translation "Example"
8503 @ManageTransactions("TrsfOp")
8504 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8506 Translate the given object along the vector, specified
8507 by its components, creating its copy before the translation.
8510 theObject The object to be translated.
8511 theDX,theDY,theDZ Components of translation vector.
8512 theName Object name; when specified, this parameter is used
8513 for result publication in the study. Otherwise, if automatic
8514 publication is switched on, default value is used for result name.
8517 New GEOM.GEOM_Object, containing the translated object.
8519 # Example: see GEOM_TestAll.py
8520 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8521 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8522 anObj.SetParameters(Parameters)
8523 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8524 self._autoPublish(anObj, theName, "translated")
8527 ## Translate the given object along the given vector.
8528 # @param theObject The object to be translated.
8529 # @param theVector The translation vector.
8530 # @param theCopy Flag used to translate object itself or create a copy.
8531 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8532 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8533 @ManageTransactions("TrsfOp")
8534 def TranslateVector(self, theObject, theVector, theCopy=False):
8536 Translate the given object along the given vector.
8539 theObject The object to be translated.
8540 theVector The translation vector.
8541 theCopy Flag used to translate object itself or create a copy.
8544 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8545 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8548 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8550 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8551 RaiseIfFailed("TranslateVector", self.TrsfOp)
8554 ## Translate the given object along the given vector,
8555 # creating its copy before the translation.
8556 # @param theObject The object to be translated.
8557 # @param theVector The translation vector.
8558 # @param theName Object name; when specified, this parameter is used
8559 # for result publication in the study. Otherwise, if automatic
8560 # publication is switched on, default value is used for result name.
8562 # @return New GEOM.GEOM_Object, containing the translated object.
8564 # @ref tui_translation "Example"
8565 @ManageTransactions("TrsfOp")
8566 def MakeTranslationVector(self, theObject, theVector, theName=None):
8568 Translate the given object along the given vector,
8569 creating its copy before the translation.
8572 theObject The object to be translated.
8573 theVector The translation vector.
8574 theName Object name; when specified, this parameter is used
8575 for result publication in the study. Otherwise, if automatic
8576 publication is switched on, default value is used for result name.
8579 New GEOM.GEOM_Object, containing the translated object.
8581 # Example: see GEOM_TestAll.py
8582 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8583 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8584 self._autoPublish(anObj, theName, "translated")
8587 ## Translate the given object along the given vector on given distance.
8588 # @param theObject The object to be translated.
8589 # @param theVector The translation vector.
8590 # @param theDistance The translation distance.
8591 # @param theCopy Flag used to translate object itself or create a copy.
8592 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8593 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8595 # @ref tui_translation "Example"
8596 @ManageTransactions("TrsfOp")
8597 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8599 Translate the given object along the given vector on given distance.
8602 theObject The object to be translated.
8603 theVector The translation vector.
8604 theDistance The translation distance.
8605 theCopy Flag used to translate object itself or create a copy.
8608 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8609 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8611 # Example: see GEOM_TestAll.py
8612 theDistance,Parameters = ParseParameters(theDistance)
8613 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8614 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8615 anObj.SetParameters(Parameters)
8618 ## Translate the given object along the given vector on given distance,
8619 # creating its copy before the translation.
8620 # @param theObject The object to be translated.
8621 # @param theVector The translation vector.
8622 # @param theDistance The translation distance.
8623 # @param theName Object name; when specified, this parameter is used
8624 # for result publication in the study. Otherwise, if automatic
8625 # publication is switched on, default value is used for result name.
8627 # @return New GEOM.GEOM_Object, containing the translated object.
8629 # @ref tui_translation "Example"
8630 @ManageTransactions("TrsfOp")
8631 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8633 Translate the given object along the given vector on given distance,
8634 creating its copy before the translation.
8637 theObject The object to be translated.
8638 theVector The translation vector.
8639 theDistance The translation distance.
8640 theName Object name; when specified, this parameter is used
8641 for result publication in the study. Otherwise, if automatic
8642 publication is switched on, default value is used for result name.
8645 New GEOM.GEOM_Object, containing the translated object.
8647 # Example: see GEOM_TestAll.py
8648 theDistance,Parameters = ParseParameters(theDistance)
8649 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8650 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8651 anObj.SetParameters(Parameters)
8652 self._autoPublish(anObj, theName, "translated")
8655 ## Rotate the given object around the given axis on the given angle.
8656 # @param theObject The object to be rotated.
8657 # @param theAxis Rotation axis.
8658 # @param theAngle Rotation angle in radians.
8659 # @param theCopy Flag used to rotate object itself or create a copy.
8661 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8662 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8664 # @ref tui_rotation "Example"
8665 @ManageTransactions("TrsfOp")
8666 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8668 Rotate the given object around the given axis on the given angle.
8671 theObject The object to be rotated.
8672 theAxis Rotation axis.
8673 theAngle Rotation angle in radians.
8674 theCopy Flag used to rotate object itself or create a copy.
8677 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8678 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8680 # Example: see GEOM_TestAll.py
8682 if isinstance(theAngle,str):
8684 theAngle, Parameters = ParseParameters(theAngle)
8686 theAngle = theAngle*math.pi/180.0
8688 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8690 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8691 RaiseIfFailed("Rotate", self.TrsfOp)
8692 anObj.SetParameters(Parameters)
8695 ## Rotate the given object around the given axis
8696 # on the given angle, creating its copy before the rotation.
8697 # @param theObject The object to be rotated.
8698 # @param theAxis Rotation axis.
8699 # @param theAngle Rotation angle in radians.
8700 # @param theName Object name; when specified, this parameter is used
8701 # for result publication in the study. Otherwise, if automatic
8702 # publication is switched on, default value is used for result name.
8704 # @return New GEOM.GEOM_Object, containing the rotated object.
8706 # @ref tui_rotation "Example"
8707 @ManageTransactions("TrsfOp")
8708 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8710 Rotate the given object around the given axis
8711 on the given angle, creating its copy before the rotatation.
8714 theObject The object to be rotated.
8715 theAxis Rotation axis.
8716 theAngle Rotation angle in radians.
8717 theName Object name; when specified, this parameter is used
8718 for result publication in the study. Otherwise, if automatic
8719 publication is switched on, default value is used for result name.
8722 New GEOM.GEOM_Object, containing the rotated object.
8724 # Example: see GEOM_TestAll.py
8726 if isinstance(theAngle,str):
8728 theAngle, Parameters = ParseParameters(theAngle)
8730 theAngle = theAngle*math.pi/180.0
8731 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8732 RaiseIfFailed("RotateCopy", self.TrsfOp)
8733 anObj.SetParameters(Parameters)
8734 self._autoPublish(anObj, theName, "rotated")
8737 ## Rotate given object around vector perpendicular to plane
8738 # containing three points.
8739 # @param theObject The object to be rotated.
8740 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8741 # containing the three points.
8742 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8743 # @param theCopy Flag used to rotate object itself or create a copy.
8744 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8745 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8746 @ManageTransactions("TrsfOp")
8747 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8749 Rotate given object around vector perpendicular to plane
8750 containing three points.
8753 theObject The object to be rotated.
8754 theCentPoint central point the axis is the vector perpendicular to the plane
8755 containing the three points.
8756 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8757 theCopy Flag used to rotate object itself or create a copy.
8760 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8761 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8764 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8766 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8767 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8770 ## Rotate given object around vector perpendicular to plane
8771 # containing three points, creating its copy before the rotatation.
8772 # @param theObject The object to be rotated.
8773 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8774 # containing the three points.
8775 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8776 # @param theName Object name; when specified, this parameter is used
8777 # for result publication in the study. Otherwise, if automatic
8778 # publication is switched on, default value is used for result name.
8780 # @return New GEOM.GEOM_Object, containing the rotated object.
8782 # @ref tui_rotation "Example"
8783 @ManageTransactions("TrsfOp")
8784 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8786 Rotate given object around vector perpendicular to plane
8787 containing three points, creating its copy before the rotatation.
8790 theObject The object to be rotated.
8791 theCentPoint central point the axis is the vector perpendicular to the plane
8792 containing the three points.
8793 thePoint1,thePoint2 in a perpendicular plane of the axis.
8794 theName Object name; when specified, this parameter is used
8795 for result publication in the study. Otherwise, if automatic
8796 publication is switched on, default value is used for result name.
8799 New GEOM.GEOM_Object, containing the rotated object.
8801 # Example: see GEOM_TestAll.py
8802 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8803 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8804 self._autoPublish(anObj, theName, "rotated")
8807 ## Scale the given object by the specified factor.
8808 # @param theObject The object to be scaled.
8809 # @param thePoint Center point for scaling.
8810 # Passing None for it means scaling relatively the origin of global CS.
8811 # @param theFactor Scaling factor value.
8812 # @param theCopy Flag used to scale object itself or create a copy.
8813 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8814 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8815 @ManageTransactions("TrsfOp")
8816 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8818 Scale the given object by the specified factor.
8821 theObject The object to be scaled.
8822 thePoint Center point for scaling.
8823 Passing None for it means scaling relatively the origin of global CS.
8824 theFactor Scaling factor value.
8825 theCopy Flag used to scale object itself or create a copy.
8828 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8829 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8831 # Example: see GEOM_TestAll.py
8832 theFactor, Parameters = ParseParameters(theFactor)
8834 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8836 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8837 RaiseIfFailed("Scale", self.TrsfOp)
8838 anObj.SetParameters(Parameters)
8841 ## Scale the given object by the factor, creating its copy before the scaling.
8842 # @param theObject The object to be scaled.
8843 # @param thePoint Center point for scaling.
8844 # Passing None for it means scaling relatively the origin of global CS.
8845 # @param theFactor Scaling factor value.
8846 # @param theName Object name; when specified, this parameter is used
8847 # for result publication in the study. Otherwise, if automatic
8848 # publication is switched on, default value is used for result name.
8850 # @return New GEOM.GEOM_Object, containing the scaled shape.
8852 # @ref tui_scale "Example"
8853 @ManageTransactions("TrsfOp")
8854 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8856 Scale the given object by the factor, creating its copy before the scaling.
8859 theObject The object to be scaled.
8860 thePoint Center point for scaling.
8861 Passing None for it means scaling relatively the origin of global CS.
8862 theFactor Scaling factor value.
8863 theName Object name; when specified, this parameter is used
8864 for result publication in the study. Otherwise, if automatic
8865 publication is switched on, default value is used for result name.
8868 New GEOM.GEOM_Object, containing the scaled shape.
8870 # Example: see GEOM_TestAll.py
8871 theFactor, Parameters = ParseParameters(theFactor)
8872 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8873 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8874 anObj.SetParameters(Parameters)
8875 self._autoPublish(anObj, theName, "scaled")
8878 ## Scale the given object by different factors along coordinate axes.
8879 # @param theObject The object to be scaled.
8880 # @param thePoint Center point for scaling.
8881 # Passing None for it means scaling relatively the origin of global CS.
8882 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8883 # @param theCopy Flag used to scale object itself or create a copy.
8884 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8885 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8886 @ManageTransactions("TrsfOp")
8887 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8889 Scale the given object by different factors along coordinate axes.
8892 theObject The object to be scaled.
8893 thePoint Center point for scaling.
8894 Passing None for it means scaling relatively the origin of global CS.
8895 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8896 theCopy Flag used to scale object itself or create a copy.
8899 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8900 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8902 # Example: see GEOM_TestAll.py
8903 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8905 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8906 theFactorX, theFactorY, theFactorZ)
8908 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8909 theFactorX, theFactorY, theFactorZ)
8910 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8911 anObj.SetParameters(Parameters)
8914 ## Scale the given object by different factors along coordinate axes,
8915 # creating its copy before the scaling.
8916 # @param theObject The object to be scaled.
8917 # @param thePoint Center point for scaling.
8918 # Passing None for it means scaling relatively the origin of global CS.
8919 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8920 # @param theName Object name; when specified, this parameter is used
8921 # for result publication in the study. Otherwise, if automatic
8922 # publication is switched on, default value is used for result name.
8924 # @return New GEOM.GEOM_Object, containing the scaled shape.
8926 # @ref swig_scale "Example"
8927 @ManageTransactions("TrsfOp")
8928 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8930 Scale the given object by different factors along coordinate axes,
8931 creating its copy before the scaling.
8934 theObject The object to be scaled.
8935 thePoint Center point for scaling.
8936 Passing None for it means scaling relatively the origin of global CS.
8937 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8938 theName Object name; when specified, this parameter is used
8939 for result publication in the study. Otherwise, if automatic
8940 publication is switched on, default value is used for result name.
8943 New GEOM.GEOM_Object, containing the scaled shape.
8945 # Example: see GEOM_TestAll.py
8946 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8947 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8948 theFactorX, theFactorY, theFactorZ)
8949 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8950 anObj.SetParameters(Parameters)
8951 self._autoPublish(anObj, theName, "scaled")
8954 ## Mirror an object relatively the given plane.
8955 # @param theObject The object to be mirrored.
8956 # @param thePlane Plane of symmetry.
8957 # @param theCopy Flag used to mirror object itself or create a copy.
8958 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8959 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8960 @ManageTransactions("TrsfOp")
8961 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8963 Mirror an object relatively the given plane.
8966 theObject The object to be mirrored.
8967 thePlane Plane of symmetry.
8968 theCopy Flag used to mirror object itself or create a copy.
8971 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8972 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8975 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8977 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8978 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8981 ## Create an object, symmetrical
8982 # to the given one relatively the given plane.
8983 # @param theObject The object to be mirrored.
8984 # @param thePlane Plane of symmetry.
8985 # @param theName Object name; when specified, this parameter is used
8986 # for result publication in the study. Otherwise, if automatic
8987 # publication is switched on, default value is used for result name.
8989 # @return New GEOM.GEOM_Object, containing the mirrored shape.
8991 # @ref tui_mirror "Example"
8992 @ManageTransactions("TrsfOp")
8993 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
8995 Create an object, symmetrical to the given one relatively the given plane.
8998 theObject The object to be mirrored.
8999 thePlane Plane of symmetry.
9000 theName Object name; when specified, this parameter is used
9001 for result publication in the study. Otherwise, if automatic
9002 publication is switched on, default value is used for result name.
9005 New GEOM.GEOM_Object, containing the mirrored shape.
9007 # Example: see GEOM_TestAll.py
9008 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9009 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9010 self._autoPublish(anObj, theName, "mirrored")
9013 ## Mirror an object relatively the given axis.
9014 # @param theObject The object to be mirrored.
9015 # @param theAxis Axis of symmetry.
9016 # @param theCopy Flag used to mirror object itself or create a copy.
9017 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9018 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9019 @ManageTransactions("TrsfOp")
9020 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9022 Mirror an object relatively the given axis.
9025 theObject The object to be mirrored.
9026 theAxis Axis of symmetry.
9027 theCopy Flag used to mirror object itself or create a copy.
9030 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9031 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9034 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9036 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9037 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9040 ## Create an object, symmetrical
9041 # to the given one relatively the given axis.
9042 # @param theObject The object to be mirrored.
9043 # @param theAxis Axis of symmetry.
9044 # @param theName Object name; when specified, this parameter is used
9045 # for result publication in the study. Otherwise, if automatic
9046 # publication is switched on, default value is used for result name.
9048 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9050 # @ref tui_mirror "Example"
9051 @ManageTransactions("TrsfOp")
9052 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9054 Create an object, symmetrical to the given one relatively the given axis.
9057 theObject The object to be mirrored.
9058 theAxis Axis of symmetry.
9059 theName Object name; when specified, this parameter is used
9060 for result publication in the study. Otherwise, if automatic
9061 publication is switched on, default value is used for result name.
9064 New GEOM.GEOM_Object, containing the mirrored shape.
9066 # Example: see GEOM_TestAll.py
9067 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9068 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9069 self._autoPublish(anObj, theName, "mirrored")
9072 ## Mirror an object relatively the given point.
9073 # @param theObject The object to be mirrored.
9074 # @param thePoint Point of symmetry.
9075 # @param theCopy Flag used to mirror object itself or create a copy.
9076 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9077 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9078 @ManageTransactions("TrsfOp")
9079 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9081 Mirror an object relatively the given point.
9084 theObject The object to be mirrored.
9085 thePoint Point of symmetry.
9086 theCopy Flag used to mirror object itself or create a copy.
9089 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9090 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9092 # Example: see GEOM_TestAll.py
9094 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9096 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9097 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9100 ## Create an object, symmetrical
9101 # to the given one relatively the given point.
9102 # @param theObject The object to be mirrored.
9103 # @param thePoint Point of symmetry.
9104 # @param theName Object name; when specified, this parameter is used
9105 # for result publication in the study. Otherwise, if automatic
9106 # publication is switched on, default value is used for result name.
9108 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9110 # @ref tui_mirror "Example"
9111 @ManageTransactions("TrsfOp")
9112 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9114 Create an object, symmetrical
9115 to the given one relatively the given point.
9118 theObject The object to be mirrored.
9119 thePoint Point of symmetry.
9120 theName Object name; when specified, this parameter is used
9121 for result publication in the study. Otherwise, if automatic
9122 publication is switched on, default value is used for result name.
9125 New GEOM.GEOM_Object, containing the mirrored shape.
9127 # Example: see GEOM_TestAll.py
9128 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9129 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9130 self._autoPublish(anObj, theName, "mirrored")
9133 ## Modify the location of the given object.
9134 # @param theObject The object to be displaced.
9135 # @param theStartLCS Coordinate system to perform displacement from it.\n
9136 # If \a theStartLCS is NULL, displacement
9137 # will be performed from global CS.\n
9138 # If \a theObject itself is used as \a theStartLCS,
9139 # its location will be changed to \a theEndLCS.
9140 # @param theEndLCS Coordinate system to perform displacement to it.
9141 # @param theCopy Flag used to displace object itself or create a copy.
9142 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9143 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9144 @ManageTransactions("TrsfOp")
9145 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9147 Modify the Location of the given object by LCS, creating its copy before the setting.
9150 theObject The object to be displaced.
9151 theStartLCS Coordinate system to perform displacement from it.
9152 If theStartLCS is NULL, displacement
9153 will be performed from global CS.
9154 If theObject itself is used as theStartLCS,
9155 its location will be changed to theEndLCS.
9156 theEndLCS Coordinate system to perform displacement to it.
9157 theCopy Flag used to displace object itself or create a copy.
9160 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9161 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9163 # Example: see GEOM_TestAll.py
9165 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9167 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9168 RaiseIfFailed("Displace", self.TrsfOp)
9171 ## Modify the Location of the given object by LCS,
9172 # creating its copy before the setting.
9173 # @param theObject The object to be displaced.
9174 # @param theStartLCS Coordinate system to perform displacement from it.\n
9175 # If \a theStartLCS is NULL, displacement
9176 # will be performed from global CS.\n
9177 # If \a theObject itself is used as \a theStartLCS,
9178 # its location will be changed to \a theEndLCS.
9179 # @param theEndLCS Coordinate system to perform displacement to it.
9180 # @param theName Object name; when specified, this parameter is used
9181 # for result publication in the study. Otherwise, if automatic
9182 # publication is switched on, default value is used for result name.
9184 # @return New GEOM.GEOM_Object, containing the displaced shape.
9186 # @ref tui_modify_location "Example"
9187 @ManageTransactions("TrsfOp")
9188 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9190 Modify the Location of the given object by LCS, creating its copy before the setting.
9193 theObject The object to be displaced.
9194 theStartLCS Coordinate system to perform displacement from it.
9195 If theStartLCS is NULL, displacement
9196 will be performed from global CS.
9197 If theObject itself is used as theStartLCS,
9198 its location will be changed to theEndLCS.
9199 theEndLCS Coordinate system to perform displacement to it.
9200 theName Object name; when specified, this parameter is used
9201 for result publication in the study. Otherwise, if automatic
9202 publication is switched on, default value is used for result name.
9205 New GEOM.GEOM_Object, containing the displaced shape.
9208 # create local coordinate systems
9209 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9210 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9211 # modify the location of the given object
9212 position = geompy.MakePosition(cylinder, cs1, cs2)
9214 # Example: see GEOM_TestAll.py
9215 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9216 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9217 self._autoPublish(anObj, theName, "displaced")
9220 ## Modify the Location of the given object by Path.
9221 # @param theObject The object to be displaced.
9222 # @param thePath Wire or Edge along that the object will be translated.
9223 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9224 # @param theCopy is to create a copy objects if true.
9225 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9226 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9227 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9229 # @ref tui_modify_location "Example"
9230 @ManageTransactions("TrsfOp")
9231 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9233 Modify the Location of the given object by Path.
9236 theObject The object to be displaced.
9237 thePath Wire or Edge along that the object will be translated.
9238 theDistance progress of Path (0 = start location, 1 = end of path location).
9239 theCopy is to create a copy objects if true.
9240 theReverse 0 - for usual direction, 1 - to reverse path direction.
9243 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9244 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9247 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9249 # Example: see GEOM_TestAll.py
9250 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9251 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9254 ## Modify the Location of the given object by Path, creating its copy before the operation.
9255 # @param theObject The object to be displaced.
9256 # @param thePath Wire or Edge along that the object will be translated.
9257 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9258 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9259 # @param 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.
9263 # @return New GEOM.GEOM_Object, containing the displaced shape.
9264 @ManageTransactions("TrsfOp")
9265 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9267 Modify the Location of the given object by Path, creating its copy before the operation.
9270 theObject The object to be displaced.
9271 thePath Wire or Edge along that the object will be translated.
9272 theDistance progress of Path (0 = start location, 1 = end of path location).
9273 theReverse 0 - for usual direction, 1 - to reverse path direction.
9274 theName Object name; when specified, this parameter is used
9275 for result publication in the study. Otherwise, if automatic
9276 publication is switched on, default value is used for result name.
9279 New GEOM.GEOM_Object, containing the displaced shape.
9281 # Example: see GEOM_TestAll.py
9282 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9283 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9284 self._autoPublish(anObj, theName, "displaced")
9287 ## Offset given shape.
9288 # @param theObject The base object for the offset.
9289 # @param theOffset Offset value.
9290 # @param theCopy Flag used to offset object itself or create a copy.
9291 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9292 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9293 @ManageTransactions("TrsfOp")
9294 def Offset(self, theObject, theOffset, theCopy=False):
9299 theObject The base object for the offset.
9300 theOffset Offset value.
9301 theCopy Flag used to offset object itself or create a copy.
9304 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9305 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9307 theOffset, Parameters = ParseParameters(theOffset)
9309 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9311 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9312 RaiseIfFailed("Offset", self.TrsfOp)
9313 anObj.SetParameters(Parameters)
9316 ## Create new object as offset of the given one. Gap between two adjacent
9317 # offset surfaces is filled by a pipe.
9318 # @param theObject The base object for the offset.
9319 # @param theOffset Offset value.
9320 # @param theName Object name; when specified, this parameter is used
9321 # for result publication in the study. Otherwise, if automatic
9322 # publication is switched on, default value is used for result name.
9324 # @return New GEOM.GEOM_Object, containing the offset object.
9326 # @sa MakeOffsetIntersectionJoin
9327 # @ref tui_offset "Example"
9328 @ManageTransactions("TrsfOp")
9329 def MakeOffset(self, theObject, theOffset, theName=None):
9331 Create new object as offset of the given one. Gap between adjacent
9332 offset surfaces is filled by a pipe.
9335 theObject The base object for the offset.
9336 theOffset Offset value.
9337 theName Object name; when specified, this parameter is used
9338 for result publication in the study. Otherwise, if automatic
9339 publication is switched on, default value is used for result name.
9342 New GEOM.GEOM_Object, containing the offset object.
9345 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9346 # create a new object as offset of the given object
9347 offset = geompy.MakeOffset(box, 70.)
9349 # Example: see GEOM_TestAll.py
9350 theOffset, Parameters = ParseParameters(theOffset)
9351 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9352 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9353 anObj.SetParameters(Parameters)
9354 self._autoPublish(anObj, theName, "offset")
9357 ## Create new object as offset of the given one. Gap between adjacent
9358 # offset surfaces is filled by extending and intersecting them.
9359 # @param theObject The base object for the offset.
9360 # @param theOffset Offset value.
9361 # @param theName Object name; when specified, this parameter is used
9362 # for result publication in the study. Otherwise, if automatic
9363 # publication is switched on, default value is used for result name.
9365 # @return New GEOM.GEOM_Object, containing the offset object.
9368 # @ref tui_offset "Example"
9369 @ManageTransactions("TrsfOp")
9370 def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9372 Create new object as offset of the given one. Gap between adjacent
9373 offset surfaces is filled by extending and intersecting them.
9376 theObject The base object for the offset.
9377 theOffset Offset value.
9378 theName Object name; when specified, this parameter is used
9379 for result publication in the study. Otherwise, if automatic
9380 publication is switched on, default value is used for result name.
9383 New GEOM.GEOM_Object, containing the offset object.
9386 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9387 # create a new box extended by 70
9388 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9390 # Example: see GEOM_TestAll.py
9391 theOffset, Parameters = ParseParameters( theOffset )
9392 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9393 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9394 anObj.SetParameters(Parameters)
9395 self._autoPublish(anObj, theName, "offset")
9398 ## Create new object as projection of the given one on another.
9399 # @param theSource The source object for the projection. It can be a point, edge or wire.
9400 # Edge and wire are acceptable if @a theTarget is a face.
9401 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9402 # @param theName Object name; when specified, this parameter is used
9403 # for result publication in the study. Otherwise, if automatic
9404 # publication is switched on, default value is used for result name.
9406 # @return New GEOM.GEOM_Object, containing the projection.
9408 # @ref tui_projection "Example"
9409 @ManageTransactions("TrsfOp")
9410 def MakeProjection(self, theSource, theTarget, theName=None):
9412 Create new object as projection of the given one on another.
9415 theSource The source object for the projection. It can be a point, edge or wire.
9416 Edge and wire are acceptable if theTarget is a face.
9417 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9418 theName Object name; when specified, this parameter is used
9419 for result publication in the study. Otherwise, if automatic
9420 publication is switched on, default value is used for result name.
9423 New GEOM.GEOM_Object, containing the projection.
9425 # Example: see GEOM_TestAll.py
9426 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9427 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9428 self._autoPublish(anObj, theName, "projection")
9431 ## Create a projection of the given point on a wire or an edge.
9432 # If there are no solutions or there are 2 or more solutions It throws an
9434 # @param thePoint the point to be projected.
9435 # @param theWire the wire. The edge is accepted as well.
9436 # @param theName Object name; when specified, this parameter is used
9437 # for result publication in the study. Otherwise, if automatic
9438 # publication is switched on, default value is used for result name.
9440 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9441 # \n \a u: The parameter of projection point on edge.
9442 # \n \a PointOnEdge: The projection point.
9443 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9445 # @ref tui_projection "Example"
9446 @ManageTransactions("TrsfOp")
9447 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9449 Create a projection of the given point on a wire or an edge.
9450 If there are no solutions or there are 2 or more solutions It throws an
9454 thePoint the point to be projected.
9455 theWire the wire. The edge is accepted as well.
9456 theName Object name; when specified, this parameter is used
9457 for result publication in the study. Otherwise, if automatic
9458 publication is switched on, default value is used for result name.
9461 [u, PointOnEdge, EdgeInWireIndex]
9462 u: The parameter of projection point on edge.
9463 PointOnEdge: The projection point.
9464 EdgeInWireIndex: The index of an edge in a wire.
9466 # Example: see GEOM_TestAll.py
9467 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9468 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9469 self._autoPublish(anObj[1], theName, "projection")
9472 # -----------------------------------------------------------------------------
9474 # -----------------------------------------------------------------------------
9476 ## Translate the given object along the given vector a given number times
9477 # @param theObject The object to be translated.
9478 # @param theVector Direction of the translation. DX if None.
9479 # @param theStep Distance to translate on.
9480 # @param theNbTimes Quantity of translations to be done.
9481 # @param theName Object name; when specified, this parameter is used
9482 # for result publication in the study. Otherwise, if automatic
9483 # publication is switched on, default value is used for result name.
9485 # @return New GEOM.GEOM_Object, containing compound of all
9486 # the shapes, obtained after each translation.
9488 # @ref tui_multi_translation "Example"
9489 @ManageTransactions("TrsfOp")
9490 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9492 Translate the given object along the given vector a given number times
9495 theObject The object to be translated.
9496 theVector Direction of the translation. DX if None.
9497 theStep Distance to translate on.
9498 theNbTimes Quantity of translations to be done.
9499 theName Object name; when specified, this parameter is used
9500 for result publication in the study. Otherwise, if automatic
9501 publication is switched on, default value is used for result name.
9504 New GEOM.GEOM_Object, containing compound of all
9505 the shapes, obtained after each translation.
9508 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9510 # Example: see GEOM_TestAll.py
9511 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9512 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9513 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9514 anObj.SetParameters(Parameters)
9515 self._autoPublish(anObj, theName, "multitranslation")
9518 ## Conseqently apply two specified translations to theObject specified number of times.
9519 # @param theObject The object to be translated.
9520 # @param theVector1 Direction of the first translation. DX if None.
9521 # @param theStep1 Step of the first translation.
9522 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9523 # @param theVector2 Direction of the second translation. DY if None.
9524 # @param theStep2 Step of the second translation.
9525 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9526 # @param theName Object name; when specified, this parameter is used
9527 # for result publication in the study. Otherwise, if automatic
9528 # publication is switched on, default value is used for result name.
9530 # @return New GEOM.GEOM_Object, containing compound of all
9531 # the shapes, obtained after each translation.
9533 # @ref tui_multi_translation "Example"
9534 @ManageTransactions("TrsfOp")
9535 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9536 theVector2, theStep2, theNbTimes2, theName=None):
9538 Conseqently apply two specified translations to theObject specified number of times.
9541 theObject The object to be translated.
9542 theVector1 Direction of the first translation. DX if None.
9543 theStep1 Step of the first translation.
9544 theNbTimes1 Quantity of translations to be done along theVector1.
9545 theVector2 Direction of the second translation. DY if None.
9546 theStep2 Step of the second translation.
9547 theNbTimes2 Quantity of translations to be done along theVector2.
9548 theName Object name; when specified, this parameter is used
9549 for result publication in the study. Otherwise, if automatic
9550 publication is switched on, default value is used for result name.
9553 New GEOM.GEOM_Object, containing compound of all
9554 the shapes, obtained after each translation.
9557 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9559 # Example: see GEOM_TestAll.py
9560 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9561 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9562 theVector2, theStep2, theNbTimes2)
9563 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9564 anObj.SetParameters(Parameters)
9565 self._autoPublish(anObj, theName, "multitranslation")
9568 ## Rotate the given object around the given axis a given number times.
9569 # Rotation angle will be 2*PI/theNbTimes.
9570 # @param theObject The object to be rotated.
9571 # @param theAxis The rotation axis. DZ if None.
9572 # @param theNbTimes Quantity of rotations to be done.
9573 # @param theName Object name; when specified, this parameter is used
9574 # for result publication in the study. Otherwise, if automatic
9575 # publication is switched on, default value is used for result name.
9577 # @return New GEOM.GEOM_Object, containing compound of all the
9578 # shapes, obtained after each rotation.
9580 # @ref tui_multi_rotation "Example"
9581 @ManageTransactions("TrsfOp")
9582 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9584 Rotate the given object around the given axis a given number times.
9585 Rotation angle will be 2*PI/theNbTimes.
9588 theObject The object to be rotated.
9589 theAxis The rotation axis. DZ if None.
9590 theNbTimes Quantity of rotations to be done.
9591 theName Object name; when specified, this parameter is used
9592 for result publication in the study. Otherwise, if automatic
9593 publication is switched on, default value is used for result name.
9596 New GEOM.GEOM_Object, containing compound of all the
9597 shapes, obtained after each rotation.
9600 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9602 # Example: see GEOM_TestAll.py
9603 theNbTimes, Parameters = ParseParameters(theNbTimes)
9604 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9605 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9606 anObj.SetParameters(Parameters)
9607 self._autoPublish(anObj, theName, "multirotation")
9610 ## Rotate the given object around the given axis
9611 # a given number times on the given angle.
9612 # @param theObject The object to be rotated.
9613 # @param theAxis The rotation axis. DZ if None.
9614 # @param theAngleStep Rotation angle in radians.
9615 # @param theNbTimes Quantity of rotations to be done.
9616 # @param theName Object name; when specified, this parameter is used
9617 # for result publication in the study. Otherwise, if automatic
9618 # publication is switched on, default value is used for result name.
9620 # @return New GEOM.GEOM_Object, containing compound of all the
9621 # shapes, obtained after each rotation.
9623 # @ref tui_multi_rotation "Example"
9624 @ManageTransactions("TrsfOp")
9625 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9627 Rotate the given object around the given axis
9628 a given number times on the given angle.
9631 theObject The object to be rotated.
9632 theAxis The rotation axis. DZ if None.
9633 theAngleStep Rotation angle in radians.
9634 theNbTimes Quantity of rotations to be done.
9635 theName Object name; when specified, this parameter is used
9636 for result publication in the study. Otherwise, if automatic
9637 publication is switched on, default value is used for result name.
9640 New GEOM.GEOM_Object, containing compound of all the
9641 shapes, obtained after each rotation.
9644 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9646 # Example: see GEOM_TestAll.py
9647 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9648 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9649 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9650 anObj.SetParameters(Parameters)
9651 self._autoPublish(anObj, theName, "multirotation")
9654 ## Rotate the given object around the given axis a given
9655 # number times and multi-translate each rotation result.
9656 # Rotation angle will be 2*PI/theNbTimes1.
9657 # Translation direction passes through center of gravity
9658 # of rotated shape and its projection on the rotation axis.
9659 # @param theObject The object to be rotated.
9660 # @param theAxis Rotation axis. DZ if None.
9661 # @param theNbTimes1 Quantity of rotations to be done.
9662 # @param theRadialStep Translation distance.
9663 # @param theNbTimes2 Quantity of translations to be done.
9664 # @param theName Object name; when specified, this parameter is used
9665 # for result publication in the study. Otherwise, if automatic
9666 # publication is switched on, default value is used for result name.
9668 # @return New GEOM.GEOM_Object, containing compound of all the
9669 # shapes, obtained after each transformation.
9671 # @ref tui_multi_rotation "Example"
9672 @ManageTransactions("TrsfOp")
9673 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9675 Rotate the given object around the
9676 given axis on the given angle a given number
9677 times and multi-translate each rotation result.
9678 Translation direction passes through center of gravity
9679 of rotated shape and its projection on the rotation axis.
9682 theObject The object to be rotated.
9683 theAxis Rotation axis. DZ if None.
9684 theNbTimes1 Quantity of rotations to be done.
9685 theRadialStep Translation distance.
9686 theNbTimes2 Quantity of translations to be done.
9687 theName Object name; when specified, this parameter is used
9688 for result publication in the study. Otherwise, if automatic
9689 publication is switched on, default value is used for result name.
9692 New GEOM.GEOM_Object, containing compound of all the
9693 shapes, obtained after each transformation.
9696 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9698 # Example: see GEOM_TestAll.py
9699 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9700 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9701 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9702 anObj.SetParameters(Parameters)
9703 self._autoPublish(anObj, theName, "multirotation")
9706 ## Rotate the given object around the
9707 # given axis on the given angle a given number
9708 # times and multi-translate each rotation result.
9709 # Translation direction passes through center of gravity
9710 # of rotated shape and its projection on the rotation axis.
9711 # @param theObject The object to be rotated.
9712 # @param theAxis Rotation axis. DZ if None.
9713 # @param theAngleStep Rotation angle in radians.
9714 # @param theNbTimes1 Quantity of rotations to be done.
9715 # @param theRadialStep Translation distance.
9716 # @param theNbTimes2 Quantity of translations to be done.
9717 # @param theName Object name; when specified, this parameter is used
9718 # for result publication in the study. Otherwise, if automatic
9719 # publication is switched on, default value is used for result name.
9721 # @return New GEOM.GEOM_Object, containing compound of all the
9722 # shapes, obtained after each transformation.
9724 # @ref tui_multi_rotation "Example"
9725 @ManageTransactions("TrsfOp")
9726 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9728 Rotate the given object around the
9729 given axis on the given angle a given number
9730 times and multi-translate each rotation result.
9731 Translation direction passes through center of gravity
9732 of rotated shape and its projection on the rotation axis.
9735 theObject The object to be rotated.
9736 theAxis Rotation axis. DZ if None.
9737 theAngleStep Rotation angle in radians.
9738 theNbTimes1 Quantity of rotations to be done.
9739 theRadialStep Translation distance.
9740 theNbTimes2 Quantity of translations to be done.
9741 theName Object name; when specified, this parameter is used
9742 for result publication in the study. Otherwise, if automatic
9743 publication is switched on, default value is used for result name.
9746 New GEOM.GEOM_Object, containing compound of all the
9747 shapes, obtained after each transformation.
9750 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9752 # Example: see GEOM_TestAll.py
9753 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9754 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9755 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9756 anObj.SetParameters(Parameters)
9757 self._autoPublish(anObj, theName, "multirotation")
9760 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9762 # @ref swig_MakeMultiRotation "Example"
9763 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9765 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9768 pz = geompy.MakeVertex(0, 0, 100)
9769 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9770 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9772 # Example: see GEOM_TestOthers.py
9773 aVec = self.MakeLine(aPoint,aDir)
9774 # note: auto-publishing is done in self.MultiRotate1D()
9775 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9778 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9780 # @ref swig_MakeMultiRotation "Example"
9781 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9783 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9786 pz = geompy.MakeVertex(0, 0, 100)
9787 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9788 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9790 # Example: see GEOM_TestOthers.py
9791 aVec = self.MakeLine(aPoint,aDir)
9792 # note: auto-publishing is done in self.MultiRotate1D()
9793 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9796 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9798 # @ref swig_MakeMultiRotation "Example"
9799 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9801 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9804 pz = geompy.MakeVertex(0, 0, 100)
9805 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9806 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9808 # Example: see GEOM_TestOthers.py
9809 aVec = self.MakeLine(aPoint,aDir)
9810 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9811 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9814 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9816 # @ref swig_MakeMultiRotation "Example"
9817 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9819 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9822 pz = geompy.MakeVertex(0, 0, 100)
9823 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9824 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9826 # Example: see GEOM_TestOthers.py
9827 aVec = self.MakeLine(aPoint,aDir)
9828 # note: auto-publishing is done in self.MultiRotate2D()
9829 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9833 # Compute a wire or a face that represents a projection of the source
9834 # shape onto cylinder. The cylinder's coordinate system is the same
9835 # as the global coordinate system.
9837 # @param theObject The object to be projected. It can be either
9838 # a planar wire or a face.
9839 # @param theRadius The radius of the cylinder.
9840 # @param theStartAngle The starting angle in radians from
9841 # the cylinder's X axis around Z axis. The angle from which
9842 # the projection is started.
9843 # @param theAngleLength The projection length angle in radians.
9844 # The angle in which to project the total length of the wire.
9845 # If it is negative the projection is not scaled and natural
9846 # wire length is kept for the projection.
9847 # @param theAngleRotation The desired angle in radians between
9848 # the tangent vector to the first curve at the first point of
9849 # the theObject's projection in 2D space and U-direction of
9850 # cylinder's 2D space.
9851 # @param theName Object name; when specified, this parameter is used
9852 # for result publication in the study. Otherwise, if automatic
9853 # publication is switched on, default value is used for result name.
9855 # @return New GEOM.GEOM_Object, containing the result shape. The result
9856 # represents a wire or a face that represents a projection of
9857 # the source shape onto a cylinder.
9859 # @ref tui_projection "Example"
9860 def MakeProjectionOnCylinder (self, theObject, theRadius,
9861 theStartAngle=0.0, theAngleLength=-1.0,
9862 theAngleRotation=0.0,
9865 Compute a wire or a face that represents a projection of the source
9866 shape onto cylinder. The cylinder's coordinate system is the same
9867 as the global coordinate system.
9870 theObject The object to be projected. It can be either
9871 a planar wire or a face.
9872 theRadius The radius of the cylinder.
9873 theStartAngle The starting angle in radians from the cylinder's X axis
9874 around Z axis. The angle from which the projection is started.
9875 theAngleLength The projection length angle in radians. The angle in which
9876 to project the total length of the wire. If it is negative the
9877 projection is not scaled and natural wire length is kept for
9879 theAngleRotation The desired angle in radians between
9880 the tangent vector to the first curve at the first
9881 point of the theObject's projection in 2D space and
9882 U-direction of cylinder's 2D space.
9883 theName Object name; when specified, this parameter is used
9884 for result publication in the study. Otherwise, if automatic
9885 publication is switched on, default value is used for result name.
9888 New GEOM.GEOM_Object, containing the result shape. The result
9889 represents a wire or a face that represents a projection of
9890 the source shape onto a cylinder.
9892 # Example: see GEOM_TestAll.py
9893 flagStartAngle = False
9894 if isinstance(theStartAngle,str):
9895 flagStartAngle = True
9896 flagAngleLength = False
9897 if isinstance(theAngleLength,str):
9898 flagAngleLength = True
9899 flagAngleRotation = False
9900 if isinstance(theAngleRotation,str):
9901 flagAngleRotation = True
9902 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9903 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9905 theStartAngle = theStartAngle*math.pi/180.
9907 theAngleLength = theAngleLength*math.pi/180.
9908 if flagAngleRotation:
9909 theAngleRotation = theAngleRotation*math.pi/180.
9910 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9911 theStartAngle, theAngleLength, theAngleRotation)
9912 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9913 anObj.SetParameters(Parameters)
9914 self._autoPublish(anObj, theName, "projection")
9917 # end of l3_transform
9920 ## @addtogroup l3_transform_d
9923 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9924 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9926 Deprecated method. Use MultiRotate1DNbTimes instead.
9928 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9929 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9931 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9932 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9933 @ManageTransactions("TrsfOp")
9934 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9936 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9937 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9940 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9942 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9943 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9944 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9945 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9946 anObj.SetParameters(Parameters)
9947 self._autoPublish(anObj, theName, "multirotation")
9950 ## The same, as MultiRotate1D(), but axis is given by direction and point
9951 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9952 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9954 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9955 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9958 pz = geompy.MakeVertex(0, 0, 100)
9959 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9960 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9962 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9963 aVec = self.MakeLine(aPoint,aDir)
9964 # note: auto-publishing is done in self.MultiRotate1D()
9965 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9968 ## The same, as MultiRotate2D(), but axis is given by direction and point
9969 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9970 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9972 The same, as MultiRotate2D(), but axis is given by direction and point
9973 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9976 pz = geompy.MakeVertex(0, 0, 100)
9977 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9978 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9980 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
9981 aVec = self.MakeLine(aPoint,aDir)
9982 # note: auto-publishing is done in self.MultiRotate2D()
9983 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9986 # end of l3_transform_d
9989 ## @addtogroup l3_local
9992 ## Perform a fillet on all edges of the given shape.
9993 # @param theShape Shape, to perform fillet on.
9994 # @param theR Fillet radius.
9995 # @param theName Object name; when specified, this parameter is used
9996 # for result publication in the study. Otherwise, if automatic
9997 # publication is switched on, default value is used for result name.
9999 # @return New GEOM.GEOM_Object, containing the result shape.
10001 # @ref tui_fillet "Example 1"
10002 # \n @ref swig_MakeFilletAll "Example 2"
10003 @ManageTransactions("LocalOp")
10004 def MakeFilletAll(self, theShape, theR, theName=None):
10006 Perform a fillet on all edges of the given shape.
10009 theShape Shape, to perform fillet on.
10010 theR Fillet radius.
10011 theName Object name; when specified, this parameter is used
10012 for result publication in the study. Otherwise, if automatic
10013 publication is switched on, default value is used for result name.
10016 New GEOM.GEOM_Object, containing the result shape.
10019 filletall = geompy.MakeFilletAll(prism, 10.)
10021 # Example: see GEOM_TestOthers.py
10022 theR,Parameters = ParseParameters(theR)
10023 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10024 RaiseIfFailed("MakeFilletAll", self.LocalOp)
10025 anObj.SetParameters(Parameters)
10026 self._autoPublish(anObj, theName, "fillet")
10029 ## Perform a fillet on the specified edges/faces of the given shape
10030 # @param theShape Shape, to perform fillet on.
10031 # @param theR Fillet radius.
10032 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10033 # @param theListShapes Global indices of edges/faces to perform fillet on.
10034 # @param theName Object name; when specified, this parameter is used
10035 # for result publication in the study. Otherwise, if automatic
10036 # publication is switched on, default value is used for result name.
10038 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10040 # @return New GEOM.GEOM_Object, containing the result shape.
10042 # @ref tui_fillet "Example"
10043 @ManageTransactions("LocalOp")
10044 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10046 Perform a fillet on the specified edges/faces of the given shape
10049 theShape Shape, to perform fillet on.
10050 theR Fillet radius.
10051 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10052 theListShapes Global indices of edges/faces to perform fillet on.
10053 theName Object name; when specified, this parameter is used
10054 for result publication in the study. Otherwise, if automatic
10055 publication is switched on, default value is used for result name.
10058 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10061 New GEOM.GEOM_Object, containing the result shape.
10064 # get the list of IDs (IDList) for the fillet
10065 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10067 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10068 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10069 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10070 # make a fillet on the specified edges of the given shape
10071 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10073 # Example: see GEOM_TestAll.py
10074 theR,Parameters = ParseParameters(theR)
10076 if theShapeType == self.ShapeType["EDGE"]:
10077 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10078 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10080 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10081 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10082 anObj.SetParameters(Parameters)
10083 self._autoPublish(anObj, theName, "fillet")
10086 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10087 @ManageTransactions("LocalOp")
10088 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10090 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10093 # get the list of IDs (IDList) for the fillet
10094 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10096 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10097 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10098 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10099 # make a fillet on the specified edges of the given shape
10100 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10102 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10104 if theShapeType == self.ShapeType["EDGE"]:
10105 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10106 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10108 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10109 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10110 anObj.SetParameters(Parameters)
10111 self._autoPublish(anObj, theName, "fillet")
10114 ## Perform a fillet on the specified edges of the given shape
10115 # @param theShape Wire Shape to perform fillet on.
10116 # @param theR Fillet radius.
10117 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10118 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10119 # \note The list of vertices could be empty,
10120 # in this case fillet will done done at all vertices in wire
10121 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10122 # by the length of the edges, nearest to the fillet vertex.
10123 # But sometimes the next edge is C1 continuous with the one, nearest to
10124 # the fillet point, and such two (or more) edges can be united to allow
10125 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10126 # thus ignoring the secant vertex (vertices).
10127 # @param theName Object name; when specified, this parameter is used
10128 # for result publication in the study. Otherwise, if automatic
10129 # publication is switched on, default value is used for result name.
10131 # @return New GEOM.GEOM_Object, containing the result shape.
10133 # @ref tui_fillet2d "Example"
10134 @ManageTransactions("LocalOp")
10135 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10137 Perform a fillet on the specified edges of the given shape
10140 theShape Wire Shape to perform fillet on.
10141 theR Fillet radius.
10142 theListOfVertexes Global indices of vertexes to perform fillet on.
10143 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10144 by the length of the edges, nearest to the fillet vertex.
10145 But sometimes the next edge is C1 continuous with the one, nearest to
10146 the fillet point, and such two (or more) edges can be united to allow
10147 bigger radius. Set this flag to TRUE to allow collinear edges union,
10148 thus ignoring the secant vertex (vertices).
10149 theName Object name; when specified, this parameter is used
10150 for result publication in the study. Otherwise, if automatic
10151 publication is switched on, default value is used for result name.
10153 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10155 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10158 New GEOM.GEOM_Object, containing the result shape.
10162 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10163 # make fillet at given wire vertices with giver radius
10164 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10166 # Example: see GEOM_TestAll.py
10167 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10168 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10169 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10170 anObj.SetParameters(Parameters)
10171 self._autoPublish(anObj, theName, "fillet")
10174 ## Perform a fillet at the specified vertices of the given face/shell.
10175 # @param theShape Face or Shell shape to perform fillet on.
10176 # @param theR Fillet radius.
10177 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10178 # @param theName Object name; when specified, this parameter is used
10179 # for result publication in the study. Otherwise, if automatic
10180 # publication is switched on, default value is used for result name.
10182 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10184 # @return New GEOM.GEOM_Object, containing the result shape.
10186 # @ref tui_fillet2d "Example"
10187 @ManageTransactions("LocalOp")
10188 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10190 Perform a fillet at the specified vertices of the given face/shell.
10193 theShape Face or Shell shape to perform fillet on.
10194 theR Fillet radius.
10195 theListOfVertexes Global indices of vertexes to perform fillet on.
10196 theName Object name; when specified, this parameter is used
10197 for result publication in the study. Otherwise, if automatic
10198 publication is switched on, default value is used for result name.
10200 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10203 New GEOM.GEOM_Object, containing the result shape.
10206 face = geompy.MakeFaceHW(100, 100, 1)
10207 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10209 # Example: see GEOM_TestAll.py
10210 theR,Parameters = ParseParameters(theR)
10211 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10212 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10213 anObj.SetParameters(Parameters)
10214 self._autoPublish(anObj, theName, "fillet")
10217 ## Perform a symmetric chamfer on all edges of the given shape.
10218 # @param theShape Shape, to perform chamfer on.
10219 # @param theD Chamfer size along each face.
10220 # @param theName Object name; when specified, this parameter is used
10221 # for result publication in the study. Otherwise, if automatic
10222 # publication is switched on, default value is used for result name.
10224 # @return New GEOM.GEOM_Object, containing the result shape.
10226 # @ref tui_chamfer "Example 1"
10227 # \n @ref swig_MakeChamferAll "Example 2"
10228 @ManageTransactions("LocalOp")
10229 def MakeChamferAll(self, theShape, theD, theName=None):
10231 Perform a symmetric chamfer on all edges of the given shape.
10234 theShape Shape, to perform chamfer on.
10235 theD Chamfer size along each face.
10236 theName Object name; when specified, this parameter is used
10237 for result publication in the study. Otherwise, if automatic
10238 publication is switched on, default value is used for result name.
10241 New GEOM.GEOM_Object, containing the result shape.
10244 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10246 # Example: see GEOM_TestOthers.py
10247 theD,Parameters = ParseParameters(theD)
10248 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10249 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10250 anObj.SetParameters(Parameters)
10251 self._autoPublish(anObj, theName, "chamfer")
10254 ## Perform a chamfer on edges, common to the specified faces,
10255 # with distance D1 on the Face1
10256 # @param theShape Shape, to perform chamfer on.
10257 # @param theD1 Chamfer size along \a theFace1.
10258 # @param theD2 Chamfer size along \a theFace2.
10259 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10260 # @param theName Object name; when specified, this parameter is used
10261 # for result publication in the study. Otherwise, if automatic
10262 # publication is switched on, default value is used for result name.
10264 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10266 # @return New GEOM.GEOM_Object, containing the result shape.
10268 # @ref tui_chamfer "Example"
10269 @ManageTransactions("LocalOp")
10270 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10272 Perform a chamfer on edges, common to the specified faces,
10273 with distance D1 on the Face1
10276 theShape Shape, to perform chamfer on.
10277 theD1 Chamfer size along theFace1.
10278 theD2 Chamfer size along theFace2.
10279 theFace1,theFace2 Global indices of two faces of theShape.
10280 theName Object name; when specified, this parameter is used
10281 for result publication in the study. Otherwise, if automatic
10282 publication is switched on, default value is used for result name.
10285 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10288 New GEOM.GEOM_Object, containing the result shape.
10291 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10292 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10293 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10294 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10296 # Example: see GEOM_TestAll.py
10297 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10298 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10299 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10300 anObj.SetParameters(Parameters)
10301 self._autoPublish(anObj, theName, "chamfer")
10304 ## Perform a chamfer on edges
10305 # @param theShape Shape, to perform chamfer on.
10306 # @param theD Chamfer length
10307 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10308 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10309 # @param theName Object name; when specified, this parameter is used
10310 # for result publication in the study. Otherwise, if automatic
10311 # publication is switched on, default value is used for result name.
10313 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10315 # @return New GEOM.GEOM_Object, containing the result shape.
10316 @ManageTransactions("LocalOp")
10317 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10319 Perform a chamfer on edges
10322 theShape Shape, to perform chamfer on.
10323 theD1 Chamfer size along theFace1.
10324 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10325 theFace1,theFace2 Global indices of two faces of theShape.
10326 theName Object name; when specified, this parameter is used
10327 for result publication in the study. Otherwise, if automatic
10328 publication is switched on, default value is used for result name.
10331 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10334 New GEOM.GEOM_Object, containing the result shape.
10337 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10338 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10339 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10341 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10344 if isinstance(theAngle,str):
10346 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10348 theAngle = theAngle*math.pi/180.0
10349 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10350 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10351 anObj.SetParameters(Parameters)
10352 self._autoPublish(anObj, theName, "chamfer")
10355 ## Perform a chamfer on all edges of the specified faces,
10356 # with distance D1 on the first specified face (if several for one edge)
10357 # @param theShape Shape, to perform chamfer on.
10358 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10359 # connected to the edge, are in \a theFaces, \a theD1
10360 # will be get along face, which is nearer to \a theFaces beginning.
10361 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10362 # @param theFaces Sequence of global indices of faces of \a theShape.
10363 # @param theName Object name; when specified, this parameter is used
10364 # for result publication in the study. Otherwise, if automatic
10365 # publication is switched on, default value is used for result name.
10367 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10369 # @return New GEOM.GEOM_Object, containing the result shape.
10371 # @ref tui_chamfer "Example"
10372 @ManageTransactions("LocalOp")
10373 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10375 Perform a chamfer on all edges of the specified faces,
10376 with distance D1 on the first specified face (if several for one edge)
10379 theShape Shape, to perform chamfer on.
10380 theD1 Chamfer size along face from theFaces. If both faces,
10381 connected to the edge, are in theFaces, theD1
10382 will be get along face, which is nearer to theFaces beginning.
10383 theD2 Chamfer size along another of two faces, connected to the edge.
10384 theFaces Sequence of global indices of faces of theShape.
10385 theName Object name; when specified, this parameter is used
10386 for result publication in the study. Otherwise, if automatic
10387 publication is switched on, default value is used for result name.
10389 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10392 New GEOM.GEOM_Object, containing the result shape.
10394 # Example: see GEOM_TestAll.py
10395 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10396 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10397 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10398 anObj.SetParameters(Parameters)
10399 self._autoPublish(anObj, theName, "chamfer")
10402 ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10403 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10405 # @ref swig_FilletChamfer "Example"
10406 @ManageTransactions("LocalOp")
10407 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10409 The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10410 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10413 if isinstance(theAngle,str):
10415 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10417 theAngle = theAngle*math.pi/180.0
10418 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10419 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10420 anObj.SetParameters(Parameters)
10421 self._autoPublish(anObj, theName, "chamfer")
10424 ## Perform a chamfer on edges,
10425 # with distance D1 on the first specified face (if several for one edge)
10426 # @param theShape Shape, to perform chamfer on.
10427 # @param theD1,theD2 Chamfer size
10428 # @param theEdges Sequence of edges of \a theShape.
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 the result shape.
10435 # @ref swig_FilletChamfer "Example"
10436 @ManageTransactions("LocalOp")
10437 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10439 Perform a chamfer on edges,
10440 with distance D1 on the first specified face (if several for one edge)
10443 theShape Shape, to perform chamfer on.
10444 theD1,theD2 Chamfer size
10445 theEdges Sequence of edges of theShape.
10446 theName Object name; when specified, this parameter is used
10447 for result publication in the study. Otherwise, if automatic
10448 publication is switched on, default value is used for result name.
10451 New GEOM.GEOM_Object, containing the result shape.
10453 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10454 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10455 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10456 anObj.SetParameters(Parameters)
10457 self._autoPublish(anObj, theName, "chamfer")
10460 ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10461 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10462 @ManageTransactions("LocalOp")
10463 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10465 The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10466 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10469 if isinstance(theAngle,str):
10471 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10473 theAngle = theAngle*math.pi/180.0
10474 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10475 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10476 anObj.SetParameters(Parameters)
10477 self._autoPublish(anObj, theName, "chamfer")
10480 ## @sa MakeChamferEdge(), MakeChamferFaces()
10482 # @ref swig_MakeChamfer "Example"
10483 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10485 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10487 # Example: see GEOM_TestOthers.py
10489 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10490 if aShapeType == self.ShapeType["EDGE"]:
10491 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10493 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10496 ## Remove material from a solid by extrusion of the base shape on the given distance.
10497 # @param theInit Shape to remove material from. It must be a solid or
10498 # a compound made of a single solid.
10499 # @param theBase Closed edge or wire defining the base shape to be extruded.
10500 # @param theH Prism dimension along the normal to theBase
10501 # @param theAngle Draft angle in degrees.
10502 # @param theInvert If true material changes the direction
10503 # @param theName Object name; when specified, this parameter is used
10504 # for result publication in the study. Otherwise, if automatic
10505 # publication is switched on, default value is used for result name.
10507 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10509 # @ref tui_creation_prism "Example"
10510 @ManageTransactions("PrimOp")
10511 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10513 Add material to a solid by extrusion of the base shape on the given distance.
10516 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10517 theBase Closed edge or wire defining the base shape to be extruded.
10518 theH Prism dimension along the normal to theBase
10519 theAngle Draft angle in degrees.
10520 theInvert If true material changes the direction.
10521 theName Object name; when specified, this parameter is used
10522 for result publication in the study. Otherwise, if automatic
10523 publication is switched on, default value is used for result name.
10526 New GEOM.GEOM_Object, containing the initial shape with removed material.
10528 # Example: see GEOM_TestAll.py
10529 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10530 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10531 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10532 anObj.SetParameters(Parameters)
10533 self._autoPublish(anObj, theName, "extrudedCut")
10536 ## Add material to a solid by extrusion of the base shape on the given distance.
10537 # @param theInit Shape to add material to. It must be a solid or
10538 # a compound made of a single solid.
10539 # @param theBase Closed edge or wire defining the base shape to be extruded.
10540 # @param theH Prism dimension along the normal to theBase
10541 # @param theAngle Draft angle in degrees.
10542 # @param theInvert If true material changes the direction
10543 # @param theName Object name; when specified, this parameter is used
10544 # for result publication in the study. Otherwise, if automatic
10545 # publication is switched on, default value is used for result name.
10547 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10549 # @ref tui_creation_prism "Example"
10550 @ManageTransactions("PrimOp")
10551 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10553 Add material to a solid by extrusion of the base shape on the given distance.
10556 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10557 theBase Closed edge or wire defining the base shape to be extruded.
10558 theH Prism dimension along the normal to theBase
10559 theAngle Draft angle in degrees.
10560 theInvert If true material changes the direction.
10561 theName Object name; when specified, this parameter is used
10562 for result publication in the study. Otherwise, if automatic
10563 publication is switched on, default value is used for result name.
10566 New GEOM.GEOM_Object, containing the initial shape with added material.
10568 # Example: see GEOM_TestAll.py
10569 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10570 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10571 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10572 anObj.SetParameters(Parameters)
10573 self._autoPublish(anObj, theName, "extrudedBoss")
10579 ## @addtogroup l3_basic_op
10582 ## Perform an Archimde operation on the given shape with given parameters.
10583 # The object presenting the resulting face is returned.
10584 # @param theShape Shape to be put in water.
10585 # @param theWeight Weight of the shape.
10586 # @param theWaterDensity Density of the water.
10587 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10588 # @param theName Object name; when specified, this parameter is used
10589 # for result publication in the study. Otherwise, if automatic
10590 # publication is switched on, default value is used for result name.
10592 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10593 # by a plane, corresponding to water level.
10595 # @ref tui_archimede "Example"
10596 @ManageTransactions("LocalOp")
10597 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10599 Perform an Archimde operation on the given shape with given parameters.
10600 The object presenting the resulting face is returned.
10603 theShape Shape to be put in water.
10604 theWeight Weight of the shape.
10605 theWaterDensity Density of the water.
10606 theMeshDeflection Deflection of the mesh, using to compute the section.
10607 theName Object name; when specified, this parameter is used
10608 for result publication in the study. Otherwise, if automatic
10609 publication is switched on, default value is used for result name.
10612 New GEOM.GEOM_Object, containing a section of theShape
10613 by a plane, corresponding to water level.
10615 # Example: see GEOM_TestAll.py
10616 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10617 theWeight,theWaterDensity,theMeshDeflection)
10618 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10619 RaiseIfFailed("MakeArchimede", self.LocalOp)
10620 anObj.SetParameters(Parameters)
10621 self._autoPublish(anObj, theName, "archimede")
10624 # end of l3_basic_op
10627 ## @addtogroup l2_measure
10630 ## Get point coordinates
10631 # @return [x, y, z]
10633 # @ref tui_point_coordinates_page "Example"
10634 @ManageTransactions("MeasuOp")
10635 def PointCoordinates(self,Point):
10637 Get point coordinates
10642 # Example: see GEOM_TestMeasures.py
10643 aTuple = self.MeasuOp.PointCoordinates(Point)
10644 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10647 ## Get vector coordinates
10648 # @return [x, y, z]
10650 # @ref tui_measurement_tools_page "Example"
10651 def VectorCoordinates(self,Vector):
10653 Get vector coordinates
10659 p1=self.GetFirstVertex(Vector)
10660 p2=self.GetLastVertex(Vector)
10662 X1=self.PointCoordinates(p1)
10663 X2=self.PointCoordinates(p2)
10665 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10668 ## Compute cross product
10669 # @return vector w=u^v
10671 # @ref tui_measurement_tools_page "Example"
10672 def CrossProduct(self, Vector1, Vector2):
10674 Compute cross product
10676 Returns: vector w=u^v
10678 u=self.VectorCoordinates(Vector1)
10679 v=self.VectorCoordinates(Vector2)
10680 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])
10684 ## Compute cross product
10685 # @return dot product p=u.v
10687 # @ref tui_measurement_tools_page "Example"
10688 def DotProduct(self, Vector1, Vector2):
10690 Compute cross product
10692 Returns: dot product p=u.v
10694 u=self.VectorCoordinates(Vector1)
10695 v=self.VectorCoordinates(Vector2)
10696 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10701 ## Get summarized length of all wires,
10702 # area of surface and volume of the given shape.
10703 # @param theShape Shape to define properties of.
10704 # @param theTolerance maximal relative error of area
10705 # and volume computation.
10706 # @return [theLength, theSurfArea, theVolume]\n
10707 # theLength: Summarized length of all wires of the given shape.\n
10708 # theSurfArea: Area of surface of the given shape.\n
10709 # theVolume: Volume of the given shape.
10711 # @ref tui_basic_properties_page "Example"
10712 @ManageTransactions("MeasuOp")
10713 def BasicProperties(self,theShape, theTolerance=1.e-6):
10715 Get summarized length of all wires,
10716 area of surface and volume of the given shape.
10719 theShape Shape to define properties of.
10720 theTolerance maximal relative error of area
10721 and volume computation.
10724 [theLength, theSurfArea, theVolume]
10725 theLength: Summarized length of all wires of the given shape.
10726 theSurfArea: Area of surface of the given shape.
10727 theVolume: Volume of the given shape.
10729 # Example: see GEOM_TestMeasures.py
10730 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10731 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10734 ## Get parameters of bounding box of the given shape
10735 # @param theShape Shape to obtain bounding box of.
10736 # @param precise TRUE for precise computation; FALSE for fast one.
10737 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10738 # Xmin,Xmax: Limits of shape along OX axis.
10739 # Ymin,Ymax: Limits of shape along OY axis.
10740 # Zmin,Zmax: Limits of shape along OZ axis.
10742 # @ref tui_bounding_box_page "Example"
10743 @ManageTransactions("MeasuOp")
10744 def BoundingBox (self, theShape, precise=False):
10746 Get parameters of bounding box of the given shape
10749 theShape Shape to obtain bounding box of.
10750 precise TRUE for precise computation; FALSE for fast one.
10753 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10754 Xmin,Xmax: Limits of shape along OX axis.
10755 Ymin,Ymax: Limits of shape along OY axis.
10756 Zmin,Zmax: Limits of shape along OZ axis.
10758 # Example: see GEOM_TestMeasures.py
10759 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10760 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10763 ## Get bounding box of the given shape
10764 # @param theShape Shape to obtain bounding box of.
10765 # @param precise TRUE for precise computation; FALSE for fast one.
10766 # @param theName Object name; when specified, this parameter is used
10767 # for result publication in the study. Otherwise, if automatic
10768 # publication is switched on, default value is used for result name.
10770 # @return New GEOM.GEOM_Object, containing the created box.
10772 # @ref tui_bounding_box_page "Example"
10773 @ManageTransactions("MeasuOp")
10774 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10776 Get bounding box of the given shape
10779 theShape Shape to obtain bounding box of.
10780 precise TRUE for precise computation; FALSE for fast one.
10781 theName Object name; when specified, this parameter is used
10782 for result publication in the study. Otherwise, if automatic
10783 publication is switched on, default value is used for result name.
10786 New GEOM.GEOM_Object, containing the created box.
10788 # Example: see GEOM_TestMeasures.py
10789 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10790 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10791 self._autoPublish(anObj, theName, "bndbox")
10794 ## Get inertia matrix and moments of inertia of theShape.
10795 # @param theShape Shape to calculate inertia of.
10796 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10797 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10798 # Ix,Iy,Iz: Moments of inertia of the given shape.
10800 # @ref tui_inertia_page "Example"
10801 @ManageTransactions("MeasuOp")
10802 def Inertia(self,theShape):
10804 Get inertia matrix and moments of inertia of theShape.
10807 theShape Shape to calculate inertia of.
10810 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10811 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10812 Ix,Iy,Iz: Moments of inertia of the given shape.
10814 # Example: see GEOM_TestMeasures.py
10815 aTuple = self.MeasuOp.GetInertia(theShape)
10816 RaiseIfFailed("GetInertia", self.MeasuOp)
10819 ## Get if coords are included in the shape (ST_IN or ST_ON)
10820 # @param theShape Shape
10821 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10822 # @param tolerance to be used (default is 1.0e-7)
10823 # @return list_of_boolean = [res1, res2, ...]
10824 @ManageTransactions("MeasuOp")
10825 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10827 Get if coords are included in the shape (ST_IN or ST_ON)
10831 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10832 tolerance to be used (default is 1.0e-7)
10835 list_of_boolean = [res1, res2, ...]
10837 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10839 ## Get minimal distance between the given shapes.
10840 # @param theShape1,theShape2 Shapes to find minimal distance between.
10841 # @return Value of the minimal distance between the given shapes.
10843 # @ref tui_min_distance_page "Example"
10844 @ManageTransactions("MeasuOp")
10845 def MinDistance(self, theShape1, theShape2):
10847 Get minimal distance between the given shapes.
10850 theShape1,theShape2 Shapes to find minimal distance between.
10853 Value of the minimal distance between the given shapes.
10855 # Example: see GEOM_TestMeasures.py
10856 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10857 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10860 ## Get minimal distance between the given shapes.
10861 # @param theShape1,theShape2 Shapes to find minimal distance between.
10862 # @return Value of the minimal distance between the given shapes, in form of list
10863 # [Distance, DX, DY, DZ].
10865 # @ref tui_min_distance_page "Example"
10866 @ManageTransactions("MeasuOp")
10867 def MinDistanceComponents(self, theShape1, theShape2):
10869 Get minimal distance between the given shapes.
10872 theShape1,theShape2 Shapes to find minimal distance between.
10875 Value of the minimal distance between the given shapes, in form of list
10876 [Distance, DX, DY, DZ]
10878 # Example: see GEOM_TestMeasures.py
10879 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10880 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10881 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10884 ## Get closest points of the given shapes.
10885 # @param theShape1,theShape2 Shapes to find closest points of.
10886 # @return The number of found solutions (-1 in case of infinite number of
10887 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10889 # @ref tui_min_distance_page "Example"
10890 @ManageTransactions("MeasuOp")
10891 def ClosestPoints (self, theShape1, theShape2):
10893 Get closest points of the given shapes.
10896 theShape1,theShape2 Shapes to find closest points of.
10899 The number of found solutions (-1 in case of infinite number of
10900 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10902 # Example: see GEOM_TestMeasures.py
10903 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10904 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10907 ## Get angle between the given shapes in degrees.
10908 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10909 # @note If both arguments are vectors, the angle is computed in accordance
10910 # with their orientations, otherwise the minimum angle is computed.
10911 # @return Value of the angle between the given shapes in degrees.
10913 # @ref tui_angle_page "Example"
10914 @ManageTransactions("MeasuOp")
10915 def GetAngle(self, theShape1, theShape2):
10917 Get angle between the given shapes in degrees.
10920 theShape1,theShape2 Lines or linear edges to find angle between.
10923 If both arguments are vectors, the angle is computed in accordance
10924 with their orientations, otherwise the minimum angle is computed.
10927 Value of the angle between the given shapes in degrees.
10929 # Example: see GEOM_TestMeasures.py
10930 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10931 RaiseIfFailed("GetAngle", self.MeasuOp)
10934 ## Get angle between the given shapes in radians.
10935 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10936 # @note If both arguments are vectors, the angle is computed in accordance
10937 # with their orientations, otherwise the minimum angle is computed.
10938 # @return Value of the angle between the given shapes in radians.
10940 # @ref tui_angle_page "Example"
10941 @ManageTransactions("MeasuOp")
10942 def GetAngleRadians(self, theShape1, theShape2):
10944 Get angle between the given shapes in radians.
10947 theShape1,theShape2 Lines or linear edges to find angle between.
10951 If both arguments are vectors, the angle is computed in accordance
10952 with their orientations, otherwise the minimum angle is computed.
10955 Value of the angle between the given shapes in radians.
10957 # Example: see GEOM_TestMeasures.py
10958 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10959 RaiseIfFailed("GetAngle", self.MeasuOp)
10962 ## Get angle between the given vectors in degrees.
10963 # @param theShape1,theShape2 Vectors to find angle between.
10964 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10965 # if False, the opposite vector to the normal vector is used.
10966 # @return Value of the angle between the given vectors in degrees.
10968 # @ref tui_angle_page "Example"
10969 @ManageTransactions("MeasuOp")
10970 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10972 Get angle between the given vectors in degrees.
10975 theShape1,theShape2 Vectors to find angle between.
10976 theFlag If True, the normal vector is defined by the two vectors cross,
10977 if False, the opposite vector to the normal vector is used.
10980 Value of the angle between the given vectors in degrees.
10982 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10984 anAngle = 360. - anAngle
10985 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10988 ## The same as GetAngleVectors, but the result is in radians.
10989 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10991 Get angle between the given vectors in radians.
10994 theShape1,theShape2 Vectors to find angle between.
10995 theFlag If True, the normal vector is defined by the two vectors cross,
10996 if False, the opposite vector to the normal vector is used.
10999 Value of the angle between the given vectors in radians.
11001 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11004 ## @name Curve Curvature Measurement
11005 # Methods for receiving radius of curvature of curves
11006 # in the given point
11009 ## Measure curvature of a curve at a point, set by parameter.
11010 # @param theCurve a curve.
11011 # @param theParam parameter.
11012 # @return radius of curvature of \a theCurve.
11014 # @ref swig_todo "Example"
11015 @ManageTransactions("MeasuOp")
11016 def CurveCurvatureByParam(self, theCurve, theParam):
11018 Measure curvature of a curve at a point, set by parameter.
11022 theParam parameter.
11025 radius of curvature of theCurve.
11027 # Example: see GEOM_TestMeasures.py
11028 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11029 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11032 ## Measure curvature of a curve at a point.
11033 # @param theCurve a curve.
11034 # @param thePoint given point.
11035 # @return radius of curvature of \a theCurve.
11037 # @ref swig_todo "Example"
11038 @ManageTransactions("MeasuOp")
11039 def CurveCurvatureByPoint(self, theCurve, thePoint):
11041 Measure curvature of a curve at a point.
11045 thePoint given point.
11048 radius of curvature of theCurve.
11050 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11051 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11055 ## @name Surface Curvature Measurement
11056 # Methods for receiving max and min radius of curvature of surfaces
11057 # in the given point
11060 ## Measure max radius of curvature of surface.
11061 # @param theSurf the given surface.
11062 # @param theUParam Value of U-parameter on the referenced surface.
11063 # @param theVParam Value of V-parameter on the referenced surface.
11064 # @return max radius of curvature of theSurf.
11066 ## @ref swig_todo "Example"
11067 @ManageTransactions("MeasuOp")
11068 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11070 Measure max radius of curvature of surface.
11073 theSurf the given surface.
11074 theUParam Value of U-parameter on the referenced surface.
11075 theVParam Value of V-parameter on the referenced surface.
11078 max radius of curvature of theSurf.
11080 # Example: see GEOM_TestMeasures.py
11081 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11082 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11085 ## Measure max radius of curvature of surface in the given point
11086 # @param theSurf the given surface.
11087 # @param thePoint given point.
11088 # @return max radius of curvature of theSurf.
11090 ## @ref swig_todo "Example"
11091 @ManageTransactions("MeasuOp")
11092 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11094 Measure max radius of curvature of surface in the given point.
11097 theSurf the given surface.
11098 thePoint given point.
11101 max radius of curvature of theSurf.
11103 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11104 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11107 ## Measure min radius of curvature of surface.
11108 # @param theSurf the given surface.
11109 # @param theUParam Value of U-parameter on the referenced surface.
11110 # @param theVParam Value of V-parameter on the referenced surface.
11111 # @return min radius of curvature of theSurf.
11113 ## @ref swig_todo "Example"
11114 @ManageTransactions("MeasuOp")
11115 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11117 Measure min radius of curvature of surface.
11120 theSurf the given surface.
11121 theUParam Value of U-parameter on the referenced surface.
11122 theVParam Value of V-parameter on the referenced surface.
11125 Min radius of curvature of theSurf.
11127 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11128 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11131 ## Measure min radius of curvature of surface in the given point
11132 # @param theSurf the given surface.
11133 # @param thePoint given point.
11134 # @return min radius of curvature of theSurf.
11136 ## @ref swig_todo "Example"
11137 @ManageTransactions("MeasuOp")
11138 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11140 Measure min radius of curvature of surface in the given point.
11143 theSurf the given surface.
11144 thePoint given point.
11147 Min radius of curvature of theSurf.
11149 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11150 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11154 ## Get min and max tolerances of sub-shapes of theShape
11155 # @param theShape Shape, to get tolerances of.
11156 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11157 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11158 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11159 # VertMin,VertMax: Min and max tolerances of the vertices.
11161 # @ref tui_tolerance_page "Example"
11162 @ManageTransactions("MeasuOp")
11163 def Tolerance(self,theShape):
11165 Get min and max tolerances of sub-shapes of theShape
11168 theShape Shape, to get tolerances of.
11171 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11172 FaceMin,FaceMax: Min and max tolerances of the faces.
11173 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11174 VertMin,VertMax: Min and max tolerances of the vertices.
11176 # Example: see GEOM_TestMeasures.py
11177 aTuple = self.MeasuOp.GetTolerance(theShape)
11178 RaiseIfFailed("GetTolerance", self.MeasuOp)
11181 ## Obtain description of the given shape (number of sub-shapes of each type)
11182 # @param theShape Shape to be described.
11183 # @return Description of the given shape.
11185 # @ref tui_whatis_page "Example"
11186 @ManageTransactions("MeasuOp")
11187 def WhatIs(self,theShape):
11189 Obtain description of the given shape (number of sub-shapes of each type)
11192 theShape Shape to be described.
11195 Description of the given shape.
11197 # Example: see GEOM_TestMeasures.py
11198 aDescr = self.MeasuOp.WhatIs(theShape)
11199 RaiseIfFailed("WhatIs", self.MeasuOp)
11202 ## Obtain quantity of shapes of the given type in \a theShape.
11203 # If \a theShape is of type \a theType, it is also counted.
11204 # @param theShape Shape to be described.
11205 # @param theType the given ShapeType().
11206 # @return Quantity of shapes of type \a theType in \a theShape.
11208 # @ref tui_measurement_tools_page "Example"
11209 def NbShapes (self, theShape, theType):
11211 Obtain quantity of shapes of the given type in theShape.
11212 If theShape is of type theType, it is also counted.
11215 theShape Shape to be described.
11216 theType the given geompy.ShapeType
11219 Quantity of shapes of type theType in theShape.
11221 # Example: see GEOM_TestMeasures.py
11222 listSh = self.SubShapeAllIDs(theShape, theType)
11226 ## Obtain quantity of shapes of each type in \a theShape.
11227 # The \a theShape is also counted.
11228 # @param theShape Shape to be described.
11229 # @return Dictionary of ShapeType() with bound quantities of shapes.
11231 # @ref tui_measurement_tools_page "Example"
11232 def ShapeInfo (self, theShape):
11234 Obtain quantity of shapes of each type in theShape.
11235 The theShape is also counted.
11238 theShape Shape to be described.
11241 Dictionary of geompy.ShapeType with bound quantities of shapes.
11243 # Example: see GEOM_TestMeasures.py
11245 for typeSh in self.ShapeType:
11246 if typeSh in ( "AUTO", "SHAPE" ): continue
11247 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11253 def GetCreationInformation(self, theShape):
11255 infos = theShape.GetCreationInformation()
11258 opName = info.operationName
11259 if not opName: opName = "no info available"
11260 if res: res += "\n"
11261 res += "Operation: " + opName
11263 for parVal in info.params:
11264 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11267 ## Get a point, situated at the centre of mass of theShape.
11268 # @param theShape Shape to define centre of mass of.
11269 # @param theName Object name; when specified, this parameter is used
11270 # for result publication in the study. Otherwise, if automatic
11271 # publication is switched on, default value is used for result name.
11273 # @return New GEOM.GEOM_Object, containing the created point.
11275 # @ref tui_center_of_mass_page "Example"
11276 @ManageTransactions("MeasuOp")
11277 def MakeCDG(self, theShape, theName=None):
11279 Get a point, situated at the centre of mass of theShape.
11282 theShape Shape to define centre of mass of.
11283 theName Object name; when specified, this parameter is used
11284 for result publication in the study. Otherwise, if automatic
11285 publication is switched on, default value is used for result name.
11288 New GEOM.GEOM_Object, containing the created point.
11290 # Example: see GEOM_TestMeasures.py
11291 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11292 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11293 self._autoPublish(anObj, theName, "centerOfMass")
11296 ## Get a vertex sub-shape by index depended with orientation.
11297 # @param theShape Shape to find sub-shape.
11298 # @param theIndex Index to find vertex by this index (starting from zero)
11299 # @param theName Object name; when specified, this parameter is used
11300 # for result publication in the study. Otherwise, if automatic
11301 # publication is switched on, default value is used for result name.
11303 # @return New GEOM.GEOM_Object, containing the created vertex.
11305 # @ref tui_measurement_tools_page "Example"
11306 @ManageTransactions("MeasuOp")
11307 def GetVertexByIndex(self, theShape, theIndex, theName=None):
11309 Get a vertex sub-shape by index depended with orientation.
11312 theShape Shape to find sub-shape.
11313 theIndex Index to find vertex by this index (starting from zero)
11314 theName Object name; when specified, this parameter is used
11315 for result publication in the study. Otherwise, if automatic
11316 publication is switched on, default value is used for result name.
11319 New GEOM.GEOM_Object, containing the created vertex.
11321 # Example: see GEOM_TestMeasures.py
11322 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
11323 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11324 self._autoPublish(anObj, theName, "vertex")
11327 ## Get the first vertex of wire/edge depended orientation.
11328 # @param theShape Shape to find first vertex.
11329 # @param theName Object name; when specified, this parameter is used
11330 # for result publication in the study. Otherwise, if automatic
11331 # publication is switched on, default value is used for result name.
11333 # @return New GEOM.GEOM_Object, containing the created vertex.
11335 # @ref tui_measurement_tools_page "Example"
11336 def GetFirstVertex(self, theShape, theName=None):
11338 Get the first vertex of wire/edge depended orientation.
11341 theShape Shape to find first vertex.
11342 theName Object name; when specified, this parameter is used
11343 for result publication in the study. Otherwise, if automatic
11344 publication is switched on, default value is used for result name.
11347 New GEOM.GEOM_Object, containing the created vertex.
11349 # Example: see GEOM_TestMeasures.py
11350 # note: auto-publishing is done in self.GetVertexByIndex()
11351 return self.GetVertexByIndex(theShape, 0, theName)
11353 ## Get the last vertex of wire/edge depended orientation.
11354 # @param theShape Shape to find last vertex.
11355 # @param theName Object name; when specified, this parameter is used
11356 # for result publication in the study. Otherwise, if automatic
11357 # publication is switched on, default value is used for result name.
11359 # @return New GEOM.GEOM_Object, containing the created vertex.
11361 # @ref tui_measurement_tools_page "Example"
11362 def GetLastVertex(self, theShape, theName=None):
11364 Get the last vertex of wire/edge depended orientation.
11367 theShape Shape to find last vertex.
11368 theName Object name; when specified, this parameter is used
11369 for result publication in the study. Otherwise, if automatic
11370 publication is switched on, default value is used for result name.
11373 New GEOM.GEOM_Object, containing the created vertex.
11375 # Example: see GEOM_TestMeasures.py
11376 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11377 # note: auto-publishing is done in self.GetVertexByIndex()
11378 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
11380 ## Get a normale to the given face. If the point is not given,
11381 # the normale is calculated at the center of mass.
11382 # @param theFace Face to define normale of.
11383 # @param theOptionalPoint Point to compute the normale at.
11384 # @param theName Object name; when specified, this parameter is used
11385 # for result publication in the study. Otherwise, if automatic
11386 # publication is switched on, default value is used for result name.
11388 # @return New GEOM.GEOM_Object, containing the created vector.
11390 # @ref swig_todo "Example"
11391 @ManageTransactions("MeasuOp")
11392 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11394 Get a normale to the given face. If the point is not given,
11395 the normale is calculated at the center of mass.
11398 theFace Face to define normale of.
11399 theOptionalPoint Point to compute the normale at.
11400 theName Object name; when specified, this parameter is used
11401 for result publication in the study. Otherwise, if automatic
11402 publication is switched on, default value is used for result name.
11405 New GEOM.GEOM_Object, containing the created vector.
11407 # Example: see GEOM_TestMeasures.py
11408 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11409 RaiseIfFailed("GetNormal", self.MeasuOp)
11410 self._autoPublish(anObj, theName, "normal")
11413 ## Print shape errors obtained from CheckShape.
11414 # @param theShape Shape that was checked.
11415 # @param theShapeErrors the shape errors obtained by CheckShape.
11416 # @param theReturnStatus If 0 the description of problem is printed.
11417 # If 1 the description of problem is returned.
11418 # @return If theReturnStatus is equal to 1 the description is returned.
11419 # Otherwise doesn't return anything.
11421 # @ref tui_check_shape_page "Example"
11422 @ManageTransactions("MeasuOp")
11423 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11425 Print shape errors obtained from CheckShape.
11428 theShape Shape that was checked.
11429 theShapeErrors the shape errors obtained by CheckShape.
11430 theReturnStatus If 0 the description of problem is printed.
11431 If 1 the description of problem is returned.
11434 If theReturnStatus is equal to 1 the description is returned.
11435 Otherwise doesn't return anything.
11437 # Example: see GEOM_TestMeasures.py
11438 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11439 if theReturnStatus == 1:
11444 ## Check a topology of the given shape.
11445 # @param theShape Shape to check validity of.
11446 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11447 # if TRUE, the shape's geometry will be checked also.
11448 # @param theReturnStatus If 0 and if theShape is invalid, a description
11449 # of problem is printed.
11450 # If 1 isValid flag and the description of
11451 # problem is returned.
11452 # If 2 isValid flag and the list of error data
11454 # @return TRUE, if the shape "seems to be valid".
11455 # If theShape is invalid, prints a description of problem.
11456 # If theReturnStatus is equal to 1 the description is returned
11457 # along with IsValid flag.
11458 # If theReturnStatus is equal to 2 the list of error data is
11459 # returned along with IsValid flag.
11461 # @ref tui_check_shape_page "Example"
11462 @ManageTransactions("MeasuOp")
11463 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11465 Check a topology of the given shape.
11468 theShape Shape to check validity of.
11469 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11470 if TRUE, the shape's geometry will be checked also.
11471 theReturnStatus If 0 and if theShape is invalid, a description
11472 of problem is printed.
11473 If 1 IsValid flag and the description of
11474 problem is returned.
11475 If 2 IsValid flag and the list of error data
11479 TRUE, if the shape "seems to be valid".
11480 If theShape is invalid, prints a description of problem.
11481 If theReturnStatus is equal to 1 the description is returned
11482 along with IsValid flag.
11483 If theReturnStatus is equal to 2 the list of error data is
11484 returned along with IsValid flag.
11486 # Example: see GEOM_TestMeasures.py
11488 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11489 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11491 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11492 RaiseIfFailed("CheckShape", self.MeasuOp)
11494 if theReturnStatus == 0:
11495 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11497 if theReturnStatus == 1:
11498 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11499 return (IsValid, Descr)
11500 elif theReturnStatus == 2:
11501 return (IsValid, ShapeErrors)
11504 ## Detect self-intersections in the given shape.
11505 # @param theShape Shape to check.
11506 # @param theCheckLevel is the level of self-intersection check.
11507 # Possible input values are:
11508 # - GEOM.SI_V_V(0) - only V/V interferences
11509 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11510 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11511 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11512 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11513 # - GEOM.SI_ALL(5) - all interferences.
11514 # @return TRUE, if the shape contains no self-intersections.
11516 # @ref tui_check_self_intersections_page "Example"
11517 @ManageTransactions("MeasuOp")
11518 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11520 Detect self-intersections in the given shape.
11523 theShape Shape to check.
11524 theCheckLevel is the level of self-intersection check.
11525 Possible input values are:
11526 - GEOM.SI_V_V(0) - only V/V interferences
11527 - GEOM.SI_V_E(1) - V/V and V/E interferences
11528 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11529 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11530 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11531 - GEOM.SI_ALL(5) - all interferences.
11534 TRUE, if the shape contains no self-intersections.
11536 # Example: see GEOM_TestMeasures.py
11537 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11538 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11541 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11542 # @param theShape Shape to check.
11543 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11544 # - if \a theDeflection <= 0, default deflection 0.001 is used
11545 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11546 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11547 # - if \a theTolerance > 0, algorithm detects gaps
11548 # @return TRUE, if the shape contains no self-intersections.
11550 # @ref tui_check_self_intersections_fast_page "Example"
11551 @ManageTransactions("MeasuOp")
11552 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11554 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11557 theShape Shape to check.
11558 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11559 - if theDeflection <= 0, default deflection 0.001 is used
11560 theTolerance Specifies a distance between shapes used for detecting gaps:
11561 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11562 - if theTolerance > 0, algorithm detects gaps
11565 TRUE, if the shape contains no self-intersections.
11567 # Example: see GEOM_TestMeasures.py
11568 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11569 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11572 ## Check boolean and partition operations arguments.
11573 # @param theShape the argument of an operation to be checked
11574 # @return TRUE if the argument is valid for a boolean or partition
11575 # operation; FALSE otherwise.
11576 @ManageTransactions("MeasuOp")
11577 def CheckBOPArguments(self, theShape):
11579 Check boolean and partition operations arguments.
11582 theShape the argument of an operation to be checked
11585 TRUE if the argument is valid for a boolean or partition
11586 operation; FALSE otherwise.
11588 return self.MeasuOp.CheckBOPArguments(theShape)
11590 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11591 # @param theShape1 First source object
11592 # @param theShape2 Second source object
11593 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11594 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11595 # - if \a theTolerance > 0, algorithm detects gaps
11596 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11597 # - if \a theDeflection <= 0, default deflection 0.001 is used
11598 # @return TRUE, if there are intersections (gaps) between source shapes
11599 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11600 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11602 # @ref tui_fast_intersection_page "Example"
11603 @ManageTransactions("MeasuOp")
11604 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11606 Detect intersections of the given shapes with algorithm based on mesh intersections.
11609 theShape1 First source object
11610 theShape2 Second source object
11611 theTolerance Specifies a distance between shapes used for detecting gaps:
11612 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11613 - if theTolerance > 0, algorithm detects gaps
11614 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11615 - if theDeflection <= 0, default deflection 0.001 is used
11618 TRUE, if there are intersections (gaps) between source shapes
11619 List of sub-shapes IDs from 1st shape that localize intersection.
11620 List of sub-shapes IDs from 2nd shape that localize intersection.
11622 # Example: see GEOM_TestMeasures.py
11623 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11624 RaiseIfFailed("FastIntersect", self.MeasuOp)
11625 return IsOk, Res1, Res2
11627 ## Get position (LCS) of theShape.
11629 # Origin of the LCS is situated at the shape's center of mass.
11630 # Axes of the LCS are obtained from shape's location or,
11631 # if the shape is a planar face, from position of its plane.
11633 # @param theShape Shape to calculate position of.
11634 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11635 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11636 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11637 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11639 # @ref swig_todo "Example"
11640 @ManageTransactions("MeasuOp")
11641 def GetPosition(self,theShape):
11643 Get position (LCS) of theShape.
11644 Origin of the LCS is situated at the shape's center of mass.
11645 Axes of the LCS are obtained from shape's location or,
11646 if the shape is a planar face, from position of its plane.
11649 theShape Shape to calculate position of.
11652 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11653 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11654 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11655 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11657 # Example: see GEOM_TestMeasures.py
11658 aTuple = self.MeasuOp.GetPosition(theShape)
11659 RaiseIfFailed("GetPosition", self.MeasuOp)
11662 ## Get kind of theShape.
11664 # @param theShape Shape to get a kind of.
11665 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11666 # and a list of parameters, describing the shape.
11667 # @note Concrete meaning of each value, returned via \a theIntegers
11668 # or \a theDoubles list depends on the kind() of the shape.
11670 # @ref swig_todo "Example"
11671 @ManageTransactions("MeasuOp")
11672 def KindOfShape(self,theShape):
11674 Get kind of theShape.
11677 theShape Shape to get a kind of.
11680 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11681 and a list of parameters, describing the shape.
11683 Concrete meaning of each value, returned via theIntegers
11684 or theDoubles list depends on the geompy.kind of the shape
11686 # Example: see GEOM_TestMeasures.py
11687 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11688 RaiseIfFailed("KindOfShape", self.MeasuOp)
11690 aKind = aRoughTuple[0]
11691 anInts = aRoughTuple[1]
11692 aDbls = aRoughTuple[2]
11694 # Now there is no exception from this rule:
11695 aKindTuple = [aKind] + aDbls + anInts
11697 # If they are we will regroup parameters for such kind of shape.
11699 #if aKind == kind.SOME_KIND:
11700 # # SOME_KIND int int double int double double
11701 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11705 ## Returns the string that describes if the shell is good for solid.
11706 # This is a support method for MakeSolid.
11708 # @param theShell the shell to be checked.
11709 # @return Returns a string that describes the shell validity for
11710 # solid construction.
11711 @ManageTransactions("MeasuOp")
11712 def _IsGoodForSolid(self, theShell):
11714 Returns the string that describes if the shell is good for solid.
11715 This is a support method for MakeSolid.
11718 theShell the shell to be checked.
11721 Returns a string that describes the shell validity for
11722 solid construction.
11724 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11727 # end of l2_measure
11730 ## @addtogroup l2_import_export
11733 ## Import a shape from the BREP, IGES, STEP or other file
11734 # (depends on given format) with given name.
11736 # Note: this function is deprecated, it is kept for backward compatibility only
11737 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11739 # @param theFileName The file, containing the shape.
11740 # @param theFormatName Specify format for the file reading.
11741 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11742 # If format 'IGES_SCALE' is used instead of 'IGES' or
11743 # format 'STEP_SCALE' is used instead of 'STEP',
11744 # length unit will be set to 'meter' and result model will be scaled.
11745 # @param theName Object name; when specified, this parameter is used
11746 # for result publication in the study. Otherwise, if automatic
11747 # publication is switched on, default value is used for result name.
11749 # @return New GEOM.GEOM_Object, containing the imported shape.
11750 # If material names are imported it returns the list of
11751 # objects. The first one is the imported object followed by
11753 # @note Auto publishing is allowed for the shape itself. Imported
11754 # material groups are not automatically published.
11756 # @ref swig_Import_Export "Example"
11757 @ManageTransactions("InsertOp")
11758 def ImportFile(self, theFileName, theFormatName, theName=None):
11760 Import a shape from the BREP, IGES, STEP or other file
11761 (depends on given format) with given name.
11763 Note: this function is deprecated, it is kept for backward compatibility only
11764 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11767 theFileName The file, containing the shape.
11768 theFormatName Specify format for the file reading.
11769 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11770 If format 'IGES_SCALE' is used instead of 'IGES' or
11771 format 'STEP_SCALE' is used instead of 'STEP',
11772 length unit will be set to 'meter' and result model will be scaled.
11773 theName Object name; when specified, this parameter is used
11774 for result publication in the study. Otherwise, if automatic
11775 publication is switched on, default value is used for result name.
11778 New GEOM.GEOM_Object, containing the imported shape.
11779 If material names are imported it returns the list of
11780 objects. The first one is the imported object followed by
11783 Auto publishing is allowed for the shape itself. Imported
11784 material groups are not automatically published.
11786 # Example: see GEOM_TestOthers.py
11788 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11789 where <FormatName> is a name of desirable format for importing.
11791 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11792 RaiseIfFailed("ImportFile", self.InsertOp)
11793 aNbObj = len(aListObj)
11795 self._autoPublish(aListObj[0], theName, "imported")
11800 ## Deprecated analog of ImportFile()
11801 def Import(self, theFileName, theFormatName, theName=None):
11803 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11805 # note: auto-publishing is done in self.ImportFile()
11806 return self.ImportFile(theFileName, theFormatName, theName)
11808 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11810 # @note As the byte-stream representing the shape data can be quite large, this method
11811 # is not automatically dumped to the Python script with the DumpStudy functionality;
11812 # so please use this method carefully, only for strong reasons.
11814 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11817 # @param theStream The BRep binary stream.
11818 # @param theName Object name; when specified, this parameter is used
11819 # for result publication in the study. Otherwise, if automatic
11820 # publication is switched on, default value is used for result name.
11822 # @return New GEOM_Object, containing the shape, read from theStream.
11824 # @ref swig_Import_Export "Example"
11825 @ManageTransactions("InsertOp")
11826 def RestoreShape (self, theStream, theName=None):
11828 Read a shape from the binary stream, containing its bounding representation (BRep).
11831 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11834 theStream The BRep binary stream.
11835 theName Object name; when specified, this parameter is used
11836 for result publication in the study. Otherwise, if automatic
11837 publication is switched on, default value is used for result name.
11840 New GEOM_Object, containing the shape, read from theStream.
11842 # Example: see GEOM_TestOthers.py
11844 # this is the workaround to ignore invalid case when data stream is empty
11845 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11846 print("WARNING: Result of RestoreShape is a NULL shape!")
11848 anObj = self.InsertOp.RestoreShape(theStream)
11849 RaiseIfFailed("RestoreShape", self.InsertOp)
11850 self._autoPublish(anObj, theName, "restored")
11853 ## Export the given shape into a file with given name.
11855 # Note: this function is deprecated, it is kept for backward compatibility only
11856 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11858 # @param theObject Shape to be stored in the file.
11859 # @param theFileName Name of the file to store the given shape in.
11860 # @param theFormatName Specify format for the shape storage.
11861 # Available formats can be obtained with
11862 # geompy.InsertOp.ExportTranslators()[0] method.
11864 # @ref swig_Import_Export "Example"
11865 @ManageTransactions("InsertOp")
11866 def Export(self, theObject, theFileName, theFormatName):
11868 Export the given shape into a file with given name.
11870 Note: this function is deprecated, it is kept for backward compatibility only
11871 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11874 theObject Shape to be stored in the file.
11875 theFileName Name of the file to store the given shape in.
11876 theFormatName Specify format for the shape storage.
11877 Available formats can be obtained with
11878 geompy.InsertOp.ExportTranslators()[0] method.
11880 # Example: see GEOM_TestOthers.py
11882 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11883 where <FormatName> is a name of desirable format for exporting.
11885 self.InsertOp.Export(theObject, theFileName, theFormatName)
11886 if self.InsertOp.IsDone() == 0:
11887 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11891 # end of l2_import_export
11894 ## @addtogroup l3_blocks
11897 ## Create a quadrangle face from four edges. Order of Edges is not
11898 # important. It is not necessary that edges share the same vertex.
11899 # @param E1,E2,E3,E4 Edges for the face bound.
11900 # @param theName Object name; when specified, this parameter is used
11901 # for result publication in the study. Otherwise, if automatic
11902 # publication is switched on, default value is used for result name.
11904 # @return New GEOM.GEOM_Object, containing the created face.
11906 # @ref tui_building_by_blocks_page "Example"
11907 @ManageTransactions("BlocksOp")
11908 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11910 Create a quadrangle face from four edges. Order of Edges is not
11911 important. It is not necessary that edges share the same vertex.
11914 E1,E2,E3,E4 Edges for the face bound.
11915 theName Object name; when specified, this parameter is used
11916 for result publication in the study. Otherwise, if automatic
11917 publication is switched on, default value is used for result name.
11920 New GEOM.GEOM_Object, containing the created face.
11923 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11925 # Example: see GEOM_Spanner.py
11926 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11927 RaiseIfFailed("MakeQuad", self.BlocksOp)
11928 self._autoPublish(anObj, theName, "quad")
11931 ## Create a quadrangle face on two edges.
11932 # The missing edges will be built by creating the shortest ones.
11933 # @param E1,E2 Two opposite edges for the face.
11934 # @param theName Object name; when specified, this parameter is used
11935 # for result publication in the study. Otherwise, if automatic
11936 # publication is switched on, default value is used for result name.
11938 # @return New GEOM.GEOM_Object, containing the created face.
11940 # @ref tui_building_by_blocks_page "Example"
11941 @ManageTransactions("BlocksOp")
11942 def MakeQuad2Edges(self, E1, E2, theName=None):
11944 Create a quadrangle face on two edges.
11945 The missing edges will be built by creating the shortest ones.
11948 E1,E2 Two opposite edges for the face.
11949 theName Object name; when specified, this parameter is used
11950 for result publication in the study. Otherwise, if automatic
11951 publication is switched on, default value is used for result name.
11954 New GEOM.GEOM_Object, containing the created face.
11958 p1 = geompy.MakeVertex( 0., 0., 0.)
11959 p2 = geompy.MakeVertex(150., 30., 0.)
11960 p3 = geompy.MakeVertex( 0., 120., 50.)
11961 p4 = geompy.MakeVertex( 0., 40., 70.)
11963 edge1 = geompy.MakeEdge(p1, p2)
11964 edge2 = geompy.MakeEdge(p3, p4)
11965 # create a quadrangle face from two edges
11966 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11968 # Example: see GEOM_Spanner.py
11969 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11970 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11971 self._autoPublish(anObj, theName, "quad")
11974 ## Create a quadrangle face with specified corners.
11975 # The missing edges will be built by creating the shortest ones.
11976 # @param V1,V2,V3,V4 Corner vertices for the face.
11977 # @param theName Object name; when specified, this parameter is used
11978 # for result publication in the study. Otherwise, if automatic
11979 # publication is switched on, default value is used for result name.
11981 # @return New GEOM.GEOM_Object, containing the created face.
11983 # @ref tui_building_by_blocks_page "Example 1"
11984 # \n @ref swig_MakeQuad4Vertices "Example 2"
11985 @ManageTransactions("BlocksOp")
11986 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11988 Create a quadrangle face with specified corners.
11989 The missing edges will be built by creating the shortest ones.
11992 V1,V2,V3,V4 Corner vertices for the face.
11993 theName Object name; when specified, this parameter is used
11994 for result publication in the study. Otherwise, if automatic
11995 publication is switched on, default value is used for result name.
11998 New GEOM.GEOM_Object, containing the created face.
12002 p1 = geompy.MakeVertex( 0., 0., 0.)
12003 p2 = geompy.MakeVertex(150., 30., 0.)
12004 p3 = geompy.MakeVertex( 0., 120., 50.)
12005 p4 = geompy.MakeVertex( 0., 40., 70.)
12006 # create a quadrangle from four points in its corners
12007 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12009 # Example: see GEOM_Spanner.py
12010 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12011 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12012 self._autoPublish(anObj, theName, "quad")
12015 ## Create a hexahedral solid, bounded by the six given faces. Order of
12016 # faces is not important. It is not necessary that Faces share the same edge.
12017 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12018 # @param theName Object name; when specified, this parameter is used
12019 # for result publication in the study. Otherwise, if automatic
12020 # publication is switched on, default value is used for result name.
12022 # @return New GEOM.GEOM_Object, containing the created solid.
12024 # @ref tui_building_by_blocks_page "Example 1"
12025 # \n @ref swig_MakeHexa "Example 2"
12026 @ManageTransactions("BlocksOp")
12027 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12029 Create a hexahedral solid, bounded by the six given faces. Order of
12030 faces is not important. It is not necessary that Faces share the same edge.
12033 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12034 theName Object name; when specified, this parameter is used
12035 for result publication in the study. Otherwise, if automatic
12036 publication is switched on, default value is used for result name.
12039 New GEOM.GEOM_Object, containing the created solid.
12042 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12044 # Example: see GEOM_Spanner.py
12045 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12046 RaiseIfFailed("MakeHexa", self.BlocksOp)
12047 self._autoPublish(anObj, theName, "hexa")
12050 ## Create a hexahedral solid between two given faces.
12051 # The missing faces will be built by creating the smallest ones.
12052 # @param F1,F2 Two opposite faces for the hexahedral solid.
12053 # @param theName Object name; when specified, this parameter is used
12054 # for result publication in the study. Otherwise, if automatic
12055 # publication is switched on, default value is used for result name.
12057 # @return New GEOM.GEOM_Object, containing the created solid.
12059 # @ref tui_building_by_blocks_page "Example 1"
12060 # \n @ref swig_MakeHexa2Faces "Example 2"
12061 @ManageTransactions("BlocksOp")
12062 def MakeHexa2Faces(self, F1, F2, theName=None):
12064 Create a hexahedral solid between two given faces.
12065 The missing faces will be built by creating the smallest ones.
12068 F1,F2 Two opposite faces for the hexahedral solid.
12069 theName Object name; when specified, this parameter is used
12070 for result publication in the study. Otherwise, if automatic
12071 publication is switched on, default value is used for result name.
12074 New GEOM.GEOM_Object, containing the created solid.
12077 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12079 # Example: see GEOM_Spanner.py
12080 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12081 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12082 self._autoPublish(anObj, theName, "hexa")
12088 ## @addtogroup l3_blocks_op
12091 ## Get a vertex, found in the given shape by its coordinates.
12092 # @param theShape Block or a compound of blocks.
12093 # @param theX,theY,theZ Coordinates of the sought vertex.
12094 # @param theEpsilon Maximum allowed distance between the resulting
12095 # vertex and point with the given coordinates.
12096 # @param theName Object name; when specified, this parameter is used
12097 # for result publication in the study. Otherwise, if automatic
12098 # publication is switched on, default value is used for result name.
12100 # @return New GEOM.GEOM_Object, containing the found vertex.
12102 # @ref swig_GetPoint "Example"
12103 @ManageTransactions("BlocksOp")
12104 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12106 Get a vertex, found in the given shape by its coordinates.
12109 theShape Block or a compound of blocks.
12110 theX,theY,theZ Coordinates of the sought vertex.
12111 theEpsilon Maximum allowed distance between the resulting
12112 vertex and point with the given coordinates.
12113 theName Object name; when specified, this parameter is used
12114 for result publication in the study. Otherwise, if automatic
12115 publication is switched on, default value is used for result name.
12118 New GEOM.GEOM_Object, containing the found vertex.
12121 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12123 # Example: see GEOM_TestOthers.py
12124 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12125 RaiseIfFailed("GetPoint", self.BlocksOp)
12126 self._autoPublish(anObj, theName, "vertex")
12129 ## Find a vertex of the given shape, which has minimal distance to the given point.
12130 # @param theShape Any shape.
12131 # @param thePoint Point, close to the desired vertex.
12132 # @param theName Object name; when specified, this parameter is used
12133 # for result publication in the study. Otherwise, if automatic
12134 # publication is switched on, default value is used for result name.
12136 # @return New GEOM.GEOM_Object, containing the found vertex.
12138 # @ref swig_GetVertexNearPoint "Example"
12139 @ManageTransactions("BlocksOp")
12140 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12142 Find a vertex of the given shape, which has minimal distance to the given point.
12145 theShape Any shape.
12146 thePoint Point, close to the desired vertex.
12147 theName Object name; when specified, this parameter is used
12148 for result publication in the study. Otherwise, if automatic
12149 publication is switched on, default value is used for result name.
12152 New GEOM.GEOM_Object, containing the found vertex.
12155 pmidle = geompy.MakeVertex(50, 0, 50)
12156 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12158 # Example: see GEOM_TestOthers.py
12159 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12160 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12161 self._autoPublish(anObj, theName, "vertex")
12164 ## Get an edge, found in the given shape by two given vertices.
12165 # @param theShape Block or a compound of blocks.
12166 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12167 # @param theName Object name; when specified, this parameter is used
12168 # for result publication in the study. Otherwise, if automatic
12169 # publication is switched on, default value is used for result name.
12171 # @return New GEOM.GEOM_Object, containing the found edge.
12173 # @ref swig_GetEdge "Example"
12174 @ManageTransactions("BlocksOp")
12175 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12177 Get an edge, found in the given shape by two given vertices.
12180 theShape Block or a compound of blocks.
12181 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12182 theName Object name; when specified, this parameter is used
12183 for result publication in the study. Otherwise, if automatic
12184 publication is switched on, default value is used for result name.
12187 New GEOM.GEOM_Object, containing the found edge.
12189 # Example: see GEOM_Spanner.py
12190 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12191 RaiseIfFailed("GetEdge", self.BlocksOp)
12192 self._autoPublish(anObj, theName, "edge")
12195 ## Find an edge of the given shape, which has minimal distance to the given point.
12196 # @param theShape Block or a compound of blocks.
12197 # @param thePoint Point, close to the desired edge.
12198 # @param theName Object name; when specified, this parameter is used
12199 # for result publication in the study. Otherwise, if automatic
12200 # publication is switched on, default value is used for result name.
12202 # @return New GEOM.GEOM_Object, containing the found edge.
12204 # @ref swig_GetEdgeNearPoint "Example"
12205 @ManageTransactions("BlocksOp")
12206 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12208 Find an edge of the given shape, which has minimal distance to the given point.
12211 theShape Block or a compound of blocks.
12212 thePoint Point, close to the desired edge.
12213 theName Object name; when specified, this parameter is used
12214 for result publication in the study. Otherwise, if automatic
12215 publication is switched on, default value is used for result name.
12218 New GEOM.GEOM_Object, containing the found edge.
12220 # Example: see GEOM_TestOthers.py
12221 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12222 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12223 self._autoPublish(anObj, theName, "edge")
12226 ## Returns a face, found in the given shape by four given corner vertices.
12227 # @param theShape Block or a compound of blocks.
12228 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12229 # @param theName Object name; when specified, this parameter is used
12230 # for result publication in the study. Otherwise, if automatic
12231 # publication is switched on, default value is used for result name.
12233 # @return New GEOM.GEOM_Object, containing the found face.
12235 # @ref swig_todo "Example"
12236 @ManageTransactions("BlocksOp")
12237 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12239 Returns a face, found in the given shape by four given corner vertices.
12242 theShape Block or a compound of blocks.
12243 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12244 theName Object name; when specified, this parameter is used
12245 for result publication in the study. Otherwise, if automatic
12246 publication is switched on, default value is used for result name.
12249 New GEOM.GEOM_Object, containing the found face.
12251 # Example: see GEOM_Spanner.py
12252 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12253 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12254 self._autoPublish(anObj, theName, "face")
12257 ## Get a face of block, found in the given shape by two given edges.
12258 # @param theShape Block or a compound of blocks.
12259 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12260 # @param theName Object name; when specified, this parameter is used
12261 # for result publication in the study. Otherwise, if automatic
12262 # publication is switched on, default value is used for result name.
12264 # @return New GEOM.GEOM_Object, containing the found face.
12266 # @ref swig_todo "Example"
12267 @ManageTransactions("BlocksOp")
12268 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12270 Get a face of block, found in the given shape by two given edges.
12273 theShape Block or a compound of blocks.
12274 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12275 theName Object name; when specified, this parameter is used
12276 for result publication in the study. Otherwise, if automatic
12277 publication is switched on, default value is used for result name.
12280 New GEOM.GEOM_Object, containing the found face.
12282 # Example: see GEOM_Spanner.py
12283 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12284 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12285 self._autoPublish(anObj, theName, "face")
12288 ## Find a face, opposite to the given one in the given block.
12289 # @param theBlock Must be a hexahedral solid.
12290 # @param theFace Face of \a theBlock, opposite to the desired face.
12291 # @param theName Object name; when specified, this parameter is used
12292 # for result publication in the study. Otherwise, if automatic
12293 # publication is switched on, default value is used for result name.
12295 # @return New GEOM.GEOM_Object, containing the found face.
12297 # @ref swig_GetOppositeFace "Example"
12298 @ManageTransactions("BlocksOp")
12299 def GetOppositeFace(self, theBlock, theFace, theName=None):
12301 Find a face, opposite to the given one in the given block.
12304 theBlock Must be a hexahedral solid.
12305 theFace Face of theBlock, opposite to the desired face.
12306 theName Object name; when specified, this parameter is used
12307 for result publication in the study. Otherwise, if automatic
12308 publication is switched on, default value is used for result name.
12311 New GEOM.GEOM_Object, containing the found face.
12313 # Example: see GEOM_Spanner.py
12314 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12315 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12316 self._autoPublish(anObj, theName, "face")
12319 ## Find a face of the given shape, which has minimal distance to the given point.
12320 # @param theShape Block or a compound of blocks.
12321 # @param thePoint Point, close to the desired face.
12322 # @param theName Object name; when specified, this parameter is used
12323 # for result publication in the study. Otherwise, if automatic
12324 # publication is switched on, default value is used for result name.
12326 # @return New GEOM.GEOM_Object, containing the found face.
12328 # @ref swig_GetFaceNearPoint "Example"
12329 @ManageTransactions("BlocksOp")
12330 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12332 Find a face of the given shape, which has minimal distance to the given point.
12335 theShape Block or a compound of blocks.
12336 thePoint Point, close to the desired face.
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 New GEOM.GEOM_Object, containing the found face.
12344 # Example: see GEOM_Spanner.py
12345 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12346 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12347 self._autoPublish(anObj, theName, "face")
12350 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12351 # @param theBlock Block or a compound of blocks.
12352 # @param theVector Vector, close to the normale of the desired face.
12353 # @param theName Object name; when specified, this parameter is used
12354 # for result publication in the study. Otherwise, if automatic
12355 # publication is switched on, default value is used for result name.
12357 # @return New GEOM.GEOM_Object, containing the found face.
12359 # @ref swig_todo "Example"
12360 @ManageTransactions("BlocksOp")
12361 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12363 Find a face of block, whose outside normale has minimal angle with the given vector.
12366 theBlock Block or a compound of blocks.
12367 theVector Vector, close to the normale of the desired face.
12368 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.
12373 New GEOM.GEOM_Object, containing the found face.
12375 # Example: see GEOM_Spanner.py
12376 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12377 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12378 self._autoPublish(anObj, theName, "face")
12381 ## Find all sub-shapes of type \a theShapeType of the given shape,
12382 # which have minimal distance to the given point.
12383 # @param theShape Any shape.
12384 # @param thePoint Point, close to the desired shape.
12385 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12386 # @param theTolerance The tolerance for distances comparison. All shapes
12387 # with distances to the given point in interval
12388 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12389 # @param theName Object name; when specified, this parameter is used
12390 # for result publication in the study. Otherwise, if automatic
12391 # publication is switched on, default value is used for result name.
12393 # @return New GEOM_Object, containing a group of all found shapes.
12395 # @ref swig_GetShapesNearPoint "Example"
12396 @ManageTransactions("BlocksOp")
12397 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12399 Find all sub-shapes of type theShapeType of the given shape,
12400 which have minimal distance to the given point.
12403 theShape Any shape.
12404 thePoint Point, close to the desired shape.
12405 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12406 theTolerance The tolerance for distances comparison. All shapes
12407 with distances to the given point in interval
12408 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12409 theName Object name; when specified, this parameter is used
12410 for result publication in the study. Otherwise, if automatic
12411 publication is switched on, default value is used for result name.
12414 New GEOM_Object, containing a group of all found shapes.
12416 # Example: see GEOM_TestOthers.py
12417 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12418 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12419 self._autoPublish(anObj, theName, "group")
12422 # end of l3_blocks_op
12425 ## @addtogroup l4_blocks_measure
12428 ## Check, if the compound of blocks is given.
12429 # To be considered as a compound of blocks, the
12430 # given shape must satisfy the following conditions:
12431 # - Each element of the compound should be a Block (6 faces).
12432 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12433 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12434 # there are more than 4 edges in the only wire of a face,
12435 # this face is considered to be quadrangle if it has 4 bounds
12436 # (1 or more edge) of C1 continuity.
12437 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12438 # - The compound should be connexe.
12439 # - The glue between two quadrangle faces should be applied.
12440 # @param theCompound The compound to check.
12441 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12442 # taking into account C1 continuity.
12443 # @param theAngTolerance the angular tolerance to check if two neighbor
12444 # edges are codirectional in the common vertex with this
12445 # tolerance. This parameter is used only if
12446 # <VAR>theIsUseC1</VAR> is set to True.
12447 # @return TRUE, if the given shape is a compound of blocks.
12448 # If theCompound is not valid, prints all discovered errors.
12450 # @ref tui_check_compound_of_blocks_page "Example 1"
12451 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12452 @ManageTransactions("BlocksOp")
12453 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12454 theAngTolerance = 1.e-12):
12456 Check, if the compound of blocks is given.
12457 To be considered as a compound of blocks, the
12458 given shape must satisfy the following conditions:
12459 - Each element of the compound should be a Block (6 faces).
12460 - Each face should be a quadrangle, i.e. it should have only 1 wire
12461 with 4 edges. If theIsUseC1 is set to True and
12462 there are more than 4 edges in the only wire of a face,
12463 this face is considered to be quadrangle if it has 4 bounds
12464 (1 or more edge) of C1 continuity.
12465 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12466 - The compound should be connexe.
12467 - The glue between two quadrangle faces should be applied.
12470 theCompound The compound to check.
12471 theIsUseC1 Flag to check if there are 4 bounds on a face
12472 taking into account C1 continuity.
12473 theAngTolerance the angular tolerance to check if two neighbor
12474 edges are codirectional in the common vertex with this
12475 tolerance. This parameter is used only if
12476 theIsUseC1 is set to True.
12479 TRUE, if the given shape is a compound of blocks.
12480 If theCompound is not valid, prints all discovered errors.
12482 # Example: see GEOM_Spanner.py
12485 aTolerance = theAngTolerance
12486 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12487 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12489 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12493 ## Retrieve all non blocks solids and faces from \a theShape.
12494 # @param theShape The shape to explore.
12495 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12496 # taking into account C1 continuity.
12497 # @param theAngTolerance the angular tolerance to check if two neighbor
12498 # edges are codirectional in the common vertex with this
12499 # tolerance. This parameter is used only if
12500 # <VAR>theIsUseC1</VAR> is set to True.
12501 # @param theName Object name; when specified, this parameter is used
12502 # for result publication in the study. Otherwise, if automatic
12503 # publication is switched on, default value is used for result name.
12505 # @return A tuple of two GEOM_Objects. The first object is a group of all
12506 # non block solids (= not 6 faces, or with 6 faces, but with the
12507 # presence of non-quadrangular faces). The second object is a
12508 # group of all non quadrangular faces (= faces with more then
12509 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12510 # with 1 wire with not 4 edges that do not form 4 bounds of
12513 # @ref tui_get_non_blocks_page "Example 1"
12514 # \n @ref swig_GetNonBlocks "Example 2"
12515 @ManageTransactions("BlocksOp")
12516 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12517 theAngTolerance = 1.e-12, theName=None):
12519 Retrieve all non blocks solids and faces from theShape.
12522 theShape The shape to explore.
12523 theIsUseC1 Flag to check if there are 4 bounds on a face
12524 taking into account C1 continuity.
12525 theAngTolerance the angular tolerance to check if two neighbor
12526 edges are codirectional in the common vertex with this
12527 tolerance. This parameter is used only if
12528 theIsUseC1 is set to True.
12529 theName Object name; when specified, this parameter is used
12530 for result publication in the study. Otherwise, if automatic
12531 publication is switched on, default value is used for result name.
12534 A tuple of two GEOM_Objects. The first object is a group of all
12535 non block solids (= not 6 faces, or with 6 faces, but with the
12536 presence of non-quadrangular faces). The second object is a
12537 group of all non quadrangular faces (= faces with more then
12538 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12539 with 1 wire with not 4 edges that do not form 4 bounds of
12543 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12545 # Example: see GEOM_Spanner.py
12548 aTolerance = theAngTolerance
12549 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12550 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12551 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12554 ## Remove all seam and degenerated edges from \a theShape.
12555 # Unite faces and edges, sharing one surface. It means that
12556 # this faces must have references to one C++ surface object (handle).
12557 # @param theShape The compound or single solid to remove irregular edges from.
12558 # @param doUnionFaces If True, then unite faces. If False (the default value),
12559 # do not unite faces.
12560 # @param theName Object name; when specified, this parameter is used
12561 # for result publication in the study. Otherwise, if automatic
12562 # publication is switched on, default value is used for result name.
12564 # @return Improved shape.
12566 # @ref swig_RemoveExtraEdges "Example"
12567 @ManageTransactions("BlocksOp")
12568 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12570 Remove all seam and degenerated edges from theShape.
12571 Unite faces and edges, sharing one surface. It means that
12572 this faces must have references to one C++ surface object (handle).
12575 theShape The compound or single solid to remove irregular edges from.
12576 doUnionFaces If True, then unite faces. If False (the default value),
12577 do not unite faces.
12578 theName Object name; when specified, this parameter is used
12579 for result publication in the study. Otherwise, if automatic
12580 publication is switched on, default value is used for result name.
12585 # Example: see GEOM_TestOthers.py
12586 nbFacesOptimum = -1 # -1 means do not unite faces
12587 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12588 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12589 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12590 self._autoPublish(anObj, theName, "removeExtraEdges")
12593 ## Performs union faces of \a theShape
12594 # Unite faces sharing one surface. It means that
12595 # these faces must have references to one C++ surface object (handle).
12596 # @param theShape The compound or single solid that contains faces
12597 # to perform union.
12598 # @param theName Object name; when specified, this parameter is used
12599 # for result publication in the study. Otherwise, if automatic
12600 # publication is switched on, default value is used for result name.
12602 # @return Improved shape.
12604 # @ref swig_UnionFaces "Example"
12605 @ManageTransactions("BlocksOp")
12606 def UnionFaces(self, theShape, theName=None):
12608 Performs union faces of theShape.
12609 Unite faces sharing one surface. It means that
12610 these faces must have references to one C++ surface object (handle).
12613 theShape The compound or single solid that contains faces
12615 theName Object name; when specified, this parameter is used
12616 for result publication in the study. Otherwise, if automatic
12617 publication is switched on, default value is used for result name.
12622 # Example: see GEOM_TestOthers.py
12623 anObj = self.BlocksOp.UnionFaces(theShape)
12624 RaiseIfFailed("UnionFaces", self.BlocksOp)
12625 self._autoPublish(anObj, theName, "unionFaces")
12628 ## Check, if the given shape is a blocks compound.
12629 # Fix all detected errors.
12630 # \note Single block can be also fixed by this method.
12631 # @param theShape The compound to check and improve.
12632 # @param theName Object name; when specified, this parameter is used
12633 # for result publication in the study. Otherwise, if automatic
12634 # publication is switched on, default value is used for result name.
12636 # @return Improved compound.
12638 # @ref swig_CheckAndImprove "Example"
12639 @ManageTransactions("BlocksOp")
12640 def CheckAndImprove(self, theShape, theName=None):
12642 Check, if the given shape is a blocks compound.
12643 Fix all detected errors.
12646 Single block can be also fixed by this method.
12649 theShape The compound to check and improve.
12650 theName Object name; when specified, this parameter is used
12651 for result publication in the study. Otherwise, if automatic
12652 publication is switched on, default value is used for result name.
12657 # Example: see GEOM_TestOthers.py
12658 anObj = self.BlocksOp.CheckAndImprove(theShape)
12659 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12660 self._autoPublish(anObj, theName, "improved")
12663 # end of l4_blocks_measure
12666 ## @addtogroup l3_blocks_op
12669 ## Get all the blocks, contained in the given compound.
12670 # @param theCompound The compound to explode.
12671 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12672 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12673 # @param theName Object name; when specified, this parameter is used
12674 # for result publication in the study. Otherwise, if automatic
12675 # publication is switched on, default value is used for result name.
12677 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12679 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12681 # @ref tui_explode_on_blocks "Example 1"
12682 # \n @ref swig_MakeBlockExplode "Example 2"
12683 @ManageTransactions("BlocksOp")
12684 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12686 Get all the blocks, contained in the given compound.
12689 theCompound The compound to explode.
12690 theMinNbFaces If solid has lower number of faces, it is not a block.
12691 theMaxNbFaces If solid has higher number of faces, it is not a block.
12692 theName Object name; when specified, this parameter is used
12693 for result publication in the study. Otherwise, if automatic
12694 publication is switched on, default value is used for result name.
12697 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12700 List of GEOM.GEOM_Object, containing the retrieved blocks.
12702 # Example: see GEOM_TestOthers.py
12703 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12704 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12705 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12706 for anObj in aList:
12707 anObj.SetParameters(Parameters)
12709 self._autoPublish(aList, theName, "block")
12712 ## Find block, containing the given point inside its volume or on boundary.
12713 # @param theCompound Compound, to find block in.
12714 # @param thePoint Point, close to the desired block. If the point lays on
12715 # boundary between some blocks, we return block with nearest center.
12716 # @param theName Object name; when specified, this parameter is used
12717 # for result publication in the study. Otherwise, if automatic
12718 # publication is switched on, default value is used for result name.
12720 # @return New GEOM.GEOM_Object, containing the found block.
12722 # @ref swig_todo "Example"
12723 @ManageTransactions("BlocksOp")
12724 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12726 Find block, containing the given point inside its volume or on boundary.
12729 theCompound Compound, to find block in.
12730 thePoint Point, close to the desired block. If the point lays on
12731 boundary between some blocks, we return block with nearest center.
12732 theName Object name; when specified, this parameter is used
12733 for result publication in the study. Otherwise, if automatic
12734 publication is switched on, default value is used for result name.
12737 New GEOM.GEOM_Object, containing the found block.
12739 # Example: see GEOM_Spanner.py
12740 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12741 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12742 self._autoPublish(anObj, theName, "block")
12745 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12746 # @param theCompound Compound, to find block in.
12747 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12748 # @param theName Object name; when specified, this parameter is used
12749 # for result publication in the study. Otherwise, if automatic
12750 # publication is switched on, default value is used for result name.
12752 # @return New GEOM.GEOM_Object, containing the found block.
12754 # @ref swig_GetBlockByParts "Example"
12755 @ManageTransactions("BlocksOp")
12756 def GetBlockByParts(self, theCompound, theParts, theName=None):
12758 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12761 theCompound Compound, to find block in.
12762 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12763 theName Object name; when specified, this parameter is used
12764 for result publication in the study. Otherwise, if automatic
12765 publication is switched on, default value is used for result name.
12768 New GEOM_Object, containing the found block.
12770 # Example: see GEOM_TestOthers.py
12771 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12772 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12773 self._autoPublish(anObj, theName, "block")
12776 ## Return all blocks, containing all the elements, passed as the parts.
12777 # @param theCompound Compound, to find blocks in.
12778 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12779 # @param theName Object name; when specified, this parameter is used
12780 # for result publication in the study. Otherwise, if automatic
12781 # publication is switched on, default value is used for result name.
12783 # @return List of GEOM.GEOM_Object, containing the found blocks.
12785 # @ref swig_todo "Example"
12786 @ManageTransactions("BlocksOp")
12787 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12789 Return all blocks, containing all the elements, passed as the parts.
12792 theCompound Compound, to find blocks in.
12793 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12794 theName Object name; when specified, this parameter is used
12795 for result publication in the study. Otherwise, if automatic
12796 publication is switched on, default value is used for result name.
12799 List of GEOM.GEOM_Object, containing the found blocks.
12801 # Example: see GEOM_Spanner.py
12802 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12803 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12804 self._autoPublish(aList, theName, "block")
12807 ## Multi-transformate block and glue the result.
12808 # Transformation is defined so, as to superpose direction faces.
12809 # @param Block Hexahedral solid to be multi-transformed.
12810 # @param DirFace1 ID of First direction face.
12811 # @param DirFace2 ID of Second direction face.
12812 # @param NbTimes Quantity of transformations to be done.
12813 # @param theName Object name; when specified, this parameter is used
12814 # for result publication in the study. Otherwise, if automatic
12815 # publication is switched on, default value is used for result name.
12817 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12819 # @return New GEOM.GEOM_Object, containing the result shape.
12821 # @ref tui_multi_transformation "Example"
12822 @ManageTransactions("BlocksOp")
12823 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12825 Multi-transformate block and glue the result.
12826 Transformation is defined so, as to superpose direction faces.
12829 Block Hexahedral solid to be multi-transformed.
12830 DirFace1 ID of First direction face.
12831 DirFace2 ID of Second direction face.
12832 NbTimes Quantity of transformations to be done.
12833 theName Object name; when specified, this parameter is used
12834 for result publication in the study. Otherwise, if automatic
12835 publication is switched on, default value is used for result name.
12838 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12841 New GEOM.GEOM_Object, containing the result shape.
12843 # Example: see GEOM_Spanner.py
12844 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12845 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12846 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12847 anObj.SetParameters(Parameters)
12848 self._autoPublish(anObj, theName, "transformed")
12851 ## Multi-transformate block and glue the result.
12852 # @param Block Hexahedral solid to be multi-transformed.
12853 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12854 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12855 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12856 # @param theName Object name; when specified, this parameter is used
12857 # for result publication in the study. Otherwise, if automatic
12858 # publication is switched on, default value is used for result name.
12860 # @return New GEOM.GEOM_Object, containing the result shape.
12862 # @ref tui_multi_transformation "Example"
12863 @ManageTransactions("BlocksOp")
12864 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12865 DirFace1V, DirFace2V, NbTimesV, theName=None):
12867 Multi-transformate block and glue the result.
12870 Block Hexahedral solid to be multi-transformed.
12871 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12872 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12873 NbTimesU,NbTimesV Quantity of transformations to be done.
12874 theName Object name; when specified, this parameter is used
12875 for result publication in the study. Otherwise, if automatic
12876 publication is switched on, default value is used for result name.
12879 New GEOM.GEOM_Object, containing the result shape.
12881 # Example: see GEOM_Spanner.py
12882 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12883 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12884 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12885 DirFace1V, DirFace2V, NbTimesV)
12886 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12887 anObj.SetParameters(Parameters)
12888 self._autoPublish(anObj, theName, "transformed")
12891 ## Build all possible propagation groups.
12892 # Propagation group is a set of all edges, opposite to one (main)
12893 # edge of this group directly or through other opposite edges.
12894 # Notion of Opposite Edge make sense only on quadrangle face.
12895 # @param theShape Shape to build propagation groups on.
12896 # @param theName Object name; when specified, this parameter is used
12897 # for result publication in the study. Otherwise, if automatic
12898 # publication is switched on, default value is used for result name.
12900 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12902 # @ref swig_Propagate "Example"
12903 @ManageTransactions("BlocksOp")
12904 def Propagate(self, theShape, theName=None):
12906 Build all possible propagation groups.
12907 Propagation group is a set of all edges, opposite to one (main)
12908 edge of this group directly or through other opposite edges.
12909 Notion of Opposite Edge make sense only on quadrangle face.
12912 theShape Shape to build propagation groups on.
12913 theName Object name; when specified, this parameter is used
12914 for result publication in the study. Otherwise, if automatic
12915 publication is switched on, default value is used for result name.
12918 List of GEOM.GEOM_Object, each of them is a propagation group.
12920 # Example: see GEOM_TestOthers.py
12921 listChains = self.BlocksOp.Propagate(theShape)
12922 RaiseIfFailed("Propagate", self.BlocksOp)
12923 self._autoPublish(listChains, theName, "propagate")
12926 # end of l3_blocks_op
12929 ## @addtogroup l3_groups
12932 ## Creates a new group which will store sub-shapes of theMainShape
12933 # @param theMainShape is a GEOM object on which the group is selected
12934 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12935 # @param theName Object name; when specified, this parameter is used
12936 # for result publication in the study. Otherwise, if automatic
12937 # publication is switched on, default value is used for result name.
12939 # @return a newly created GEOM group (GEOM.GEOM_Object)
12941 # @ref tui_working_with_groups_page "Example 1"
12942 # \n @ref swig_CreateGroup "Example 2"
12943 @ManageTransactions("GroupOp")
12944 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12946 Creates a new group which will store sub-shapes of theMainShape
12949 theMainShape is a GEOM object on which the group is selected
12950 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12951 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12952 theName Object name; when specified, this parameter is used
12953 for result publication in the study. Otherwise, if automatic
12954 publication is switched on, default value is used for result name.
12957 a newly created GEOM group
12960 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12963 # Example: see GEOM_TestOthers.py
12964 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12965 RaiseIfFailed("CreateGroup", self.GroupOp)
12966 self._autoPublish(anObj, theName, "group")
12969 ## Adds a sub-object with ID theSubShapeId to the group
12970 # @param theGroup is a GEOM group to which the new sub-shape is added
12971 # @param theSubShapeID is a sub-shape ID in the main object.
12972 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12974 # @ref tui_working_with_groups_page "Example"
12975 @ManageTransactions("GroupOp")
12976 def AddObject(self,theGroup, theSubShapeID):
12978 Adds a sub-object with ID theSubShapeId to the group
12981 theGroup is a GEOM group to which the new sub-shape is added
12982 theSubShapeID is a sub-shape ID in the main object.
12985 Use method GetSubShapeID() to get an unique ID of the sub-shape
12987 # Example: see GEOM_TestOthers.py
12988 self.GroupOp.AddObject(theGroup, theSubShapeID)
12989 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12990 RaiseIfFailed("AddObject", self.GroupOp)
12994 ## Removes a sub-object with ID \a theSubShapeId from the group
12995 # @param theGroup is a GEOM group from which the new sub-shape is removed
12996 # @param theSubShapeID is a sub-shape ID in the main object.
12997 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12999 # @ref tui_working_with_groups_page "Example"
13000 @ManageTransactions("GroupOp")
13001 def RemoveObject(self,theGroup, theSubShapeID):
13003 Removes a sub-object with ID theSubShapeId from the group
13006 theGroup is a GEOM group from which the new sub-shape is removed
13007 theSubShapeID is a sub-shape ID in the main object.
13010 Use method GetSubShapeID() to get an unique ID of the sub-shape
13012 # Example: see GEOM_TestOthers.py
13013 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13014 RaiseIfFailed("RemoveObject", self.GroupOp)
13017 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
13018 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13019 # @param theSubShapes is a list of sub-shapes to be added.
13021 # @ref tui_working_with_groups_page "Example"
13022 @ManageTransactions("GroupOp")
13023 def UnionList (self,theGroup, theSubShapes):
13025 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
13028 theGroup is a GEOM group to which the new sub-shapes are added.
13029 theSubShapes is a list of sub-shapes to be added.
13031 # Example: see GEOM_TestOthers.py
13032 self.GroupOp.UnionList(theGroup, theSubShapes)
13033 RaiseIfFailed("UnionList", self.GroupOp)
13036 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
13037 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13038 # @param theSubShapes is a list of indices of sub-shapes to be added.
13040 # @ref swig_UnionIDs "Example"
13041 @ManageTransactions("GroupOp")
13042 def UnionIDs(self,theGroup, theSubShapes):
13044 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
13047 theGroup is a GEOM group to which the new sub-shapes are added.
13048 theSubShapes is a list of indices of sub-shapes to be added.
13050 # Example: see GEOM_TestOthers.py
13051 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13052 RaiseIfFailed("UnionIDs", self.GroupOp)
13055 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13056 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13057 # @param theSubShapes is a list of sub-shapes to be removed.
13059 # @ref tui_working_with_groups_page "Example"
13060 @ManageTransactions("GroupOp")
13061 def DifferenceList (self,theGroup, theSubShapes):
13063 Removes from the group all the given shapes. No errors, if some shapes are not included.
13066 theGroup is a GEOM group from which the sub-shapes are removed.
13067 theSubShapes is a list of sub-shapes to be removed.
13069 # Example: see GEOM_TestOthers.py
13070 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13071 RaiseIfFailed("DifferenceList", self.GroupOp)
13074 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13075 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13076 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13078 # @ref swig_DifferenceIDs "Example"
13079 @ManageTransactions("GroupOp")
13080 def DifferenceIDs(self,theGroup, theSubShapes):
13082 Removes from the group all the given shapes. No errors, if some shapes are not included.
13085 theGroup is a GEOM group from which the sub-shapes are removed.
13086 theSubShapes is a list of indices of sub-shapes to be removed.
13088 # Example: see GEOM_TestOthers.py
13089 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13090 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13093 ## Union of two groups.
13094 # New group is created. It will contain all entities
13095 # which are present in groups theGroup1 and theGroup2.
13096 # @param theGroup1, theGroup2 are the initial GEOM groups
13097 # to create the united group from.
13098 # @param theName Object name; when specified, this parameter is used
13099 # for result publication in the study. Otherwise, if automatic
13100 # publication is switched on, default value is used for result name.
13102 # @return a newly created GEOM group.
13104 # @ref tui_union_groups_anchor "Example"
13105 @ManageTransactions("GroupOp")
13106 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13108 Union of two groups.
13109 New group is created. It will contain all entities
13110 which are present in groups theGroup1 and theGroup2.
13113 theGroup1, theGroup2 are the initial GEOM groups
13114 to create the united group from.
13115 theName Object name; when specified, this parameter is used
13116 for result publication in the study. Otherwise, if automatic
13117 publication is switched on, default value is used for result name.
13120 a newly created GEOM group.
13122 # Example: see GEOM_TestOthers.py
13123 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13124 RaiseIfFailed("UnionGroups", self.GroupOp)
13125 self._autoPublish(aGroup, theName, "group")
13128 ## Intersection of two groups.
13129 # New group is created. It will contain only those entities
13130 # which are present in both groups theGroup1 and theGroup2.
13131 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13132 # @param theName Object name; when specified, this parameter is used
13133 # for result publication in the study. Otherwise, if automatic
13134 # publication is switched on, default value is used for result name.
13136 # @return a newly created GEOM group.
13138 # @ref tui_intersect_groups_anchor "Example"
13139 @ManageTransactions("GroupOp")
13140 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13142 Intersection of two groups.
13143 New group is created. It will contain only those entities
13144 which are present in both groups theGroup1 and theGroup2.
13147 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13148 theName Object name; when specified, this parameter is used
13149 for result publication in the study. Otherwise, if automatic
13150 publication is switched on, default value is used for result name.
13153 a newly created GEOM group.
13155 # Example: see GEOM_TestOthers.py
13156 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13157 RaiseIfFailed("IntersectGroups", self.GroupOp)
13158 self._autoPublish(aGroup, theName, "group")
13161 ## Cut of two groups.
13162 # New group is created. It will contain entities which are
13163 # present in group theGroup1 but are not present in group theGroup2.
13164 # @param theGroup1 is a GEOM group to include elements of.
13165 # @param theGroup2 is a GEOM group to exclude elements of.
13166 # @param theName Object name; when specified, this parameter is used
13167 # for result publication in the study. Otherwise, if automatic
13168 # publication is switched on, default value is used for result name.
13170 # @return a newly created GEOM group.
13172 # @ref tui_cut_groups_anchor "Example"
13173 @ManageTransactions("GroupOp")
13174 def CutGroups (self, theGroup1, theGroup2, theName=None):
13177 New group is created. It will contain entities which are
13178 present in group theGroup1 but are not present in group theGroup2.
13181 theGroup1 is a GEOM group to include elements of.
13182 theGroup2 is a GEOM group to exclude elements of.
13183 theName Object name; when specified, this parameter is used
13184 for result publication in the study. Otherwise, if automatic
13185 publication is switched on, default value is used for result name.
13188 a newly created GEOM group.
13190 # Example: see GEOM_TestOthers.py
13191 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13192 RaiseIfFailed("CutGroups", self.GroupOp)
13193 self._autoPublish(aGroup, theName, "group")
13196 ## Union of list of groups.
13197 # New group is created. It will contain all entities that are
13198 # present in groups listed in theGList.
13199 # @param theGList is a list of GEOM groups to create the united group from.
13200 # @param theName Object name; when specified, this parameter is used
13201 # for result publication in the study. Otherwise, if automatic
13202 # publication is switched on, default value is used for result name.
13204 # @return a newly created GEOM group.
13206 # @ref tui_union_groups_anchor "Example"
13207 @ManageTransactions("GroupOp")
13208 def UnionListOfGroups (self, theGList, theName=None):
13210 Union of list of groups.
13211 New group is created. It will contain all entities that are
13212 present in groups listed in theGList.
13215 theGList is a list of GEOM groups to create the united group from.
13216 theName Object name; when specified, this parameter is used
13217 for result publication in the study. Otherwise, if automatic
13218 publication is switched on, default value is used for result name.
13221 a newly created GEOM group.
13223 # Example: see GEOM_TestOthers.py
13224 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13225 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13226 self._autoPublish(aGroup, theName, "group")
13229 ## Cut of lists of groups.
13230 # New group is created. It will contain only entities
13231 # which are present in groups listed in theGList.
13232 # @param theGList is a list of GEOM groups to include elements of.
13233 # @param theName Object name; when specified, this parameter is used
13234 # for result publication in the study. Otherwise, if automatic
13235 # publication is switched on, default value is used for result name.
13237 # @return a newly created GEOM group.
13239 # @ref tui_intersect_groups_anchor "Example"
13240 @ManageTransactions("GroupOp")
13241 def IntersectListOfGroups (self, theGList, theName=None):
13243 Cut of lists of groups.
13244 New group is created. It will contain only entities
13245 which are present in groups listed in theGList.
13248 theGList is a list of GEOM groups to include elements of.
13249 theName Object name; when specified, this parameter is used
13250 for result publication in the study. Otherwise, if automatic
13251 publication is switched on, default value is used for result name.
13254 a newly created GEOM group.
13256 # Example: see GEOM_TestOthers.py
13257 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13258 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13259 self._autoPublish(aGroup, theName, "group")
13262 ## Cut of lists of groups.
13263 # New group is created. It will contain only entities
13264 # which are present in groups listed in theGList1 but
13265 # are not present in groups from theGList2.
13266 # @param theGList1 is a list of GEOM groups to include elements of.
13267 # @param theGList2 is a list of GEOM groups to exclude elements of.
13268 # @param theName Object name; when specified, this parameter is used
13269 # for result publication in the study. Otherwise, if automatic
13270 # publication is switched on, default value is used for result name.
13272 # @return a newly created GEOM group.
13274 # @ref tui_cut_groups_anchor "Example"
13275 @ManageTransactions("GroupOp")
13276 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13278 Cut of lists of groups.
13279 New group is created. It will contain only entities
13280 which are present in groups listed in theGList1 but
13281 are not present in groups from theGList2.
13284 theGList1 is a list of GEOM groups to include elements of.
13285 theGList2 is a list of GEOM groups to exclude elements of.
13286 theName Object name; when specified, this parameter is used
13287 for result publication in the study. Otherwise, if automatic
13288 publication is switched on, default value is used for result name.
13291 a newly created GEOM group.
13293 # Example: see GEOM_TestOthers.py
13294 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13295 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13296 self._autoPublish(aGroup, theName, "group")
13299 ## Returns a list of sub-objects ID stored in the group
13300 # @param theGroup is a GEOM group for which a list of IDs is requested
13302 # @ref swig_GetObjectIDs "Example"
13303 @ManageTransactions("GroupOp")
13304 def GetObjectIDs(self,theGroup):
13306 Returns a list of sub-objects ID stored in the group
13309 theGroup is a GEOM group for which a list of IDs is requested
13311 # Example: see GEOM_TestOthers.py
13312 ListIDs = self.GroupOp.GetObjects(theGroup)
13313 RaiseIfFailed("GetObjects", self.GroupOp)
13316 ## Returns a type of sub-objects stored in the group
13317 # @param theGroup is a GEOM group which type is returned.
13319 # @ref swig_GetType "Example"
13320 @ManageTransactions("GroupOp")
13321 def GetType(self,theGroup):
13323 Returns a type of sub-objects stored in the group
13326 theGroup is a GEOM group which type is returned.
13328 # Example: see GEOM_TestOthers.py
13329 aType = self.GroupOp.GetType(theGroup)
13330 RaiseIfFailed("GetType", self.GroupOp)
13333 ## Convert a type of geom object from id to string value
13334 # @param theId is a GEOM object type id.
13335 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13336 # @ref swig_GetType "Example"
13337 def ShapeIdToType(self, theId):
13339 Convert a type of geom object from id to string value
13342 theId is a GEOM object type id.
13345 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13372 return "REVOLUTION"
13420 return "FREE_BOUNDS"
13428 return "THRUSECTIONS"
13430 return "COMPOUNDFILTER"
13432 return "SHAPES_ON_SHAPE"
13434 return "ELLIPSE_ARC"
13436 return "3DSKETCHER"
13442 return "PIPETSHAPE"
13443 return "Shape Id not exist."
13445 ## Returns a main shape associated with the group
13446 # @param theGroup is a GEOM group for which a main shape object is requested
13447 # @return a GEOM object which is a main shape for theGroup
13449 # @ref swig_GetMainShape "Example"
13450 @ManageTransactions("GroupOp")
13451 def GetMainShape(self,theGroup):
13453 Returns a main shape associated with the group
13456 theGroup is a GEOM group for which a main shape object is requested
13459 a GEOM object which is a main shape for theGroup
13461 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13463 # Example: see GEOM_TestOthers.py
13464 anObj = self.GroupOp.GetMainShape(theGroup)
13465 RaiseIfFailed("GetMainShape", self.GroupOp)
13468 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13469 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13470 # @param theShape given shape (see GEOM.GEOM_Object)
13471 # @param min_length minimum length of edges of theShape
13472 # @param max_length maximum length of edges of theShape
13473 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13474 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13475 # @param theName Object name; when specified, this parameter is used
13476 # for result publication in the study. Otherwise, if automatic
13477 # publication is switched on, default value is used for result name.
13479 # @return a newly created GEOM group of edges
13481 # @@ref swig_todo "Example"
13482 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13484 Create group of edges of theShape, whose length is in range [min_length, max_length].
13485 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13488 theShape given shape
13489 min_length minimum length of edges of theShape
13490 max_length maximum length of edges of theShape
13491 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13492 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13493 theName Object name; when specified, this parameter is used
13494 for result publication in the study. Otherwise, if automatic
13495 publication is switched on, default value is used for result name.
13498 a newly created GEOM group of edges.
13500 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13501 edges_in_range = []
13503 Props = self.BasicProperties(edge)
13504 if min_length <= Props[0] and Props[0] <= max_length:
13505 if (not include_min) and (min_length == Props[0]):
13508 if (not include_max) and (Props[0] == max_length):
13511 edges_in_range.append(edge)
13513 if len(edges_in_range) <= 0:
13514 print("No edges found by given criteria")
13517 # note: auto-publishing is done in self.CreateGroup()
13518 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13519 self.UnionList(group_edges, edges_in_range)
13523 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13524 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13525 # @param min_length minimum length of edges of selected shape
13526 # @param max_length maximum length of edges of selected shape
13527 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13528 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13529 # @return a newly created GEOM group of edges
13530 # @ref swig_todo "Example"
13531 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13533 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13534 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13537 min_length minimum length of edges of selected shape
13538 max_length maximum length of edges of selected shape
13539 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13540 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13543 a newly created GEOM group of edges.
13545 nb_selected = sg.SelectedCount()
13546 if nb_selected < 1:
13547 print("Select a shape before calling this function, please.")
13549 if nb_selected > 1:
13550 print("Only one shape must be selected")
13553 id_shape = sg.getSelected(0)
13554 shape = IDToObject( id_shape )
13556 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13560 if include_min: left_str = " <= "
13561 if include_max: right_str = " <= "
13563 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13564 + left_str + "length" + right_str + repr(max_length))
13566 sg.updateObjBrowser()
13573 #@@ insert new functions before this line @@ do not remove this line @@#
13575 ## Create a copy of the given object
13577 # @param theOriginal geometry object for copy
13578 # @param theName Object name; when specified, this parameter is used
13579 # for result publication in the study. Otherwise, if automatic
13580 # publication is switched on, default value is used for result name.
13582 # @return New GEOM_Object, containing the copied shape.
13584 # @ingroup l1_geomBuilder_auxiliary
13585 # @ref swig_MakeCopy "Example"
13586 @ManageTransactions("InsertOp")
13587 def MakeCopy(self, theOriginal, theName=None):
13589 Create a copy of the given object
13592 theOriginal geometry object for copy
13593 theName Object name; when specified, this parameter is used
13594 for result publication in the study. Otherwise, if automatic
13595 publication is switched on, default value is used for result name.
13598 New GEOM_Object, containing the copied shape.
13600 Example of usage: Copy = geompy.MakeCopy(Box)
13602 # Example: see GEOM_TestAll.py
13603 anObj = self.InsertOp.MakeCopy(theOriginal)
13604 RaiseIfFailed("MakeCopy", self.InsertOp)
13605 self._autoPublish(anObj, theName, "copy")
13608 ## Add Path to load python scripts from
13609 # @param Path a path to load python scripts from
13610 # @ingroup l1_geomBuilder_auxiliary
13611 def addPath(self,Path):
13613 Add Path to load python scripts from
13616 Path a path to load python scripts from
13618 if (sys.path.count(Path) < 1):
13619 sys.path.append(Path)
13623 ## Load marker texture from the file
13624 # @param Path a path to the texture file
13625 # @return unique texture identifier
13626 # @ingroup l1_geomBuilder_auxiliary
13627 @ManageTransactions("InsertOp")
13628 def LoadTexture(self, Path):
13630 Load marker texture from the file
13633 Path a path to the texture file
13636 unique texture identifier
13638 # Example: see GEOM_TestAll.py
13639 ID = self.InsertOp.LoadTexture(Path)
13640 RaiseIfFailed("LoadTexture", self.InsertOp)
13643 ## Get internal name of the object based on its study entry
13644 # @note This method does not provide an unique identifier of the geometry object.
13645 # @note This is internal function of GEOM component, though it can be used outside it for
13646 # appropriate reason (e.g. for identification of geometry object).
13647 # @param obj geometry object
13648 # @return unique object identifier
13649 # @ingroup l1_geomBuilder_auxiliary
13650 def getObjectID(self, obj):
13652 Get internal name of the object based on its study entry.
13653 Note: this method does not provide an unique identifier of the geometry object.
13654 It is an internal function of GEOM component, though it can be used outside GEOM for
13655 appropriate reason (e.g. for identification of geometry object).
13658 obj geometry object
13661 unique object identifier
13664 entry = salome.ObjectToID(obj)
13665 if entry is not None:
13666 lst = entry.split(":")
13668 ID = lst[-1] # -1 means last item in the list
13669 return "GEOM_" + ID
13674 ## Add marker texture. @a Width and @a Height parameters
13675 # specify width and height of the texture in pixels.
13676 # If @a RowData is @c True, @a Texture parameter should represent texture data
13677 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13678 # parameter should be unpacked string, in which '1' symbols represent opaque
13679 # pixels and '0' represent transparent pixels of the texture bitmap.
13681 # @param Width texture width in pixels
13682 # @param Height texture height in pixels
13683 # @param Texture texture data
13684 # @param RowData if @c True, @a Texture data are packed in the byte stream
13685 # @return unique texture identifier
13686 # @ingroup l1_geomBuilder_auxiliary
13687 @ManageTransactions("InsertOp")
13688 def AddTexture(self, Width, Height, Texture, RowData=False):
13690 Add marker texture. Width and Height parameters
13691 specify width and height of the texture in pixels.
13692 If RowData is True, Texture parameter should represent texture data
13693 packed into the byte array. If RowData is False (default), Texture
13694 parameter should be unpacked string, in which '1' symbols represent opaque
13695 pixels and '0' represent transparent pixels of the texture bitmap.
13698 Width texture width in pixels
13699 Height texture height in pixels
13700 Texture texture data
13701 RowData if True, Texture data are packed in the byte stream
13704 return unique texture identifier
13706 if not RowData: Texture = PackData(Texture)
13707 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13708 RaiseIfFailed("AddTexture", self.InsertOp)
13711 ## Transfer not topological data from one GEOM object to another.
13713 # @param theObjectFrom the source object of non-topological data
13714 # @param theObjectTo the destination object of non-topological data
13715 # @param theFindMethod method to search sub-shapes of theObjectFrom
13716 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13717 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13718 # Other values of GEOM.find_shape_method are not supported.
13720 # @return True in case of success; False otherwise.
13722 # @ingroup l1_geomBuilder_auxiliary
13724 # @ref swig_TransferData "Example"
13725 @ManageTransactions("InsertOp")
13726 def TransferData(self, theObjectFrom, theObjectTo,
13727 theFindMethod=GEOM.FSM_GetInPlace):
13729 Transfer not topological data from one GEOM object to another.
13732 theObjectFrom the source object of non-topological data
13733 theObjectTo the destination object of non-topological data
13734 theFindMethod method to search sub-shapes of theObjectFrom
13735 in shape theObjectTo. Possible values are:
13736 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13737 and GEOM.FSM_GetInPlace_Old. Other values of
13738 GEOM.find_shape_method are not supported.
13741 True in case of success; False otherwise.
13743 # Example: see GEOM_TestOthers.py
13745 # Example: see GEOM_TestAll.py
13746 isOk = self.InsertOp.TransferData(theObjectFrom,
13747 theObjectTo, theFindMethod)
13748 RaiseIfFailed("TransferData", self.InsertOp)
13751 ## Creates a new folder object. It is a container for any GEOM objects.
13752 # @param Name name of the container
13753 # @param Father parent object. If None,
13754 # folder under 'Geometry' root object will be created.
13755 # @return a new created folder
13756 # @ingroup l1_publish_data
13757 def NewFolder(self, Name, Father=None):
13759 Create a new folder object. It is an auxiliary container for any GEOM objects.
13762 Name name of the container
13763 Father parent object. If None,
13764 folder under 'Geometry' root object will be created.
13767 a new created folder
13769 if not Father: Father = self.father
13770 return self.CreateFolder(Name, Father)
13772 ## Move object to the specified folder
13773 # @param Object object to move
13774 # @param Folder target folder
13775 # @ingroup l1_publish_data
13776 def PutToFolder(self, Object, Folder):
13778 Move object to the specified folder
13781 Object object to move
13782 Folder target folder
13784 self.MoveToFolder(Object, Folder)
13787 ## Move list of objects to the specified folder
13788 # @param ListOfSO list of objects to move
13789 # @param Folder target folder
13790 # @ingroup l1_publish_data
13791 def PutListToFolder(self, ListOfSO, Folder):
13793 Move list of objects to the specified folder
13796 ListOfSO list of objects to move
13797 Folder target folder
13799 self.MoveListToFolder(ListOfSO, Folder)
13802 ## @addtogroup l2_field
13806 # @param shape the shape the field lies on
13807 # @param name the field name
13808 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13809 # @param dimension dimension of the shape the field lies on
13810 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13811 # @param componentNames names of components
13812 # @return a created field
13813 @ManageTransactions("FieldOp")
13814 def CreateField(self, shape, name, type, dimension, componentNames):
13819 shape the shape the field lies on
13820 name the field name
13821 type type of field data
13822 dimension dimension of the shape the field lies on
13823 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13824 componentNames names of components
13829 if isinstance( type, int ):
13830 if type < 0 or type > 3:
13831 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13832 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13834 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13835 RaiseIfFailed("CreateField", self.FieldOp)
13837 geom._autoPublish( f, "", name)
13840 ## Removes a field from the GEOM component
13841 # @param field the field to remove
13842 def RemoveField(self, field):
13843 "Removes a field from the GEOM component"
13845 if isinstance( field, GEOM._objref_GEOM_Field ):
13846 geom.RemoveObject( field )
13847 elif isinstance( field, geomField ):
13848 geom.RemoveObject( field.field )
13850 raise RuntimeError("RemoveField() : the object is not a field")
13853 ## Returns number of fields on a shape
13854 @ManageTransactions("FieldOp")
13855 def CountFields(self, shape):
13856 "Returns number of fields on a shape"
13857 nb = self.FieldOp.CountFields( shape )
13858 RaiseIfFailed("CountFields", self.FieldOp)
13861 ## Returns all fields on a shape
13862 @ManageTransactions("FieldOp")
13863 def GetFields(self, shape):
13864 "Returns all fields on a shape"
13865 ff = self.FieldOp.GetFields( shape )
13866 RaiseIfFailed("GetFields", self.FieldOp)
13869 ## Returns a field on a shape by its name
13870 @ManageTransactions("FieldOp")
13871 def GetField(self, shape, name):
13872 "Returns a field on a shape by its name"
13873 f = self.FieldOp.GetField( shape, name )
13874 RaiseIfFailed("GetField", self.FieldOp)
13881 # Register the new proxy for GEOM_Gen
13882 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13885 ## Field on Geometry
13886 # @ingroup l2_field
13887 class geomField( GEOM._objref_GEOM_Field ):
13889 def __init__(self, *args):
13890 GEOM._objref_GEOM_Field.__init__(self, *args)
13891 self.field = GEOM._objref_GEOM_Field
13894 ## Returns the shape the field lies on
13895 def getShape(self):
13896 "Returns the shape the field lies on"
13897 return self.field.GetShape(self)
13899 ## Returns the field name
13901 "Returns the field name"
13902 return self.field.GetName(self)
13904 ## Returns type of field data as integer [0-3]
13906 "Returns type of field data"
13907 return EnumToLong(self.field.GetDataType(self))
13909 ## Returns type of field data:
13910 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13911 def getTypeEnum(self):
13912 "Returns type of field data"
13913 return self.field.GetDataType(self)
13915 ## Returns dimension of the shape the field lies on:
13916 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13917 def getDimension(self):
13918 """Returns dimension of the shape the field lies on:
13919 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13920 return self.field.GetDimension(self)
13922 ## Returns names of components
13923 def getComponents(self):
13924 "Returns names of components"
13925 return self.field.GetComponents(self)
13927 ## Adds a time step to the field
13928 # @param step the time step number further used as the step identifier
13929 # @param stamp the time step time
13930 # @param values the values of the time step
13931 def addStep(self, step, stamp, values):
13932 "Adds a time step to the field"
13933 stp = self.field.AddStep( self, step, stamp )
13935 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
13937 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13938 self.setValues( step, values )
13941 ## Remove a time step from the field
13942 def removeStep(self,step):
13943 "Remove a time step from the field"
13946 stepObj = self.field.GetStep( self, step )
13948 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13951 #traceback.print_exc()
13953 self.field.RemoveStep( self, step )
13955 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13958 ## Returns number of time steps in the field
13959 def countSteps(self):
13960 "Returns number of time steps in the field"
13961 return self.field.CountSteps(self)
13963 ## Returns a list of time step IDs in the field
13964 def getSteps(self):
13965 "Returns a list of time step IDs in the field"
13966 return self.field.GetSteps(self)
13968 ## Returns a time step by its ID
13969 def getStep(self,step):
13970 "Returns a time step by its ID"
13971 stp = self.field.GetStep(self, step)
13973 raise RuntimeError("Step %s is missing from this field"%step)
13976 ## Returns the time of the field step
13977 def getStamp(self,step):
13978 "Returns the time of the field step"
13979 return self.getStep(step).GetStamp()
13981 ## Changes the time of the field step
13982 def setStamp(self, step, stamp):
13983 "Changes the time of the field step"
13984 return self.getStep(step).SetStamp(stamp)
13986 ## Returns values of the field step
13987 def getValues(self, step):
13988 "Returns values of the field step"
13989 return self.getStep(step).GetValues()
13991 ## Changes values of the field step
13992 def setValues(self, step, values):
13993 "Changes values of the field step"
13994 stp = self.getStep(step)
13995 errBeg = "Field.setValues(values) : Error: "
13997 ok = stp.SetValues( values )
13998 except Exception as e:
14000 if excStr.find("WrongPythonType") > 0:
14001 raise RuntimeError(errBeg +\
14002 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14003 raise RuntimeError(errBeg + str(e))
14005 nbOK = self.field.GetArraySize(self)
14008 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14010 raise RuntimeError(errBeg + "failed")
14013 pass # end of class geomField
14015 # Register the new proxy for GEOM_Field
14016 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14019 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14020 # interface to GEOM operations.
14025 # salome.salome_init()
14026 # from salome.geom import geomBuilder
14027 # geompy = geomBuilder.New()
14029 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14030 # @return geomBuilder instance
14031 def New( instance=None):
14033 Create a new geomBuilder instance.The geomBuilder class provides the Python
14034 interface to GEOM operations.
14038 salome.salome_init()
14039 from salome.geom import geomBuilder
14040 geompy = geomBuilder.New()
14043 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14045 geomBuilder instance
14047 #print "New geomBuilder ", study, instance
14054 geom = geomBuilder()
14055 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14060 # Register methods from the plug-ins in the geomBuilder class
14061 plugins_var = os.environ.get( "GEOM_PluginsList" )
14064 if plugins_var is not None:
14065 plugins = plugins_var.split( ":" )
14066 plugins=[x for x in plugins if len(x)>0]
14067 if plugins is not None:
14068 for pluginName in plugins:
14069 pluginBuilderName = pluginName + "Builder"
14071 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14072 except Exception as e:
14073 from salome_utils import verbose
14074 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14076 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14077 plugin = eval( pluginBuilderName )
14079 # add methods from plugin module to the geomBuilder class
14080 for k in dir( plugin ):
14081 if k[0] == '_': continue
14082 method = getattr( plugin, k )
14083 if type( method ).__name__ == 'function':
14084 if not hasattr( geomBuilder, k ):
14085 setattr( geomBuilder, k, method )