1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New()
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New()
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still contains all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New()
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
245 # initialize SALOME session in try/except block
246 # to avoid problems in some cases, e.g. when generating documentation
254 from salome_notebook import *
261 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
263 # In case the omniORBpy EnumItem class does not fully support Python 3
264 # (for instance in version 4.2.1-2), the comparison ordering methods must be
268 GEOM.COMPOUND < GEOM.SOLID
270 def enumitem_eq(self, other):
272 if isinstance(other, omniORB.EnumItem):
273 if other._parent_id == self._parent_id:
274 return self._v == other._v
276 return self._parent_id == other._parent_id
278 return id(self) == id(other)
280 return id(self) == id(other)
282 def enumitem_lt(self, other):
284 if isinstance(other, omniORB.EnumItem):
285 if other._parent_id == self._parent_id:
286 return self._v < other._v
288 return self._parent_id < other._parent_id
290 return id(self) < id(other)
292 return id(self) < id(other)
294 def enumitem_le(self, other):
296 if isinstance(other, omniORB.EnumItem):
297 if other._parent_id == self._parent_id:
298 return self._v <= other._v
300 return self._parent_id <= other._parent_id
302 return id(self) <= id(other)
304 return id(self) <= id(other)
306 def enumitem_gt(self, other):
308 if isinstance(other, omniORB.EnumItem):
309 if other._parent_id == self._parent_id:
310 return self._v > other._v
312 return self._parent_id > other._parent_id
314 return id(self) > id(other)
316 return id(self) > id(other)
318 def enumitem_ge(self, other):
320 if isinstance(other, omniORB.EnumItem):
321 if other._parent_id == self._parent_id:
322 return self._v >= other._v
324 return self._parent_id >= other._parent_id
326 return id(self) >= id(other)
328 return id(self) >= id(other)
330 GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
331 GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
332 GEOM.omniORB.EnumItem.__le__ = enumitem_le
333 GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
334 GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
335 omniORB.EnumItem.__eq__ = enumitem_eq
336 omniORB.EnumItem.__lt__ = enumitem_lt
337 omniORB.EnumItem.__le__ = enumitem_le
338 omniORB.EnumItem.__gt__ = enumitem_gt
339 omniORB.EnumItem.__ge__ = enumitem_ge
342 def _toListOfNames(_names, _size=-1):
345 if type(_names) in [list, tuple]:
346 for i in _names: l.append(i)
349 if l and len(l) < _size:
350 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
353 # Decorator function to manage transactions for all geometric operations.
354 def ManageTransactions(theOpeName):
355 def MTDecorator(theFunction):
356 # To keep the original function name an documentation.
357 @functools.wraps(theFunction)
358 def OpenCallClose(self, *args, **kwargs):
360 anOperation = getattr(self, theOpeName)
361 anOperation.StartOperation()
364 res = theFunction(self, *args, **kwargs)
366 anOperation.FinishOperation()
370 anOperation.AbortOperation()
375 ## Raise an Error, containing the Method_name, if Operation is Failed
376 ## @ingroup l1_geomBuilder_auxiliary
377 def RaiseIfFailed (Method_name, Operation):
378 if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
379 raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
381 ## Return list of variables value from salome notebook
382 ## @ingroup l1_geomBuilder_auxiliary
383 def ParseParameters(*parameters):
386 for parameter in parameters:
387 if isinstance(parameter, list):
388 lResults = ParseParameters(*parameter)
389 if len(lResults) > 0:
390 Result.append(lResults[:-1])
391 StringResult += lResults[-1].split(":")
395 if isinstance(parameter,str):
396 if notebook.isVariable(parameter):
397 Result.append(notebook.get(parameter))
399 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
402 Result.append(parameter)
404 StringResult.append(str(parameter))
408 Result.append(":".join(StringResult))
410 Result = ":".join(StringResult)
413 ## Return list of variables value from salome notebook
414 ## @ingroup l1_geomBuilder_auxiliary
418 for parameter in list:
419 if isinstance(parameter,str) and notebook.isVariable(parameter):
420 Result.append(str(notebook.get(parameter)))
423 Result.append(str(parameter))
426 StringResult = StringResult + str(parameter)
427 StringResult = StringResult + ":"
429 StringResult = StringResult[:len(StringResult)-1]
430 return Result, StringResult
432 ## Return list of variables value from salome notebook
433 ## @ingroup l1_geomBuilder_auxiliary
434 def ParseSketcherCommand(command):
437 sections = command.split(":")
438 for section in sections:
439 parameters = section.split(" ")
441 for parameter in parameters:
442 if paramIndex > 1 and parameter.find("'") != -1:
443 parameter = parameter.replace("'","")
444 if notebook.isVariable(parameter):
445 Result = Result + str(notebook.get(parameter)) + " "
448 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
452 Result = Result + str(parameter) + " "
455 StringResult = StringResult + parameter
456 StringResult = StringResult + ":"
458 paramIndex = paramIndex + 1
460 Result = Result[:len(Result)-1] + ":"
462 Result = Result[:len(Result)-1]
463 return Result, StringResult
465 ## Helper function which can be used to pack the passed string to the byte data.
466 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
467 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
470 ## val = PackData("10001110") # val = 0xAE
471 ## val = PackData("1") # val = 0x80
473 ## @param data unpacked data - a string containing '1' and '0' symbols
474 ## @return data packed to the byte stream
475 ## @ingroup l1_geomBuilder_auxiliary
478 Helper function which can be used to pack the passed string to the byte data.
479 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
480 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
483 data unpacked data - a string containing '1' and '0' symbols
486 data packed to the byte stream
489 val = PackData("10001110") # val = 0xAE
490 val = PackData("1") # val = 0x80
493 if len(data)%8: bytes += 1
495 for b in range(bytes):
496 d = data[b*8:(b+1)*8]
501 if d[i] == "1": val += 1
503 raise "Invalid symbol %s" % d[i]
510 ## Read bitmap texture from the text file.
511 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
512 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
513 ## The function returns width and height of the pixmap in pixels and byte stream representing
514 ## texture bitmap itself.
516 ## This function can be used to read the texture to the byte stream in order to pass it to
517 ## the AddTexture() function of geomBuilder class.
520 ## from salome.geom import geomBuilder
521 ## geompy = geomBuilder.New()
522 ## texture = geompy.readtexture('mytexture.dat')
523 ## texture = geompy.AddTexture(*texture)
524 ## obj.SetMarkerTexture(texture)
526 ## @param fname texture file name
527 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
528 ## @ingroup l1_geomBuilder_auxiliary
529 def ReadTexture(fname):
531 Read bitmap texture from the text file.
532 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
533 A zero symbol ('0') represents transparent pixel of the texture bitmap.
534 The function returns width and height of the pixmap in pixels and byte stream representing
535 texture bitmap itself.
536 This function can be used to read the texture to the byte stream in order to pass it to
537 the AddTexture() function of geomBuilder class.
540 fname texture file name
543 sequence of tree values: texture's width, height in pixels and its byte stream
546 from salome.geom import geomBuilder
547 geompy = geomBuilder.New()
548 texture = geompy.readtexture('mytexture.dat')
549 texture = geompy.AddTexture(*texture)
550 obj.SetMarkerTexture(texture)
554 lines = [ l.strip() for l in f.readlines()]
557 if lines: maxlen = max([len(x) for x in lines])
559 if maxlen%8: lenbytes += 1
563 lenline = (len(line)/8+1)*8
566 lenline = (len(line)/8)*8
568 for i in range(lenline/8):
571 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
574 bytedata += PackData(byte)
576 for i in range(lenline/8, lenbytes):
577 bytedata += PackData("0")
579 return lenbytes*8, len(lines), bytedata
584 ## Returns a long value from enumeration type
585 # Can be used for CORBA enumerator types like GEOM.shape_type
586 # @param theItem enumeration type
587 # @ingroup l1_geomBuilder_auxiliary
588 def EnumToLong(theItem):
590 Returns a long value from enumeration type
591 Can be used for CORBA enumerator types like geomBuilder.ShapeType
594 theItem enumeration type
597 if hasattr(theItem, "_v"): ret = theItem._v
600 ## Pack an argument into a list
602 if isinstance( arg, list ):
604 if hasattr( arg, "__getitem__" ):
608 ## Information about closed/unclosed state of shell or wire
609 # @ingroup l1_geomBuilder_auxiliary
612 Information about closed/unclosed state of shell or wire
618 ## Private class used to bind calls of plugin operations to geomBuilder
619 class PluginOperation:
620 def __init__(self, operation, function):
621 self.operation = operation
622 self.function = function
625 @ManageTransactions("operation")
626 def __call__(self, *args):
627 res = self.function(self.operation, *args)
628 RaiseIfFailed(self.function.__name__, self.operation)
631 # Warning: geom is a singleton
637 class geomBuilder(GEOM._objref_GEOM_Gen):
639 ## Enumeration ShapeType as a dictionary. \n
640 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
641 # @ingroup l1_geomBuilder_auxiliary
642 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
644 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
645 # and a list of parameters, describing the shape.
646 # List of parameters, describing the shape:
647 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
648 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
650 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
652 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
654 # - SPHERE: [xc yc zc R]
655 # - CYLINDER: [xb yb zb dx dy dz R H]
656 # - BOX: [xc yc zc ax ay az]
657 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
658 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
659 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
660 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
661 # - SOLID: [nb_faces nb_edges nb_vertices]
663 # - SPHERE2D: [xc yc zc R]
664 # - CYLINDER2D: [xb yb zb dx dy dz R H]
665 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
666 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
667 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
668 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
669 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
670 # - PLANE: [xo yo zo dx dy dz]
671 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
672 # - FACE: [nb_edges nb_vertices]
674 # - CIRCLE: [xc yc zc dx dy dz R]
675 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
676 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
677 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
678 # - LINE: [xo yo zo dx dy dz]
679 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
680 # - EDGE: [nb_vertices]
684 # - LCS: [x y z xx xy xz yx yy yz zx zy zz]
685 # @ingroup l1_geomBuilder_auxiliary
686 kind = GEOM.GEOM_IKindOfShape
688 def __new__(cls, *args):
693 #print "==== __new__ ", engine, geom, doLcc, created
695 # geom engine is either retrieved from engine, or created
697 # Following test avoids a recursive loop
700 # geom engine not created: existing engine found
702 if doLcc and not created:
704 # FindOrLoadComponent called:
705 # 1. CORBA resolution of server
706 # 2. the __new__ method is called again
707 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
708 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
711 # FindOrLoadComponent not called
713 # geomBuilder instance is created from lcc.FindOrLoadComponent
714 #print "==== super ", engine, geom, doLcc, created
715 geom = super(geomBuilder,cls).__new__(cls)
718 # geom engine not created: existing engine found
719 #print "==== existing ", engine, geom, doLcc, created
721 #print "return geom 1 ", geom
724 #print "return geom 2 ", geom
727 def __init__(self, *args):
729 #print "-------- geomBuilder __init__ --- ", created, self
732 GEOM._objref_GEOM_Gen.__init__(self, *args)
733 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
734 self.myBuilder = None
750 ## Process object publication in the study, as follows:
751 # - if @a theName is specified (not None), the object is published in the study
752 # with this name, not taking into account "auto-publishing" option;
753 # - if @a theName is NOT specified, the object is published in the study
754 # (using default name, which can be customized using @a theDefaultName parameter)
755 # only if auto-publishing is switched on.
757 # @param theObj object, a subject for publishing
758 # @param theName object name for study
759 # @param theDefaultName default name for the auto-publishing
761 # @sa addToStudyAuto()
762 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
764 def _item_name(_names, _defname, _idx=-1):
765 if not _names: _names = _defname
766 if type(_names) in [list, tuple]:
768 if _idx >= len(_names) or not _names[_idx]:
769 if type(_defname) not in [list, tuple]:
770 _name = "%s_%d"%(_defname, _idx+1)
771 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
772 _name = _defname[_idx]
774 _name = "%noname_%d"%(dn, _idx+1)
780 # must be wrong usage
785 _name = "%s_%d"%(_names, _idx+1)
791 def _publish( _name, _obj ):
793 if isinstance( _obj, GEOM._objref_GEOM_Field ):
794 fatherObj = _obj.GetShape()
795 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
796 fatherObj = _obj.GetField()
797 elif not _obj.IsMainShape():
798 fatherObj = _obj.GetMainShape()
800 if fatherObj and fatherObj.GetStudyEntry():
801 self.addToStudyInFather(fatherObj, _obj, _name)
803 self.addToStudy(_obj, _name)
809 if not theName and not self.myMaxNbSubShapesAllowed:
810 return # nothing to do: auto-publishing is disabled
811 if not theName and not theDefaultName:
812 return # neither theName nor theDefaultName is given
814 if type(theObj) in [list, tuple]:
815 # list of objects is being published
818 if not obj: continue # bad object
819 name = _item_name(theName, theDefaultName, idx)
820 _publish( name, obj )
822 if not theName and idx == self.myMaxNbSubShapesAllowed: break
826 # single object is published
827 name = _item_name(theName, theDefaultName)
828 _publish( name, theObj )
831 ## @addtogroup l1_geomBuilder_auxiliary
834 self.myStudy = salome.myStudy
835 self.myBuilder = self.myStudy.NewBuilder()
837 # load data from the study file, if necessary
838 component = self.myStudy.FindComponent("GEOM")
840 self.myBuilder.LoadWith(component, self)
842 self.BasicOp = self.GetIBasicOperations ()
843 self.CurvesOp = self.GetICurvesOperations ()
844 self.PrimOp = self.GetI3DPrimOperations ()
845 self.ShapesOp = self.GetIShapesOperations ()
846 self.HealOp = self.GetIHealingOperations ()
847 self.InsertOp = self.GetIInsertOperations ()
848 self.BoolOp = self.GetIBooleanOperations ()
849 self.TrsfOp = self.GetITransformOperations()
850 self.LocalOp = self.GetILocalOperations ()
851 self.MeasuOp = self.GetIMeasureOperations ()
852 self.BlocksOp = self.GetIBlocksOperations ()
853 self.GroupOp = self.GetIGroupOperations ()
854 self.FieldOp = self.GetIFieldOperations ()
856 notebook.myStudy = self.myStudy
859 def GetPluginOperations(self, libraryName):
860 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
863 ## Enable / disable results auto-publishing
865 # The automatic publishing is managed in the following way:
866 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
867 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
868 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
869 # value passed as parameter has the same effect.
870 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
871 # maximum number of sub-shapes allowed for publishing is set to specified value.
873 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
874 # @ingroup l1_publish_data
875 def addToStudyAuto(self, maxNbSubShapes=-1):
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 this value.
888 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
891 geompy.addToStudyAuto() # enable auto-publishing
892 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
893 geompy.addToStudyAuto(0) # disable auto-publishing
895 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
898 ## Dump component to the Python script
899 # This method overrides IDL function to allow default values for the parameters.
900 def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
902 Dump component to the Python script
903 This method overrides IDL function to allow default values for the parameters.
905 return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
907 ## Get name for sub-shape aSubObj of shape aMainObj
909 # @ref swig_SubShapeName "Example"
910 @ManageTransactions("ShapesOp")
911 def SubShapeName(self,aSubObj, aMainObj):
913 Get name for sub-shape aSubObj of shape aMainObj
915 # Example: see GEOM_TestAll.py
917 #aSubId = orb.object_to_string(aSubObj)
918 #aMainId = orb.object_to_string(aMainObj)
919 #index = gg.getIndexTopology(aSubId, aMainId)
920 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
921 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
922 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
925 ## Publish in study aShape with name aName
927 # \param aShape the shape to be published
928 # \param aName the name for the shape
929 # \param doRestoreSubShapes if True, finds and publishes also
930 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
931 # and published sub-shapes of arguments
932 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
933 # these arguments description
934 # \return study entry of the published shape in form of string
936 # @ingroup l1_publish_data
937 # @ref swig_all_addtostudy "Example"
938 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
939 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
941 Publish in study aShape with name aName
944 aShape the shape to be published
945 aName the name for the shape
946 doRestoreSubShapes if True, finds and publishes also
947 sub-shapes of aShape, corresponding to its arguments
948 and published sub-shapes of arguments
949 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
950 these arguments description
953 study entry of the published shape in form of string
956 id_block1 = geompy.addToStudy(Block1, "Block 1")
958 # Example: see GEOM_TestAll.py
960 aSObject = self.AddInStudy(aShape, aName, None)
961 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
962 if doRestoreSubShapes:
963 self.RestoreSubShapesSO(aSObject, theArgs,
964 theFindMethod, theInheritFirstArg, True )
966 print("addToStudy() failed")
968 return aShape.GetStudyEntry()
970 ## Publish in study aShape with name aName as sub-object of previously published aFather
971 # \param aFather previously published object
972 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
973 # \param aName the name for the shape
975 # \return study entry of the published shape in form of string
977 # @ingroup l1_publish_data
978 # @ref swig_all_addtostudyInFather "Example"
979 def addToStudyInFather(self, aFather, aShape, aName):
981 Publish in study aShape with name aName as sub-object of previously published aFather
984 aFather previously published object
985 aShape the shape to be published as sub-object of aFather
986 aName the name for the shape
989 study entry of the published shape in form of string
991 # Example: see GEOM_TestAll.py
993 aSObject = self.AddInStudy(aShape, aName, aFather)
994 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
996 print("addToStudyInFather() failed")
998 return aShape.GetStudyEntry()
1000 ## Unpublish object in study
1002 # \param obj the object to be unpublished
1003 def hideInStudy(self, obj):
1005 Unpublish object in study
1008 obj the object to be unpublished
1010 ior = salome.orb.object_to_string(obj)
1011 aSObject = self.myStudy.FindObjectIOR(ior)
1012 if aSObject is not None:
1013 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1014 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1015 drwAttribute.SetDrawable(False)
1016 # hide references if any
1017 vso = self.myStudy.FindDependances(aSObject);
1019 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1020 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1021 drwAttribute.SetDrawable(False)
1025 # end of l1_geomBuilder_auxiliary
1028 ## @addtogroup l3_restore_ss
1031 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1032 # To be used from python scripts out of addToStudy() (non-default usage)
1033 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1034 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1035 # If this list is empty, all operation arguments will be published
1036 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1037 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
1038 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1039 # Do not publish sub-shapes in place of arguments, but only
1040 # in place of sub-shapes of the first argument,
1041 # because the whole shape corresponds to the first argument.
1042 # Mainly to be used after transformations, but it also can be
1043 # useful after partition with one object shape, and some other
1044 # operations, where only the first argument has to be considered.
1045 # If theObject has only one argument shape, this flag is automatically
1046 # considered as True, not regarding really passed value.
1047 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1048 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1049 # \return list of published sub-shapes
1051 # @ref tui_restore_prs_params "Example"
1052 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1053 theInheritFirstArg=False, theAddPrefix=True):
1055 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1056 To be used from python scripts out of geompy.addToStudy (non-default usage)
1059 theObject published GEOM.GEOM_Object, arguments of which will be published
1060 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1061 If this list is empty, all operation arguments will be published
1062 theFindMethod method to search sub-shapes, corresponding to arguments and
1063 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1064 theInheritFirstArg set properties of the first argument for theObject.
1065 Do not publish sub-shapes in place of arguments, but only
1066 in place of sub-shapes of the first argument,
1067 because the whole shape corresponds to the first argument.
1068 Mainly to be used after transformations, but it also can be
1069 useful after partition with one object shape, and some other
1070 operations, where only the first argument has to be considered.
1071 If theObject has only one argument shape, this flag is automatically
1072 considered as True, not regarding really passed value.
1073 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1074 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1076 list of published sub-shapes
1078 # Example: see GEOM_TestAll.py
1079 return self.RestoreSubShapesO(theObject, theArgs,
1080 theFindMethod, theInheritFirstArg, theAddPrefix)
1082 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1083 # To be used from python scripts out of addToStudy() (non-default usage)
1084 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1085 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1086 # If this list is empty, all operation arguments will be published
1087 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1088 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1089 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1090 # Do not publish sub-shapes in place of arguments, but only
1091 # in place of sub-shapes of the first argument,
1092 # because the whole shape corresponds to the first argument.
1093 # Mainly to be used after transformations, but it also can be
1094 # useful after partition with one object shape, and some other
1095 # operations, where only the first argument has to be considered.
1096 # If theObject has only one argument shape, this flag is automatically
1097 # considered as True, not regarding really passed value.
1098 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1099 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1100 # \return list of published sub-shapes
1102 # @ref tui_restore_prs_params "Example"
1103 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1104 theInheritFirstArg=False, theAddPrefix=True):
1106 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1107 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1110 theObject published GEOM.GEOM_Object, arguments of which will be published
1111 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1112 If this list is empty, all operation arguments will be published
1113 theFindMethod method to search sub-shapes, corresponding to arguments and
1114 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1115 theInheritFirstArg set properties of the first argument for theObject.
1116 Do not publish sub-shapes in place of arguments, but only
1117 in place of sub-shapes of the first argument,
1118 because the whole shape corresponds to the first argument.
1119 Mainly to be used after transformations, but it also can be
1120 useful after partition with one object shape, and some other
1121 operations, where only the first argument has to be considered.
1122 If theObject has only one argument shape, this flag is automatically
1123 considered as True, not regarding really passed value.
1124 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1125 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1128 list of published sub-shapes
1130 # Example: see GEOM_TestAll.py
1131 return self.RestoreGivenSubShapesO(theObject, theArgs,
1132 theFindMethod, theInheritFirstArg, theAddPrefix)
1134 # end of l3_restore_ss
1137 ## @addtogroup l3_basic_go
1140 ## Create point by three coordinates.
1141 # @param theX The X coordinate of the point.
1142 # @param theY The Y coordinate of the point.
1143 # @param theZ The Z coordinate of the point.
1144 # @param theName Object name; when specified, this parameter is used
1145 # for result publication in the study. Otherwise, if automatic
1146 # publication is switched on, default value is used for result name.
1148 # @return New GEOM.GEOM_Object, containing the created point.
1150 # @ref tui_creation_point "Example"
1151 @ManageTransactions("BasicOp")
1152 def MakeVertex(self, theX, theY, theZ, theName=None):
1154 Create point by three coordinates.
1157 theX The X coordinate of the point.
1158 theY The Y coordinate of the point.
1159 theZ The Z coordinate of the point.
1160 theName Object name; when specified, this parameter is used
1161 for result publication in the study. Otherwise, if automatic
1162 publication is switched on, default value is used for result name.
1165 New GEOM.GEOM_Object, containing the created point.
1167 # Example: see GEOM_TestAll.py
1168 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1169 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1170 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1171 anObj.SetParameters(Parameters)
1172 self._autoPublish(anObj, theName, "vertex")
1175 ## Create a point, distant from the referenced point
1176 # on the given distances along the coordinate axes.
1177 # @param theReference The referenced point.
1178 # @param theX Displacement from the referenced point along OX axis.
1179 # @param theY Displacement from the referenced point along OY axis.
1180 # @param theZ Displacement from the referenced point along OZ axis.
1181 # @param theName Object name; when specified, this parameter is used
1182 # for result publication in the study. Otherwise, if automatic
1183 # publication is switched on, default value is used for result name.
1185 # @return New GEOM.GEOM_Object, containing the created point.
1187 # @ref tui_creation_point "Example"
1188 @ManageTransactions("BasicOp")
1189 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1191 Create a point, distant from the referenced point
1192 on the given distances along the coordinate axes.
1195 theReference The referenced point.
1196 theX Displacement from the referenced point along OX axis.
1197 theY Displacement from the referenced point along OY axis.
1198 theZ Displacement from the referenced point along OZ axis.
1199 theName Object name; when specified, this parameter is used
1200 for result publication in the study. Otherwise, if automatic
1201 publication is switched on, default value is used for result name.
1204 New GEOM.GEOM_Object, containing the created point.
1206 # Example: see GEOM_TestAll.py
1207 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1208 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1209 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1210 anObj.SetParameters(Parameters)
1211 self._autoPublish(anObj, theName, "vertex")
1214 ## Create a point, corresponding to the given parameter on the given curve.
1215 # @param theRefCurve The referenced curve.
1216 # @param theParameter Value of parameter on the referenced curve.
1217 # @param takeOrientationIntoAccount flag that tells if it is necessary
1218 # to take the curve's orientation into account for the
1219 # operation. I.e. if this flag is set, the results for the same
1220 # parameters (except the value 0.5) is different for forward
1221 # and reversed curves. If it is not set the result is the same.
1222 # @param theName Object name; when specified, this parameter is used
1223 # for result publication in the study. Otherwise, if automatic
1224 # publication is switched on, default value is used for result name.
1226 # @return New GEOM.GEOM_Object, containing the created point.
1228 # @ref tui_creation_point "Example"
1229 @ManageTransactions("BasicOp")
1230 def MakeVertexOnCurve(self, theRefCurve, theParameter,
1231 takeOrientationIntoAccount=False, theName=None):
1233 Create a point, corresponding to the given parameter on the given curve.
1236 theRefCurve The referenced curve.
1237 theParameter Value of parameter on the referenced curve.
1238 takeOrientationIntoAccount flag that tells if it is necessary
1239 to take the curve's orientation into account for the
1240 operation. I.e. if this flag is set, the results for
1241 the same parameters (except the value 0.5) is different
1242 for forward and reversed curves. If it is not set
1243 the result is the same.
1244 theName Object name; when specified, this parameter is used
1245 for result publication in the study. Otherwise, if automatic
1246 publication is switched on, default value is used for result name.
1249 New GEOM.GEOM_Object, containing the created point.
1252 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1254 # Example: see GEOM_TestAll.py
1255 theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1256 theParameter, takeOrientationIntoAccount)
1257 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1258 takeOrientationIntoAccount)
1259 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1260 anObj.SetParameters(Parameters)
1261 self._autoPublish(anObj, theName, "vertex")
1264 ## Create a point by projection give coordinates on the given curve
1265 # @param theRefCurve The referenced curve.
1266 # @param theX X-coordinate in 3D space
1267 # @param theY Y-coordinate in 3D space
1268 # @param theZ Z-coordinate in 3D space
1269 # @param theName Object name; when specified, this parameter is used
1270 # for result publication in the study. Otherwise, if automatic
1271 # publication is switched on, default value is used for result name.
1273 # @return New GEOM.GEOM_Object, containing the created point.
1275 # @ref tui_creation_point "Example"
1276 @ManageTransactions("BasicOp")
1277 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1279 Create a point by projection give coordinates on the given curve
1282 theRefCurve The referenced curve.
1283 theX X-coordinate in 3D space
1284 theY Y-coordinate in 3D space
1285 theZ Z-coordinate in 3D space
1286 theName Object name; when specified, this parameter is used
1287 for result publication in the study. Otherwise, if automatic
1288 publication is switched on, default value is used for result name.
1291 New GEOM.GEOM_Object, containing the created point.
1294 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1296 # Example: see GEOM_TestAll.py
1297 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1298 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1299 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1300 anObj.SetParameters(Parameters)
1301 self._autoPublish(anObj, theName, "vertex")
1304 ## Create a point, corresponding to the given length on the given curve.
1305 # @param theRefCurve The referenced curve.
1306 # @param theLength Length on the referenced curve. It can be negative.
1307 # @param theStartPoint Point allowing to choose the direction for the calculation
1308 # of the length. If None, start from the first point of theRefCurve.
1309 # @param theName Object name; when specified, this parameter is used
1310 # for result publication in the study. Otherwise, if automatic
1311 # publication is switched on, default value is used for result name.
1313 # @return New GEOM.GEOM_Object, containing the created point.
1315 # @ref tui_creation_point "Example"
1316 @ManageTransactions("BasicOp")
1317 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1319 Create a point, corresponding to the given length on the given curve.
1322 theRefCurve The referenced curve.
1323 theLength Length on the referenced curve. It can be negative.
1324 theStartPoint Point allowing to choose the direction for the calculation
1325 of the length. If None, start from the first point of theRefCurve.
1326 theName Object name; when specified, this parameter is used
1327 for result publication in the study. Otherwise, if automatic
1328 publication is switched on, default value is used for result name.
1331 New GEOM.GEOM_Object, containing the created point.
1333 # Example: see GEOM_TestAll.py
1334 theLength, Parameters = ParseParameters(theLength)
1335 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1336 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1337 anObj.SetParameters(Parameters)
1338 self._autoPublish(anObj, theName, "vertex")
1341 ## Create a point, corresponding to the given parameters on the
1343 # @param theRefSurf The referenced surface.
1344 # @param theUParameter Value of U-parameter on the referenced surface.
1345 # @param theVParameter Value of V-parameter on the referenced surface.
1346 # @param theName Object name; when specified, this parameter is used
1347 # for result publication in the study. Otherwise, if automatic
1348 # publication is switched on, default value is used for result name.
1350 # @return New GEOM.GEOM_Object, containing the created point.
1352 # @ref swig_MakeVertexOnSurface "Example"
1353 @ManageTransactions("BasicOp")
1354 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1356 Create a point, corresponding to the given parameters on the
1360 theRefSurf The referenced surface.
1361 theUParameter Value of U-parameter on the referenced surface.
1362 theVParameter Value of V-parameter on the referenced surface.
1363 theName Object name; when specified, this parameter is used
1364 for result publication in the study. Otherwise, if automatic
1365 publication is switched on, default value is used for result name.
1368 New GEOM.GEOM_Object, containing the created point.
1371 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1373 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1374 # Example: see GEOM_TestAll.py
1375 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1376 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1377 anObj.SetParameters(Parameters);
1378 self._autoPublish(anObj, theName, "vertex")
1381 ## Create a point by projection give coordinates on the given surface
1382 # @param theRefSurf The referenced surface.
1383 # @param theX X-coordinate in 3D space
1384 # @param theY Y-coordinate in 3D space
1385 # @param theZ Z-coordinate in 3D space
1386 # @param theName Object name; when specified, this parameter is used
1387 # for result publication in the study. Otherwise, if automatic
1388 # publication is switched on, default value is used for result name.
1390 # @return New GEOM.GEOM_Object, containing the created point.
1392 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1393 @ManageTransactions("BasicOp")
1394 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1396 Create a point by projection give coordinates on the given surface
1399 theRefSurf The referenced surface.
1400 theX X-coordinate in 3D space
1401 theY Y-coordinate in 3D space
1402 theZ Z-coordinate in 3D space
1403 theName Object name; when specified, this parameter is used
1404 for result publication in the study. Otherwise, if automatic
1405 publication is switched on, default value is used for result name.
1408 New GEOM.GEOM_Object, containing the created point.
1411 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1413 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1414 # Example: see GEOM_TestAll.py
1415 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1416 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1417 anObj.SetParameters(Parameters);
1418 self._autoPublish(anObj, theName, "vertex")
1421 ## Create a point, which lays on the given face.
1422 # The point will lay in arbitrary place of the face.
1423 # The only condition on it is a non-zero distance to the face boundary.
1424 # Such point can be used to uniquely identify the face inside any
1425 # shape in case, when the shape does not contain overlapped faces.
1426 # @param theFace The referenced face.
1427 # @param theName Object name; when specified, this parameter is used
1428 # for result publication in the study. Otherwise, if automatic
1429 # publication is switched on, default value is used for result name.
1431 # @return New GEOM.GEOM_Object, containing the created point.
1433 # @ref swig_MakeVertexInsideFace "Example"
1434 @ManageTransactions("BasicOp")
1435 def MakeVertexInsideFace (self, theFace, theName=None):
1437 Create a point, which lays on the given face.
1438 The point will lay in arbitrary place of the face.
1439 The only condition on it is a non-zero distance to the face boundary.
1440 Such point can be used to uniquely identify the face inside any
1441 shape in case, when the shape does not contain overlapped faces.
1444 theFace The referenced face.
1445 theName Object name; when specified, this parameter is used
1446 for result publication in the study. Otherwise, if automatic
1447 publication is switched on, default value is used for result name.
1450 New GEOM.GEOM_Object, containing the created point.
1453 p_on_face = geompy.MakeVertexInsideFace(Face)
1455 # Example: see GEOM_TestAll.py
1456 anObj = self.BasicOp.MakePointOnFace(theFace)
1457 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1458 self._autoPublish(anObj, theName, "vertex")
1461 ## Create a point on intersection of two lines.
1462 # @param theRefLine1, theRefLine2 The referenced lines.
1463 # @param theName Object name; when specified, this parameter is used
1464 # for result publication in the study. Otherwise, if automatic
1465 # publication is switched on, default value is used for result name.
1467 # @return New GEOM.GEOM_Object, containing the created point.
1469 # @ref swig_MakeVertexOnLinesIntersection "Example"
1470 @ManageTransactions("BasicOp")
1471 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1473 Create a point on intersection of two lines.
1476 theRefLine1, theRefLine2 The referenced lines.
1477 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.
1482 New GEOM.GEOM_Object, containing the created point.
1484 # Example: see GEOM_TestAll.py
1485 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1486 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1487 self._autoPublish(anObj, theName, "vertex")
1490 ## Create a tangent, corresponding to the given parameter on the given curve.
1491 # @param theRefCurve The referenced curve.
1492 # @param theParameter Value of parameter on the referenced curve.
1493 # @param theName Object name; when specified, this parameter is used
1494 # for result publication in the study. Otherwise, if automatic
1495 # publication is switched on, default value is used for result name.
1497 # @return New GEOM.GEOM_Object, containing the created tangent.
1499 # @ref swig_MakeTangentOnCurve "Example"
1500 @ManageTransactions("BasicOp")
1501 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1503 Create a tangent, corresponding to the given parameter on the given curve.
1506 theRefCurve The referenced curve.
1507 theParameter Value of parameter on the referenced curve.
1508 theName Object name; when specified, this parameter is used
1509 for result publication in the study. Otherwise, if automatic
1510 publication is switched on, default value is used for result name.
1513 New GEOM.GEOM_Object, containing the created tangent.
1516 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1518 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1519 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1520 self._autoPublish(anObj, theName, "tangent")
1523 ## Create a tangent plane, corresponding to the given parameter on the given face.
1524 # @param theFace The face for which tangent plane should be built.
1525 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1526 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1527 # @param theTrimSize the size of plane.
1528 # @param theName Object name; when specified, this parameter is used
1529 # for result publication in the study. Otherwise, if automatic
1530 # publication is switched on, default value is used for result name.
1532 # @return New GEOM.GEOM_Object, containing the created tangent.
1534 # @ref swig_MakeTangentPlaneOnFace "Example"
1535 @ManageTransactions("BasicOp")
1536 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1538 Create a tangent plane, corresponding to the given parameter on the given face.
1541 theFace The face for which tangent plane should be built.
1542 theParameterV vertical value of the center point (0.0 - 1.0).
1543 theParameterU horisontal value of the center point (0.0 - 1.0).
1544 theTrimSize the size of plane.
1545 theName Object name; when specified, this parameter is used
1546 for result publication in the study. Otherwise, if automatic
1547 publication is switched on, default value is used for result name.
1550 New GEOM.GEOM_Object, containing the created tangent.
1553 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1555 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1556 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1557 self._autoPublish(anObj, theName, "tangent")
1560 ## Create a vector with the given components.
1561 # @param theDX X component of the vector.
1562 # @param theDY Y component of the vector.
1563 # @param theDZ Z component of the vector.
1564 # @param theName Object name; when specified, this parameter is used
1565 # for result publication in the study. Otherwise, if automatic
1566 # publication is switched on, default value is used for result name.
1568 # @return New GEOM.GEOM_Object, containing the created vector.
1570 # @ref tui_creation_vector "Example"
1571 @ManageTransactions("BasicOp")
1572 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1574 Create a vector with the given components.
1577 theDX X component of the vector.
1578 theDY Y component of the vector.
1579 theDZ Z component of the vector.
1580 theName Object name; when specified, this parameter is used
1581 for result publication in the study. Otherwise, if automatic
1582 publication is switched on, default value is used for result name.
1585 New GEOM.GEOM_Object, containing the created vector.
1587 # Example: see GEOM_TestAll.py
1588 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1589 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1590 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1591 anObj.SetParameters(Parameters)
1592 self._autoPublish(anObj, theName, "vector")
1595 ## Create a vector between two points.
1596 # @param thePnt1 Start point for the vector.
1597 # @param thePnt2 End point for the vector.
1598 # @param theName Object name; when specified, this parameter is used
1599 # for result publication in the study. Otherwise, if automatic
1600 # publication is switched on, default value is used for result name.
1602 # @return New GEOM.GEOM_Object, containing the created vector.
1604 # @ref tui_creation_vector "Example"
1605 @ManageTransactions("BasicOp")
1606 def MakeVector(self, thePnt1, thePnt2, theName=None):
1608 Create a vector between two points.
1611 thePnt1 Start point for the vector.
1612 thePnt2 End point for the vector.
1613 theName Object name; when specified, this parameter is used
1614 for result publication in the study. Otherwise, if automatic
1615 publication is switched on, default value is used for result name.
1618 New GEOM.GEOM_Object, containing the created vector.
1620 # Example: see GEOM_TestAll.py
1621 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1622 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1623 self._autoPublish(anObj, theName, "vector")
1626 ## Create a line, passing through the given point
1627 # and parallel to the given direction
1628 # @param thePnt Point. The resulting line will pass through it.
1629 # @param theDir Direction. The resulting line will be parallel to it.
1630 # @param theName Object name; when specified, this parameter is used
1631 # for result publication in the study. Otherwise, if automatic
1632 # publication is switched on, default value is used for result name.
1634 # @return New GEOM.GEOM_Object, containing the created line.
1636 # @ref tui_creation_line "Example"
1637 @ManageTransactions("BasicOp")
1638 def MakeLine(self, thePnt, theDir, theName=None):
1640 Create a line, passing through the given point
1641 and parallel to the given direction
1644 thePnt Point. The resulting line will pass through it.
1645 theDir Direction. The resulting line will be parallel to it.
1646 theName Object name; when specified, this parameter is used
1647 for result publication in the study. Otherwise, if automatic
1648 publication is switched on, default value is used for result name.
1651 New GEOM.GEOM_Object, containing the created line.
1653 # Example: see GEOM_TestAll.py
1654 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1655 RaiseIfFailed("MakeLine", self.BasicOp)
1656 self._autoPublish(anObj, theName, "line")
1659 ## Create a line, passing through the given points
1660 # @param thePnt1 First of two points, defining the line.
1661 # @param thePnt2 Second of two points, defining the line.
1662 # @param theName Object name; when specified, this parameter is used
1663 # for result publication in the study. Otherwise, if automatic
1664 # publication is switched on, default value is used for result name.
1666 # @return New GEOM.GEOM_Object, containing the created line.
1668 # @ref tui_creation_line "Example"
1669 @ManageTransactions("BasicOp")
1670 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1672 Create a line, passing through the given points
1675 thePnt1 First of two points, defining the line.
1676 thePnt2 Second of two points, defining the line.
1677 theName Object name; when specified, this parameter is used
1678 for result publication in the study. Otherwise, if automatic
1679 publication is switched on, default value is used for result name.
1682 New GEOM.GEOM_Object, containing the created line.
1684 # Example: see GEOM_TestAll.py
1685 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1686 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1687 self._autoPublish(anObj, theName, "line")
1690 ## Create a line on two faces intersection.
1691 # @param theFace1 First of two faces, defining the line.
1692 # @param theFace2 Second of two faces, defining the line.
1693 # @param theName Object name; when specified, this parameter is used
1694 # for result publication in the study. Otherwise, if automatic
1695 # publication is switched on, default value is used for result name.
1697 # @return New GEOM.GEOM_Object, containing the created line.
1699 # @ref swig_MakeLineTwoFaces "Example"
1700 @ManageTransactions("BasicOp")
1701 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1703 Create a line on two faces intersection.
1706 theFace1 First of two faces, defining the line.
1707 theFace2 Second of two faces, defining the line.
1708 theName Object name; when specified, this parameter is used
1709 for result publication in the study. Otherwise, if automatic
1710 publication is switched on, default value is used for result name.
1713 New GEOM.GEOM_Object, containing the created line.
1715 # Example: see GEOM_TestAll.py
1716 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1717 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1718 self._autoPublish(anObj, theName, "line")
1721 ## Create a plane, passing through the given point
1722 # and normal to the given vector.
1723 # @param thePnt Point, the plane has to pass through.
1724 # @param theVec Vector, defining the plane normal direction.
1725 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1726 # @param theName Object name; when specified, this parameter is used
1727 # for result publication in the study. Otherwise, if automatic
1728 # publication is switched on, default value is used for result name.
1730 # @return New GEOM.GEOM_Object, containing the created plane.
1732 # @ref tui_creation_plane "Example"
1733 @ManageTransactions("BasicOp")
1734 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1736 Create a plane, passing through the given point
1737 and normal to the given vector.
1740 thePnt Point, the plane has to pass through.
1741 theVec Vector, defining the plane normal direction.
1742 theTrimSize Half size of a side of quadrangle face, representing the plane.
1743 theName Object name; when specified, this parameter is used
1744 for result publication in the study. Otherwise, if automatic
1745 publication is switched on, default value is used for result name.
1748 New GEOM.GEOM_Object, containing the created plane.
1750 # Example: see GEOM_TestAll.py
1751 theTrimSize, Parameters = ParseParameters(theTrimSize);
1752 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1753 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1754 anObj.SetParameters(Parameters)
1755 self._autoPublish(anObj, theName, "plane")
1758 ## Create a plane, passing through the three given points
1759 # @param thePnt1 First of three points, defining the plane.
1760 # @param thePnt2 Second of three points, defining the plane.
1761 # @param thePnt3 Third of three points, defining the plane.
1762 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1763 # @param theName Object name; when specified, this parameter is used
1764 # for result publication in the study. Otherwise, if automatic
1765 # publication is switched on, default value is used for result name.
1767 # @return New GEOM.GEOM_Object, containing the created plane.
1769 # @ref tui_creation_plane "Example"
1770 @ManageTransactions("BasicOp")
1771 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1773 Create a plane, passing through the three given points
1776 thePnt1 First of three points, defining the plane.
1777 thePnt2 Second of three points, defining the plane.
1778 thePnt3 Third of three points, defining the plane.
1779 theTrimSize Half size of a side of quadrangle face, representing the plane.
1780 theName Object name; when specified, this parameter is used
1781 for result publication in the study. Otherwise, if automatic
1782 publication is switched on, default value is used for result name.
1785 New GEOM.GEOM_Object, containing the created plane.
1787 # Example: see GEOM_TestAll.py
1788 theTrimSize, Parameters = ParseParameters(theTrimSize);
1789 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1790 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1791 anObj.SetParameters(Parameters)
1792 self._autoPublish(anObj, theName, "plane")
1795 ## Create a plane, similar to the existing one, but with another size of representing face.
1796 # @param theFace Referenced plane or LCS(Marker).
1797 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1798 # @param theName Object name; when specified, this parameter is used
1799 # for result publication in the study. Otherwise, if automatic
1800 # publication is switched on, default value is used for result name.
1802 # @return New GEOM.GEOM_Object, containing the created plane.
1804 # @ref tui_creation_plane "Example"
1805 @ManageTransactions("BasicOp")
1806 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1808 Create a plane, similar to the existing one, but with another size of representing face.
1811 theFace Referenced plane or LCS(Marker).
1812 theTrimSize New half size of a side of quadrangle face, representing the plane.
1813 theName Object name; when specified, this parameter is used
1814 for result publication in the study. Otherwise, if automatic
1815 publication is switched on, default value is used for result name.
1818 New GEOM.GEOM_Object, containing the created plane.
1820 # Example: see GEOM_TestAll.py
1821 theTrimSize, Parameters = ParseParameters(theTrimSize);
1822 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1823 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1824 anObj.SetParameters(Parameters)
1825 self._autoPublish(anObj, theName, "plane")
1828 ## Create a plane, passing through the 2 vectors
1829 # with center in a start point of the first vector.
1830 # @param theVec1 Vector, defining center point and plane direction.
1831 # @param theVec2 Vector, defining the plane normal direction.
1832 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1833 # @param theName Object name; when specified, this parameter is used
1834 # for result publication in the study. Otherwise, if automatic
1835 # publication is switched on, default value is used for result name.
1837 # @return New GEOM.GEOM_Object, containing the created plane.
1839 # @ref tui_creation_plane "Example"
1840 @ManageTransactions("BasicOp")
1841 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1843 Create a plane, passing through the 2 vectors
1844 with center in a start point of the first vector.
1847 theVec1 Vector, defining center point and plane direction.
1848 theVec2 Vector, defining the plane normal direction.
1849 theTrimSize Half size of a side of quadrangle face, representing the plane.
1850 theName Object name; when specified, this parameter is used
1851 for result publication in the study. Otherwise, if automatic
1852 publication is switched on, default value is used for result name.
1855 New GEOM.GEOM_Object, containing the created plane.
1857 # Example: see GEOM_TestAll.py
1858 theTrimSize, Parameters = ParseParameters(theTrimSize);
1859 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1860 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1861 anObj.SetParameters(Parameters)
1862 self._autoPublish(anObj, theName, "plane")
1865 ## Create a plane, based on a Local coordinate system.
1866 # @param theLCS coordinate system, defining plane.
1867 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1868 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1869 # @param theName Object name; when specified, this parameter is used
1870 # for result publication in the study. Otherwise, if automatic
1871 # publication is switched on, default value is used for result name.
1873 # @return New GEOM.GEOM_Object, containing the created plane.
1875 # @ref tui_creation_plane "Example"
1876 @ManageTransactions("BasicOp")
1877 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1879 Create a plane, based on a Local coordinate system.
1882 theLCS coordinate system, defining plane.
1883 theTrimSize Half size of a side of quadrangle face, representing the plane.
1884 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1885 theName Object name; when specified, this parameter is used
1886 for result publication in the study. Otherwise, if automatic
1887 publication is switched on, default value is used for result name.
1890 New GEOM.GEOM_Object, containing the created plane.
1892 # Example: see GEOM_TestAll.py
1893 theTrimSize, Parameters = ParseParameters(theTrimSize);
1894 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1895 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1896 anObj.SetParameters(Parameters)
1897 self._autoPublish(anObj, theName, "plane")
1900 ## Create a local coordinate system.
1901 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1902 # @param XDX,XDY,XDZ Three components of OX direction
1903 # @param YDX,YDY,YDZ Three components of OY direction
1904 # @param theName Object name; when specified, this parameter is used
1905 # for result publication in the study. Otherwise, if automatic
1906 # publication is switched on, default value is used for result name.
1908 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1910 # @ref swig_MakeMarker "Example"
1911 @ManageTransactions("BasicOp")
1912 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1914 Create a local coordinate system.
1917 OX,OY,OZ Three coordinates of coordinate system origin.
1918 XDX,XDY,XDZ Three components of OX direction
1919 YDX,YDY,YDZ Three components of OY direction
1920 theName Object name; when specified, this parameter is used
1921 for result publication in the study. Otherwise, if automatic
1922 publication is switched on, default value is used for result name.
1925 New GEOM.GEOM_Object, containing the created coordinate system.
1927 # Example: see GEOM_TestAll.py
1928 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1929 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1930 RaiseIfFailed("MakeMarker", self.BasicOp)
1931 anObj.SetParameters(Parameters)
1932 self._autoPublish(anObj, theName, "lcs")
1935 ## Create a local coordinate system from shape.
1936 # @param theShape The initial shape to detect the coordinate system.
1937 # @param theName Object name; when specified, this parameter is used
1938 # for result publication in the study. Otherwise, if automatic
1939 # publication is switched on, default value is used for result name.
1941 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1943 # @ref tui_creation_lcs "Example"
1944 @ManageTransactions("BasicOp")
1945 def MakeMarkerFromShape(self, theShape, theName=None):
1947 Create a local coordinate system from shape.
1950 theShape The initial shape to detect the coordinate system.
1951 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.
1956 New GEOM.GEOM_Object, containing the created coordinate system.
1958 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1959 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1960 self._autoPublish(anObj, theName, "lcs")
1963 ## Create a local coordinate system from point and two vectors.
1964 # @param theOrigin Point of coordinate system origin.
1965 # @param theXVec Vector of X direction
1966 # @param theYVec Vector of Y direction
1967 # @param theName Object name; when specified, this parameter is used
1968 # for result publication in the study. Otherwise, if automatic
1969 # publication is switched on, default value is used for result name.
1971 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1973 # @ref tui_creation_lcs "Example"
1974 @ManageTransactions("BasicOp")
1975 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1977 Create a local coordinate system from point and two vectors.
1980 theOrigin Point of coordinate system origin.
1981 theXVec Vector of X direction
1982 theYVec Vector of Y direction
1983 theName Object name; when specified, this parameter is used
1984 for result publication in the study. Otherwise, if automatic
1985 publication is switched on, default value is used for result name.
1988 New GEOM.GEOM_Object, containing the created coordinate system.
1991 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1992 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1993 self._autoPublish(anObj, theName, "lcs")
1996 # end of l3_basic_go
1999 ## @addtogroup l4_curves
2002 ## Create an arc of circle, passing through three given points.
2003 # @param thePnt1 Start point of the arc.
2004 # @param thePnt2 Middle point of the arc.
2005 # @param thePnt3 End point of the arc.
2006 # @param theName Object name; when specified, this parameter is used
2007 # for result publication in the study. Otherwise, if automatic
2008 # publication is switched on, default value is used for result name.
2010 # @return New GEOM.GEOM_Object, containing the created arc.
2012 # @ref swig_MakeArc "Example"
2013 @ManageTransactions("CurvesOp")
2014 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2016 Create an arc of circle, passing through three given points.
2019 thePnt1 Start point of the arc.
2020 thePnt2 Middle point of the arc.
2021 thePnt3 End point of the arc.
2022 theName Object name; when specified, this parameter is used
2023 for result publication in the study. Otherwise, if automatic
2024 publication is switched on, default value is used for result name.
2027 New GEOM.GEOM_Object, containing the created arc.
2029 # Example: see GEOM_TestAll.py
2030 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2031 RaiseIfFailed("MakeArc", self.CurvesOp)
2032 self._autoPublish(anObj, theName, "arc")
2035 ## Create an arc of circle from a center and 2 points.
2036 # @param thePnt1 Center of the arc
2037 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2038 # @param thePnt3 End point of the arc (Gives also a direction)
2039 # @param theSense Orientation of the arc
2040 # @param theName Object name; when specified, this parameter is used
2041 # for result publication in the study. Otherwise, if automatic
2042 # publication is switched on, default value is used for result name.
2044 # @return New GEOM.GEOM_Object, containing the created arc.
2046 # @ref swig_MakeArc "Example"
2047 @ManageTransactions("CurvesOp")
2048 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2050 Create an arc of circle from a center and 2 points.
2053 thePnt1 Center of the arc
2054 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2055 thePnt3 End point of the arc (Gives also a direction)
2056 theSense Orientation of the arc
2057 theName Object name; when specified, this parameter is used
2058 for result publication in the study. Otherwise, if automatic
2059 publication is switched on, default value is used for result name.
2062 New GEOM.GEOM_Object, containing the created arc.
2064 # Example: see GEOM_TestAll.py
2065 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2066 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2067 self._autoPublish(anObj, theName, "arc")
2070 ## Create an arc of ellipse, of center and two points.
2071 # @param theCenter Center of the arc.
2072 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2073 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2074 # @param theName Object name; when specified, this parameter is used
2075 # for result publication in the study. Otherwise, if automatic
2076 # publication is switched on, default value is used for result name.
2078 # @return New GEOM.GEOM_Object, containing the created arc.
2080 # @ref swig_MakeArc "Example"
2081 @ManageTransactions("CurvesOp")
2082 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2084 Create an arc of ellipse, of center and two points.
2087 theCenter Center of the arc.
2088 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2089 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2090 theName Object name; when specified, this parameter is used
2091 for result publication in the study. Otherwise, if automatic
2092 publication is switched on, default value is used for result name.
2095 New GEOM.GEOM_Object, containing the created arc.
2097 # Example: see GEOM_TestAll.py
2098 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2099 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2100 self._autoPublish(anObj, theName, "arc")
2103 ## Create a circle with given center, normal vector and radius.
2104 # @param thePnt Circle center.
2105 # @param theVec Vector, normal to the plane of the circle.
2106 # @param theR Circle radius.
2107 # @param theName Object name; when specified, this parameter is used
2108 # for result publication in the study. Otherwise, if automatic
2109 # publication is switched on, default value is used for result name.
2111 # @return New GEOM.GEOM_Object, containing the created circle.
2113 # @ref tui_creation_circle "Example"
2114 @ManageTransactions("CurvesOp")
2115 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2117 Create a circle with given center, normal vector and radius.
2120 thePnt Circle center.
2121 theVec Vector, normal to the plane of the circle.
2123 theName Object name; when specified, this parameter is used
2124 for result publication in the study. Otherwise, if automatic
2125 publication is switched on, default value is used for result name.
2128 New GEOM.GEOM_Object, containing the created circle.
2130 # Example: see GEOM_TestAll.py
2131 theR, Parameters = ParseParameters(theR)
2132 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2133 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2134 anObj.SetParameters(Parameters)
2135 self._autoPublish(anObj, theName, "circle")
2138 ## Create a circle with given radius.
2139 # Center of the circle will be in the origin of global
2140 # coordinate system and normal vector will be codirected with Z axis
2141 # @param theR Circle radius.
2142 # @param theName Object name; when specified, this parameter is used
2143 # for result publication in the study. Otherwise, if automatic
2144 # publication is switched on, default value is used for result name.
2146 # @return New GEOM.GEOM_Object, containing the created circle.
2147 @ManageTransactions("CurvesOp")
2148 def MakeCircleR(self, theR, theName=None):
2150 Create a circle with given radius.
2151 Center of the circle will be in the origin of global
2152 coordinate system and normal vector will be codirected with Z axis
2156 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.
2161 New GEOM.GEOM_Object, containing the created circle.
2163 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2164 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2165 self._autoPublish(anObj, theName, "circle")
2168 ## Create a circle, passing through three given points
2169 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2170 # @param 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.
2174 # @return New GEOM.GEOM_Object, containing the created circle.
2176 # @ref tui_creation_circle "Example"
2177 @ManageTransactions("CurvesOp")
2178 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2180 Create a circle, passing through three given points
2183 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2184 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.
2189 New GEOM.GEOM_Object, containing the created circle.
2191 # Example: see GEOM_TestAll.py
2192 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2193 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2194 self._autoPublish(anObj, theName, "circle")
2197 ## Create a circle, with given point1 as center,
2198 # passing through the point2 as radius and laying in the plane,
2199 # defined by all three given points.
2200 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2201 # @param theName Object name; when specified, this parameter is used
2202 # for result publication in the study. Otherwise, if automatic
2203 # publication is switched on, default value is used for result name.
2205 # @return New GEOM.GEOM_Object, containing the created circle.
2207 # @ref swig_MakeCircle "Example"
2208 @ManageTransactions("CurvesOp")
2209 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
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.
2216 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2217 theName Object name; when specified, this parameter is used
2218 for result publication in the study. Otherwise, if automatic
2219 publication is switched on, default value is used for result name.
2222 New GEOM.GEOM_Object, containing the created circle.
2224 # Example: see GEOM_example6.py
2225 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2226 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2227 self._autoPublish(anObj, theName, "circle")
2230 ## Create an ellipse with given center, normal vector and radiuses.
2231 # @param thePnt Ellipse center.
2232 # @param theVec Vector, normal to the plane of the ellipse.
2233 # @param theRMajor Major ellipse radius.
2234 # @param theRMinor Minor ellipse radius.
2235 # @param theVecMaj Vector, direction of the ellipse's main axis.
2236 # @param theName Object name; when specified, this parameter is used
2237 # for result publication in the study. Otherwise, if automatic
2238 # publication is switched on, default value is used for result name.
2240 # @return New GEOM.GEOM_Object, containing the created ellipse.
2242 # @ref tui_creation_ellipse "Example"
2243 @ManageTransactions("CurvesOp")
2244 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2246 Create an ellipse with given center, normal vector and radiuses.
2249 thePnt Ellipse center.
2250 theVec Vector, normal to the plane of the ellipse.
2251 theRMajor Major ellipse radius.
2252 theRMinor Minor ellipse radius.
2253 theVecMaj Vector, direction of the ellipse's main axis.
2254 theName Object name; when specified, this parameter is used
2255 for result publication in the study. Otherwise, if automatic
2256 publication is switched on, default value is used for result name.
2259 New GEOM.GEOM_Object, containing the created ellipse.
2261 # Example: see GEOM_TestAll.py
2262 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2263 if theVecMaj is not None:
2264 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2266 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2268 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2269 anObj.SetParameters(Parameters)
2270 self._autoPublish(anObj, theName, "ellipse")
2273 ## Create an ellipse with given radiuses.
2274 # Center of the ellipse will be in the origin of global
2275 # coordinate system and normal vector will be codirected with Z axis
2276 # @param theRMajor Major ellipse radius.
2277 # @param theRMinor Minor ellipse radius.
2278 # @param theName Object name; when specified, this parameter is used
2279 # for result publication in the study. Otherwise, if automatic
2280 # publication is switched on, default value is used for result name.
2282 # @return New GEOM.GEOM_Object, containing the created ellipse.
2283 @ManageTransactions("CurvesOp")
2284 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2286 Create an ellipse with given radiuses.
2287 Center of the ellipse will be in the origin of global
2288 coordinate system and normal vector will be codirected with Z axis
2291 theRMajor Major ellipse radius.
2292 theRMinor Minor ellipse radius.
2293 theName Object name; when specified, this parameter is used
2294 for result publication in the study. Otherwise, if automatic
2295 publication is switched on, default value is used for result name.
2298 New GEOM.GEOM_Object, containing the created ellipse.
2300 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2301 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2302 self._autoPublish(anObj, theName, "ellipse")
2305 ## Create a polyline on the set of points.
2306 # @param thePoints Sequence of points for the polyline.
2307 # @param theIsClosed If True, build a closed wire.
2308 # @param theName Object name; when specified, this parameter is used
2309 # for result publication in the study. Otherwise, if automatic
2310 # publication is switched on, default value is used for result name.
2312 # @return New GEOM.GEOM_Object, containing the created polyline.
2314 # @ref tui_creation_curve "Example"
2315 @ManageTransactions("CurvesOp")
2316 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2318 Create a polyline on the set of points.
2321 thePoints Sequence of points for the polyline.
2322 theIsClosed If True, build a closed wire.
2323 theName Object name; when specified, this parameter is used
2324 for result publication in the study. Otherwise, if automatic
2325 publication is switched on, default value is used for result name.
2328 New GEOM.GEOM_Object, containing the created polyline.
2330 # Example: see GEOM_TestAll.py
2331 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2332 RaiseIfFailed("MakePolyline", self.CurvesOp)
2333 self._autoPublish(anObj, theName, "polyline")
2336 ## Create bezier curve on the set of points.
2337 # @param thePoints Sequence of points for the bezier curve.
2338 # @param theIsClosed If True, build a closed curve.
2339 # @param theName Object name; when specified, this parameter is used
2340 # for result publication in the study. Otherwise, if automatic
2341 # publication is switched on, default value is used for result name.
2343 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2345 # @ref tui_creation_curve "Example"
2346 @ManageTransactions("CurvesOp")
2347 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2349 Create bezier curve on the set of points.
2352 thePoints Sequence of points for the bezier curve.
2353 theIsClosed If True, build a closed curve.
2354 theName Object name; when specified, this parameter is used
2355 for result publication in the study. Otherwise, if automatic
2356 publication is switched on, default value is used for result name.
2359 New GEOM.GEOM_Object, containing the created bezier curve.
2361 # Example: see GEOM_TestAll.py
2362 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2363 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2364 self._autoPublish(anObj, theName, "bezier")
2367 ## Create B-Spline curve on the set of points.
2368 # @param thePoints Sequence of points for the B-Spline curve.
2369 # @param theIsClosed If True, build a closed curve.
2370 # @param theDoReordering If TRUE, the algo does not follow the order of
2371 # \a thePoints but searches for the closest vertex.
2372 # @param theName Object name; when specified, this parameter is used
2373 # for result publication in the study. Otherwise, if automatic
2374 # publication is switched on, default value is used for result name.
2376 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2378 # @ref tui_creation_curve "Example"
2379 @ManageTransactions("CurvesOp")
2380 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2382 Create B-Spline curve on the set of points.
2385 thePoints Sequence of points for the B-Spline curve.
2386 theIsClosed If True, build a closed curve.
2387 theDoReordering If True, the algo does not follow the order of
2388 thePoints but searches for the closest vertex.
2389 theName Object name; when specified, this parameter is used
2390 for result publication in the study. Otherwise, if automatic
2391 publication is switched on, default value is used for result name.
2394 New GEOM.GEOM_Object, containing the created B-Spline curve.
2396 # Example: see GEOM_TestAll.py
2397 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2398 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2399 self._autoPublish(anObj, theName, "bspline")
2402 ## Create B-Spline curve on the set of points.
2403 # @param thePoints Sequence of points for the B-Spline curve.
2404 # @param theFirstVec Vector object, defining the curve direction at its first point.
2405 # @param theLastVec Vector object, defining the curve direction at its last point.
2406 # @param theName Object name; when specified, this parameter is used
2407 # for result publication in the study. Otherwise, if automatic
2408 # publication is switched on, default value is used for result name.
2410 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2412 # @ref tui_creation_curve "Example"
2413 @ManageTransactions("CurvesOp")
2414 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2416 Create B-Spline curve on the set of points.
2419 thePoints Sequence of points for the B-Spline curve.
2420 theFirstVec Vector object, defining the curve direction at its first point.
2421 theLastVec Vector object, defining the curve direction at its last point.
2422 theName Object name; when specified, this parameter is used
2423 for result publication in the study. Otherwise, if automatic
2424 publication is switched on, default value is used for result name.
2427 New GEOM.GEOM_Object, containing the created B-Spline curve.
2429 # Example: see GEOM_TestAll.py
2430 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2431 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2432 self._autoPublish(anObj, theName, "bspline")
2435 ## Creates a curve using the parametric definition of the basic points.
2436 # @param thexExpr parametric equation of the coordinates X.
2437 # @param theyExpr parametric equation of the coordinates Y.
2438 # @param thezExpr parametric equation of the coordinates Z.
2439 # @param theParamMin the minimal value of the parameter.
2440 # @param theParamMax the maximum value of the parameter.
2441 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2442 # @param theCurveType the type of the curve,
2443 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2444 # @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.
2445 # @param theName Object name; when specified, this parameter is used
2446 # for result publication in the study. Otherwise, if automatic
2447 # publication is switched on, default value is used for result name.
2449 # @return New GEOM.GEOM_Object, containing the created curve.
2451 # @ref tui_creation_curve "Example"
2452 @ManageTransactions("CurvesOp")
2453 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2454 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2456 Creates a curve using the parametric definition of the basic points.
2459 thexExpr parametric equation of the coordinates X.
2460 theyExpr parametric equation of the coordinates Y.
2461 thezExpr parametric equation of the coordinates Z.
2462 theParamMin the minimal value of the parameter.
2463 theParamMax the maximum value of the parameter.
2464 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2465 theCurveType the type of the curve,
2466 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2467 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2468 method is used which can lead to a bug.
2469 theName Object name; when specified, this parameter is used
2470 for result publication in the study. Otherwise, if automatic
2471 publication is switched on, default value is used for result name.
2474 New GEOM.GEOM_Object, containing the created curve.
2476 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2478 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2480 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2481 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2482 anObj.SetParameters(Parameters)
2483 self._autoPublish(anObj, theName, "curve")
2486 ## Create an isoline curve on a face.
2487 # @param theFace the face for which an isoline is created.
2488 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2490 # @param theParameter the U parameter for U-isoline or V parameter
2492 # @param theName Object name; when specified, this parameter is used
2493 # for result publication in the study. Otherwise, if automatic
2494 # publication is switched on, default value is used for result name.
2496 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2497 # a compound of edges.
2499 # @ref tui_creation_curve "Example"
2500 @ManageTransactions("CurvesOp")
2501 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2503 Create an isoline curve on a face.
2506 theFace the face for which an isoline is created.
2507 IsUIsoline True for U-isoline creation; False for V-isoline
2509 theParameter the U parameter for U-isoline or V parameter
2511 theName Object name; when specified, this parameter is used
2512 for result publication in the study. Otherwise, if automatic
2513 publication is switched on, default value is used for result name.
2516 New GEOM.GEOM_Object, containing the created isoline edge or a
2519 # Example: see GEOM_TestAll.py
2520 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2521 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2523 self._autoPublish(anObj, theName, "U-Isoline")
2525 self._autoPublish(anObj, theName, "V-Isoline")
2531 ## @addtogroup l3_sketcher
2534 ## Create a sketcher (wire or face), following the textual description,
2535 # passed through <VAR>theCommand</VAR> argument. \n
2536 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2537 # Format of the description string have to be the following:
2539 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2542 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2544 # - "R angle" : Set the direction by angle
2545 # - "D dx dy" : Set the direction by DX & DY
2548 # - "TT x y" : Create segment by point at X & Y
2549 # - "T dx dy" : Create segment by point with DX & DY
2550 # - "L length" : Create segment by direction & Length
2551 # - "IX x" : Create segment by direction & Intersect. X
2552 # - "IY y" : Create segment by direction & Intersect. Y
2555 # - "C radius length" : Create arc by direction, radius and length(in degree)
2556 # - "AA x y": Create arc by point at X & Y
2557 # - "A dx dy" : Create arc by point with DX & DY
2558 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2559 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2560 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2561 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2564 # - "WW" : Close Wire (to finish)
2565 # - "WF" : Close Wire and build face (to finish)
2568 # - Flag1 (= reverse) is 0 or 2 ...
2569 # - if 0 the drawn arc is the one of lower angle (< Pi)
2570 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2573 # - Flag2 (= control tolerance) is 0 or 1 ...
2574 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2575 # - if 1 the wire is built only if the end point is on the arc
2576 # with a tolerance of 10^-7 on the distance else the creation fails
2578 # @param theCommand String, defining the sketcher in local
2579 # coordinates of the working plane.
2580 # @param theWorkingPlane Nine double values, defining origin,
2581 # OZ and OX directions of the working plane.
2582 # @param theName Object name; when specified, this parameter is used
2583 # for result publication in the study. Otherwise, if automatic
2584 # publication is switched on, default value is used for result name.
2586 # @return New GEOM.GEOM_Object, containing the created wire.
2588 # @ref tui_sketcher_page "Example"
2589 @ManageTransactions("CurvesOp")
2590 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2592 Create a sketcher (wire or face), following the textual description, passed
2593 through theCommand argument.
2594 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2595 Format of the description string have to be the following:
2596 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2598 - x1, y1 are coordinates of the first sketcher point (zero by default),
2600 - "R angle" : Set the direction by angle
2601 - "D dx dy" : Set the direction by DX & DY
2603 - "TT x y" : Create segment by point at X & Y
2604 - "T dx dy" : Create segment by point with DX & DY
2605 - "L length" : Create segment by direction & Length
2606 - "IX x" : Create segment by direction & Intersect. X
2607 - "IY y" : Create segment by direction & Intersect. Y
2609 - "C radius length" : Create arc by direction, radius and length(in degree)
2610 - "AA x y": Create arc by point at X & Y
2611 - "A dx dy" : Create arc by point with DX & DY
2612 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2613 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2614 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2615 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2617 - "WW" : Close Wire (to finish)
2618 - "WF" : Close Wire and build face (to finish)
2620 - Flag1 (= reverse) is 0 or 2 ...
2621 - if 0 the drawn arc is the one of lower angle (< Pi)
2622 - if 2 the drawn arc ius the one of greater angle (> Pi)
2624 - Flag2 (= control tolerance) is 0 or 1 ...
2625 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2626 - if 1 the wire is built only if the end point is on the arc
2627 with a tolerance of 10^-7 on the distance else the creation fails
2630 theCommand String, defining the sketcher in local
2631 coordinates of the working plane.
2632 theWorkingPlane Nine double values, defining origin,
2633 OZ and OX directions of the working plane.
2634 theName Object name; when specified, this parameter is used
2635 for result publication in the study. Otherwise, if automatic
2636 publication is switched on, default value is used for result name.
2639 New GEOM.GEOM_Object, containing the created wire.
2641 # Example: see GEOM_TestAll.py
2642 theCommand,Parameters = ParseSketcherCommand(theCommand)
2643 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2644 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2645 anObj.SetParameters(Parameters)
2646 self._autoPublish(anObj, theName, "wire")
2649 ## Create a sketcher (wire or face), following the textual description,
2650 # passed through <VAR>theCommand</VAR> argument. \n
2651 # For format of the description string see MakeSketcher() method.\n
2652 # @param theCommand String, defining the sketcher in local
2653 # coordinates of the working plane.
2654 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2655 # @param theName Object name; when specified, this parameter is used
2656 # for result publication in the study. Otherwise, if automatic
2657 # publication is switched on, default value is used for result name.
2659 # @return New GEOM.GEOM_Object, containing the created wire.
2661 # @ref tui_sketcher_page "Example"
2662 @ManageTransactions("CurvesOp")
2663 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2665 Create a sketcher (wire or face), following the textual description,
2666 passed through theCommand argument.
2667 For format of the description string see geompy.MakeSketcher() method.
2670 theCommand String, defining the sketcher in local
2671 coordinates of the working plane.
2672 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2673 theName Object name; when specified, this parameter is used
2674 for result publication in the study. Otherwise, if automatic
2675 publication is switched on, default value is used for result name.
2678 New GEOM.GEOM_Object, containing the created wire.
2680 theCommand,Parameters = ParseSketcherCommand(theCommand)
2681 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2682 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2683 anObj.SetParameters(Parameters)
2684 self._autoPublish(anObj, theName, "wire")
2687 ## Obtain a 2D sketcher interface
2688 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2689 def Sketcher2D (self):
2691 Obtain a 2D sketcher interface.
2694 sk = geompy.Sketcher2D()
2696 sk.addSegmentRelative(15, 70)
2697 sk.addSegmentPerpY(50)
2698 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2699 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2700 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2702 Sketch_1 = sk.wire(geomObj_1)
2704 sk = Sketcher2D (self)
2707 ## Create a sketcher wire, following the numerical description,
2708 # passed through <VAR>theCoordinates</VAR> argument. \n
2709 # @param theCoordinates double values, defining points to create a wire,
2711 # @param theName Object name; when specified, this parameter is used
2712 # for result publication in the study. Otherwise, if automatic
2713 # publication is switched on, default value is used for result name.
2715 # @return New GEOM.GEOM_Object, containing the created wire.
2717 # @ref tui_3dsketcher_page "Example"
2718 @ManageTransactions("CurvesOp")
2719 def Make3DSketcher(self, theCoordinates, theName=None):
2721 Create a sketcher wire, following the numerical description,
2722 passed through theCoordinates argument.
2725 theCoordinates double values, defining points to create a wire,
2727 theName Object name; when specified, this parameter is used
2728 for result publication in the study. Otherwise, if automatic
2729 publication is switched on, default value is used for result name.
2732 New GEOM_Object, containing the created wire.
2734 theCoordinates,Parameters = ParseParameters(theCoordinates)
2735 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2736 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2737 anObj.SetParameters(Parameters)
2738 self._autoPublish(anObj, theName, "wire")
2741 ## Obtain a 3D sketcher interface
2742 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2744 # @ref tui_3dsketcher_page "Example"
2745 def Sketcher3D (self):
2747 Obtain a 3D sketcher interface.
2750 sk = geompy.Sketcher3D()
2751 sk.addPointsAbsolute(0,0,0, 70,0,0)
2752 sk.addPointsRelative(0, 0, 130)
2753 sk.addPointAnglesLength("OXY", 50, 0, 100)
2754 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2756 a3D_Sketcher_1 = sk.wire()
2758 sk = Sketcher3D (self)
2761 ## Obtain a 2D polyline creation interface
2762 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2764 # @ref tui_3dsketcher_page "Example"
2765 def Polyline2D (self):
2767 Obtain a 2D polyline creation interface.
2770 pl = geompy.Polyline2D()
2771 pl.addSection("section 1", GEOM.Polyline, True)
2772 pl.addPoints(0, 0, 10, 0, 10, 10)
2773 pl.addSection("section 2", GEOM.Interpolation, False)
2774 pl.addPoints(20, 0, 30, 0, 30, 10)
2775 resultObj = pl.result(WorkingPlane)
2777 pl = Polyline2D (self)
2780 # end of l3_sketcher
2783 ## @addtogroup l3_3d_primitives
2786 ## Create a box by coordinates of two opposite vertices.
2788 # @param x1,y1,z1 double values, defining first point it.
2789 # @param x2,y2,z2 double values, defining first point it.
2790 # @param theName Object name; when specified, this parameter is used
2791 # for result publication in the study. Otherwise, if automatic
2792 # publication is switched on, default value is used for result name.
2794 # @return New GEOM.GEOM_Object, containing the created box.
2796 # @ref tui_creation_box "Example"
2797 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2799 Create a box by coordinates of two opposite vertices.
2802 x1,y1,z1 double values, defining first point.
2803 x2,y2,z2 double values, defining second point.
2804 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.
2809 New GEOM.GEOM_Object, containing the created box.
2811 # Example: see GEOM_TestAll.py
2812 pnt1 = self.MakeVertex(x1,y1,z1)
2813 pnt2 = self.MakeVertex(x2,y2,z2)
2814 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2815 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2817 ## Create a box with specified dimensions along the coordinate axes
2818 # and with edges, parallel to the coordinate axes.
2819 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2820 # @param theDX Length of Box edges, parallel to OX axis.
2821 # @param theDY Length of Box edges, parallel to OY axis.
2822 # @param theDZ Length of Box edges, parallel to OZ axis.
2823 # @param theName Object name; when specified, this parameter is used
2824 # for result publication in the study. Otherwise, if automatic
2825 # publication is switched on, default value is used for result name.
2827 # @return New GEOM.GEOM_Object, containing the created box.
2829 # @ref tui_creation_box "Example"
2830 @ManageTransactions("PrimOp")
2831 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2833 Create a box with specified dimensions along the coordinate axes
2834 and with edges, parallel to the coordinate axes.
2835 Center of the box will be at point (DX/2, DY/2, DZ/2).
2838 theDX Length of Box edges, parallel to OX axis.
2839 theDY Length of Box edges, parallel to OY axis.
2840 theDZ Length of Box edges, parallel to OZ axis.
2841 theName Object name; when specified, this parameter is used
2842 for result publication in the study. Otherwise, if automatic
2843 publication is switched on, default value is used for result name.
2846 New GEOM.GEOM_Object, containing the created box.
2848 # Example: see GEOM_TestAll.py
2849 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2850 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2851 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2852 anObj.SetParameters(Parameters)
2853 self._autoPublish(anObj, theName, "box")
2856 ## Create a box with two specified opposite vertices,
2857 # and with edges, parallel to the coordinate axes
2858 # @param thePnt1 First of two opposite vertices.
2859 # @param thePnt2 Second of two opposite vertices.
2860 # @param theName Object name; when specified, this parameter is used
2861 # for result publication in the study. Otherwise, if automatic
2862 # publication is switched on, default value is used for result name.
2864 # @return New GEOM.GEOM_Object, containing the created box.
2866 # @ref tui_creation_box "Example"
2867 @ManageTransactions("PrimOp")
2868 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2870 Create a box with two specified opposite vertices,
2871 and with edges, parallel to the coordinate axes
2874 thePnt1 First of two opposite vertices.
2875 thePnt2 Second of two opposite vertices.
2876 theName Object name; when specified, this parameter is used
2877 for result publication in the study. Otherwise, if automatic
2878 publication is switched on, default value is used for result name.
2881 New GEOM.GEOM_Object, containing the created box.
2883 # Example: see GEOM_TestAll.py
2884 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2885 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2886 self._autoPublish(anObj, theName, "box")
2889 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2890 # @param theH height of Face.
2891 # @param theW width of Face.
2892 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2893 # @param theName Object name; when specified, this parameter is used
2894 # for result publication in the study. Otherwise, if automatic
2895 # publication is switched on, default value is used for result name.
2897 # @return New GEOM.GEOM_Object, containing the created face.
2899 # @ref tui_creation_face "Example"
2900 @ManageTransactions("PrimOp")
2901 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2903 Create a face with specified dimensions with edges parallel to coordinate axes.
2906 theH height of Face.
2908 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2909 theName Object name; when specified, this parameter is used
2910 for result publication in the study. Otherwise, if automatic
2911 publication is switched on, default value is used for result name.
2914 New GEOM.GEOM_Object, containing the created face.
2916 # Example: see GEOM_TestAll.py
2917 theH,theW,Parameters = ParseParameters(theH, theW)
2918 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2919 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2920 anObj.SetParameters(Parameters)
2921 self._autoPublish(anObj, theName, "rectangle")
2924 ## Create a face from another plane and two sizes,
2925 # vertical size and horisontal size.
2926 # @param theObj Normale vector to the creating face or
2928 # @param theH Height (vertical size).
2929 # @param theW Width (horisontal size).
2930 # @param theName Object name; when specified, this parameter is used
2931 # for result publication in the study. Otherwise, if automatic
2932 # publication is switched on, default value is used for result name.
2934 # @return New GEOM.GEOM_Object, containing the created face.
2936 # @ref tui_creation_face "Example"
2937 @ManageTransactions("PrimOp")
2938 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2940 Create a face from another plane and two sizes,
2941 vertical size and horisontal size.
2944 theObj Normale vector to the creating face or
2946 theH Height (vertical size).
2947 theW Width (horisontal size).
2948 theName Object name; when specified, this parameter is used
2949 for result publication in the study. Otherwise, if automatic
2950 publication is switched on, default value is used for result name.
2953 New GEOM_Object, containing the created face.
2955 # Example: see GEOM_TestAll.py
2956 theH,theW,Parameters = ParseParameters(theH, theW)
2957 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2958 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2959 anObj.SetParameters(Parameters)
2960 self._autoPublish(anObj, theName, "rectangle")
2963 ## Create a disk with given center, normal vector and radius.
2964 # @param thePnt Disk center.
2965 # @param theVec Vector, normal to the plane of the disk.
2966 # @param theR Disk radius.
2967 # @param theName Object name; when specified, this parameter is used
2968 # for result publication in the study. Otherwise, if automatic
2969 # publication is switched on, default value is used for result name.
2971 # @return New GEOM.GEOM_Object, containing the created disk.
2973 # @ref tui_creation_disk "Example"
2974 @ManageTransactions("PrimOp")
2975 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2977 Create a disk with given center, normal vector and radius.
2981 theVec Vector, normal to the plane of the disk.
2983 theName Object name; when specified, this parameter is used
2984 for result publication in the study. Otherwise, if automatic
2985 publication is switched on, default value is used for result name.
2988 New GEOM.GEOM_Object, containing the created disk.
2990 # Example: see GEOM_TestAll.py
2991 theR,Parameters = ParseParameters(theR)
2992 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2993 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2994 anObj.SetParameters(Parameters)
2995 self._autoPublish(anObj, theName, "disk")
2998 ## Create a disk, passing through three given points
2999 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3000 # @param theName Object name; when specified, this parameter is used
3001 # for result publication in the study. Otherwise, if automatic
3002 # publication is switched on, default value is used for result name.
3004 # @return New GEOM.GEOM_Object, containing the created disk.
3006 # @ref tui_creation_disk "Example"
3007 @ManageTransactions("PrimOp")
3008 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3010 Create a disk, passing through three given points
3013 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3014 theName Object name; when specified, this parameter is used
3015 for result publication in the study. Otherwise, if automatic
3016 publication is switched on, default value is used for result name.
3019 New GEOM.GEOM_Object, containing the created disk.
3021 # Example: see GEOM_TestAll.py
3022 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3023 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3024 self._autoPublish(anObj, theName, "disk")
3027 ## Create a disk with specified dimensions along OX-OY coordinate axes.
3028 # @param theR Radius of Face.
3029 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3030 # @param theName Object name; when specified, this parameter is used
3031 # for result publication in the study. Otherwise, if automatic
3032 # publication is switched on, default value is used for result name.
3034 # @return New GEOM.GEOM_Object, containing the created disk.
3036 # @ref tui_creation_face "Example"
3037 @ManageTransactions("PrimOp")
3038 def MakeDiskR(self, theR, theOrientation, theName=None):
3040 Create a disk with specified dimensions along OX-OY coordinate axes.
3043 theR Radius of Face.
3044 theOrientation set the orientation belong axis OXY or OYZ or OZX
3045 theName Object name; when specified, this parameter is used
3046 for result publication in the study. Otherwise, if automatic
3047 publication is switched on, default value is used for result name.
3050 New GEOM.GEOM_Object, containing the created disk.
3053 Disk3 = geompy.MakeDiskR(100., 1)
3055 # Example: see GEOM_TestAll.py
3056 theR,Parameters = ParseParameters(theR)
3057 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3058 RaiseIfFailed("MakeDiskR", self.PrimOp)
3059 anObj.SetParameters(Parameters)
3060 self._autoPublish(anObj, theName, "disk")
3063 ## Create a cylinder with given base point, axis, radius and height.
3064 # @param thePnt Central point of cylinder base.
3065 # @param theAxis Cylinder axis.
3066 # @param theR Cylinder radius.
3067 # @param theH Cylinder height.
3068 # @param theName Object name; when specified, this parameter is used
3069 # for result publication in the study. Otherwise, if automatic
3070 # publication is switched on, default value is used for result name.
3072 # @return New GEOM.GEOM_Object, containing the created cylinder.
3074 # @ref tui_creation_cylinder "Example"
3075 @ManageTransactions("PrimOp")
3076 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3078 Create a cylinder with given base point, axis, radius and height.
3081 thePnt Central point of cylinder base.
3082 theAxis Cylinder axis.
3083 theR Cylinder radius.
3084 theH Cylinder height.
3085 theName Object name; when specified, this parameter is used
3086 for result publication in the study. Otherwise, if automatic
3087 publication is switched on, default value is used for result name.
3090 New GEOM.GEOM_Object, containing the created cylinder.
3092 # Example: see GEOM_TestAll.py
3093 theR,theH,Parameters = ParseParameters(theR, theH)
3094 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3095 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3096 anObj.SetParameters(Parameters)
3097 self._autoPublish(anObj, theName, "cylinder")
3100 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3101 # @param thePnt Central point of cylinder base.
3102 # @param theAxis Cylinder axis.
3103 # @param theR Cylinder radius.
3104 # @param theH Cylinder height.
3105 # @param theA Cylinder angle in radians.
3106 # @param theName Object name; when specified, this parameter is used
3107 # for result publication in the study. Otherwise, if automatic
3108 # publication is switched on, default value is used for result name.
3110 # @return New GEOM.GEOM_Object, containing the created cylinder.
3112 # @ref tui_creation_cylinder "Example"
3113 @ManageTransactions("PrimOp")
3114 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3116 Create a portion of cylinder with given base point, axis, radius, height and angle.
3119 thePnt Central point of cylinder base.
3120 theAxis Cylinder axis.
3121 theR Cylinder radius.
3122 theH Cylinder height.
3123 theA Cylinder angle in radians.
3124 theName Object name; when specified, this parameter is used
3125 for result publication in the study. Otherwise, if automatic
3126 publication is switched on, default value is used for result name.
3129 New GEOM.GEOM_Object, containing the created cylinder.
3131 # Example: see GEOM_TestAll.py
3133 if isinstance(theA,str):
3135 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3137 theA = theA*math.pi/180.
3138 if theA<=0. or theA>=2*math.pi:
3139 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3140 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3141 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3142 anObj.SetParameters(Parameters)
3143 self._autoPublish(anObj, theName, "cylinder")
3146 ## Create a cylinder with given radius and height at
3147 # the origin of coordinate system. Axis of the cylinder
3148 # will be collinear to the OZ axis of the coordinate system.
3149 # @param theR Cylinder radius.
3150 # @param theH Cylinder height.
3151 # @param theName Object name; when specified, this parameter is used
3152 # for result publication in the study. Otherwise, if automatic
3153 # publication is switched on, default value is used for result name.
3155 # @return New GEOM.GEOM_Object, containing the created cylinder.
3157 # @ref tui_creation_cylinder "Example"
3158 @ManageTransactions("PrimOp")
3159 def MakeCylinderRH(self, theR, theH, theName=None):
3161 Create a cylinder with given radius and height at
3162 the origin of coordinate system. Axis of the cylinder
3163 will be collinear to the OZ axis of the coordinate system.
3166 theR Cylinder radius.
3167 theH Cylinder height.
3168 theName Object name; when specified, this parameter is used
3169 for result publication in the study. Otherwise, if automatic
3170 publication is switched on, default value is used for result name.
3173 New GEOM.GEOM_Object, containing the created cylinder.
3175 # Example: see GEOM_TestAll.py
3176 theR,theH,Parameters = ParseParameters(theR, theH)
3177 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3178 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3179 anObj.SetParameters(Parameters)
3180 self._autoPublish(anObj, theName, "cylinder")
3183 ## Create a portion of cylinder with given radius, height and angle at
3184 # the origin of coordinate system. Axis of the cylinder
3185 # will be collinear to the OZ axis of the coordinate system.
3186 # @param theR Cylinder radius.
3187 # @param theH Cylinder height.
3188 # @param theA Cylinder angle in radians.
3189 # @param theName Object name; when specified, this parameter is used
3190 # for result publication in the study. Otherwise, if automatic
3191 # publication is switched on, default value is used for result name.
3193 # @return New GEOM.GEOM_Object, containing the created cylinder.
3195 # @ref tui_creation_cylinder "Example"
3196 @ManageTransactions("PrimOp")
3197 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3199 Create a portion of cylinder with given radius, height and angle at
3200 the origin of coordinate system. Axis of the cylinder
3201 will be collinear to the OZ axis of the coordinate system.
3204 theR Cylinder radius.
3205 theH Cylinder height.
3206 theA Cylinder angle in radians.
3207 theName Object name; when specified, this parameter is used
3208 for result publication in the study. Otherwise, if automatic
3209 publication is switched on, default value is used for result name.
3212 New GEOM.GEOM_Object, containing the created cylinder.
3214 # Example: see GEOM_TestAll.py
3216 if isinstance(theA,str):
3218 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3220 theA = theA*math.pi/180.
3221 if theA<=0. or theA>=2*math.pi:
3222 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3223 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3224 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3225 anObj.SetParameters(Parameters)
3226 self._autoPublish(anObj, theName, "cylinder")
3229 ## Create a sphere with given center and radius.
3230 # @param thePnt Sphere center.
3231 # @param theR Sphere radius.
3232 # @param theName Object name; when specified, this parameter is used
3233 # for result publication in the study. Otherwise, if automatic
3234 # publication is switched on, default value is used for result name.
3236 # @return New GEOM.GEOM_Object, containing the created sphere.
3238 # @ref tui_creation_sphere "Example"
3239 @ManageTransactions("PrimOp")
3240 def MakeSpherePntR(self, thePnt, theR, theName=None):
3242 Create a sphere with given center and radius.
3245 thePnt Sphere center.
3247 theName Object name; when specified, this parameter is used
3248 for result publication in the study. Otherwise, if automatic
3249 publication is switched on, default value is used for result name.
3252 New GEOM.GEOM_Object, containing the created sphere.
3254 # Example: see GEOM_TestAll.py
3255 theR,Parameters = ParseParameters(theR)
3256 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3257 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3258 anObj.SetParameters(Parameters)
3259 self._autoPublish(anObj, theName, "sphere")
3262 ## Create a sphere with given center and radius.
3263 # @param x,y,z Coordinates of sphere center.
3264 # @param theR Sphere radius.
3265 # @param theName Object name; when specified, this parameter is used
3266 # for result publication in the study. Otherwise, if automatic
3267 # publication is switched on, default value is used for result name.
3269 # @return New GEOM.GEOM_Object, containing the created sphere.
3271 # @ref tui_creation_sphere "Example"
3272 def MakeSphere(self, x, y, z, theR, theName=None):
3274 Create a sphere with given center and radius.
3277 x,y,z Coordinates of sphere center.
3279 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.
3284 New GEOM.GEOM_Object, containing the created sphere.
3286 # Example: see GEOM_TestAll.py
3287 point = self.MakeVertex(x, y, z)
3288 # note: auto-publishing is done in self.MakeSpherePntR()
3289 anObj = self.MakeSpherePntR(point, theR, theName)
3292 ## Create a sphere with given radius at the origin of coordinate system.
3293 # @param theR Sphere radius.
3294 # @param theName Object name; when specified, this parameter is used
3295 # for result publication in the study. Otherwise, if automatic
3296 # publication is switched on, default value is used for result name.
3298 # @return New GEOM.GEOM_Object, containing the created sphere.
3300 # @ref tui_creation_sphere "Example"
3301 @ManageTransactions("PrimOp")
3302 def MakeSphereR(self, theR, theName=None):
3304 Create a sphere with given radius at the origin of coordinate system.
3308 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.
3313 New GEOM.GEOM_Object, containing the created sphere.
3315 # Example: see GEOM_TestAll.py
3316 theR,Parameters = ParseParameters(theR)
3317 anObj = self.PrimOp.MakeSphereR(theR)
3318 RaiseIfFailed("MakeSphereR", self.PrimOp)
3319 anObj.SetParameters(Parameters)
3320 self._autoPublish(anObj, theName, "sphere")
3323 ## Create a cone with given base point, axis, height and radiuses.
3324 # @param thePnt Central point of the first cone base.
3325 # @param theAxis Cone axis.
3326 # @param theR1 Radius of the first cone base.
3327 # @param theR2 Radius of the second cone base.
3328 # \note If both radiuses are non-zero, the cone will be truncated.
3329 # \note If the radiuses are equal, a cylinder will be created instead.
3330 # @param theH Cone height.
3331 # @param theName Object name; when specified, this parameter is used
3332 # for result publication in the study. Otherwise, if automatic
3333 # publication is switched on, default value is used for result name.
3335 # @return New GEOM.GEOM_Object, containing the created cone.
3337 # @ref tui_creation_cone "Example"
3338 @ManageTransactions("PrimOp")
3339 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3341 Create a cone with given base point, axis, height and radiuses.
3344 thePnt Central point of the first cone base.
3346 theR1 Radius of the first cone base.
3347 theR2 Radius of the second cone base.
3349 theName Object name; when specified, this parameter is used
3350 for result publication in the study. Otherwise, if automatic
3351 publication is switched on, default value is used for result name.
3354 If both radiuses are non-zero, the cone will be truncated.
3355 If the radiuses are equal, a cylinder will be created instead.
3358 New GEOM.GEOM_Object, containing the created cone.
3360 # Example: see GEOM_TestAll.py
3361 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3362 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3363 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3364 anObj.SetParameters(Parameters)
3365 self._autoPublish(anObj, theName, "cone")
3368 ## Create a cone with given height and radiuses at
3369 # the origin of coordinate system. Axis of the cone will
3370 # be collinear to the OZ axis of the coordinate system.
3371 # @param theR1 Radius of the first cone base.
3372 # @param theR2 Radius of the second cone base.
3373 # \note If both radiuses are non-zero, the cone will be truncated.
3374 # \note If the radiuses are equal, a cylinder will be created instead.
3375 # @param theH Cone height.
3376 # @param theName Object name; when specified, this parameter is used
3377 # for result publication in the study. Otherwise, if automatic
3378 # publication is switched on, default value is used for result name.
3380 # @return New GEOM.GEOM_Object, containing the created cone.
3382 # @ref tui_creation_cone "Example"
3383 @ManageTransactions("PrimOp")
3384 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3386 Create a cone with given height and radiuses at
3387 the origin of coordinate system. Axis of the cone will
3388 be collinear to the OZ axis of the coordinate system.
3391 theR1 Radius of the first cone base.
3392 theR2 Radius of the second cone base.
3394 theName Object name; when specified, this parameter is used
3395 for result publication in the study. Otherwise, if automatic
3396 publication is switched on, default value is used for result name.
3399 If both radiuses are non-zero, the cone will be truncated.
3400 If the radiuses are equal, a cylinder will be created instead.
3403 New GEOM.GEOM_Object, containing the created cone.
3405 # Example: see GEOM_TestAll.py
3406 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3407 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3408 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3409 anObj.SetParameters(Parameters)
3410 self._autoPublish(anObj, theName, "cone")
3413 ## Create a torus with given center, normal vector and radiuses.
3414 # @param thePnt Torus central point.
3415 # @param theVec Torus axis of symmetry.
3416 # @param theRMajor Torus major radius.
3417 # @param theRMinor Torus minor radius.
3418 # @param theName Object name; when specified, this parameter is used
3419 # for result publication in the study. Otherwise, if automatic
3420 # publication is switched on, default value is used for result name.
3422 # @return New GEOM.GEOM_Object, containing the created torus.
3424 # @ref tui_creation_torus "Example"
3425 @ManageTransactions("PrimOp")
3426 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3428 Create a torus with given center, normal vector and radiuses.
3431 thePnt Torus central point.
3432 theVec Torus axis of symmetry.
3433 theRMajor Torus major radius.
3434 theRMinor Torus minor radius.
3435 theName Object name; when specified, this parameter is used
3436 for result publication in the study. Otherwise, if automatic
3437 publication is switched on, default value is used for result name.
3440 New GEOM.GEOM_Object, containing the created torus.
3442 # Example: see GEOM_TestAll.py
3443 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3444 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3445 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3446 anObj.SetParameters(Parameters)
3447 self._autoPublish(anObj, theName, "torus")
3450 ## Create a torus with given radiuses at the origin of coordinate system.
3451 # @param theRMajor Torus major radius.
3452 # @param theRMinor Torus minor radius.
3453 # @param theName Object name; when specified, this parameter is used
3454 # for result publication in the study. Otherwise, if automatic
3455 # publication is switched on, default value is used for result name.
3457 # @return New GEOM.GEOM_Object, containing the created torus.
3459 # @ref tui_creation_torus "Example"
3460 @ManageTransactions("PrimOp")
3461 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3463 Create a torus with given radiuses at the origin of coordinate system.
3466 theRMajor Torus major radius.
3467 theRMinor Torus minor radius.
3468 theName Object name; when specified, this parameter is used
3469 for result publication in the study. Otherwise, if automatic
3470 publication is switched on, default value is used for result name.
3473 New GEOM.GEOM_Object, containing the created torus.
3475 # Example: see GEOM_TestAll.py
3476 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3477 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3478 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3479 anObj.SetParameters(Parameters)
3480 self._autoPublish(anObj, theName, "torus")
3483 # end of l3_3d_primitives
3486 ## @addtogroup l3_complex
3489 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3490 # @param theBase Base shape to be extruded.
3491 # @param thePoint1 First end of extrusion vector.
3492 # @param thePoint2 Second end of extrusion vector.
3493 # @param theScaleFactor Use it to make prism with scaled second base.
3494 # Nagative value means not scaled second base.
3495 # @param theName Object name; when specified, this parameter is used
3496 # for result publication in the study. Otherwise, if automatic
3497 # publication is switched on, default value is used for result name.
3499 # @return New GEOM.GEOM_Object, containing the created prism.
3501 # @ref tui_creation_prism "Example"
3502 @ManageTransactions("PrimOp")
3503 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3505 Create a shape by extrusion of the base shape along a vector, defined by two points.
3508 theBase Base shape to be extruded.
3509 thePoint1 First end of extrusion vector.
3510 thePoint2 Second end of extrusion vector.
3511 theScaleFactor Use it to make prism with scaled second base.
3512 Nagative value means not scaled second base.
3513 theName Object name; when specified, this parameter is used
3514 for result publication in the study. Otherwise, if automatic
3515 publication is switched on, default value is used for result name.
3518 New GEOM.GEOM_Object, containing the created prism.
3520 # Example: see GEOM_TestAll.py
3523 if theScaleFactor > 0:
3524 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3525 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3527 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3528 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3529 anObj.SetParameters(Parameters)
3530 self._autoPublish(anObj, theName, "prism")
3533 ## Create a shape by extrusion of the base shape along a
3534 # vector, defined by two points, in 2 Ways (forward/backward).
3535 # @param theBase Base shape to be extruded.
3536 # @param thePoint1 First end of extrusion vector.
3537 # @param thePoint2 Second end of extrusion vector.
3538 # @param theName Object name; when specified, this parameter is used
3539 # for result publication in the study. Otherwise, if automatic
3540 # publication is switched on, default value is used for result name.
3542 # @return New GEOM.GEOM_Object, containing the created prism.
3544 # @ref tui_creation_prism "Example"
3545 @ManageTransactions("PrimOp")
3546 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3548 Create a shape by extrusion of the base shape along a
3549 vector, defined by two points, in 2 Ways (forward/backward).
3552 theBase Base shape to be extruded.
3553 thePoint1 First end of extrusion vector.
3554 thePoint2 Second end of extrusion vector.
3555 theName Object name; when specified, this parameter is used
3556 for result publication in the study. Otherwise, if automatic
3557 publication is switched on, default value is used for result name.
3560 New GEOM.GEOM_Object, containing the created prism.
3562 # Example: see GEOM_TestAll.py
3563 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3564 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3565 self._autoPublish(anObj, theName, "prism")
3568 ## Create a shape by extrusion of the base shape along the vector,
3569 # i.e. all the space, transfixed by the base shape during its translation
3570 # along the vector on the given distance.
3571 # @param theBase Base shape to be extruded.
3572 # @param theVec Direction of extrusion.
3573 # @param theH Prism dimension along theVec.
3574 # @param theScaleFactor Use it to make prism with scaled second base.
3575 # Negative value means not scaled second base.
3576 # @param theName Object name; when specified, this parameter is used
3577 # for result publication in the study. Otherwise, if automatic
3578 # publication is switched on, default value is used for result name.
3580 # @return New GEOM.GEOM_Object, containing the created prism.
3582 # @ref tui_creation_prism "Example"
3583 @ManageTransactions("PrimOp")
3584 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3586 Create a shape by extrusion of the base shape along the vector,
3587 i.e. all the space, transfixed by the base shape during its translation
3588 along the vector on the given distance.
3591 theBase Base shape to be extruded.
3592 theVec Direction of extrusion.
3593 theH Prism dimension along theVec.
3594 theScaleFactor Use it to make prism with scaled second base.
3595 Negative value means not scaled second base.
3596 theName Object name; when specified, this parameter is used
3597 for result publication in the study. Otherwise, if automatic
3598 publication is switched on, default value is used for result name.
3601 New GEOM.GEOM_Object, containing the created prism.
3603 # Example: see GEOM_TestAll.py
3606 if theScaleFactor > 0:
3607 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3608 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3610 theH,Parameters = ParseParameters(theH)
3611 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3612 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3613 anObj.SetParameters(Parameters)
3614 self._autoPublish(anObj, theName, "prism")
3617 ## Create a shape by extrusion of the base shape along the vector,
3618 # i.e. all the space, transfixed by the base shape during its translation
3619 # along the vector on the given distance in 2 Ways (forward/backward).
3620 # @param theBase Base shape to be extruded.
3621 # @param theVec Direction of extrusion.
3622 # @param theH Prism dimension along theVec in forward direction.
3623 # @param theName Object name; when specified, this parameter is used
3624 # for result publication in the study. Otherwise, if automatic
3625 # publication is switched on, default value is used for result name.
3627 # @return New GEOM.GEOM_Object, containing the created prism.
3629 # @ref tui_creation_prism "Example"
3630 @ManageTransactions("PrimOp")
3631 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3633 Create a shape by extrusion of the base shape along the vector,
3634 i.e. all the space, transfixed by the base shape during its translation
3635 along the vector on the given distance in 2 Ways (forward/backward).
3638 theBase Base shape to be extruded.
3639 theVec Direction of extrusion.
3640 theH Prism dimension along theVec in forward direction.
3641 theName Object name; when specified, this parameter is used
3642 for result publication in the study. Otherwise, if automatic
3643 publication is switched on, default value is used for result name.
3646 New GEOM.GEOM_Object, containing the created prism.
3648 # Example: see GEOM_TestAll.py
3649 theH,Parameters = ParseParameters(theH)
3650 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3651 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3652 anObj.SetParameters(Parameters)
3653 self._autoPublish(anObj, theName, "prism")
3656 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3657 # @param theBase Base shape to be extruded.
3658 # @param theDX, theDY, theDZ Directions of extrusion.
3659 # @param theScaleFactor Use it to make prism with scaled second base.
3660 # Nagative value means not scaled second base.
3661 # @param theName Object name; when specified, this parameter is used
3662 # for result publication in the study. Otherwise, if automatic
3663 # publication is switched on, default value is used for result name.
3665 # @return New GEOM.GEOM_Object, containing the created prism.
3667 # @ref tui_creation_prism "Example"
3668 @ManageTransactions("PrimOp")
3669 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3671 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3674 theBase Base shape to be extruded.
3675 theDX, theDY, theDZ Directions of extrusion.
3676 theScaleFactor Use it to make prism with scaled second base.
3677 Nagative value means not scaled second base.
3678 theName Object name; when specified, this parameter is used
3679 for result publication in the study. Otherwise, if automatic
3680 publication is switched on, default value is used for result name.
3683 New GEOM.GEOM_Object, containing the created prism.
3685 # Example: see GEOM_TestAll.py
3688 if theScaleFactor > 0:
3689 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3690 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3692 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3693 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3694 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3695 anObj.SetParameters(Parameters)
3696 self._autoPublish(anObj, theName, "prism")
3699 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3700 # i.e. all the space, transfixed by the base shape during its translation
3701 # along the vector on the given distance in 2 Ways (forward/backward).
3702 # @param theBase Base shape to be extruded.
3703 # @param theDX, theDY, theDZ Directions of extrusion.
3704 # @param theName Object name; when specified, this parameter is used
3705 # for result publication in the study. Otherwise, if automatic
3706 # publication is switched on, default value is used for result name.
3708 # @return New GEOM.GEOM_Object, containing the created prism.
3710 # @ref tui_creation_prism "Example"
3711 @ManageTransactions("PrimOp")
3712 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3714 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3715 i.e. all the space, transfixed by the base shape during its translation
3716 along the vector on the given distance in 2 Ways (forward/backward).
3719 theBase Base shape to be extruded.
3720 theDX, theDY, theDZ Directions of extrusion.
3721 theName Object name; when specified, this parameter is used
3722 for result publication in the study. Otherwise, if automatic
3723 publication is switched on, default value is used for result name.
3726 New GEOM.GEOM_Object, containing the created prism.
3728 # Example: see GEOM_TestAll.py
3729 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3730 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3731 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3732 anObj.SetParameters(Parameters)
3733 self._autoPublish(anObj, theName, "prism")
3736 ## Create a shape by revolution of the base shape around the axis
3737 # on the given angle, i.e. all the space, transfixed by the base
3738 # shape during its rotation around the axis on the given angle.
3739 # @param theBase Base shape to be rotated.
3740 # @param theAxis Rotation axis.
3741 # @param theAngle Rotation angle in radians.
3742 # @param theName Object name; when specified, this parameter is used
3743 # for result publication in the study. Otherwise, if automatic
3744 # publication is switched on, default value is used for result name.
3746 # @return New GEOM.GEOM_Object, containing the created revolution.
3748 # @ref tui_creation_revolution "Example"
3749 @ManageTransactions("PrimOp")
3750 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3752 Create a shape by revolution of the base shape around the axis
3753 on the given angle, i.e. all the space, transfixed by the base
3754 shape during its rotation around the axis on the given angle.
3757 theBase Base shape to be rotated.
3758 theAxis Rotation axis.
3759 theAngle Rotation angle in radians.
3760 theName Object name; when specified, this parameter is used
3761 for result publication in the study. Otherwise, if automatic
3762 publication is switched on, default value is used for result name.
3765 New GEOM.GEOM_Object, containing the created revolution.
3767 # Example: see GEOM_TestAll.py
3768 theAngle,Parameters = ParseParameters(theAngle)
3769 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3770 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3771 anObj.SetParameters(Parameters)
3772 self._autoPublish(anObj, theName, "revolution")
3775 ## Create a shape by revolution of the base shape around the axis
3776 # on the given angle, i.e. all the space, transfixed by the base
3777 # shape during its rotation around the axis on the given angle in
3778 # both directions (forward/backward)
3779 # @param theBase Base shape to be rotated.
3780 # @param theAxis Rotation axis.
3781 # @param theAngle Rotation angle in radians.
3782 # @param theName Object name; when specified, this parameter is used
3783 # for result publication in the study. Otherwise, if automatic
3784 # publication is switched on, default value is used for result name.
3786 # @return New GEOM.GEOM_Object, containing the created revolution.
3788 # @ref tui_creation_revolution "Example"
3789 @ManageTransactions("PrimOp")
3790 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3792 Create a shape by revolution of the base shape around the axis
3793 on the given angle, i.e. all the space, transfixed by the base
3794 shape during its rotation around the axis on the given angle in
3795 both directions (forward/backward).
3798 theBase Base shape to be rotated.
3799 theAxis Rotation axis.
3800 theAngle Rotation angle in radians.
3801 theName Object name; when specified, this parameter is used
3802 for result publication in the study. Otherwise, if automatic
3803 publication is switched on, default value is used for result name.
3806 New GEOM.GEOM_Object, containing the created revolution.
3808 theAngle,Parameters = ParseParameters(theAngle)
3809 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3810 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3811 anObj.SetParameters(Parameters)
3812 self._autoPublish(anObj, theName, "revolution")
3815 ## Create a face from a given set of contours.
3816 # @param theContours either a list or a compound of edges/wires.
3817 # @param theMinDeg a minimal degree of BSpline surface to create.
3818 # @param theMaxDeg a maximal degree of BSpline surface to create.
3819 # @param theTol2D a 2d tolerance to be reached.
3820 # @param theTol3D a 3d tolerance to be reached.
3821 # @param theNbIter a number of iteration of approximation algorithm.
3822 # @param theMethod Kind of method to perform filling operation
3823 # (see GEOM.filling_oper_method enum).
3824 # @param isApprox if True, BSpline curves are generated in the process
3825 # of surface construction. By default it is False, that means
3826 # the surface is created using given curves. The usage of
3827 # Approximation makes the algorithm work slower, but allows
3828 # building the surface for rather complex cases.
3829 # @param theName Object name; when specified, this parameter is used
3830 # for result publication in the study. Otherwise, if automatic
3831 # publication is switched on, default value is used for result name.
3833 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3835 # @ref tui_creation_filling "Example"
3836 @ManageTransactions("PrimOp")
3837 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3838 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3840 Create a face from a given set of contours.
3843 theContours either a list or a compound of edges/wires.
3844 theMinDeg a minimal degree of BSpline surface to create.
3845 theMaxDeg a maximal degree of BSpline surface to create.
3846 theTol2D a 2d tolerance to be reached.
3847 theTol3D a 3d tolerance to be reached.
3848 theNbIter a number of iteration of approximation algorithm.
3849 theMethod Kind of method to perform filling operation
3850 (see GEOM.filling_oper_method enum).
3851 isApprox if True, BSpline curves are generated in the process
3852 of surface construction. By default it is False, that means
3853 the surface is created using given curves. The usage of
3854 Approximation makes the algorithm work slower, but allows
3855 building the surface for rather complex cases.
3856 theName Object name; when specified, this parameter is used
3857 for result publication in the study. Otherwise, if automatic
3858 publication is switched on, default value is used for result name.
3861 New GEOM.GEOM_Object (face), containing the created filling surface.
3864 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3866 # Example: see GEOM_TestAll.py
3867 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3868 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3869 theTol2D, theTol3D, theNbIter,
3870 theMethod, isApprox)
3871 RaiseIfFailed("MakeFilling", self.PrimOp)
3872 anObj.SetParameters(Parameters)
3873 self._autoPublish(anObj, theName, "filling")
3877 ## Create a face from a given set of contours.
3878 # This method corresponds to MakeFilling() with isApprox=True.
3879 # @param theContours either a list or a compound of edges/wires.
3880 # @param theMinDeg a minimal degree of BSpline surface to create.
3881 # @param theMaxDeg a maximal degree of BSpline surface to create.
3882 # @param theTol3D a 3d tolerance to be reached.
3883 # @param theName Object name; when specified, this parameter is used
3884 # for result publication in the study. Otherwise, if automatic
3885 # publication is switched on, default value is used for result name.
3887 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3889 # @ref tui_creation_filling "Example"
3890 @ManageTransactions("PrimOp")
3891 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3893 Create a filling from the given compound of contours.
3894 This method corresponds to MakeFilling() with isApprox=True.
3897 theContours either a list or a compound of edges/wires.
3898 theMinDeg a minimal degree of BSpline surface to create.
3899 theMaxDeg a maximal degree of BSpline surface to create.
3900 theTol3D a 3d tolerance to be reached.
3901 theName Object name; when specified, this parameter is used
3902 for result publication in the study. Otherwise, if automatic
3903 publication is switched on, default value is used for result name.
3906 New GEOM.GEOM_Object (face), containing the created filling surface.
3909 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3911 # Example: see GEOM_TestAll.py
3912 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3913 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3914 0, theTol3D, 0, GEOM.FOM_Default, True)
3915 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3916 anObj.SetParameters(Parameters)
3917 self._autoPublish(anObj, theName, "filling")
3920 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3921 # @param theSeqSections - set of specified sections.
3922 # @param theModeSolid - mode defining building solid or shell
3923 # @param thePreci - precision 3D used for smoothing
3924 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3925 # @param theName Object name; when specified, this parameter is used
3926 # for result publication in the study. Otherwise, if automatic
3927 # publication is switched on, default value is used for result name.
3929 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3931 # @ref swig_todo "Example"
3932 @ManageTransactions("PrimOp")
3933 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3935 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3938 theSeqSections - set of specified sections.
3939 theModeSolid - mode defining building solid or shell
3940 thePreci - precision 3D used for smoothing
3941 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3942 theName Object name; when specified, this parameter is used
3943 for result publication in the study. Otherwise, if automatic
3944 publication is switched on, default value is used for result name.
3947 New GEOM.GEOM_Object, containing the created shell or solid.
3949 # Example: see GEOM_TestAll.py
3950 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3951 RaiseIfFailed("MakeThruSections", self.PrimOp)
3952 self._autoPublish(anObj, theName, "filling")
3955 ## Create a shape by extrusion of the base shape along
3956 # the path shape. The path shape can be a wire or an edge. It is
3957 # possible to generate groups along with the result by means of
3958 # setting the flag \a IsGenerateGroups.<BR>
3959 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3960 # set, an error is occurred. If \a thePath is not closed edge/wire,
3961 # the following groups are returned:
3962 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3964 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3967 # "Down" and "Up" groups contain:
3968 # - Edges if \a theBase is edge or wire;
3969 # - Faces if \a theBase is face or shell.<BR>
3971 # "Side1" and "Side2" groups contain edges generated from the first
3972 # and last vertices of \a theBase. The first and last vertices are
3973 # determined taking into account edge/wire orientation.<BR>
3974 # "Other" group represents faces generated from the bounding edges of
3977 # @param theBase Base shape to be extruded.
3978 # @param thePath Path shape to extrude the base shape along it.
3979 # @param IsGenerateGroups flag that tells if it is necessary to
3980 # create groups. It is equal to False by default.
3981 # @param theName Object name; when specified, this parameter is used
3982 # for result publication in the study. Otherwise, if automatic
3983 # publication is switched on, default value is used for result name.
3985 # @return New GEOM.GEOM_Object, containing the created pipe if
3986 # \a IsGenerateGroups is not set. Otherwise it returns a
3987 # list of GEOM.GEOM_Object. Its first element is the created pipe, the
3988 # remaining ones are created groups.
3990 # @ref tui_creation_pipe "Example"
3991 @ManageTransactions("PrimOp")
3992 def MakePipe(self, theBase, thePath,
3993 IsGenerateGroups=False, theName=None):
3995 Create a shape by extrusion of the base shape along
3996 the path shape. The path shape can be a wire or an edge. It is
3997 possible to generate groups along with the result by means of
3998 setting the flag IsGenerateGroups.
3999 If thePath is a closed edge or wire and IsGenerateGroups is
4000 set, an error is occurred. If thePath is not closed edge/wire,
4001 the following groups are returned:
4002 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4004 - If theBase is closed edge or wire, face or shell: "Down", "Up",
4006 "Down" and "Up" groups contain:
4007 - Edges if theBase is edge or wire;
4008 - Faces if theBase is face or shell.
4009 "Side1" and "Side2" groups contain edges generated from the first
4010 and last vertices of theBase. The first and last vertices are
4011 determined taking into account edge/wire orientation.
4012 "Other" group represents faces generated from the bounding edges of
4016 theBase Base shape to be extruded.
4017 thePath Path shape to extrude the base shape along it.
4018 IsGenerateGroups flag that tells if it is necessary to
4019 create groups. It is equal to False by default.
4020 theName Object name; when specified, this parameter is used
4021 for result publication in the study. Otherwise, if automatic
4022 publication is switched on, default value is used for result name.
4025 New GEOM.GEOM_Object, containing the created pipe if
4026 IsGenerateGroups is not set. Otherwise it returns a
4027 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4028 remaining ones are created groups.
4030 # Example: see GEOM_TestAll.py
4031 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4032 RaiseIfFailed("MakePipe", self.PrimOp)
4034 if IsGenerateGroups:
4035 self._autoPublish(aList, theName, "pipe")
4038 self._autoPublish(aList[0], theName, "pipe")
4041 ## Create a shape by extrusion of the profile shape along
4042 # the path shape. The path shape can be a wire or an edge.
4043 # the several profiles can be specified in the several locations of path.
4044 # It is possible to generate groups along with the result by means of
4045 # setting the flag \a IsGenerateGroups. For detailed information on
4046 # groups that can be created please see the method MakePipe().
4047 # @param theSeqBases - list of Bases shape to be extruded.
4048 # @param theLocations - list of locations on the path corresponding
4049 # specified list of the Bases shapes. Number of locations
4050 # should be equal to number of bases or list of locations can be empty.
4051 # @param thePath - Path shape to extrude the base shape along it.
4052 # @param theWithContact - the mode defining that the section is translated to be in
4053 # contact with the spine.
4054 # @param theWithCorrection - defining that the section is rotated to be
4055 # orthogonal to the spine tangent in the correspondent point
4056 # @param IsGenerateGroups - flag that tells if it is necessary to
4057 # create groups. It is equal to False by default.
4058 # @param theName Object name; when specified, this parameter is used
4059 # for result publication in the study. Otherwise, if automatic
4060 # publication is switched on, default value is used for result name.
4062 # @return New GEOM.GEOM_Object, containing the created pipe if
4063 # \a IsGenerateGroups is not set. Otherwise it returns new
4064 # GEOM.ListOfGO. Its first element is the created pipe, the
4065 # remaining ones are created groups.
4067 # @ref tui_creation_pipe_with_diff_sec "Example"
4068 @ManageTransactions("PrimOp")
4069 def MakePipeWithDifferentSections(self, theSeqBases,
4070 theLocations, thePath,
4071 theWithContact, theWithCorrection,
4072 IsGenerateGroups=False, theName=None):
4074 Create a shape by extrusion of the profile shape along
4075 the path shape. The path shape can be a wire or an edge.
4076 the several profiles can be specified in the several locations of path.
4077 It is possible to generate groups along with the result by means of
4078 setting the flag IsGenerateGroups. For detailed information on
4079 groups that can be created please see the method geompy.MakePipe().
4082 theSeqBases - list of Bases shape to be extruded.
4083 theLocations - list of locations on the path corresponding
4084 specified list of the Bases shapes. Number of locations
4085 should be equal to number of bases or list of locations can be empty.
4086 thePath - Path shape to extrude the base shape along it.
4087 theWithContact - the mode defining that the section is translated to be in
4088 contact with the spine(0/1)
4089 theWithCorrection - defining that the section is rotated to be
4090 orthogonal to the spine tangent in the correspondent point (0/1)
4091 IsGenerateGroups - flag that tells if it is necessary to
4092 create groups. It is equal to False by default.
4093 theName Object name; when specified, this parameter is used
4094 for result publication in the study. Otherwise, if automatic
4095 publication is switched on, default value is used for result name.
4098 New GEOM.GEOM_Object, containing the created pipe if
4099 IsGenerateGroups is not set. Otherwise it returns new
4100 GEOM.ListOfGO. Its first element is the created pipe, the
4101 remaining ones are created groups.
4103 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4104 theLocations, thePath,
4105 theWithContact, theWithCorrection,
4106 False, IsGenerateGroups)
4107 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4109 if IsGenerateGroups:
4110 self._autoPublish(aList, theName, "pipe")
4113 self._autoPublish(aList[0], theName, "pipe")
4116 ## Create a shape by extrusion of the profile shape along
4117 # the path shape. This function is a version of
4118 # MakePipeWithDifferentSections() with the same parameters, except
4119 # eliminated theWithContact and theWithCorrection. So it is
4120 # possible to find the description of all parameters is in this
4121 # method. The difference is that this method performs the operation
4122 # step by step, i.e. it creates pipes between each pair of neighbor
4123 # sections and fuses them into a single shape.
4125 # @ref tui_creation_pipe_with_diff_sec "Example"
4126 @ManageTransactions("PrimOp")
4127 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4128 theLocations, thePath,
4129 IsGenerateGroups=False, theName=None):
4131 Create a shape by extrusion of the profile shape along
4132 the path shape. This function is a version of
4133 MakePipeWithDifferentSections() with the same parameters, except
4134 eliminated theWithContact and theWithCorrection. So it is
4135 possible to find the description of all parameters is in this
4136 method. The difference is that this method performs the operation
4137 step by step, i.e. it creates pipes between each pair of neighbor
4138 sections and fuses them into a single shape.
4140 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4141 theLocations, thePath,
4143 True, IsGenerateGroups)
4144 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4146 if IsGenerateGroups:
4147 self._autoPublish(aList, theName, "pipe")
4150 self._autoPublish(aList[0], theName, "pipe")
4153 ## Create a shape by extrusion of the profile shape along
4154 # the path shape. The path shape can be a wire or an edge.
4155 # the several profiles can be specified in the several locations of path.
4156 # It is possible to generate groups along with the result by means of
4157 # setting the flag \a IsGenerateGroups. For detailed information on
4158 # groups that can be created please see the method MakePipe().
4159 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4160 # shell or face. If number of faces in neighbour sections
4161 # aren't coincided result solid between such sections will
4162 # be created using external boundaries of this shells.
4163 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4164 # This list is used for searching correspondences between
4165 # faces in the sections. Size of this list must be equal
4166 # to size of list of base shapes.
4167 # @param theLocations - list of locations on the path corresponding
4168 # specified list of the Bases shapes. Number of locations
4169 # should be equal to number of bases. First and last
4170 # locations must be coincided with first and last vertexes
4171 # of path correspondingly.
4172 # @param thePath - Path shape to extrude the base shape along it.
4173 # @param theWithContact - the mode defining that the section is translated to be in
4174 # contact with the spine.
4175 # @param theWithCorrection - defining that the section is rotated to be
4176 # orthogonal to the spine tangent in the correspondent point
4177 # @param IsGenerateGroups - flag that tells if it is necessary to
4178 # create groups. It is equal to False by default.
4179 # @param theName Object name; when specified, this parameter is used
4180 # for result publication in the study. Otherwise, if automatic
4181 # publication is switched on, default value is used for result name.
4183 # @return New GEOM.GEOM_Object, containing the created solids if
4184 # \a IsGenerateGroups is not set. Otherwise it returns new
4185 # GEOM.ListOfGO. Its first element is the created solids, the
4186 # remaining ones are created groups.
4188 # @ref tui_creation_pipe_with_shell_sec "Example"
4189 @ManageTransactions("PrimOp")
4190 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4191 theLocations, thePath,
4192 theWithContact, theWithCorrection,
4193 IsGenerateGroups=False, theName=None):
4195 Create a shape by extrusion of the profile shape along
4196 the path shape. The path shape can be a wire or an edge.
4197 the several profiles can be specified in the several locations of path.
4198 It is possible to generate groups along with the result by means of
4199 setting the flag IsGenerateGroups. For detailed information on
4200 groups that can be created please see the method geompy.MakePipe().
4203 theSeqBases - list of Bases shape to be extruded. Base shape must be
4204 shell or face. If number of faces in neighbour sections
4205 aren't coincided result solid between such sections will
4206 be created using external boundaries of this shells.
4207 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4208 This list is used for searching correspondences between
4209 faces in the sections. Size of this list must be equal
4210 to size of list of base shapes.
4211 theLocations - list of locations on the path corresponding
4212 specified list of the Bases shapes. Number of locations
4213 should be equal to number of bases. First and last
4214 locations must be coincided with first and last vertexes
4215 of path correspondingly.
4216 thePath - Path shape to extrude the base shape along it.
4217 theWithContact - the mode defining that the section is translated to be in
4218 contact with the spine (0/1)
4219 theWithCorrection - defining that the section is rotated to be
4220 orthogonal to the spine tangent in the correspondent point (0/1)
4221 IsGenerateGroups - flag that tells if it is necessary to
4222 create groups. It is equal to False by default.
4223 theName Object name; when specified, this parameter is used
4224 for result publication in the study. Otherwise, if automatic
4225 publication is switched on, default value is used for result name.
4228 New GEOM.GEOM_Object, containing the created solids if
4229 IsGenerateGroups is not set. Otherwise it returns new
4230 GEOM.ListOfGO. Its first element is the created solids, the
4231 remaining ones are created groups.
4233 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4234 theLocations, thePath,
4235 theWithContact, theWithCorrection,
4237 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4239 if IsGenerateGroups:
4240 self._autoPublish(aList, theName, "pipe")
4243 self._autoPublish(aList[0], theName, "pipe")
4246 ## Create a shape by extrusion of the profile shape along
4247 # the path shape. This function is used only for debug pipe
4248 # functionality - it is a version of function MakePipeWithShellSections()
4249 # which give a possibility to receive information about
4250 # creating pipe between each pair of sections step by step.
4251 @ManageTransactions("PrimOp")
4252 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4253 theLocations, thePath,
4254 theWithContact, theWithCorrection,
4255 IsGenerateGroups=False, theName=None):
4257 Create a shape by extrusion of the profile shape along
4258 the path shape. This function is used only for debug pipe
4259 functionality - it is a version of previous function
4260 geompy.MakePipeWithShellSections() which give a possibility to
4261 receive information about creating pipe between each pair of
4262 sections step by step.
4265 nbsect = len(theSeqBases)
4266 nbsubsect = len(theSeqSubBases)
4267 #print "nbsect = ",nbsect
4268 for i in range(1,nbsect):
4270 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4271 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4273 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4274 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4275 tmpLocations, thePath,
4276 theWithContact, theWithCorrection,
4278 if self.PrimOp.IsDone() == 0:
4279 print("Problems with pipe creation between ",i," and ",i+1," sections")
4280 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4283 print("Pipe between ",i," and ",i+1," sections is OK")
4284 res.append(aList[0])
4288 resc = self.MakeCompound(res)
4289 #resc = self.MakeSewing(res, 0.001)
4290 #print "resc: ",resc
4291 self._autoPublish(resc, theName, "pipe")
4294 ## Create solids between given sections.
4295 # It is possible to generate groups along with the result by means of
4296 # setting the flag \a IsGenerateGroups. For detailed information on
4297 # groups that can be created please see the method MakePipe().
4298 # @param theSeqBases - list of sections (shell or face).
4299 # @param theLocations - list of corresponding vertexes
4300 # @param IsGenerateGroups - flag that tells if it is necessary to
4301 # create groups. It is equal to False by default.
4302 # @param theName Object name; when specified, this parameter is used
4303 # for result publication in the study. Otherwise, if automatic
4304 # publication is switched on, default value is used for result name.
4306 # @return New GEOM.GEOM_Object, containing the created solids if
4307 # \a IsGenerateGroups is not set. Otherwise it returns new
4308 # GEOM.ListOfGO. Its first element is the created solids, the
4309 # remaining ones are created groups.
4311 # @ref tui_creation_pipe_without_path "Example"
4312 @ManageTransactions("PrimOp")
4313 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4314 IsGenerateGroups=False, theName=None):
4316 Create solids between given sections.
4317 It is possible to generate groups along with the result by means of
4318 setting the flag IsGenerateGroups. For detailed information on
4319 groups that can be created please see the method geompy.MakePipe().
4322 theSeqBases - list of sections (shell or face).
4323 theLocations - list of corresponding vertexes
4324 IsGenerateGroups - flag that tells if it is necessary to
4325 create groups. It is equal to False by default.
4326 theName Object name; when specified, this parameter is used
4327 for result publication in the study. Otherwise, if automatic
4328 publication is switched on, default value is used for result name.
4331 New GEOM.GEOM_Object, containing the created solids if
4332 IsGenerateGroups is not set. Otherwise it returns new
4333 GEOM.ListOfGO. Its first element is the created solids, the
4334 remaining ones are created groups.
4336 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4338 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4340 if IsGenerateGroups:
4341 self._autoPublish(aList, theName, "pipe")
4344 self._autoPublish(aList[0], theName, "pipe")
4347 ## Create a shape by extrusion of the base shape along
4348 # the path shape with constant bi-normal direction along the given vector.
4349 # The path shape can be a wire or an edge.
4350 # It is possible to generate groups along with the result by means of
4351 # setting the flag \a IsGenerateGroups. For detailed information on
4352 # groups that can be created please see the method MakePipe().
4353 # @param theBase Base shape to be extruded.
4354 # @param thePath Path shape to extrude the base shape along it.
4355 # @param theVec Vector defines a constant binormal direction to keep the
4356 # same angle between the direction and the sections
4357 # along the sweep surface.
4358 # @param IsGenerateGroups flag that tells if it is necessary to
4359 # create groups. It is equal to False by default.
4360 # @param theName Object name; when specified, this parameter is used
4361 # for result publication in the study. Otherwise, if automatic
4362 # publication is switched on, default value is used for result name.
4364 # @return New GEOM.GEOM_Object, containing the created pipe if
4365 # \a IsGenerateGroups is not set. Otherwise it returns new
4366 # GEOM.ListOfGO. Its first element is the created pipe, the
4367 # remaining ones are created groups.
4369 # @ref tui_creation_pipe "Example"
4370 @ManageTransactions("PrimOp")
4371 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4372 IsGenerateGroups=False, theName=None):
4374 Create a shape by extrusion of the base shape along
4375 the path shape with constant bi-normal direction along the given vector.
4376 The path shape can be a wire or an edge.
4377 It is possible to generate groups along with the result by means of
4378 setting the flag IsGenerateGroups. For detailed information on
4379 groups that can be created please see the method geompy.MakePipe().
4382 theBase Base shape to be extruded.
4383 thePath Path shape to extrude the base shape along it.
4384 theVec Vector defines a constant binormal direction to keep the
4385 same angle between the direction and the sections
4386 along the sweep surface.
4387 IsGenerateGroups flag that tells if it is necessary to
4388 create groups. It is equal to False by default.
4389 theName Object name; when specified, this parameter is used
4390 for result publication in the study. Otherwise, if automatic
4391 publication is switched on, default value is used for result name.
4394 New GEOM.GEOM_Object, containing the created pipe if
4395 IsGenerateGroups is not set. Otherwise it returns new
4396 GEOM.ListOfGO. Its first element is the created pipe, the
4397 remaining ones are created groups.
4399 # Example: see GEOM_TestAll.py
4400 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4401 theVec, IsGenerateGroups)
4402 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4404 if IsGenerateGroups:
4405 self._autoPublish(aList, theName, "pipe")
4408 self._autoPublish(aList[0], theName, "pipe")
4411 ## Makes a thick solid from a shape. If the input is a surface shape
4412 # (face or shell) the result is a thick solid. If an input shape is
4413 # a solid the result is a hollowed solid with removed faces.
4414 # @param theShape Face or Shell to get thick solid or solid to get
4416 # @param theThickness Thickness of the resulting solid
4417 # @param theFacesIDs the list of face IDs to be removed from the
4418 # result. It is ignored if \a theShape is a face or a shell.
4419 # It is empty by default.
4420 # @param theInside If true the thickness is applied towards inside
4421 # @param theName Object name; when specified, this parameter is used
4422 # for result publication in the study. Otherwise, if automatic
4423 # publication is switched on, default value is used for result name.
4425 # @return New GEOM.GEOM_Object, containing the created solid
4427 # @ref tui_creation_thickness "Example"
4428 @ManageTransactions("PrimOp")
4429 def MakeThickSolid(self, theShape, theThickness,
4430 theFacesIDs=[], theInside=False, theName=None):
4432 Make a thick solid from a shape. If the input is a surface shape
4433 (face or shell) the result is a thick solid. If an input shape is
4434 a solid the result is a hollowed solid with removed faces.
4437 theShape Face or Shell to get thick solid or solid to get
4439 theThickness Thickness of the resulting solid
4440 theFacesIDs the list of face IDs to be removed from the
4441 result. It is ignored if theShape is a face or a
4442 shell. It is empty by default.
4443 theInside If true the thickness is applied towards inside
4444 theName Object name; when specified, this parameter is used
4445 for result publication in the study. Otherwise, if automatic
4446 publication is switched on, default value is used for result name.
4449 New GEOM.GEOM_Object, containing the created solid
4451 # Example: see GEOM_TestAll.py
4452 theThickness,Parameters = ParseParameters(theThickness)
4453 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4454 theThickness, True, theInside)
4455 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4456 anObj.SetParameters(Parameters)
4457 self._autoPublish(anObj, theName, "thickSolid")
4461 ## Modifies a shape to make it a thick solid. If the input is a surface
4462 # shape (face or shell) the result is a thick solid. If an input shape
4463 # is a solid the result is a hollowed solid with removed faces.
4464 # @param theShape Face or Shell to get thick solid or solid to get
4466 # @param theThickness Thickness of the resulting solid
4467 # @param theFacesIDs the list of face IDs to be removed from the
4468 # result. It is ignored if \a theShape is a face or a shell.
4469 # It is empty by default.
4470 # @param theInside If true the thickness is applied towards inside
4472 # @return The modified shape
4474 # @ref tui_creation_thickness "Example"
4475 @ManageTransactions("PrimOp")
4476 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4478 Modifies a shape to make it a thick solid. If the input is a
4479 surface shape (face or shell) the result is a thick solid. If
4480 an input shape is a solid the result is a hollowed solid with
4484 theShape Face or Shell to get thick solid or solid to get
4486 theThickness Thickness of the resulting solid
4487 theFacesIDs the list of face IDs to be removed from the
4488 result. It is ignored if \a theShape is a face or
4489 a shell. It is empty by default.
4490 theInside If true the thickness is applied towards inside
4495 # Example: see GEOM_TestAll.py
4496 theThickness,Parameters = ParseParameters(theThickness)
4497 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4498 theThickness, False, theInside)
4499 RaiseIfFailed("Thicken", self.PrimOp)
4500 anObj.SetParameters(Parameters)
4503 ## Build a middle path of a pipe-like shape.
4504 # The path shape can be a wire or an edge.
4505 # @param theShape It can be closed or unclosed pipe-like shell
4506 # or a pipe-like solid.
4507 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4508 # should be wires or faces of theShape.
4509 # @param theName Object name; when specified, this parameter is used
4510 # for result publication in the study. Otherwise, if automatic
4511 # publication is switched on, default value is used for result name.
4513 # @note It is not assumed that exact or approximate copy of theShape
4514 # can be obtained by applying existing Pipe operation on the
4515 # resulting "Path" wire taking theBase1 as the base - it is not
4516 # always possible; though in some particular cases it might work
4517 # it is not guaranteed. Thus, RestorePath function should not be
4518 # considered as an exact reverse operation of the Pipe.
4520 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4521 # source pipe's "path".
4523 # @ref tui_creation_pipe_path "Example"
4524 @ManageTransactions("PrimOp")
4525 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4527 Build a middle path of a pipe-like shape.
4528 The path shape can be a wire or an edge.
4531 theShape It can be closed or unclosed pipe-like shell
4532 or a pipe-like solid.
4533 theBase1, theBase2 Two bases of the supposed pipe. This
4534 should be wires or faces of theShape.
4535 theName Object name; when specified, this parameter is used
4536 for result publication in the study. Otherwise, if automatic
4537 publication is switched on, default value is used for result name.
4540 New GEOM_Object, containing an edge or wire that represent
4543 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4544 RaiseIfFailed("RestorePath", self.PrimOp)
4545 self._autoPublish(anObj, theName, "path")
4548 ## Build a middle path of a pipe-like shape.
4549 # The path shape can be a wire or an edge.
4550 # @param theShape It can be closed or unclosed pipe-like shell
4551 # or a pipe-like solid.
4552 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4553 # should be lists of edges of theShape.
4554 # @param theName Object name; when specified, this parameter is used
4555 # for result publication in the study. Otherwise, if automatic
4556 # publication is switched on, default value is used for result name.
4558 # @note It is not assumed that exact or approximate copy of theShape
4559 # can be obtained by applying existing Pipe operation on the
4560 # resulting "Path" wire taking theBase1 as the base - it is not
4561 # always possible; though in some particular cases it might work
4562 # it is not guaranteed. Thus, RestorePath function should not be
4563 # considered as an exact reverse operation of the Pipe.
4565 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4566 # source pipe's "path".
4568 # @ref tui_creation_pipe_path "Example"
4569 @ManageTransactions("PrimOp")
4570 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4572 Build a middle path of a pipe-like shape.
4573 The path shape can be a wire or an edge.
4576 theShape It can be closed or unclosed pipe-like shell
4577 or a pipe-like solid.
4578 listEdges1, listEdges2 Two bases of the supposed pipe. This
4579 should be lists of edges of theShape.
4580 theName Object name; when specified, this parameter is used
4581 for result publication in the study. Otherwise, if automatic
4582 publication is switched on, default value is used for result name.
4585 New GEOM_Object, containing an edge or wire that represent
4588 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4589 RaiseIfFailed("RestorePath", self.PrimOp)
4590 self._autoPublish(anObj, theName, "path")
4596 ## @addtogroup l3_basic_go
4599 ## Create a linear edge with specified ends.
4600 # @param thePnt1 Point for the first end of edge.
4601 # @param thePnt2 Point for the second end of edge.
4602 # @param theName Object name; when specified, this parameter is used
4603 # for result publication in the study. Otherwise, if automatic
4604 # publication is switched on, default value is used for result name.
4606 # @return New GEOM.GEOM_Object, containing the created edge.
4608 # @ref tui_creation_edge "Example"
4609 @ManageTransactions("ShapesOp")
4610 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4612 Create a linear edge with specified ends.
4615 thePnt1 Point for the first end of edge.
4616 thePnt2 Point for the second end of edge.
4617 theName Object name; when specified, this parameter is used
4618 for result publication in the study. Otherwise, if automatic
4619 publication is switched on, default value is used for result name.
4622 New GEOM.GEOM_Object, containing the created edge.
4624 # Example: see GEOM_TestAll.py
4625 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4626 RaiseIfFailed("MakeEdge", self.ShapesOp)
4627 self._autoPublish(anObj, theName, "edge")
4630 ## Create a new edge, corresponding to the given length on the given curve.
4631 # @param theRefCurve The referenced curve (edge).
4632 # @param theLength Length on the referenced curve. It can be negative.
4633 # @param theStartPoint Any point can be selected for it, the new edge will begin
4634 # at the end of \a theRefCurve, close to the selected point.
4635 # If None, start from the first point of \a theRefCurve.
4636 # @param theName Object name; when specified, this parameter is used
4637 # for result publication in the study. Otherwise, if automatic
4638 # publication is switched on, default value is used for result name.
4640 # @return New GEOM.GEOM_Object, containing the created edge.
4642 # @ref tui_creation_edge "Example"
4643 @ManageTransactions("ShapesOp")
4644 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4646 Create a new edge, corresponding to the given length on the given curve.
4649 theRefCurve The referenced curve (edge).
4650 theLength Length on the referenced curve. It can be negative.
4651 theStartPoint Any point can be selected for it, the new edge will begin
4652 at the end of theRefCurve, close to the selected point.
4653 If None, start from the first point of theRefCurve.
4654 theName Object name; when specified, this parameter is used
4655 for result publication in the study. Otherwise, if automatic
4656 publication is switched on, default value is used for result name.
4659 New GEOM.GEOM_Object, containing the created edge.
4661 # Example: see GEOM_TestAll.py
4662 theLength, Parameters = ParseParameters(theLength)
4663 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4664 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4665 anObj.SetParameters(Parameters)
4666 self._autoPublish(anObj, theName, "edge")
4669 ## Create an edge from specified wire.
4670 # @param theWire source Wire
4671 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4672 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4673 # @param theName Object name; when specified, this parameter is used
4674 # for result publication in the study. Otherwise, if automatic
4675 # publication is switched on, default value is used for result name.
4677 # @return New GEOM.GEOM_Object, containing the created edge.
4679 # @ref tui_creation_edge "Example"
4680 @ManageTransactions("ShapesOp")
4681 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4683 Create an edge from specified wire.
4687 theLinearTolerance linear tolerance value (default = 1e-07)
4688 theAngularTolerance angular tolerance value (default = 1e-12)
4689 theName Object name; when specified, this parameter is used
4690 for result publication in the study. Otherwise, if automatic
4691 publication is switched on, default value is used for result name.
4694 New GEOM.GEOM_Object, containing the created edge.
4696 # Example: see GEOM_TestAll.py
4697 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4698 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4699 self._autoPublish(anObj, theName, "edge")
4702 ## Create a wire from the set of edges and wires.
4703 # @param theEdgesAndWires List of edges and/or wires.
4704 # @param theTolerance Maximum distance between vertices, that will be merged.
4705 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4706 # @param theName Object name; when specified, this parameter is used
4707 # for result publication in the study. Otherwise, if automatic
4708 # publication is switched on, default value is used for result name.
4710 # @return New GEOM.GEOM_Object, containing the created wire.
4712 # @ref tui_creation_wire "Example"
4713 @ManageTransactions("ShapesOp")
4714 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4716 Create a wire from the set of edges and wires.
4719 theEdgesAndWires List of edges and/or wires.
4720 theTolerance Maximum distance between vertices, that will be merged.
4721 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4722 theName Object name; when specified, this parameter is used
4723 for result publication in the study. Otherwise, if automatic
4724 publication is switched on, default value is used for result name.
4727 New GEOM.GEOM_Object, containing the created wire.
4729 # Example: see GEOM_TestAll.py
4730 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4731 RaiseIfFailed("MakeWire", self.ShapesOp)
4732 self._autoPublish(anObj, theName, "wire")
4735 ## Create a face on the given wire.
4736 # @param theWire closed Wire or Edge to build the face on.
4737 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4738 # If the tolerance of the obtained planar face is less
4739 # than 1e-06, this face will be returned, otherwise the
4740 # algorithm tries to build any suitable face on the given
4741 # wire and prints a warning message.
4742 # @param theName Object name; when specified, this parameter is used
4743 # for result publication in the study. Otherwise, if automatic
4744 # publication is switched on, default value is used for result name.
4746 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4748 # @ref tui_creation_face "Example"
4749 @ManageTransactions("ShapesOp")
4750 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4752 Create a face on the given wire.
4755 theWire closed Wire or Edge to build the face on.
4756 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4757 If the tolerance of the obtained planar face is less
4758 than 1e-06, this face will be returned, otherwise the
4759 algorithm tries to build any suitable face on the given
4760 wire and prints a warning message.
4761 theName Object name; when specified, this parameter is used
4762 for result publication in the study. Otherwise, if automatic
4763 publication is switched on, default value is used for result name.
4766 New GEOM.GEOM_Object, containing the created face (compound of faces).
4768 # Example: see GEOM_TestAll.py
4769 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4770 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4771 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4773 RaiseIfFailed("MakeFace", self.ShapesOp)
4774 self._autoPublish(anObj, theName, "face")
4777 ## Create a face on the given wires set.
4778 # @param theWires List of closed wires or edges to build the face on.
4779 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4780 # If the tolerance of the obtained planar face is less
4781 # than 1e-06, this face will be returned, otherwise the
4782 # algorithm tries to build any suitable face on the given
4783 # wire and prints a warning message.
4784 # @param theName Object name; when specified, this parameter is used
4785 # for result publication in the study. Otherwise, if automatic
4786 # publication is switched on, default value is used for result name.
4788 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4790 # @ref tui_creation_face "Example"
4791 @ManageTransactions("ShapesOp")
4792 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4794 Create a face on the given wires set.
4797 theWires List of closed wires or edges to build the face on.
4798 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4799 If the tolerance of the obtained planar face is less
4800 than 1e-06, this face will be returned, otherwise the
4801 algorithm tries to build any suitable face on the given
4802 wire and prints a warning message.
4803 theName Object name; when specified, this parameter is used
4804 for result publication in the study. Otherwise, if automatic
4805 publication is switched on, default value is used for result name.
4808 New GEOM.GEOM_Object, containing the created face (compound of faces).
4810 # Example: see GEOM_TestAll.py
4811 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4812 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4813 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4815 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4816 self._autoPublish(anObj, theName, "face")
4819 ## See MakeFaceWires() method for details.
4821 # @ref tui_creation_face "Example 1"
4822 # \n @ref swig_MakeFaces "Example 2"
4823 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4825 See geompy.MakeFaceWires() method for details.
4827 # Example: see GEOM_TestOthers.py
4828 # note: auto-publishing is done in self.MakeFaceWires()
4829 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4832 ## Create a face based on a surface from given face bounded
4834 # @param theFace the face whose surface is used to create a new face.
4835 # @param theWire the wire that will bound a new face.
4836 # @param theName Object name; when specified, this parameter is used
4837 # for result publication in the study. Otherwise, if automatic
4838 # publication is switched on, default value is used for result name.
4840 # @return New GEOM.GEOM_Object, containing the created face.
4842 # @ref tui_creation_face "Example"
4843 @ManageTransactions("ShapesOp")
4844 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4846 Create a face based on a surface from given face bounded
4850 theFace the face whose surface is used to create a new face.
4851 theWire the wire that will bound a new face.
4852 theName Object name; when specified, this parameter is used
4853 for result publication in the study. Otherwise, if automatic
4854 publication is switched on, default value is used for result name.
4857 New GEOM.GEOM_Object, containing the created face.
4859 # Example: see GEOM_TestAll.py
4860 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4861 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4862 self._autoPublish(anObj, theName, "face")
4865 ## Create a face from a set of edges with the given constraints.
4866 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4867 # - edges should form a closed wire;
4868 # - for each edge, constraint face is optional: if a constraint face is missing
4869 # for some edge, this means that there no constraint associated with this edge.
4870 # @param theName Object name; when specified, this parameter is used
4871 # for result publication in the study. Otherwise, if automatic
4872 # publication is switched on, default value is used for result name.
4874 # @return New GEOM.GEOM_Object, containing the created face.
4876 # @ref tui_creation_face "Example"
4877 @ManageTransactions("ShapesOp")
4878 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4880 Create a face from a set of edges with the given constraints.
4883 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4884 - edges should form a closed wire;
4885 - for each edge, constraint face is optional: if a constraint face is missing
4886 for some edge, this means that there no constraint associated with this edge.
4887 theName Object name; when specified, this parameter is used
4888 for result publication in the study. Otherwise, if automatic
4889 publication is switched on, default value is used for result name.
4892 New GEOM.GEOM_Object, containing the created face.
4894 # Example: see GEOM_TestAll.py
4895 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4897 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4898 self._autoPublish(anObj, theName, "face")
4901 ## Create a shell from the set of faces, shells and/or compounds of faces.
4902 # @param theFacesAndShells List of faces, shells and/or compounds of faces.
4903 # @param theName Object name; when specified, this parameter is used
4904 # for result publication in the study. Otherwise, if automatic
4905 # publication is switched on, default value is used for result name.
4907 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4909 # @ref tui_creation_shell "Example"
4910 @ManageTransactions("ShapesOp")
4911 def MakeShell(self, theFacesAndShells, theName=None):
4913 Create a shell from the set of faces and shells.
4916 theFacesAndShells List of faces and/or shells.
4917 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.
4922 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4924 # Example: see GEOM_TestAll.py
4925 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4926 RaiseIfFailed("MakeShell", self.ShapesOp)
4927 self._autoPublish(anObj, theName, "shell")
4930 ## Create a solid, bounded by the given shells.
4931 # @param theShells Sequence of bounding shells.
4932 # @param theName Object name; when specified, this parameter is used
4933 # for result publication in the study. Otherwise, if automatic
4934 # publication is switched on, default value is used for result name.
4936 # @return New GEOM.GEOM_Object, containing the created solid.
4938 # @ref tui_creation_solid "Example"
4939 @ManageTransactions("ShapesOp")
4940 def MakeSolid(self, theShells, theName=None):
4942 Create a solid, bounded by the given shells.
4945 theShells Sequence of bounding shells.
4946 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.
4951 New GEOM.GEOM_Object, containing the created solid.
4953 # Example: see GEOM_TestAll.py
4954 theShells = ToList(theShells)
4955 if len(theShells) == 1:
4956 descr = self._IsGoodForSolid(theShells[0])
4958 # raise RuntimeError, "MakeSolidShells : " + descr
4959 if descr == "WRN_SHAPE_UNCLOSED":
4960 raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4961 anObj = self.ShapesOp.MakeSolidShells(theShells)
4962 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4963 self._autoPublish(anObj, theName, "solid")
4966 ## Create a compound of the given shapes.
4967 # @param theShapes List of shapes to put in compound.
4968 # @param theName Object name; when specified, this parameter is used
4969 # for result publication in the study. Otherwise, if automatic
4970 # publication is switched on, default value is used for result name.
4972 # @return New GEOM.GEOM_Object, containing the created compound.
4974 # @ref tui_creation_compound "Example"
4975 @ManageTransactions("ShapesOp")
4976 def MakeCompound(self, theShapes, theName=None):
4978 Create a compound of the given shapes.
4981 theShapes List of shapes to put in compound.
4982 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.
4987 New GEOM.GEOM_Object, containing the created compound.
4989 # Example: see GEOM_TestAll.py
4990 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4991 RaiseIfFailed("MakeCompound", self.ShapesOp)
4992 self._autoPublish(anObj, theName, "compound")
4995 ## Create a solid (or solids) from the set of faces and/or shells.
4996 # @param theFacesOrShells List of faces and/or shells.
4997 # @param isIntersect If TRUE, forces performing intersections
4998 # between arguments; otherwise (default) intersection is not performed.
4999 # @param theName Object name; when specified, this parameter is used
5000 # for result publication in the study. Otherwise, if automatic
5001 # publication is switched on, default value is used for result name.
5003 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5005 # @ref tui_creation_solid_from_faces "Example"
5006 @ManageTransactions("ShapesOp")
5007 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5009 Create a solid (or solids) from the set of connected faces and/or shells.
5012 theFacesOrShells List of faces and/or shells.
5013 isIntersect If TRUE, forces performing intersections
5014 between arguments; otherwise (default) intersection is not performed
5015 theName Object name; when specified, this parameter is used.
5016 for result publication in the study. Otherwise, if automatic
5017 publication is switched on, default value is used for result name.
5020 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5022 # Example: see GEOM_TestAll.py
5023 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5024 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5025 self._autoPublish(anObj, theName, "solid")
5028 # end of l3_basic_go
5031 ## @addtogroup l2_measure
5034 ## Gives quantity of faces in the given shape.
5035 # @param theShape Shape to count faces of.
5036 # @return Quantity of faces.
5038 # @ref swig_NumberOf "Example"
5039 @ManageTransactions("ShapesOp")
5040 def NumberOfFaces(self, theShape):
5042 Gives quantity of faces in the given shape.
5045 theShape Shape to count faces of.
5050 # Example: see GEOM_TestOthers.py
5051 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5052 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5055 ## Gives quantity of edges in the given shape.
5056 # @param theShape Shape to count edges of.
5057 # @return Quantity of edges.
5059 # @ref swig_NumberOf "Example"
5060 @ManageTransactions("ShapesOp")
5061 def NumberOfEdges(self, theShape):
5063 Gives quantity of edges in the given shape.
5066 theShape Shape to count edges of.
5071 # Example: see GEOM_TestOthers.py
5072 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5073 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5076 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5077 # @param theShape Shape to count sub-shapes of.
5078 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5079 # @return Quantity of sub-shapes of given type.
5081 # @ref swig_NumberOf "Example"
5082 @ManageTransactions("ShapesOp")
5083 def NumberOfSubShapes(self, theShape, theShapeType):
5085 Gives quantity of sub-shapes of type theShapeType in the given shape.
5088 theShape Shape to count sub-shapes of.
5089 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5092 Quantity of sub-shapes of given type.
5094 # Example: see GEOM_TestOthers.py
5095 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5096 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5099 ## Gives quantity of solids in the given shape.
5100 # @param theShape Shape to count solids in.
5101 # @return Quantity of solids.
5103 # @ref swig_NumberOf "Example"
5104 @ManageTransactions("ShapesOp")
5105 def NumberOfSolids(self, theShape):
5107 Gives quantity of solids in the given shape.
5110 theShape Shape to count solids in.
5115 # Example: see GEOM_TestOthers.py
5116 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5117 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5123 ## @addtogroup l3_healing
5126 ## Reverses an orientation the given shape.
5127 # @param theShape Shape to be reversed.
5128 # @param theName Object name; when specified, this parameter is used
5129 # for result publication in the study. Otherwise, if automatic
5130 # publication is switched on, default value is used for result name.
5132 # @return The reversed copy of theShape.
5134 # @ref swig_ChangeOrientation "Example"
5135 @ManageTransactions("ShapesOp")
5136 def ChangeOrientation(self, theShape, theName=None):
5138 Reverses an orientation the given shape.
5141 theShape Shape to be reversed.
5142 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.
5147 The reversed copy of theShape.
5149 # Example: see GEOM_TestAll.py
5150 anObj = self.ShapesOp.ChangeOrientation(theShape)
5151 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5152 self._autoPublish(anObj, theName, "reversed")
5155 ## See ChangeOrientation() method for details.
5157 # @ref swig_OrientationChange "Example"
5158 def OrientationChange(self, theShape, theName=None):
5160 See geompy.ChangeOrientation method for details.
5162 # Example: see GEOM_TestOthers.py
5163 # note: auto-publishing is done in self.ChangeOrientation()
5164 anObj = self.ChangeOrientation(theShape, theName)
5170 ## @addtogroup l4_obtain
5173 ## Retrieve all free faces from the given shape.
5174 # Free face is a face, which is not shared between two shells of the shape.
5175 # @param theShape Shape to find free faces in.
5176 # @return List of IDs of all free faces, contained in theShape.
5178 # @ref tui_free_faces_page "Example"
5179 @ManageTransactions("ShapesOp")
5180 def GetFreeFacesIDs(self,theShape):
5182 Retrieve all free faces from the given shape.
5183 Free face is a face, which is not shared between two shells of the shape.
5186 theShape Shape to find free faces in.
5189 List of IDs of all free faces, contained in theShape.
5191 # Example: see GEOM_TestOthers.py
5192 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5193 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5196 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5197 # @param theShape1 Shape to find sub-shapes in.
5198 # @param theShape2 Shape to find shared sub-shapes with.
5199 # @param theShapeType Type of sub-shapes to be retrieved.
5200 # @param theName Object name; when specified, this parameter is used
5201 # for result publication in the study. Otherwise, if automatic
5202 # publication is switched on, default value is used for result name.
5204 # @return List of sub-shapes of theShape1, shared with theShape2.
5206 # @ref swig_GetSharedShapes "Example"
5207 @ManageTransactions("ShapesOp")
5208 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5210 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5213 theShape1 Shape to find sub-shapes in.
5214 theShape2 Shape to find shared sub-shapes with.
5215 theShapeType Type of sub-shapes to be retrieved.
5216 theName Object name; when specified, this parameter is used
5217 for result publication in the study. Otherwise, if automatic
5218 publication is switched on, default value is used for result name.
5221 List of sub-shapes of theShape1, shared with theShape2.
5223 # Example: see GEOM_TestOthers.py
5224 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5225 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5226 self._autoPublish(aList, theName, "shared")
5229 ## Get sub-shapes, shared by input shapes.
5230 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5231 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5232 # @param theMultiShare Specifies what type of shares should be checked:
5233 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5234 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5235 # @param theName Object name; when specified, this parameter is used
5236 # for result publication in the study. Otherwise, if automatic
5237 # publication is switched on, default value is used for result name.
5239 # @note If @a theShapes contains single compound, the shares between all possible couples of
5240 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5241 # and all rest input shapes are returned.
5243 # @return List of all found sub-shapes.
5246 # - @ref tui_shared_shapes "Example 1"
5247 # - @ref swig_GetSharedShapes "Example 2"
5248 @ManageTransactions("ShapesOp")
5249 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5251 Get sub-shapes, shared by input shapes.
5254 theShapes Either a list or compound of shapes to find common sub-shapes of.
5255 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5256 theMultiShare Specifies what type of shares should be checked:
5257 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5258 - False: causes to search sub-shapes shared between couples of input shapes.
5259 theName Object name; when specified, this parameter is used
5260 for result publication in the study. Otherwise, if automatic
5261 publication is switched on, default value is used for result name.
5263 Note: if theShapes contains single compound, the shares between all possible couples of
5264 its top-level shapes are returned; otherwise, only shares between 1st input shape
5265 and all rest input shapes are returned.
5268 List of all found sub-shapes.
5270 # Example: see GEOM_TestOthers.py
5271 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5272 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5273 self._autoPublish(aList, theName, "shared")
5276 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5277 # situated relatively the specified plane by the certain way,
5278 # defined through <VAR>theState</VAR> parameter.
5279 # @param theShape Shape to find sub-shapes of.
5280 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5281 # @param theAx1 Vector (or line, or linear edge), specifying normal
5282 # direction and location of the plane to find shapes on.
5283 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5284 # @param theName Object name; when specified, this parameter is used
5285 # for result publication in the study. Otherwise, if automatic
5286 # publication is switched on, default value is used for result name.
5288 # @return List of all found sub-shapes.
5290 # @ref swig_GetShapesOnPlane "Example"
5291 @ManageTransactions("ShapesOp")
5292 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5294 Find in theShape all sub-shapes of type theShapeType,
5295 situated relatively the specified plane by the certain way,
5296 defined through theState parameter.
5299 theShape Shape to find sub-shapes of.
5300 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5301 theAx1 Vector (or line, or linear edge), specifying normal
5302 direction and location of the plane to find shapes on.
5303 theState The state of the sub-shapes to find (see GEOM::shape_state)
5304 theName Object name; when specified, this parameter is used
5305 for result publication in the study. Otherwise, if automatic
5306 publication is switched on, default value is used for result name.
5309 List of all found sub-shapes.
5311 # Example: see GEOM_TestOthers.py
5312 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5313 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5314 self._autoPublish(aList, theName, "shapeOnPlane")
5317 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5318 # situated relatively the specified plane by the certain way,
5319 # defined through <VAR>theState</VAR> parameter.
5320 # @param theShape Shape to find sub-shapes of.
5321 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5322 # @param theAx1 Vector (or line, or linear edge), specifying normal
5323 # direction and location of the plane to find shapes on.
5324 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5326 # @return List of all found sub-shapes indices.
5328 # @ref swig_GetShapesOnPlaneIDs "Example"
5329 @ManageTransactions("ShapesOp")
5330 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5332 Find in theShape all sub-shapes of type theShapeType,
5333 situated relatively the specified plane by the certain way,
5334 defined through theState parameter.
5337 theShape Shape to find sub-shapes of.
5338 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5339 theAx1 Vector (or line, or linear edge), specifying normal
5340 direction and location of the plane to find shapes on.
5341 theState The state of the sub-shapes to find (see GEOM::shape_state)
5344 List of all found sub-shapes indices.
5346 # Example: see GEOM_TestOthers.py
5347 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5348 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5351 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5352 # situated relatively the specified plane by the certain way,
5353 # defined through <VAR>theState</VAR> parameter.
5354 # @param theShape Shape to find sub-shapes of.
5355 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5356 # @param theAx1 Vector (or line, or linear edge), specifying normal
5357 # direction of the plane to find shapes on.
5358 # @param thePnt Point specifying location of the plane to find shapes on.
5359 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5360 # @param theName Object name; when specified, this parameter is used
5361 # for result publication in the study. Otherwise, if automatic
5362 # publication is switched on, default value is used for result name.
5364 # @return List of all found sub-shapes.
5366 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5367 @ManageTransactions("ShapesOp")
5368 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5370 Find in theShape all sub-shapes of type theShapeType,
5371 situated relatively the specified plane by the certain way,
5372 defined through theState parameter.
5375 theShape Shape to find sub-shapes of.
5376 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5377 theAx1 Vector (or line, or linear edge), specifying normal
5378 direction and location of the plane to find shapes on.
5379 thePnt Point specifying location of the plane to find shapes on.
5380 theState The state of the sub-shapes to find (see GEOM::shape_state)
5381 theName Object name; when specified, this parameter is used
5382 for result publication in the study. Otherwise, if automatic
5383 publication is switched on, default value is used for result name.
5386 List of all found sub-shapes.
5388 # Example: see GEOM_TestOthers.py
5389 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5390 theAx1, thePnt, theState)
5391 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5392 self._autoPublish(aList, theName, "shapeOnPlane")
5395 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5396 # situated relatively the specified plane by the certain way,
5397 # defined through <VAR>theState</VAR> parameter.
5398 # @param theShape Shape to find sub-shapes of.
5399 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5400 # @param theAx1 Vector (or line, or linear edge), specifying normal
5401 # direction of the plane to find shapes on.
5402 # @param thePnt Point specifying location of the plane to find shapes on.
5403 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5405 # @return List of all found sub-shapes indices.
5407 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5408 @ManageTransactions("ShapesOp")
5409 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5411 Find in theShape all sub-shapes of type theShapeType,
5412 situated relatively the specified plane by the certain way,
5413 defined through theState parameter.
5416 theShape Shape to find sub-shapes of.
5417 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5418 theAx1 Vector (or line, or linear edge), specifying normal
5419 direction and location of the plane to find shapes on.
5420 thePnt Point specifying location of the plane to find shapes on.
5421 theState The state of the sub-shapes to find (see GEOM::shape_state)
5424 List of all found sub-shapes indices.
5426 # Example: see GEOM_TestOthers.py
5427 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5428 theAx1, thePnt, theState)
5429 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5432 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5433 # the specified cylinder by the certain way, defined through \a theState parameter.
5434 # @param theShape Shape to find sub-shapes of.
5435 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5436 # @param theAxis Vector (or line, or linear edge), specifying
5437 # axis of the cylinder to find shapes on.
5438 # @param theRadius Radius of the cylinder to find shapes on.
5439 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5440 # @param theName Object name; when specified, this parameter is used
5441 # for result publication in the study. Otherwise, if automatic
5442 # publication is switched on, default value is used for result name.
5444 # @return List of all found sub-shapes.
5446 # @ref swig_GetShapesOnCylinder "Example"
5447 @ManageTransactions("ShapesOp")
5448 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5450 Find in theShape all sub-shapes of type theShapeType, situated relatively
5451 the specified cylinder by the certain way, defined through theState parameter.
5454 theShape Shape to find sub-shapes of.
5455 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5456 theAxis Vector (or line, or linear edge), specifying
5457 axis of the cylinder to find shapes on.
5458 theRadius Radius of the cylinder to find shapes on.
5459 theState The state of the sub-shapes to find (see GEOM::shape_state)
5460 theName Object name; when specified, this parameter is used
5461 for result publication in the study. Otherwise, if automatic
5462 publication is switched on, default value is used for result name.
5465 List of all found sub-shapes.
5467 # Example: see GEOM_TestOthers.py
5468 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5469 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5470 self._autoPublish(aList, theName, "shapeOnCylinder")
5473 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5474 # the specified cylinder by the certain way, defined through \a theState parameter.
5475 # @param theShape Shape to find sub-shapes of.
5476 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5477 # @param theAxis Vector (or line, or linear edge), specifying
5478 # axis of the cylinder to find shapes on.
5479 # @param theRadius Radius of the cylinder to find shapes on.
5480 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5482 # @return List of all found sub-shapes indices.
5484 # @ref swig_GetShapesOnCylinderIDs "Example"
5485 @ManageTransactions("ShapesOp")
5486 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5488 Find in theShape all sub-shapes of type theShapeType, situated relatively
5489 the specified cylinder by the certain way, defined through theState parameter.
5492 theShape Shape to find sub-shapes of.
5493 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5494 theAxis Vector (or line, or linear edge), specifying
5495 axis of the cylinder to find shapes on.
5496 theRadius Radius of the cylinder to find shapes on.
5497 theState The state of the sub-shapes to find (see GEOM::shape_state)
5500 List of all found sub-shapes indices.
5502 # Example: see GEOM_TestOthers.py
5503 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5504 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5507 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5508 # the specified cylinder by the certain way, defined through \a theState parameter.
5509 # @param theShape Shape to find sub-shapes of.
5510 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5511 # @param theAxis Vector (or line, or linear edge), specifying
5512 # axis of the cylinder to find shapes on.
5513 # @param thePnt Point specifying location of the bottom of the cylinder.
5514 # @param theRadius Radius of the cylinder to find shapes on.
5515 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5516 # @param theName Object name; when specified, this parameter is used
5517 # for result publication in the study. Otherwise, if automatic
5518 # publication is switched on, default value is used for result name.
5520 # @return List of all found sub-shapes.
5522 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5523 @ManageTransactions("ShapesOp")
5524 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5526 Find in theShape all sub-shapes of type theShapeType, situated relatively
5527 the specified cylinder by the certain way, defined through theState parameter.
5530 theShape Shape to find sub-shapes of.
5531 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5532 theAxis Vector (or line, or linear edge), specifying
5533 axis of the cylinder to find shapes on.
5534 theRadius Radius of the cylinder to find shapes on.
5535 theState The state of the sub-shapes to find (see GEOM::shape_state)
5536 theName Object name; when specified, this parameter is used
5537 for result publication in the study. Otherwise, if automatic
5538 publication is switched on, default value is used for result name.
5541 List of all found sub-shapes.
5543 # Example: see GEOM_TestOthers.py
5544 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5545 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5546 self._autoPublish(aList, theName, "shapeOnCylinder")
5549 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5550 # the specified cylinder by the certain way, defined through \a theState parameter.
5551 # @param theShape Shape to find sub-shapes of.
5552 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5553 # @param theAxis Vector (or line, or linear edge), specifying
5554 # axis of the cylinder to find shapes on.
5555 # @param thePnt Point specifying location of the bottom of the cylinder.
5556 # @param theRadius Radius of the cylinder to find shapes on.
5557 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5559 # @return List of all found sub-shapes indices
5561 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5562 @ManageTransactions("ShapesOp")
5563 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5565 Find in theShape all sub-shapes of type theShapeType, situated relatively
5566 the specified cylinder by the certain way, defined through theState parameter.
5569 theShape Shape to find sub-shapes of.
5570 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5571 theAxis Vector (or line, or linear edge), specifying
5572 axis of the cylinder to find shapes on.
5573 theRadius Radius of the cylinder to find shapes on.
5574 theState The state of the sub-shapes to find (see GEOM::shape_state)
5577 List of all found sub-shapes indices.
5579 # Example: see GEOM_TestOthers.py
5580 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5581 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5584 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5585 # the specified sphere by the certain way, defined through \a theState parameter.
5586 # @param theShape Shape to find sub-shapes of.
5587 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5588 # @param theCenter Point, specifying center of the sphere to find shapes on.
5589 # @param theRadius Radius of the sphere to find shapes on.
5590 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5591 # @param theName Object name; when specified, this parameter is used
5592 # for result publication in the study. Otherwise, if automatic
5593 # publication is switched on, default value is used for result name.
5595 # @return List of all found sub-shapes.
5597 # @ref swig_GetShapesOnSphere "Example"
5598 @ManageTransactions("ShapesOp")
5599 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5601 Find in theShape all sub-shapes of type theShapeType, situated relatively
5602 the specified sphere by the certain way, defined through theState parameter.
5605 theShape Shape to find sub-shapes of.
5606 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5607 theCenter Point, specifying center of the sphere to find shapes on.
5608 theRadius Radius of the sphere to find shapes on.
5609 theState The state of the sub-shapes to find (see GEOM::shape_state)
5610 theName Object name; when specified, this parameter is used
5611 for result publication in the study. Otherwise, if automatic
5612 publication is switched on, default value is used for result name.
5615 List of all found sub-shapes.
5617 # Example: see GEOM_TestOthers.py
5618 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5619 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5620 self._autoPublish(aList, theName, "shapeOnSphere")
5623 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5624 # the specified sphere by the certain way, defined through \a theState parameter.
5625 # @param theShape Shape to find sub-shapes of.
5626 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5627 # @param theCenter Point, specifying center of the sphere to find shapes on.
5628 # @param theRadius Radius of the sphere to find shapes on.
5629 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5631 # @return List of all found sub-shapes indices.
5633 # @ref swig_GetShapesOnSphereIDs "Example"
5634 @ManageTransactions("ShapesOp")
5635 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5637 Find in theShape all sub-shapes of type theShapeType, situated relatively
5638 the specified sphere by the certain way, defined through theState parameter.
5641 theShape Shape to find sub-shapes of.
5642 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5643 theCenter Point, specifying center of the sphere to find shapes on.
5644 theRadius Radius of the sphere to find shapes on.
5645 theState The state of the sub-shapes to find (see GEOM::shape_state)
5648 List of all found sub-shapes indices.
5650 # Example: see GEOM_TestOthers.py
5651 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5652 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5655 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5656 # the specified quadrangle by the certain way, defined through \a theState parameter.
5657 # @param theShape Shape to find sub-shapes of.
5658 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5659 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5660 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5661 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5662 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5663 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5664 # @param theName Object name; when specified, this parameter is used
5665 # for result publication in the study. Otherwise, if automatic
5666 # publication is switched on, default value is used for result name.
5668 # @return List of all found sub-shapes.
5670 # @ref swig_GetShapesOnQuadrangle "Example"
5671 @ManageTransactions("ShapesOp")
5672 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5673 theTopLeftPoint, theTopRightPoint,
5674 theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5676 Find in theShape all sub-shapes of type theShapeType, situated relatively
5677 the specified quadrangle by the certain way, defined through theState parameter.
5680 theShape Shape to find sub-shapes of.
5681 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5682 theTopLeftPoint Point, specifying top left corner of a quadrangle
5683 theTopRightPoint Point, specifying top right corner of a quadrangle
5684 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5685 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5686 theState The state of the sub-shapes to find (see GEOM::shape_state)
5687 theName Object name; when specified, this parameter is used
5688 for result publication in the study. Otherwise, if automatic
5689 publication is switched on, default value is used for result name.
5692 List of all found sub-shapes.
5694 # Example: see GEOM_TestOthers.py
5695 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5696 theTopLeftPoint, theTopRightPoint,
5697 theBottomLeftPoint, theBottomRightPoint, theState)
5698 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5699 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5702 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5703 # the specified quadrangle by the certain way, defined through \a theState parameter.
5704 # @param theShape Shape to find sub-shapes of.
5705 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5706 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5707 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5708 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5709 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5710 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5712 # @return List of all found sub-shapes indices.
5714 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5715 @ManageTransactions("ShapesOp")
5716 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5717 theTopLeftPoint, theTopRightPoint,
5718 theBottomLeftPoint, theBottomRightPoint, theState):
5720 Find in theShape all sub-shapes of type theShapeType, situated relatively
5721 the specified quadrangle by the certain way, defined through theState parameter.
5724 theShape Shape to find sub-shapes of.
5725 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5726 theTopLeftPoint Point, specifying top left corner of a quadrangle
5727 theTopRightPoint Point, specifying top right corner of a quadrangle
5728 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5729 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5730 theState The state of the sub-shapes to find (see GEOM::shape_state)
5733 List of all found sub-shapes indices.
5736 # Example: see GEOM_TestOthers.py
5737 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5738 theTopLeftPoint, theTopRightPoint,
5739 theBottomLeftPoint, theBottomRightPoint, theState)
5740 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5743 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5744 # the specified \a theBox by the certain way, defined through \a theState parameter.
5745 # @param theBox Shape for relative comparing.
5746 # @param theShape Shape to find sub-shapes of.
5747 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5748 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5749 # @param theName Object name; when specified, this parameter is used
5750 # for result publication in the study. Otherwise, if automatic
5751 # publication is switched on, default value is used for result name.
5753 # @return List of all found sub-shapes.
5755 # @ref swig_GetShapesOnBox "Example"
5756 @ManageTransactions("ShapesOp")
5757 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5759 Find in theShape all sub-shapes of type theShapeType, situated relatively
5760 the specified theBox by the certain way, defined through theState parameter.
5763 theBox Shape for relative comparing.
5764 theShape Shape to find sub-shapes of.
5765 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5766 theState The state of the sub-shapes to find (see GEOM::shape_state)
5767 theName Object name; when specified, this parameter is used
5768 for result publication in the study. Otherwise, if automatic
5769 publication is switched on, default value is used for result name.
5772 List of all found sub-shapes.
5774 # Example: see GEOM_TestOthers.py
5775 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5776 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5777 self._autoPublish(aList, theName, "shapeOnBox")
5780 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5781 # the specified \a theBox by the certain way, defined through \a theState parameter.
5782 # @param theBox Shape for relative comparing.
5783 # @param theShape Shape to find sub-shapes of.
5784 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5785 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5787 # @return List of all found sub-shapes indices.
5789 # @ref swig_GetShapesOnBoxIDs "Example"
5790 @ManageTransactions("ShapesOp")
5791 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5793 Find in theShape all sub-shapes of type theShapeType, situated relatively
5794 the specified theBox by the certain way, defined through theState parameter.
5797 theBox Shape for relative comparing.
5798 theShape Shape to find sub-shapes of.
5799 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5800 theState The state of the sub-shapes to find (see GEOM::shape_state)
5803 List of all found sub-shapes indices.
5805 # Example: see GEOM_TestOthers.py
5806 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5807 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5810 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5811 # situated relatively the specified \a theCheckShape by the
5812 # certain way, defined through \a theState parameter.
5813 # @param theCheckShape Shape for relative comparing. It must be a solid.
5814 # @param theShape Shape to find sub-shapes of.
5815 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5816 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5817 # @param theName Object name; when specified, this parameter is used
5818 # for result publication in the study. Otherwise, if automatic
5819 # publication is switched on, default value is used for result name.
5821 # @return List of all found sub-shapes.
5823 # @ref swig_GetShapesOnShape "Example"
5824 @ManageTransactions("ShapesOp")
5825 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5827 Find in theShape all sub-shapes of type theShapeType,
5828 situated relatively the specified theCheckShape by the
5829 certain way, defined through theState parameter.
5832 theCheckShape Shape for relative comparing. It must be a solid.
5833 theShape Shape to find sub-shapes of.
5834 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5835 theState The state of the sub-shapes to find (see GEOM::shape_state)
5836 theName Object name; when specified, this parameter is used
5837 for result publication in the study. Otherwise, if automatic
5838 publication is switched on, default value is used for result name.
5841 List of all found sub-shapes.
5843 # Example: see GEOM_TestOthers.py
5844 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5845 theShapeType, theState)
5846 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5847 self._autoPublish(aList, theName, "shapeOnShape")
5850 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5851 # situated relatively the specified \a theCheckShape by the
5852 # certain way, defined through \a theState parameter.
5853 # @param theCheckShape Shape for relative comparing. It must be a solid.
5854 # @param theShape Shape to find sub-shapes of.
5855 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5856 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5857 # @param theName Object name; when specified, this parameter is used
5858 # for result publication in the study. Otherwise, if automatic
5859 # publication is switched on, default value is used for result name.
5861 # @return All found sub-shapes as compound.
5863 # @ref swig_GetShapesOnShapeAsCompound "Example"
5864 @ManageTransactions("ShapesOp")
5865 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5867 Find in theShape all sub-shapes of type theShapeType,
5868 situated relatively the specified theCheckShape by the
5869 certain way, defined through theState parameter.
5872 theCheckShape Shape for relative comparing. It must be a solid.
5873 theShape Shape to find sub-shapes of.
5874 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5875 theState The state of the sub-shapes to find (see GEOM::shape_state)
5876 theName Object name; when specified, this parameter is used
5877 for result publication in the study. Otherwise, if automatic
5878 publication is switched on, default value is used for result name.
5881 All found sub-shapes as compound.
5883 # Example: see GEOM_TestOthers.py
5884 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5885 theShapeType, theState)
5886 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5887 self._autoPublish(anObj, theName, "shapeOnShape")
5890 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5891 # situated relatively the specified \a theCheckShape by the
5892 # certain way, defined through \a theState parameter.
5893 # @param theCheckShape Shape for relative comparing. It must be a solid.
5894 # @param theShape Shape to find sub-shapes of.
5895 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5896 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5898 # @return List of all found sub-shapes indices.
5900 # @ref swig_GetShapesOnShapeIDs "Example"
5901 @ManageTransactions("ShapesOp")
5902 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5904 Find in theShape all sub-shapes of type theShapeType,
5905 situated relatively the specified theCheckShape by the
5906 certain way, defined through theState parameter.
5909 theCheckShape Shape for relative comparing. It must be a solid.
5910 theShape Shape to find sub-shapes of.
5911 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5912 theState The state of the sub-shapes to find (see GEOM::shape_state)
5915 List of all found sub-shapes indices.
5917 # Example: see GEOM_TestOthers.py
5918 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5919 theShapeType, theState)
5920 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5923 ## Get sub-shape(s) of theShapeWhere, which are
5924 # coincident with \a theShapeWhat or could be a part of it.
5925 # @param theShapeWhere Shape to find sub-shapes of.
5926 # @param theShapeWhat Shape, specifying what to find.
5927 # @param isNewImplementation implementation of GetInPlace functionality
5928 # (default = False, old alghorithm based on shape properties)
5929 # @param theName Object name; when specified, this parameter is used
5930 # for result publication in the study. Otherwise, if automatic
5931 # publication is switched on, default value is used for result name.
5933 # @return Compound which includes all found sub-shapes if they have different types;
5934 # or group of all found shapes of the equal type; or a single found sub-shape.
5936 # @note This function has a restriction on argument shapes.
5937 # If \a theShapeWhere has curved parts with significantly
5938 # outstanding centres (i.e. the mass centre of a part is closer to
5939 # \a theShapeWhat than to the part), such parts will not be found.
5940 # @image html get_in_place_lost_part.png
5942 # @ref swig_GetInPlace "Example"
5943 @ManageTransactions("ShapesOp")
5944 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5946 Get sub-shape(s) of theShapeWhere, which are
5947 coincident with theShapeWhat or could be a part of it.
5950 theShapeWhere Shape to find sub-shapes of.
5951 theShapeWhat Shape, specifying what to find.
5952 isNewImplementation Implementation of GetInPlace functionality
5953 (default = False, old alghorithm based on shape properties)
5954 theName Object name; when specified, this parameter is used
5955 for result publication in the study. Otherwise, if automatic
5956 publication is switched on, default value is used for result name.
5959 Compound which includes all found sub-shapes if they have different types;
5960 or group of all found shapes of the equal type; or a single found sub-shape.
5964 This function has a restriction on argument shapes.
5965 If theShapeWhere has curved parts with significantly
5966 outstanding centres (i.e. the mass centre of a part is closer to
5967 theShapeWhat than to the part), such parts will not be found.
5969 # Example: see GEOM_TestOthers.py
5971 if isNewImplementation:
5972 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5974 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5976 RaiseIfFailed("GetInPlace", self.ShapesOp)
5977 self._autoPublish(anObj, theName, "inplace")
5980 ## Get sub-shape(s) of \a theShapeWhere, which are
5981 # coincident with \a theShapeWhat or could be a part of it.
5983 # Implementation of this method is based on a saved history of an operation,
5984 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5985 # arguments (an argument shape or a sub-shape of an argument shape).
5986 # The operation could be the Partition or one of boolean operations,
5987 # performed on simple shapes (not on compounds).
5989 # @param theShapeWhere Shape to find sub-shapes of.
5990 # @param theShapeWhat Shape, specifying what to find (must be in the
5991 # building history of the ShapeWhere).
5992 # @param theName Object name; when specified, this parameter is used
5993 # for result publication in the study. Otherwise, if automatic
5994 # publication is switched on, default value is used for result name.
5996 # @return Compound which includes all found sub-shapes if they have different types;
5997 # or group of all found shapes of the equal type; or a single found sub-shape.
5999 # @ref swig_GetInPlace "Example"
6000 @ManageTransactions("ShapesOp")
6001 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6003 Implementation of this method is based on a saved history of an operation,
6004 produced theShapeWhere. The theShapeWhat must be among this operation's
6005 arguments (an argument shape or a sub-shape of an argument shape).
6006 The operation could be the Partition or one of boolean operations,
6007 performed on simple shapes (not on compounds).
6010 theShapeWhere Shape to find sub-shapes of.
6011 theShapeWhat Shape, specifying what to find (must be in the
6012 building history of the ShapeWhere).
6013 theName Object name; when specified, this parameter is used
6014 for result publication in the study. Otherwise, if automatic
6015 publication is switched on, default value is used for result name.
6018 Compound which includes all found sub-shapes if they have different types;
6019 or group of all found shapes of the equal type; or a single found sub-shape.
6021 # Example: see GEOM_TestOthers.py
6022 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6023 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6024 self._autoPublish(anObj, theName, "inplace")
6027 ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6028 # For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6029 # IDs of @a theShapeWhere.
6030 # For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6031 # two parts by a plane, then the result can be as this:
6032 # len( result_list ) = 35,
6033 # result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6034 # solids with IDs 2 and 36 within theShapeWhere
6036 # @param theShapeWhere Shape to find sub-shapes of.
6037 # @param theShapeWhat Shape, specifying what to find.
6038 # @return List of lists of sub-shape IDS of theShapeWhere.
6039 def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6041 A sort of GetInPlace functionality, returning IDs of sub-shapes.
6042 For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6043 IDs of @a theShapeWhere.
6044 For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6045 two parts by a plane, then the result can be as this:
6046 len( result_list ) = 35,
6047 result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6048 solids with IDs 2 and 36 within theShapeWhere
6051 theShapeWhere Shape to find sub-shapes of.
6052 theShapeWhat Shape, specifying what to find.
6055 List of lists of sub-shape IDS of theShapeWhere.
6057 return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6059 ## Get sub-shape of theShapeWhere, which is
6060 # equal to \a theShapeWhat.
6061 # @param theShapeWhere Shape to find sub-shape of.
6062 # @param theShapeWhat Shape, specifying what to find.
6063 # @param theName Object name; when specified, this parameter is used
6064 # for result publication in the study. Otherwise, if automatic
6065 # publication is switched on, default value is used for result name.
6067 # @return New GEOM.GEOM_Object for found sub-shape.
6069 # @ref swig_GetSame "Example"
6070 @ManageTransactions("ShapesOp")
6071 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6073 Get sub-shape of theShapeWhere, which is
6074 equal to theShapeWhat.
6077 theShapeWhere Shape to find sub-shape of.
6078 theShapeWhat Shape, specifying what to find.
6079 theName Object name; when specified, this parameter is used
6080 for result publication in the study. Otherwise, if automatic
6081 publication is switched on, default value is used for result name.
6084 New GEOM.GEOM_Object for found sub-shape.
6086 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6087 RaiseIfFailed("GetSame", self.ShapesOp)
6088 self._autoPublish(anObj, theName, "sameShape")
6092 ## Get sub-shape indices of theShapeWhere, which is
6093 # equal to \a theShapeWhat.
6094 # @param theShapeWhere Shape to find sub-shape of.
6095 # @param theShapeWhat Shape, specifying what to find.
6096 # @return List of all found sub-shapes indices.
6098 # @ref swig_GetSame "Example"
6099 @ManageTransactions("ShapesOp")
6100 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6102 Get sub-shape indices of theShapeWhere, which is
6103 equal to theShapeWhat.
6106 theShapeWhere Shape to find sub-shape of.
6107 theShapeWhat Shape, specifying what to find.
6110 List of all found sub-shapes indices.
6112 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6113 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6116 ## Resize the input edge with the new Min and Max parameters.
6117 # The input edge parameters range is [0, 1]. If theMin parameter is
6118 # negative, the input edge is extended, otherwise it is shrinked by
6119 # theMin parameter. If theMax is greater than 1, the edge is extended,
6120 # otherwise it is shrinked by theMax parameter.
6121 # @param theEdge the input edge to be resized.
6122 # @param theMin the minimal parameter value.
6123 # @param theMax the maximal parameter value.
6124 # @param theName Object name; when specified, this parameter is used
6125 # for result publication in the study. Otherwise, if automatic
6126 # publication is switched on, default value is used for result name.
6127 # @return New GEOM.GEOM_Object, containing the created edge.
6129 # @ref tui_extend "Example"
6130 @ManageTransactions("ShapesOp")
6131 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6133 Resize the input edge with the new Min and Max parameters.
6134 The input edge parameters range is [0, 1]. If theMin parameter is
6135 negative, the input edge is extended, otherwise it is shrinked by
6136 theMin parameter. If theMax is greater than 1, the edge is extended,
6137 otherwise it is shrinked by theMax parameter.
6140 theEdge the input edge to be resized.
6141 theMin the minimal parameter value.
6142 theMax the maximal parameter value.
6143 theName Object name; when specified, this parameter is used
6144 for result publication in the study. Otherwise, if automatic
6145 publication is switched on, default value is used for result name.
6148 New GEOM.GEOM_Object, containing the created edge.
6150 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6151 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6152 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6153 anObj.SetParameters(Parameters)
6154 self._autoPublish(anObj, theName, "edge")
6157 ## Resize the input face with the new UMin, UMax, VMin and VMax
6158 # parameters. The input face U and V parameters range is [0, 1]. If
6159 # theUMin parameter is negative, the input face is extended, otherwise
6160 # it is shrinked along U direction by theUMin parameter. If theUMax is
6161 # greater than 1, the face is extended, otherwise it is shrinked along
6162 # U direction by theUMax parameter. So as for theVMin, theVMax and
6163 # V direction of the input face.
6164 # @param theFace the input face to be resized.
6165 # @param theUMin the minimal U parameter value.
6166 # @param theUMax the maximal U parameter value.
6167 # @param theVMin the minimal V parameter value.
6168 # @param theVMax the maximal V parameter value.
6169 # @param theName Object name; when specified, this parameter is used
6170 # for result publication in the study. Otherwise, if automatic
6171 # publication is switched on, default value is used for result name.
6172 # @return New GEOM.GEOM_Object, containing the created face.
6174 # @ref tui_extend "Example"
6175 @ManageTransactions("ShapesOp")
6176 def ExtendFace(self, theFace, theUMin, theUMax,
6177 theVMin, theVMax, theName=None):
6179 Resize the input face with the new UMin, UMax, VMin and VMax
6180 parameters. The input face U and V parameters range is [0, 1]. If
6181 theUMin parameter is negative, the input face is extended, otherwise
6182 it is shrinked along U direction by theUMin parameter. If theUMax is
6183 greater than 1, the face is extended, otherwise it is shrinked along
6184 U direction by theUMax parameter. So as for theVMin, theVMax and
6185 V direction of the input face.
6188 theFace the input face to be resized.
6189 theUMin the minimal U parameter value.
6190 theUMax the maximal U parameter value.
6191 theVMin the minimal V parameter value.
6192 theVMax the maximal V parameter value.
6193 theName Object name; when specified, this parameter is used
6194 for result publication in the study. Otherwise, if automatic
6195 publication is switched on, default value is used for result name.
6198 New GEOM.GEOM_Object, containing the created face.
6200 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6201 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6203 RaiseIfFailed("ExtendFace", self.ShapesOp)
6204 anObj.SetParameters(Parameters)
6205 self._autoPublish(anObj, theName, "face")
6208 ## This function takes some face as input parameter and creates new
6209 # GEOM_Object, i.e. topological shape by extracting underlying surface
6210 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6211 # parameters of the source face (in the parametrical space).
6212 # @param theFace the input face.
6213 # @param theName Object name; when specified, this parameter is used
6214 # for result publication in the study. Otherwise, if automatic
6215 # publication is switched on, default value is used for result name.
6216 # @return New GEOM.GEOM_Object, containing the created face.
6218 # @ref tui_creation_surface "Example"
6219 @ManageTransactions("ShapesOp")
6220 def MakeSurfaceFromFace(self, theFace, theName=None):
6222 This function takes some face as input parameter and creates new
6223 GEOM_Object, i.e. topological shape by extracting underlying surface
6224 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6225 parameters of the source face (in the parametrical space).
6228 theFace the input face.
6229 theName Object name; when specified, this parameter is used
6230 for result publication in the study. Otherwise, if automatic
6231 publication is switched on, default value is used for result name.
6234 New GEOM.GEOM_Object, containing the created face.
6236 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6237 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6238 self._autoPublish(anObj, theName, "surface")
6244 ## @addtogroup l4_access
6247 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6248 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6249 # @param aShape Shape to get sub-shape of.
6250 # @param ListOfID List of sub-shapes indices.
6251 # @param theName Object name; when specified, this parameter is used
6252 # for result publication in the study. Otherwise, if automatic
6253 # publication is switched on, default value is used for result name.
6255 # @return Found sub-shape.
6257 # @ref swig_all_decompose "Example"
6258 def GetSubShape(self, aShape, ListOfID, theName=None):
6260 Obtain a composite sub-shape of aShape, composed from sub-shapes
6261 of aShape, selected by their unique IDs inside aShape
6264 aShape Shape to get sub-shape of.
6265 ListOfID List of sub-shapes indices.
6266 theName Object name; when specified, this parameter is used
6267 for result publication in the study. Otherwise, if automatic
6268 publication is switched on, default value is used for result name.
6273 # Example: see GEOM_TestAll.py
6274 anObj = self.AddSubShape(aShape,ListOfID)
6275 self._autoPublish(anObj, theName, "subshape")
6278 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6279 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6280 # @param aShape Shape to get sub-shape of.
6281 # @param aSubShape Sub-shapes of aShape.
6282 # @return ID of found sub-shape.
6284 # @ref swig_all_decompose "Example"
6285 @ManageTransactions("LocalOp")
6286 def GetSubShapeID(self, aShape, aSubShape):
6288 Obtain unique ID of sub-shape aSubShape inside aShape
6289 of aShape, selected by their unique IDs inside aShape
6292 aShape Shape to get sub-shape of.
6293 aSubShape Sub-shapes of aShape.
6296 ID of found sub-shape.
6298 # Example: see GEOM_TestAll.py
6299 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6300 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6303 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6304 # This function is provided for performance purpose. The complexity is O(n) with n
6305 # the number of subobjects of aShape
6306 # @param aShape Shape to get sub-shape of.
6307 # @param aSubShapes Sub-shapes of aShape.
6308 # @return list of IDs of found sub-shapes.
6310 # @ref swig_all_decompose "Example"
6311 @ManageTransactions("ShapesOp")
6312 def GetSubShapesIDs(self, aShape, aSubShapes):
6314 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6315 This function is provided for performance purpose. The complexity is O(n) with n
6316 the number of subobjects of aShape
6319 aShape Shape to get sub-shape of.
6320 aSubShapes Sub-shapes of aShape.
6323 List of IDs of found sub-shape.
6325 # Example: see GEOM_TestAll.py
6326 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6327 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6333 ## @addtogroup l4_decompose
6336 ## Get all sub-shapes and groups of \a theShape,
6337 # that were created already by any other methods.
6338 # @param theShape Any shape.
6339 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6340 # returned, else all found sub-shapes and groups.
6341 # @return List of existing sub-objects of \a theShape.
6343 # @ref swig_all_decompose "Example"
6344 @ManageTransactions("ShapesOp")
6345 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6347 Get all sub-shapes and groups of theShape,
6348 that were created already by any other methods.
6352 theGroupsOnly If this parameter is TRUE, only groups will be
6353 returned, else all found sub-shapes and groups.
6356 List of existing sub-objects of theShape.
6358 # Example: see GEOM_TestAll.py
6359 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6360 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6363 ## Get all groups of \a theShape,
6364 # that were created already by any other methods.
6365 # @param theShape Any shape.
6366 # @return List of existing groups of \a theShape.
6368 # @ref swig_all_decompose "Example"
6369 @ManageTransactions("ShapesOp")
6370 def GetGroups(self, theShape):
6372 Get all groups of theShape,
6373 that were created already by any other methods.
6379 List of existing groups of theShape.
6381 # Example: see GEOM_TestAll.py
6382 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6383 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6386 ## Explode a shape on sub-shapes of a given type.
6387 # If the shape itself matches the type, it is also returned.
6388 # @param aShape Shape to be exploded.
6389 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6390 # @param theName Object name; when specified, this parameter is used
6391 # for result publication in the study. Otherwise, if automatic
6392 # publication is switched on, default value is used for result name.
6394 # @return List of sub-shapes of type theShapeType, contained in theShape.
6396 # @ref swig_all_decompose "Example"
6397 @ManageTransactions("ShapesOp")
6398 def SubShapeAll(self, aShape, aType, theName=None):
6400 Explode a shape on sub-shapes of a given type.
6401 If the shape itself matches the type, it is also returned.
6404 aShape Shape to be exploded.
6405 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6406 theName Object name; when specified, this parameter is used
6407 for result publication in the study. Otherwise, if automatic
6408 publication is switched on, default value is used for result name.
6411 List of sub-shapes of type theShapeType, contained in theShape.
6413 # Example: see GEOM_TestAll.py
6414 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6415 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6416 self._autoPublish(ListObj, theName, "subshape")
6419 ## Explode a shape on sub-shapes of a given type.
6420 # @param aShape Shape to be exploded.
6421 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6422 # @return List of IDs of sub-shapes.
6424 # @ref swig_all_decompose "Example"
6425 @ManageTransactions("ShapesOp")
6426 def SubShapeAllIDs(self, aShape, aType):
6428 Explode a shape on sub-shapes of a given type.
6431 aShape Shape to be exploded (see geompy.ShapeType)
6432 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6435 List of IDs of sub-shapes.
6437 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6438 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6441 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6442 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6443 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6444 # @param aShape Shape to get sub-shape of.
6445 # @param ListOfInd List of sub-shapes indices.
6446 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6447 # @param theName Object name; when specified, this parameter is used
6448 # for result publication in the study. Otherwise, if automatic
6449 # publication is switched on, default value is used for result name.
6451 # @return A compound of sub-shapes of aShape.
6453 # @ref swig_all_decompose "Example"
6454 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6456 Obtain a compound of sub-shapes of aShape,
6457 selected by their indices in list of all sub-shapes of type aType.
6458 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6461 aShape Shape to get sub-shape of.
6462 ListOfID List of sub-shapes indices.
6463 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6464 theName Object name; when specified, this parameter is used
6465 for result publication in the study. Otherwise, if automatic
6466 publication is switched on, default value is used for result name.
6469 A compound of sub-shapes of aShape.
6471 # Example: see GEOM_TestAll.py
6473 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6474 for ind in ListOfInd:
6475 ListOfIDs.append(AllShapeIDsList[ind - 1])
6476 # note: auto-publishing is done in self.GetSubShape()
6477 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6480 ## Explode a shape on sub-shapes of a given type.
6481 # Sub-shapes will be sorted taking into account their gravity centers,
6482 # to provide stable order of sub-shapes. Please see
6483 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6484 # If the shape itself matches the type, it is also returned.
6485 # @param aShape Shape to be exploded.
6486 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6487 # @param 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.
6491 # @return List of sub-shapes of type theShapeType, contained in theShape.
6493 # @ref swig_SubShapeAllSorted "Example"
6494 @ManageTransactions("ShapesOp")
6495 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6497 Explode a shape on sub-shapes of a given type.
6498 Sub-shapes will be sorted taking into account their gravity centers,
6499 to provide stable order of sub-shapes.
6500 If the shape itself matches the type, it is also returned.
6503 aShape Shape to be exploded.
6504 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6505 theName Object name; when specified, this parameter is used
6506 for result publication in the study. Otherwise, if automatic
6507 publication is switched on, default value is used for result name.
6510 List of sub-shapes of type theShapeType, contained in theShape.
6512 # Example: see GEOM_TestAll.py
6513 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6514 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6515 self._autoPublish(ListObj, theName, "subshape")
6518 ## Explode a shape on sub-shapes of a given type.
6519 # Sub-shapes will be sorted taking into account their gravity centers,
6520 # to provide stable order of sub-shapes. Please see
6521 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6522 # @param aShape Shape to be exploded.
6523 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6524 # @return List of IDs of sub-shapes.
6526 # @ref swig_all_decompose "Example"
6527 @ManageTransactions("ShapesOp")
6528 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6530 Explode a shape on sub-shapes of a given type.
6531 Sub-shapes will be sorted taking into account their gravity centers,
6532 to provide stable order of sub-shapes.
6535 aShape Shape to be exploded.
6536 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6539 List of IDs of sub-shapes.
6541 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6542 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6545 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6546 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6547 # Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6548 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6549 # @param aShape Shape to get sub-shape of.
6550 # @param ListOfInd List of sub-shapes indices.
6551 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6552 # @param theName Object name; when specified, this parameter is used
6553 # for result publication in the study. Otherwise, if automatic
6554 # publication is switched on, default value is used for result name.
6556 # @return A compound of sub-shapes of aShape.
6558 # @ref swig_all_decompose "Example"
6559 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6561 Obtain a compound of sub-shapes of aShape,
6562 selected by they indices in sorted list of all sub-shapes of type aType.
6563 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6566 aShape Shape to get sub-shape of.
6567 ListOfID List of sub-shapes indices.
6568 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6569 theName Object name; when specified, this parameter is used
6570 for result publication in the study. Otherwise, if automatic
6571 publication is switched on, default value is used for result name.
6574 A compound of sub-shapes of aShape.
6576 # Example: see GEOM_TestAll.py
6578 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6579 for ind in ListOfInd:
6580 ListOfIDs.append(AllShapeIDsList[ind - 1])
6581 # note: auto-publishing is done in self.GetSubShape()
6582 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6585 ## Extract shapes (excluding the main shape) of given type.
6586 # @param aShape The shape.
6587 # @param aType The shape type (see ShapeType())
6588 # @param isSorted Boolean flag to switch sorting on/off. Please see
6589 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6590 # @param theName Object name; when specified, this parameter is used
6591 # for result publication in the study. Otherwise, if automatic
6592 # publication is switched on, default value is used for result name.
6594 # @return List of sub-shapes of type aType, contained in aShape.
6596 # @ref swig_FilletChamfer "Example"
6597 @ManageTransactions("ShapesOp")
6598 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6600 Extract shapes (excluding the main shape) of given type.
6604 aType The shape type (see geompy.ShapeType)
6605 isSorted Boolean flag to switch sorting on/off.
6606 theName Object name; when specified, this parameter is used
6607 for result publication in the study. Otherwise, if automatic
6608 publication is switched on, default value is used for result name.
6611 List of sub-shapes of type aType, contained in aShape.
6613 # Example: see GEOM_TestAll.py
6614 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6615 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6616 self._autoPublish(ListObj, theName, "subshape")
6619 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6620 # @param aShape Main shape.
6621 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6622 # @param theName Object name; when specified, this parameter is used
6623 # for result publication in the study. Otherwise, if automatic
6624 # publication is switched on, default value is used for result name.
6625 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6627 # @ref swig_all_decompose "Example"
6628 @ManageTransactions("ShapesOp")
6629 def SubShapes(self, aShape, anIDs, theName=None):
6631 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6635 anIDs List of unique IDs of sub-shapes inside theMainShape.
6636 theName Object name; when specified, this parameter is used
6637 for result publication in the study. Otherwise, if automatic
6638 publication is switched on, default value is used for result name.
6641 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6643 # Example: see GEOM_TestAll.py
6644 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6645 RaiseIfFailed("SubShapes", self.ShapesOp)
6646 self._autoPublish(ListObj, theName, "subshape")
6649 ## Explode a shape into edges sorted in a row from a starting point.
6650 # @param theShape the shape to be exploded on edges.
6651 # @param theStartPoint the starting point.
6652 # @param theName Object name; when specified, this parameter is used
6653 # for result publication in the study. Otherwise, if automatic
6654 # publication is switched on, default value is used for result name.
6655 # @return List of GEOM.GEOM_Object that is actually an ordered list
6656 # of edges sorted in a row from a starting point.
6658 # @ref swig_GetSubShapeEdgeSorted "Example"
6659 @ManageTransactions("ShapesOp")
6660 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6662 Explode a shape into edges sorted in a row from a starting point.
6665 theShape the shape to be exploded on edges.
6666 theStartPoint the starting point.
6667 theName Object name; when specified, this parameter is used
6668 for result publication in the study. Otherwise, if automatic
6669 publication is switched on, default value is used for result name.
6672 List of GEOM.GEOM_Object that is actually an ordered list
6673 of edges sorted in a row from a starting point.
6675 # Example: see GEOM_TestAll.py
6676 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6677 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6678 self._autoPublish(ListObj, theName, "SortedEdges")
6682 # Return the list of subshapes that satisfies a certain tolerance
6683 # criterion. The user defines the type of shapes to be returned, the
6684 # condition and the tolerance value. The operation is defined for
6685 # faces, edges and vertices only. E.g. for theShapeType FACE,
6686 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6687 # all faces of theShape that have tolerances greater then 1.e7.
6689 # @param theShape the shape to be exploded
6690 # @param theShapeType the type of sub-shapes to be returned (see
6691 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6692 # @param theCondition the condition type (see GEOM::comparison_condition).
6693 # @param theTolerance the tolerance filter.
6694 # @param theName Object name; when specified, this parameter is used
6695 # for result publication in the study. Otherwise, if automatic
6696 # publication is switched on, default value is used for result name.
6697 # @return the list of shapes that satisfy the conditions.
6699 # @ref swig_GetSubShapesWithTolerance "Example"
6700 @ManageTransactions("ShapesOp")
6701 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6702 theCondition, theTolerance, theName=None):
6704 Return the list of subshapes that satisfies a certain tolerance
6705 criterion. The user defines the type of shapes to be returned, the
6706 condition and the tolerance value. The operation is defined for
6707 faces, edges and vertices only. E.g. for theShapeType FACE,
6708 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6709 all faces of theShape that have tolerances greater then 1.e7.
6712 theShape the shape to be exploded
6713 theShapeType the type of sub-shapes to be returned (see
6714 ShapeType()). Can have the values FACE,
6715 EDGE and VERTEX only.
6716 theCondition the condition type (see GEOM::comparison_condition).
6717 theTolerance the tolerance filter.
6718 theName Object name; when specified, this parameter is used
6719 for result publication in the study. Otherwise, if automatic
6720 publication is switched on, default value is used for result name.
6723 The list of shapes that satisfy the conditions.
6725 # Example: see GEOM_TestAll.py
6726 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6727 theCondition, theTolerance)
6728 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6729 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6732 ## Check if the object is a sub-object of another GEOM object.
6733 # @param aSubObject Checked sub-object (or its parent object, in case if
6734 # \a theSubObjectIndex is non-zero).
6735 # @param anObject An object that is checked for ownership (or its parent object,
6736 # in case if \a theObjectIndex is non-zero).
6737 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6738 # identifies a sub-object within its parent specified via \a theSubObject.
6739 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6740 # identifies an object within its parent specified via \a theObject.
6741 # @return TRUE, if the given object contains sub-object.
6742 @ManageTransactions("ShapesOp")
6743 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6745 Check if the object is a sub-object of another GEOM object.
6748 aSubObject Checked sub-object (or its parent object, in case if
6749 \a theSubObjectIndex is non-zero).
6750 anObject An object that is checked for ownership (or its parent object,
6751 in case if \a theObjectIndex is non-zero).
6752 aSubObjectIndex When non-zero, specifies a sub-shape index that
6753 identifies a sub-object within its parent specified via \a theSubObject.
6754 anObjectIndex When non-zero, specifies a sub-shape index that
6755 identifies an object within its parent specified via \a theObject.
6758 TRUE, if the given object contains sub-object.
6760 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6761 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6764 ## Perform extraction of sub-shapes from the main shape.
6766 # @param theShape the main shape
6767 # @param theListOfID the list of sub-shape IDs to be extracted from
6769 # @return New GEOM.GEOM_Object, containing the shape without
6770 # extracted sub-shapes.
6772 # @ref swig_MakeExtraction "Example"
6773 @ManageTransactions("ShapesOp")
6774 def MakeExtraction(self, theShape, theListOfID, theName=None):
6776 Perform extraction of sub-shapes from the main shape.
6779 theShape the main shape
6780 theListOfID the list of sub-shape IDs to be extracted from
6784 New GEOM.GEOM_Object, containing the shape without
6785 extracted sub-shapes.
6787 # Example: see GEOM_TestAll.py
6788 (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6789 RaiseIfFailed("MakeExtraction", self.ShapesOp)
6790 self._autoPublish(anObj, theName, "Extraction")
6793 # end of l4_decompose
6796 ## @addtogroup l4_decompose_d
6799 ## Deprecated method
6800 # It works like SubShapeAllSortedCentres(), but wrongly
6801 # defines centres of faces, shells and solids.
6802 @ManageTransactions("ShapesOp")
6803 def SubShapeAllSorted(self, aShape, aType, theName=None):
6806 It works like geompy.SubShapeAllSortedCentres, but wrongly
6807 defines centres of faces, shells and solids.
6809 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6810 RaiseIfFailed("MakeExplode", self.ShapesOp)
6811 self._autoPublish(ListObj, theName, "subshape")
6814 ## Deprecated method
6815 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6816 # defines centres of faces, shells and solids.
6817 @ManageTransactions("ShapesOp")
6818 def SubShapeAllSortedIDs(self, aShape, aType):
6821 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6822 defines centres of faces, shells and solids.
6824 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6825 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6828 ## Deprecated method
6829 # It works like SubShapeSortedCentres(), but has a bug
6830 # (wrongly defines centres of faces, shells and solids).
6831 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6834 It works like geompy.SubShapeSortedCentres, but has a bug
6835 (wrongly defines centres of faces, shells and solids).
6838 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6839 for ind in ListOfInd:
6840 ListOfIDs.append(AllShapeIDsList[ind - 1])
6841 # note: auto-publishing is done in self.GetSubShape()
6842 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6845 # end of l4_decompose_d
6848 ## @addtogroup l3_healing
6851 ## Apply a sequence of Shape Healing operators to the given object.
6852 # @param theShape Shape to be processed.
6853 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6854 # @param theParameters List of names of parameters
6855 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6856 # @param theValues List of values of parameters, in the same order
6857 # as parameters are listed in <VAR>theParameters</VAR> list.
6858 # @param theName Object name; when specified, this parameter is used
6859 # for result publication in the study. Otherwise, if automatic
6860 # publication is switched on, default value is used for result name.
6862 # <b> Operators and Parameters: </b> \n
6864 # * \b FixShape - corrects invalid shapes. \n
6865 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6866 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6868 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6869 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6870 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6871 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6872 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6873 # - \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
6874 # - \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
6875 # - \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
6877 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6878 # surfaces in segments using a certain angle. \n
6879 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6880 # if Angle=180, four if Angle=90, etc). \n
6881 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6883 # * \b SplitClosedFaces - splits closed faces in segments.
6884 # The number of segments depends on the number of splitting points.\n
6885 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6887 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6888 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6889 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6890 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6891 # This and the previous parameters can take the following values:\n
6892 # \b Parametric \b Continuity \n
6893 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6894 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6895 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6896 # ruling out sharp edges).\n
6897 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6898 # are of the same magnitude).\n
6899 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6900 # or surfaces (d/du C(u)) are the same at junction. \n
6901 # \b Geometric \b Continuity \n
6902 # \b G1: first derivatives are proportional at junction.\n
6903 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6904 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6905 # \b G2: first and second derivatives are proportional at junction.
6906 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6907 # continuity requires that the underlying parameterization was continuous as well.
6908 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6910 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6911 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6912 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6913 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6914 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6915 # with the specified parameters.\n
6916 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6917 # with the specified parameters.\n
6918 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6919 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6920 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6921 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6923 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6924 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6925 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6926 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6927 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6929 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6930 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6933 # @return New GEOM.GEOM_Object, containing processed shape.
6935 # \n @ref tui_shape_processing "Example"
6936 @ManageTransactions("HealOp")
6937 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6939 Apply a sequence of Shape Healing operators to the given object.
6942 theShape Shape to be processed.
6943 theValues List of values of parameters, in the same order
6944 as parameters are listed in theParameters list.
6945 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6946 theParameters List of names of parameters
6947 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6948 theName Object name; when specified, this parameter is used
6949 for result publication in the study. Otherwise, if automatic
6950 publication is switched on, default value is used for result name.
6952 Operators and Parameters:
6954 * FixShape - corrects invalid shapes.
6955 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6956 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6957 * FixFaceSize - removes small faces, such as spots and strips.
6958 * FixFaceSize.Tolerance - defines minimum possible face size.
6959 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6960 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6961 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6962 * 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.
6963 * 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.
6964 * 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.
6966 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6967 in segments using a certain angle.
6968 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6969 if Angle=180, four if Angle=90, etc).
6970 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6971 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6973 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6974 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6975 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6976 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6977 * SplitContinuity.CurveContinuity - required continuity for curves.
6978 This and the previous parameters can take the following values:
6980 Parametric Continuity:
6981 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6982 coincidental. The curves or surfaces may still meet at an angle,
6983 giving rise to a sharp corner or edge).
6984 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6985 are parallel, ruling out sharp edges).
6986 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6987 or surfaces are of the same magnitude).
6988 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6989 curves or surfaces (d/du C(u)) are the same at junction.
6991 Geometric Continuity:
6992 G1: first derivatives are proportional at junction.
6993 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6994 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6995 G2: first and second derivatives are proportional at junction. As the names imply,
6996 geometric continuity requires the geometry to be continuous, while parametric continuity requires
6997 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
6998 geometric continuity of order n, but not vice-versa.
6999 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7000 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7001 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7002 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7003 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7004 the specified parameters.
7005 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7006 the specified parameters.
7007 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7008 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7009 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7010 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7011 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7012 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7013 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7014 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7015 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7016 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7017 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7020 New GEOM.GEOM_Object, containing processed shape.
7022 Note: For more information look through SALOME Geometry User's Guide->
7023 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7025 # Example: see GEOM_TestHealing.py
7026 theValues,Parameters = ParseList(theValues)
7027 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7028 # To avoid script failure in case of good argument shape
7029 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7031 RaiseIfFailed("ProcessShape", self.HealOp)
7032 for string in (theOperators + theParameters):
7033 Parameters = ":" + Parameters
7035 anObj.SetParameters(Parameters)
7036 self._autoPublish(anObj, theName, "healed")
7039 ## Remove faces from the given object (shape).
7040 # @param theObject Shape to be processed.
7041 # @param theFaces Indices of faces to be removed, if EMPTY then the method
7042 # removes ALL faces of the given object.
7043 # @param theName Object name; when specified, this parameter is used
7044 # for result publication in the study. Otherwise, if automatic
7045 # publication is switched on, default value is used for result name.
7047 # @return New GEOM.GEOM_Object, containing processed shape.
7049 # @ref tui_suppress_faces "Example"
7050 @ManageTransactions("HealOp")
7051 def SuppressFaces(self, theObject, theFaces, theName=None):
7053 Remove faces from the given object (shape).
7056 theObject Shape to be processed.
7057 theFaces Indices of faces to be removed, if EMPTY then the method
7058 removes ALL faces of the given object.
7059 theName Object name; when specified, this parameter is used
7060 for result publication in the study. Otherwise, if automatic
7061 publication is switched on, default value is used for result name.
7064 New GEOM.GEOM_Object, containing processed shape.
7066 # Example: see GEOM_TestHealing.py
7067 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7068 RaiseIfFailed("SuppressFaces", self.HealOp)
7069 self._autoPublish(anObj, theName, "suppressFaces")
7072 ## Sewing of faces into a single shell.
7073 # @param ListShape Shapes to be processed.
7074 # @param theTolerance Required tolerance value.
7075 # @param AllowNonManifold Flag that allows non-manifold sewing.
7076 # @param theName Object name; when specified, this parameter is used
7077 # for result publication in the study. Otherwise, if automatic
7078 # publication is switched on, default value is used for result name.
7080 # @return New GEOM.GEOM_Object, containing a result shell.
7082 # @ref tui_sewing "Example"
7083 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7085 Sewing of faces into a single shell.
7088 ListShape Shapes to be processed.
7089 theTolerance Required tolerance value.
7090 AllowNonManifold Flag that allows non-manifold sewing.
7091 theName Object name; when specified, this parameter is used
7092 for result publication in the study. Otherwise, if automatic
7093 publication is switched on, default value is used for result name.
7096 New GEOM.GEOM_Object, containing containing a result shell.
7098 # Example: see GEOM_TestHealing.py
7099 # note: auto-publishing is done in self.Sew()
7100 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7103 ## Sewing of faces into a single shell.
7104 # @param ListShape Shapes to be processed.
7105 # @param theTolerance Required tolerance value.
7106 # @param AllowNonManifold Flag that allows non-manifold sewing.
7107 # @param theName Object name; when specified, this parameter is used
7108 # for result publication in the study. Otherwise, if automatic
7109 # publication is switched on, default value is used for result name.
7111 # @return New GEOM.GEOM_Object, containing a result shell.
7112 @ManageTransactions("HealOp")
7113 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7115 Sewing of faces into a single shell.
7118 ListShape Shapes to be processed.
7119 theTolerance Required tolerance value.
7120 AllowNonManifold Flag that allows non-manifold sewing.
7121 theName Object name; when specified, this parameter is used
7122 for result publication in the study. Otherwise, if automatic
7123 publication is switched on, default value is used for result name.
7126 New GEOM.GEOM_Object, containing a result shell.
7128 # Example: see MakeSewing() above
7129 theTolerance,Parameters = ParseParameters(theTolerance)
7130 if AllowNonManifold:
7131 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7133 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7134 # To avoid script failure in case of good argument shape
7135 # (Fix of test cases geom/bugs11/L7,L8)
7136 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7138 RaiseIfFailed("Sew", self.HealOp)
7139 anObj.SetParameters(Parameters)
7140 self._autoPublish(anObj, theName, "sewed")
7143 ## Rebuild the topology of theSolids by removing
7144 # the faces that are shared by several solids.
7145 # @param theSolids A compound or a list of solids to be processed.
7146 # @param theName Object name; when specified, this parameter is used
7147 # for result publication in the study. Otherwise, if automatic
7148 # publication is switched on, default value is used for result name.
7150 # @return New GEOM.GEOM_Object, containing processed shape.
7152 # @ref tui_remove_webs "Example"
7153 @ManageTransactions("HealOp")
7154 def RemoveInternalFaces (self, theSolids, theName=None):
7156 Rebuild the topology of theSolids by removing
7157 the faces that are shared by several solids.
7160 theSolids A compound or a list of solids to be processed.
7161 theName Object name; when specified, this parameter is used
7162 for result publication in the study. Otherwise, if automatic
7163 publication is switched on, default value is used for result name.
7166 New GEOM.GEOM_Object, containing processed shape.
7168 # Example: see GEOM_TestHealing.py
7169 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7170 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7171 self._autoPublish(anObj, theName, "removeWebs")
7174 ## Remove internal wires and edges from the given object (face).
7175 # @param theObject Shape to be processed.
7176 # @param theWires Indices of wires to be removed, if EMPTY then the method
7177 # removes ALL internal wires of the given object.
7178 # @param theName Object name; when specified, this parameter is used
7179 # for result publication in the study. Otherwise, if automatic
7180 # publication is switched on, default value is used for result name.
7182 # @return New GEOM.GEOM_Object, containing processed shape.
7184 # @ref tui_suppress_internal_wires "Example"
7185 @ManageTransactions("HealOp")
7186 def SuppressInternalWires(self, theObject, theWires, theName=None):
7188 Remove internal wires and edges from the given object (face).
7191 theObject Shape to be processed.
7192 theWires Indices of wires to be removed, if EMPTY then the method
7193 removes ALL internal wires of the given object.
7194 theName Object name; when specified, this parameter is used
7195 for result publication in the study. Otherwise, if automatic
7196 publication is switched on, default value is used for result name.
7199 New GEOM.GEOM_Object, containing processed shape.
7201 # Example: see GEOM_TestHealing.py
7202 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7203 RaiseIfFailed("RemoveIntWires", self.HealOp)
7204 self._autoPublish(anObj, theName, "suppressWires")
7207 ## Remove internal closed contours (holes) from the given object.
7208 # @param theObject Shape to be processed.
7209 # @param theWires Indices of wires to be removed, if EMPTY then the method
7210 # removes ALL internal holes of the given object
7211 # @param theName Object name; when specified, this parameter is used
7212 # for result publication in the study. Otherwise, if automatic
7213 # publication is switched on, default value is used for result name.
7215 # @return New GEOM.GEOM_Object, containing processed shape.
7217 # @ref tui_suppress_holes "Example"
7218 @ManageTransactions("HealOp")
7219 def SuppressHoles(self, theObject, theWires, theName=None):
7221 Remove internal closed contours (holes) from the given object.
7224 theObject Shape to be processed.
7225 theWires Indices of wires to be removed, if EMPTY then the method
7226 removes ALL internal holes of the given object
7227 theName Object name; when specified, this parameter is used
7228 for result publication in the study. Otherwise, if automatic
7229 publication is switched on, default value is used for result name.
7232 New GEOM.GEOM_Object, containing processed shape.
7234 # Example: see GEOM_TestHealing.py
7235 anObj = self.HealOp.FillHoles(theObject, theWires)
7236 RaiseIfFailed("FillHoles", self.HealOp)
7237 self._autoPublish(anObj, theName, "suppressHoles")
7240 ## Close an open wire.
7241 # @param theObject Shape to be processed.
7242 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7243 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7244 # @param isCommonVertex If True : closure by creation of a common vertex,
7245 # If False : closure by creation of an edge between ends.
7246 # @param 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.
7250 # @return New GEOM.GEOM_Object, containing processed shape.
7252 # @ref tui_close_contour "Example"
7253 @ManageTransactions("HealOp")
7254 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7259 theObject Shape to be processed.
7260 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7261 if [ ], then theObject itself is a wire.
7262 isCommonVertex If True : closure by creation of a common vertex,
7263 If False : closure by creation of an edge between ends.
7264 theName Object name; when specified, this parameter is used
7265 for result publication in the study. Otherwise, if automatic
7266 publication is switched on, default value is used for result name.
7269 New GEOM.GEOM_Object, containing processed shape.
7271 # Example: see GEOM_TestHealing.py
7272 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7273 RaiseIfFailed("CloseContour", self.HealOp)
7274 self._autoPublish(anObj, theName, "closeContour")
7277 ## Addition of a point to a given edge object.
7278 # @param theObject Shape to be processed.
7279 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7280 # if -1, then theObject itself is the edge.
7281 # @param theValue Value of parameter on edge or length parameter,
7282 # depending on \a isByParameter.
7283 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7284 # if FALSE : \a theValue is treated as a length parameter [0..1]
7285 # @param theName Object name; when specified, this parameter is used
7286 # for result publication in the study. Otherwise, if automatic
7287 # publication is switched on, default value is used for result name.
7289 # @return New GEOM.GEOM_Object, containing processed shape.
7291 # @ref tui_add_point_on_edge "Example"
7292 @ManageTransactions("HealOp")
7293 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7295 Addition of a point to a given edge object.
7298 theObject Shape to be processed.
7299 theEdgeIndex Index of edge to be divided within theObject's shape,
7300 if -1, then theObject itself is the edge.
7301 theValue Value of parameter on edge or length parameter,
7302 depending on isByParameter.
7303 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7304 if FALSE : theValue is treated as a length parameter [0..1]
7305 theName Object name; when specified, this parameter is used
7306 for result publication in the study. Otherwise, if automatic
7307 publication is switched on, default value is used for result name.
7310 New GEOM.GEOM_Object, containing processed shape.
7312 # Example: see GEOM_TestHealing.py
7313 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7314 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7315 RaiseIfFailed("DivideEdge", self.HealOp)
7316 anObj.SetParameters(Parameters)
7317 self._autoPublish(anObj, theName, "divideEdge")
7320 ## Addition of points to a given edge of \a theObject by projecting
7321 # other points to the given edge.
7322 # @param theObject Shape to be processed.
7323 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7324 # if -1, then theObject itself is the edge.
7325 # @param thePoints List of points to project to theEdgeIndex-th edge.
7326 # @param 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.
7330 # @return New GEOM.GEOM_Object, containing processed shape.
7332 # @ref tui_add_point_on_edge "Example"
7333 @ManageTransactions("HealOp")
7334 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7336 Addition of points to a given edge of \a theObject by projecting
7337 other points to the given edge.
7340 theObject Shape to be processed.
7341 theEdgeIndex The edge or its index to be divided within theObject's shape,
7342 if -1, then theObject itself is the edge.
7343 thePoints List of points to project to theEdgeIndex-th edge.
7344 theName Object name; when specified, this parameter is used
7345 for result publication in the study. Otherwise, if automatic
7346 publication is switched on, default value is used for result name.
7349 New GEOM.GEOM_Object, containing processed shape.
7351 # Example: see GEOM_TestHealing.py
7352 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7353 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7354 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7355 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7356 self._autoPublish(anObj, theName, "divideEdge")
7359 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7360 # @param theWire Wire to minimize the number of C1 continuous edges in.
7361 # @param theVertices A list of vertices to suppress. If the list
7362 # is empty, all vertices in a wire will be assumed.
7363 # @param theName Object name; when specified, this parameter is used
7364 # for result publication in the study. Otherwise, if automatic
7365 # publication is switched on, default value is used for result name.
7367 # @return New GEOM.GEOM_Object with modified wire.
7369 # @ref tui_fuse_collinear_edges "Example"
7370 @ManageTransactions("HealOp")
7371 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7373 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7376 theWire Wire to minimize the number of C1 continuous edges in.
7377 theVertices A list of vertices to suppress. If the list
7378 is empty, all vertices in a wire will be assumed.
7379 theName Object name; when specified, this parameter is used
7380 for result publication in the study. Otherwise, if automatic
7381 publication is switched on, default value is used for result name.
7384 New GEOM.GEOM_Object with modified wire.
7386 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7387 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7388 self._autoPublish(anObj, theName, "fuseEdges")
7391 ## Change orientation of the given object. Updates given shape.
7392 # @param theObject Shape to be processed.
7393 # @return Updated <var>theObject</var>
7395 # @ref swig_todo "Example"
7396 @ManageTransactions("HealOp")
7397 def ChangeOrientationShell(self,theObject):
7399 Change orientation of the given object. Updates given shape.
7402 theObject Shape to be processed.
7407 theObject = self.HealOp.ChangeOrientation(theObject)
7408 RaiseIfFailed("ChangeOrientation", self.HealOp)
7411 ## Change orientation of the given object.
7412 # @param theObject Shape to be processed.
7413 # @param theName Object name; when specified, this parameter is used
7414 # for result publication in the study. Otherwise, if automatic
7415 # publication is switched on, default value is used for result name.
7417 # @return New GEOM.GEOM_Object, containing processed shape.
7419 # @ref swig_todo "Example"
7420 @ManageTransactions("HealOp")
7421 def ChangeOrientationShellCopy(self, theObject, theName=None):
7423 Change orientation of the given object.
7426 theObject Shape to be processed.
7427 theName Object name; when specified, this parameter is used
7428 for result publication in the study. Otherwise, if automatic
7429 publication is switched on, default value is used for result name.
7432 New GEOM.GEOM_Object, containing processed shape.
7434 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7435 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7436 self._autoPublish(anObj, theName, "reversed")
7439 ## Try to limit tolerance of the given object by value \a theTolerance.
7440 # @param theObject Shape to be processed.
7441 # @param theTolerance Required tolerance value.
7442 # @param theName Object name; when specified, this parameter is used
7443 # for result publication in the study. Otherwise, if automatic
7444 # publication is switched on, default value is used for result name.
7446 # @return New GEOM.GEOM_Object, containing processed shape.
7448 # @ref tui_limit_tolerance "Example"
7449 @ManageTransactions("HealOp")
7450 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7452 Try to limit tolerance of the given object by value theTolerance.
7455 theObject Shape to be processed.
7456 theTolerance Required tolerance value.
7457 theName Object name; when specified, this parameter is used
7458 for result publication in the study. Otherwise, if automatic
7459 publication is switched on, default value is used for result name.
7462 New GEOM.GEOM_Object, containing processed shape.
7464 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7465 RaiseIfFailed("LimitTolerance", self.HealOp)
7466 self._autoPublish(anObj, theName, "limitTolerance")
7469 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7470 # that constitute a free boundary of the given shape.
7471 # @param theObject Shape to get free boundary of.
7472 # @param 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.
7476 # @return [\a status, \a theClosedWires, \a theOpenWires]
7477 # \n \a status: FALSE, if an error(s) occurred during the method execution.
7478 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7479 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7481 # @ref tui_free_boundaries_page "Example"
7482 @ManageTransactions("HealOp")
7483 def GetFreeBoundary(self, theObject, theName=None):
7485 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7486 that constitute a free boundary of the given shape.
7489 theObject Shape to get free boundary of.
7490 theName Object name; when specified, this parameter is used
7491 for result publication in the study. Otherwise, if automatic
7492 publication is switched on, default value is used for result name.
7495 [status, theClosedWires, theOpenWires]
7496 status: FALSE, if an error(s) occurred during the method execution.
7497 theClosedWires: Closed wires on the free boundary of the given shape.
7498 theOpenWires: Open wires on the free boundary of the given shape.
7500 # Example: see GEOM_TestHealing.py
7501 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7502 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7503 self._autoPublish(anObj[1], theName, "closedWire")
7504 self._autoPublish(anObj[2], theName, "openWire")
7507 ## Replace coincident faces in \a theShapes by one face.
7508 # @param theShapes Initial shapes, either a list or compound of shapes.
7509 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7510 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7511 # otherwise all initial shapes.
7512 # @param theName Object name; when specified, this parameter is used
7513 # for result publication in the study. Otherwise, if automatic
7514 # publication is switched on, default value is used for result name.
7516 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7518 # @ref tui_glue_faces "Example"
7519 @ManageTransactions("ShapesOp")
7520 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7522 Replace coincident faces in theShapes by one face.
7525 theShapes Initial shapes, either a list or compound of shapes.
7526 theTolerance Maximum distance between faces, which can be considered as coincident.
7527 doKeepNonSolids If FALSE, only solids will present in the result,
7528 otherwise all initial shapes.
7529 theName Object name; when specified, this parameter is used
7530 for result publication in the study. Otherwise, if automatic
7531 publication is switched on, default value is used for result name.
7534 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7536 # Example: see GEOM_Spanner.py
7537 theTolerance,Parameters = ParseParameters(theTolerance)
7538 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7540 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7541 anObj.SetParameters(Parameters)
7542 self._autoPublish(anObj, theName, "glueFaces")
7545 ## Find coincident faces in \a theShapes for possible gluing.
7546 # @param theShapes Initial shapes, either a list or compound of shapes.
7547 # @param theTolerance Maximum distance between faces,
7548 # which can be considered as coincident.
7549 # @param theName Object name; when specified, this parameter is used
7550 # for result publication in the study. Otherwise, if automatic
7551 # publication is switched on, default value is used for result name.
7553 # @return GEOM.ListOfGO
7555 # @ref tui_glue_faces "Example"
7556 @ManageTransactions("ShapesOp")
7557 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7559 Find coincident faces in theShapes for possible gluing.
7562 theShapes Initial shapes, either a list or compound of shapes.
7563 theTolerance Maximum distance between faces,
7564 which can be considered as coincident.
7565 theName Object name; when specified, this parameter is used
7566 for result publication in the study. Otherwise, if automatic
7567 publication is switched on, default value is used for result name.
7572 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7573 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7574 self._autoPublish(anObj, theName, "facesToGlue")
7577 ## Replace coincident faces in \a theShapes by one face
7578 # in compliance with given list of faces
7579 # @param theShapes Initial shapes, either a list or compound of shapes.
7580 # @param theTolerance Maximum distance between faces,
7581 # which can be considered as coincident.
7582 # @param theFaces List of faces for gluing.
7583 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7584 # otherwise all initial shapes.
7585 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7586 # will be glued, otherwise only the edges,
7587 # belonging to <VAR>theFaces</VAR>.
7588 # @param theName Object name; when specified, this parameter is used
7589 # for result publication in the study. Otherwise, if automatic
7590 # publication is switched on, default value is used for result name.
7592 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7594 # @ref tui_glue_faces "Example"
7595 @ManageTransactions("ShapesOp")
7596 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7597 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7599 Replace coincident faces in theShapes by one face
7600 in compliance with given list of faces
7603 theShapes theShapes Initial shapes, either a list or compound of shapes.
7604 theTolerance Maximum distance between faces,
7605 which can be considered as coincident.
7606 theFaces List of faces for gluing.
7607 doKeepNonSolids If FALSE, only solids will present in the result,
7608 otherwise all initial shapes.
7609 doGlueAllEdges If TRUE, all coincident edges of theShape
7610 will be glued, otherwise only the edges,
7611 belonging to theFaces.
7612 theName Object name; when specified, this parameter is used
7613 for result publication in the study. Otherwise, if automatic
7614 publication is switched on, default value is used for result name.
7617 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7619 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7620 doKeepNonSolids, doGlueAllEdges)
7622 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7623 self._autoPublish(anObj, theName, "glueFaces")
7626 ## Replace coincident edges in \a theShapes by one edge.
7627 # @param theShapes Initial shapes, either a list or compound of shapes.
7628 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7629 # @param theName Object name; when specified, this parameter is used
7630 # for result publication in the study. Otherwise, if automatic
7631 # publication is switched on, default value is used for result name.
7633 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7635 # @ref tui_glue_edges "Example"
7636 @ManageTransactions("ShapesOp")
7637 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7639 Replace coincident edges in theShapes by one edge.
7642 theShapes Initial shapes, either a list or compound of shapes.
7643 theTolerance Maximum distance between edges, which can be considered as coincident.
7644 theName Object name; when specified, this parameter is used
7645 for result publication in the study. Otherwise, if automatic
7646 publication is switched on, default value is used for result name.
7649 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7651 theTolerance,Parameters = ParseParameters(theTolerance)
7652 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7654 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7655 anObj.SetParameters(Parameters)
7656 self._autoPublish(anObj, theName, "glueEdges")
7659 ## Find coincident edges in \a theShapes for possible gluing.
7660 # @param theShapes Initial shapes, either a list or compound of shapes.
7661 # @param theTolerance Maximum distance between edges,
7662 # which can be considered as coincident.
7663 # @param theName Object name; when specified, this parameter is used
7664 # for result publication in the study. Otherwise, if automatic
7665 # publication is switched on, default value is used for result name.
7667 # @return GEOM.ListOfGO
7669 # @ref tui_glue_edges "Example"
7670 @ManageTransactions("ShapesOp")
7671 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7673 Find coincident edges in theShapes for possible gluing.
7676 theShapes Initial shapes, either a list or compound of shapes.
7677 theTolerance Maximum distance between edges,
7678 which can be considered as coincident.
7679 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.
7686 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7687 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7688 self._autoPublish(anObj, theName, "edgesToGlue")
7691 ## Replace coincident edges in theShapes by one edge
7692 # in compliance with given list of edges.
7693 # @param theShapes Initial shapes, either a list or compound of shapes.
7694 # @param theTolerance Maximum distance between edges,
7695 # which can be considered as coincident.
7696 # @param theEdges List of edges for gluing.
7697 # @param theName Object name; when specified, this parameter is used
7698 # for result publication in the study. Otherwise, if automatic
7699 # publication is switched on, default value is used for result name.
7701 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7703 # @ref tui_glue_edges "Example"
7704 @ManageTransactions("ShapesOp")
7705 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7707 Replace coincident edges in theShapes by one edge
7708 in compliance with given list of edges.
7711 theShapes Initial shapes, either a list or compound of shapes.
7712 theTolerance Maximum distance between edges,
7713 which can be considered as coincident.
7714 theEdges List of edges for gluing.
7715 theName Object name; when specified, this parameter is used
7716 for result publication in the study. Otherwise, if automatic
7717 publication is switched on, default value is used for result name.
7720 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7722 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7724 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7725 self._autoPublish(anObj, theName, "glueEdges")
7731 ## @addtogroup l3_boolean Boolean Operations
7734 # -----------------------------------------------------------------------------
7735 # Boolean (Common, Cut, Fuse, Section)
7736 # -----------------------------------------------------------------------------
7738 ## Perform one of boolean operations on two given shapes.
7739 # @param theShape1 First argument for boolean operation.
7740 # @param theShape2 Second argument for boolean operation.
7741 # @param theOperation Indicates the operation to be done:\n
7742 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7743 # @param checkSelfInte The flag that tells if the arguments should
7744 # be checked for self-intersection prior to the operation.
7745 # @param theName Object name; when specified, this parameter is used
7746 # for result publication in the study. Otherwise, if automatic
7747 # publication is switched on, default value is used for result name.
7749 # @note This algorithm doesn't find all types of self-intersections.
7750 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7751 # vertex/face and edge/face intersections. Face/face
7752 # intersections detection is switched off as it is a
7753 # time-consuming operation that gives an impact on performance.
7754 # To find all self-intersections please use
7755 # CheckSelfIntersections() method.
7757 # @return New GEOM.GEOM_Object, containing the result shape.
7759 # @ref tui_fuse "Example"
7760 @ManageTransactions("BoolOp")
7761 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7763 Perform one of boolean operations on two given shapes.
7766 theShape1 First argument for boolean operation.
7767 theShape2 Second argument for boolean operation.
7768 theOperation Indicates the operation to be done:
7769 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7770 checkSelfInte The flag that tells if the arguments should
7771 be checked for self-intersection prior to
7773 theName Object name; when specified, this parameter is used
7774 for result publication in the study. Otherwise, if automatic
7775 publication is switched on, default value is used for result name.
7778 This algorithm doesn't find all types of self-intersections.
7779 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7780 vertex/face and edge/face intersections. Face/face
7781 intersections detection is switched off as it is a
7782 time-consuming operation that gives an impact on performance.
7783 To find all self-intersections please use
7784 CheckSelfIntersections() method.
7787 New GEOM.GEOM_Object, containing the result shape.
7789 # Example: see GEOM_TestAll.py
7790 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7791 RaiseIfFailed("MakeBoolean", self.BoolOp)
7792 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7793 self._autoPublish(anObj, theName, def_names[theOperation])
7796 ## Perform Common boolean operation on two given shapes.
7797 # @param theShape1 First argument for boolean operation.
7798 # @param theShape2 Second argument for boolean operation.
7799 # @param checkSelfInte The flag that tells if the arguments should
7800 # be checked for self-intersection prior to the operation.
7801 # @param theName Object name; when specified, this parameter is used
7802 # for result publication in the study. Otherwise, if automatic
7803 # publication is switched on, default value is used for result name.
7805 # @note This algorithm doesn't find all types of self-intersections.
7806 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7807 # vertex/face and edge/face intersections. Face/face
7808 # intersections detection is switched off as it is a
7809 # time-consuming operation that gives an impact on performance.
7810 # To find all self-intersections please use
7811 # CheckSelfIntersections() method.
7813 # @return New GEOM.GEOM_Object, containing the result shape.
7815 # @ref tui_common "Example 1"
7816 # \n @ref swig_MakeCommon "Example 2"
7817 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7819 Perform Common boolean operation on two given shapes.
7822 theShape1 First argument for boolean operation.
7823 theShape2 Second argument for boolean operation.
7824 checkSelfInte The flag that tells if the arguments should
7825 be checked for self-intersection prior to
7827 theName Object name; when specified, this parameter is used
7828 for result publication in the study. Otherwise, if automatic
7829 publication is switched on, default value is used for result name.
7832 This algorithm doesn't find all types of self-intersections.
7833 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7834 vertex/face and edge/face intersections. Face/face
7835 intersections detection is switched off as it is a
7836 time-consuming operation that gives an impact on performance.
7837 To find all self-intersections please use
7838 CheckSelfIntersections() method.
7841 New GEOM.GEOM_Object, containing the result shape.
7843 # Example: see GEOM_TestOthers.py
7844 # note: auto-publishing is done in self.MakeBoolean()
7845 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7847 ## Perform Cut boolean operation on two given shapes.
7848 # @param theShape1 First argument for boolean operation.
7849 # @param theShape2 Second argument for boolean operation.
7850 # @param checkSelfInte The flag that tells if the arguments should
7851 # be checked for self-intersection prior to the operation.
7852 # @param theName Object name; when specified, this parameter is used
7853 # for result publication in the study. Otherwise, if automatic
7854 # publication is switched on, default value is used for result name.
7856 # @note This algorithm doesn't find all types of self-intersections.
7857 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7858 # vertex/face and edge/face intersections. Face/face
7859 # intersections detection is switched off as it is a
7860 # time-consuming operation that gives an impact on performance.
7861 # To find all self-intersections please use
7862 # CheckSelfIntersections() method.
7864 # @return New GEOM.GEOM_Object, containing the result shape.
7866 # @ref tui_cut "Example 1"
7867 # \n @ref swig_MakeCommon "Example 2"
7868 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7870 Perform Cut boolean operation on two given shapes.
7873 theShape1 First argument for boolean operation.
7874 theShape2 Second argument for boolean operation.
7875 checkSelfInte The flag that tells if the arguments should
7876 be checked for self-intersection prior to
7878 theName Object name; when specified, this parameter is used
7879 for result publication in the study. Otherwise, if automatic
7880 publication is switched on, default value is used for result name.
7883 This algorithm doesn't find all types of self-intersections.
7884 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7885 vertex/face and edge/face intersections. Face/face
7886 intersections detection is switched off as it is a
7887 time-consuming operation that gives an impact on performance.
7888 To find all self-intersections please use
7889 CheckSelfIntersections() method.
7892 New GEOM.GEOM_Object, containing the result shape.
7895 # Example: see GEOM_TestOthers.py
7896 # note: auto-publishing is done in self.MakeBoolean()
7897 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7899 ## Perform Fuse boolean operation on two given shapes.
7900 # @param theShape1 First argument for boolean operation.
7901 # @param theShape2 Second argument for boolean operation.
7902 # @param checkSelfInte The flag that tells if the arguments should
7903 # be checked for self-intersection prior to the operation.
7904 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7905 # operation should be performed during the operation.
7906 # @param theName Object name; when specified, this parameter is used
7907 # for result publication in the study. Otherwise, if automatic
7908 # publication is switched on, default value is used for result name.
7910 # @note This algorithm doesn't find all types of self-intersections.
7911 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7912 # vertex/face and edge/face intersections. Face/face
7913 # intersections detection is switched off as it is a
7914 # time-consuming operation that gives an impact on performance.
7915 # To find all self-intersections please use
7916 # CheckSelfIntersections() method.
7918 # @return New GEOM.GEOM_Object, containing the result shape.
7920 # @ref tui_fuse "Example 1"
7921 # \n @ref swig_MakeCommon "Example 2"
7922 @ManageTransactions("BoolOp")
7923 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7924 rmExtraEdges=False, theName=None):
7926 Perform Fuse boolean operation on two given shapes.
7929 theShape1 First argument for boolean operation.
7930 theShape2 Second argument for boolean operation.
7931 checkSelfInte The flag that tells if the arguments should
7932 be checked for self-intersection prior to
7934 rmExtraEdges The flag that tells if Remove Extra Edges
7935 operation should be performed during the operation.
7936 theName Object name; when specified, this parameter is used
7937 for result publication in the study. Otherwise, if automatic
7938 publication is switched on, default value is used for result name.
7941 This algorithm doesn't find all types of self-intersections.
7942 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7943 vertex/face and edge/face intersections. Face/face
7944 intersections detection is switched off as it is a
7945 time-consuming operation that gives an impact on performance.
7946 To find all self-intersections please use
7947 CheckSelfIntersections() method.
7950 New GEOM.GEOM_Object, containing the result shape.
7953 # Example: see GEOM_TestOthers.py
7954 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7955 checkSelfInte, rmExtraEdges)
7956 RaiseIfFailed("MakeFuse", self.BoolOp)
7957 self._autoPublish(anObj, theName, "fuse")
7960 ## Perform Section boolean operation on two given shapes.
7961 # @param theShape1 First argument for boolean operation.
7962 # @param theShape2 Second argument for boolean operation.
7963 # @param checkSelfInte The flag that tells if the arguments should
7964 # be checked for self-intersection prior to the operation.
7965 # If a self-intersection detected the operation fails.
7966 # @param theName Object name; when specified, this parameter is used
7967 # for result publication in the study. Otherwise, if automatic
7968 # publication is switched on, default value is used for result name.
7969 # @return New GEOM.GEOM_Object, containing the result shape.
7971 # @ref tui_section "Example 1"
7972 # \n @ref swig_MakeCommon "Example 2"
7973 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7975 Perform Section boolean operation on two given shapes.
7978 theShape1 First argument for boolean operation.
7979 theShape2 Second argument for boolean operation.
7980 checkSelfInte The flag that tells if the arguments should
7981 be checked for self-intersection prior to the operation.
7982 If a self-intersection detected the operation fails.
7983 theName Object name; when specified, this parameter is used
7984 for result publication in the study. Otherwise, if automatic
7985 publication is switched on, default value is used for result name.
7987 New GEOM.GEOM_Object, containing the result shape.
7990 # Example: see GEOM_TestOthers.py
7991 # note: auto-publishing is done in self.MakeBoolean()
7992 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7994 ## Perform Fuse boolean operation on the list of shapes.
7995 # @param theShapesList Shapes to be fused.
7996 # @param checkSelfInte The flag that tells if the arguments should
7997 # be checked for self-intersection prior to the operation.
7998 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7999 # operation should be performed during the operation.
8000 # @param theName Object name; when specified, this parameter is used
8001 # for result publication in the study. Otherwise, if automatic
8002 # publication is switched on, default value is used for result name.
8004 # @note This algorithm doesn't find all types of self-intersections.
8005 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8006 # vertex/face and edge/face intersections. Face/face
8007 # intersections detection is switched off as it is a
8008 # time-consuming operation that gives an impact on performance.
8009 # To find all self-intersections please use
8010 # CheckSelfIntersections() method.
8012 # @return New GEOM.GEOM_Object, containing the result shape.
8014 # @ref tui_fuse "Example 1"
8015 # \n @ref swig_MakeCommon "Example 2"
8016 @ManageTransactions("BoolOp")
8017 def MakeFuseList(self, theShapesList, checkSelfInte=False,
8018 rmExtraEdges=False, theName=None):
8020 Perform Fuse boolean operation on the list of shapes.
8023 theShapesList Shapes to be fused.
8024 checkSelfInte The flag that tells if the arguments should
8025 be checked for self-intersection prior to
8027 rmExtraEdges The flag that tells if Remove Extra Edges
8028 operation should be performed during the operation.
8029 theName Object name; when specified, this parameter is used
8030 for result publication in the study. Otherwise, if automatic
8031 publication is switched on, default value is used for result name.
8034 This algorithm doesn't find all types of self-intersections.
8035 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8036 vertex/face and edge/face intersections. Face/face
8037 intersections detection is switched off as it is a
8038 time-consuming operation that gives an impact on performance.
8039 To find all self-intersections please use
8040 CheckSelfIntersections() method.
8043 New GEOM.GEOM_Object, containing the result shape.
8046 # Example: see GEOM_TestOthers.py
8047 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8049 RaiseIfFailed("MakeFuseList", self.BoolOp)
8050 self._autoPublish(anObj, theName, "fuse")
8053 ## Perform Common boolean operation on the list of shapes.
8054 # @param theShapesList Shapes for Common operation.
8055 # @param checkSelfInte The flag that tells if the arguments should
8056 # be checked for self-intersection prior to the operation.
8057 # @param theName Object name; when specified, this parameter is used
8058 # for result publication in the study. Otherwise, if automatic
8059 # publication is switched on, default value is used for result name.
8061 # @note This algorithm doesn't find all types of self-intersections.
8062 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8063 # vertex/face and edge/face intersections. Face/face
8064 # intersections detection is switched off as it is a
8065 # time-consuming operation that gives an impact on performance.
8066 # To find all self-intersections please use
8067 # CheckSelfIntersections() method.
8069 # @return New GEOM.GEOM_Object, containing the result shape.
8071 # @ref tui_common "Example 1"
8072 # \n @ref swig_MakeCommon "Example 2"
8073 @ManageTransactions("BoolOp")
8074 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8076 Perform Common boolean operation on the list of shapes.
8079 theShapesList Shapes for Common operation.
8080 checkSelfInte The flag that tells if the arguments should
8081 be checked for self-intersection prior to
8083 theName Object name; when specified, this parameter is used
8084 for result publication in the study. Otherwise, if automatic
8085 publication is switched on, default value is used for result name.
8088 This algorithm doesn't find all types of self-intersections.
8089 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8090 vertex/face and edge/face intersections. Face/face
8091 intersections detection is switched off as it is a
8092 time-consuming operation that gives an impact on performance.
8093 To find all self-intersections please use
8094 CheckSelfIntersections() method.
8097 New GEOM.GEOM_Object, containing the result shape.
8100 # Example: see GEOM_TestOthers.py
8101 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8102 RaiseIfFailed("MakeCommonList", self.BoolOp)
8103 self._autoPublish(anObj, theName, "common")
8106 ## Perform Cut boolean operation on one object and the list of tools.
8107 # @param theMainShape The object of the operation.
8108 # @param theShapesList The list of tools of the operation.
8109 # @param checkSelfInte The flag that tells if the arguments should
8110 # be checked for self-intersection prior to the operation.
8111 # @param theName Object name; when specified, this parameter is used
8112 # for result publication in the study. Otherwise, if automatic
8113 # publication is switched on, default value is used for result name.
8115 # @note This algorithm doesn't find all types of self-intersections.
8116 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8117 # vertex/face and edge/face intersections. Face/face
8118 # intersections detection is switched off as it is a
8119 # time-consuming operation that gives an impact on performance.
8120 # To find all self-intersections please use
8121 # CheckSelfIntersections() method.
8123 # @return New GEOM.GEOM_Object, containing the result shape.
8125 # @ref tui_cut "Example 1"
8126 # \n @ref swig_MakeCommon "Example 2"
8127 @ManageTransactions("BoolOp")
8128 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8130 Perform Cut boolean operation on one object and the list of tools.
8133 theMainShape The object of the operation.
8134 theShapesList The list of tools of the operation.
8135 checkSelfInte The flag that tells if the arguments should
8136 be checked for self-intersection prior to
8138 theName Object name; when specified, this parameter is used
8139 for result publication in the study. Otherwise, if automatic
8140 publication is switched on, default value is used for result name.
8143 This algorithm doesn't find all types of self-intersections.
8144 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8145 vertex/face and edge/face intersections. Face/face
8146 intersections detection is switched off as it is a
8147 time-consuming operation that gives an impact on performance.
8148 To find all self-intersections please use
8149 CheckSelfIntersections() method.
8152 New GEOM.GEOM_Object, containing the result shape.
8155 # Example: see GEOM_TestOthers.py
8156 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8157 RaiseIfFailed("MakeCutList", self.BoolOp)
8158 self._autoPublish(anObj, theName, "cut")
8164 ## @addtogroup l3_basic_op
8167 ## Perform partition operation.
8168 # @param ListShapes Shapes to be intersected.
8169 # @param ListTools Shapes to intersect theShapes.
8170 # @param Limit Type of resulting shapes (see ShapeType()).\n
8171 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8172 # type will be detected automatically.
8173 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8174 # target type (equal to Limit) are kept in the result,
8175 # else standalone shapes of lower dimension
8176 # are kept also (if they exist).
8178 # @param theName Object name; when specified, this parameter is used
8179 # for result publication in the study. Otherwise, if automatic
8180 # publication is switched on, default value is used for result name.
8182 # @note Each compound from ListShapes and ListTools will be exploded
8183 # in order to avoid possible intersection between shapes from this compound.
8185 # After implementation new version of PartitionAlgo (October 2006)
8186 # other parameters are ignored by current functionality. They are kept
8187 # in this function only for support old versions.
8188 # @param ListKeepInside Shapes, outside which the results will be deleted.
8189 # Each shape from theKeepInside must belong to theShapes also.
8190 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8191 # Each shape from theRemoveInside must belong to theShapes also.
8192 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8193 # @param ListMaterials Material indices for each shape. Make sense,
8194 # only if theRemoveWebs is TRUE.
8196 # @return New GEOM.GEOM_Object, containing the result shapes.
8198 # @ref tui_partition "Example"
8199 @ManageTransactions("BoolOp")
8200 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8201 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8202 KeepNonlimitShapes=0, theName=None):
8204 Perform partition operation.
8207 ListShapes Shapes to be intersected.
8208 ListTools Shapes to intersect theShapes.
8209 Limit Type of resulting shapes (see geompy.ShapeType)
8210 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8211 type will be detected automatically.
8212 KeepNonlimitShapes if this parameter == 0, then only shapes of
8213 target type (equal to Limit) are kept in the result,
8214 else standalone shapes of lower dimension
8215 are kept also (if they exist).
8217 theName Object name; when specified, this parameter is used
8218 for result publication in the study. Otherwise, if automatic
8219 publication is switched on, default value is used for result name.
8221 Each compound from ListShapes and ListTools will be exploded
8222 in order to avoid possible intersection between shapes from
8225 After implementation new version of PartitionAlgo (October 2006) other
8226 parameters are ignored by current functionality. They are kept in this
8227 function only for support old versions.
8230 ListKeepInside Shapes, outside which the results will be deleted.
8231 Each shape from theKeepInside must belong to theShapes also.
8232 ListRemoveInside Shapes, inside which the results will be deleted.
8233 Each shape from theRemoveInside must belong to theShapes also.
8234 RemoveWebs If TRUE, perform Glue 3D algorithm.
8235 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8238 New GEOM.GEOM_Object, containing the result shapes.
8240 # Example: see GEOM_TestAll.py
8241 if Limit == self.ShapeType["AUTO"]:
8242 # automatic detection of the most appropriate shape limit type
8244 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8245 Limit = EnumToLong(lim)
8247 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8248 ListKeepInside, ListRemoveInside,
8249 Limit, RemoveWebs, ListMaterials,
8250 KeepNonlimitShapes);
8251 RaiseIfFailed("MakePartition", self.BoolOp)
8252 self._autoPublish(anObj, theName, "partition")
8255 ## Perform partition operation.
8256 # This method may be useful if it is needed to make a partition for
8257 # compound contains nonintersected shapes. Performance will be better
8258 # since intersection between shapes from compound is not performed.
8260 # Description of all parameters as in previous method MakePartition().
8261 # One additional parameter is provided:
8262 # @param checkSelfInte The flag that tells if the arguments should
8263 # be checked for self-intersection prior to the operation.
8265 # @note This algorithm doesn't find all types of self-intersections.
8266 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8267 # vertex/face and edge/face intersections. Face/face
8268 # intersections detection is switched off as it is a
8269 # time-consuming operation that gives an impact on performance.
8270 # To find all self-intersections please use
8271 # CheckSelfIntersections() method.
8273 # @note Passed compounds (via ListShapes or via ListTools)
8274 # have to consist of nonintersecting shapes.
8276 # @return New GEOM.GEOM_Object, containing the result shapes.
8278 # @ref swig_todo "Example"
8279 @ManageTransactions("BoolOp")
8280 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8281 ListKeepInside=[], ListRemoveInside=[],
8282 Limit=ShapeType["AUTO"], RemoveWebs=0,
8283 ListMaterials=[], KeepNonlimitShapes=0,
8284 checkSelfInte=False, theName=None):
8286 Perform partition operation.
8287 This method may be useful if it is needed to make a partition for
8288 compound contains nonintersected shapes. Performance will be better
8289 since intersection between shapes from compound is not performed.
8292 Description of all parameters as in method geompy.MakePartition.
8293 One additional parameter is provided:
8294 checkSelfInte The flag that tells if the arguments should
8295 be checked for self-intersection prior to
8299 This algorithm doesn't find all types of self-intersections.
8300 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8301 vertex/face and edge/face intersections. Face/face
8302 intersections detection is switched off as it is a
8303 time-consuming operation that gives an impact on performance.
8304 To find all self-intersections please use
8305 CheckSelfIntersections() method.
8308 Passed compounds (via ListShapes or via ListTools)
8309 have to consist of nonintersecting shapes.
8312 New GEOM.GEOM_Object, containing the result shapes.
8314 if Limit == self.ShapeType["AUTO"]:
8315 # automatic detection of the most appropriate shape limit type
8317 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8318 Limit = EnumToLong(lim)
8320 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8321 ListKeepInside, ListRemoveInside,
8322 Limit, RemoveWebs, ListMaterials,
8323 KeepNonlimitShapes, checkSelfInte);
8324 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8325 self._autoPublish(anObj, theName, "partition")
8328 ## See method MakePartition() for more information.
8330 # @ref tui_partition "Example 1"
8331 # \n @ref swig_Partition "Example 2"
8332 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8333 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8334 KeepNonlimitShapes=0, theName=None):
8336 See method geompy.MakePartition for more information.
8338 # Example: see GEOM_TestOthers.py
8339 # note: auto-publishing is done in self.MakePartition()
8340 anObj = self.MakePartition(ListShapes, ListTools,
8341 ListKeepInside, ListRemoveInside,
8342 Limit, RemoveWebs, ListMaterials,
8343 KeepNonlimitShapes, theName);
8346 ## Perform partition of the Shape with the Plane
8347 # @param theShape Shape to be intersected.
8348 # @param thePlane Tool shape, to intersect theShape.
8349 # @param theName Object name; when specified, this parameter is used
8350 # for result publication in the study. Otherwise, if automatic
8351 # publication is switched on, default value is used for result name.
8353 # @return New GEOM.GEOM_Object, containing the result shape.
8355 # @note This operation is a shortcut to the more general @ref MakePartition
8356 # operation, where @a theShape specifies single "object" (shape being partitioned)
8357 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8358 # @ref MakePartition operation have default values:
8359 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8360 # - @a KeepNonlimitShapes: 0
8361 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8362 # @a Materials (obsolete parameters): empty
8364 # @note I.e. the following two operations are equivalent:
8366 # Result = geompy.MakeHalfPartition(Object, Plane)
8367 # Result = geompy.MakePartition([Object], [Plane])
8370 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8372 # @ref tui_partition "Example"
8373 @ManageTransactions("BoolOp")
8374 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8376 Perform partition of the Shape with the Plane
8379 theShape Shape to be intersected.
8380 thePlane Tool shape, to intersect theShape.
8381 theName Object name; when specified, this parameter is used
8382 for result publication in the study. Otherwise, if automatic
8383 publication is switched on, default value is used for result name.
8386 New GEOM.GEOM_Object, containing the result shape.
8388 Note: This operation is a shortcut to the more general MakePartition
8389 operation, where theShape specifies single "object" (shape being partitioned)
8390 and thePlane specifies single "tool" (intersector shape). Other parameters of
8391 MakePartition operation have default values:
8392 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8393 - KeepNonlimitShapes: 0
8394 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8396 I.e. the following two operations are equivalent:
8397 Result = geompy.MakeHalfPartition(Object, Plane)
8398 Result = geompy.MakePartition([Object], [Plane])
8400 # Example: see GEOM_TestAll.py
8401 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8402 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8403 self._autoPublish(anObj, theName, "partition")
8406 # end of l3_basic_op
8409 ## @addtogroup l3_transform
8412 ## Translate the given object along the vector, specified
8413 # by its end points.
8414 # @param theObject The object to be translated.
8415 # @param thePoint1 Start point of translation vector.
8416 # @param thePoint2 End point of translation vector.
8417 # @param theCopy Flag used to translate object itself or create a copy.
8418 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8419 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8420 @ManageTransactions("TrsfOp")
8421 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8423 Translate the given object along the vector, specified by its end points.
8426 theObject The object to be translated.
8427 thePoint1 Start point of translation vector.
8428 thePoint2 End point of translation vector.
8429 theCopy Flag used to translate object itself or create a copy.
8432 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8433 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8436 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8438 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8439 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8442 ## Translate the given object along the vector, specified
8443 # by its end points, creating its copy before the translation.
8444 # @param theObject The object to be translated.
8445 # @param thePoint1 Start point of translation vector.
8446 # @param thePoint2 End point of translation vector.
8447 # @param 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.
8451 # @return New GEOM.GEOM_Object, containing the translated object.
8453 # @ref tui_translation "Example 1"
8454 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8455 @ManageTransactions("TrsfOp")
8456 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8458 Translate the given object along the vector, specified
8459 by its end points, creating its copy before the translation.
8462 theObject The object to be translated.
8463 thePoint1 Start point of translation vector.
8464 thePoint2 End point of translation vector.
8465 theName Object name; when specified, this parameter is used
8466 for result publication in the study. Otherwise, if automatic
8467 publication is switched on, default value is used for result name.
8470 New GEOM.GEOM_Object, containing the translated object.
8472 # Example: see GEOM_TestAll.py
8473 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8474 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8475 self._autoPublish(anObj, theName, "translated")
8478 ## Translate the given object along the vector, specified by its components.
8479 # @param theObject The object to be translated.
8480 # @param theDX,theDY,theDZ Components of translation vector.
8481 # @param theCopy Flag used to translate object itself or create a copy.
8482 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8483 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8485 # @ref tui_translation "Example"
8486 @ManageTransactions("TrsfOp")
8487 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8489 Translate the given object along the vector, specified by its components.
8492 theObject The object to be translated.
8493 theDX,theDY,theDZ Components of translation vector.
8494 theCopy Flag used to translate object itself or create a copy.
8497 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8498 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8500 # Example: see GEOM_TestAll.py
8501 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8503 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8505 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8506 anObj.SetParameters(Parameters)
8507 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8510 ## Translate the given object along the vector, specified
8511 # by its components, creating its copy before the translation.
8512 # @param theObject The object to be translated.
8513 # @param theDX,theDY,theDZ Components of translation vector.
8514 # @param theName Object name; when specified, this parameter is used
8515 # for result publication in the study. Otherwise, if automatic
8516 # publication is switched on, default value is used for result name.
8518 # @return New GEOM.GEOM_Object, containing the translated object.
8520 # @ref tui_translation "Example"
8521 @ManageTransactions("TrsfOp")
8522 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8524 Translate the given object along the vector, specified
8525 by its components, creating its copy before the translation.
8528 theObject The object to be translated.
8529 theDX,theDY,theDZ Components of translation vector.
8530 theName Object name; when specified, this parameter is used
8531 for result publication in the study. Otherwise, if automatic
8532 publication is switched on, default value is used for result name.
8535 New GEOM.GEOM_Object, containing the translated object.
8537 # Example: see GEOM_TestAll.py
8538 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8539 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8540 anObj.SetParameters(Parameters)
8541 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8542 self._autoPublish(anObj, theName, "translated")
8545 ## Translate the given object along the given vector.
8546 # @param theObject The object to be translated.
8547 # @param theVector The translation vector.
8548 # @param theCopy Flag used to translate object itself or create a copy.
8549 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8550 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8551 @ManageTransactions("TrsfOp")
8552 def TranslateVector(self, theObject, theVector, theCopy=False):
8554 Translate the given object along the given vector.
8557 theObject The object to be translated.
8558 theVector The translation vector.
8559 theCopy Flag used to translate object itself or create a copy.
8562 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8563 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8566 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8568 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8569 RaiseIfFailed("TranslateVector", self.TrsfOp)
8572 ## Translate the given object along the given vector,
8573 # creating its copy before the translation.
8574 # @param theObject The object to be translated.
8575 # @param theVector The translation vector.
8576 # @param theName Object name; when specified, this parameter is used
8577 # for result publication in the study. Otherwise, if automatic
8578 # publication is switched on, default value is used for result name.
8580 # @return New GEOM.GEOM_Object, containing the translated object.
8582 # @ref tui_translation "Example"
8583 @ManageTransactions("TrsfOp")
8584 def MakeTranslationVector(self, theObject, theVector, theName=None):
8586 Translate the given object along the given vector,
8587 creating its copy before the translation.
8590 theObject The object to be translated.
8591 theVector The translation vector.
8592 theName Object name; when specified, this parameter is used
8593 for result publication in the study. Otherwise, if automatic
8594 publication is switched on, default value is used for result name.
8597 New GEOM.GEOM_Object, containing the translated object.
8599 # Example: see GEOM_TestAll.py
8600 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8601 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8602 self._autoPublish(anObj, theName, "translated")
8605 ## Translate the given object along the given vector on given distance.
8606 # @param theObject The object to be translated.
8607 # @param theVector The translation vector.
8608 # @param theDistance The translation distance.
8609 # @param theCopy Flag used to translate object itself or create a copy.
8610 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8611 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8613 # @ref tui_translation "Example"
8614 @ManageTransactions("TrsfOp")
8615 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8617 Translate the given object along the given vector on given distance.
8620 theObject The object to be translated.
8621 theVector The translation vector.
8622 theDistance The translation distance.
8623 theCopy Flag used to translate object itself or create a copy.
8626 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8627 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8629 # Example: see GEOM_TestAll.py
8630 theDistance,Parameters = ParseParameters(theDistance)
8631 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8632 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8633 anObj.SetParameters(Parameters)
8636 ## Translate the given object along the given vector on given distance,
8637 # creating its copy before the translation.
8638 # @param theObject The object to be translated.
8639 # @param theVector The translation vector.
8640 # @param theDistance The translation distance.
8641 # @param theName Object name; when specified, this parameter is used
8642 # for result publication in the study. Otherwise, if automatic
8643 # publication is switched on, default value is used for result name.
8645 # @return New GEOM.GEOM_Object, containing the translated object.
8647 # @ref tui_translation "Example"
8648 @ManageTransactions("TrsfOp")
8649 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8651 Translate the given object along the given vector on given distance,
8652 creating its copy before the translation.
8655 theObject The object to be translated.
8656 theVector The translation vector.
8657 theDistance The translation distance.
8658 theName Object name; when specified, this parameter is used
8659 for result publication in the study. Otherwise, if automatic
8660 publication is switched on, default value is used for result name.
8663 New GEOM.GEOM_Object, containing the translated object.
8665 # Example: see GEOM_TestAll.py
8666 theDistance,Parameters = ParseParameters(theDistance)
8667 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8668 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8669 anObj.SetParameters(Parameters)
8670 self._autoPublish(anObj, theName, "translated")
8673 ## Rotate the given object around the given axis on the given angle.
8674 # @param theObject The object to be rotated.
8675 # @param theAxis Rotation axis.
8676 # @param theAngle Rotation angle in radians.
8677 # @param theCopy Flag used to rotate object itself or create a copy.
8679 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8680 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8682 # @ref tui_rotation "Example"
8683 @ManageTransactions("TrsfOp")
8684 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8686 Rotate the given object around the given axis on the given angle.
8689 theObject The object to be rotated.
8690 theAxis Rotation axis.
8691 theAngle Rotation angle in radians.
8692 theCopy Flag used to rotate object itself or create a copy.
8695 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8696 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8698 # Example: see GEOM_TestAll.py
8700 if isinstance(theAngle,str):
8702 theAngle, Parameters = ParseParameters(theAngle)
8704 theAngle = theAngle*math.pi/180.0
8706 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8708 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8709 RaiseIfFailed("Rotate", self.TrsfOp)
8710 anObj.SetParameters(Parameters)
8713 ## Rotate the given object around the given axis
8714 # on the given angle, creating its copy before the rotation.
8715 # @param theObject The object to be rotated.
8716 # @param theAxis Rotation axis.
8717 # @param theAngle Rotation angle in radians.
8718 # @param theName Object name; when specified, this parameter is used
8719 # for result publication in the study. Otherwise, if automatic
8720 # publication is switched on, default value is used for result name.
8722 # @return New GEOM.GEOM_Object, containing the rotated object.
8724 # @ref tui_rotation "Example"
8725 @ManageTransactions("TrsfOp")
8726 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8728 Rotate the given object around the given axis
8729 on the given angle, creating its copy before the rotatation.
8732 theObject The object to be rotated.
8733 theAxis Rotation axis.
8734 theAngle Rotation angle in radians.
8735 theName Object name; when specified, this parameter is used
8736 for result publication in the study. Otherwise, if automatic
8737 publication is switched on, default value is used for result name.
8740 New GEOM.GEOM_Object, containing the rotated object.
8742 # Example: see GEOM_TestAll.py
8744 if isinstance(theAngle,str):
8746 theAngle, Parameters = ParseParameters(theAngle)
8748 theAngle = theAngle*math.pi/180.0
8749 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8750 RaiseIfFailed("RotateCopy", self.TrsfOp)
8751 anObj.SetParameters(Parameters)
8752 self._autoPublish(anObj, theName, "rotated")
8755 ## Rotate given object around vector perpendicular to plane
8756 # containing three points.
8757 # @param theObject The object to be rotated.
8758 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8759 # containing the three points.
8760 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8761 # @param theCopy Flag used to rotate object itself or create a copy.
8762 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8763 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8764 @ManageTransactions("TrsfOp")
8765 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8767 Rotate given object around vector perpendicular to plane
8768 containing three points.
8771 theObject The object to be rotated.
8772 theCentPoint central point the axis is the vector perpendicular to the plane
8773 containing the three points.
8774 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8775 theCopy Flag used to rotate object itself or create a copy.
8778 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8779 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8782 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8784 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8785 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8788 ## Rotate given object around vector perpendicular to plane
8789 # containing three points, creating its copy before the rotatation.
8790 # @param theObject The object to be rotated.
8791 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8792 # containing the three points.
8793 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8794 # @param 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.
8798 # @return New GEOM.GEOM_Object, containing the rotated object.
8800 # @ref tui_rotation "Example"
8801 @ManageTransactions("TrsfOp")
8802 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8804 Rotate given object around vector perpendicular to plane
8805 containing three points, creating its copy before the rotatation.
8808 theObject The object to be rotated.
8809 theCentPoint central point the axis is the vector perpendicular to the plane
8810 containing the three points.
8811 thePoint1,thePoint2 in a perpendicular plane of the axis.
8812 theName Object name; when specified, this parameter is used
8813 for result publication in the study. Otherwise, if automatic
8814 publication is switched on, default value is used for result name.
8817 New GEOM.GEOM_Object, containing the rotated object.
8819 # Example: see GEOM_TestAll.py
8820 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8821 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8822 self._autoPublish(anObj, theName, "rotated")
8825 ## Scale the given object by the specified factor.
8826 # @param theObject The object to be scaled.
8827 # @param thePoint Center point for scaling.
8828 # Passing None for it means scaling relatively the origin of global CS.
8829 # @param theFactor Scaling factor value.
8830 # @param theCopy Flag used to scale object itself or create a copy.
8831 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8832 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8833 @ManageTransactions("TrsfOp")
8834 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8836 Scale the given object by the specified factor.
8839 theObject The object to be scaled.
8840 thePoint Center point for scaling.
8841 Passing None for it means scaling relatively the origin of global CS.
8842 theFactor Scaling factor value.
8843 theCopy Flag used to scale object itself or create a copy.
8846 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8847 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8849 # Example: see GEOM_TestAll.py
8850 theFactor, Parameters = ParseParameters(theFactor)
8852 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8854 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8855 RaiseIfFailed("Scale", self.TrsfOp)
8856 anObj.SetParameters(Parameters)
8859 ## Scale the given object by the factor, creating its copy before the scaling.
8860 # @param theObject The object to be scaled.
8861 # @param thePoint Center point for scaling.
8862 # Passing None for it means scaling relatively the origin of global CS.
8863 # @param theFactor Scaling factor value.
8864 # @param theName Object name; when specified, this parameter is used
8865 # for result publication in the study. Otherwise, if automatic
8866 # publication is switched on, default value is used for result name.
8868 # @return New GEOM.GEOM_Object, containing the scaled shape.
8870 # @ref tui_scale "Example"
8871 @ManageTransactions("TrsfOp")
8872 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8874 Scale the given object by the factor, creating its copy before the scaling.
8877 theObject The object to be scaled.
8878 thePoint Center point for scaling.
8879 Passing None for it means scaling relatively the origin of global CS.
8880 theFactor Scaling factor value.
8881 theName Object name; when specified, this parameter is used
8882 for result publication in the study. Otherwise, if automatic
8883 publication is switched on, default value is used for result name.
8886 New GEOM.GEOM_Object, containing the scaled shape.
8888 # Example: see GEOM_TestAll.py
8889 theFactor, Parameters = ParseParameters(theFactor)
8890 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8891 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8892 anObj.SetParameters(Parameters)
8893 self._autoPublish(anObj, theName, "scaled")
8896 ## Scale the given object by different factors along coordinate axes.
8897 # @param theObject The object to be scaled.
8898 # @param thePoint Center point for scaling.
8899 # Passing None for it means scaling relatively the origin of global CS.
8900 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8901 # @param theCopy Flag used to scale object itself or create a copy.
8902 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8903 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8904 @ManageTransactions("TrsfOp")
8905 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8907 Scale the given object by different factors along coordinate axes.
8910 theObject The object to be scaled.
8911 thePoint Center point for scaling.
8912 Passing None for it means scaling relatively the origin of global CS.
8913 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8914 theCopy Flag used to scale object itself or create a copy.
8917 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8918 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8920 # Example: see GEOM_TestAll.py
8921 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8923 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8924 theFactorX, theFactorY, theFactorZ)
8926 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8927 theFactorX, theFactorY, theFactorZ)
8928 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8929 anObj.SetParameters(Parameters)
8932 ## Scale the given object by different factors along coordinate axes,
8933 # creating its copy before the scaling.
8934 # @param theObject The object to be scaled.
8935 # @param thePoint Center point for scaling.
8936 # Passing None for it means scaling relatively the origin of global CS.
8937 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8938 # @param 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.
8942 # @return New GEOM.GEOM_Object, containing the scaled shape.
8944 # @ref swig_scale "Example"
8945 @ManageTransactions("TrsfOp")
8946 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8948 Scale the given object by different factors along coordinate axes,
8949 creating its copy before the scaling.
8952 theObject The object to be scaled.
8953 thePoint Center point for scaling.
8954 Passing None for it means scaling relatively the origin of global CS.
8955 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8956 theName Object name; when specified, this parameter is used
8957 for result publication in the study. Otherwise, if automatic
8958 publication is switched on, default value is used for result name.
8961 New GEOM.GEOM_Object, containing the scaled shape.
8963 # Example: see GEOM_TestAll.py
8964 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8965 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8966 theFactorX, theFactorY, theFactorZ)
8967 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8968 anObj.SetParameters(Parameters)
8969 self._autoPublish(anObj, theName, "scaled")
8972 ## Mirror an object relatively the given plane.
8973 # @param theObject The object to be mirrored.
8974 # @param thePlane Plane of symmetry.
8975 # @param theCopy Flag used to mirror object itself or create a copy.
8976 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8977 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8978 @ManageTransactions("TrsfOp")
8979 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8981 Mirror an object relatively the given plane.
8984 theObject The object to be mirrored.
8985 thePlane Plane of symmetry.
8986 theCopy Flag used to mirror object itself or create a copy.
8989 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8990 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8993 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8995 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8996 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
8999 ## Create an object, symmetrical
9000 # to the given one relatively the given plane.
9001 # @param theObject The object to be mirrored.
9002 # @param thePlane Plane of symmetry.
9003 # @param theName Object name; when specified, this parameter is used
9004 # for result publication in the study. Otherwise, if automatic
9005 # publication is switched on, default value is used for result name.
9007 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9009 # @ref tui_mirror "Example"
9010 @ManageTransactions("TrsfOp")
9011 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9013 Create an object, symmetrical to the given one relatively the given plane.
9016 theObject The object to be mirrored.
9017 thePlane Plane of symmetry.
9018 theName Object name; when specified, this parameter is used
9019 for result publication in the study. Otherwise, if automatic
9020 publication is switched on, default value is used for result name.
9023 New GEOM.GEOM_Object, containing the mirrored shape.
9025 # Example: see GEOM_TestAll.py
9026 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9027 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9028 self._autoPublish(anObj, theName, "mirrored")
9031 ## Mirror an object relatively the given axis.
9032 # @param theObject The object to be mirrored.
9033 # @param theAxis Axis of symmetry.
9034 # @param theCopy Flag used to mirror object itself or create a copy.
9035 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9036 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9037 @ManageTransactions("TrsfOp")
9038 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9040 Mirror an object relatively the given axis.
9043 theObject The object to be mirrored.
9044 theAxis Axis of symmetry.
9045 theCopy Flag used to mirror object itself or create a copy.
9048 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9049 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9052 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9054 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9055 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9058 ## Create an object, symmetrical
9059 # to the given one relatively the given axis.
9060 # @param theObject The object to be mirrored.
9061 # @param theAxis Axis of symmetry.
9062 # @param theName Object name; when specified, this parameter is used
9063 # for result publication in the study. Otherwise, if automatic
9064 # publication is switched on, default value is used for result name.
9066 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9068 # @ref tui_mirror "Example"
9069 @ManageTransactions("TrsfOp")
9070 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9072 Create an object, symmetrical to the given one relatively the given axis.
9075 theObject The object to be mirrored.
9076 theAxis Axis of symmetry.
9077 theName Object name; when specified, this parameter is used
9078 for result publication in the study. Otherwise, if automatic
9079 publication is switched on, default value is used for result name.
9082 New GEOM.GEOM_Object, containing the mirrored shape.
9084 # Example: see GEOM_TestAll.py
9085 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9086 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9087 self._autoPublish(anObj, theName, "mirrored")
9090 ## Mirror an object relatively the given point.
9091 # @param theObject The object to be mirrored.
9092 # @param thePoint Point of symmetry.
9093 # @param theCopy Flag used to mirror object itself or create a copy.
9094 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9095 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9096 @ManageTransactions("TrsfOp")
9097 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9099 Mirror an object relatively the given point.
9102 theObject The object to be mirrored.
9103 thePoint Point of symmetry.
9104 theCopy Flag used to mirror object itself or create a copy.
9107 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9108 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9110 # Example: see GEOM_TestAll.py
9112 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9114 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9115 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9118 ## Create an object, symmetrical
9119 # to the given one relatively the given point.
9120 # @param theObject The object to be mirrored.
9121 # @param thePoint Point of symmetry.
9122 # @param theName Object name; when specified, this parameter is used
9123 # for result publication in the study. Otherwise, if automatic
9124 # publication is switched on, default value is used for result name.
9126 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9128 # @ref tui_mirror "Example"
9129 @ManageTransactions("TrsfOp")
9130 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9132 Create an object, symmetrical
9133 to the given one relatively the given point.
9136 theObject The object to be mirrored.
9137 thePoint Point of symmetry.
9138 theName Object name; when specified, this parameter is used
9139 for result publication in the study. Otherwise, if automatic
9140 publication is switched on, default value is used for result name.
9143 New GEOM.GEOM_Object, containing the mirrored shape.
9145 # Example: see GEOM_TestAll.py
9146 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9147 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9148 self._autoPublish(anObj, theName, "mirrored")
9151 ## Modify the location of the given object.
9152 # @param theObject The object to be displaced.
9153 # @param theStartLCS Coordinate system to perform displacement from it.\n
9154 # If \a theStartLCS is NULL, displacement
9155 # will be performed from global CS.\n
9156 # If \a theObject itself is used as \a theStartLCS,
9157 # its location will be changed to \a theEndLCS.
9158 # @param theEndLCS Coordinate system to perform displacement to it.
9159 # @param theCopy Flag used to displace object itself or create a copy.
9160 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9161 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9162 @ManageTransactions("TrsfOp")
9163 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9165 Modify the Location of the given object by LCS, creating its copy before the setting.
9168 theObject The object to be displaced.
9169 theStartLCS Coordinate system to perform displacement from it.
9170 If theStartLCS is NULL, displacement
9171 will be performed from global CS.
9172 If theObject itself is used as theStartLCS,
9173 its location will be changed to theEndLCS.
9174 theEndLCS Coordinate system to perform displacement to it.
9175 theCopy Flag used to displace object itself or create a copy.
9178 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9179 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9181 # Example: see GEOM_TestAll.py
9183 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9185 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9186 RaiseIfFailed("Displace", self.TrsfOp)
9189 ## Modify the Location of the given object by LCS,
9190 # creating its copy before the setting.
9191 # @param theObject The object to be displaced.
9192 # @param theStartLCS Coordinate system to perform displacement from it.\n
9193 # If \a theStartLCS is NULL, displacement
9194 # will be performed from global CS.\n
9195 # If \a theObject itself is used as \a theStartLCS,
9196 # its location will be changed to \a theEndLCS.
9197 # @param theEndLCS Coordinate system to perform displacement to it.
9198 # @param theName Object name; when specified, this parameter is used
9199 # for result publication in the study. Otherwise, if automatic
9200 # publication is switched on, default value is used for result name.
9202 # @return New GEOM.GEOM_Object, containing the displaced shape.
9204 # @ref tui_modify_location "Example"
9205 @ManageTransactions("TrsfOp")
9206 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9208 Modify the Location of the given object by LCS, creating its copy before the setting.
9211 theObject The object to be displaced.
9212 theStartLCS Coordinate system to perform displacement from it.
9213 If theStartLCS is NULL, displacement
9214 will be performed from global CS.
9215 If theObject itself is used as theStartLCS,
9216 its location will be changed to theEndLCS.
9217 theEndLCS Coordinate system to perform displacement to it.
9218 theName Object name; when specified, this parameter is used
9219 for result publication in the study. Otherwise, if automatic
9220 publication is switched on, default value is used for result name.
9223 New GEOM.GEOM_Object, containing the displaced shape.
9226 # create local coordinate systems
9227 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9228 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9229 # modify the location of the given object
9230 position = geompy.MakePosition(cylinder, cs1, cs2)
9232 # Example: see GEOM_TestAll.py
9233 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9234 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9235 self._autoPublish(anObj, theName, "displaced")
9238 ## Modify the Location of the given object by Path.
9239 # @param theObject The object to be displaced.
9240 # @param thePath Wire or Edge along that the object will be translated.
9241 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9242 # @param theCopy is to create a copy objects if true.
9243 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9244 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9245 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9247 # @ref tui_modify_location "Example"
9248 @ManageTransactions("TrsfOp")
9249 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9251 Modify the Location of the given object by Path.
9254 theObject The object to be displaced.
9255 thePath Wire or Edge along that the object will be translated.
9256 theDistance progress of Path (0 = start location, 1 = end of path location).
9257 theCopy is to create a copy objects if true.
9258 theReverse 0 - for usual direction, 1 - to reverse path direction.
9261 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9262 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9265 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9267 # Example: see GEOM_TestAll.py
9268 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9269 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9272 ## Modify the Location of the given object by Path, creating its copy before the operation.
9273 # @param theObject The object to be displaced.
9274 # @param thePath Wire or Edge along that the object will be translated.
9275 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9276 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9277 # @param theName Object name; when specified, this parameter is used
9278 # for result publication in the study. Otherwise, if automatic
9279 # publication is switched on, default value is used for result name.
9281 # @return New GEOM.GEOM_Object, containing the displaced shape.
9282 @ManageTransactions("TrsfOp")
9283 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9285 Modify the Location of the given object by Path, creating its copy before the operation.
9288 theObject The object to be displaced.
9289 thePath Wire or Edge along that the object will be translated.
9290 theDistance progress of Path (0 = start location, 1 = end of path location).
9291 theReverse 0 - for usual direction, 1 - to reverse path direction.
9292 theName Object name; when specified, this parameter is used
9293 for result publication in the study. Otherwise, if automatic
9294 publication is switched on, default value is used for result name.
9297 New GEOM.GEOM_Object, containing the displaced shape.
9299 # Example: see GEOM_TestAll.py
9300 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9301 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9302 self._autoPublish(anObj, theName, "displaced")
9305 ## Offset given shape.
9306 # @param theObject The base object for the offset.
9307 # @param theOffset Offset value.
9308 # @param theCopy Flag used to offset object itself or create a copy.
9309 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9310 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9311 @ManageTransactions("TrsfOp")
9312 def Offset(self, theObject, theOffset, theCopy=False):
9317 theObject The base object for the offset.
9318 theOffset Offset value.
9319 theCopy Flag used to offset object itself or create a copy.
9322 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9323 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9325 theOffset, Parameters = ParseParameters(theOffset)
9327 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9329 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9330 RaiseIfFailed("Offset", self.TrsfOp)
9331 anObj.SetParameters(Parameters)
9334 ## Create new object as offset of the given one. Gap between two adjacent
9335 # offset surfaces is filled by a pipe.
9336 # @param theObject The base object for the offset.
9337 # @param theOffset Offset value.
9338 # @param theName Object name; when specified, this parameter is used
9339 # for result publication in the study. Otherwise, if automatic
9340 # publication is switched on, default value is used for result name.
9342 # @return New GEOM.GEOM_Object, containing the offset object.
9344 # @sa MakeOffsetIntersectionJoin
9345 # @ref tui_offset "Example"
9346 @ManageTransactions("TrsfOp")
9347 def MakeOffset(self, theObject, theOffset, theName=None):
9349 Create new object as offset of the given one. Gap between adjacent
9350 offset surfaces is filled by a pipe.
9353 theObject The base object for the offset.
9354 theOffset Offset value.
9355 theName Object name; when specified, this parameter is used
9356 for result publication in the study. Otherwise, if automatic
9357 publication is switched on, default value is used for result name.
9360 New GEOM.GEOM_Object, containing the offset object.
9363 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9364 # create a new object as offset of the given object
9365 offset = geompy.MakeOffset(box, 70.)
9367 # Example: see GEOM_TestAll.py
9368 theOffset, Parameters = ParseParameters(theOffset)
9369 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9370 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9371 anObj.SetParameters(Parameters)
9372 self._autoPublish(anObj, theName, "offset")
9375 ## Create new object as offset of the given one. Gap between adjacent
9376 # offset surfaces is filled by extending and intersecting them.
9377 # @param theObject The base object for the offset.
9378 # @param theOffset Offset value.
9379 # @param theName Object name; when specified, this parameter is used
9380 # for result publication in the study. Otherwise, if automatic
9381 # publication is switched on, default value is used for result name.
9383 # @return New GEOM.GEOM_Object, containing the offset object.
9386 # @ref tui_offset "Example"
9387 @ManageTransactions("TrsfOp")
9388 def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9390 Create new object as offset of the given one. Gap between adjacent
9391 offset surfaces is filled by extending and intersecting them.
9394 theObject The base object for the offset.
9395 theOffset Offset value.
9396 theName Object name; when specified, this parameter is used
9397 for result publication in the study. Otherwise, if automatic
9398 publication is switched on, default value is used for result name.
9401 New GEOM.GEOM_Object, containing the offset object.
9404 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9405 # create a new box extended by 70
9406 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9408 # Example: see GEOM_TestAll.py
9409 theOffset, Parameters = ParseParameters( theOffset )
9410 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9411 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9412 anObj.SetParameters(Parameters)
9413 self._autoPublish(anObj, theName, "offset")
9416 ## Create new object as projection of the given one on another.
9417 # @param theSource The source object for the projection. It can be a point, edge or wire.
9418 # Edge and wire are acceptable if @a theTarget is a face.
9419 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9420 # @param theName Object name; when specified, this parameter is used
9421 # for result publication in the study. Otherwise, if automatic
9422 # publication is switched on, default value is used for result name.
9424 # @return New GEOM.GEOM_Object, containing the projection.
9426 # @ref tui_projection "Example"
9427 @ManageTransactions("TrsfOp")
9428 def MakeProjection(self, theSource, theTarget, theName=None):
9430 Create new object as projection of the given one on another.
9433 theSource The source object for the projection. It can be a point, edge or wire.
9434 Edge and wire are acceptable if theTarget is a face.
9435 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9436 theName Object name; when specified, this parameter is used
9437 for result publication in the study. Otherwise, if automatic
9438 publication is switched on, default value is used for result name.
9441 New GEOM.GEOM_Object, containing the projection.
9443 # Example: see GEOM_TestAll.py
9444 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9445 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9446 self._autoPublish(anObj, theName, "projection")
9449 ## Create a projection of the given point on a wire or an edge.
9450 # If there are no solutions or there are 2 or more solutions It throws an
9452 # @param thePoint the point to be projected.
9453 # @param theWire the wire. The edge is accepted as well.
9454 # @param theName Object name; when specified, this parameter is used
9455 # for result publication in the study. Otherwise, if automatic
9456 # publication is switched on, default value is used for result name.
9458 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9459 # \n \a u: The parameter of projection point on edge.
9460 # \n \a PointOnEdge: The projection point.
9461 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9463 # @ref tui_projection "Example"
9464 @ManageTransactions("TrsfOp")
9465 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9467 Create a projection of the given point on a wire or an edge.
9468 If there are no solutions or there are 2 or more solutions It throws an
9472 thePoint the point to be projected.
9473 theWire the wire. The edge is accepted as well.
9474 theName Object name; when specified, this parameter is used
9475 for result publication in the study. Otherwise, if automatic
9476 publication is switched on, default value is used for result name.
9479 [u, PointOnEdge, EdgeInWireIndex]
9480 u: The parameter of projection point on edge.
9481 PointOnEdge: The projection point.
9482 EdgeInWireIndex: The index of an edge in a wire.
9484 # Example: see GEOM_TestAll.py
9485 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9486 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9487 self._autoPublish(anObj[1], theName, "projection")
9490 # -----------------------------------------------------------------------------
9492 # -----------------------------------------------------------------------------
9494 ## Translate the given object along the given vector a given number times
9495 # @param theObject The object to be translated.
9496 # @param theVector Direction of the translation. DX if None.
9497 # @param theStep Distance to translate on.
9498 # @param theNbTimes Quantity of translations to be done.
9499 # @param theName Object name; when specified, this parameter is used
9500 # for result publication in the study. Otherwise, if automatic
9501 # publication is switched on, default value is used for result name.
9503 # @return New GEOM.GEOM_Object, containing compound of all
9504 # the shapes, obtained after each translation.
9506 # @ref tui_multi_translation "Example"
9507 @ManageTransactions("TrsfOp")
9508 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9510 Translate the given object along the given vector a given number times
9513 theObject The object to be translated.
9514 theVector Direction of the translation. DX if None.
9515 theStep Distance to translate on.
9516 theNbTimes Quantity of translations to be done.
9517 theName Object name; when specified, this parameter is used
9518 for result publication in the study. Otherwise, if automatic
9519 publication is switched on, default value is used for result name.
9522 New GEOM.GEOM_Object, containing compound of all
9523 the shapes, obtained after each translation.
9526 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9528 # Example: see GEOM_TestAll.py
9529 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9530 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9531 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9532 anObj.SetParameters(Parameters)
9533 self._autoPublish(anObj, theName, "multitranslation")
9536 ## Conseqently apply two specified translations to theObject specified number of times.
9537 # @param theObject The object to be translated.
9538 # @param theVector1 Direction of the first translation. DX if None.
9539 # @param theStep1 Step of the first translation.
9540 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9541 # @param theVector2 Direction of the second translation. DY if None.
9542 # @param theStep2 Step of the second translation.
9543 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9544 # @param theName Object name; when specified, this parameter is used
9545 # for result publication in the study. Otherwise, if automatic
9546 # publication is switched on, default value is used for result name.
9548 # @return New GEOM.GEOM_Object, containing compound of all
9549 # the shapes, obtained after each translation.
9551 # @ref tui_multi_translation "Example"
9552 @ManageTransactions("TrsfOp")
9553 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9554 theVector2, theStep2, theNbTimes2, theName=None):
9556 Conseqently apply two specified translations to theObject specified number of times.
9559 theObject The object to be translated.
9560 theVector1 Direction of the first translation. DX if None.
9561 theStep1 Step of the first translation.
9562 theNbTimes1 Quantity of translations to be done along theVector1.
9563 theVector2 Direction of the second translation. DY if None.
9564 theStep2 Step of the second translation.
9565 theNbTimes2 Quantity of translations to be done along theVector2.
9566 theName Object name; when specified, this parameter is used
9567 for result publication in the study. Otherwise, if automatic
9568 publication is switched on, default value is used for result name.
9571 New GEOM.GEOM_Object, containing compound of all
9572 the shapes, obtained after each translation.
9575 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9577 # Example: see GEOM_TestAll.py
9578 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9579 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9580 theVector2, theStep2, theNbTimes2)
9581 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9582 anObj.SetParameters(Parameters)
9583 self._autoPublish(anObj, theName, "multitranslation")
9586 ## Rotate the given object around the given axis a given number times.
9587 # Rotation angle will be 2*PI/theNbTimes.
9588 # @param theObject The object to be rotated.
9589 # @param theAxis The rotation axis. DZ if None.
9590 # @param theNbTimes Quantity of rotations to be done.
9591 # @param 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.
9595 # @return New GEOM.GEOM_Object, containing compound of all the
9596 # shapes, obtained after each rotation.
9598 # @ref tui_multi_rotation "Example"
9599 @ManageTransactions("TrsfOp")
9600 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9602 Rotate the given object around the given axis a given number times.
9603 Rotation angle will be 2*PI/theNbTimes.
9606 theObject The object to be rotated.
9607 theAxis The rotation axis. DZ if None.
9608 theNbTimes Quantity of rotations to be done.
9609 theName Object name; when specified, this parameter is used
9610 for result publication in the study. Otherwise, if automatic
9611 publication is switched on, default value is used for result name.
9614 New GEOM.GEOM_Object, containing compound of all the
9615 shapes, obtained after each rotation.
9618 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9620 # Example: see GEOM_TestAll.py
9621 theNbTimes, Parameters = ParseParameters(theNbTimes)
9622 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9623 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9624 anObj.SetParameters(Parameters)
9625 self._autoPublish(anObj, theName, "multirotation")
9628 ## Rotate the given object around the given axis
9629 # a given number times on the given angle.
9630 # @param theObject The object to be rotated.
9631 # @param theAxis The rotation axis. DZ if None.
9632 # @param theAngleStep Rotation angle in radians.
9633 # @param theNbTimes Quantity of rotations to be done.
9634 # @param theName Object name; when specified, this parameter is used
9635 # for result publication in the study. Otherwise, if automatic
9636 # publication is switched on, default value is used for result name.
9638 # @return New GEOM.GEOM_Object, containing compound of all the
9639 # shapes, obtained after each rotation.
9641 # @ref tui_multi_rotation "Example"
9642 @ManageTransactions("TrsfOp")
9643 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9645 Rotate the given object around the given axis
9646 a given number times on the given angle.
9649 theObject The object to be rotated.
9650 theAxis The rotation axis. DZ if None.
9651 theAngleStep Rotation angle in radians.
9652 theNbTimes Quantity of rotations to be done.
9653 theName Object name; when specified, this parameter is used
9654 for result publication in the study. Otherwise, if automatic
9655 publication is switched on, default value is used for result name.
9658 New GEOM.GEOM_Object, containing compound of all the
9659 shapes, obtained after each rotation.
9662 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9664 # Example: see GEOM_TestAll.py
9665 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9666 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9667 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9668 anObj.SetParameters(Parameters)
9669 self._autoPublish(anObj, theName, "multirotation")
9672 ## Rotate the given object around the given axis a given
9673 # number times and multi-translate each rotation result.
9674 # Rotation angle will be 2*PI/theNbTimes1.
9675 # Translation direction passes through center of gravity
9676 # of rotated shape and its projection on the rotation axis.
9677 # @param theObject The object to be rotated.
9678 # @param theAxis Rotation axis. DZ if None.
9679 # @param theNbTimes1 Quantity of rotations to be done.
9680 # @param theRadialStep Translation distance.
9681 # @param theNbTimes2 Quantity of translations to be done.
9682 # @param theName Object name; when specified, this parameter is used
9683 # for result publication in the study. Otherwise, if automatic
9684 # publication is switched on, default value is used for result name.
9686 # @return New GEOM.GEOM_Object, containing compound of all the
9687 # shapes, obtained after each transformation.
9689 # @ref tui_multi_rotation "Example"
9690 @ManageTransactions("TrsfOp")
9691 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9693 Rotate the given object around the
9694 given axis on the given angle a given number
9695 times and multi-translate each rotation result.
9696 Translation direction passes through center of gravity
9697 of rotated shape and its projection on the rotation axis.
9700 theObject The object to be rotated.
9701 theAxis Rotation axis. DZ if None.
9702 theNbTimes1 Quantity of rotations to be done.
9703 theRadialStep Translation distance.
9704 theNbTimes2 Quantity of translations to be done.
9705 theName Object name; when specified, this parameter is used
9706 for result publication in the study. Otherwise, if automatic
9707 publication is switched on, default value is used for result name.
9710 New GEOM.GEOM_Object, containing compound of all the
9711 shapes, obtained after each transformation.
9714 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9716 # Example: see GEOM_TestAll.py
9717 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9718 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9719 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9720 anObj.SetParameters(Parameters)
9721 self._autoPublish(anObj, theName, "multirotation")
9724 ## Rotate the given object around the
9725 # given axis on the given angle a given number
9726 # times and multi-translate each rotation result.
9727 # Translation direction passes through center of gravity
9728 # of rotated shape and its projection on the rotation axis.
9729 # @param theObject The object to be rotated.
9730 # @param theAxis Rotation axis. DZ if None.
9731 # @param theAngleStep Rotation angle in radians.
9732 # @param theNbTimes1 Quantity of rotations to be done.
9733 # @param theRadialStep Translation distance.
9734 # @param theNbTimes2 Quantity of translations to be done.
9735 # @param theName Object name; when specified, this parameter is used
9736 # for result publication in the study. Otherwise, if automatic
9737 # publication is switched on, default value is used for result name.
9739 # @return New GEOM.GEOM_Object, containing compound of all the
9740 # shapes, obtained after each transformation.
9742 # @ref tui_multi_rotation "Example"
9743 @ManageTransactions("TrsfOp")
9744 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9746 Rotate the given object around the
9747 given axis on the given angle a given number
9748 times and multi-translate each rotation result.
9749 Translation direction passes through center of gravity
9750 of rotated shape and its projection on the rotation axis.
9753 theObject The object to be rotated.
9754 theAxis Rotation axis. DZ if None.
9755 theAngleStep Rotation angle in radians.
9756 theNbTimes1 Quantity of rotations to be done.
9757 theRadialStep Translation distance.
9758 theNbTimes2 Quantity of translations to be done.
9759 theName Object name; when specified, this parameter is used
9760 for result publication in the study. Otherwise, if automatic
9761 publication is switched on, default value is used for result name.
9764 New GEOM.GEOM_Object, containing compound of all the
9765 shapes, obtained after each transformation.
9768 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9770 # Example: see GEOM_TestAll.py
9771 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9772 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9773 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9774 anObj.SetParameters(Parameters)
9775 self._autoPublish(anObj, theName, "multirotation")
9778 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9780 # @ref swig_MakeMultiRotation "Example"
9781 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9783 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9786 pz = geompy.MakeVertex(0, 0, 100)
9787 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9788 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9790 # Example: see GEOM_TestOthers.py
9791 aVec = self.MakeLine(aPoint,aDir)
9792 # note: auto-publishing is done in self.MultiRotate1D()
9793 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9796 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9798 # @ref swig_MakeMultiRotation "Example"
9799 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9801 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9804 pz = geompy.MakeVertex(0, 0, 100)
9805 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9806 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9808 # Example: see GEOM_TestOthers.py
9809 aVec = self.MakeLine(aPoint,aDir)
9810 # note: auto-publishing is done in self.MultiRotate1D()
9811 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9814 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9816 # @ref swig_MakeMultiRotation "Example"
9817 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9819 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9822 pz = geompy.MakeVertex(0, 0, 100)
9823 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9824 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9826 # Example: see GEOM_TestOthers.py
9827 aVec = self.MakeLine(aPoint,aDir)
9828 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9829 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9832 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9834 # @ref swig_MakeMultiRotation "Example"
9835 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9837 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9840 pz = geompy.MakeVertex(0, 0, 100)
9841 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9842 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9844 # Example: see GEOM_TestOthers.py
9845 aVec = self.MakeLine(aPoint,aDir)
9846 # note: auto-publishing is done in self.MultiRotate2D()
9847 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9851 # Compute a wire or a face that represents a projection of the source
9852 # shape onto cylinder. The cylinder's coordinate system is the same
9853 # as the global coordinate system.
9855 # @param theObject The object to be projected. It can be either
9856 # a planar wire or a face.
9857 # @param theRadius The radius of the cylinder.
9858 # @param theStartAngle The starting angle in radians from
9859 # the cylinder's X axis around Z axis. The angle from which
9860 # the projection is started.
9861 # @param theAngleLength The projection length angle in radians.
9862 # The angle in which to project the total length of the wire.
9863 # If it is negative the projection is not scaled and natural
9864 # wire length is kept for the projection.
9865 # @param theAngleRotation The desired angle in radians between
9866 # the tangent vector to the first curve at the first point of
9867 # the theObject's projection in 2D space and U-direction of
9868 # cylinder's 2D space.
9869 # @param theName Object name; when specified, this parameter is used
9870 # for result publication in the study. Otherwise, if automatic
9871 # publication is switched on, default value is used for result name.
9873 # @return New GEOM.GEOM_Object, containing the result shape. The result
9874 # represents a wire or a face that represents a projection of
9875 # the source shape onto a cylinder.
9877 # @ref tui_projection "Example"
9878 def MakeProjectionOnCylinder (self, theObject, theRadius,
9879 theStartAngle=0.0, theAngleLength=-1.0,
9880 theAngleRotation=0.0,
9883 Compute a wire or a face that represents a projection of the source
9884 shape onto cylinder. The cylinder's coordinate system is the same
9885 as the global coordinate system.
9888 theObject The object to be projected. It can be either
9889 a planar wire or a face.
9890 theRadius The radius of the cylinder.
9891 theStartAngle The starting angle in radians from the cylinder's X axis
9892 around Z axis. The angle from which the projection is started.
9893 theAngleLength The projection length angle in radians. The angle in which
9894 to project the total length of the wire. If it is negative the
9895 projection is not scaled and natural wire length is kept for
9897 theAngleRotation The desired angle in radians between
9898 the tangent vector to the first curve at the first
9899 point of the theObject's projection in 2D space and
9900 U-direction of cylinder's 2D space.
9901 theName Object name; when specified, this parameter is used
9902 for result publication in the study. Otherwise, if automatic
9903 publication is switched on, default value is used for result name.
9906 New GEOM.GEOM_Object, containing the result shape. The result
9907 represents a wire or a face that represents a projection of
9908 the source shape onto a cylinder.
9910 # Example: see GEOM_TestAll.py
9911 flagStartAngle = False
9912 if isinstance(theStartAngle,str):
9913 flagStartAngle = True
9914 flagAngleLength = False
9915 if isinstance(theAngleLength,str):
9916 flagAngleLength = True
9917 flagAngleRotation = False
9918 if isinstance(theAngleRotation,str):
9919 flagAngleRotation = True
9920 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9921 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9923 theStartAngle = theStartAngle*math.pi/180.
9925 theAngleLength = theAngleLength*math.pi/180.
9926 if flagAngleRotation:
9927 theAngleRotation = theAngleRotation*math.pi/180.
9928 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9929 theStartAngle, theAngleLength, theAngleRotation)
9930 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9931 anObj.SetParameters(Parameters)
9932 self._autoPublish(anObj, theName, "projection")
9935 # end of l3_transform
9938 ## @addtogroup l3_transform_d
9941 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9942 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9944 Deprecated method. Use MultiRotate1DNbTimes instead.
9946 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9947 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9949 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9950 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9951 @ManageTransactions("TrsfOp")
9952 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9954 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9955 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9958 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9960 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9961 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9962 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9963 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9964 anObj.SetParameters(Parameters)
9965 self._autoPublish(anObj, theName, "multirotation")
9968 ## The same, as MultiRotate1D(), but axis is given by direction and point
9969 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9970 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9972 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9973 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9976 pz = geompy.MakeVertex(0, 0, 100)
9977 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9978 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9980 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9981 aVec = self.MakeLine(aPoint,aDir)
9982 # note: auto-publishing is done in self.MultiRotate1D()
9983 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9986 ## The same, as MultiRotate2D(), but axis is given by direction and point
9987 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9988 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9990 The same, as MultiRotate2D(), but axis is given by direction and point
9991 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9994 pz = geompy.MakeVertex(0, 0, 100)
9995 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9996 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
9998 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
9999 aVec = self.MakeLine(aPoint,aDir)
10000 # note: auto-publishing is done in self.MultiRotate2D()
10001 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10004 # end of l3_transform_d
10007 ## @addtogroup l3_local
10010 ## Perform a fillet on all edges of the given shape.
10011 # @param theShape Shape, to perform fillet on.
10012 # @param theR Fillet radius.
10013 # @param theName Object name; when specified, this parameter is used
10014 # for result publication in the study. Otherwise, if automatic
10015 # publication is switched on, default value is used for result name.
10017 # @return New GEOM.GEOM_Object, containing the result shape.
10019 # @ref tui_fillet "Example 1"
10020 # \n @ref swig_MakeFilletAll "Example 2"
10021 @ManageTransactions("LocalOp")
10022 def MakeFilletAll(self, theShape, theR, theName=None):
10024 Perform a fillet on all edges of the given shape.
10027 theShape Shape, to perform fillet on.
10028 theR Fillet radius.
10029 theName Object name; when specified, this parameter is used
10030 for result publication in the study. Otherwise, if automatic
10031 publication is switched on, default value is used for result name.
10034 New GEOM.GEOM_Object, containing the result shape.
10037 filletall = geompy.MakeFilletAll(prism, 10.)
10039 # Example: see GEOM_TestOthers.py
10040 theR,Parameters = ParseParameters(theR)
10041 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10042 RaiseIfFailed("MakeFilletAll", self.LocalOp)
10043 anObj.SetParameters(Parameters)
10044 self._autoPublish(anObj, theName, "fillet")
10047 ## Perform a fillet on the specified edges/faces of the given shape
10048 # @param theShape Shape, to perform fillet on.
10049 # @param theR Fillet radius.
10050 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10051 # @param theListShapes Global indices of edges/faces to perform fillet on.
10052 # @param theName Object name; when specified, this parameter is used
10053 # for result publication in the study. Otherwise, if automatic
10054 # publication is switched on, default value is used for result name.
10056 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10058 # @return New GEOM.GEOM_Object, containing the result shape.
10060 # @ref tui_fillet "Example"
10061 @ManageTransactions("LocalOp")
10062 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10064 Perform a fillet on the specified edges/faces of the given shape
10067 theShape Shape, to perform fillet on.
10068 theR Fillet radius.
10069 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10070 theListShapes Global indices of edges/faces to perform fillet on.
10071 theName Object name; when specified, this parameter is used
10072 for result publication in the study. Otherwise, if automatic
10073 publication is switched on, default value is used for result name.
10076 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10079 New GEOM.GEOM_Object, containing the result shape.
10082 # get the list of IDs (IDList) for the fillet
10083 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10085 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10086 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10087 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10088 # make a fillet on the specified edges of the given shape
10089 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10091 # Example: see GEOM_TestAll.py
10092 theR,Parameters = ParseParameters(theR)
10094 if theShapeType == self.ShapeType["EDGE"]:
10095 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10096 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10098 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10099 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10100 anObj.SetParameters(Parameters)
10101 self._autoPublish(anObj, theName, "fillet")
10104 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10105 @ManageTransactions("LocalOp")
10106 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10108 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10111 # get the list of IDs (IDList) for the fillet
10112 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10114 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10115 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10116 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10117 # make a fillet on the specified edges of the given shape
10118 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10120 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10122 if theShapeType == self.ShapeType["EDGE"]:
10123 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10124 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10126 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10127 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10128 anObj.SetParameters(Parameters)
10129 self._autoPublish(anObj, theName, "fillet")
10132 ## Perform a fillet on the specified edges of the given shape
10133 # @param theShape Wire Shape to perform fillet on.
10134 # @param theR Fillet radius.
10135 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10136 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10137 # \note The list of vertices could be empty,
10138 # in this case fillet will done done at all vertices in wire
10139 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10140 # by the length of the edges, nearest to the fillet vertex.
10141 # But sometimes the next edge is C1 continuous with the one, nearest to
10142 # the fillet point, and such two (or more) edges can be united to allow
10143 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10144 # thus ignoring the secant vertex (vertices).
10145 # @param theName Object name; when specified, this parameter is used
10146 # for result publication in the study. Otherwise, if automatic
10147 # publication is switched on, default value is used for result name.
10149 # @return New GEOM.GEOM_Object, containing the result shape.
10151 # @ref tui_fillet2d "Example"
10152 @ManageTransactions("LocalOp")
10153 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10155 Perform a fillet on the specified edges of the given shape
10158 theShape Wire Shape to perform fillet on.
10159 theR Fillet radius.
10160 theListOfVertexes Global indices of vertexes to perform fillet on.
10161 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10162 by the length of the edges, nearest to the fillet vertex.
10163 But sometimes the next edge is C1 continuous with the one, nearest to
10164 the fillet point, and such two (or more) edges can be united to allow
10165 bigger radius. Set this flag to TRUE to allow collinear edges union,
10166 thus ignoring the secant vertex (vertices).
10167 theName Object name; when specified, this parameter is used
10168 for result publication in the study. Otherwise, if automatic
10169 publication is switched on, default value is used for result name.
10171 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10173 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10176 New GEOM.GEOM_Object, containing the result shape.
10180 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10181 # make fillet at given wire vertices with giver radius
10182 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10184 # Example: see GEOM_TestAll.py
10185 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10186 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10187 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10188 anObj.SetParameters(Parameters)
10189 self._autoPublish(anObj, theName, "fillet")
10192 ## Perform a fillet at the specified vertices of the given face/shell.
10193 # @param theShape Face or Shell shape to perform fillet on.
10194 # @param theR Fillet radius.
10195 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10196 # @param theName Object name; when specified, this parameter is used
10197 # for result publication in the study. Otherwise, if automatic
10198 # publication is switched on, default value is used for result name.
10200 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10202 # @return New GEOM.GEOM_Object, containing the result shape.
10204 # @ref tui_fillet2d "Example"
10205 @ManageTransactions("LocalOp")
10206 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10208 Perform a fillet at the specified vertices of the given face/shell.
10211 theShape Face or Shell shape to perform fillet on.
10212 theR Fillet radius.
10213 theListOfVertexes Global indices of vertexes to perform fillet on.
10214 theName Object name; when specified, this parameter is used
10215 for result publication in the study. Otherwise, if automatic
10216 publication is switched on, default value is used for result name.
10218 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10221 New GEOM.GEOM_Object, containing the result shape.
10224 face = geompy.MakeFaceHW(100, 100, 1)
10225 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10227 # Example: see GEOM_TestAll.py
10228 theR,Parameters = ParseParameters(theR)
10229 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10230 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10231 anObj.SetParameters(Parameters)
10232 self._autoPublish(anObj, theName, "fillet")
10235 ## Perform a symmetric chamfer on all edges of the given shape.
10236 # @param theShape Shape, to perform chamfer on.
10237 # @param theD Chamfer size along each face.
10238 # @param theName Object name; when specified, this parameter is used
10239 # for result publication in the study. Otherwise, if automatic
10240 # publication is switched on, default value is used for result name.
10242 # @return New GEOM.GEOM_Object, containing the result shape.
10244 # @ref tui_chamfer "Example 1"
10245 # \n @ref swig_MakeChamferAll "Example 2"
10246 @ManageTransactions("LocalOp")
10247 def MakeChamferAll(self, theShape, theD, theName=None):
10249 Perform a symmetric chamfer on all edges of the given shape.
10252 theShape Shape, to perform chamfer on.
10253 theD Chamfer size along each face.
10254 theName Object name; when specified, this parameter is used
10255 for result publication in the study. Otherwise, if automatic
10256 publication is switched on, default value is used for result name.
10259 New GEOM.GEOM_Object, containing the result shape.
10262 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10264 # Example: see GEOM_TestOthers.py
10265 theD,Parameters = ParseParameters(theD)
10266 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10267 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10268 anObj.SetParameters(Parameters)
10269 self._autoPublish(anObj, theName, "chamfer")
10272 ## Perform a chamfer on edges, common to the specified faces,
10273 # with distance D1 on the Face1
10274 # @param theShape Shape, to perform chamfer on.
10275 # @param theD1 Chamfer size along \a theFace1.
10276 # @param theD2 Chamfer size along \a theFace2.
10277 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10278 # @param theName Object name; when specified, this parameter is used
10279 # for result publication in the study. Otherwise, if automatic
10280 # publication is switched on, default value is used for result name.
10282 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10284 # @return New GEOM.GEOM_Object, containing the result shape.
10286 # @ref tui_chamfer "Example"
10287 @ManageTransactions("LocalOp")
10288 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10290 Perform a chamfer on edges, common to the specified faces,
10291 with distance D1 on the Face1
10294 theShape Shape, to perform chamfer on.
10295 theD1 Chamfer size along theFace1.
10296 theD2 Chamfer size along theFace2.
10297 theFace1,theFace2 Global indices of two faces of theShape.
10298 theName Object name; when specified, this parameter is used
10299 for result publication in the study. Otherwise, if automatic
10300 publication is switched on, default value is used for result name.
10303 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10306 New GEOM.GEOM_Object, containing the result shape.
10309 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10310 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10311 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10312 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10314 # Example: see GEOM_TestAll.py
10315 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10316 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10317 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10318 anObj.SetParameters(Parameters)
10319 self._autoPublish(anObj, theName, "chamfer")
10322 ## Perform a chamfer on edges
10323 # @param theShape Shape, to perform chamfer on.
10324 # @param theD Chamfer length
10325 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10326 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10327 # @param theName Object name; when specified, this parameter is used
10328 # for result publication in the study. Otherwise, if automatic
10329 # publication is switched on, default value is used for result name.
10331 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10333 # @return New GEOM.GEOM_Object, containing the result shape.
10334 @ManageTransactions("LocalOp")
10335 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10337 Perform a chamfer on edges
10340 theShape Shape, to perform chamfer on.
10341 theD1 Chamfer size along theFace1.
10342 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10343 theFace1,theFace2 Global indices of two faces of theShape.
10344 theName Object name; when specified, this parameter is used
10345 for result publication in the study. Otherwise, if automatic
10346 publication is switched on, default value is used for result name.
10349 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10352 New GEOM.GEOM_Object, containing the result shape.
10355 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10356 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10357 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10359 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10362 if isinstance(theAngle,str):
10364 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10366 theAngle = theAngle*math.pi/180.0
10367 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10368 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10369 anObj.SetParameters(Parameters)
10370 self._autoPublish(anObj, theName, "chamfer")
10373 ## Perform a chamfer on all edges of the specified faces,
10374 # with distance D1 on the first specified face (if several for one edge)
10375 # @param theShape Shape, to perform chamfer on.
10376 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10377 # connected to the edge, are in \a theFaces, \a theD1
10378 # will be get along face, which is nearer to \a theFaces beginning.
10379 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10380 # @param theFaces Sequence of global indices of faces of \a theShape.
10381 # @param theName Object name; when specified, this parameter is used
10382 # for result publication in the study. Otherwise, if automatic
10383 # publication is switched on, default value is used for result name.
10385 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10387 # @return New GEOM.GEOM_Object, containing the result shape.
10389 # @ref tui_chamfer "Example"
10390 @ManageTransactions("LocalOp")
10391 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10393 Perform a chamfer on all edges of the specified faces,
10394 with distance D1 on the first specified face (if several for one edge)
10397 theShape Shape, to perform chamfer on.
10398 theD1 Chamfer size along face from theFaces. If both faces,
10399 connected to the edge, are in theFaces, theD1
10400 will be get along face, which is nearer to theFaces beginning.
10401 theD2 Chamfer size along another of two faces, connected to the edge.
10402 theFaces Sequence of global indices of faces of theShape.
10403 theName Object name; when specified, this parameter is used
10404 for result publication in the study. Otherwise, if automatic
10405 publication is switched on, default value is used for result name.
10407 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10410 New GEOM.GEOM_Object, containing the result shape.
10412 # Example: see GEOM_TestAll.py
10413 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10414 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10415 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10416 anObj.SetParameters(Parameters)
10417 self._autoPublish(anObj, theName, "chamfer")
10420 ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10421 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10423 # @ref swig_FilletChamfer "Example"
10424 @ManageTransactions("LocalOp")
10425 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10427 The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10428 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10431 if isinstance(theAngle,str):
10433 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10435 theAngle = theAngle*math.pi/180.0
10436 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10437 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10438 anObj.SetParameters(Parameters)
10439 self._autoPublish(anObj, theName, "chamfer")
10442 ## Perform a chamfer on edges,
10443 # with distance D1 on the first specified face (if several for one edge)
10444 # @param theShape Shape, to perform chamfer on.
10445 # @param theD1,theD2 Chamfer size
10446 # @param theEdges Sequence of edges of \a theShape.
10447 # @param theName Object name; when specified, this parameter is used
10448 # for result publication in the study. Otherwise, if automatic
10449 # publication is switched on, default value is used for result name.
10451 # @return New GEOM.GEOM_Object, containing the result shape.
10453 # @ref swig_FilletChamfer "Example"
10454 @ManageTransactions("LocalOp")
10455 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10457 Perform a chamfer on edges,
10458 with distance D1 on the first specified face (if several for one edge)
10461 theShape Shape, to perform chamfer on.
10462 theD1,theD2 Chamfer size
10463 theEdges Sequence of edges of theShape.
10464 theName Object name; when specified, this parameter is used
10465 for result publication in the study. Otherwise, if automatic
10466 publication is switched on, default value is used for result name.
10469 New GEOM.GEOM_Object, containing the result shape.
10471 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10472 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10473 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10474 anObj.SetParameters(Parameters)
10475 self._autoPublish(anObj, theName, "chamfer")
10478 ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10479 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10480 @ManageTransactions("LocalOp")
10481 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10483 The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10484 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10487 if isinstance(theAngle,str):
10489 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10491 theAngle = theAngle*math.pi/180.0
10492 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10493 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10494 anObj.SetParameters(Parameters)
10495 self._autoPublish(anObj, theName, "chamfer")
10498 ## @sa MakeChamferEdge(), MakeChamferFaces()
10500 # @ref swig_MakeChamfer "Example"
10501 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10503 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10505 # Example: see GEOM_TestOthers.py
10507 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10508 if aShapeType == self.ShapeType["EDGE"]:
10509 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10511 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10514 ## Remove material from a solid by extrusion of the base shape on the given distance.
10515 # @param theInit Shape to remove material from. It must be a solid or
10516 # a compound made of a single solid.
10517 # @param theBase Closed edge or wire defining the base shape to be extruded.
10518 # @param theH Prism dimension along the normal to theBase
10519 # @param theAngle Draft angle in degrees.
10520 # @param theInvert If true material changes the direction
10521 # @param theName Object name; when specified, this parameter is used
10522 # for result publication in the study. Otherwise, if automatic
10523 # publication is switched on, default value is used for result name.
10525 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10527 # @ref tui_creation_prism "Example"
10528 @ManageTransactions("PrimOp")
10529 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10531 Add material to a solid by extrusion of the base shape on the given distance.
10534 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10535 theBase Closed edge or wire defining the base shape to be extruded.
10536 theH Prism dimension along the normal to theBase
10537 theAngle Draft angle in degrees.
10538 theInvert If true material changes the direction.
10539 theName Object name; when specified, this parameter is used
10540 for result publication in the study. Otherwise, if automatic
10541 publication is switched on, default value is used for result name.
10544 New GEOM.GEOM_Object, containing the initial shape with removed material.
10546 # Example: see GEOM_TestAll.py
10547 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10548 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10549 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10550 anObj.SetParameters(Parameters)
10551 self._autoPublish(anObj, theName, "extrudedCut")
10554 ## Add material to a solid by extrusion of the base shape on the given distance.
10555 # @param theInit Shape to add material to. It must be a solid or
10556 # a compound made of a single solid.
10557 # @param theBase Closed edge or wire defining the base shape to be extruded.
10558 # @param theH Prism dimension along the normal to theBase
10559 # @param theAngle Draft angle in degrees.
10560 # @param theInvert If true material changes the direction
10561 # @param theName Object name; when specified, this parameter is used
10562 # for result publication in the study. Otherwise, if automatic
10563 # publication is switched on, default value is used for result name.
10565 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10567 # @ref tui_creation_prism "Example"
10568 @ManageTransactions("PrimOp")
10569 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10571 Add material to a solid by extrusion of the base shape on the given distance.
10574 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10575 theBase Closed edge or wire defining the base shape to be extruded.
10576 theH Prism dimension along the normal to theBase
10577 theAngle Draft angle in degrees.
10578 theInvert If true material changes the direction.
10579 theName Object name; when specified, this parameter is used
10580 for result publication in the study. Otherwise, if automatic
10581 publication is switched on, default value is used for result name.
10584 New GEOM.GEOM_Object, containing the initial shape with added material.
10586 # Example: see GEOM_TestAll.py
10587 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10588 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10589 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10590 anObj.SetParameters(Parameters)
10591 self._autoPublish(anObj, theName, "extrudedBoss")
10597 ## @addtogroup l3_basic_op
10600 ## Perform an Archimde operation on the given shape with given parameters.
10601 # The object presenting the resulting face is returned.
10602 # @param theShape Shape to be put in water.
10603 # @param theWeight Weight of the shape.
10604 # @param theWaterDensity Density of the water.
10605 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10606 # @param theName Object name; when specified, this parameter is used
10607 # for result publication in the study. Otherwise, if automatic
10608 # publication is switched on, default value is used for result name.
10610 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10611 # by a plane, corresponding to water level.
10613 # @ref tui_archimede "Example"
10614 @ManageTransactions("LocalOp")
10615 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10617 Perform an Archimde operation on the given shape with given parameters.
10618 The object presenting the resulting face is returned.
10621 theShape Shape to be put in water.
10622 theWeight Weight of the shape.
10623 theWaterDensity Density of the water.
10624 theMeshDeflection Deflection of the mesh, using to compute the section.
10625 theName Object name; when specified, this parameter is used
10626 for result publication in the study. Otherwise, if automatic
10627 publication is switched on, default value is used for result name.
10630 New GEOM.GEOM_Object, containing a section of theShape
10631 by a plane, corresponding to water level.
10633 # Example: see GEOM_TestAll.py
10634 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10635 theWeight,theWaterDensity,theMeshDeflection)
10636 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10637 RaiseIfFailed("MakeArchimede", self.LocalOp)
10638 anObj.SetParameters(Parameters)
10639 self._autoPublish(anObj, theName, "archimede")
10642 # end of l3_basic_op
10645 ## @addtogroup l2_measure
10648 ## Get point coordinates
10649 # @return [x, y, z]
10651 # @ref tui_point_coordinates_page "Example"
10652 @ManageTransactions("MeasuOp")
10653 def PointCoordinates(self,Point):
10655 Get point coordinates
10660 # Example: see GEOM_TestMeasures.py
10661 aTuple = self.MeasuOp.PointCoordinates(Point)
10662 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10665 ## Get vector coordinates
10666 # @return [x, y, z]
10668 # @ref tui_measurement_tools_page "Example"
10669 def VectorCoordinates(self,Vector):
10671 Get vector coordinates
10677 p1=self.GetFirstVertex(Vector)
10678 p2=self.GetLastVertex(Vector)
10680 X1=self.PointCoordinates(p1)
10681 X2=self.PointCoordinates(p2)
10683 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10686 ## Compute cross product
10687 # @return vector w=u^v
10689 # @ref tui_measurement_tools_page "Example"
10690 def CrossProduct(self, Vector1, Vector2):
10692 Compute cross product
10694 Returns: vector w=u^v
10696 u=self.VectorCoordinates(Vector1)
10697 v=self.VectorCoordinates(Vector2)
10698 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])
10702 ## Compute cross product
10703 # @return dot product p=u.v
10705 # @ref tui_measurement_tools_page "Example"
10706 def DotProduct(self, Vector1, Vector2):
10708 Compute cross product
10710 Returns: dot product p=u.v
10712 u=self.VectorCoordinates(Vector1)
10713 v=self.VectorCoordinates(Vector2)
10714 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10719 ## Get summarized length of all wires,
10720 # area of surface and volume of the given shape.
10721 # @param theShape Shape to define properties of.
10722 # @param theTolerance maximal relative error of area
10723 # and volume computation.
10724 # @return [theLength, theSurfArea, theVolume]\n
10725 # theLength: Summarized length of all wires of the given shape.\n
10726 # theSurfArea: Area of surface of the given shape.\n
10727 # theVolume: Volume of the given shape.
10729 # @ref tui_basic_properties_page "Example"
10730 @ManageTransactions("MeasuOp")
10731 def BasicProperties(self,theShape, theTolerance=1.e-6):
10733 Get summarized length of all wires,
10734 area of surface and volume of the given shape.
10737 theShape Shape to define properties of.
10738 theTolerance maximal relative error of area
10739 and volume computation.
10742 [theLength, theSurfArea, theVolume]
10743 theLength: Summarized length of all wires of the given shape.
10744 theSurfArea: Area of surface of the given shape.
10745 theVolume: Volume of the given shape.
10747 # Example: see GEOM_TestMeasures.py
10748 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10749 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10752 ## Get parameters of bounding box of the given shape
10753 # @param theShape Shape to obtain bounding box of.
10754 # @param precise TRUE for precise computation; FALSE for fast one.
10755 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10756 # Xmin,Xmax: Limits of shape along OX axis.
10757 # Ymin,Ymax: Limits of shape along OY axis.
10758 # Zmin,Zmax: Limits of shape along OZ axis.
10760 # @ref tui_bounding_box_page "Example"
10761 @ManageTransactions("MeasuOp")
10762 def BoundingBox (self, theShape, precise=False):
10764 Get parameters of bounding box of the given shape
10767 theShape Shape to obtain bounding box of.
10768 precise TRUE for precise computation; FALSE for fast one.
10771 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10772 Xmin,Xmax: Limits of shape along OX axis.
10773 Ymin,Ymax: Limits of shape along OY axis.
10774 Zmin,Zmax: Limits of shape along OZ axis.
10776 # Example: see GEOM_TestMeasures.py
10777 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10778 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10781 ## Get bounding box of the given shape
10782 # @param theShape Shape to obtain bounding box of.
10783 # @param precise TRUE for precise computation; FALSE for fast one.
10784 # @param theName Object name; when specified, this parameter is used
10785 # for result publication in the study. Otherwise, if automatic
10786 # publication is switched on, default value is used for result name.
10788 # @return New GEOM.GEOM_Object, containing the created box.
10790 # @ref tui_bounding_box_page "Example"
10791 @ManageTransactions("MeasuOp")
10792 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10794 Get bounding box of the given shape
10797 theShape Shape to obtain bounding box of.
10798 precise TRUE for precise computation; FALSE for fast one.
10799 theName Object name; when specified, this parameter is used
10800 for result publication in the study. Otherwise, if automatic
10801 publication is switched on, default value is used for result name.
10804 New GEOM.GEOM_Object, containing the created box.
10806 # Example: see GEOM_TestMeasures.py
10807 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10808 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10809 self._autoPublish(anObj, theName, "bndbox")
10812 ## Get inertia matrix and moments of inertia of theShape.
10813 # @param theShape Shape to calculate inertia of.
10814 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10815 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10816 # Ix,Iy,Iz: Moments of inertia of the given shape.
10818 # @ref tui_inertia_page "Example"
10819 @ManageTransactions("MeasuOp")
10820 def Inertia(self,theShape):
10822 Get inertia matrix and moments of inertia of theShape.
10825 theShape Shape to calculate inertia of.
10828 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10829 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10830 Ix,Iy,Iz: Moments of inertia of the given shape.
10832 # Example: see GEOM_TestMeasures.py
10833 aTuple = self.MeasuOp.GetInertia(theShape)
10834 RaiseIfFailed("GetInertia", self.MeasuOp)
10837 ## Get if coords are included in the shape (ST_IN or ST_ON)
10838 # @param theShape Shape
10839 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10840 # @param tolerance to be used (default is 1.0e-7)
10841 # @return list_of_boolean = [res1, res2, ...]
10842 @ManageTransactions("MeasuOp")
10843 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10845 Get if coords are included in the shape (ST_IN or ST_ON)
10849 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10850 tolerance to be used (default is 1.0e-7)
10853 list_of_boolean = [res1, res2, ...]
10855 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10857 ## Get minimal distance between the given shapes.
10858 # @param theShape1,theShape2 Shapes to find minimal distance between.
10859 # @return Value of the minimal distance between the given shapes.
10861 # @ref tui_min_distance_page "Example"
10862 @ManageTransactions("MeasuOp")
10863 def MinDistance(self, theShape1, theShape2):
10865 Get minimal distance between the given shapes.
10868 theShape1,theShape2 Shapes to find minimal distance between.
10871 Value of the minimal distance between the given shapes.
10873 # Example: see GEOM_TestMeasures.py
10874 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10875 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10878 ## Get minimal distance between the given shapes.
10879 # @param theShape1,theShape2 Shapes to find minimal distance between.
10880 # @return Value of the minimal distance between the given shapes, in form of list
10881 # [Distance, DX, DY, DZ].
10883 # @ref tui_min_distance_page "Example"
10884 @ManageTransactions("MeasuOp")
10885 def MinDistanceComponents(self, theShape1, theShape2):
10887 Get minimal distance between the given shapes.
10890 theShape1,theShape2 Shapes to find minimal distance between.
10893 Value of the minimal distance between the given shapes, in form of list
10894 [Distance, DX, DY, DZ]
10896 # Example: see GEOM_TestMeasures.py
10897 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10898 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10899 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10902 ## Get closest points of the given shapes.
10903 # @param theShape1,theShape2 Shapes to find closest points of.
10904 # @return The number of found solutions (-1 in case of infinite number of
10905 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10907 # @ref tui_min_distance_page "Example"
10908 @ManageTransactions("MeasuOp")
10909 def ClosestPoints (self, theShape1, theShape2):
10911 Get closest points of the given shapes.
10914 theShape1,theShape2 Shapes to find closest points of.
10917 The number of found solutions (-1 in case of infinite number of
10918 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10920 # Example: see GEOM_TestMeasures.py
10921 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10922 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10925 ## Get angle between the given shapes in degrees.
10926 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10927 # @note If both arguments are vectors, the angle is computed in accordance
10928 # with their orientations, otherwise the minimum angle is computed.
10929 # @return Value of the angle between the given shapes in degrees.
10931 # @ref tui_angle_page "Example"
10932 @ManageTransactions("MeasuOp")
10933 def GetAngle(self, theShape1, theShape2):
10935 Get angle between the given shapes in degrees.
10938 theShape1,theShape2 Lines or linear edges to find angle between.
10941 If both arguments are vectors, the angle is computed in accordance
10942 with their orientations, otherwise the minimum angle is computed.
10945 Value of the angle between the given shapes in degrees.
10947 # Example: see GEOM_TestMeasures.py
10948 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10949 RaiseIfFailed("GetAngle", self.MeasuOp)
10952 ## Get angle between the given shapes in radians.
10953 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10954 # @note If both arguments are vectors, the angle is computed in accordance
10955 # with their orientations, otherwise the minimum angle is computed.
10956 # @return Value of the angle between the given shapes in radians.
10958 # @ref tui_angle_page "Example"
10959 @ManageTransactions("MeasuOp")
10960 def GetAngleRadians(self, theShape1, theShape2):
10962 Get angle between the given shapes in radians.
10965 theShape1,theShape2 Lines or linear edges to find angle between.
10969 If both arguments are vectors, the angle is computed in accordance
10970 with their orientations, otherwise the minimum angle is computed.
10973 Value of the angle between the given shapes in radians.
10975 # Example: see GEOM_TestMeasures.py
10976 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10977 RaiseIfFailed("GetAngle", self.MeasuOp)
10980 ## Get angle between the given vectors in degrees.
10981 # @param theShape1,theShape2 Vectors to find angle between.
10982 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10983 # if False, the opposite vector to the normal vector is used.
10984 # @return Value of the angle between the given vectors in degrees.
10986 # @ref tui_angle_page "Example"
10987 @ManageTransactions("MeasuOp")
10988 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10990 Get angle between the given vectors in degrees.
10993 theShape1,theShape2 Vectors to find angle between.
10994 theFlag If True, the normal vector is defined by the two vectors cross,
10995 if False, the opposite vector to the normal vector is used.
10998 Value of the angle between the given vectors in degrees.
11000 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11002 anAngle = 360. - anAngle
11003 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11006 ## The same as GetAngleVectors, but the result is in radians.
11007 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11009 Get angle between the given vectors in radians.
11012 theShape1,theShape2 Vectors to find angle between.
11013 theFlag If True, the normal vector is defined by the two vectors cross,
11014 if False, the opposite vector to the normal vector is used.
11017 Value of the angle between the given vectors in radians.
11019 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11022 ## @name Curve Curvature Measurement
11023 # Methods for receiving radius of curvature of curves
11024 # in the given point
11027 ## Measure curvature of a curve at a point, set by parameter.
11028 # @param theCurve a curve.
11029 # @param theParam parameter.
11030 # @return radius of curvature of \a theCurve.
11032 # @ref swig_todo "Example"
11033 @ManageTransactions("MeasuOp")
11034 def CurveCurvatureByParam(self, theCurve, theParam):
11036 Measure curvature of a curve at a point, set by parameter.
11040 theParam parameter.
11043 radius of curvature of theCurve.
11045 # Example: see GEOM_TestMeasures.py
11046 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11047 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11050 ## Measure curvature of a curve at a point.
11051 # @param theCurve a curve.
11052 # @param thePoint given point.
11053 # @return radius of curvature of \a theCurve.
11055 # @ref swig_todo "Example"
11056 @ManageTransactions("MeasuOp")
11057 def CurveCurvatureByPoint(self, theCurve, thePoint):
11059 Measure curvature of a curve at a point.
11063 thePoint given point.
11066 radius of curvature of theCurve.
11068 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11069 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11073 ## @name Surface Curvature Measurement
11074 # Methods for receiving max and min radius of curvature of surfaces
11075 # in the given point
11078 ## Measure max radius of curvature of surface.
11079 # @param theSurf the given surface.
11080 # @param theUParam Value of U-parameter on the referenced surface.
11081 # @param theVParam Value of V-parameter on the referenced surface.
11082 # @return max radius of curvature of theSurf.
11084 ## @ref swig_todo "Example"
11085 @ManageTransactions("MeasuOp")
11086 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11088 Measure max radius of curvature of surface.
11091 theSurf the given surface.
11092 theUParam Value of U-parameter on the referenced surface.
11093 theVParam Value of V-parameter on the referenced surface.
11096 max radius of curvature of theSurf.
11098 # Example: see GEOM_TestMeasures.py
11099 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11100 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11103 ## Measure max radius of curvature of surface in the given point
11104 # @param theSurf the given surface.
11105 # @param thePoint given point.
11106 # @return max radius of curvature of theSurf.
11108 ## @ref swig_todo "Example"
11109 @ManageTransactions("MeasuOp")
11110 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11112 Measure max radius of curvature of surface in the given point.
11115 theSurf the given surface.
11116 thePoint given point.
11119 max radius of curvature of theSurf.
11121 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11122 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11125 ## Measure min radius of curvature of surface.
11126 # @param theSurf the given surface.
11127 # @param theUParam Value of U-parameter on the referenced surface.
11128 # @param theVParam Value of V-parameter on the referenced surface.
11129 # @return min radius of curvature of theSurf.
11131 ## @ref swig_todo "Example"
11132 @ManageTransactions("MeasuOp")
11133 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11135 Measure min radius of curvature of surface.
11138 theSurf the given surface.
11139 theUParam Value of U-parameter on the referenced surface.
11140 theVParam Value of V-parameter on the referenced surface.
11143 Min radius of curvature of theSurf.
11145 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11146 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11149 ## Measure min radius of curvature of surface in the given point
11150 # @param theSurf the given surface.
11151 # @param thePoint given point.
11152 # @return min radius of curvature of theSurf.
11154 ## @ref swig_todo "Example"
11155 @ManageTransactions("MeasuOp")
11156 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11158 Measure min radius of curvature of surface in the given point.
11161 theSurf the given surface.
11162 thePoint given point.
11165 Min radius of curvature of theSurf.
11167 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11168 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11172 ## Get min and max tolerances of sub-shapes of theShape
11173 # @param theShape Shape, to get tolerances of.
11174 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11175 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11176 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11177 # VertMin,VertMax: Min and max tolerances of the vertices.
11179 # @ref tui_tolerance_page "Example"
11180 @ManageTransactions("MeasuOp")
11181 def Tolerance(self,theShape):
11183 Get min and max tolerances of sub-shapes of theShape
11186 theShape Shape, to get tolerances of.
11189 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11190 FaceMin,FaceMax: Min and max tolerances of the faces.
11191 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11192 VertMin,VertMax: Min and max tolerances of the vertices.
11194 # Example: see GEOM_TestMeasures.py
11195 aTuple = self.MeasuOp.GetTolerance(theShape)
11196 RaiseIfFailed("GetTolerance", self.MeasuOp)
11199 ## Obtain description of the given shape (number of sub-shapes of each type)
11200 # @param theShape Shape to be described.
11201 # @return Description of the given shape.
11203 # @ref tui_whatis_page "Example"
11204 @ManageTransactions("MeasuOp")
11205 def WhatIs(self,theShape):
11207 Obtain description of the given shape (number of sub-shapes of each type)
11210 theShape Shape to be described.
11213 Description of the given shape.
11215 # Example: see GEOM_TestMeasures.py
11216 aDescr = self.MeasuOp.WhatIs(theShape)
11217 RaiseIfFailed("WhatIs", self.MeasuOp)
11220 ## Obtain quantity of shapes of the given type in \a theShape.
11221 # If \a theShape is of type \a theType, it is also counted.
11222 # @param theShape Shape to be described.
11223 # @param theType the given ShapeType().
11224 # @return Quantity of shapes of type \a theType in \a theShape.
11226 # @ref tui_measurement_tools_page "Example"
11227 def NbShapes (self, theShape, theType):
11229 Obtain quantity of shapes of the given type in theShape.
11230 If theShape is of type theType, it is also counted.
11233 theShape Shape to be described.
11234 theType the given geompy.ShapeType
11237 Quantity of shapes of type theType in theShape.
11239 # Example: see GEOM_TestMeasures.py
11240 listSh = self.SubShapeAllIDs(theShape, theType)
11244 ## Obtain quantity of shapes of each type in \a theShape.
11245 # The \a theShape is also counted.
11246 # @param theShape Shape to be described.
11247 # @return Dictionary of ShapeType() with bound quantities of shapes.
11249 # @ref tui_measurement_tools_page "Example"
11250 def ShapeInfo (self, theShape):
11252 Obtain quantity of shapes of each type in theShape.
11253 The theShape is also counted.
11256 theShape Shape to be described.
11259 Dictionary of geompy.ShapeType with bound quantities of shapes.
11261 # Example: see GEOM_TestMeasures.py
11263 for typeSh in self.ShapeType:
11264 if typeSh in ( "AUTO", "SHAPE" ): continue
11265 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11271 def GetCreationInformation(self, theShape):
11273 infos = theShape.GetCreationInformation()
11276 opName = info.operationName
11277 if not opName: opName = "no info available"
11278 if res: res += "\n"
11279 res += "Operation: " + opName
11281 for parVal in info.params:
11282 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11285 ## Get a point, situated at the centre of mass of theShape.
11286 # @param theShape Shape to define centre of mass of.
11287 # @param theName Object name; when specified, this parameter is used
11288 # for result publication in the study. Otherwise, if automatic
11289 # publication is switched on, default value is used for result name.
11291 # @return New GEOM.GEOM_Object, containing the created point.
11293 # @ref tui_center_of_mass_page "Example"
11294 @ManageTransactions("MeasuOp")
11295 def MakeCDG(self, theShape, theName=None):
11297 Get a point, situated at the centre of mass of theShape.
11300 theShape Shape to define centre of mass of.
11301 theName Object name; when specified, this parameter is used
11302 for result publication in the study. Otherwise, if automatic
11303 publication is switched on, default value is used for result name.
11306 New GEOM.GEOM_Object, containing the created point.
11308 # Example: see GEOM_TestMeasures.py
11309 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11310 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11311 self._autoPublish(anObj, theName, "centerOfMass")
11314 ## Get a vertex sub-shape by index.
11315 # @param theShape Shape to find sub-shape.
11316 # @param theIndex Index to find vertex by this index (starting from zero)
11317 # @param theUseOri To consider edge/wire orientation or not
11318 # @param theName Object name; when specified, this parameter is used
11319 # for result publication in the study. Otherwise, if automatic
11320 # publication is switched on, default value is used for result name.
11322 # @return New GEOM.GEOM_Object, containing the created vertex.
11324 # @ref tui_measurement_tools_page "Example"
11325 @ManageTransactions("MeasuOp")
11326 def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
11328 Get a vertex sub-shape by index.
11331 theShape Shape to find sub-shape.
11332 theIndex Index to find vertex by this index (starting from zero)
11333 theUseOri To consider edge/wire orientation or not
11334 theName Object name; when specified, this parameter is used
11335 for result publication in the study. Otherwise, if automatic
11336 publication is switched on, default value is used for result name.
11339 New GEOM.GEOM_Object, containing the created vertex.
11341 # Example: see GEOM_TestMeasures.py
11342 if isinstance( theUseOri, str ): # theUseOri was inserted before theName
11343 theUseOri, theName = True, theUseOri
11344 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
11345 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11346 self._autoPublish(anObj, theName, "vertex")
11349 ## Get the first vertex of wire/edge depended orientation.
11350 # @param theShape Shape to find first vertex.
11351 # @param theName Object name; when specified, this parameter is used
11352 # for result publication in the study. Otherwise, if automatic
11353 # publication is switched on, default value is used for result name.
11355 # @return New GEOM.GEOM_Object, containing the created vertex.
11357 # @ref tui_measurement_tools_page "Example"
11358 def GetFirstVertex(self, theShape, theName=None):
11360 Get the first vertex of wire/edge depended orientation.
11363 theShape Shape to find first vertex.
11364 theName Object name; when specified, this parameter is used
11365 for result publication in the study. Otherwise, if automatic
11366 publication is switched on, default value is used for result name.
11369 New GEOM.GEOM_Object, containing the created vertex.
11371 # Example: see GEOM_TestMeasures.py
11372 # note: auto-publishing is done in self.GetVertexByIndex()
11373 return self.GetVertexByIndex(theShape, 0, True, theName)
11375 ## Get the last vertex of wire/edge depended orientation.
11376 # @param theShape Shape to find last vertex.
11377 # @param theName Object name; when specified, this parameter is used
11378 # for result publication in the study. Otherwise, if automatic
11379 # publication is switched on, default value is used for result name.
11381 # @return New GEOM.GEOM_Object, containing the created vertex.
11383 # @ref tui_measurement_tools_page "Example"
11384 def GetLastVertex(self, theShape, theName=None):
11386 Get the last vertex of wire/edge depended orientation.
11389 theShape Shape to find last vertex.
11390 theName Object name; when specified, this parameter is used
11391 for result publication in the study. Otherwise, if automatic
11392 publication is switched on, default value is used for result name.
11395 New GEOM.GEOM_Object, containing the created vertex.
11397 # Example: see GEOM_TestMeasures.py
11398 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11399 # note: auto-publishing is done in self.GetVertexByIndex()
11400 return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
11402 ## Get a normale to the given face. If the point is not given,
11403 # the normale is calculated at the center of mass.
11404 # @param theFace Face to define normale of.
11405 # @param theOptionalPoint Point to compute the normale at.
11406 # @param theName Object name; when specified, this parameter is used
11407 # for result publication in the study. Otherwise, if automatic
11408 # publication is switched on, default value is used for result name.
11410 # @return New GEOM.GEOM_Object, containing the created vector.
11412 # @ref swig_todo "Example"
11413 @ManageTransactions("MeasuOp")
11414 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11416 Get a normale to the given face. If the point is not given,
11417 the normale is calculated at the center of mass.
11420 theFace Face to define normale of.
11421 theOptionalPoint Point to compute the normale at.
11422 theName Object name; when specified, this parameter is used
11423 for result publication in the study. Otherwise, if automatic
11424 publication is switched on, default value is used for result name.
11427 New GEOM.GEOM_Object, containing the created vector.
11429 # Example: see GEOM_TestMeasures.py
11430 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11431 RaiseIfFailed("GetNormal", self.MeasuOp)
11432 self._autoPublish(anObj, theName, "normal")
11435 ## Print shape errors obtained from CheckShape.
11436 # @param theShape Shape that was checked.
11437 # @param theShapeErrors the shape errors obtained by CheckShape.
11438 # @param theReturnStatus If 0 the description of problem is printed.
11439 # If 1 the description of problem is returned.
11440 # @return If theReturnStatus is equal to 1 the description is returned.
11441 # Otherwise doesn't return anything.
11443 # @ref tui_check_shape_page "Example"
11444 @ManageTransactions("MeasuOp")
11445 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11447 Print shape errors obtained from CheckShape.
11450 theShape Shape that was checked.
11451 theShapeErrors the shape errors obtained by CheckShape.
11452 theReturnStatus If 0 the description of problem is printed.
11453 If 1 the description of problem is returned.
11456 If theReturnStatus is equal to 1 the description is returned.
11457 Otherwise doesn't return anything.
11459 # Example: see GEOM_TestMeasures.py
11460 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11461 if theReturnStatus == 1:
11466 ## Check a topology of the given shape.
11467 # @param theShape Shape to check validity of.
11468 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11469 # if TRUE, the shape's geometry will be checked also.
11470 # @param theReturnStatus If 0 and if theShape is invalid, a description
11471 # of problem is printed.
11472 # If 1 isValid flag and the description of
11473 # problem is returned.
11474 # If 2 isValid flag and the list of error data
11476 # @return TRUE, if the shape "seems to be valid".
11477 # If theShape is invalid, prints a description of problem.
11478 # If theReturnStatus is equal to 1 the description is returned
11479 # along with IsValid flag.
11480 # If theReturnStatus is equal to 2 the list of error data is
11481 # returned along with IsValid flag.
11483 # @ref tui_check_shape_page "Example"
11484 @ManageTransactions("MeasuOp")
11485 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11487 Check a topology of the given shape.
11490 theShape Shape to check validity of.
11491 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11492 if TRUE, the shape's geometry will be checked also.
11493 theReturnStatus If 0 and if theShape is invalid, a description
11494 of problem is printed.
11495 If 1 IsValid flag and the description of
11496 problem is returned.
11497 If 2 IsValid flag and the list of error data
11501 TRUE, if the shape "seems to be valid".
11502 If theShape is invalid, prints a description of problem.
11503 If theReturnStatus is equal to 1 the description is returned
11504 along with IsValid flag.
11505 If theReturnStatus is equal to 2 the list of error data is
11506 returned along with IsValid flag.
11508 # Example: see GEOM_TestMeasures.py
11510 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11511 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11513 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11514 RaiseIfFailed("CheckShape", self.MeasuOp)
11516 if theReturnStatus == 0:
11517 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11519 if theReturnStatus == 1:
11520 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11521 return (IsValid, Descr)
11522 elif theReturnStatus == 2:
11523 return (IsValid, ShapeErrors)
11526 ## Detect self-intersections in the given shape.
11527 # @param theShape Shape to check.
11528 # @param theCheckLevel is the level of self-intersection check.
11529 # Possible input values are:
11530 # - GEOM.SI_V_V(0) - only V/V interferences
11531 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11532 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11533 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11534 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11535 # - GEOM.SI_ALL(5) - all interferences.
11536 # @return TRUE, if the shape contains no self-intersections.
11538 # @ref tui_check_self_intersections_page "Example"
11539 @ManageTransactions("MeasuOp")
11540 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11542 Detect self-intersections in the given shape.
11545 theShape Shape to check.
11546 theCheckLevel is the level of self-intersection check.
11547 Possible input values are:
11548 - GEOM.SI_V_V(0) - only V/V interferences
11549 - GEOM.SI_V_E(1) - V/V and V/E interferences
11550 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11551 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11552 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11553 - GEOM.SI_ALL(5) - all interferences.
11556 TRUE, if the shape contains no self-intersections.
11558 # Example: see GEOM_TestMeasures.py
11559 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11560 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11563 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11564 # @param theShape Shape to check.
11565 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11566 # - if \a theDeflection <= 0, default deflection 0.001 is used
11567 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11568 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11569 # - if \a theTolerance > 0, algorithm detects gaps
11570 # @return TRUE, if the shape contains no self-intersections.
11572 # @ref tui_check_self_intersections_fast_page "Example"
11573 @ManageTransactions("MeasuOp")
11574 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11576 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11579 theShape Shape to check.
11580 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11581 - if theDeflection <= 0, default deflection 0.001 is used
11582 theTolerance Specifies a distance between shapes used for detecting gaps:
11583 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11584 - if theTolerance > 0, algorithm detects gaps
11587 TRUE, if the shape contains no self-intersections.
11589 # Example: see GEOM_TestMeasures.py
11590 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11591 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11594 ## Check boolean and partition operations arguments.
11595 # @param theShape the argument of an operation to be checked
11596 # @return TRUE if the argument is valid for a boolean or partition
11597 # operation; FALSE otherwise.
11598 @ManageTransactions("MeasuOp")
11599 def CheckBOPArguments(self, theShape):
11601 Check boolean and partition operations arguments.
11604 theShape the argument of an operation to be checked
11607 TRUE if the argument is valid for a boolean or partition
11608 operation; FALSE otherwise.
11610 return self.MeasuOp.CheckBOPArguments(theShape)
11612 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11613 # @param theShape1 First source object
11614 # @param theShape2 Second source object
11615 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11616 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11617 # - if \a theTolerance > 0, algorithm detects gaps
11618 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11619 # - if \a theDeflection <= 0, default deflection 0.001 is used
11620 # @return TRUE, if there are intersections (gaps) between source shapes
11621 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11622 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11624 # @ref tui_fast_intersection_page "Example"
11625 @ManageTransactions("MeasuOp")
11626 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11628 Detect intersections of the given shapes with algorithm based on mesh intersections.
11631 theShape1 First source object
11632 theShape2 Second source object
11633 theTolerance Specifies a distance between shapes used for detecting gaps:
11634 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11635 - if theTolerance > 0, algorithm detects gaps
11636 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11637 - if theDeflection <= 0, default deflection 0.001 is used
11640 TRUE, if there are intersections (gaps) between source shapes
11641 List of sub-shapes IDs from 1st shape that localize intersection.
11642 List of sub-shapes IDs from 2nd shape that localize intersection.
11644 # Example: see GEOM_TestMeasures.py
11645 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11646 RaiseIfFailed("FastIntersect", self.MeasuOp)
11647 return IsOk, Res1, Res2
11649 ## Get position (LCS) of theShape.
11651 # Origin of the LCS is situated at the shape's center of mass.
11652 # Axes of the LCS are obtained from shape's location or,
11653 # if the shape is a planar face, from position of its plane.
11655 # @param theShape Shape to calculate position of.
11656 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11657 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11658 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11659 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11661 # @ref swig_todo "Example"
11662 @ManageTransactions("MeasuOp")
11663 def GetPosition(self,theShape):
11665 Get position (LCS) of theShape.
11666 Origin of the LCS is situated at the shape's center of mass.
11667 Axes of the LCS are obtained from shape's location or,
11668 if the shape is a planar face, from position of its plane.
11671 theShape Shape to calculate position of.
11674 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11675 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11676 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11677 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11679 # Example: see GEOM_TestMeasures.py
11680 aTuple = self.MeasuOp.GetPosition(theShape)
11681 RaiseIfFailed("GetPosition", self.MeasuOp)
11684 ## Get kind of theShape.
11686 # @param theShape Shape to get a kind of.
11687 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11688 # and a list of parameters, describing the shape.
11689 # @note Concrete meaning of each value, returned via \a theIntegers
11690 # or \a theDoubles list depends on the kind() of the shape.
11692 # @ref swig_todo "Example"
11693 @ManageTransactions("MeasuOp")
11694 def KindOfShape(self,theShape):
11696 Get kind of theShape.
11699 theShape Shape to get a kind of.
11702 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11703 and a list of parameters, describing the shape.
11705 Concrete meaning of each value, returned via theIntegers
11706 or theDoubles list depends on the geompy.kind of the shape
11708 # Example: see GEOM_TestMeasures.py
11709 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11710 RaiseIfFailed("KindOfShape", self.MeasuOp)
11712 aKind = aRoughTuple[0]
11713 anInts = aRoughTuple[1]
11714 aDbls = aRoughTuple[2]
11716 # Now there is no exception from this rule:
11717 aKindTuple = [aKind] + aDbls + anInts
11719 # If they are we will regroup parameters for such kind of shape.
11721 #if aKind == kind.SOME_KIND:
11722 # # SOME_KIND int int double int double double
11723 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11727 ## Returns the string that describes if the shell is good for solid.
11728 # This is a support method for MakeSolid.
11730 # @param theShell the shell to be checked.
11731 # @return Returns a string that describes the shell validity for
11732 # solid construction.
11733 @ManageTransactions("MeasuOp")
11734 def _IsGoodForSolid(self, theShell):
11736 Returns the string that describes if the shell is good for solid.
11737 This is a support method for MakeSolid.
11740 theShell the shell to be checked.
11743 Returns a string that describes the shell validity for
11744 solid construction.
11746 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11749 # end of l2_measure
11752 ## @addtogroup l2_import_export
11755 ## Import a shape from the BREP, IGES, STEP or other file
11756 # (depends on given format) with given name.
11758 # Note: this function is deprecated, it is kept for backward compatibility only
11759 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11761 # @param theFileName The file, containing the shape.
11762 # @param theFormatName Specify format for the file reading.
11763 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11764 # If format 'IGES_SCALE' is used instead of 'IGES' or
11765 # format 'STEP_SCALE' is used instead of 'STEP',
11766 # length unit will be set to 'meter' and result model will be scaled.
11767 # @param theName Object name; when specified, this parameter is used
11768 # for result publication in the study. Otherwise, if automatic
11769 # publication is switched on, default value is used for result name.
11771 # @return New GEOM.GEOM_Object, containing the imported shape.
11772 # If material names are imported it returns the list of
11773 # objects. The first one is the imported object followed by
11775 # @note Auto publishing is allowed for the shape itself. Imported
11776 # material groups are not automatically published.
11778 # @ref swig_Import_Export "Example"
11779 @ManageTransactions("InsertOp")
11780 def ImportFile(self, theFileName, theFormatName, theName=None):
11782 Import a shape from the BREP, IGES, STEP or other file
11783 (depends on given format) with given name.
11785 Note: this function is deprecated, it is kept for backward compatibility only
11786 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11789 theFileName The file, containing the shape.
11790 theFormatName Specify format for the file reading.
11791 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11792 If format 'IGES_SCALE' is used instead of 'IGES' or
11793 format 'STEP_SCALE' is used instead of 'STEP',
11794 length unit will be set to 'meter' and result model will be scaled.
11795 theName Object name; when specified, this parameter is used
11796 for result publication in the study. Otherwise, if automatic
11797 publication is switched on, default value is used for result name.
11800 New GEOM.GEOM_Object, containing the imported shape.
11801 If material names are imported it returns the list of
11802 objects. The first one is the imported object followed by
11805 Auto publishing is allowed for the shape itself. Imported
11806 material groups are not automatically published.
11808 # Example: see GEOM_TestOthers.py
11810 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11811 where <FormatName> is a name of desirable format for importing.
11813 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11814 RaiseIfFailed("ImportFile", self.InsertOp)
11815 aNbObj = len(aListObj)
11817 self._autoPublish(aListObj[0], theName, "imported")
11822 ## Deprecated analog of ImportFile()
11823 def Import(self, theFileName, theFormatName, theName=None):
11825 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11827 # note: auto-publishing is done in self.ImportFile()
11828 return self.ImportFile(theFileName, theFormatName, theName)
11830 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11832 # @note As the byte-stream representing the shape data can be quite large, this method
11833 # is not automatically dumped to the Python script with the DumpStudy functionality;
11834 # so please use this method carefully, only for strong reasons.
11836 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11839 # @param theStream The BRep binary stream.
11840 # @param theName Object name; when specified, this parameter is used
11841 # for result publication in the study. Otherwise, if automatic
11842 # publication is switched on, default value is used for result name.
11844 # @return New GEOM_Object, containing the shape, read from theStream.
11846 # @ref swig_Import_Export "Example"
11847 @ManageTransactions("InsertOp")
11848 def RestoreShape (self, theStream, theName=None):
11850 Read a shape from the binary stream, containing its bounding representation (BRep).
11853 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11856 theStream The BRep binary stream.
11857 theName Object name; when specified, this parameter is used
11858 for result publication in the study. Otherwise, if automatic
11859 publication is switched on, default value is used for result name.
11862 New GEOM_Object, containing the shape, read from theStream.
11864 # Example: see GEOM_TestOthers.py
11866 # this is the workaround to ignore invalid case when data stream is empty
11867 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11868 print("WARNING: Result of RestoreShape is a NULL shape!")
11870 anObj = self.InsertOp.RestoreShape(theStream)
11871 RaiseIfFailed("RestoreShape", self.InsertOp)
11872 self._autoPublish(anObj, theName, "restored")
11875 ## Export the given shape into a file with given name.
11877 # Note: this function is deprecated, it is kept for backward compatibility only
11878 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11880 # @param theObject Shape to be stored in the file.
11881 # @param theFileName Name of the file to store the given shape in.
11882 # @param theFormatName Specify format for the shape storage.
11883 # Available formats can be obtained with
11884 # geompy.InsertOp.ExportTranslators()[0] method.
11886 # @ref swig_Import_Export "Example"
11887 @ManageTransactions("InsertOp")
11888 def Export(self, theObject, theFileName, theFormatName):
11890 Export the given shape into a file with given name.
11892 Note: this function is deprecated, it is kept for backward compatibility only
11893 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11896 theObject Shape to be stored in the file.
11897 theFileName Name of the file to store the given shape in.
11898 theFormatName Specify format for the shape storage.
11899 Available formats can be obtained with
11900 geompy.InsertOp.ExportTranslators()[0] method.
11902 # Example: see GEOM_TestOthers.py
11904 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11905 where <FormatName> is a name of desirable format for exporting.
11907 self.InsertOp.Export(theObject, theFileName, theFormatName)
11908 if self.InsertOp.IsDone() == 0:
11909 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11913 # end of l2_import_export
11916 ## @addtogroup l3_blocks
11919 ## Create a quadrangle face from four edges. Order of Edges is not
11920 # important. It is not necessary that edges share the same vertex.
11921 # @param E1,E2,E3,E4 Edges for the face bound.
11922 # @param theName Object name; when specified, this parameter is used
11923 # for result publication in the study. Otherwise, if automatic
11924 # publication is switched on, default value is used for result name.
11926 # @return New GEOM.GEOM_Object, containing the created face.
11928 # @ref tui_building_by_blocks_page "Example"
11929 @ManageTransactions("BlocksOp")
11930 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11932 Create a quadrangle face from four edges. Order of Edges is not
11933 important. It is not necessary that edges share the same vertex.
11936 E1,E2,E3,E4 Edges for the face bound.
11937 theName Object name; when specified, this parameter is used
11938 for result publication in the study. Otherwise, if automatic
11939 publication is switched on, default value is used for result name.
11942 New GEOM.GEOM_Object, containing the created face.
11945 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11947 # Example: see GEOM_Spanner.py
11948 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11949 RaiseIfFailed("MakeQuad", self.BlocksOp)
11950 self._autoPublish(anObj, theName, "quad")
11953 ## Create a quadrangle face on two edges.
11954 # The missing edges will be built by creating the shortest ones.
11955 # @param E1,E2 Two opposite edges for the face.
11956 # @param theName Object name; when specified, this parameter is used
11957 # for result publication in the study. Otherwise, if automatic
11958 # publication is switched on, default value is used for result name.
11960 # @return New GEOM.GEOM_Object, containing the created face.
11962 # @ref tui_building_by_blocks_page "Example"
11963 @ManageTransactions("BlocksOp")
11964 def MakeQuad2Edges(self, E1, E2, theName=None):
11966 Create a quadrangle face on two edges.
11967 The missing edges will be built by creating the shortest ones.
11970 E1,E2 Two opposite edges for the face.
11971 theName Object name; when specified, this parameter is used
11972 for result publication in the study. Otherwise, if automatic
11973 publication is switched on, default value is used for result name.
11976 New GEOM.GEOM_Object, containing the created face.
11980 p1 = geompy.MakeVertex( 0., 0., 0.)
11981 p2 = geompy.MakeVertex(150., 30., 0.)
11982 p3 = geompy.MakeVertex( 0., 120., 50.)
11983 p4 = geompy.MakeVertex( 0., 40., 70.)
11985 edge1 = geompy.MakeEdge(p1, p2)
11986 edge2 = geompy.MakeEdge(p3, p4)
11987 # create a quadrangle face from two edges
11988 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11990 # Example: see GEOM_Spanner.py
11991 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11992 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11993 self._autoPublish(anObj, theName, "quad")
11996 ## Create a quadrangle face with specified corners.
11997 # The missing edges will be built by creating the shortest ones.
11998 # @param V1,V2,V3,V4 Corner vertices for the face.
11999 # @param theName Object name; when specified, this parameter is used
12000 # for result publication in the study. Otherwise, if automatic
12001 # publication is switched on, default value is used for result name.
12003 # @return New GEOM.GEOM_Object, containing the created face.
12005 # @ref tui_building_by_blocks_page "Example 1"
12006 # \n @ref swig_MakeQuad4Vertices "Example 2"
12007 @ManageTransactions("BlocksOp")
12008 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12010 Create a quadrangle face with specified corners.
12011 The missing edges will be built by creating the shortest ones.
12014 V1,V2,V3,V4 Corner vertices for the face.
12015 theName Object name; when specified, this parameter is used
12016 for result publication in the study. Otherwise, if automatic
12017 publication is switched on, default value is used for result name.
12020 New GEOM.GEOM_Object, containing the created face.
12024 p1 = geompy.MakeVertex( 0., 0., 0.)
12025 p2 = geompy.MakeVertex(150., 30., 0.)
12026 p3 = geompy.MakeVertex( 0., 120., 50.)
12027 p4 = geompy.MakeVertex( 0., 40., 70.)
12028 # create a quadrangle from four points in its corners
12029 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12031 # Example: see GEOM_Spanner.py
12032 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12033 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12034 self._autoPublish(anObj, theName, "quad")
12037 ## Create a hexahedral solid, bounded by the six given faces. Order of
12038 # faces is not important. It is not necessary that Faces share the same edge.
12039 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12040 # @param theName Object name; when specified, this parameter is used
12041 # for result publication in the study. Otherwise, if automatic
12042 # publication is switched on, default value is used for result name.
12044 # @return New GEOM.GEOM_Object, containing the created solid.
12046 # @ref tui_building_by_blocks_page "Example 1"
12047 # \n @ref swig_MakeHexa "Example 2"
12048 @ManageTransactions("BlocksOp")
12049 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12051 Create a hexahedral solid, bounded by the six given faces. Order of
12052 faces is not important. It is not necessary that Faces share the same edge.
12055 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12056 theName Object name; when specified, this parameter is used
12057 for result publication in the study. Otherwise, if automatic
12058 publication is switched on, default value is used for result name.
12061 New GEOM.GEOM_Object, containing the created solid.
12064 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12066 # Example: see GEOM_Spanner.py
12067 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12068 RaiseIfFailed("MakeHexa", self.BlocksOp)
12069 self._autoPublish(anObj, theName, "hexa")
12072 ## Create a hexahedral solid between two given faces.
12073 # The missing faces will be built by creating the smallest ones.
12074 # @param F1,F2 Two opposite faces for the hexahedral solid.
12075 # @param theName Object name; when specified, this parameter is used
12076 # for result publication in the study. Otherwise, if automatic
12077 # publication is switched on, default value is used for result name.
12079 # @return New GEOM.GEOM_Object, containing the created solid.
12081 # @ref tui_building_by_blocks_page "Example 1"
12082 # \n @ref swig_MakeHexa2Faces "Example 2"
12083 @ManageTransactions("BlocksOp")
12084 def MakeHexa2Faces(self, F1, F2, theName=None):
12086 Create a hexahedral solid between two given faces.
12087 The missing faces will be built by creating the smallest ones.
12090 F1,F2 Two opposite faces for the hexahedral solid.
12091 theName Object name; when specified, this parameter is used
12092 for result publication in the study. Otherwise, if automatic
12093 publication is switched on, default value is used for result name.
12096 New GEOM.GEOM_Object, containing the created solid.
12099 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12101 # Example: see GEOM_Spanner.py
12102 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12103 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12104 self._autoPublish(anObj, theName, "hexa")
12110 ## @addtogroup l3_blocks_op
12113 ## Get a vertex, found in the given shape by its coordinates.
12114 # @param theShape Block or a compound of blocks.
12115 # @param theX,theY,theZ Coordinates of the sought vertex.
12116 # @param theEpsilon Maximum allowed distance between the resulting
12117 # vertex and point with the given coordinates.
12118 # @param theName Object name; when specified, this parameter is used
12119 # for result publication in the study. Otherwise, if automatic
12120 # publication is switched on, default value is used for result name.
12122 # @return New GEOM.GEOM_Object, containing the found vertex.
12124 # @ref swig_GetPoint "Example"
12125 @ManageTransactions("BlocksOp")
12126 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12128 Get a vertex, found in the given shape by its coordinates.
12131 theShape Block or a compound of blocks.
12132 theX,theY,theZ Coordinates of the sought vertex.
12133 theEpsilon Maximum allowed distance between the resulting
12134 vertex and point with the given coordinates.
12135 theName Object name; when specified, this parameter is used
12136 for result publication in the study. Otherwise, if automatic
12137 publication is switched on, default value is used for result name.
12140 New GEOM.GEOM_Object, containing the found vertex.
12143 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12145 # Example: see GEOM_TestOthers.py
12146 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12147 RaiseIfFailed("GetPoint", self.BlocksOp)
12148 self._autoPublish(anObj, theName, "vertex")
12151 ## Find a vertex of the given shape, which has minimal distance to the given point.
12152 # @param theShape Any shape.
12153 # @param thePoint Point, close to the desired vertex.
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 vertex.
12160 # @ref swig_GetVertexNearPoint "Example"
12161 @ManageTransactions("BlocksOp")
12162 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12164 Find a vertex of the given shape, which has minimal distance to the given point.
12167 theShape Any shape.
12168 thePoint Point, close to the desired vertex.
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 vertex.
12177 pmidle = geompy.MakeVertex(50, 0, 50)
12178 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12180 # Example: see GEOM_TestOthers.py
12181 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12182 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12183 self._autoPublish(anObj, theName, "vertex")
12186 ## Get an edge, found in the given shape by two given vertices.
12187 # @param theShape Block or a compound of blocks.
12188 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12189 # @param theName Object name; when specified, this parameter is used
12190 # for result publication in the study. Otherwise, if automatic
12191 # publication is switched on, default value is used for result name.
12193 # @return New GEOM.GEOM_Object, containing the found edge.
12195 # @ref swig_GetEdge "Example"
12196 @ManageTransactions("BlocksOp")
12197 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12199 Get an edge, found in the given shape by two given vertices.
12202 theShape Block or a compound of blocks.
12203 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12204 theName Object name; when specified, this parameter is used
12205 for result publication in the study. Otherwise, if automatic
12206 publication is switched on, default value is used for result name.
12209 New GEOM.GEOM_Object, containing the found edge.
12211 # Example: see GEOM_Spanner.py
12212 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12213 RaiseIfFailed("GetEdge", self.BlocksOp)
12214 self._autoPublish(anObj, theName, "edge")
12217 ## Find an edge of the given shape, which has minimal distance to the given point.
12218 # @param theShape Block or a compound of blocks.
12219 # @param thePoint Point, close to the desired edge.
12220 # @param theName Object name; when specified, this parameter is used
12221 # for result publication in the study. Otherwise, if automatic
12222 # publication is switched on, default value is used for result name.
12224 # @return New GEOM.GEOM_Object, containing the found edge.
12226 # @ref swig_GetEdgeNearPoint "Example"
12227 @ManageTransactions("BlocksOp")
12228 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12230 Find an edge of the given shape, which has minimal distance to the given point.
12233 theShape Block or a compound of blocks.
12234 thePoint Point, close to the desired edge.
12235 theName Object name; when specified, this parameter is used
12236 for result publication in the study. Otherwise, if automatic
12237 publication is switched on, default value is used for result name.
12240 New GEOM.GEOM_Object, containing the found edge.
12242 # Example: see GEOM_TestOthers.py
12243 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12244 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12245 self._autoPublish(anObj, theName, "edge")
12248 ## Returns a face, found in the given shape by four given corner vertices.
12249 # @param theShape Block or a compound of blocks.
12250 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12251 # @param theName Object name; when specified, this parameter is used
12252 # for result publication in the study. Otherwise, if automatic
12253 # publication is switched on, default value is used for result name.
12255 # @return New GEOM.GEOM_Object, containing the found face.
12257 # @ref swig_todo "Example"
12258 @ManageTransactions("BlocksOp")
12259 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12261 Returns a face, found in the given shape by four given corner vertices.
12264 theShape Block or a compound of blocks.
12265 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12266 theName Object name; when specified, this parameter is used
12267 for result publication in the study. Otherwise, if automatic
12268 publication is switched on, default value is used for result name.
12271 New GEOM.GEOM_Object, containing the found face.
12273 # Example: see GEOM_Spanner.py
12274 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12275 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12276 self._autoPublish(anObj, theName, "face")
12279 ## Get a face of block, found in the given shape by two given edges.
12280 # @param theShape Block or a compound of blocks.
12281 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12282 # @param theName Object name; when specified, this parameter is used
12283 # for result publication in the study. Otherwise, if automatic
12284 # publication is switched on, default value is used for result name.
12286 # @return New GEOM.GEOM_Object, containing the found face.
12288 # @ref swig_todo "Example"
12289 @ManageTransactions("BlocksOp")
12290 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12292 Get a face of block, found in the given shape by two given edges.
12295 theShape Block or a compound of blocks.
12296 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12297 theName Object name; when specified, this parameter is used
12298 for result publication in the study. Otherwise, if automatic
12299 publication is switched on, default value is used for result name.
12302 New GEOM.GEOM_Object, containing the found face.
12304 # Example: see GEOM_Spanner.py
12305 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12306 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12307 self._autoPublish(anObj, theName, "face")
12310 ## Find a face, opposite to the given one in the given block.
12311 # @param theBlock Must be a hexahedral solid.
12312 # @param theFace Face of \a theBlock, opposite to the desired face.
12313 # @param theName Object name; when specified, this parameter is used
12314 # for result publication in the study. Otherwise, if automatic
12315 # publication is switched on, default value is used for result name.
12317 # @return New GEOM.GEOM_Object, containing the found face.
12319 # @ref swig_GetOppositeFace "Example"
12320 @ManageTransactions("BlocksOp")
12321 def GetOppositeFace(self, theBlock, theFace, theName=None):
12323 Find a face, opposite to the given one in the given block.
12326 theBlock Must be a hexahedral solid.
12327 theFace Face of theBlock, opposite to the desired face.
12328 theName Object name; when specified, this parameter is used
12329 for result publication in the study. Otherwise, if automatic
12330 publication is switched on, default value is used for result name.
12333 New GEOM.GEOM_Object, containing the found face.
12335 # Example: see GEOM_Spanner.py
12336 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12337 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12338 self._autoPublish(anObj, theName, "face")
12341 ## Find a face of the given shape, which has minimal distance to the given point.
12342 # @param theShape Block or a compound of blocks.
12343 # @param thePoint Point, close to the desired face.
12344 # @param theName Object name; when specified, this parameter is used
12345 # for result publication in the study. Otherwise, if automatic
12346 # publication is switched on, default value is used for result name.
12348 # @return New GEOM.GEOM_Object, containing the found face.
12350 # @ref swig_GetFaceNearPoint "Example"
12351 @ManageTransactions("BlocksOp")
12352 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12354 Find a face of the given shape, which has minimal distance to the given point.
12357 theShape Block or a compound of blocks.
12358 thePoint Point, close to the desired face.
12359 theName Object name; when specified, this parameter is used
12360 for result publication in the study. Otherwise, if automatic
12361 publication is switched on, default value is used for result name.
12364 New GEOM.GEOM_Object, containing the found face.
12366 # Example: see GEOM_Spanner.py
12367 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12368 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12369 self._autoPublish(anObj, theName, "face")
12372 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12373 # @param theBlock Block or a compound of blocks.
12374 # @param theVector Vector, close to the normale of the desired face.
12375 # @param theName Object name; when specified, this parameter is used
12376 # for result publication in the study. Otherwise, if automatic
12377 # publication is switched on, default value is used for result name.
12379 # @return New GEOM.GEOM_Object, containing the found face.
12381 # @ref swig_todo "Example"
12382 @ManageTransactions("BlocksOp")
12383 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12385 Find a face of block, whose outside normale has minimal angle with the given vector.
12388 theBlock Block or a compound of blocks.
12389 theVector Vector, close to the normale of the desired face.
12390 theName Object name; when specified, this parameter is used
12391 for result publication in the study. Otherwise, if automatic
12392 publication is switched on, default value is used for result name.
12395 New GEOM.GEOM_Object, containing the found face.
12397 # Example: see GEOM_Spanner.py
12398 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12399 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12400 self._autoPublish(anObj, theName, "face")
12403 ## Find all sub-shapes of type \a theShapeType of the given shape,
12404 # which have minimal distance to the given point.
12405 # @param theShape Any shape.
12406 # @param thePoint Point, close to the desired shape.
12407 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12408 # @param theTolerance The tolerance for distances comparison. All shapes
12409 # with distances to the given point in interval
12410 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12411 # @param theName Object name; when specified, this parameter is used
12412 # for result publication in the study. Otherwise, if automatic
12413 # publication is switched on, default value is used for result name.
12415 # @return New GEOM_Object, containing a group of all found shapes.
12417 # @ref swig_GetShapesNearPoint "Example"
12418 @ManageTransactions("BlocksOp")
12419 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12421 Find all sub-shapes of type theShapeType of the given shape,
12422 which have minimal distance to the given point.
12425 theShape Any shape.
12426 thePoint Point, close to the desired shape.
12427 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12428 theTolerance The tolerance for distances comparison. All shapes
12429 with distances to the given point in interval
12430 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12431 theName Object name; when specified, this parameter is used
12432 for result publication in the study. Otherwise, if automatic
12433 publication is switched on, default value is used for result name.
12436 New GEOM_Object, containing a group of all found shapes.
12438 # Example: see GEOM_TestOthers.py
12439 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12440 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12441 self._autoPublish(anObj, theName, "group")
12444 # end of l3_blocks_op
12447 ## @addtogroup l4_blocks_measure
12450 ## Check, if the compound of blocks is given.
12451 # To be considered as a compound of blocks, the
12452 # given shape must satisfy the following conditions:
12453 # - Each element of the compound should be a Block (6 faces).
12454 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12455 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12456 # there are more than 4 edges in the only wire of a face,
12457 # this face is considered to be quadrangle if it has 4 bounds
12458 # (1 or more edge) of C1 continuity.
12459 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12460 # - The compound should be connexe.
12461 # - The glue between two quadrangle faces should be applied.
12462 # @param theCompound The compound to check.
12463 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12464 # taking into account C1 continuity.
12465 # @param theAngTolerance the angular tolerance to check if two neighbor
12466 # edges are codirectional in the common vertex with this
12467 # tolerance. This parameter is used only if
12468 # <VAR>theIsUseC1</VAR> is set to True.
12469 # @return TRUE, if the given shape is a compound of blocks.
12470 # If theCompound is not valid, prints all discovered errors.
12472 # @ref tui_check_compound_of_blocks_page "Example 1"
12473 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12474 @ManageTransactions("BlocksOp")
12475 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12476 theAngTolerance = 1.e-12):
12478 Check, if the compound of blocks is given.
12479 To be considered as a compound of blocks, the
12480 given shape must satisfy the following conditions:
12481 - Each element of the compound should be a Block (6 faces).
12482 - Each face should be a quadrangle, i.e. it should have only 1 wire
12483 with 4 edges. If theIsUseC1 is set to True and
12484 there are more than 4 edges in the only wire of a face,
12485 this face is considered to be quadrangle if it has 4 bounds
12486 (1 or more edge) of C1 continuity.
12487 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12488 - The compound should be connexe.
12489 - The glue between two quadrangle faces should be applied.
12492 theCompound The compound to check.
12493 theIsUseC1 Flag to check if there are 4 bounds on a face
12494 taking into account C1 continuity.
12495 theAngTolerance the angular tolerance to check if two neighbor
12496 edges are codirectional in the common vertex with this
12497 tolerance. This parameter is used only if
12498 theIsUseC1 is set to True.
12501 TRUE, if the given shape is a compound of blocks.
12502 If theCompound is not valid, prints all discovered errors.
12504 # Example: see GEOM_Spanner.py
12507 aTolerance = theAngTolerance
12508 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12509 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12511 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12515 ## Retrieve all non blocks solids and faces from \a theShape.
12516 # @param theShape The shape to explore.
12517 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12518 # taking into account C1 continuity.
12519 # @param theAngTolerance the angular tolerance to check if two neighbor
12520 # edges are codirectional in the common vertex with this
12521 # tolerance. This parameter is used only if
12522 # <VAR>theIsUseC1</VAR> is set to True.
12523 # @param theName Object name; when specified, this parameter is used
12524 # for result publication in the study. Otherwise, if automatic
12525 # publication is switched on, default value is used for result name.
12527 # @return A tuple of two GEOM_Objects. The first object is a group of all
12528 # non block solids (= not 6 faces, or with 6 faces, but with the
12529 # presence of non-quadrangular faces). The second object is a
12530 # group of all non quadrangular faces (= faces with more then
12531 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12532 # with 1 wire with not 4 edges that do not form 4 bounds of
12535 # @ref tui_get_non_blocks_page "Example 1"
12536 # \n @ref swig_GetNonBlocks "Example 2"
12537 @ManageTransactions("BlocksOp")
12538 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12539 theAngTolerance = 1.e-12, theName=None):
12541 Retrieve all non blocks solids and faces from theShape.
12544 theShape The shape to explore.
12545 theIsUseC1 Flag to check if there are 4 bounds on a face
12546 taking into account C1 continuity.
12547 theAngTolerance the angular tolerance to check if two neighbor
12548 edges are codirectional in the common vertex with this
12549 tolerance. This parameter is used only if
12550 theIsUseC1 is set to True.
12551 theName Object name; when specified, this parameter is used
12552 for result publication in the study. Otherwise, if automatic
12553 publication is switched on, default value is used for result name.
12556 A tuple of two GEOM_Objects. The first object is a group of all
12557 non block solids (= not 6 faces, or with 6 faces, but with the
12558 presence of non-quadrangular faces). The second object is a
12559 group of all non quadrangular faces (= faces with more then
12560 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12561 with 1 wire with not 4 edges that do not form 4 bounds of
12565 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12567 # Example: see GEOM_Spanner.py
12570 aTolerance = theAngTolerance
12571 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12572 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12573 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12576 ## Remove all seam and degenerated edges from \a theShape.
12577 # Unite faces and edges, sharing one surface. It means that
12578 # this faces must have references to one C++ surface object (handle).
12579 # @param theShape The compound or single solid to remove irregular edges from.
12580 # @param doUnionFaces If True, then unite faces. If False (the default value),
12581 # do not unite faces.
12582 # @param theName Object name; when specified, this parameter is used
12583 # for result publication in the study. Otherwise, if automatic
12584 # publication is switched on, default value is used for result name.
12586 # @return Improved shape.
12588 # @ref swig_RemoveExtraEdges "Example"
12589 @ManageTransactions("BlocksOp")
12590 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12592 Remove all seam and degenerated edges from theShape.
12593 Unite faces and edges, sharing one surface. It means that
12594 this faces must have references to one C++ surface object (handle).
12597 theShape The compound or single solid to remove irregular edges from.
12598 doUnionFaces If True, then unite faces. If False (the default value),
12599 do not unite faces.
12600 theName Object name; when specified, this parameter is used
12601 for result publication in the study. Otherwise, if automatic
12602 publication is switched on, default value is used for result name.
12607 # Example: see GEOM_TestOthers.py
12608 nbFacesOptimum = -1 # -1 means do not unite faces
12609 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12610 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12611 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12612 self._autoPublish(anObj, theName, "removeExtraEdges")
12615 ## Performs union faces of \a theShape
12616 # Unite faces sharing one surface. It means that
12617 # these faces must have references to one C++ surface object (handle).
12618 # @param theShape The compound or single solid that contains faces
12619 # to perform union.
12620 # @param theName Object name; when specified, this parameter is used
12621 # for result publication in the study. Otherwise, if automatic
12622 # publication is switched on, default value is used for result name.
12624 # @return Improved shape.
12626 # @ref swig_UnionFaces "Example"
12627 @ManageTransactions("BlocksOp")
12628 def UnionFaces(self, theShape, theName=None):
12630 Performs union faces of theShape.
12631 Unite faces sharing one surface. It means that
12632 these faces must have references to one C++ surface object (handle).
12635 theShape The compound or single solid that contains faces
12637 theName Object name; when specified, this parameter is used
12638 for result publication in the study. Otherwise, if automatic
12639 publication is switched on, default value is used for result name.
12644 # Example: see GEOM_TestOthers.py
12645 anObj = self.BlocksOp.UnionFaces(theShape)
12646 RaiseIfFailed("UnionFaces", self.BlocksOp)
12647 self._autoPublish(anObj, theName, "unionFaces")
12650 ## Check, if the given shape is a blocks compound.
12651 # Fix all detected errors.
12652 # \note Single block can be also fixed by this method.
12653 # @param theShape The compound to check and improve.
12654 # @param theName Object name; when specified, this parameter is used
12655 # for result publication in the study. Otherwise, if automatic
12656 # publication is switched on, default value is used for result name.
12658 # @return Improved compound.
12660 # @ref swig_CheckAndImprove "Example"
12661 @ManageTransactions("BlocksOp")
12662 def CheckAndImprove(self, theShape, theName=None):
12664 Check, if the given shape is a blocks compound.
12665 Fix all detected errors.
12668 Single block can be also fixed by this method.
12671 theShape The compound to check and improve.
12672 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.
12679 # Example: see GEOM_TestOthers.py
12680 anObj = self.BlocksOp.CheckAndImprove(theShape)
12681 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12682 self._autoPublish(anObj, theName, "improved")
12685 # end of l4_blocks_measure
12688 ## @addtogroup l3_blocks_op
12691 ## Get all the blocks, contained in the given compound.
12692 # @param theCompound The compound to explode.
12693 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12694 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12695 # @param theName Object name; when specified, this parameter is used
12696 # for result publication in the study. Otherwise, if automatic
12697 # publication is switched on, default value is used for result name.
12699 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12701 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12703 # @ref tui_explode_on_blocks "Example 1"
12704 # \n @ref swig_MakeBlockExplode "Example 2"
12705 @ManageTransactions("BlocksOp")
12706 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12708 Get all the blocks, contained in the given compound.
12711 theCompound The compound to explode.
12712 theMinNbFaces If solid has lower number of faces, it is not a block.
12713 theMaxNbFaces If solid has higher number of faces, it is not a block.
12714 theName Object name; when specified, this parameter is used
12715 for result publication in the study. Otherwise, if automatic
12716 publication is switched on, default value is used for result name.
12719 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12722 List of GEOM.GEOM_Object, containing the retrieved blocks.
12724 # Example: see GEOM_TestOthers.py
12725 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12726 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12727 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12728 for anObj in aList:
12729 anObj.SetParameters(Parameters)
12731 self._autoPublish(aList, theName, "block")
12734 ## Find block, containing the given point inside its volume or on boundary.
12735 # @param theCompound Compound, to find block in.
12736 # @param thePoint Point, close to the desired block. If the point lays on
12737 # boundary between some blocks, we return block with nearest center.
12738 # @param theName Object name; when specified, this parameter is used
12739 # for result publication in the study. Otherwise, if automatic
12740 # publication is switched on, default value is used for result name.
12742 # @return New GEOM.GEOM_Object, containing the found block.
12744 # @ref swig_todo "Example"
12745 @ManageTransactions("BlocksOp")
12746 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12748 Find block, containing the given point inside its volume or on boundary.
12751 theCompound Compound, to find block in.
12752 thePoint Point, close to the desired block. If the point lays on
12753 boundary between some blocks, we return block with nearest center.
12754 theName Object name; when specified, this parameter is used
12755 for result publication in the study. Otherwise, if automatic
12756 publication is switched on, default value is used for result name.
12759 New GEOM.GEOM_Object, containing the found block.
12761 # Example: see GEOM_Spanner.py
12762 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12763 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12764 self._autoPublish(anObj, theName, "block")
12767 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12768 # @param theCompound Compound, to find block in.
12769 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12770 # @param theName Object name; when specified, this parameter is used
12771 # for result publication in the study. Otherwise, if automatic
12772 # publication is switched on, default value is used for result name.
12774 # @return New GEOM.GEOM_Object, containing the found block.
12776 # @ref swig_GetBlockByParts "Example"
12777 @ManageTransactions("BlocksOp")
12778 def GetBlockByParts(self, theCompound, theParts, theName=None):
12780 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12783 theCompound Compound, to find block in.
12784 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12785 theName Object name; when specified, this parameter is used
12786 for result publication in the study. Otherwise, if automatic
12787 publication is switched on, default value is used for result name.
12790 New GEOM_Object, containing the found block.
12792 # Example: see GEOM_TestOthers.py
12793 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12794 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12795 self._autoPublish(anObj, theName, "block")
12798 ## Return all blocks, containing all the elements, passed as the parts.
12799 # @param theCompound Compound, to find blocks in.
12800 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12801 # @param theName Object name; when specified, this parameter is used
12802 # for result publication in the study. Otherwise, if automatic
12803 # publication is switched on, default value is used for result name.
12805 # @return List of GEOM.GEOM_Object, containing the found blocks.
12807 # @ref swig_todo "Example"
12808 @ManageTransactions("BlocksOp")
12809 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12811 Return all blocks, containing all the elements, passed as the parts.
12814 theCompound Compound, to find blocks in.
12815 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12816 theName Object name; when specified, this parameter is used
12817 for result publication in the study. Otherwise, if automatic
12818 publication is switched on, default value is used for result name.
12821 List of GEOM.GEOM_Object, containing the found blocks.
12823 # Example: see GEOM_Spanner.py
12824 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12825 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12826 self._autoPublish(aList, theName, "block")
12829 ## Multi-transformate block and glue the result.
12830 # Transformation is defined so, as to superpose direction faces.
12831 # @param Block Hexahedral solid to be multi-transformed.
12832 # @param DirFace1 ID of First direction face.
12833 # @param DirFace2 ID of Second direction face.
12834 # @param NbTimes Quantity of transformations to be done.
12835 # @param theName Object name; when specified, this parameter is used
12836 # for result publication in the study. Otherwise, if automatic
12837 # publication is switched on, default value is used for result name.
12839 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12841 # @return New GEOM.GEOM_Object, containing the result shape.
12843 # @ref tui_multi_transformation "Example"
12844 @ManageTransactions("BlocksOp")
12845 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12847 Multi-transformate block and glue the result.
12848 Transformation is defined so, as to superpose direction faces.
12851 Block Hexahedral solid to be multi-transformed.
12852 DirFace1 ID of First direction face.
12853 DirFace2 ID of Second direction face.
12854 NbTimes Quantity of transformations to be done.
12855 theName Object name; when specified, this parameter is used
12856 for result publication in the study. Otherwise, if automatic
12857 publication is switched on, default value is used for result name.
12860 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12863 New GEOM.GEOM_Object, containing the result shape.
12865 # Example: see GEOM_Spanner.py
12866 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12867 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12868 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12869 anObj.SetParameters(Parameters)
12870 self._autoPublish(anObj, theName, "transformed")
12873 ## Multi-transformate block and glue the result.
12874 # @param Block Hexahedral solid to be multi-transformed.
12875 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12876 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12877 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12878 # @param theName Object name; when specified, this parameter is used
12879 # for result publication in the study. Otherwise, if automatic
12880 # publication is switched on, default value is used for result name.
12882 # @return New GEOM.GEOM_Object, containing the result shape.
12884 # @ref tui_multi_transformation "Example"
12885 @ManageTransactions("BlocksOp")
12886 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12887 DirFace1V, DirFace2V, NbTimesV, theName=None):
12889 Multi-transformate block and glue the result.
12892 Block Hexahedral solid to be multi-transformed.
12893 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12894 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12895 NbTimesU,NbTimesV Quantity of transformations to be done.
12896 theName Object name; when specified, this parameter is used
12897 for result publication in the study. Otherwise, if automatic
12898 publication is switched on, default value is used for result name.
12901 New GEOM.GEOM_Object, containing the result shape.
12903 # Example: see GEOM_Spanner.py
12904 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12905 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12906 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12907 DirFace1V, DirFace2V, NbTimesV)
12908 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12909 anObj.SetParameters(Parameters)
12910 self._autoPublish(anObj, theName, "transformed")
12913 ## Build all possible propagation groups.
12914 # Propagation group is a set of all edges, opposite to one (main)
12915 # edge of this group directly or through other opposite edges.
12916 # Notion of Opposite Edge make sense only on quadrangle face.
12917 # @param theShape Shape to build propagation groups on.
12918 # @param theName Object name; when specified, this parameter is used
12919 # for result publication in the study. Otherwise, if automatic
12920 # publication is switched on, default value is used for result name.
12922 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12924 # @ref swig_Propagate "Example"
12925 @ManageTransactions("BlocksOp")
12926 def Propagate(self, theShape, theName=None):
12928 Build all possible propagation groups.
12929 Propagation group is a set of all edges, opposite to one (main)
12930 edge of this group directly or through other opposite edges.
12931 Notion of Opposite Edge make sense only on quadrangle face.
12934 theShape Shape to build propagation groups on.
12935 theName Object name; when specified, this parameter is used
12936 for result publication in the study. Otherwise, if automatic
12937 publication is switched on, default value is used for result name.
12940 List of GEOM.GEOM_Object, each of them is a propagation group.
12942 # Example: see GEOM_TestOthers.py
12943 listChains = self.BlocksOp.Propagate(theShape)
12944 RaiseIfFailed("Propagate", self.BlocksOp)
12945 self._autoPublish(listChains, theName, "propagate")
12948 # end of l3_blocks_op
12951 ## @addtogroup l3_groups
12954 ## Creates a new group which will store sub-shapes of theMainShape
12955 # @param theMainShape is a GEOM object on which the group is selected
12956 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12957 # @param theName Object name; when specified, this parameter is used
12958 # for result publication in the study. Otherwise, if automatic
12959 # publication is switched on, default value is used for result name.
12961 # @return a newly created GEOM group (GEOM.GEOM_Object)
12963 # @ref tui_working_with_groups_page "Example 1"
12964 # \n @ref swig_CreateGroup "Example 2"
12965 @ManageTransactions("GroupOp")
12966 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12968 Creates a new group which will store sub-shapes of theMainShape
12971 theMainShape is a GEOM object on which the group is selected
12972 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12973 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12974 theName Object name; when specified, this parameter is used
12975 for result publication in the study. Otherwise, if automatic
12976 publication is switched on, default value is used for result name.
12979 a newly created GEOM group
12982 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12985 # Example: see GEOM_TestOthers.py
12986 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12987 RaiseIfFailed("CreateGroup", self.GroupOp)
12988 self._autoPublish(anObj, theName, "group")
12991 ## Adds a sub-object with ID theSubShapeId to the group
12992 # @param theGroup is a GEOM group to which the new sub-shape is added
12993 # @param theSubShapeID is a sub-shape ID in the main object.
12994 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12996 # @ref tui_working_with_groups_page "Example"
12997 @ManageTransactions("GroupOp")
12998 def AddObject(self,theGroup, theSubShapeID):
13000 Adds a sub-object with ID theSubShapeId to the group
13003 theGroup is a GEOM group to which the new sub-shape is added
13004 theSubShapeID is a sub-shape ID in the main object.
13007 Use method GetSubShapeID() to get an unique ID of the sub-shape
13009 # Example: see GEOM_TestOthers.py
13010 self.GroupOp.AddObject(theGroup, theSubShapeID)
13011 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13012 RaiseIfFailed("AddObject", self.GroupOp)
13016 ## Removes a sub-object with ID \a theSubShapeId from the group
13017 # @param theGroup is a GEOM group from which the new sub-shape is removed
13018 # @param theSubShapeID is a sub-shape ID in the main object.
13019 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13021 # @ref tui_working_with_groups_page "Example"
13022 @ManageTransactions("GroupOp")
13023 def RemoveObject(self,theGroup, theSubShapeID):
13025 Removes a sub-object with ID theSubShapeId from the group
13028 theGroup is a GEOM group from which the new sub-shape is removed
13029 theSubShapeID is a sub-shape ID in the main object.
13032 Use method GetSubShapeID() to get an unique ID of the sub-shape
13034 # Example: see GEOM_TestOthers.py
13035 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13036 RaiseIfFailed("RemoveObject", self.GroupOp)
13039 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13040 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13041 # @param theSubShapes is a list of sub-shapes to be added.
13043 # @ref tui_working_with_groups_page "Example"
13044 @ManageTransactions("GroupOp")
13045 def UnionList (self,theGroup, theSubShapes):
13047 Adds to the group all the given shapes. No errors, if some shapes are already included.
13050 theGroup is a GEOM group to which the new sub-shapes are added.
13051 theSubShapes is a list of sub-shapes to be added.
13053 # Example: see GEOM_TestOthers.py
13054 self.GroupOp.UnionList(theGroup, theSubShapes)
13055 RaiseIfFailed("UnionList", self.GroupOp)
13058 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13059 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13060 # @param theSubShapes is a list of indices of sub-shapes to be added.
13062 # @ref swig_UnionIDs "Example"
13063 @ManageTransactions("GroupOp")
13064 def UnionIDs(self,theGroup, theSubShapes):
13066 Adds to the group all the given shapes. No errors, if some shapes are already included.
13069 theGroup is a GEOM group to which the new sub-shapes are added.
13070 theSubShapes is a list of indices of sub-shapes to be added.
13072 # Example: see GEOM_TestOthers.py
13073 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13074 RaiseIfFailed("UnionIDs", self.GroupOp)
13077 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13078 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13079 # @param theSubShapes is a list of sub-shapes to be removed.
13081 # @ref tui_working_with_groups_page "Example"
13082 @ManageTransactions("GroupOp")
13083 def DifferenceList (self,theGroup, theSubShapes):
13085 Removes from the group all the given shapes. No errors, if some shapes are not included.
13088 theGroup is a GEOM group from which the sub-shapes are removed.
13089 theSubShapes is a list of sub-shapes to be removed.
13091 # Example: see GEOM_TestOthers.py
13092 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13093 RaiseIfFailed("DifferenceList", self.GroupOp)
13096 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13097 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13098 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13100 # @ref swig_DifferenceIDs "Example"
13101 @ManageTransactions("GroupOp")
13102 def DifferenceIDs(self,theGroup, theSubShapes):
13104 Removes from the group all the given shapes. No errors, if some shapes are not included.
13107 theGroup is a GEOM group from which the sub-shapes are removed.
13108 theSubShapes is a list of indices of sub-shapes to be removed.
13110 # Example: see GEOM_TestOthers.py
13111 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13112 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13115 ## Union of two groups.
13116 # New group is created. It will contain all entities
13117 # which are present in groups theGroup1 and theGroup2.
13118 # @param theGroup1, theGroup2 are the initial GEOM groups
13119 # to create the united group from.
13120 # @param theName Object name; when specified, this parameter is used
13121 # for result publication in the study. Otherwise, if automatic
13122 # publication is switched on, default value is used for result name.
13124 # @return a newly created GEOM group.
13126 # @ref tui_union_groups_anchor "Example"
13127 @ManageTransactions("GroupOp")
13128 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13130 Union of two groups.
13131 New group is created. It will contain all entities
13132 which are present in groups theGroup1 and theGroup2.
13135 theGroup1, theGroup2 are the initial GEOM groups
13136 to create the united group from.
13137 theName Object name; when specified, this parameter is used
13138 for result publication in the study. Otherwise, if automatic
13139 publication is switched on, default value is used for result name.
13142 a newly created GEOM group.
13144 # Example: see GEOM_TestOthers.py
13145 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13146 RaiseIfFailed("UnionGroups", self.GroupOp)
13147 self._autoPublish(aGroup, theName, "group")
13150 ## Intersection of two groups.
13151 # New group is created. It will contain only those entities
13152 # which are present in both groups theGroup1 and theGroup2.
13153 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13154 # @param theName Object name; when specified, this parameter is used
13155 # for result publication in the study. Otherwise, if automatic
13156 # publication is switched on, default value is used for result name.
13158 # @return a newly created GEOM group.
13160 # @ref tui_intersect_groups_anchor "Example"
13161 @ManageTransactions("GroupOp")
13162 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13164 Intersection of two groups.
13165 New group is created. It will contain only those entities
13166 which are present in both groups theGroup1 and theGroup2.
13169 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13170 theName Object name; when specified, this parameter is used
13171 for result publication in the study. Otherwise, if automatic
13172 publication is switched on, default value is used for result name.
13175 a newly created GEOM group.
13177 # Example: see GEOM_TestOthers.py
13178 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13179 RaiseIfFailed("IntersectGroups", self.GroupOp)
13180 self._autoPublish(aGroup, theName, "group")
13183 ## Cut of two groups.
13184 # New group is created. It will contain entities which are
13185 # present in group theGroup1 but are not present in group theGroup2.
13186 # @param theGroup1 is a GEOM group to include elements of.
13187 # @param theGroup2 is a GEOM group to exclude elements of.
13188 # @param theName Object name; when specified, this parameter is used
13189 # for result publication in the study. Otherwise, if automatic
13190 # publication is switched on, default value is used for result name.
13192 # @return a newly created GEOM group.
13194 # @ref tui_cut_groups_anchor "Example"
13195 @ManageTransactions("GroupOp")
13196 def CutGroups (self, theGroup1, theGroup2, theName=None):
13199 New group is created. It will contain entities which are
13200 present in group theGroup1 but are not present in group theGroup2.
13203 theGroup1 is a GEOM group to include elements of.
13204 theGroup2 is a GEOM group to exclude 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.CutGroups(theGroup1, theGroup2)
13214 RaiseIfFailed("CutGroups", self.GroupOp)
13215 self._autoPublish(aGroup, theName, "group")
13218 ## Union of list of groups.
13219 # New group is created. It will contain all entities that are
13220 # present in groups listed in theGList.
13221 # @param theGList is a list of GEOM groups to create the united group from.
13222 # @param theName Object name; when specified, this parameter is used
13223 # for result publication in the study. Otherwise, if automatic
13224 # publication is switched on, default value is used for result name.
13226 # @return a newly created GEOM group.
13228 # @ref tui_union_groups_anchor "Example"
13229 @ManageTransactions("GroupOp")
13230 def UnionListOfGroups (self, theGList, theName=None):
13232 Union of list of groups.
13233 New group is created. It will contain all entities that are
13234 present in groups listed in theGList.
13237 theGList is a list of GEOM groups to create the united group from.
13238 theName Object name; when specified, this parameter is used
13239 for result publication in the study. Otherwise, if automatic
13240 publication is switched on, default value is used for result name.
13243 a newly created GEOM group.
13245 # Example: see GEOM_TestOthers.py
13246 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13247 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13248 self._autoPublish(aGroup, theName, "group")
13251 ## Cut of lists of groups.
13252 # New group is created. It will contain only entities
13253 # which are present in groups listed in theGList.
13254 # @param theGList is a list of GEOM groups to include elements of.
13255 # @param theName Object name; when specified, this parameter is used
13256 # for result publication in the study. Otherwise, if automatic
13257 # publication is switched on, default value is used for result name.
13259 # @return a newly created GEOM group.
13261 # @ref tui_intersect_groups_anchor "Example"
13262 @ManageTransactions("GroupOp")
13263 def IntersectListOfGroups (self, theGList, theName=None):
13265 Cut of lists of groups.
13266 New group is created. It will contain only entities
13267 which are present in groups listed in theGList.
13270 theGList is a list of GEOM groups to include elements of.
13271 theName Object name; when specified, this parameter is used
13272 for result publication in the study. Otherwise, if automatic
13273 publication is switched on, default value is used for result name.
13276 a newly created GEOM group.
13278 # Example: see GEOM_TestOthers.py
13279 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13280 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13281 self._autoPublish(aGroup, theName, "group")
13284 ## Cut of lists of groups.
13285 # New group is created. It will contain only entities
13286 # which are present in groups listed in theGList1 but
13287 # are not present in groups from theGList2.
13288 # @param theGList1 is a list of GEOM groups to include elements of.
13289 # @param theGList2 is a list of GEOM groups to exclude elements of.
13290 # @param theName Object name; when specified, this parameter is used
13291 # for result publication in the study. Otherwise, if automatic
13292 # publication is switched on, default value is used for result name.
13294 # @return a newly created GEOM group.
13296 # @ref tui_cut_groups_anchor "Example"
13297 @ManageTransactions("GroupOp")
13298 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13300 Cut of lists of groups.
13301 New group is created. It will contain only entities
13302 which are present in groups listed in theGList1 but
13303 are not present in groups from theGList2.
13306 theGList1 is a list of GEOM groups to include elements of.
13307 theGList2 is a list of GEOM groups to exclude elements of.
13308 theName Object name; when specified, this parameter is used
13309 for result publication in the study. Otherwise, if automatic
13310 publication is switched on, default value is used for result name.
13313 a newly created GEOM group.
13315 # Example: see GEOM_TestOthers.py
13316 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13317 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13318 self._autoPublish(aGroup, theName, "group")
13321 ## Returns a list of sub-objects ID stored in the group
13322 # @param theGroup is a GEOM group for which a list of IDs is requested
13324 # @ref swig_GetObjectIDs "Example"
13325 @ManageTransactions("GroupOp")
13326 def GetObjectIDs(self,theGroup):
13328 Returns a list of sub-objects ID stored in the group
13331 theGroup is a GEOM group for which a list of IDs is requested
13333 # Example: see GEOM_TestOthers.py
13334 ListIDs = self.GroupOp.GetObjects(theGroup)
13335 RaiseIfFailed("GetObjects", self.GroupOp)
13338 ## Returns a type of sub-objects stored in the group
13339 # @param theGroup is a GEOM group which type is returned.
13341 # @ref swig_GetType "Example"
13342 @ManageTransactions("GroupOp")
13343 def GetType(self,theGroup):
13345 Returns a type of sub-objects stored in the group
13348 theGroup is a GEOM group which type is returned.
13350 # Example: see GEOM_TestOthers.py
13351 aType = self.GroupOp.GetType(theGroup)
13352 RaiseIfFailed("GetType", self.GroupOp)
13355 ## Convert a type of geom object from id to string value
13356 # @param theId is a GEOM object type id.
13357 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13358 # @ref swig_GetType "Example"
13359 def ShapeIdToType(self, theId):
13361 Convert a type of geom object from id to string value
13364 theId is a GEOM object type id.
13367 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13394 return "REVOLUTION"
13442 return "FREE_BOUNDS"
13450 return "THRUSECTIONS"
13452 return "COMPOUNDFILTER"
13454 return "SHAPES_ON_SHAPE"
13456 return "ELLIPSE_ARC"
13458 return "3DSKETCHER"
13464 return "PIPETSHAPE"
13465 return "Shape Id not exist."
13467 ## Returns a main shape associated with the group
13468 # @param theGroup is a GEOM group for which a main shape object is requested
13469 # @return a GEOM object which is a main shape for theGroup
13471 # @ref swig_GetMainShape "Example"
13472 @ManageTransactions("GroupOp")
13473 def GetMainShape(self,theGroup):
13475 Returns a main shape associated with the group
13478 theGroup is a GEOM group for which a main shape object is requested
13481 a GEOM object which is a main shape for theGroup
13483 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13485 # Example: see GEOM_TestOthers.py
13486 anObj = self.GroupOp.GetMainShape(theGroup)
13487 RaiseIfFailed("GetMainShape", self.GroupOp)
13490 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13491 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13492 # @param theShape given shape (see GEOM.GEOM_Object)
13493 # @param min_length minimum length of edges of theShape
13494 # @param max_length maximum length of edges of theShape
13495 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13496 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13497 # @param theName Object name; when specified, this parameter is used
13498 # for result publication in the study. Otherwise, if automatic
13499 # publication is switched on, default value is used for result name.
13501 # @return a newly created GEOM group of edges
13503 # @@ref swig_todo "Example"
13504 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13506 Create group of edges of theShape, whose length is in range [min_length, max_length].
13507 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13510 theShape given shape
13511 min_length minimum length of edges of theShape
13512 max_length maximum length of edges of theShape
13513 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13514 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13515 theName Object name; when specified, this parameter is used
13516 for result publication in the study. Otherwise, if automatic
13517 publication is switched on, default value is used for result name.
13520 a newly created GEOM group of edges.
13522 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13523 edges_in_range = []
13525 Props = self.BasicProperties(edge)
13526 if min_length <= Props[0] and Props[0] <= max_length:
13527 if (not include_min) and (min_length == Props[0]):
13530 if (not include_max) and (Props[0] == max_length):
13533 edges_in_range.append(edge)
13535 if len(edges_in_range) <= 0:
13536 print("No edges found by given criteria")
13539 # note: auto-publishing is done in self.CreateGroup()
13540 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13541 self.UnionList(group_edges, edges_in_range)
13545 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13546 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13547 # @param min_length minimum length of edges of selected shape
13548 # @param max_length maximum length of edges of selected shape
13549 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13550 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13551 # @return a newly created GEOM group of edges
13552 # @ref swig_todo "Example"
13553 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13555 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13556 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13559 min_length minimum length of edges of selected shape
13560 max_length maximum length of edges of selected shape
13561 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13562 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13565 a newly created GEOM group of edges.
13567 nb_selected = sg.SelectedCount()
13568 if nb_selected < 1:
13569 print("Select a shape before calling this function, please.")
13571 if nb_selected > 1:
13572 print("Only one shape must be selected")
13575 id_shape = sg.getSelected(0)
13576 shape = IDToObject( id_shape )
13578 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13582 if include_min: left_str = " <= "
13583 if include_max: right_str = " <= "
13585 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13586 + left_str + "length" + right_str + repr(max_length))
13588 sg.updateObjBrowser()
13595 #@@ insert new functions before this line @@ do not remove this line @@#
13597 ## Create a copy of the given object
13599 # @param theOriginal geometry object for copy
13600 # @param theName Object name; when specified, this parameter is used
13601 # for result publication in the study. Otherwise, if automatic
13602 # publication is switched on, default value is used for result name.
13604 # @return New GEOM_Object, containing the copied shape.
13606 # @ingroup l1_geomBuilder_auxiliary
13607 # @ref swig_MakeCopy "Example"
13608 @ManageTransactions("InsertOp")
13609 def MakeCopy(self, theOriginal, theName=None):
13611 Create a copy of the given object
13614 theOriginal geometry object for copy
13615 theName Object name; when specified, this parameter is used
13616 for result publication in the study. Otherwise, if automatic
13617 publication is switched on, default value is used for result name.
13620 New GEOM_Object, containing the copied shape.
13622 Example of usage: Copy = geompy.MakeCopy(Box)
13624 # Example: see GEOM_TestAll.py
13625 anObj = self.InsertOp.MakeCopy(theOriginal)
13626 RaiseIfFailed("MakeCopy", self.InsertOp)
13627 self._autoPublish(anObj, theName, "copy")
13630 ## Add Path to load python scripts from
13631 # @param Path a path to load python scripts from
13632 # @ingroup l1_geomBuilder_auxiliary
13633 def addPath(self,Path):
13635 Add Path to load python scripts from
13638 Path a path to load python scripts from
13640 if (sys.path.count(Path) < 1):
13641 sys.path.append(Path)
13645 ## Load marker texture from the file
13646 # @param Path a path to the texture file
13647 # @return unique texture identifier
13648 # @ingroup l1_geomBuilder_auxiliary
13649 @ManageTransactions("InsertOp")
13650 def LoadTexture(self, Path):
13652 Load marker texture from the file
13655 Path a path to the texture file
13658 unique texture identifier
13660 # Example: see GEOM_TestAll.py
13661 ID = self.InsertOp.LoadTexture(Path)
13662 RaiseIfFailed("LoadTexture", self.InsertOp)
13665 ## Get internal name of the object based on its study entry
13666 # @note This method does not provide an unique identifier of the geometry object.
13667 # @note This is internal function of GEOM component, though it can be used outside it for
13668 # appropriate reason (e.g. for identification of geometry object).
13669 # @param obj geometry object
13670 # @return unique object identifier
13671 # @ingroup l1_geomBuilder_auxiliary
13672 def getObjectID(self, obj):
13674 Get internal name of the object based on its study entry.
13675 Note: this method does not provide an unique identifier of the geometry object.
13676 It is an internal function of GEOM component, though it can be used outside GEOM for
13677 appropriate reason (e.g. for identification of geometry object).
13680 obj geometry object
13683 unique object identifier
13686 entry = salome.ObjectToID(obj)
13687 if entry is not None:
13688 lst = entry.split(":")
13690 ID = lst[-1] # -1 means last item in the list
13691 return "GEOM_" + ID
13696 ## Add marker texture. @a Width and @a Height parameters
13697 # specify width and height of the texture in pixels.
13698 # If @a RowData is @c True, @a Texture parameter should represent texture data
13699 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13700 # parameter should be unpacked string, in which '1' symbols represent opaque
13701 # pixels and '0' represent transparent pixels of the texture bitmap.
13703 # @param Width texture width in pixels
13704 # @param Height texture height in pixels
13705 # @param Texture texture data
13706 # @param RowData if @c True, @a Texture data are packed in the byte stream
13707 # @return unique texture identifier
13708 # @ingroup l1_geomBuilder_auxiliary
13709 @ManageTransactions("InsertOp")
13710 def AddTexture(self, Width, Height, Texture, RowData=False):
13712 Add marker texture. Width and Height parameters
13713 specify width and height of the texture in pixels.
13714 If RowData is True, Texture parameter should represent texture data
13715 packed into the byte array. If RowData is False (default), Texture
13716 parameter should be unpacked string, in which '1' symbols represent opaque
13717 pixels and '0' represent transparent pixels of the texture bitmap.
13720 Width texture width in pixels
13721 Height texture height in pixels
13722 Texture texture data
13723 RowData if True, Texture data are packed in the byte stream
13726 return unique texture identifier
13728 if not RowData: Texture = PackData(Texture)
13729 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13730 RaiseIfFailed("AddTexture", self.InsertOp)
13733 ## Transfer not topological data from one GEOM object to another.
13735 # @param theObjectFrom the source object of non-topological data
13736 # @param theObjectTo the destination object of non-topological data
13737 # @param theFindMethod method to search sub-shapes of theObjectFrom
13738 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13739 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13740 # Other values of GEOM.find_shape_method are not supported.
13742 # @return True in case of success; False otherwise.
13744 # @ingroup l1_geomBuilder_auxiliary
13746 # @ref swig_TransferData "Example"
13747 @ManageTransactions("InsertOp")
13748 def TransferData(self, theObjectFrom, theObjectTo,
13749 theFindMethod=GEOM.FSM_GetInPlace):
13751 Transfer not topological data from one GEOM object to another.
13754 theObjectFrom the source object of non-topological data
13755 theObjectTo the destination object of non-topological data
13756 theFindMethod method to search sub-shapes of theObjectFrom
13757 in shape theObjectTo. Possible values are:
13758 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13759 and GEOM.FSM_GetInPlace_Old. Other values of
13760 GEOM.find_shape_method are not supported.
13763 True in case of success; False otherwise.
13765 # Example: see GEOM_TestOthers.py
13767 # Example: see GEOM_TestAll.py
13768 isOk = self.InsertOp.TransferData(theObjectFrom,
13769 theObjectTo, theFindMethod)
13770 RaiseIfFailed("TransferData", self.InsertOp)
13773 ## Creates a new folder object. It is a container for any GEOM objects.
13774 # @param Name name of the container
13775 # @param Father parent object. If None,
13776 # folder under 'Geometry' root object will be created.
13777 # @return a new created folder
13778 # @ingroup l1_publish_data
13779 def NewFolder(self, Name, Father=None):
13781 Create a new folder object. It is an auxiliary container for any GEOM objects.
13784 Name name of the container
13785 Father parent object. If None,
13786 folder under 'Geometry' root object will be created.
13789 a new created folder
13791 return self.CreateFolder(Name, Father)
13793 ## Move object to the specified folder
13794 # @param Object object to move
13795 # @param Folder target folder
13796 # @ingroup l1_publish_data
13797 def PutToFolder(self, Object, Folder):
13799 Move object to the specified folder
13802 Object object to move
13803 Folder target folder
13805 self.MoveToFolder(Object, Folder)
13808 ## Move list of objects to the specified folder
13809 # @param ListOfSO list of objects to move
13810 # @param Folder target folder
13811 # @ingroup l1_publish_data
13812 def PutListToFolder(self, ListOfSO, Folder):
13814 Move list of objects to the specified folder
13817 ListOfSO list of objects to move
13818 Folder target folder
13820 self.MoveListToFolder(ListOfSO, Folder)
13823 ## @addtogroup l2_field
13827 # @param shape the shape the field lies on
13828 # @param name the field name
13829 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13830 # @param dimension dimension of the shape the field lies on
13831 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13832 # @param componentNames names of components
13833 # @return a created field
13834 @ManageTransactions("FieldOp")
13835 def CreateField(self, shape, name, type, dimension, componentNames):
13840 shape the shape the field lies on
13841 name the field name
13842 type type of field data
13843 dimension dimension of the shape the field lies on
13844 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13845 componentNames names of components
13850 if isinstance( type, int ):
13851 if type < 0 or type > 3:
13852 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13853 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13855 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13856 RaiseIfFailed("CreateField", self.FieldOp)
13858 geom._autoPublish( f, "", name)
13861 ## Removes a field from the GEOM component
13862 # @param field the field to remove
13863 def RemoveField(self, field):
13864 "Removes a field from the GEOM component"
13866 if isinstance( field, GEOM._objref_GEOM_Field ):
13867 geom.RemoveObject( field )
13868 elif isinstance( field, geomField ):
13869 geom.RemoveObject( field.field )
13871 raise RuntimeError("RemoveField() : the object is not a field")
13874 ## Returns number of fields on a shape
13875 @ManageTransactions("FieldOp")
13876 def CountFields(self, shape):
13877 "Returns number of fields on a shape"
13878 nb = self.FieldOp.CountFields( shape )
13879 RaiseIfFailed("CountFields", self.FieldOp)
13882 ## Returns all fields on a shape
13883 @ManageTransactions("FieldOp")
13884 def GetFields(self, shape):
13885 "Returns all fields on a shape"
13886 ff = self.FieldOp.GetFields( shape )
13887 RaiseIfFailed("GetFields", self.FieldOp)
13890 ## Returns a field on a shape by its name
13891 @ManageTransactions("FieldOp")
13892 def GetField(self, shape, name):
13893 "Returns a field on a shape by its name"
13894 f = self.FieldOp.GetField( shape, name )
13895 RaiseIfFailed("GetField", self.FieldOp)
13902 # Register the new proxy for GEOM_Gen
13903 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13906 ## Field on Geometry
13907 # @ingroup l2_field
13908 class geomField( GEOM._objref_GEOM_Field ):
13910 def __init__(self, *args):
13911 GEOM._objref_GEOM_Field.__init__(self, *args)
13912 self.field = GEOM._objref_GEOM_Field
13915 ## Returns the shape the field lies on
13916 def getShape(self):
13917 "Returns the shape the field lies on"
13918 return self.field.GetShape(self)
13920 ## Returns the field name
13922 "Returns the field name"
13923 return self.field.GetName(self)
13925 ## Returns type of field data as integer [0-3]
13927 "Returns type of field data"
13928 return EnumToLong(self.field.GetDataType(self))
13930 ## Returns type of field data:
13931 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13932 def getTypeEnum(self):
13933 "Returns type of field data"
13934 return self.field.GetDataType(self)
13936 ## Returns dimension of the shape the field lies on:
13937 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13938 def getDimension(self):
13939 """Returns dimension of the shape the field lies on:
13940 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13941 return self.field.GetDimension(self)
13943 ## Returns names of components
13944 def getComponents(self):
13945 "Returns names of components"
13946 return self.field.GetComponents(self)
13948 ## Adds a time step to the field
13949 # @param step the time step number further used as the step identifier
13950 # @param stamp the time step time
13951 # @param values the values of the time step
13952 def addStep(self, step, stamp, values):
13953 "Adds a time step to the field"
13954 stp = self.field.AddStep( self, step, stamp )
13956 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
13958 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13959 self.setValues( step, values )
13962 ## Remove a time step from the field
13963 def removeStep(self,step):
13964 "Remove a time step from the field"
13967 stepObj = self.field.GetStep( self, step )
13969 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13972 #traceback.print_exc()
13974 self.field.RemoveStep( self, step )
13976 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13979 ## Returns number of time steps in the field
13980 def countSteps(self):
13981 "Returns number of time steps in the field"
13982 return self.field.CountSteps(self)
13984 ## Returns a list of time step IDs in the field
13985 def getSteps(self):
13986 "Returns a list of time step IDs in the field"
13987 return self.field.GetSteps(self)
13989 ## Returns a time step by its ID
13990 def getStep(self,step):
13991 "Returns a time step by its ID"
13992 stp = self.field.GetStep(self, step)
13994 raise RuntimeError("Step %s is missing from this field"%step)
13997 ## Returns the time of the field step
13998 def getStamp(self,step):
13999 "Returns the time of the field step"
14000 return self.getStep(step).GetStamp()
14002 ## Changes the time of the field step
14003 def setStamp(self, step, stamp):
14004 "Changes the time of the field step"
14005 return self.getStep(step).SetStamp(stamp)
14007 ## Returns values of the field step
14008 def getValues(self, step):
14009 "Returns values of the field step"
14010 return self.getStep(step).GetValues()
14012 ## Changes values of the field step
14013 def setValues(self, step, values):
14014 "Changes values of the field step"
14015 stp = self.getStep(step)
14016 errBeg = "Field.setValues(values) : Error: "
14018 ok = stp.SetValues( values )
14019 except Exception as e:
14021 if excStr.find("WrongPythonType") > 0:
14022 raise RuntimeError(errBeg +\
14023 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14024 raise RuntimeError(errBeg + str(e))
14026 nbOK = self.field.GetArraySize(self)
14029 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14031 raise RuntimeError(errBeg + "failed")
14034 pass # end of class geomField
14036 # Register the new proxy for GEOM_Field
14037 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14040 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14041 # interface to GEOM operations.
14046 # salome.salome_init()
14047 # from salome.geom import geomBuilder
14048 # geompy = geomBuilder.New()
14050 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14051 # @return geomBuilder instance
14052 def New( instance=None):
14054 Create a new geomBuilder instance.The geomBuilder class provides the Python
14055 interface to GEOM operations.
14059 salome.salome_init()
14060 from salome.geom import geomBuilder
14061 geompy = geomBuilder.New()
14064 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14066 geomBuilder instance
14068 #print "New geomBuilder ", study, instance
14072 if instance and isinstance( instance, SALOMEDS._objref_Study ):
14074 sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14079 geom = geomBuilder()
14080 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14085 # Register methods from the plug-ins in the geomBuilder class
14086 plugins_var = os.environ.get( "GEOM_PluginsList" )
14089 if plugins_var is not None:
14090 plugins = plugins_var.split( ":" )
14091 plugins=[x for x in plugins if len(x)>0]
14092 if plugins is not None:
14093 for pluginName in plugins:
14094 pluginBuilderName = pluginName + "Builder"
14096 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14097 except Exception as e:
14098 from salome_utils import verbose
14099 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14101 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14102 plugin = eval( pluginBuilderName )
14104 # add methods from plugin module to the geomBuilder class
14105 for k in dir( plugin ):
14106 if k[0] == '_': continue
14107 method = getattr( plugin, k )
14108 if type( method ).__name__ == 'function':
14109 if not hasattr( geomBuilder, k ):
14110 setattr( geomBuilder, k, method )