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 containes all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New()
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 # usefull 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 usefull 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 # usefull 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 usefull 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 parrallel 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 parrallel 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 occured. 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 occured. 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 recieve 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 recieve 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 beetween 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 beetween 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 theTopRigthPoint Point, specifying top right corner of a quadrangle
5675 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5676 # @param theBottomRigthPoint 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, theTopRigthPoint,
5688 theBottomLeftPoint, theBottomRigthPoint, 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 theTopRigthPoint Point, specifying top right corner of a quadrangle
5698 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5699 theBottomRigthPoint 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, theTopRigthPoint,
5711 theBottomLeftPoint, theBottomRigthPoint, 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 theTopRigthPoint Point, specifying top right corner of a quadrangle
5722 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5723 # @param theBottomRigthPoint 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, theTopRigthPoint,
5732 theBottomLeftPoint, theBottomRigthPoint, 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 theTopRigthPoint Point, specifying top right corner of a quadrangle
5742 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5743 theBottomRigthPoint 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, theTopRigthPoint,
5753 theBottomLeftPoint, theBottomRigthPoint, 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) occured 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) occured 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 sence,
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 sence, 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)
9311 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
9312 RaiseIfFailed("Offset", self.TrsfOp)
9313 anObj.SetParameters(Parameters)
9316 ## Create new object as offset of the given one.
9317 # @param theObject The base object for the offset.
9318 # @param theOffset Offset value.
9319 # @param theName Object name; when specified, this parameter is used
9320 # for result publication in the study. Otherwise, if automatic
9321 # publication is switched on, default value is used for result name.
9323 # @return New GEOM.GEOM_Object, containing the offset object.
9325 # @ref tui_offset "Example"
9326 @ManageTransactions("TrsfOp")
9327 def MakeOffset(self, theObject, theOffset, theName=None):
9329 Create new object as offset of the given one.
9332 theObject The base object for the offset.
9333 theOffset Offset value.
9334 theName Object name; when specified, this parameter is used
9335 for result publication in the study. Otherwise, if automatic
9336 publication is switched on, default value is used for result name.
9339 New GEOM.GEOM_Object, containing the offset object.
9342 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9343 # create a new object as offset of the given object
9344 offset = geompy.MakeOffset(box, 70.)
9346 # Example: see GEOM_TestAll.py
9347 theOffset, Parameters = ParseParameters(theOffset)
9348 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
9349 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9350 anObj.SetParameters(Parameters)
9351 self._autoPublish(anObj, theName, "offset")
9354 ## Create new object as projection of the given one on another.
9355 # @param theSource The source object for the projection. It can be a point, edge or wire.
9356 # Edge and wire are acceptable if @a theTarget is a face.
9357 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9358 # @param theName Object name; when specified, this parameter is used
9359 # for result publication in the study. Otherwise, if automatic
9360 # publication is switched on, default value is used for result name.
9362 # @return New GEOM.GEOM_Object, containing the projection.
9364 # @ref tui_projection "Example"
9365 @ManageTransactions("TrsfOp")
9366 def MakeProjection(self, theSource, theTarget, theName=None):
9368 Create new object as projection of the given one on another.
9371 theSource The source object for the projection. It can be a point, edge or wire.
9372 Edge and wire are acceptable if theTarget is a face.
9373 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9374 theName Object name; when specified, this parameter is used
9375 for result publication in the study. Otherwise, if automatic
9376 publication is switched on, default value is used for result name.
9379 New GEOM.GEOM_Object, containing the projection.
9381 # Example: see GEOM_TestAll.py
9382 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9383 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9384 self._autoPublish(anObj, theName, "projection")
9387 ## Create a projection of the given point on a wire or an edge.
9388 # If there are no solutions or there are 2 or more solutions It throws an
9390 # @param thePoint the point to be projected.
9391 # @param theWire the wire. The edge is accepted as well.
9392 # @param theName Object name; when specified, this parameter is used
9393 # for result publication in the study. Otherwise, if automatic
9394 # publication is switched on, default value is used for result name.
9396 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9397 # \n \a u: The parameter of projection point on edge.
9398 # \n \a PointOnEdge: The projection point.
9399 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9401 # @ref tui_projection "Example"
9402 @ManageTransactions("TrsfOp")
9403 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9405 Create a projection of the given point on a wire or an edge.
9406 If there are no solutions or there are 2 or more solutions It throws an
9410 thePoint the point to be projected.
9411 theWire the wire. The edge is accepted as well.
9412 theName Object name; when specified, this parameter is used
9413 for result publication in the study. Otherwise, if automatic
9414 publication is switched on, default value is used for result name.
9417 [u, PointOnEdge, EdgeInWireIndex]
9418 u: The parameter of projection point on edge.
9419 PointOnEdge: The projection point.
9420 EdgeInWireIndex: The index of an edge in a wire.
9422 # Example: see GEOM_TestAll.py
9423 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9424 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9425 self._autoPublish(anObj[1], theName, "projection")
9428 # -----------------------------------------------------------------------------
9430 # -----------------------------------------------------------------------------
9432 ## Translate the given object along the given vector a given number times
9433 # @param theObject The object to be translated.
9434 # @param theVector Direction of the translation. DX if None.
9435 # @param theStep Distance to translate on.
9436 # @param theNbTimes Quantity of translations to be done.
9437 # @param theName Object name; when specified, this parameter is used
9438 # for result publication in the study. Otherwise, if automatic
9439 # publication is switched on, default value is used for result name.
9441 # @return New GEOM.GEOM_Object, containing compound of all
9442 # the shapes, obtained after each translation.
9444 # @ref tui_multi_translation "Example"
9445 @ManageTransactions("TrsfOp")
9446 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9448 Translate the given object along the given vector a given number times
9451 theObject The object to be translated.
9452 theVector Direction of the translation. DX if None.
9453 theStep Distance to translate on.
9454 theNbTimes Quantity of translations to be done.
9455 theName Object name; when specified, this parameter is used
9456 for result publication in the study. Otherwise, if automatic
9457 publication is switched on, default value is used for result name.
9460 New GEOM.GEOM_Object, containing compound of all
9461 the shapes, obtained after each translation.
9464 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9466 # Example: see GEOM_TestAll.py
9467 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9468 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9469 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9470 anObj.SetParameters(Parameters)
9471 self._autoPublish(anObj, theName, "multitranslation")
9474 ## Conseqently apply two specified translations to theObject specified number of times.
9475 # @param theObject The object to be translated.
9476 # @param theVector1 Direction of the first translation. DX if None.
9477 # @param theStep1 Step of the first translation.
9478 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9479 # @param theVector2 Direction of the second translation. DY if None.
9480 # @param theStep2 Step of the second translation.
9481 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9482 # @param theName Object name; when specified, this parameter is used
9483 # for result publication in the study. Otherwise, if automatic
9484 # publication is switched on, default value is used for result name.
9486 # @return New GEOM.GEOM_Object, containing compound of all
9487 # the shapes, obtained after each translation.
9489 # @ref tui_multi_translation "Example"
9490 @ManageTransactions("TrsfOp")
9491 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9492 theVector2, theStep2, theNbTimes2, theName=None):
9494 Conseqently apply two specified translations to theObject specified number of times.
9497 theObject The object to be translated.
9498 theVector1 Direction of the first translation. DX if None.
9499 theStep1 Step of the first translation.
9500 theNbTimes1 Quantity of translations to be done along theVector1.
9501 theVector2 Direction of the second translation. DY if None.
9502 theStep2 Step of the second translation.
9503 theNbTimes2 Quantity of translations to be done along theVector2.
9504 theName Object name; when specified, this parameter is used
9505 for result publication in the study. Otherwise, if automatic
9506 publication is switched on, default value is used for result name.
9509 New GEOM.GEOM_Object, containing compound of all
9510 the shapes, obtained after each translation.
9513 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9515 # Example: see GEOM_TestAll.py
9516 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9517 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9518 theVector2, theStep2, theNbTimes2)
9519 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9520 anObj.SetParameters(Parameters)
9521 self._autoPublish(anObj, theName, "multitranslation")
9524 ## Rotate the given object around the given axis a given number times.
9525 # Rotation angle will be 2*PI/theNbTimes.
9526 # @param theObject The object to be rotated.
9527 # @param theAxis The rotation axis. DZ if None.
9528 # @param theNbTimes Quantity of rotations to be done.
9529 # @param theName Object name; when specified, this parameter is used
9530 # for result publication in the study. Otherwise, if automatic
9531 # publication is switched on, default value is used for result name.
9533 # @return New GEOM.GEOM_Object, containing compound of all the
9534 # shapes, obtained after each rotation.
9536 # @ref tui_multi_rotation "Example"
9537 @ManageTransactions("TrsfOp")
9538 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9540 Rotate the given object around the given axis a given number times.
9541 Rotation angle will be 2*PI/theNbTimes.
9544 theObject The object to be rotated.
9545 theAxis The rotation axis. DZ if None.
9546 theNbTimes Quantity of rotations to be done.
9547 theName Object name; when specified, this parameter is used
9548 for result publication in the study. Otherwise, if automatic
9549 publication is switched on, default value is used for result name.
9552 New GEOM.GEOM_Object, containing compound of all the
9553 shapes, obtained after each rotation.
9556 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9558 # Example: see GEOM_TestAll.py
9559 theNbTimes, Parameters = ParseParameters(theNbTimes)
9560 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9561 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9562 anObj.SetParameters(Parameters)
9563 self._autoPublish(anObj, theName, "multirotation")
9566 ## Rotate the given object around the given axis
9567 # a given number times on the given angle.
9568 # @param theObject The object to be rotated.
9569 # @param theAxis The rotation axis. DZ if None.
9570 # @param theAngleStep Rotation angle in radians.
9571 # @param theNbTimes Quantity of rotations to be done.
9572 # @param theName Object name; when specified, this parameter is used
9573 # for result publication in the study. Otherwise, if automatic
9574 # publication is switched on, default value is used for result name.
9576 # @return New GEOM.GEOM_Object, containing compound of all the
9577 # shapes, obtained after each rotation.
9579 # @ref tui_multi_rotation "Example"
9580 @ManageTransactions("TrsfOp")
9581 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9583 Rotate the given object around the given axis
9584 a given number times on the given angle.
9587 theObject The object to be rotated.
9588 theAxis The rotation axis. DZ if None.
9589 theAngleStep Rotation angle in radians.
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.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9602 # Example: see GEOM_TestAll.py
9603 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9604 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9605 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9606 anObj.SetParameters(Parameters)
9607 self._autoPublish(anObj, theName, "multirotation")
9610 ## Rotate the given object around the given axis a given
9611 # number times and multi-translate each rotation result.
9612 # Rotation angle will be 2*PI/theNbTimes1.
9613 # Translation direction passes through center of gravity
9614 # of rotated shape and its projection on the rotation axis.
9615 # @param theObject The object to be rotated.
9616 # @param theAxis Rotation axis. DZ if None.
9617 # @param theNbTimes1 Quantity of rotations to be done.
9618 # @param theRadialStep Translation distance.
9619 # @param theNbTimes2 Quantity of translations to be done.
9620 # @param theName Object name; when specified, this parameter is used
9621 # for result publication in the study. Otherwise, if automatic
9622 # publication is switched on, default value is used for result name.
9624 # @return New GEOM.GEOM_Object, containing compound of all the
9625 # shapes, obtained after each transformation.
9627 # @ref tui_multi_rotation "Example"
9628 @ManageTransactions("TrsfOp")
9629 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9631 Rotate the given object around the
9632 given axis on the given angle a given number
9633 times and multi-translate each rotation result.
9634 Translation direction passes through center of gravity
9635 of rotated shape and its projection on the rotation axis.
9638 theObject The object to be rotated.
9639 theAxis Rotation axis. DZ if None.
9640 theNbTimes1 Quantity of rotations to be done.
9641 theRadialStep Translation distance.
9642 theNbTimes2 Quantity of translations to be done.
9643 theName Object name; when specified, this parameter is used
9644 for result publication in the study. Otherwise, if automatic
9645 publication is switched on, default value is used for result name.
9648 New GEOM.GEOM_Object, containing compound of all the
9649 shapes, obtained after each transformation.
9652 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9654 # Example: see GEOM_TestAll.py
9655 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9656 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9657 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9658 anObj.SetParameters(Parameters)
9659 self._autoPublish(anObj, theName, "multirotation")
9662 ## Rotate the given object around the
9663 # given axis on the given angle a given number
9664 # times and multi-translate each rotation result.
9665 # Translation direction passes through center of gravity
9666 # of rotated shape and its projection on the rotation axis.
9667 # @param theObject The object to be rotated.
9668 # @param theAxis Rotation axis. DZ if None.
9669 # @param theAngleStep Rotation angle in radians.
9670 # @param theNbTimes1 Quantity of rotations to be done.
9671 # @param theRadialStep Translation distance.
9672 # @param theNbTimes2 Quantity of translations to be done.
9673 # @param theName Object name; when specified, this parameter is used
9674 # for result publication in the study. Otherwise, if automatic
9675 # publication is switched on, default value is used for result name.
9677 # @return New GEOM.GEOM_Object, containing compound of all the
9678 # shapes, obtained after each transformation.
9680 # @ref tui_multi_rotation "Example"
9681 @ManageTransactions("TrsfOp")
9682 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9684 Rotate the given object around the
9685 given axis on the given angle a given number
9686 times and multi-translate each rotation result.
9687 Translation direction passes through center of gravity
9688 of rotated shape and its projection on the rotation axis.
9691 theObject The object to be rotated.
9692 theAxis Rotation axis. DZ if None.
9693 theAngleStep Rotation angle in radians.
9694 theNbTimes1 Quantity of rotations to be done.
9695 theRadialStep Translation distance.
9696 theNbTimes2 Quantity of translations to be done.
9697 theName Object name; when specified, this parameter is used
9698 for result publication in the study. Otherwise, if automatic
9699 publication is switched on, default value is used for result name.
9702 New GEOM.GEOM_Object, containing compound of all the
9703 shapes, obtained after each transformation.
9706 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9708 # Example: see GEOM_TestAll.py
9709 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9710 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9711 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9712 anObj.SetParameters(Parameters)
9713 self._autoPublish(anObj, theName, "multirotation")
9716 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9718 # @ref swig_MakeMultiRotation "Example"
9719 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9721 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9724 pz = geompy.MakeVertex(0, 0, 100)
9725 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9726 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9728 # Example: see GEOM_TestOthers.py
9729 aVec = self.MakeLine(aPoint,aDir)
9730 # note: auto-publishing is done in self.MultiRotate1D()
9731 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9734 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9736 # @ref swig_MakeMultiRotation "Example"
9737 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9739 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9742 pz = geompy.MakeVertex(0, 0, 100)
9743 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9744 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9746 # Example: see GEOM_TestOthers.py
9747 aVec = self.MakeLine(aPoint,aDir)
9748 # note: auto-publishing is done in self.MultiRotate1D()
9749 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9752 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9754 # @ref swig_MakeMultiRotation "Example"
9755 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9757 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9760 pz = geompy.MakeVertex(0, 0, 100)
9761 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9762 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9764 # Example: see GEOM_TestOthers.py
9765 aVec = self.MakeLine(aPoint,aDir)
9766 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9767 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9770 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9772 # @ref swig_MakeMultiRotation "Example"
9773 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9775 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9778 pz = geompy.MakeVertex(0, 0, 100)
9779 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9780 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9782 # Example: see GEOM_TestOthers.py
9783 aVec = self.MakeLine(aPoint,aDir)
9784 # note: auto-publishing is done in self.MultiRotate2D()
9785 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9789 # Compute a wire or a face that represents a projection of the source
9790 # shape onto cylinder. The cylinder's coordinate system is the same
9791 # as the global coordinate system.
9793 # @param theObject The object to be projected. It can be either
9794 # a planar wire or a face.
9795 # @param theRadius The radius of the cylinder.
9796 # @param theStartAngle The starting angle in radians from
9797 # the cylinder's X axis around Z axis. The angle from which
9798 # the projection is started.
9799 # @param theAngleLength The projection length angle in radians.
9800 # The angle in which to project the total length of the wire.
9801 # If it is negative the projection is not scaled and natural
9802 # wire length is kept for the projection.
9803 # @param theAngleRotation The desired angle in radians between
9804 # the tangent vector to the first curve at the first point of
9805 # the theObject's projection in 2D space and U-direction of
9806 # cylinder's 2D space.
9807 # @param theName Object name; when specified, this parameter is used
9808 # for result publication in the study. Otherwise, if automatic
9809 # publication is switched on, default value is used for result name.
9811 # @return New GEOM.GEOM_Object, containing the result shape. The result
9812 # represents a wire or a face that represents a projection of
9813 # the source shape onto a cylinder.
9815 # @ref tui_projection "Example"
9816 def MakeProjectionOnCylinder (self, theObject, theRadius,
9817 theStartAngle=0.0, theAngleLength=-1.0,
9818 theAngleRotation=0.0,
9821 Compute a wire or a face that represents a projection of the source
9822 shape onto cylinder. The cylinder's coordinate system is the same
9823 as the global coordinate system.
9826 theObject The object to be projected. It can be either
9827 a planar wire or a face.
9828 theRadius The radius of the cylinder.
9829 theStartAngle The starting angle in radians from the cylinder's X axis
9830 around Z axis. The angle from which the projection is started.
9831 theAngleLength The projection length angle in radians. The angle in which
9832 to project the total length of the wire. If it is negative the
9833 projection is not scaled and natural wire length is kept for
9835 theAngleRotation The desired angle in radians between
9836 the tangent vector to the first curve at the first
9837 point of the theObject's projection in 2D space and
9838 U-direction of cylinder's 2D space.
9839 theName Object name; when specified, this parameter is used
9840 for result publication in the study. Otherwise, if automatic
9841 publication is switched on, default value is used for result name.
9844 New GEOM.GEOM_Object, containing the result shape. The result
9845 represents a wire or a face that represents a projection of
9846 the source shape onto a cylinder.
9848 # Example: see GEOM_TestAll.py
9849 flagStartAngle = False
9850 if isinstance(theStartAngle,str):
9851 flagStartAngle = True
9852 flagAngleLength = False
9853 if isinstance(theAngleLength,str):
9854 flagAngleLength = True
9855 flagAngleRotation = False
9856 if isinstance(theAngleRotation,str):
9857 flagAngleRotation = True
9858 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9859 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9861 theStartAngle = theStartAngle*math.pi/180.
9863 theAngleLength = theAngleLength*math.pi/180.
9864 if flagAngleRotation:
9865 theAngleRotation = theAngleRotation*math.pi/180.
9866 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9867 theStartAngle, theAngleLength, theAngleRotation)
9868 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9869 anObj.SetParameters(Parameters)
9870 self._autoPublish(anObj, theName, "projection")
9873 # end of l3_transform
9876 ## @addtogroup l3_transform_d
9879 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9880 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9882 Deprecated method. Use MultiRotate1DNbTimes instead.
9884 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9885 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9887 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9888 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9889 @ManageTransactions("TrsfOp")
9890 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9892 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9893 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9896 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9898 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9899 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9900 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9901 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9902 anObj.SetParameters(Parameters)
9903 self._autoPublish(anObj, theName, "multirotation")
9906 ## The same, as MultiRotate1D(), but axis is given by direction and point
9907 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9908 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9910 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9911 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9914 pz = geompy.MakeVertex(0, 0, 100)
9915 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9916 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9918 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9919 aVec = self.MakeLine(aPoint,aDir)
9920 # note: auto-publishing is done in self.MultiRotate1D()
9921 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9924 ## The same, as MultiRotate2D(), but axis is given by direction and point
9925 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9926 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9928 The same, as MultiRotate2D(), but axis is given by direction and point
9929 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9932 pz = geompy.MakeVertex(0, 0, 100)
9933 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9934 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9936 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
9937 aVec = self.MakeLine(aPoint,aDir)
9938 # note: auto-publishing is done in self.MultiRotate2D()
9939 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9942 # end of l3_transform_d
9945 ## @addtogroup l3_local
9948 ## Perform a fillet on all edges of the given shape.
9949 # @param theShape Shape, to perform fillet on.
9950 # @param theR Fillet radius.
9951 # @param theName Object name; when specified, this parameter is used
9952 # for result publication in the study. Otherwise, if automatic
9953 # publication is switched on, default value is used for result name.
9955 # @return New GEOM.GEOM_Object, containing the result shape.
9957 # @ref tui_fillet "Example 1"
9958 # \n @ref swig_MakeFilletAll "Example 2"
9959 @ManageTransactions("LocalOp")
9960 def MakeFilletAll(self, theShape, theR, theName=None):
9962 Perform a fillet on all edges of the given shape.
9965 theShape Shape, to perform fillet on.
9967 theName Object name; when specified, this parameter is used
9968 for result publication in the study. Otherwise, if automatic
9969 publication is switched on, default value is used for result name.
9972 New GEOM.GEOM_Object, containing the result shape.
9975 filletall = geompy.MakeFilletAll(prism, 10.)
9977 # Example: see GEOM_TestOthers.py
9978 theR,Parameters = ParseParameters(theR)
9979 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
9980 RaiseIfFailed("MakeFilletAll", self.LocalOp)
9981 anObj.SetParameters(Parameters)
9982 self._autoPublish(anObj, theName, "fillet")
9985 ## Perform a fillet on the specified edges/faces of the given shape
9986 # @param theShape Shape, to perform fillet on.
9987 # @param theR Fillet radius.
9988 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
9989 # @param theListShapes Global indices of edges/faces to perform fillet on.
9990 # @param theName Object name; when specified, this parameter is used
9991 # for result publication in the study. Otherwise, if automatic
9992 # publication is switched on, default value is used for result name.
9994 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
9996 # @return New GEOM.GEOM_Object, containing the result shape.
9998 # @ref tui_fillet "Example"
9999 @ManageTransactions("LocalOp")
10000 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10002 Perform a fillet on the specified edges/faces of the given shape
10005 theShape Shape, to perform fillet on.
10006 theR Fillet radius.
10007 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10008 theListShapes Global indices of edges/faces to perform fillet on.
10009 theName Object name; when specified, this parameter is used
10010 for result publication in the study. Otherwise, if automatic
10011 publication is switched on, default value is used for result name.
10014 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10017 New GEOM.GEOM_Object, containing the result shape.
10020 # get the list of IDs (IDList) for the fillet
10021 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10023 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10024 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10025 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10026 # make a fillet on the specified edges of the given shape
10027 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10029 # Example: see GEOM_TestAll.py
10030 theR,Parameters = ParseParameters(theR)
10032 if theShapeType == self.ShapeType["EDGE"]:
10033 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10034 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10036 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10037 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10038 anObj.SetParameters(Parameters)
10039 self._autoPublish(anObj, theName, "fillet")
10042 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10043 @ManageTransactions("LocalOp")
10044 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10046 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10049 # get the list of IDs (IDList) for the fillet
10050 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10052 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10053 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10054 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10055 # make a fillet on the specified edges of the given shape
10056 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10058 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10060 if theShapeType == self.ShapeType["EDGE"]:
10061 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10062 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10064 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10065 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10066 anObj.SetParameters(Parameters)
10067 self._autoPublish(anObj, theName, "fillet")
10070 ## Perform a fillet on the specified edges of the given shape
10071 # @param theShape Wire Shape to perform fillet on.
10072 # @param theR Fillet radius.
10073 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10074 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10075 # \note The list of vertices could be empty,
10076 # in this case fillet will done done at all vertices in wire
10077 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10078 # by the length of the edges, nearest to the fillet vertex.
10079 # But sometimes the next edge is C1 continuous with the one, nearest to
10080 # the fillet point, and such two (or more) edges can be united to allow
10081 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10082 # thus ignoring the secant vertex (vertices).
10083 # @param theName Object name; when specified, this parameter is used
10084 # for result publication in the study. Otherwise, if automatic
10085 # publication is switched on, default value is used for result name.
10087 # @return New GEOM.GEOM_Object, containing the result shape.
10089 # @ref tui_fillet2d "Example"
10090 @ManageTransactions("LocalOp")
10091 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10093 Perform a fillet on the specified edges of the given shape
10096 theShape Wire Shape to perform fillet on.
10097 theR Fillet radius.
10098 theListOfVertexes Global indices of vertexes to perform fillet on.
10099 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10100 by the length of the edges, nearest to the fillet vertex.
10101 But sometimes the next edge is C1 continuous with the one, nearest to
10102 the fillet point, and such two (or more) edges can be united to allow
10103 bigger radius. Set this flag to TRUE to allow collinear edges union,
10104 thus ignoring the secant vertex (vertices).
10105 theName Object name; when specified, this parameter is used
10106 for result publication in the study. Otherwise, if automatic
10107 publication is switched on, default value is used for result name.
10109 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10111 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10114 New GEOM.GEOM_Object, containing the result shape.
10118 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10119 # make fillet at given wire vertices with giver radius
10120 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10122 # Example: see GEOM_TestAll.py
10123 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10124 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10125 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10126 anObj.SetParameters(Parameters)
10127 self._autoPublish(anObj, theName, "fillet")
10130 ## Perform a fillet at the specified vertices of the given face/shell.
10131 # @param theShape Face or Shell shape to perform fillet on.
10132 # @param theR Fillet radius.
10133 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10134 # @param theName Object name; when specified, this parameter is used
10135 # for result publication in the study. Otherwise, if automatic
10136 # publication is switched on, default value is used for result name.
10138 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10140 # @return New GEOM.GEOM_Object, containing the result shape.
10142 # @ref tui_fillet2d "Example"
10143 @ManageTransactions("LocalOp")
10144 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10146 Perform a fillet at the specified vertices of the given face/shell.
10149 theShape Face or Shell shape to perform fillet on.
10150 theR Fillet radius.
10151 theListOfVertexes Global indices of vertexes to perform fillet on.
10152 theName Object name; when specified, this parameter is used
10153 for result publication in the study. Otherwise, if automatic
10154 publication is switched on, default value is used for result name.
10156 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10159 New GEOM.GEOM_Object, containing the result shape.
10162 face = geompy.MakeFaceHW(100, 100, 1)
10163 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10165 # Example: see GEOM_TestAll.py
10166 theR,Parameters = ParseParameters(theR)
10167 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10168 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10169 anObj.SetParameters(Parameters)
10170 self._autoPublish(anObj, theName, "fillet")
10173 ## Perform a symmetric chamfer on all edges of the given shape.
10174 # @param theShape Shape, to perform chamfer on.
10175 # @param theD Chamfer size along each face.
10176 # @param theName Object name; when specified, this parameter is used
10177 # for result publication in the study. Otherwise, if automatic
10178 # publication is switched on, default value is used for result name.
10180 # @return New GEOM.GEOM_Object, containing the result shape.
10182 # @ref tui_chamfer "Example 1"
10183 # \n @ref swig_MakeChamferAll "Example 2"
10184 @ManageTransactions("LocalOp")
10185 def MakeChamferAll(self, theShape, theD, theName=None):
10187 Perform a symmetric chamfer on all edges of the given shape.
10190 theShape Shape, to perform chamfer on.
10191 theD Chamfer size along each face.
10192 theName Object name; when specified, this parameter is used
10193 for result publication in the study. Otherwise, if automatic
10194 publication is switched on, default value is used for result name.
10197 New GEOM.GEOM_Object, containing the result shape.
10200 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10202 # Example: see GEOM_TestOthers.py
10203 theD,Parameters = ParseParameters(theD)
10204 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10205 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10206 anObj.SetParameters(Parameters)
10207 self._autoPublish(anObj, theName, "chamfer")
10210 ## Perform a chamfer on edges, common to the specified faces,
10211 # with distance D1 on the Face1
10212 # @param theShape Shape, to perform chamfer on.
10213 # @param theD1 Chamfer size along \a theFace1.
10214 # @param theD2 Chamfer size along \a theFace2.
10215 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10216 # @param theName Object name; when specified, this parameter is used
10217 # for result publication in the study. Otherwise, if automatic
10218 # publication is switched on, default value is used for result name.
10220 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10222 # @return New GEOM.GEOM_Object, containing the result shape.
10224 # @ref tui_chamfer "Example"
10225 @ManageTransactions("LocalOp")
10226 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10228 Perform a chamfer on edges, common to the specified faces,
10229 with distance D1 on the Face1
10232 theShape Shape, to perform chamfer on.
10233 theD1 Chamfer size along theFace1.
10234 theD2 Chamfer size along theFace2.
10235 theFace1,theFace2 Global indices of two faces of theShape.
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 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10244 New GEOM.GEOM_Object, containing the result shape.
10247 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10248 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10249 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10250 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10252 # Example: see GEOM_TestAll.py
10253 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10254 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10255 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10256 anObj.SetParameters(Parameters)
10257 self._autoPublish(anObj, theName, "chamfer")
10260 ## Perform a chamfer on edges
10261 # @param theShape Shape, to perform chamfer on.
10262 # @param theD Chamfer length
10263 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10264 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10265 # @param theName Object name; when specified, this parameter is used
10266 # for result publication in the study. Otherwise, if automatic
10267 # publication is switched on, default value is used for result name.
10269 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10271 # @return New GEOM.GEOM_Object, containing the result shape.
10272 @ManageTransactions("LocalOp")
10273 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10275 Perform a chamfer on edges
10278 theShape Shape, to perform chamfer on.
10279 theD1 Chamfer size along theFace1.
10280 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10281 theFace1,theFace2 Global indices of two faces of theShape.
10282 theName Object name; when specified, this parameter is used
10283 for result publication in the study. Otherwise, if automatic
10284 publication is switched on, default value is used for result name.
10287 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10290 New GEOM.GEOM_Object, containing the result shape.
10293 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10294 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10295 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10297 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10300 if isinstance(theAngle,str):
10302 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10304 theAngle = theAngle*math.pi/180.0
10305 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10306 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10307 anObj.SetParameters(Parameters)
10308 self._autoPublish(anObj, theName, "chamfer")
10311 ## Perform a chamfer on all edges of the specified faces,
10312 # with distance D1 on the first specified face (if several for one edge)
10313 # @param theShape Shape, to perform chamfer on.
10314 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10315 # connected to the edge, are in \a theFaces, \a theD1
10316 # will be get along face, which is nearer to \a theFaces beginning.
10317 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10318 # @param theFaces Sequence of global indices of faces of \a theShape.
10319 # @param theName Object name; when specified, this parameter is used
10320 # for result publication in the study. Otherwise, if automatic
10321 # publication is switched on, default value is used for result name.
10323 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10325 # @return New GEOM.GEOM_Object, containing the result shape.
10327 # @ref tui_chamfer "Example"
10328 @ManageTransactions("LocalOp")
10329 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10331 Perform a chamfer on all edges of the specified faces,
10332 with distance D1 on the first specified face (if several for one edge)
10335 theShape Shape, to perform chamfer on.
10336 theD1 Chamfer size along face from theFaces. If both faces,
10337 connected to the edge, are in theFaces, theD1
10338 will be get along face, which is nearer to theFaces beginning.
10339 theD2 Chamfer size along another of two faces, connected to the edge.
10340 theFaces Sequence of global indices of faces of theShape.
10341 theName Object name; when specified, this parameter is used
10342 for result publication in the study. Otherwise, if automatic
10343 publication is switched on, default value is used for result name.
10345 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10348 New GEOM.GEOM_Object, containing the result shape.
10350 # Example: see GEOM_TestAll.py
10351 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10352 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10353 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10354 anObj.SetParameters(Parameters)
10355 self._autoPublish(anObj, theName, "chamfer")
10358 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
10359 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10361 # @ref swig_FilletChamfer "Example"
10362 @ManageTransactions("LocalOp")
10363 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10365 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
10366 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10369 if isinstance(theAngle,str):
10371 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10373 theAngle = theAngle*math.pi/180.0
10374 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10375 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10376 anObj.SetParameters(Parameters)
10377 self._autoPublish(anObj, theName, "chamfer")
10380 ## Perform a chamfer on edges,
10381 # with distance D1 on the first specified face (if several for one edge)
10382 # @param theShape Shape, to perform chamfer on.
10383 # @param theD1,theD2 Chamfer size
10384 # @param theEdges Sequence of edges of \a theShape.
10385 # @param 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 # @return New GEOM.GEOM_Object, containing the result shape.
10391 # @ref swig_FilletChamfer "Example"
10392 @ManageTransactions("LocalOp")
10393 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10395 Perform a chamfer on edges,
10396 with distance D1 on the first specified face (if several for one edge)
10399 theShape Shape, to perform chamfer on.
10400 theD1,theD2 Chamfer size
10401 theEdges Sequence of edges of theShape.
10402 theName Object name; when specified, this parameter is used
10403 for result publication in the study. Otherwise, if automatic
10404 publication is switched on, default value is used for result name.
10407 New GEOM.GEOM_Object, containing the result shape.
10409 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10410 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10411 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10412 anObj.SetParameters(Parameters)
10413 self._autoPublish(anObj, theName, "chamfer")
10416 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
10417 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10418 @ManageTransactions("LocalOp")
10419 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10421 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
10422 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10425 if isinstance(theAngle,str):
10427 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10429 theAngle = theAngle*math.pi/180.0
10430 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10431 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10432 anObj.SetParameters(Parameters)
10433 self._autoPublish(anObj, theName, "chamfer")
10436 ## @sa MakeChamferEdge(), MakeChamferFaces()
10438 # @ref swig_MakeChamfer "Example"
10439 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10441 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10443 # Example: see GEOM_TestOthers.py
10445 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10446 if aShapeType == self.ShapeType["EDGE"]:
10447 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10449 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10452 ## Remove material from a solid by extrusion of the base shape on the given distance.
10453 # @param theInit Shape to remove material from. It must be a solid or
10454 # a compound made of a single solid.
10455 # @param theBase Closed edge or wire defining the base shape to be extruded.
10456 # @param theH Prism dimension along the normal to theBase
10457 # @param theAngle Draft angle in degrees.
10458 # @param theInvert If true material changes the direction
10459 # @param theName Object name; when specified, this parameter is used
10460 # for result publication in the study. Otherwise, if automatic
10461 # publication is switched on, default value is used for result name.
10463 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10465 # @ref tui_creation_prism "Example"
10466 @ManageTransactions("PrimOp")
10467 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10469 Add material to a solid by extrusion of the base shape on the given distance.
10472 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10473 theBase Closed edge or wire defining the base shape to be extruded.
10474 theH Prism dimension along the normal to theBase
10475 theAngle Draft angle in degrees.
10476 theInvert If true material changes the direction.
10477 theName Object name; when specified, this parameter is used
10478 for result publication in the study. Otherwise, if automatic
10479 publication is switched on, default value is used for result name.
10482 New GEOM.GEOM_Object, containing the initial shape with removed material.
10484 # Example: see GEOM_TestAll.py
10485 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10486 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10487 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10488 anObj.SetParameters(Parameters)
10489 self._autoPublish(anObj, theName, "extrudedCut")
10492 ## Add material to a solid by extrusion of the base shape on the given distance.
10493 # @param theInit Shape to add material to. It must be a solid or
10494 # a compound made of a single solid.
10495 # @param theBase Closed edge or wire defining the base shape to be extruded.
10496 # @param theH Prism dimension along the normal to theBase
10497 # @param theAngle Draft angle in degrees.
10498 # @param theInvert If true material changes the direction
10499 # @param theName Object name; when specified, this parameter is used
10500 # for result publication in the study. Otherwise, if automatic
10501 # publication is switched on, default value is used for result name.
10503 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10505 # @ref tui_creation_prism "Example"
10506 @ManageTransactions("PrimOp")
10507 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10509 Add material to a solid by extrusion of the base shape on the given distance.
10512 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10513 theBase Closed edge or wire defining the base shape to be extruded.
10514 theH Prism dimension along the normal to theBase
10515 theAngle Draft angle in degrees.
10516 theInvert If true material changes the direction.
10517 theName Object name; when specified, this parameter is used
10518 for result publication in the study. Otherwise, if automatic
10519 publication is switched on, default value is used for result name.
10522 New GEOM.GEOM_Object, containing the initial shape with added material.
10524 # Example: see GEOM_TestAll.py
10525 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10526 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10527 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10528 anObj.SetParameters(Parameters)
10529 self._autoPublish(anObj, theName, "extrudedBoss")
10535 ## @addtogroup l3_basic_op
10538 ## Perform an Archimde operation on the given shape with given parameters.
10539 # The object presenting the resulting face is returned.
10540 # @param theShape Shape to be put in water.
10541 # @param theWeight Weight of the shape.
10542 # @param theWaterDensity Density of the water.
10543 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10544 # @param theName Object name; when specified, this parameter is used
10545 # for result publication in the study. Otherwise, if automatic
10546 # publication is switched on, default value is used for result name.
10548 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10549 # by a plane, corresponding to water level.
10551 # @ref tui_archimede "Example"
10552 @ManageTransactions("LocalOp")
10553 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10555 Perform an Archimde operation on the given shape with given parameters.
10556 The object presenting the resulting face is returned.
10559 theShape Shape to be put in water.
10560 theWeight Weight of the shape.
10561 theWaterDensity Density of the water.
10562 theMeshDeflection Deflection of the mesh, using to compute the section.
10563 theName Object name; when specified, this parameter is used
10564 for result publication in the study. Otherwise, if automatic
10565 publication is switched on, default value is used for result name.
10568 New GEOM.GEOM_Object, containing a section of theShape
10569 by a plane, corresponding to water level.
10571 # Example: see GEOM_TestAll.py
10572 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10573 theWeight,theWaterDensity,theMeshDeflection)
10574 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10575 RaiseIfFailed("MakeArchimede", self.LocalOp)
10576 anObj.SetParameters(Parameters)
10577 self._autoPublish(anObj, theName, "archimede")
10580 # end of l3_basic_op
10583 ## @addtogroup l2_measure
10586 ## Get point coordinates
10587 # @return [x, y, z]
10589 # @ref tui_point_coordinates_page "Example"
10590 @ManageTransactions("MeasuOp")
10591 def PointCoordinates(self,Point):
10593 Get point coordinates
10598 # Example: see GEOM_TestMeasures.py
10599 aTuple = self.MeasuOp.PointCoordinates(Point)
10600 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10603 ## Get vector coordinates
10604 # @return [x, y, z]
10606 # @ref tui_measurement_tools_page "Example"
10607 def VectorCoordinates(self,Vector):
10609 Get vector coordinates
10615 p1=self.GetFirstVertex(Vector)
10616 p2=self.GetLastVertex(Vector)
10618 X1=self.PointCoordinates(p1)
10619 X2=self.PointCoordinates(p2)
10621 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10624 ## Compute cross product
10625 # @return vector w=u^v
10627 # @ref tui_measurement_tools_page "Example"
10628 def CrossProduct(self, Vector1, Vector2):
10630 Compute cross product
10632 Returns: vector w=u^v
10634 u=self.VectorCoordinates(Vector1)
10635 v=self.VectorCoordinates(Vector2)
10636 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])
10640 ## Compute cross product
10641 # @return dot product p=u.v
10643 # @ref tui_measurement_tools_page "Example"
10644 def DotProduct(self, Vector1, Vector2):
10646 Compute cross product
10648 Returns: dot product p=u.v
10650 u=self.VectorCoordinates(Vector1)
10651 v=self.VectorCoordinates(Vector2)
10652 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10657 ## Get summarized length of all wires,
10658 # area of surface and volume of the given shape.
10659 # @param theShape Shape to define properties of.
10660 # @param theTolerance maximal relative error of area
10661 # and volume computation.
10662 # @return [theLength, theSurfArea, theVolume]\n
10663 # theLength: Summarized length of all wires of the given shape.\n
10664 # theSurfArea: Area of surface of the given shape.\n
10665 # theVolume: Volume of the given shape.
10667 # @ref tui_basic_properties_page "Example"
10668 @ManageTransactions("MeasuOp")
10669 def BasicProperties(self,theShape, theTolerance=1.e-6):
10671 Get summarized length of all wires,
10672 area of surface and volume of the given shape.
10675 theShape Shape to define properties of.
10676 theTolerance maximal relative error of area
10677 and volume computation.
10680 [theLength, theSurfArea, theVolume]
10681 theLength: Summarized length of all wires of the given shape.
10682 theSurfArea: Area of surface of the given shape.
10683 theVolume: Volume of the given shape.
10685 # Example: see GEOM_TestMeasures.py
10686 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10687 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10690 ## Get parameters of bounding box of the given shape
10691 # @param theShape Shape to obtain bounding box of.
10692 # @param precise TRUE for precise computation; FALSE for fast one.
10693 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10694 # Xmin,Xmax: Limits of shape along OX axis.
10695 # Ymin,Ymax: Limits of shape along OY axis.
10696 # Zmin,Zmax: Limits of shape along OZ axis.
10698 # @ref tui_bounding_box_page "Example"
10699 @ManageTransactions("MeasuOp")
10700 def BoundingBox (self, theShape, precise=False):
10702 Get parameters of bounding box of the given shape
10705 theShape Shape to obtain bounding box of.
10706 precise TRUE for precise computation; FALSE for fast one.
10709 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10710 Xmin,Xmax: Limits of shape along OX axis.
10711 Ymin,Ymax: Limits of shape along OY axis.
10712 Zmin,Zmax: Limits of shape along OZ axis.
10714 # Example: see GEOM_TestMeasures.py
10715 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10716 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10719 ## Get bounding box of the given shape
10720 # @param theShape Shape to obtain bounding box of.
10721 # @param precise TRUE for precise computation; FALSE for fast one.
10722 # @param theName Object name; when specified, this parameter is used
10723 # for result publication in the study. Otherwise, if automatic
10724 # publication is switched on, default value is used for result name.
10726 # @return New GEOM.GEOM_Object, containing the created box.
10728 # @ref tui_bounding_box_page "Example"
10729 @ManageTransactions("MeasuOp")
10730 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10732 Get bounding box of the given shape
10735 theShape Shape to obtain bounding box of.
10736 precise TRUE for precise computation; FALSE for fast one.
10737 theName Object name; when specified, this parameter is used
10738 for result publication in the study. Otherwise, if automatic
10739 publication is switched on, default value is used for result name.
10742 New GEOM.GEOM_Object, containing the created box.
10744 # Example: see GEOM_TestMeasures.py
10745 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10746 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10747 self._autoPublish(anObj, theName, "bndbox")
10750 ## Get inertia matrix and moments of inertia of theShape.
10751 # @param theShape Shape to calculate inertia of.
10752 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10753 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10754 # Ix,Iy,Iz: Moments of inertia of the given shape.
10756 # @ref tui_inertia_page "Example"
10757 @ManageTransactions("MeasuOp")
10758 def Inertia(self,theShape):
10760 Get inertia matrix and moments of inertia of theShape.
10763 theShape Shape to calculate inertia of.
10766 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10767 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10768 Ix,Iy,Iz: Moments of inertia of the given shape.
10770 # Example: see GEOM_TestMeasures.py
10771 aTuple = self.MeasuOp.GetInertia(theShape)
10772 RaiseIfFailed("GetInertia", self.MeasuOp)
10775 ## Get if coords are included in the shape (ST_IN or ST_ON)
10776 # @param theShape Shape
10777 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10778 # @param tolerance to be used (default is 1.0e-7)
10779 # @return list_of_boolean = [res1, res2, ...]
10780 @ManageTransactions("MeasuOp")
10781 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10783 Get if coords are included in the shape (ST_IN or ST_ON)
10787 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10788 tolerance to be used (default is 1.0e-7)
10791 list_of_boolean = [res1, res2, ...]
10793 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10795 ## Get minimal distance between the given shapes.
10796 # @param theShape1,theShape2 Shapes to find minimal distance between.
10797 # @return Value of the minimal distance between the given shapes.
10799 # @ref tui_min_distance_page "Example"
10800 @ManageTransactions("MeasuOp")
10801 def MinDistance(self, theShape1, theShape2):
10803 Get minimal distance between the given shapes.
10806 theShape1,theShape2 Shapes to find minimal distance between.
10809 Value of the minimal distance between the given shapes.
10811 # Example: see GEOM_TestMeasures.py
10812 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10813 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10816 ## Get minimal distance between the given shapes.
10817 # @param theShape1,theShape2 Shapes to find minimal distance between.
10818 # @return Value of the minimal distance between the given shapes, in form of list
10819 # [Distance, DX, DY, DZ].
10821 # @ref tui_min_distance_page "Example"
10822 @ManageTransactions("MeasuOp")
10823 def MinDistanceComponents(self, theShape1, theShape2):
10825 Get minimal distance between the given shapes.
10828 theShape1,theShape2 Shapes to find minimal distance between.
10831 Value of the minimal distance between the given shapes, in form of list
10832 [Distance, DX, DY, DZ]
10834 # Example: see GEOM_TestMeasures.py
10835 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10836 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10837 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10840 ## Get closest points of the given shapes.
10841 # @param theShape1,theShape2 Shapes to find closest points of.
10842 # @return The number of found solutions (-1 in case of infinite number of
10843 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10845 # @ref tui_min_distance_page "Example"
10846 @ManageTransactions("MeasuOp")
10847 def ClosestPoints (self, theShape1, theShape2):
10849 Get closest points of the given shapes.
10852 theShape1,theShape2 Shapes to find closest points of.
10855 The number of found solutions (-1 in case of infinite number of
10856 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10858 # Example: see GEOM_TestMeasures.py
10859 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10860 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10863 ## Get angle between the given shapes in degrees.
10864 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10865 # @note If both arguments are vectors, the angle is computed in accordance
10866 # with their orientations, otherwise the minimum angle is computed.
10867 # @return Value of the angle between the given shapes in degrees.
10869 # @ref tui_angle_page "Example"
10870 @ManageTransactions("MeasuOp")
10871 def GetAngle(self, theShape1, theShape2):
10873 Get angle between the given shapes in degrees.
10876 theShape1,theShape2 Lines or linear edges to find angle between.
10879 If both arguments are vectors, the angle is computed in accordance
10880 with their orientations, otherwise the minimum angle is computed.
10883 Value of the angle between the given shapes in degrees.
10885 # Example: see GEOM_TestMeasures.py
10886 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10887 RaiseIfFailed("GetAngle", self.MeasuOp)
10890 ## Get angle between the given shapes in radians.
10891 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10892 # @note If both arguments are vectors, the angle is computed in accordance
10893 # with their orientations, otherwise the minimum angle is computed.
10894 # @return Value of the angle between the given shapes in radians.
10896 # @ref tui_angle_page "Example"
10897 @ManageTransactions("MeasuOp")
10898 def GetAngleRadians(self, theShape1, theShape2):
10900 Get angle between the given shapes in radians.
10903 theShape1,theShape2 Lines or linear edges to find angle between.
10907 If both arguments are vectors, the angle is computed in accordance
10908 with their orientations, otherwise the minimum angle is computed.
10911 Value of the angle between the given shapes in radians.
10913 # Example: see GEOM_TestMeasures.py
10914 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10915 RaiseIfFailed("GetAngle", self.MeasuOp)
10918 ## Get angle between the given vectors in degrees.
10919 # @param theShape1,theShape2 Vectors to find angle between.
10920 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10921 # if False, the opposite vector to the normal vector is used.
10922 # @return Value of the angle between the given vectors in degrees.
10924 # @ref tui_angle_page "Example"
10925 @ManageTransactions("MeasuOp")
10926 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10928 Get angle between the given vectors in degrees.
10931 theShape1,theShape2 Vectors to find angle between.
10932 theFlag If True, the normal vector is defined by the two vectors cross,
10933 if False, the opposite vector to the normal vector is used.
10936 Value of the angle between the given vectors in degrees.
10938 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
10940 anAngle = 360. - anAngle
10941 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
10944 ## The same as GetAngleVectors, but the result is in radians.
10945 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
10947 Get angle between the given vectors in radians.
10950 theShape1,theShape2 Vectors to find angle between.
10951 theFlag If True, the normal vector is defined by the two vectors cross,
10952 if False, the opposite vector to the normal vector is used.
10955 Value of the angle between the given vectors in radians.
10957 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
10960 ## @name Curve Curvature Measurement
10961 # Methods for receiving radius of curvature of curves
10962 # in the given point
10965 ## Measure curvature of a curve at a point, set by parameter.
10966 # @param theCurve a curve.
10967 # @param theParam parameter.
10968 # @return radius of curvature of \a theCurve.
10970 # @ref swig_todo "Example"
10971 @ManageTransactions("MeasuOp")
10972 def CurveCurvatureByParam(self, theCurve, theParam):
10974 Measure curvature of a curve at a point, set by parameter.
10978 theParam parameter.
10981 radius of curvature of theCurve.
10983 # Example: see GEOM_TestMeasures.py
10984 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
10985 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
10988 ## Measure curvature of a curve at a point.
10989 # @param theCurve a curve.
10990 # @param thePoint given point.
10991 # @return radius of curvature of \a theCurve.
10993 # @ref swig_todo "Example"
10994 @ManageTransactions("MeasuOp")
10995 def CurveCurvatureByPoint(self, theCurve, thePoint):
10997 Measure curvature of a curve at a point.
11001 thePoint given point.
11004 radius of curvature of theCurve.
11006 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11007 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11011 ## @name Surface Curvature Measurement
11012 # Methods for receiving max and min radius of curvature of surfaces
11013 # in the given point
11016 ## Measure max radius of curvature of surface.
11017 # @param theSurf the given surface.
11018 # @param theUParam Value of U-parameter on the referenced surface.
11019 # @param theVParam Value of V-parameter on the referenced surface.
11020 # @return max radius of curvature of theSurf.
11022 ## @ref swig_todo "Example"
11023 @ManageTransactions("MeasuOp")
11024 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11026 Measure max radius of curvature of surface.
11029 theSurf the given surface.
11030 theUParam Value of U-parameter on the referenced surface.
11031 theVParam Value of V-parameter on the referenced surface.
11034 max radius of curvature of theSurf.
11036 # Example: see GEOM_TestMeasures.py
11037 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11038 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11041 ## Measure max radius of curvature of surface in the given point
11042 # @param theSurf the given surface.
11043 # @param thePoint given point.
11044 # @return max radius of curvature of theSurf.
11046 ## @ref swig_todo "Example"
11047 @ManageTransactions("MeasuOp")
11048 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11050 Measure max radius of curvature of surface in the given point.
11053 theSurf the given surface.
11054 thePoint given point.
11057 max radius of curvature of theSurf.
11059 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11060 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11063 ## Measure min radius of curvature of surface.
11064 # @param theSurf the given surface.
11065 # @param theUParam Value of U-parameter on the referenced surface.
11066 # @param theVParam Value of V-parameter on the referenced surface.
11067 # @return min radius of curvature of theSurf.
11069 ## @ref swig_todo "Example"
11070 @ManageTransactions("MeasuOp")
11071 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11073 Measure min radius of curvature of surface.
11076 theSurf the given surface.
11077 theUParam Value of U-parameter on the referenced surface.
11078 theVParam Value of V-parameter on the referenced surface.
11081 Min radius of curvature of theSurf.
11083 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11084 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11087 ## Measure min radius of curvature of surface in the given point
11088 # @param theSurf the given surface.
11089 # @param thePoint given point.
11090 # @return min radius of curvature of theSurf.
11092 ## @ref swig_todo "Example"
11093 @ManageTransactions("MeasuOp")
11094 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11096 Measure min radius of curvature of surface in the given point.
11099 theSurf the given surface.
11100 thePoint given point.
11103 Min radius of curvature of theSurf.
11105 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11106 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11110 ## Get min and max tolerances of sub-shapes of theShape
11111 # @param theShape Shape, to get tolerances of.
11112 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11113 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11114 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11115 # VertMin,VertMax: Min and max tolerances of the vertices.
11117 # @ref tui_tolerance_page "Example"
11118 @ManageTransactions("MeasuOp")
11119 def Tolerance(self,theShape):
11121 Get min and max tolerances of sub-shapes of theShape
11124 theShape Shape, to get tolerances of.
11127 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11128 FaceMin,FaceMax: Min and max tolerances of the faces.
11129 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11130 VertMin,VertMax: Min and max tolerances of the vertices.
11132 # Example: see GEOM_TestMeasures.py
11133 aTuple = self.MeasuOp.GetTolerance(theShape)
11134 RaiseIfFailed("GetTolerance", self.MeasuOp)
11137 ## Obtain description of the given shape (number of sub-shapes of each type)
11138 # @param theShape Shape to be described.
11139 # @return Description of the given shape.
11141 # @ref tui_whatis_page "Example"
11142 @ManageTransactions("MeasuOp")
11143 def WhatIs(self,theShape):
11145 Obtain description of the given shape (number of sub-shapes of each type)
11148 theShape Shape to be described.
11151 Description of the given shape.
11153 # Example: see GEOM_TestMeasures.py
11154 aDescr = self.MeasuOp.WhatIs(theShape)
11155 RaiseIfFailed("WhatIs", self.MeasuOp)
11158 ## Obtain quantity of shapes of the given type in \a theShape.
11159 # If \a theShape is of type \a theType, it is also counted.
11160 # @param theShape Shape to be described.
11161 # @param theType the given ShapeType().
11162 # @return Quantity of shapes of type \a theType in \a theShape.
11164 # @ref tui_measurement_tools_page "Example"
11165 def NbShapes (self, theShape, theType):
11167 Obtain quantity of shapes of the given type in theShape.
11168 If theShape is of type theType, it is also counted.
11171 theShape Shape to be described.
11172 theType the given geompy.ShapeType
11175 Quantity of shapes of type theType in theShape.
11177 # Example: see GEOM_TestMeasures.py
11178 listSh = self.SubShapeAllIDs(theShape, theType)
11182 ## Obtain quantity of shapes of each type in \a theShape.
11183 # The \a theShape is also counted.
11184 # @param theShape Shape to be described.
11185 # @return Dictionary of ShapeType() with bound quantities of shapes.
11187 # @ref tui_measurement_tools_page "Example"
11188 def ShapeInfo (self, theShape):
11190 Obtain quantity of shapes of each type in theShape.
11191 The theShape is also counted.
11194 theShape Shape to be described.
11197 Dictionary of geompy.ShapeType with bound quantities of shapes.
11199 # Example: see GEOM_TestMeasures.py
11201 for typeSh in self.ShapeType:
11202 if typeSh in ( "AUTO", "SHAPE" ): continue
11203 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11209 def GetCreationInformation(self, theShape):
11211 infos = theShape.GetCreationInformation()
11214 opName = info.operationName
11215 if not opName: opName = "no info available"
11216 if res: res += "\n"
11217 res += "Operation: " + opName
11219 for parVal in info.params:
11220 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11223 ## Get a point, situated at the centre of mass of theShape.
11224 # @param theShape Shape to define centre of mass of.
11225 # @param theName Object name; when specified, this parameter is used
11226 # for result publication in the study. Otherwise, if automatic
11227 # publication is switched on, default value is used for result name.
11229 # @return New GEOM.GEOM_Object, containing the created point.
11231 # @ref tui_center_of_mass_page "Example"
11232 @ManageTransactions("MeasuOp")
11233 def MakeCDG(self, theShape, theName=None):
11235 Get a point, situated at the centre of mass of theShape.
11238 theShape Shape to define centre of mass of.
11239 theName Object name; when specified, this parameter is used
11240 for result publication in the study. Otherwise, if automatic
11241 publication is switched on, default value is used for result name.
11244 New GEOM.GEOM_Object, containing the created point.
11246 # Example: see GEOM_TestMeasures.py
11247 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11248 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11249 self._autoPublish(anObj, theName, "centerOfMass")
11252 ## Get a vertex sub-shape by index depended with orientation.
11253 # @param theShape Shape to find sub-shape.
11254 # @param theIndex Index to find vertex by this index (starting from zero)
11255 # @param theName Object name; when specified, this parameter is used
11256 # for result publication in the study. Otherwise, if automatic
11257 # publication is switched on, default value is used for result name.
11259 # @return New GEOM.GEOM_Object, containing the created vertex.
11261 # @ref tui_measurement_tools_page "Example"
11262 @ManageTransactions("MeasuOp")
11263 def GetVertexByIndex(self, theShape, theIndex, theName=None):
11265 Get a vertex sub-shape by index depended with orientation.
11268 theShape Shape to find sub-shape.
11269 theIndex Index to find vertex by this index (starting from zero)
11270 theName Object name; when specified, this parameter is used
11271 for result publication in the study. Otherwise, if automatic
11272 publication is switched on, default value is used for result name.
11275 New GEOM.GEOM_Object, containing the created vertex.
11277 # Example: see GEOM_TestMeasures.py
11278 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
11279 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11280 self._autoPublish(anObj, theName, "vertex")
11283 ## Get the first vertex of wire/edge depended orientation.
11284 # @param theShape Shape to find first vertex.
11285 # @param theName Object name; when specified, this parameter is used
11286 # for result publication in the study. Otherwise, if automatic
11287 # publication is switched on, default value is used for result name.
11289 # @return New GEOM.GEOM_Object, containing the created vertex.
11291 # @ref tui_measurement_tools_page "Example"
11292 def GetFirstVertex(self, theShape, theName=None):
11294 Get the first vertex of wire/edge depended orientation.
11297 theShape Shape to find first vertex.
11298 theName Object name; when specified, this parameter is used
11299 for result publication in the study. Otherwise, if automatic
11300 publication is switched on, default value is used for result name.
11303 New GEOM.GEOM_Object, containing the created vertex.
11305 # Example: see GEOM_TestMeasures.py
11306 # note: auto-publishing is done in self.GetVertexByIndex()
11307 return self.GetVertexByIndex(theShape, 0, theName)
11309 ## Get the last vertex of wire/edge depended orientation.
11310 # @param theShape Shape to find last vertex.
11311 # @param theName Object name; when specified, this parameter is used
11312 # for result publication in the study. Otherwise, if automatic
11313 # publication is switched on, default value is used for result name.
11315 # @return New GEOM.GEOM_Object, containing the created vertex.
11317 # @ref tui_measurement_tools_page "Example"
11318 def GetLastVertex(self, theShape, theName=None):
11320 Get the last vertex of wire/edge depended orientation.
11323 theShape Shape to find last vertex.
11324 theName Object name; when specified, this parameter is used
11325 for result publication in the study. Otherwise, if automatic
11326 publication is switched on, default value is used for result name.
11329 New GEOM.GEOM_Object, containing the created vertex.
11331 # Example: see GEOM_TestMeasures.py
11332 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11333 # note: auto-publishing is done in self.GetVertexByIndex()
11334 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
11336 ## Get a normale to the given face. If the point is not given,
11337 # the normale is calculated at the center of mass.
11338 # @param theFace Face to define normale of.
11339 # @param theOptionalPoint Point to compute the normale at.
11340 # @param theName Object name; when specified, this parameter is used
11341 # for result publication in the study. Otherwise, if automatic
11342 # publication is switched on, default value is used for result name.
11344 # @return New GEOM.GEOM_Object, containing the created vector.
11346 # @ref swig_todo "Example"
11347 @ManageTransactions("MeasuOp")
11348 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11350 Get a normale to the given face. If the point is not given,
11351 the normale is calculated at the center of mass.
11354 theFace Face to define normale of.
11355 theOptionalPoint Point to compute the normale at.
11356 theName Object name; when specified, this parameter is used
11357 for result publication in the study. Otherwise, if automatic
11358 publication is switched on, default value is used for result name.
11361 New GEOM.GEOM_Object, containing the created vector.
11363 # Example: see GEOM_TestMeasures.py
11364 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11365 RaiseIfFailed("GetNormal", self.MeasuOp)
11366 self._autoPublish(anObj, theName, "normal")
11369 ## Print shape errors obtained from CheckShape.
11370 # @param theShape Shape that was checked.
11371 # @param theShapeErrors the shape errors obtained by CheckShape.
11372 # @param theReturnStatus If 0 the description of problem is printed.
11373 # If 1 the description of problem is returned.
11374 # @return If theReturnStatus is equal to 1 the description is returned.
11375 # Otherwise doesn't return anything.
11377 # @ref tui_check_shape_page "Example"
11378 @ManageTransactions("MeasuOp")
11379 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11381 Print shape errors obtained from CheckShape.
11384 theShape Shape that was checked.
11385 theShapeErrors the shape errors obtained by CheckShape.
11386 theReturnStatus If 0 the description of problem is printed.
11387 If 1 the description of problem is returned.
11390 If theReturnStatus is equal to 1 the description is returned.
11391 Otherwise doesn't return anything.
11393 # Example: see GEOM_TestMeasures.py
11394 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11395 if theReturnStatus == 1:
11400 ## Check a topology of the given shape.
11401 # @param theShape Shape to check validity of.
11402 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11403 # if TRUE, the shape's geometry will be checked also.
11404 # @param theReturnStatus If 0 and if theShape is invalid, a description
11405 # of problem is printed.
11406 # If 1 isValid flag and the description of
11407 # problem is returned.
11408 # If 2 isValid flag and the list of error data
11410 # @return TRUE, if the shape "seems to be valid".
11411 # If theShape is invalid, prints a description of problem.
11412 # If theReturnStatus is equal to 1 the description is returned
11413 # along with IsValid flag.
11414 # If theReturnStatus is equal to 2 the list of error data is
11415 # returned along with IsValid flag.
11417 # @ref tui_check_shape_page "Example"
11418 @ManageTransactions("MeasuOp")
11419 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11421 Check a topology of the given shape.
11424 theShape Shape to check validity of.
11425 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11426 if TRUE, the shape's geometry will be checked also.
11427 theReturnStatus If 0 and if theShape is invalid, a description
11428 of problem is printed.
11429 If 1 IsValid flag and the description of
11430 problem is returned.
11431 If 2 IsValid flag and the list of error data
11435 TRUE, if the shape "seems to be valid".
11436 If theShape is invalid, prints a description of problem.
11437 If theReturnStatus is equal to 1 the description is returned
11438 along with IsValid flag.
11439 If theReturnStatus is equal to 2 the list of error data is
11440 returned along with IsValid flag.
11442 # Example: see GEOM_TestMeasures.py
11444 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11445 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11447 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11448 RaiseIfFailed("CheckShape", self.MeasuOp)
11450 if theReturnStatus == 0:
11451 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11453 if theReturnStatus == 1:
11454 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11455 return (IsValid, Descr)
11456 elif theReturnStatus == 2:
11457 return (IsValid, ShapeErrors)
11460 ## Detect self-intersections in the given shape.
11461 # @param theShape Shape to check.
11462 # @param theCheckLevel is the level of self-intersection check.
11463 # Possible input values are:
11464 # - GEOM.SI_V_V(0) - only V/V interferences
11465 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11466 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11467 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11468 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11469 # - GEOM.SI_ALL(5) - all interferences.
11470 # @return TRUE, if the shape contains no self-intersections.
11472 # @ref tui_check_self_intersections_page "Example"
11473 @ManageTransactions("MeasuOp")
11474 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11476 Detect self-intersections in the given shape.
11479 theShape Shape to check.
11480 theCheckLevel is the level of self-intersection check.
11481 Possible input values are:
11482 - GEOM.SI_V_V(0) - only V/V interferences
11483 - GEOM.SI_V_E(1) - V/V and V/E interferences
11484 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11485 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11486 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11487 - GEOM.SI_ALL(5) - all interferences.
11490 TRUE, if the shape contains no self-intersections.
11492 # Example: see GEOM_TestMeasures.py
11493 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11494 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11497 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11498 # @param theShape Shape to check.
11499 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
11500 # - if \a theDeflection <= 0, default deflection 0.001 is used
11501 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11502 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11503 # - if \a theTolerance > 0, algorithm detects gaps
11504 # @return TRUE, if the shape contains no self-intersections.
11506 # @ref tui_check_self_intersections_fast_page "Example"
11507 @ManageTransactions("MeasuOp")
11508 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11510 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11513 theShape Shape to check.
11514 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11515 - if theDeflection <= 0, default deflection 0.001 is used
11516 theTolerance Specifies a distance between shapes used for detecting gaps:
11517 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11518 - if theTolerance > 0, algorithm detects gaps
11521 TRUE, if the shape contains no self-intersections.
11523 # Example: see GEOM_TestMeasures.py
11524 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11525 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11528 ## Check boolean and partition operations agruments.
11529 # @param theShape the agrument of an operation to be checked
11530 # @return TRUE if the agrument is valid for a boolean or partition
11531 # operation; FALSE otherwise.
11532 @ManageTransactions("MeasuOp")
11533 def CheckBOPArguments(self, theShape):
11535 Check boolean and partition operations agruments.
11538 theShape the agrument of an operation to be checked
11541 TRUE if the agrument is valid for a boolean or partition
11542 operation; FALSE otherwise.
11544 return self.MeasuOp.CheckBOPArguments(theShape)
11546 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11547 # @param theShape1 First source object
11548 # @param theShape2 Second source object
11549 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11550 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11551 # - if \a theTolerance > 0, algorithm detects gaps
11552 # @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
11553 # - if \a theDeflection <= 0, default deflection 0.001 is used
11554 # @return TRUE, if there are intersections (gaps) between source shapes
11555 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11556 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11558 # @ref tui_fast_intersection_page "Example"
11559 @ManageTransactions("MeasuOp")
11560 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11562 Detect intersections of the given shapes with algorithm based on mesh intersections.
11565 theShape1 First source object
11566 theShape2 Second source object
11567 theTolerance Specifies a distance between shapes used for detecting gaps:
11568 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11569 - if theTolerance > 0, algorithm detects gaps
11570 theDeflection Linear deflection coefficient that specifies quality of tesselation:
11571 - if theDeflection <= 0, default deflection 0.001 is used
11574 TRUE, if there are intersections (gaps) between source shapes
11575 List of sub-shapes IDs from 1st shape that localize intersection.
11576 List of sub-shapes IDs from 2nd shape that localize intersection.
11578 # Example: see GEOM_TestMeasures.py
11579 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11580 RaiseIfFailed("FastIntersect", self.MeasuOp)
11581 return IsOk, Res1, Res2
11583 ## Get position (LCS) of theShape.
11585 # Origin of the LCS is situated at the shape's center of mass.
11586 # Axes of the LCS are obtained from shape's location or,
11587 # if the shape is a planar face, from position of its plane.
11589 # @param theShape Shape to calculate position of.
11590 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11591 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11592 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11593 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11595 # @ref swig_todo "Example"
11596 @ManageTransactions("MeasuOp")
11597 def GetPosition(self,theShape):
11599 Get position (LCS) of theShape.
11600 Origin of the LCS is situated at the shape's center of mass.
11601 Axes of the LCS are obtained from shape's location or,
11602 if the shape is a planar face, from position of its plane.
11605 theShape Shape to calculate position of.
11608 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11609 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11610 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11611 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11613 # Example: see GEOM_TestMeasures.py
11614 aTuple = self.MeasuOp.GetPosition(theShape)
11615 RaiseIfFailed("GetPosition", self.MeasuOp)
11618 ## Get kind of theShape.
11620 # @param theShape Shape to get a kind of.
11621 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11622 # and a list of parameters, describing the shape.
11623 # @note Concrete meaning of each value, returned via \a theIntegers
11624 # or \a theDoubles list depends on the kind() of the shape.
11626 # @ref swig_todo "Example"
11627 @ManageTransactions("MeasuOp")
11628 def KindOfShape(self,theShape):
11630 Get kind of theShape.
11633 theShape Shape to get a kind of.
11636 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11637 and a list of parameters, describing the shape.
11639 Concrete meaning of each value, returned via theIntegers
11640 or theDoubles list depends on the geompy.kind of the shape
11642 # Example: see GEOM_TestMeasures.py
11643 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11644 RaiseIfFailed("KindOfShape", self.MeasuOp)
11646 aKind = aRoughTuple[0]
11647 anInts = aRoughTuple[1]
11648 aDbls = aRoughTuple[2]
11650 # Now there is no exception from this rule:
11651 aKindTuple = [aKind] + aDbls + anInts
11653 # If they are we will regroup parameters for such kind of shape.
11655 #if aKind == kind.SOME_KIND:
11656 # # SOME_KIND int int double int double double
11657 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11661 ## Returns the string that describes if the shell is good for solid.
11662 # This is a support method for MakeSolid.
11664 # @param theShell the shell to be checked.
11665 # @return Returns a string that describes the shell validity for
11666 # solid construction.
11667 @ManageTransactions("MeasuOp")
11668 def _IsGoodForSolid(self, theShell):
11670 Returns the string that describes if the shell is good for solid.
11671 This is a support method for MakeSolid.
11674 theShell the shell to be checked.
11677 Returns a string that describes the shell validity for
11678 solid construction.
11680 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11683 # end of l2_measure
11686 ## @addtogroup l2_import_export
11689 ## Import a shape from the BREP, IGES, STEP or other file
11690 # (depends on given format) with given name.
11692 # Note: this function is deprecated, it is kept for backward compatibility only
11693 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11695 # @param theFileName The file, containing the shape.
11696 # @param theFormatName Specify format for the file reading.
11697 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11698 # If format 'IGES_SCALE' is used instead of 'IGES' or
11699 # format 'STEP_SCALE' is used instead of 'STEP',
11700 # length unit will be set to 'meter' and result model will be scaled.
11701 # @param theName Object name; when specified, this parameter is used
11702 # for result publication in the study. Otherwise, if automatic
11703 # publication is switched on, default value is used for result name.
11705 # @return New GEOM.GEOM_Object, containing the imported shape.
11706 # If material names are imported it returns the list of
11707 # objects. The first one is the imported object followed by
11709 # @note Auto publishing is allowed for the shape itself. Imported
11710 # material groups are not automatically published.
11712 # @ref swig_Import_Export "Example"
11713 @ManageTransactions("InsertOp")
11714 def ImportFile(self, theFileName, theFormatName, theName=None):
11716 Import a shape from the BREP, IGES, STEP or other file
11717 (depends on given format) with given name.
11719 Note: this function is deprecated, it is kept for backward compatibility only
11720 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11723 theFileName The file, containing the shape.
11724 theFormatName Specify format for the file reading.
11725 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11726 If format 'IGES_SCALE' is used instead of 'IGES' or
11727 format 'STEP_SCALE' is used instead of 'STEP',
11728 length unit will be set to 'meter' and result model will be scaled.
11729 theName Object name; when specified, this parameter is used
11730 for result publication in the study. Otherwise, if automatic
11731 publication is switched on, default value is used for result name.
11734 New GEOM.GEOM_Object, containing the imported shape.
11735 If material names are imported it returns the list of
11736 objects. The first one is the imported object followed by
11739 Auto publishing is allowed for the shape itself. Imported
11740 material groups are not automatically published.
11742 # Example: see GEOM_TestOthers.py
11744 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11745 where <FormatName> is a name of desirable format for importing.
11747 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11748 RaiseIfFailed("ImportFile", self.InsertOp)
11749 aNbObj = len(aListObj)
11751 self._autoPublish(aListObj[0], theName, "imported")
11756 ## Deprecated analog of ImportFile()
11757 def Import(self, theFileName, theFormatName, theName=None):
11759 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11761 # note: auto-publishing is done in self.ImportFile()
11762 return self.ImportFile(theFileName, theFormatName, theName)
11764 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11766 # @note As the byte-stream representing the shape data can be quite large, this method
11767 # is not automatically dumped to the Python script with the DumpStudy functionality;
11768 # so please use this method carefully, only for strong reasons.
11770 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11773 # @param theStream The BRep binary stream.
11774 # @param theName Object name; when specified, this parameter is used
11775 # for result publication in the study. Otherwise, if automatic
11776 # publication is switched on, default value is used for result name.
11778 # @return New GEOM_Object, containing the shape, read from theStream.
11780 # @ref swig_Import_Export "Example"
11781 @ManageTransactions("InsertOp")
11782 def RestoreShape (self, theStream, theName=None):
11784 Read a shape from the binary stream, containing its bounding representation (BRep).
11787 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11790 theStream The BRep binary stream.
11791 theName Object name; when specified, this parameter is used
11792 for result publication in the study. Otherwise, if automatic
11793 publication is switched on, default value is used for result name.
11796 New GEOM_Object, containing the shape, read from theStream.
11798 # Example: see GEOM_TestOthers.py
11800 # this is the workaround to ignore invalid case when data stream is empty
11801 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11802 print("WARNING: Result of RestoreShape is a NULL shape!")
11804 anObj = self.InsertOp.RestoreShape(theStream)
11805 RaiseIfFailed("RestoreShape", self.InsertOp)
11806 self._autoPublish(anObj, theName, "restored")
11809 ## Export the given shape into a file with given name.
11811 # Note: this function is deprecated, it is kept for backward compatibility only
11812 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11814 # @param theObject Shape to be stored in the file.
11815 # @param theFileName Name of the file to store the given shape in.
11816 # @param theFormatName Specify format for the shape storage.
11817 # Available formats can be obtained with
11818 # geompy.InsertOp.ExportTranslators()[0] method.
11820 # @ref swig_Import_Export "Example"
11821 @ManageTransactions("InsertOp")
11822 def Export(self, theObject, theFileName, theFormatName):
11824 Export the given shape into a file with given name.
11826 Note: this function is deprecated, it is kept for backward compatibility only
11827 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11830 theObject Shape to be stored in the file.
11831 theFileName Name of the file to store the given shape in.
11832 theFormatName Specify format for the shape storage.
11833 Available formats can be obtained with
11834 geompy.InsertOp.ExportTranslators()[0] method.
11836 # Example: see GEOM_TestOthers.py
11838 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11839 where <FormatName> is a name of desirable format for exporting.
11841 self.InsertOp.Export(theObject, theFileName, theFormatName)
11842 if self.InsertOp.IsDone() == 0:
11843 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11847 # end of l2_import_export
11850 ## @addtogroup l3_blocks
11853 ## Create a quadrangle face from four edges. Order of Edges is not
11854 # important. It is not necessary that edges share the same vertex.
11855 # @param E1,E2,E3,E4 Edges for the face bound.
11856 # @param theName Object name; when specified, this parameter is used
11857 # for result publication in the study. Otherwise, if automatic
11858 # publication is switched on, default value is used for result name.
11860 # @return New GEOM.GEOM_Object, containing the created face.
11862 # @ref tui_building_by_blocks_page "Example"
11863 @ManageTransactions("BlocksOp")
11864 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11866 Create a quadrangle face from four edges. Order of Edges is not
11867 important. It is not necessary that edges share the same vertex.
11870 E1,E2,E3,E4 Edges for the face bound.
11871 theName Object name; when specified, this parameter is used
11872 for result publication in the study. Otherwise, if automatic
11873 publication is switched on, default value is used for result name.
11876 New GEOM.GEOM_Object, containing the created face.
11879 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11881 # Example: see GEOM_Spanner.py
11882 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11883 RaiseIfFailed("MakeQuad", self.BlocksOp)
11884 self._autoPublish(anObj, theName, "quad")
11887 ## Create a quadrangle face on two edges.
11888 # The missing edges will be built by creating the shortest ones.
11889 # @param E1,E2 Two opposite edges for the face.
11890 # @param theName Object name; when specified, this parameter is used
11891 # for result publication in the study. Otherwise, if automatic
11892 # publication is switched on, default value is used for result name.
11894 # @return New GEOM.GEOM_Object, containing the created face.
11896 # @ref tui_building_by_blocks_page "Example"
11897 @ManageTransactions("BlocksOp")
11898 def MakeQuad2Edges(self, E1, E2, theName=None):
11900 Create a quadrangle face on two edges.
11901 The missing edges will be built by creating the shortest ones.
11904 E1,E2 Two opposite edges for the face.
11905 theName Object name; when specified, this parameter is used
11906 for result publication in the study. Otherwise, if automatic
11907 publication is switched on, default value is used for result name.
11910 New GEOM.GEOM_Object, containing the created face.
11914 p1 = geompy.MakeVertex( 0., 0., 0.)
11915 p2 = geompy.MakeVertex(150., 30., 0.)
11916 p3 = geompy.MakeVertex( 0., 120., 50.)
11917 p4 = geompy.MakeVertex( 0., 40., 70.)
11919 edge1 = geompy.MakeEdge(p1, p2)
11920 edge2 = geompy.MakeEdge(p3, p4)
11921 # create a quadrangle face from two edges
11922 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11924 # Example: see GEOM_Spanner.py
11925 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11926 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11927 self._autoPublish(anObj, theName, "quad")
11930 ## Create a quadrangle face with specified corners.
11931 # The missing edges will be built by creating the shortest ones.
11932 # @param V1,V2,V3,V4 Corner vertices for the face.
11933 # @param theName Object name; when specified, this parameter is used
11934 # for result publication in the study. Otherwise, if automatic
11935 # publication is switched on, default value is used for result name.
11937 # @return New GEOM.GEOM_Object, containing the created face.
11939 # @ref tui_building_by_blocks_page "Example 1"
11940 # \n @ref swig_MakeQuad4Vertices "Example 2"
11941 @ManageTransactions("BlocksOp")
11942 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
11944 Create a quadrangle face with specified corners.
11945 The missing edges will be built by creating the shortest ones.
11948 V1,V2,V3,V4 Corner vertices 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.)
11962 # create a quadrangle from four points in its corners
11963 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
11965 # Example: see GEOM_Spanner.py
11966 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
11967 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
11968 self._autoPublish(anObj, theName, "quad")
11971 ## Create a hexahedral solid, bounded by the six given faces. Order of
11972 # faces is not important. It is not necessary that Faces share the same edge.
11973 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11974 # @param theName Object name; when specified, this parameter is used
11975 # for result publication in the study. Otherwise, if automatic
11976 # publication is switched on, default value is used for result name.
11978 # @return New GEOM.GEOM_Object, containing the created solid.
11980 # @ref tui_building_by_blocks_page "Example 1"
11981 # \n @ref swig_MakeHexa "Example 2"
11982 @ManageTransactions("BlocksOp")
11983 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
11985 Create a hexahedral solid, bounded by the six given faces. Order of
11986 faces is not important. It is not necessary that Faces share the same edge.
11989 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
11990 theName Object name; when specified, this parameter is used
11991 for result publication in the study. Otherwise, if automatic
11992 publication is switched on, default value is used for result name.
11995 New GEOM.GEOM_Object, containing the created solid.
11998 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12000 # Example: see GEOM_Spanner.py
12001 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12002 RaiseIfFailed("MakeHexa", self.BlocksOp)
12003 self._autoPublish(anObj, theName, "hexa")
12006 ## Create a hexahedral solid between two given faces.
12007 # The missing faces will be built by creating the smallest ones.
12008 # @param F1,F2 Two opposite faces for the hexahedral solid.
12009 # @param theName Object name; when specified, this parameter is used
12010 # for result publication in the study. Otherwise, if automatic
12011 # publication is switched on, default value is used for result name.
12013 # @return New GEOM.GEOM_Object, containing the created solid.
12015 # @ref tui_building_by_blocks_page "Example 1"
12016 # \n @ref swig_MakeHexa2Faces "Example 2"
12017 @ManageTransactions("BlocksOp")
12018 def MakeHexa2Faces(self, F1, F2, theName=None):
12020 Create a hexahedral solid between two given faces.
12021 The missing faces will be built by creating the smallest ones.
12024 F1,F2 Two opposite faces for the hexahedral solid.
12025 theName Object name; when specified, this parameter is used
12026 for result publication in the study. Otherwise, if automatic
12027 publication is switched on, default value is used for result name.
12030 New GEOM.GEOM_Object, containing the created solid.
12033 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12035 # Example: see GEOM_Spanner.py
12036 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12037 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12038 self._autoPublish(anObj, theName, "hexa")
12044 ## @addtogroup l3_blocks_op
12047 ## Get a vertex, found in the given shape by its coordinates.
12048 # @param theShape Block or a compound of blocks.
12049 # @param theX,theY,theZ Coordinates of the sought vertex.
12050 # @param theEpsilon Maximum allowed distance between the resulting
12051 # vertex and point with the given coordinates.
12052 # @param theName Object name; when specified, this parameter is used
12053 # for result publication in the study. Otherwise, if automatic
12054 # publication is switched on, default value is used for result name.
12056 # @return New GEOM.GEOM_Object, containing the found vertex.
12058 # @ref swig_GetPoint "Example"
12059 @ManageTransactions("BlocksOp")
12060 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12062 Get a vertex, found in the given shape by its coordinates.
12065 theShape Block or a compound of blocks.
12066 theX,theY,theZ Coordinates of the sought vertex.
12067 theEpsilon Maximum allowed distance between the resulting
12068 vertex and point with the given coordinates.
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 found vertex.
12077 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12079 # Example: see GEOM_TestOthers.py
12080 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12081 RaiseIfFailed("GetPoint", self.BlocksOp)
12082 self._autoPublish(anObj, theName, "vertex")
12085 ## Find a vertex of the given shape, which has minimal distance to the given point.
12086 # @param theShape Any shape.
12087 # @param thePoint Point, close to the desired vertex.
12088 # @param theName Object name; when specified, this parameter is used
12089 # for result publication in the study. Otherwise, if automatic
12090 # publication is switched on, default value is used for result name.
12092 # @return New GEOM.GEOM_Object, containing the found vertex.
12094 # @ref swig_GetVertexNearPoint "Example"
12095 @ManageTransactions("BlocksOp")
12096 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12098 Find a vertex of the given shape, which has minimal distance to the given point.
12101 theShape Any shape.
12102 thePoint Point, close to the desired vertex.
12103 theName Object name; when specified, this parameter is used
12104 for result publication in the study. Otherwise, if automatic
12105 publication is switched on, default value is used for result name.
12108 New GEOM.GEOM_Object, containing the found vertex.
12111 pmidle = geompy.MakeVertex(50, 0, 50)
12112 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12114 # Example: see GEOM_TestOthers.py
12115 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12116 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12117 self._autoPublish(anObj, theName, "vertex")
12120 ## Get an edge, found in the given shape by two given vertices.
12121 # @param theShape Block or a compound of blocks.
12122 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12123 # @param theName Object name; when specified, this parameter is used
12124 # for result publication in the study. Otherwise, if automatic
12125 # publication is switched on, default value is used for result name.
12127 # @return New GEOM.GEOM_Object, containing the found edge.
12129 # @ref swig_GetEdge "Example"
12130 @ManageTransactions("BlocksOp")
12131 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12133 Get an edge, found in the given shape by two given vertices.
12136 theShape Block or a compound of blocks.
12137 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12138 theName Object name; when specified, this parameter is used
12139 for result publication in the study. Otherwise, if automatic
12140 publication is switched on, default value is used for result name.
12143 New GEOM.GEOM_Object, containing the found edge.
12145 # Example: see GEOM_Spanner.py
12146 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12147 RaiseIfFailed("GetEdge", self.BlocksOp)
12148 self._autoPublish(anObj, theName, "edge")
12151 ## Find an edge of the given shape, which has minimal distance to the given point.
12152 # @param theShape Block or a compound of blocks.
12153 # @param thePoint Point, close to the desired edge.
12154 # @param theName Object name; when specified, this parameter is used
12155 # for result publication in the study. Otherwise, if automatic
12156 # publication is switched on, default value is used for result name.
12158 # @return New GEOM.GEOM_Object, containing the found edge.
12160 # @ref swig_GetEdgeNearPoint "Example"
12161 @ManageTransactions("BlocksOp")
12162 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12164 Find an edge of the given shape, which has minimal distance to the given point.
12167 theShape Block or a compound of blocks.
12168 thePoint Point, close to the desired edge.
12169 theName Object name; when specified, this parameter is used
12170 for result publication in the study. Otherwise, if automatic
12171 publication is switched on, default value is used for result name.
12174 New GEOM.GEOM_Object, containing the found edge.
12176 # Example: see GEOM_TestOthers.py
12177 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12178 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12179 self._autoPublish(anObj, theName, "edge")
12182 ## Returns a face, found in the given shape by four given corner vertices.
12183 # @param theShape Block or a compound of blocks.
12184 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12185 # @param theName Object name; when specified, this parameter is used
12186 # for result publication in the study. Otherwise, if automatic
12187 # publication is switched on, default value is used for result name.
12189 # @return New GEOM.GEOM_Object, containing the found face.
12191 # @ref swig_todo "Example"
12192 @ManageTransactions("BlocksOp")
12193 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12195 Returns a face, found in the given shape by four given corner vertices.
12198 theShape Block or a compound of blocks.
12199 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12200 theName Object name; when specified, this parameter is used
12201 for result publication in the study. Otherwise, if automatic
12202 publication is switched on, default value is used for result name.
12205 New GEOM.GEOM_Object, containing the found face.
12207 # Example: see GEOM_Spanner.py
12208 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12209 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12210 self._autoPublish(anObj, theName, "face")
12213 ## Get a face of block, found in the given shape by two given edges.
12214 # @param theShape Block or a compound of blocks.
12215 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12216 # @param theName Object name; when specified, this parameter is used
12217 # for result publication in the study. Otherwise, if automatic
12218 # publication is switched on, default value is used for result name.
12220 # @return New GEOM.GEOM_Object, containing the found face.
12222 # @ref swig_todo "Example"
12223 @ManageTransactions("BlocksOp")
12224 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12226 Get a face of block, found in the given shape by two given edges.
12229 theShape Block or a compound of blocks.
12230 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12231 theName Object name; when specified, this parameter is used
12232 for result publication in the study. Otherwise, if automatic
12233 publication is switched on, default value is used for result name.
12236 New GEOM.GEOM_Object, containing the found face.
12238 # Example: see GEOM_Spanner.py
12239 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12240 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12241 self._autoPublish(anObj, theName, "face")
12244 ## Find a face, opposite to the given one in the given block.
12245 # @param theBlock Must be a hexahedral solid.
12246 # @param theFace Face of \a theBlock, opposite to the desired face.
12247 # @param theName Object name; when specified, this parameter is used
12248 # for result publication in the study. Otherwise, if automatic
12249 # publication is switched on, default value is used for result name.
12251 # @return New GEOM.GEOM_Object, containing the found face.
12253 # @ref swig_GetOppositeFace "Example"
12254 @ManageTransactions("BlocksOp")
12255 def GetOppositeFace(self, theBlock, theFace, theName=None):
12257 Find a face, opposite to the given one in the given block.
12260 theBlock Must be a hexahedral solid.
12261 theFace Face of theBlock, opposite to the desired face.
12262 theName Object name; when specified, this parameter is used
12263 for result publication in the study. Otherwise, if automatic
12264 publication is switched on, default value is used for result name.
12267 New GEOM.GEOM_Object, containing the found face.
12269 # Example: see GEOM_Spanner.py
12270 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12271 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12272 self._autoPublish(anObj, theName, "face")
12275 ## Find a face of the given shape, which has minimal distance to the given point.
12276 # @param theShape Block or a compound of blocks.
12277 # @param thePoint Point, close to the desired face.
12278 # @param theName Object name; when specified, this parameter is used
12279 # for result publication in the study. Otherwise, if automatic
12280 # publication is switched on, default value is used for result name.
12282 # @return New GEOM.GEOM_Object, containing the found face.
12284 # @ref swig_GetFaceNearPoint "Example"
12285 @ManageTransactions("BlocksOp")
12286 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12288 Find a face of the given shape, which has minimal distance to the given point.
12291 theShape Block or a compound of blocks.
12292 thePoint Point, close to the desired face.
12293 theName Object name; when specified, this parameter is used
12294 for result publication in the study. Otherwise, if automatic
12295 publication is switched on, default value is used for result name.
12298 New GEOM.GEOM_Object, containing the found face.
12300 # Example: see GEOM_Spanner.py
12301 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12302 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12303 self._autoPublish(anObj, theName, "face")
12306 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12307 # @param theBlock Block or a compound of blocks.
12308 # @param theVector Vector, close to the normale of the desired face.
12309 # @param theName Object name; when specified, this parameter is used
12310 # for result publication in the study. Otherwise, if automatic
12311 # publication is switched on, default value is used for result name.
12313 # @return New GEOM.GEOM_Object, containing the found face.
12315 # @ref swig_todo "Example"
12316 @ManageTransactions("BlocksOp")
12317 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12319 Find a face of block, whose outside normale has minimal angle with the given vector.
12322 theBlock Block or a compound of blocks.
12323 theVector Vector, close to the normale of the desired face.
12324 theName Object name; when specified, this parameter is used
12325 for result publication in the study. Otherwise, if automatic
12326 publication is switched on, default value is used for result name.
12329 New GEOM.GEOM_Object, containing the found face.
12331 # Example: see GEOM_Spanner.py
12332 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12333 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12334 self._autoPublish(anObj, theName, "face")
12337 ## Find all sub-shapes of type \a theShapeType of the given shape,
12338 # which have minimal distance to the given point.
12339 # @param theShape Any shape.
12340 # @param thePoint Point, close to the desired shape.
12341 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12342 # @param theTolerance The tolerance for distances comparison. All shapes
12343 # with distances to the given point in interval
12344 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12345 # @param theName Object name; when specified, this parameter is used
12346 # for result publication in the study. Otherwise, if automatic
12347 # publication is switched on, default value is used for result name.
12349 # @return New GEOM_Object, containing a group of all found shapes.
12351 # @ref swig_GetShapesNearPoint "Example"
12352 @ManageTransactions("BlocksOp")
12353 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12355 Find all sub-shapes of type theShapeType of the given shape,
12356 which have minimal distance to the given point.
12359 theShape Any shape.
12360 thePoint Point, close to the desired shape.
12361 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12362 theTolerance The tolerance for distances comparison. All shapes
12363 with distances to the given point in interval
12364 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12365 theName Object name; when specified, this parameter is used
12366 for result publication in the study. Otherwise, if automatic
12367 publication is switched on, default value is used for result name.
12370 New GEOM_Object, containing a group of all found shapes.
12372 # Example: see GEOM_TestOthers.py
12373 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12374 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12375 self._autoPublish(anObj, theName, "group")
12378 # end of l3_blocks_op
12381 ## @addtogroup l4_blocks_measure
12384 ## Check, if the compound of blocks is given.
12385 # To be considered as a compound of blocks, the
12386 # given shape must satisfy the following conditions:
12387 # - Each element of the compound should be a Block (6 faces).
12388 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12389 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12390 # there are more than 4 edges in the only wire of a face,
12391 # this face is considered to be quadrangle if it has 4 bounds
12392 # (1 or more edge) of C1 continuity.
12393 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12394 # - The compound should be connexe.
12395 # - The glue between two quadrangle faces should be applied.
12396 # @param theCompound The compound to check.
12397 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12398 # taking into account C1 continuity.
12399 # @param theAngTolerance the angular tolerance to check if two neighbor
12400 # edges are codirectional in the common vertex with this
12401 # tolerance. This parameter is used only if
12402 # <VAR>theIsUseC1</VAR> is set to True.
12403 # @return TRUE, if the given shape is a compound of blocks.
12404 # If theCompound is not valid, prints all discovered errors.
12406 # @ref tui_check_compound_of_blocks_page "Example 1"
12407 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12408 @ManageTransactions("BlocksOp")
12409 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12410 theAngTolerance = 1.e-12):
12412 Check, if the compound of blocks is given.
12413 To be considered as a compound of blocks, the
12414 given shape must satisfy the following conditions:
12415 - Each element of the compound should be a Block (6 faces).
12416 - Each face should be a quadrangle, i.e. it should have only 1 wire
12417 with 4 edges. If theIsUseC1 is set to True and
12418 there are more than 4 edges in the only wire of a face,
12419 this face is considered to be quadrangle if it has 4 bounds
12420 (1 or more edge) of C1 continuity.
12421 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12422 - The compound should be connexe.
12423 - The glue between two quadrangle faces should be applied.
12426 theCompound The compound to check.
12427 theIsUseC1 Flag to check if there are 4 bounds on a face
12428 taking into account C1 continuity.
12429 theAngTolerance the angular tolerance to check if two neighbor
12430 edges are codirectional in the common vertex with this
12431 tolerance. This parameter is used only if
12432 theIsUseC1 is set to True.
12435 TRUE, if the given shape is a compound of blocks.
12436 If theCompound is not valid, prints all discovered errors.
12438 # Example: see GEOM_Spanner.py
12441 aTolerance = theAngTolerance
12442 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12443 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12445 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12449 ## Retrieve all non blocks solids and faces from \a theShape.
12450 # @param theShape The shape to explore.
12451 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12452 # taking into account C1 continuity.
12453 # @param theAngTolerance the angular tolerance to check if two neighbor
12454 # edges are codirectional in the common vertex with this
12455 # tolerance. This parameter is used only if
12456 # <VAR>theIsUseC1</VAR> is set to True.
12457 # @param theName Object name; when specified, this parameter is used
12458 # for result publication in the study. Otherwise, if automatic
12459 # publication is switched on, default value is used for result name.
12461 # @return A tuple of two GEOM_Objects. The first object is a group of all
12462 # non block solids (= not 6 faces, or with 6 faces, but with the
12463 # presence of non-quadrangular faces). The second object is a
12464 # group of all non quadrangular faces (= faces with more then
12465 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12466 # with 1 wire with not 4 edges that do not form 4 bounds of
12469 # @ref tui_get_non_blocks_page "Example 1"
12470 # \n @ref swig_GetNonBlocks "Example 2"
12471 @ManageTransactions("BlocksOp")
12472 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12473 theAngTolerance = 1.e-12, theName=None):
12475 Retrieve all non blocks solids and faces from theShape.
12478 theShape The shape to explore.
12479 theIsUseC1 Flag to check if there are 4 bounds on a face
12480 taking into account C1 continuity.
12481 theAngTolerance the angular tolerance to check if two neighbor
12482 edges are codirectional in the common vertex with this
12483 tolerance. This parameter is used only if
12484 theIsUseC1 is set to True.
12485 theName Object name; when specified, this parameter is used
12486 for result publication in the study. Otherwise, if automatic
12487 publication is switched on, default value is used for result name.
12490 A tuple of two GEOM_Objects. The first object is a group of all
12491 non block solids (= not 6 faces, or with 6 faces, but with the
12492 presence of non-quadrangular faces). The second object is a
12493 group of all non quadrangular faces (= faces with more then
12494 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12495 with 1 wire with not 4 edges that do not form 4 bounds of
12499 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12501 # Example: see GEOM_Spanner.py
12504 aTolerance = theAngTolerance
12505 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12506 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12507 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12510 ## Remove all seam and degenerated edges from \a theShape.
12511 # Unite faces and edges, sharing one surface. It means that
12512 # this faces must have references to one C++ surface object (handle).
12513 # @param theShape The compound or single solid to remove irregular edges from.
12514 # @param doUnionFaces If True, then unite faces. If False (the default value),
12515 # do not unite faces.
12516 # @param theName Object name; when specified, this parameter is used
12517 # for result publication in the study. Otherwise, if automatic
12518 # publication is switched on, default value is used for result name.
12520 # @return Improved shape.
12522 # @ref swig_RemoveExtraEdges "Example"
12523 @ManageTransactions("BlocksOp")
12524 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12526 Remove all seam and degenerated edges from theShape.
12527 Unite faces and edges, sharing one surface. It means that
12528 this faces must have references to one C++ surface object (handle).
12531 theShape The compound or single solid to remove irregular edges from.
12532 doUnionFaces If True, then unite faces. If False (the default value),
12533 do not unite faces.
12534 theName Object name; when specified, this parameter is used
12535 for result publication in the study. Otherwise, if automatic
12536 publication is switched on, default value is used for result name.
12541 # Example: see GEOM_TestOthers.py
12542 nbFacesOptimum = -1 # -1 means do not unite faces
12543 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12544 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12545 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12546 self._autoPublish(anObj, theName, "removeExtraEdges")
12549 ## Performs union faces of \a theShape
12550 # Unite faces sharing one surface. It means that
12551 # these faces must have references to one C++ surface object (handle).
12552 # @param theShape The compound or single solid that contains faces
12553 # to perform union.
12554 # @param theName Object name; when specified, this parameter is used
12555 # for result publication in the study. Otherwise, if automatic
12556 # publication is switched on, default value is used for result name.
12558 # @return Improved shape.
12560 # @ref swig_UnionFaces "Example"
12561 @ManageTransactions("BlocksOp")
12562 def UnionFaces(self, theShape, theName=None):
12564 Performs union faces of theShape.
12565 Unite faces sharing one surface. It means that
12566 these faces must have references to one C++ surface object (handle).
12569 theShape The compound or single solid that contains faces
12571 theName Object name; when specified, this parameter is used
12572 for result publication in the study. Otherwise, if automatic
12573 publication is switched on, default value is used for result name.
12578 # Example: see GEOM_TestOthers.py
12579 anObj = self.BlocksOp.UnionFaces(theShape)
12580 RaiseIfFailed("UnionFaces", self.BlocksOp)
12581 self._autoPublish(anObj, theName, "unionFaces")
12584 ## Check, if the given shape is a blocks compound.
12585 # Fix all detected errors.
12586 # \note Single block can be also fixed by this method.
12587 # @param theShape The compound to check and improve.
12588 # @param theName Object name; when specified, this parameter is used
12589 # for result publication in the study. Otherwise, if automatic
12590 # publication is switched on, default value is used for result name.
12592 # @return Improved compound.
12594 # @ref swig_CheckAndImprove "Example"
12595 @ManageTransactions("BlocksOp")
12596 def CheckAndImprove(self, theShape, theName=None):
12598 Check, if the given shape is a blocks compound.
12599 Fix all detected errors.
12602 Single block can be also fixed by this method.
12605 theShape The compound to check and improve.
12606 theName Object name; when specified, this parameter is used
12607 for result publication in the study. Otherwise, if automatic
12608 publication is switched on, default value is used for result name.
12613 # Example: see GEOM_TestOthers.py
12614 anObj = self.BlocksOp.CheckAndImprove(theShape)
12615 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12616 self._autoPublish(anObj, theName, "improved")
12619 # end of l4_blocks_measure
12622 ## @addtogroup l3_blocks_op
12625 ## Get all the blocks, contained in the given compound.
12626 # @param theCompound The compound to explode.
12627 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12628 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12629 # @param theName Object name; when specified, this parameter is used
12630 # for result publication in the study. Otherwise, if automatic
12631 # publication is switched on, default value is used for result name.
12633 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12635 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12637 # @ref tui_explode_on_blocks "Example 1"
12638 # \n @ref swig_MakeBlockExplode "Example 2"
12639 @ManageTransactions("BlocksOp")
12640 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12642 Get all the blocks, contained in the given compound.
12645 theCompound The compound to explode.
12646 theMinNbFaces If solid has lower number of faces, it is not a block.
12647 theMaxNbFaces If solid has higher number of faces, it is not a block.
12648 theName Object name; when specified, this parameter is used
12649 for result publication in the study. Otherwise, if automatic
12650 publication is switched on, default value is used for result name.
12653 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12656 List of GEOM.GEOM_Object, containing the retrieved blocks.
12658 # Example: see GEOM_TestOthers.py
12659 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12660 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12661 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12662 for anObj in aList:
12663 anObj.SetParameters(Parameters)
12665 self._autoPublish(aList, theName, "block")
12668 ## Find block, containing the given point inside its volume or on boundary.
12669 # @param theCompound Compound, to find block in.
12670 # @param thePoint Point, close to the desired block. If the point lays on
12671 # boundary between some blocks, we return block with nearest center.
12672 # @param theName Object name; when specified, this parameter is used
12673 # for result publication in the study. Otherwise, if automatic
12674 # publication is switched on, default value is used for result name.
12676 # @return New GEOM.GEOM_Object, containing the found block.
12678 # @ref swig_todo "Example"
12679 @ManageTransactions("BlocksOp")
12680 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12682 Find block, containing the given point inside its volume or on boundary.
12685 theCompound Compound, to find block in.
12686 thePoint Point, close to the desired block. If the point lays on
12687 boundary between some blocks, we return block with nearest center.
12688 theName Object name; when specified, this parameter is used
12689 for result publication in the study. Otherwise, if automatic
12690 publication is switched on, default value is used for result name.
12693 New GEOM.GEOM_Object, containing the found block.
12695 # Example: see GEOM_Spanner.py
12696 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12697 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12698 self._autoPublish(anObj, theName, "block")
12701 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12702 # @param theCompound Compound, to find block in.
12703 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12704 # @param theName Object name; when specified, this parameter is used
12705 # for result publication in the study. Otherwise, if automatic
12706 # publication is switched on, default value is used for result name.
12708 # @return New GEOM.GEOM_Object, containing the found block.
12710 # @ref swig_GetBlockByParts "Example"
12711 @ManageTransactions("BlocksOp")
12712 def GetBlockByParts(self, theCompound, theParts, theName=None):
12714 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12717 theCompound Compound, to find block in.
12718 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12719 theName Object name; when specified, this parameter is used
12720 for result publication in the study. Otherwise, if automatic
12721 publication is switched on, default value is used for result name.
12724 New GEOM_Object, containing the found block.
12726 # Example: see GEOM_TestOthers.py
12727 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12728 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12729 self._autoPublish(anObj, theName, "block")
12732 ## Return all blocks, containing all the elements, passed as the parts.
12733 # @param theCompound Compound, to find blocks in.
12734 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12735 # @param theName Object name; when specified, this parameter is used
12736 # for result publication in the study. Otherwise, if automatic
12737 # publication is switched on, default value is used for result name.
12739 # @return List of GEOM.GEOM_Object, containing the found blocks.
12741 # @ref swig_todo "Example"
12742 @ManageTransactions("BlocksOp")
12743 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12745 Return all blocks, containing all the elements, passed as the parts.
12748 theCompound Compound, to find blocks in.
12749 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12750 theName Object name; when specified, this parameter is used
12751 for result publication in the study. Otherwise, if automatic
12752 publication is switched on, default value is used for result name.
12755 List of GEOM.GEOM_Object, containing the found blocks.
12757 # Example: see GEOM_Spanner.py
12758 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12759 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12760 self._autoPublish(aList, theName, "block")
12763 ## Multi-transformate block and glue the result.
12764 # Transformation is defined so, as to superpose direction faces.
12765 # @param Block Hexahedral solid to be multi-transformed.
12766 # @param DirFace1 ID of First direction face.
12767 # @param DirFace2 ID of Second direction face.
12768 # @param NbTimes Quantity of transformations to be done.
12769 # @param theName Object name; when specified, this parameter is used
12770 # for result publication in the study. Otherwise, if automatic
12771 # publication is switched on, default value is used for result name.
12773 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12775 # @return New GEOM.GEOM_Object, containing the result shape.
12777 # @ref tui_multi_transformation "Example"
12778 @ManageTransactions("BlocksOp")
12779 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12781 Multi-transformate block and glue the result.
12782 Transformation is defined so, as to superpose direction faces.
12785 Block Hexahedral solid to be multi-transformed.
12786 DirFace1 ID of First direction face.
12787 DirFace2 ID of Second direction face.
12788 NbTimes Quantity of transformations to be done.
12789 theName Object name; when specified, this parameter is used
12790 for result publication in the study. Otherwise, if automatic
12791 publication is switched on, default value is used for result name.
12794 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12797 New GEOM.GEOM_Object, containing the result shape.
12799 # Example: see GEOM_Spanner.py
12800 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12801 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12802 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12803 anObj.SetParameters(Parameters)
12804 self._autoPublish(anObj, theName, "transformed")
12807 ## Multi-transformate block and glue the result.
12808 # @param Block Hexahedral solid to be multi-transformed.
12809 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12810 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12811 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12812 # @param theName Object name; when specified, this parameter is used
12813 # for result publication in the study. Otherwise, if automatic
12814 # publication is switched on, default value is used for result name.
12816 # @return New GEOM.GEOM_Object, containing the result shape.
12818 # @ref tui_multi_transformation "Example"
12819 @ManageTransactions("BlocksOp")
12820 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12821 DirFace1V, DirFace2V, NbTimesV, theName=None):
12823 Multi-transformate block and glue the result.
12826 Block Hexahedral solid to be multi-transformed.
12827 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12828 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12829 NbTimesU,NbTimesV Quantity of transformations to be done.
12830 theName Object name; when specified, this parameter is used
12831 for result publication in the study. Otherwise, if automatic
12832 publication is switched on, default value is used for result name.
12835 New GEOM.GEOM_Object, containing the result shape.
12837 # Example: see GEOM_Spanner.py
12838 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12839 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12840 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12841 DirFace1V, DirFace2V, NbTimesV)
12842 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12843 anObj.SetParameters(Parameters)
12844 self._autoPublish(anObj, theName, "transformed")
12847 ## Build all possible propagation groups.
12848 # Propagation group is a set of all edges, opposite to one (main)
12849 # edge of this group directly or through other opposite edges.
12850 # Notion of Opposite Edge make sence only on quadrangle face.
12851 # @param theShape Shape to build propagation groups on.
12852 # @param theName Object name; when specified, this parameter is used
12853 # for result publication in the study. Otherwise, if automatic
12854 # publication is switched on, default value is used for result name.
12856 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12858 # @ref swig_Propagate "Example"
12859 @ManageTransactions("BlocksOp")
12860 def Propagate(self, theShape, theName=None):
12862 Build all possible propagation groups.
12863 Propagation group is a set of all edges, opposite to one (main)
12864 edge of this group directly or through other opposite edges.
12865 Notion of Opposite Edge make sence only on quadrangle face.
12868 theShape Shape to build propagation groups on.
12869 theName Object name; when specified, this parameter is used
12870 for result publication in the study. Otherwise, if automatic
12871 publication is switched on, default value is used for result name.
12874 List of GEOM.GEOM_Object, each of them is a propagation group.
12876 # Example: see GEOM_TestOthers.py
12877 listChains = self.BlocksOp.Propagate(theShape)
12878 RaiseIfFailed("Propagate", self.BlocksOp)
12879 self._autoPublish(listChains, theName, "propagate")
12882 # end of l3_blocks_op
12885 ## @addtogroup l3_groups
12888 ## Creates a new group which will store sub-shapes of theMainShape
12889 # @param theMainShape is a GEOM object on which the group is selected
12890 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12891 # @param theName Object name; when specified, this parameter is used
12892 # for result publication in the study. Otherwise, if automatic
12893 # publication is switched on, default value is used for result name.
12895 # @return a newly created GEOM group (GEOM.GEOM_Object)
12897 # @ref tui_working_with_groups_page "Example 1"
12898 # \n @ref swig_CreateGroup "Example 2"
12899 @ManageTransactions("GroupOp")
12900 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12902 Creates a new group which will store sub-shapes of theMainShape
12905 theMainShape is a GEOM object on which the group is selected
12906 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12907 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12908 theName Object name; when specified, this parameter is used
12909 for result publication in the study. Otherwise, if automatic
12910 publication is switched on, default value is used for result name.
12913 a newly created GEOM group
12916 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12919 # Example: see GEOM_TestOthers.py
12920 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12921 RaiseIfFailed("CreateGroup", self.GroupOp)
12922 self._autoPublish(anObj, theName, "group")
12925 ## Adds a sub-object with ID theSubShapeId to the group
12926 # @param theGroup is a GEOM group to which the new sub-shape is added
12927 # @param theSubShapeID is a sub-shape ID in the main object.
12928 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12930 # @ref tui_working_with_groups_page "Example"
12931 @ManageTransactions("GroupOp")
12932 def AddObject(self,theGroup, theSubShapeID):
12934 Adds a sub-object with ID theSubShapeId to the group
12937 theGroup is a GEOM group to which the new sub-shape is added
12938 theSubShapeID is a sub-shape ID in the main object.
12941 Use method GetSubShapeID() to get an unique ID of the sub-shape
12943 # Example: see GEOM_TestOthers.py
12944 self.GroupOp.AddObject(theGroup, theSubShapeID)
12945 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
12946 RaiseIfFailed("AddObject", self.GroupOp)
12950 ## Removes a sub-object with ID \a theSubShapeId from the group
12951 # @param theGroup is a GEOM group from which the new sub-shape is removed
12952 # @param theSubShapeID is a sub-shape ID in the main object.
12953 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12955 # @ref tui_working_with_groups_page "Example"
12956 @ManageTransactions("GroupOp")
12957 def RemoveObject(self,theGroup, theSubShapeID):
12959 Removes a sub-object with ID theSubShapeId from the group
12962 theGroup is a GEOM group from which the new sub-shape is removed
12963 theSubShapeID is a sub-shape ID in the main object.
12966 Use method GetSubShapeID() to get an unique ID of the sub-shape
12968 # Example: see GEOM_TestOthers.py
12969 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
12970 RaiseIfFailed("RemoveObject", self.GroupOp)
12973 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12974 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12975 # @param theSubShapes is a list of sub-shapes to be added.
12977 # @ref tui_working_with_groups_page "Example"
12978 @ManageTransactions("GroupOp")
12979 def UnionList (self,theGroup, theSubShapes):
12981 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12984 theGroup is a GEOM group to which the new sub-shapes are added.
12985 theSubShapes is a list of sub-shapes to be added.
12987 # Example: see GEOM_TestOthers.py
12988 self.GroupOp.UnionList(theGroup, theSubShapes)
12989 RaiseIfFailed("UnionList", self.GroupOp)
12992 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
12993 # @param theGroup is a GEOM group to which the new sub-shapes are added.
12994 # @param theSubShapes is a list of indices of sub-shapes to be added.
12996 # @ref swig_UnionIDs "Example"
12997 @ManageTransactions("GroupOp")
12998 def UnionIDs(self,theGroup, theSubShapes):
13000 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
13003 theGroup is a GEOM group to which the new sub-shapes are added.
13004 theSubShapes is a list of indices of sub-shapes to be added.
13006 # Example: see GEOM_TestOthers.py
13007 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13008 RaiseIfFailed("UnionIDs", self.GroupOp)
13011 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13012 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13013 # @param theSubShapes is a list of sub-shapes to be removed.
13015 # @ref tui_working_with_groups_page "Example"
13016 @ManageTransactions("GroupOp")
13017 def DifferenceList (self,theGroup, theSubShapes):
13019 Removes from the group all the given shapes. No errors, if some shapes are not included.
13022 theGroup is a GEOM group from which the sub-shapes are removed.
13023 theSubShapes is a list of sub-shapes to be removed.
13025 # Example: see GEOM_TestOthers.py
13026 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13027 RaiseIfFailed("DifferenceList", self.GroupOp)
13030 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13031 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13032 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13034 # @ref swig_DifferenceIDs "Example"
13035 @ManageTransactions("GroupOp")
13036 def DifferenceIDs(self,theGroup, theSubShapes):
13038 Removes from the group all the given shapes. No errors, if some shapes are not included.
13041 theGroup is a GEOM group from which the sub-shapes are removed.
13042 theSubShapes is a list of indices of sub-shapes to be removed.
13044 # Example: see GEOM_TestOthers.py
13045 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13046 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13049 ## Union of two groups.
13050 # New group is created. It will contain all entities
13051 # which are present in groups theGroup1 and theGroup2.
13052 # @param theGroup1, theGroup2 are the initial GEOM groups
13053 # to create the united group from.
13054 # @param theName Object name; when specified, this parameter is used
13055 # for result publication in the study. Otherwise, if automatic
13056 # publication is switched on, default value is used for result name.
13058 # @return a newly created GEOM group.
13060 # @ref tui_union_groups_anchor "Example"
13061 @ManageTransactions("GroupOp")
13062 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13064 Union of two groups.
13065 New group is created. It will contain all entities
13066 which are present in groups theGroup1 and theGroup2.
13069 theGroup1, theGroup2 are the initial GEOM groups
13070 to create the united group from.
13071 theName Object name; when specified, this parameter is used
13072 for result publication in the study. Otherwise, if automatic
13073 publication is switched on, default value is used for result name.
13076 a newly created GEOM group.
13078 # Example: see GEOM_TestOthers.py
13079 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13080 RaiseIfFailed("UnionGroups", self.GroupOp)
13081 self._autoPublish(aGroup, theName, "group")
13084 ## Intersection of two groups.
13085 # New group is created. It will contain only those entities
13086 # which are present in both groups theGroup1 and theGroup2.
13087 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13088 # @param theName Object name; when specified, this parameter is used
13089 # for result publication in the study. Otherwise, if automatic
13090 # publication is switched on, default value is used for result name.
13092 # @return a newly created GEOM group.
13094 # @ref tui_intersect_groups_anchor "Example"
13095 @ManageTransactions("GroupOp")
13096 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13098 Intersection of two groups.
13099 New group is created. It will contain only those entities
13100 which are present in both groups theGroup1 and theGroup2.
13103 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13104 theName Object name; when specified, this parameter is used
13105 for result publication in the study. Otherwise, if automatic
13106 publication is switched on, default value is used for result name.
13109 a newly created GEOM group.
13111 # Example: see GEOM_TestOthers.py
13112 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13113 RaiseIfFailed("IntersectGroups", self.GroupOp)
13114 self._autoPublish(aGroup, theName, "group")
13117 ## Cut of two groups.
13118 # New group is created. It will contain entities which are
13119 # present in group theGroup1 but are not present in group theGroup2.
13120 # @param theGroup1 is a GEOM group to include elements of.
13121 # @param theGroup2 is a GEOM group to exclude elements of.
13122 # @param theName Object name; when specified, this parameter is used
13123 # for result publication in the study. Otherwise, if automatic
13124 # publication is switched on, default value is used for result name.
13126 # @return a newly created GEOM group.
13128 # @ref tui_cut_groups_anchor "Example"
13129 @ManageTransactions("GroupOp")
13130 def CutGroups (self, theGroup1, theGroup2, theName=None):
13133 New group is created. It will contain entities which are
13134 present in group theGroup1 but are not present in group theGroup2.
13137 theGroup1 is a GEOM group to include elements of.
13138 theGroup2 is a GEOM group to exclude elements of.
13139 theName Object name; when specified, this parameter is used
13140 for result publication in the study. Otherwise, if automatic
13141 publication is switched on, default value is used for result name.
13144 a newly created GEOM group.
13146 # Example: see GEOM_TestOthers.py
13147 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13148 RaiseIfFailed("CutGroups", self.GroupOp)
13149 self._autoPublish(aGroup, theName, "group")
13152 ## Union of list of groups.
13153 # New group is created. It will contain all entities that are
13154 # present in groups listed in theGList.
13155 # @param theGList is a list of GEOM groups to create the united group from.
13156 # @param theName Object name; when specified, this parameter is used
13157 # for result publication in the study. Otherwise, if automatic
13158 # publication is switched on, default value is used for result name.
13160 # @return a newly created GEOM group.
13162 # @ref tui_union_groups_anchor "Example"
13163 @ManageTransactions("GroupOp")
13164 def UnionListOfGroups (self, theGList, theName=None):
13166 Union of list of groups.
13167 New group is created. It will contain all entities that are
13168 present in groups listed in theGList.
13171 theGList is a list of GEOM groups to create the united group from.
13172 theName Object name; when specified, this parameter is used
13173 for result publication in the study. Otherwise, if automatic
13174 publication is switched on, default value is used for result name.
13177 a newly created GEOM group.
13179 # Example: see GEOM_TestOthers.py
13180 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13181 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13182 self._autoPublish(aGroup, theName, "group")
13185 ## Cut of lists of groups.
13186 # New group is created. It will contain only entities
13187 # which are present in groups listed in theGList.
13188 # @param theGList is a list of GEOM groups to include elements of.
13189 # @param theName Object name; when specified, this parameter is used
13190 # for result publication in the study. Otherwise, if automatic
13191 # publication is switched on, default value is used for result name.
13193 # @return a newly created GEOM group.
13195 # @ref tui_intersect_groups_anchor "Example"
13196 @ManageTransactions("GroupOp")
13197 def IntersectListOfGroups (self, theGList, theName=None):
13199 Cut of lists of groups.
13200 New group is created. It will contain only entities
13201 which are present in groups listed in theGList.
13204 theGList is a list of GEOM groups to include elements of.
13205 theName Object name; when specified, this parameter is used
13206 for result publication in the study. Otherwise, if automatic
13207 publication is switched on, default value is used for result name.
13210 a newly created GEOM group.
13212 # Example: see GEOM_TestOthers.py
13213 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13214 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13215 self._autoPublish(aGroup, theName, "group")
13218 ## Cut of lists of groups.
13219 # New group is created. It will contain only entities
13220 # which are present in groups listed in theGList1 but
13221 # are not present in groups from theGList2.
13222 # @param theGList1 is a list of GEOM groups to include elements of.
13223 # @param theGList2 is a list of GEOM groups to exclude elements of.
13224 # @param theName Object name; when specified, this parameter is used
13225 # for result publication in the study. Otherwise, if automatic
13226 # publication is switched on, default value is used for result name.
13228 # @return a newly created GEOM group.
13230 # @ref tui_cut_groups_anchor "Example"
13231 @ManageTransactions("GroupOp")
13232 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13234 Cut of lists of groups.
13235 New group is created. It will contain only entities
13236 which are present in groups listed in theGList1 but
13237 are not present in groups from theGList2.
13240 theGList1 is a list of GEOM groups to include elements of.
13241 theGList2 is a list of GEOM groups to exclude elements of.
13242 theName Object name; when specified, this parameter is used
13243 for result publication in the study. Otherwise, if automatic
13244 publication is switched on, default value is used for result name.
13247 a newly created GEOM group.
13249 # Example: see GEOM_TestOthers.py
13250 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13251 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13252 self._autoPublish(aGroup, theName, "group")
13255 ## Returns a list of sub-objects ID stored in the group
13256 # @param theGroup is a GEOM group for which a list of IDs is requested
13258 # @ref swig_GetObjectIDs "Example"
13259 @ManageTransactions("GroupOp")
13260 def GetObjectIDs(self,theGroup):
13262 Returns a list of sub-objects ID stored in the group
13265 theGroup is a GEOM group for which a list of IDs is requested
13267 # Example: see GEOM_TestOthers.py
13268 ListIDs = self.GroupOp.GetObjects(theGroup)
13269 RaiseIfFailed("GetObjects", self.GroupOp)
13272 ## Returns a type of sub-objects stored in the group
13273 # @param theGroup is a GEOM group which type is returned.
13275 # @ref swig_GetType "Example"
13276 @ManageTransactions("GroupOp")
13277 def GetType(self,theGroup):
13279 Returns a type of sub-objects stored in the group
13282 theGroup is a GEOM group which type is returned.
13284 # Example: see GEOM_TestOthers.py
13285 aType = self.GroupOp.GetType(theGroup)
13286 RaiseIfFailed("GetType", self.GroupOp)
13289 ## Convert a type of geom object from id to string value
13290 # @param theId is a GEOM obect type id.
13291 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13292 # @ref swig_GetType "Example"
13293 def ShapeIdToType(self, theId):
13295 Convert a type of geom object from id to string value
13298 theId is a GEOM obect type id.
13301 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13328 return "REVOLUTION"
13376 return "FREE_BOUNDS"
13384 return "THRUSECTIONS"
13386 return "COMPOUNDFILTER"
13388 return "SHAPES_ON_SHAPE"
13390 return "ELLIPSE_ARC"
13392 return "3DSKETCHER"
13398 return "PIPETSHAPE"
13399 return "Shape Id not exist."
13401 ## Returns a main shape associated with the group
13402 # @param theGroup is a GEOM group for which a main shape object is requested
13403 # @return a GEOM object which is a main shape for theGroup
13405 # @ref swig_GetMainShape "Example"
13406 @ManageTransactions("GroupOp")
13407 def GetMainShape(self,theGroup):
13409 Returns a main shape associated with the group
13412 theGroup is a GEOM group for which a main shape object is requested
13415 a GEOM object which is a main shape for theGroup
13417 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13419 # Example: see GEOM_TestOthers.py
13420 anObj = self.GroupOp.GetMainShape(theGroup)
13421 RaiseIfFailed("GetMainShape", self.GroupOp)
13424 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13425 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13426 # @param theShape given shape (see GEOM.GEOM_Object)
13427 # @param min_length minimum length of edges of theShape
13428 # @param max_length maximum length of edges of theShape
13429 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13430 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13431 # @param theName Object name; when specified, this parameter is used
13432 # for result publication in the study. Otherwise, if automatic
13433 # publication is switched on, default value is used for result name.
13435 # @return a newly created GEOM group of edges
13437 # @@ref swig_todo "Example"
13438 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13440 Create group of edges of theShape, whose length is in range [min_length, max_length].
13441 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13444 theShape given shape
13445 min_length minimum length of edges of theShape
13446 max_length maximum length of edges of theShape
13447 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13448 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13449 theName Object name; when specified, this parameter is used
13450 for result publication in the study. Otherwise, if automatic
13451 publication is switched on, default value is used for result name.
13454 a newly created GEOM group of edges.
13456 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13457 edges_in_range = []
13459 Props = self.BasicProperties(edge)
13460 if min_length <= Props[0] and Props[0] <= max_length:
13461 if (not include_min) and (min_length == Props[0]):
13464 if (not include_max) and (Props[0] == max_length):
13467 edges_in_range.append(edge)
13469 if len(edges_in_range) <= 0:
13470 print("No edges found by given criteria")
13473 # note: auto-publishing is done in self.CreateGroup()
13474 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13475 self.UnionList(group_edges, edges_in_range)
13479 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13480 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13481 # @param min_length minimum length of edges of selected shape
13482 # @param max_length maximum length of edges of selected shape
13483 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13484 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13485 # @return a newly created GEOM group of edges
13486 # @ref swig_todo "Example"
13487 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13489 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13490 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13493 min_length minimum length of edges of selected shape
13494 max_length maximum length of edges of selected shape
13495 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13496 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13499 a newly created GEOM group of edges.
13501 nb_selected = sg.SelectedCount()
13502 if nb_selected < 1:
13503 print("Select a shape before calling this function, please.")
13505 if nb_selected > 1:
13506 print("Only one shape must be selected")
13509 id_shape = sg.getSelected(0)
13510 shape = IDToObject( id_shape )
13512 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13516 if include_min: left_str = " <= "
13517 if include_max: right_str = " <= "
13519 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13520 + left_str + "length" + right_str + repr(max_length))
13522 sg.updateObjBrowser()
13529 #@@ insert new functions before this line @@ do not remove this line @@#
13531 ## Create a copy of the given object
13533 # @param theOriginal geometry object for copy
13534 # @param theName Object name; when specified, this parameter is used
13535 # for result publication in the study. Otherwise, if automatic
13536 # publication is switched on, default value is used for result name.
13538 # @return New GEOM_Object, containing the copied shape.
13540 # @ingroup l1_geomBuilder_auxiliary
13541 # @ref swig_MakeCopy "Example"
13542 @ManageTransactions("InsertOp")
13543 def MakeCopy(self, theOriginal, theName=None):
13545 Create a copy of the given object
13548 theOriginal geometry object for copy
13549 theName Object name; when specified, this parameter is used
13550 for result publication in the study. Otherwise, if automatic
13551 publication is switched on, default value is used for result name.
13554 New GEOM_Object, containing the copied shape.
13556 Example of usage: Copy = geompy.MakeCopy(Box)
13558 # Example: see GEOM_TestAll.py
13559 anObj = self.InsertOp.MakeCopy(theOriginal)
13560 RaiseIfFailed("MakeCopy", self.InsertOp)
13561 self._autoPublish(anObj, theName, "copy")
13564 ## Add Path to load python scripts from
13565 # @param Path a path to load python scripts from
13566 # @ingroup l1_geomBuilder_auxiliary
13567 def addPath(self,Path):
13569 Add Path to load python scripts from
13572 Path a path to load python scripts from
13574 if (sys.path.count(Path) < 1):
13575 sys.path.append(Path)
13579 ## Load marker texture from the file
13580 # @param Path a path to the texture file
13581 # @return unique texture identifier
13582 # @ingroup l1_geomBuilder_auxiliary
13583 @ManageTransactions("InsertOp")
13584 def LoadTexture(self, Path):
13586 Load marker texture from the file
13589 Path a path to the texture file
13592 unique texture identifier
13594 # Example: see GEOM_TestAll.py
13595 ID = self.InsertOp.LoadTexture(Path)
13596 RaiseIfFailed("LoadTexture", self.InsertOp)
13599 ## Get internal name of the object based on its study entry
13600 # @note This method does not provide an unique identifier of the geometry object.
13601 # @note This is internal function of GEOM component, though it can be used outside it for
13602 # appropriate reason (e.g. for identification of geometry object).
13603 # @param obj geometry object
13604 # @return unique object identifier
13605 # @ingroup l1_geomBuilder_auxiliary
13606 def getObjectID(self, obj):
13608 Get internal name of the object based on its study entry.
13609 Note: this method does not provide an unique identifier of the geometry object.
13610 It is an internal function of GEOM component, though it can be used outside GEOM for
13611 appropriate reason (e.g. for identification of geometry object).
13614 obj geometry object
13617 unique object identifier
13620 entry = salome.ObjectToID(obj)
13621 if entry is not None:
13622 lst = entry.split(":")
13624 ID = lst[-1] # -1 means last item in the list
13625 return "GEOM_" + ID
13630 ## Add marker texture. @a Width and @a Height parameters
13631 # specify width and height of the texture in pixels.
13632 # If @a RowData is @c True, @a Texture parameter should represent texture data
13633 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13634 # parameter should be unpacked string, in which '1' symbols represent opaque
13635 # pixels and '0' represent transparent pixels of the texture bitmap.
13637 # @param Width texture width in pixels
13638 # @param Height texture height in pixels
13639 # @param Texture texture data
13640 # @param RowData if @c True, @a Texture data are packed in the byte stream
13641 # @return unique texture identifier
13642 # @ingroup l1_geomBuilder_auxiliary
13643 @ManageTransactions("InsertOp")
13644 def AddTexture(self, Width, Height, Texture, RowData=False):
13646 Add marker texture. Width and Height parameters
13647 specify width and height of the texture in pixels.
13648 If RowData is True, Texture parameter should represent texture data
13649 packed into the byte array. If RowData is False (default), Texture
13650 parameter should be unpacked string, in which '1' symbols represent opaque
13651 pixels and '0' represent transparent pixels of the texture bitmap.
13654 Width texture width in pixels
13655 Height texture height in pixels
13656 Texture texture data
13657 RowData if True, Texture data are packed in the byte stream
13660 return unique texture identifier
13662 if not RowData: Texture = PackData(Texture)
13663 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13664 RaiseIfFailed("AddTexture", self.InsertOp)
13667 ## Transfer not topological data from one GEOM object to another.
13669 # @param theObjectFrom the source object of non-topological data
13670 # @param theObjectTo the destination object of non-topological data
13671 # @param theFindMethod method to search sub-shapes of theObjectFrom
13672 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13673 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13674 # Other values of GEOM.find_shape_method are not supported.
13676 # @return True in case of success; False otherwise.
13678 # @ingroup l1_geomBuilder_auxiliary
13680 # @ref swig_TransferData "Example"
13681 @ManageTransactions("InsertOp")
13682 def TransferData(self, theObjectFrom, theObjectTo,
13683 theFindMethod=GEOM.FSM_GetInPlace):
13685 Transfer not topological data from one GEOM object to another.
13688 theObjectFrom the source object of non-topological data
13689 theObjectTo the destination object of non-topological data
13690 theFindMethod method to search sub-shapes of theObjectFrom
13691 in shape theObjectTo. Possible values are:
13692 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13693 and GEOM.FSM_GetInPlace_Old. Other values of
13694 GEOM.find_shape_method are not supported.
13697 True in case of success; False otherwise.
13699 # Example: see GEOM_TestOthers.py
13701 # Example: see GEOM_TestAll.py
13702 isOk = self.InsertOp.TransferData(theObjectFrom,
13703 theObjectTo, theFindMethod)
13704 RaiseIfFailed("TransferData", self.InsertOp)
13707 ## Creates a new folder object. It is a container for any GEOM objects.
13708 # @param Name name of the container
13709 # @param Father parent object. If None,
13710 # folder under 'Geometry' root object will be created.
13711 # @return a new created folder
13712 # @ingroup l1_publish_data
13713 def NewFolder(self, Name, Father=None):
13715 Create a new folder object. It is an auxiliary container for any GEOM objects.
13718 Name name of the container
13719 Father parent object. If None,
13720 folder under 'Geometry' root object will be created.
13723 a new created folder
13725 if not Father: Father = self.father
13726 return self.CreateFolder(Name, Father)
13728 ## Move object to the specified folder
13729 # @param Object object to move
13730 # @param Folder target folder
13731 # @ingroup l1_publish_data
13732 def PutToFolder(self, Object, Folder):
13734 Move object to the specified folder
13737 Object object to move
13738 Folder target folder
13740 self.MoveToFolder(Object, Folder)
13743 ## Move list of objects to the specified folder
13744 # @param ListOfSO list of objects to move
13745 # @param Folder target folder
13746 # @ingroup l1_publish_data
13747 def PutListToFolder(self, ListOfSO, Folder):
13749 Move list of objects to the specified folder
13752 ListOfSO list of objects to move
13753 Folder target folder
13755 self.MoveListToFolder(ListOfSO, Folder)
13758 ## @addtogroup l2_field
13762 # @param shape the shape the field lies on
13763 # @param name the field name
13764 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13765 # @param dimension dimension of the shape the field lies on
13766 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13767 # @param componentNames names of components
13768 # @return a created field
13769 @ManageTransactions("FieldOp")
13770 def CreateField(self, shape, name, type, dimension, componentNames):
13775 shape the shape the field lies on
13776 name the field name
13777 type type of field data
13778 dimension dimension of the shape the field lies on
13779 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13780 componentNames names of components
13785 if isinstance( type, int ):
13786 if type < 0 or type > 3:
13787 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13788 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13790 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13791 RaiseIfFailed("CreateField", self.FieldOp)
13793 geom._autoPublish( f, "", name)
13796 ## Removes a field from the GEOM component
13797 # @param field the field to remove
13798 def RemoveField(self, field):
13799 "Removes a field from the GEOM component"
13801 if isinstance( field, GEOM._objref_GEOM_Field ):
13802 geom.RemoveObject( field )
13803 elif isinstance( field, geomField ):
13804 geom.RemoveObject( field.field )
13806 raise RuntimeError("RemoveField() : the object is not a field")
13809 ## Returns number of fields on a shape
13810 @ManageTransactions("FieldOp")
13811 def CountFields(self, shape):
13812 "Returns number of fields on a shape"
13813 nb = self.FieldOp.CountFields( shape )
13814 RaiseIfFailed("CountFields", self.FieldOp)
13817 ## Returns all fields on a shape
13818 @ManageTransactions("FieldOp")
13819 def GetFields(self, shape):
13820 "Returns all fields on a shape"
13821 ff = self.FieldOp.GetFields( shape )
13822 RaiseIfFailed("GetFields", self.FieldOp)
13825 ## Returns a field on a shape by its name
13826 @ManageTransactions("FieldOp")
13827 def GetField(self, shape, name):
13828 "Returns a field on a shape by its name"
13829 f = self.FieldOp.GetField( shape, name )
13830 RaiseIfFailed("GetField", self.FieldOp)
13837 # Register the new proxy for GEOM_Gen
13838 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13841 ## Field on Geometry
13842 # @ingroup l2_field
13843 class geomField( GEOM._objref_GEOM_Field ):
13845 def __init__(self, *args):
13846 GEOM._objref_GEOM_Field.__init__(self, *args)
13847 self.field = GEOM._objref_GEOM_Field
13850 ## Returns the shape the field lies on
13851 def getShape(self):
13852 "Returns the shape the field lies on"
13853 return self.field.GetShape(self)
13855 ## Returns the field name
13857 "Returns the field name"
13858 return self.field.GetName(self)
13860 ## Returns type of field data as integer [0-3]
13862 "Returns type of field data"
13863 return EnumToLong(self.field.GetDataType(self))
13865 ## Returns type of field data:
13866 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13867 def getTypeEnum(self):
13868 "Returns type of field data"
13869 return self.field.GetDataType(self)
13871 ## Returns dimension of the shape the field lies on:
13872 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13873 def getDimension(self):
13874 """Returns dimension of the shape the field lies on:
13875 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13876 return self.field.GetDimension(self)
13878 ## Returns names of components
13879 def getComponents(self):
13880 "Returns names of components"
13881 return self.field.GetComponents(self)
13883 ## Adds a time step to the field
13884 # @param step the time step number further used as the step identifier
13885 # @param stamp the time step time
13886 # @param values the values of the time step
13887 def addStep(self, step, stamp, values):
13888 "Adds a time step to the field"
13889 stp = self.field.AddStep( self, step, stamp )
13891 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
13893 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13894 self.setValues( step, values )
13897 ## Remove a time step from the field
13898 def removeStep(self,step):
13899 "Remove a time step from the field"
13902 stepObj = self.field.GetStep( self, step )
13904 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13907 #traceback.print_exc()
13909 self.field.RemoveStep( self, step )
13911 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13914 ## Returns number of time steps in the field
13915 def countSteps(self):
13916 "Returns number of time steps in the field"
13917 return self.field.CountSteps(self)
13919 ## Returns a list of time step IDs in the field
13920 def getSteps(self):
13921 "Returns a list of time step IDs in the field"
13922 return self.field.GetSteps(self)
13924 ## Returns a time step by its ID
13925 def getStep(self,step):
13926 "Returns a time step by its ID"
13927 stp = self.field.GetStep(self, step)
13929 raise RuntimeError("Step %s is missing from this field"%step)
13932 ## Returns the time of the field step
13933 def getStamp(self,step):
13934 "Returns the time of the field step"
13935 return self.getStep(step).GetStamp()
13937 ## Changes the time of the field step
13938 def setStamp(self, step, stamp):
13939 "Changes the time of the field step"
13940 return self.getStep(step).SetStamp(stamp)
13942 ## Returns values of the field step
13943 def getValues(self, step):
13944 "Returns values of the field step"
13945 return self.getStep(step).GetValues()
13947 ## Changes values of the field step
13948 def setValues(self, step, values):
13949 "Changes values of the field step"
13950 stp = self.getStep(step)
13951 errBeg = "Field.setValues(values) : Error: "
13953 ok = stp.SetValues( values )
13954 except Exception as e:
13956 if excStr.find("WrongPythonType") > 0:
13957 raise RuntimeError(errBeg +\
13958 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
13959 raise RuntimeError(errBeg + str(e))
13961 nbOK = self.field.GetArraySize(self)
13964 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
13966 raise RuntimeError(errBeg + "failed")
13969 pass # end of class geomField
13971 # Register the new proxy for GEOM_Field
13972 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
13975 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
13976 # interface to GEOM operations.
13981 # salome.salome_init()
13982 # from salome.geom import geomBuilder
13983 # geompy = geomBuilder.New()
13985 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
13986 # @return geomBuilder instance
13987 def New( instance=None):
13989 Create a new geomBuilder instance.The geomBuilder class provides the Python
13990 interface to GEOM operations.
13994 salome.salome_init()
13995 from salome.geom import geomBuilder
13996 geompy = geomBuilder.New()
13999 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14001 geomBuilder instance
14003 #print "New geomBuilder ", study, instance
14010 geom = geomBuilder()
14011 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14016 # Register methods from the plug-ins in the geomBuilder class
14017 plugins_var = os.environ.get( "GEOM_PluginsList" )
14020 if plugins_var is not None:
14021 plugins = plugins_var.split( ":" )
14022 plugins=[x for x in plugins if len(x)>0]
14023 if plugins is not None:
14024 for pluginName in plugins:
14025 pluginBuilderName = pluginName + "Builder"
14027 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14028 except Exception as e:
14029 from salome_utils import verbose
14030 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14032 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14033 plugin = eval( pluginBuilderName )
14035 # add methods from plugin module to the geomBuilder class
14036 for k in dir( plugin ):
14037 if k[0] == '_': continue
14038 method = getattr( plugin, k )
14039 if type( method ).__name__ == 'function':
14040 if not hasattr( geomBuilder, k ):
14041 setattr( geomBuilder, k, method )