1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2022 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
240 ## @defgroup l2_testing Testing
246 # initialize SALOME session in try/except block
247 # to avoid problems in some cases, e.g. when generating documentation
255 from salome_notebook import *
262 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
264 # In case the omniORBpy EnumItem class does not fully support Python 3
265 # (for instance in version 4.2.1-2), the comparison ordering methods must be
269 GEOM.COMPOUND < GEOM.SOLID
271 def enumitem_eq(self, other):
273 if isinstance(other, omniORB.EnumItem):
274 if other._parent_id == self._parent_id:
275 return self._v == other._v
277 return self._parent_id == other._parent_id
279 return id(self) == id(other)
281 return id(self) == id(other)
283 def enumitem_lt(self, other):
285 if isinstance(other, omniORB.EnumItem):
286 if other._parent_id == self._parent_id:
287 return self._v < other._v
289 return self._parent_id < other._parent_id
291 return id(self) < id(other)
293 return id(self) < id(other)
295 def enumitem_le(self, other):
297 if isinstance(other, omniORB.EnumItem):
298 if other._parent_id == self._parent_id:
299 return self._v <= other._v
301 return self._parent_id <= other._parent_id
303 return id(self) <= id(other)
305 return id(self) <= id(other)
307 def enumitem_gt(self, other):
309 if isinstance(other, omniORB.EnumItem):
310 if other._parent_id == self._parent_id:
311 return self._v > other._v
313 return self._parent_id > other._parent_id
315 return id(self) > id(other)
317 return id(self) > id(other)
319 def enumitem_ge(self, other):
321 if isinstance(other, omniORB.EnumItem):
322 if other._parent_id == self._parent_id:
323 return self._v >= other._v
325 return self._parent_id >= other._parent_id
327 return id(self) >= id(other)
329 return id(self) >= id(other)
331 GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
332 GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
333 GEOM.omniORB.EnumItem.__le__ = enumitem_le
334 GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
335 GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
336 omniORB.EnumItem.__eq__ = enumitem_eq
337 omniORB.EnumItem.__lt__ = enumitem_lt
338 omniORB.EnumItem.__le__ = enumitem_le
339 omniORB.EnumItem.__gt__ = enumitem_gt
340 omniORB.EnumItem.__ge__ = enumitem_ge
343 def _toListOfNames(_names, _size=-1):
346 if type(_names) in [list, tuple]:
347 for i in _names: l.append(i)
350 if l and len(l) < _size:
351 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
354 # Decorator function to manage transactions for all geometric operations.
355 def ManageTransactions(theOpeName):
356 def MTDecorator(theFunction):
357 # To keep the original function name an documentation.
358 @functools.wraps(theFunction)
359 def OpenCallClose(self, *args, **kwargs):
361 anOperation = getattr(self, theOpeName)
362 anOperation.StartOperation()
365 res = theFunction(self, *args, **kwargs)
367 anOperation.FinishOperation()
371 anOperation.AbortOperation()
376 ## Raise an Error, containing the Method_name, if Operation is Failed
377 ## @ingroup l1_geomBuilder_auxiliary
378 def RaiseIfFailed (Method_name, Operation):
379 if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
380 raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
382 ## Return list of variables value from salome notebook
383 ## @ingroup l1_geomBuilder_auxiliary
384 def ParseParameters(*parameters):
387 for parameter in parameters:
388 if isinstance(parameter, list):
389 lResults = ParseParameters(*parameter)
390 if len(lResults) > 0:
391 Result.append(lResults[:-1])
392 StringResult += lResults[-1].split(":")
396 if isinstance(parameter,str):
397 if notebook.isVariable(parameter):
398 Result.append(notebook.get(parameter))
400 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
403 Result.append(parameter)
405 StringResult.append(str(parameter))
409 Result.append(":".join(StringResult))
411 Result = ":".join(StringResult)
414 ## Return list of variables value from salome notebook
415 ## @ingroup l1_geomBuilder_auxiliary
419 for parameter in list:
420 if isinstance(parameter,str) and notebook.isVariable(parameter):
421 Result.append(str(notebook.get(parameter)))
424 Result.append(str(parameter))
427 StringResult = StringResult + str(parameter)
428 StringResult = StringResult + ":"
430 StringResult = StringResult[:len(StringResult)-1]
431 return Result, StringResult
433 ## Return list of variables value from salome notebook
434 ## @ingroup l1_geomBuilder_auxiliary
435 def ParseSketcherCommand(command):
438 sections = command.split(":")
439 for section in sections:
440 parameters = section.split(" ")
442 for parameter in parameters:
443 if paramIndex > 1 and parameter.find("'") != -1:
444 parameter = parameter.replace("'","")
445 if notebook.isVariable(parameter):
446 Result = Result + str(notebook.get(parameter)) + " "
449 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
453 Result = Result + str(parameter) + " "
456 StringResult = StringResult + parameter
457 StringResult = StringResult + ":"
459 paramIndex = paramIndex + 1
461 Result = Result[:len(Result)-1] + ":"
463 Result = Result[:len(Result)-1]
464 return Result, StringResult
466 ## Helper function which can be used to pack the passed string to the byte data.
467 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
468 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
471 ## val = PackData("10001110") # val = 0xAE
472 ## val = PackData("1") # val = 0x80
474 ## @param data unpacked data - a string containing '1' and '0' symbols
475 ## @return data packed to the byte stream
476 ## @ingroup l1_geomBuilder_auxiliary
479 Helper function which can be used to pack the passed string to the byte data.
480 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
481 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
484 data unpacked data - a string containing '1' and '0' symbols
487 data packed to the byte stream
490 val = PackData("10001110") # val = 0xAE
491 val = PackData("1") # val = 0x80
494 if len(data)%8: bytes += 1
496 for b in range(bytes):
497 d = data[b*8:(b+1)*8]
502 if d[i] == "1": val += 1
504 raise "Invalid symbol %s" % d[i]
511 ## Read bitmap texture from the text file.
512 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
513 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
514 ## The function returns width and height of the pixmap in pixels and byte stream representing
515 ## texture bitmap itself.
517 ## This function can be used to read the texture to the byte stream in order to pass it to
518 ## the AddTexture() function of geomBuilder class.
521 ## from salome.geom import geomBuilder
522 ## geompy = geomBuilder.New()
523 ## texture = geompy.readtexture('mytexture.dat')
524 ## texture = geompy.AddTexture(*texture)
525 ## obj.SetMarkerTexture(texture)
527 ## @param fname texture file name
528 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
529 ## @ingroup l1_geomBuilder_auxiliary
530 def ReadTexture(fname):
532 Read bitmap texture from the text file.
533 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
534 A zero symbol ('0') represents transparent pixel of the texture bitmap.
535 The function returns width and height of the pixmap in pixels and byte stream representing
536 texture bitmap itself.
537 This function can be used to read the texture to the byte stream in order to pass it to
538 the AddTexture() function of geomBuilder class.
541 fname texture file name
544 sequence of tree values: texture's width, height in pixels and its byte stream
547 from salome.geom import geomBuilder
548 geompy = geomBuilder.New()
549 texture = geompy.readtexture('mytexture.dat')
550 texture = geompy.AddTexture(*texture)
551 obj.SetMarkerTexture(texture)
555 lines = [ l.strip() for l in f.readlines()]
558 if lines: maxlen = max([len(x) for x in lines])
560 if maxlen%8: lenbytes += 1
564 lenline = (len(line)/8+1)*8
567 lenline = (len(line)/8)*8
569 for i in range(lenline/8):
572 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
575 bytedata += PackData(byte)
577 for i in range(lenline/8, lenbytes):
578 bytedata += PackData("0")
580 return lenbytes*8, len(lines), bytedata
585 ## Returns a long value from enumeration type
586 # Can be used for CORBA enumerator types like GEOM.shape_type
587 # @param theItem enumeration type
588 # @ingroup l1_geomBuilder_auxiliary
589 def EnumToLong(theItem):
591 Returns a long value from enumeration type
592 Can be used for CORBA enumerator types like geomBuilder.ShapeType
595 theItem enumeration type
598 if hasattr(theItem, "_v"): ret = theItem._v
601 ## Pack an argument into a list
603 if isinstance( arg, list ):
605 if hasattr( arg, "__getitem__" ):
609 ## Information about closed/unclosed state of shell or wire
610 # @ingroup l1_geomBuilder_auxiliary
613 Information about closed/unclosed state of shell or wire
619 ## Private class used to bind calls of plugin operations to geomBuilder
620 class PluginOperation:
621 def __init__(self, operation, function):
622 self.operation = operation
623 self.function = function
626 @ManageTransactions("operation")
627 def __call__(self, *args):
628 res = self.function(self.operation, *args)
629 RaiseIfFailed(self.function.__name__, self.operation)
632 # Warning: geom is a singleton
638 class geomBuilder(GEOM._objref_GEOM_Gen):
640 ## Enumeration ShapeType as a dictionary. \n
641 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
642 # @ingroup l1_geomBuilder_auxiliary
643 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
645 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
646 # and a list of parameters, describing the shape.
647 # List of parameters, describing the shape:
648 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
649 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
651 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
653 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
655 # - SPHERE: [xc yc zc R]
656 # - CYLINDER: [xb yb zb dx dy dz R H]
657 # - BOX: [xc yc zc ax ay az]
658 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
659 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
660 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
661 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
662 # - SOLID: [nb_faces nb_edges nb_vertices]
664 # - SPHERE2D: [xc yc zc R]
665 # - CYLINDER2D: [xb yb zb dx dy dz R H]
666 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
667 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
668 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
669 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
670 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
671 # - PLANE: [xo yo zo dx dy dz]
672 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
673 # - FACE: [nb_edges nb_vertices]
675 # - CIRCLE: [xc yc zc dx dy dz R]
676 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
677 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
678 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
679 # - LINE: [xo yo zo dx dy dz]
680 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
681 # - EDGE: [nb_vertices]
685 # - LCS: [x y z xx xy xz yx yy yz zx zy zz]
686 # @ingroup l1_geomBuilder_auxiliary
687 kind = GEOM.GEOM_IKindOfShape
689 def __new__(cls, *args):
694 #print "==== __new__ ", engine, geom, doLcc, created
696 # geom engine is either retrieved from engine, or created
698 # Following test avoids a recursive loop
701 # geom engine not created: existing engine found
703 if doLcc and not created:
705 # FindOrLoadComponent called:
706 # 1. CORBA resolution of server
707 # 2. the __new__ method is called again
708 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
709 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
712 # FindOrLoadComponent not called
714 # geomBuilder instance is created from lcc.FindOrLoadComponent
715 #print "==== super ", engine, geom, doLcc, created
716 geom = super(geomBuilder,cls).__new__(cls)
719 # geom engine not created: existing engine found
720 #print "==== existing ", engine, geom, doLcc, created
722 #print "return geom 1 ", geom
725 #print "return geom 2 ", geom
728 def __init__(self, *args):
730 #print "-------- geomBuilder __init__ --- ", created, self
733 GEOM._objref_GEOM_Gen.__init__(self, *args)
734 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
735 self.myBuilder = None
752 ## Process object publication in the study, as follows:
753 # - if @a theName is specified (not None), the object is published in the study
754 # with this name, not taking into account "auto-publishing" option;
755 # - if @a theName is NOT specified, the object is published in the study
756 # (using default name, which can be customized using @a theDefaultName parameter)
757 # only if auto-publishing is switched on.
759 # @param theObj object, a subject for publishing
760 # @param theName object name for study
761 # @param theDefaultName default name for the auto-publishing
763 # @sa addToStudyAuto()
764 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
766 def _item_name(_names, _defname, _idx=-1):
767 if not _names: _names = _defname
768 if type(_names) in [list, tuple]:
770 if _idx >= len(_names) or not _names[_idx]:
771 if type(_defname) not in [list, tuple]:
772 _name = "%s_%d"%(_defname, _idx+1)
773 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
774 _name = _defname[_idx]
776 _name = "%noname_%d"%(dn, _idx+1)
782 # must be wrong usage
787 _name = "%s_%d"%(_names, _idx+1)
793 def _publish( _name, _obj ):
795 if isinstance( _obj, GEOM._objref_GEOM_Field ):
796 fatherObj = _obj.GetShape()
797 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
798 fatherObj = _obj.GetField()
799 elif not _obj.IsMainShape():
800 fatherObj = _obj.GetMainShape()
802 if fatherObj and fatherObj.GetStudyEntry():
803 self.addToStudyInFather(fatherObj, _obj, _name)
805 self.addToStudy(_obj, _name)
811 if not theName and not self.myMaxNbSubShapesAllowed:
812 return # nothing to do: auto-publishing is disabled
813 if not theName and not theDefaultName:
814 return # neither theName nor theDefaultName is given
816 if type(theObj) in [list, tuple]:
817 # list of objects is being published
820 if not obj: continue # bad object
821 name = _item_name(theName, theDefaultName, idx)
822 _publish( name, obj )
824 if not theName and idx == self.myMaxNbSubShapesAllowed: break
828 # single object is published
829 name = _item_name(theName, theDefaultName)
830 _publish( name, theObj )
833 ## @addtogroup l1_geomBuilder_auxiliary
836 self.myStudy = salome.myStudy
837 self.myBuilder = self.myStudy.NewBuilder()
839 # load data from the study file, if necessary
840 component = self.myStudy.FindComponent("GEOM")
842 self.myBuilder.LoadWith(component, self)
844 self.BasicOp = self.GetIBasicOperations ()
845 self.CurvesOp = self.GetICurvesOperations ()
846 self.PrimOp = self.GetI3DPrimOperations ()
847 self.ShapesOp = self.GetIShapesOperations ()
848 self.HealOp = self.GetIHealingOperations ()
849 self.InsertOp = self.GetIInsertOperations ()
850 self.BoolOp = self.GetIBooleanOperations ()
851 self.TrsfOp = self.GetITransformOperations()
852 self.LocalOp = self.GetILocalOperations ()
853 self.MeasuOp = self.GetIMeasureOperations ()
854 self.BlocksOp = self.GetIBlocksOperations ()
855 self.GroupOp = self.GetIGroupOperations ()
856 self.FieldOp = self.GetIFieldOperations ()
857 self.TestOp = self.GetITestOperations ()
859 notebook.myStudy = self.myStudy
862 def GetPluginOperations(self, libraryName):
863 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
866 ## Enable / disable results auto-publishing
868 # The automatic publishing is managed in the following way:
869 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
870 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
871 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
872 # value passed as parameter has the same effect.
873 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
874 # maximum number of sub-shapes allowed for publishing is set to specified value.
876 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
877 # @ingroup l1_publish_data
878 def addToStudyAuto(self, maxNbSubShapes=-1):
880 Enable / disable results auto-publishing
882 The automatic publishing is managed in the following way:
883 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
884 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
885 maximum number of sub-shapes allowed for publishing is unlimited; any negative
886 value passed as parameter has the same effect.
887 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
888 maximum number of sub-shapes allowed for publishing is set to this value.
891 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
894 geompy.addToStudyAuto() # enable auto-publishing
895 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
896 geompy.addToStudyAuto(0) # disable auto-publishing
898 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
901 ## Dump component to the Python script
902 # This method overrides IDL function to allow default values for the parameters.
903 def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
905 Dump component to the Python script
906 This method overrides IDL function to allow default values for the parameters.
908 return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
910 ## Get name for sub-shape aSubObj of shape aMainObj
912 # @ref swig_SubShapeName "Example"
913 @ManageTransactions("ShapesOp")
914 def SubShapeName(self,aSubObj, aMainObj):
916 Get name for sub-shape aSubObj of shape aMainObj
918 # Example: see GEOM_TestAll.py
920 #aSubId = orb.object_to_string(aSubObj)
921 #aMainId = orb.object_to_string(aMainObj)
922 #index = gg.getIndexTopology(aSubId, aMainId)
923 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
924 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
925 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
928 ## Publish in study aShape with name aName
930 # \param aShape the shape to be published
931 # \param aName the name for the shape
932 # \param doRestoreSubShapes if True, finds and publishes also
933 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
934 # and published sub-shapes of arguments
935 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
936 # these arguments description
937 # \return study entry of the published shape in form of string
939 # @ingroup l1_publish_data
940 # @ref swig_all_addtostudy "Example"
941 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
942 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
944 Publish in study aShape with name aName
947 aShape the shape to be published
948 aName the name for the shape
949 doRestoreSubShapes if True, finds and publishes also
950 sub-shapes of aShape, corresponding to its arguments
951 and published sub-shapes of arguments
952 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
953 these arguments description
956 study entry of the published shape in form of string
959 id_block1 = geompy.addToStudy(Block1, "Block 1")
961 # Example: see GEOM_TestAll.py
963 aSObject = self.AddInStudy(aShape, aName, None)
964 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
965 if doRestoreSubShapes:
966 self.RestoreSubShapesSO(aSObject, theArgs,
967 theFindMethod, theInheritFirstArg, True )
969 print("addToStudy() failed")
971 return aShape.GetStudyEntry()
973 ## Publish in study aShape with name aName as sub-object of previously published aFather
974 # \param aFather previously published object
975 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
976 # \param aName the name for the shape
978 # \return study entry of the published shape in form of string
980 # @ingroup l1_publish_data
981 # @ref swig_all_addtostudyInFather "Example"
982 def addToStudyInFather(self, aFather, aShape, aName):
984 Publish in study aShape with name aName as sub-object of previously published aFather
987 aFather previously published object
988 aShape the shape to be published as sub-object of aFather
989 aName the name for the shape
992 study entry of the published shape in form of string
994 # Example: see GEOM_TestAll.py
996 aSObject = self.AddInStudy(aShape, aName, aFather)
997 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
999 print("addToStudyInFather() failed")
1001 return aShape.GetStudyEntry()
1003 ## Unpublish object in study
1005 # \param obj the object to be unpublished
1006 def hideInStudy(self, obj):
1008 Unpublish object in study
1011 obj the object to be unpublished
1013 ior = salome.orb.object_to_string(obj)
1014 aSObject = self.myStudy.FindObjectIOR(ior)
1015 if aSObject is not None:
1016 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1017 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1018 drwAttribute.SetDrawable(False)
1019 # hide references if any
1020 vso = self.myStudy.FindDependances(aSObject);
1022 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1023 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1024 drwAttribute.SetDrawable(False)
1028 # end of l1_geomBuilder_auxiliary
1031 ## @addtogroup l3_restore_ss
1034 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1035 # To be used from python scripts out of addToStudy() (non-default usage)
1036 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1037 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1038 # If this list is empty, all operation arguments will be published
1039 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1040 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
1041 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1042 # Do not publish sub-shapes in place of arguments, but only
1043 # in place of sub-shapes of the first argument,
1044 # because the whole shape corresponds to the first argument.
1045 # Mainly to be used after transformations, but it also can be
1046 # useful after partition with one object shape, and some other
1047 # operations, where only the first argument has to be considered.
1048 # If theObject has only one argument shape, this flag is automatically
1049 # considered as True, not regarding really passed value.
1050 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1051 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1052 # \return list of published sub-shapes
1054 # @ref tui_restore_prs_params "Example"
1055 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1056 theInheritFirstArg=False, theAddPrefix=True):
1058 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1059 To be used from python scripts out of geompy.addToStudy (non-default usage)
1062 theObject published GEOM.GEOM_Object, arguments of which will be published
1063 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1064 If this list is empty, all operation arguments will be published
1065 theFindMethod method to search sub-shapes, corresponding to arguments and
1066 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1067 theInheritFirstArg set properties of the first argument for theObject.
1068 Do not publish sub-shapes in place of arguments, but only
1069 in place of sub-shapes of the first argument,
1070 because the whole shape corresponds to the first argument.
1071 Mainly to be used after transformations, but it also can be
1072 useful after partition with one object shape, and some other
1073 operations, where only the first argument has to be considered.
1074 If theObject has only one argument shape, this flag is automatically
1075 considered as True, not regarding really passed value.
1076 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1077 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1079 list of published sub-shapes
1081 # Example: see GEOM_TestAll.py
1082 return self.RestoreSubShapesO(theObject, theArgs,
1083 theFindMethod, theInheritFirstArg, theAddPrefix)
1085 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1086 # To be used from python scripts out of addToStudy() (non-default usage)
1087 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1088 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1089 # If this list is empty, all operation arguments will be published
1090 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1091 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1092 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1093 # Do not publish sub-shapes in place of arguments, but only
1094 # in place of sub-shapes of the first argument,
1095 # because the whole shape corresponds to the first argument.
1096 # Mainly to be used after transformations, but it also can be
1097 # useful after partition with one object shape, and some other
1098 # operations, where only the first argument has to be considered.
1099 # If theObject has only one argument shape, this flag is automatically
1100 # considered as True, not regarding really passed value.
1101 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1102 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1103 # \return list of published sub-shapes
1105 # @ref tui_restore_prs_params "Example"
1106 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1107 theInheritFirstArg=False, theAddPrefix=True):
1109 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1110 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1113 theObject published GEOM.GEOM_Object, arguments of which will be published
1114 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1115 If this list is empty, all operation arguments will be published
1116 theFindMethod method to search sub-shapes, corresponding to arguments and
1117 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1118 theInheritFirstArg set properties of the first argument for theObject.
1119 Do not publish sub-shapes in place of arguments, but only
1120 in place of sub-shapes of the first argument,
1121 because the whole shape corresponds to the first argument.
1122 Mainly to be used after transformations, but it also can be
1123 useful after partition with one object shape, and some other
1124 operations, where only the first argument has to be considered.
1125 If theObject has only one argument shape, this flag is automatically
1126 considered as True, not regarding really passed value.
1127 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1128 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1131 list of published sub-shapes
1133 # Example: see GEOM_TestAll.py
1134 return self.RestoreGivenSubShapesO(theObject, theArgs,
1135 theFindMethod, theInheritFirstArg, theAddPrefix)
1137 # end of l3_restore_ss
1140 ## @addtogroup l3_basic_go
1143 ## Create point by three coordinates.
1144 # @param theX The X coordinate of the point.
1145 # @param theY The Y coordinate of the point.
1146 # @param theZ The Z coordinate of the point.
1147 # @param theName Object name; when specified, this parameter is used
1148 # for result publication in the study. Otherwise, if automatic
1149 # publication is switched on, default value is used for result name.
1151 # @return New GEOM.GEOM_Object, containing the created point.
1153 # @ref tui_creation_point "Example"
1154 @ManageTransactions("BasicOp")
1155 def MakeVertex(self, theX, theY, theZ, theName=None):
1157 Create point by three coordinates.
1160 theX The X coordinate of the point.
1161 theY The Y coordinate of the point.
1162 theZ The Z coordinate of the point.
1163 theName Object name; when specified, this parameter is used
1164 for result publication in the study. Otherwise, if automatic
1165 publication is switched on, default value is used for result name.
1168 New GEOM.GEOM_Object, containing the created point.
1170 # Example: see GEOM_TestAll.py
1171 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1172 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1173 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1174 anObj.SetParameters(Parameters)
1175 self._autoPublish(anObj, theName, "vertex")
1178 ## Create a point, distant from the referenced point
1179 # on the given distances along the coordinate axes.
1180 # @param theReference The referenced point.
1181 # @param theX Displacement from the referenced point along OX axis.
1182 # @param theY Displacement from the referenced point along OY axis.
1183 # @param theZ Displacement from the referenced point along OZ axis.
1184 # @param theName Object name; when specified, this parameter is used
1185 # for result publication in the study. Otherwise, if automatic
1186 # publication is switched on, default value is used for result name.
1188 # @return New GEOM.GEOM_Object, containing the created point.
1190 # @ref tui_creation_point "Example"
1191 @ManageTransactions("BasicOp")
1192 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1194 Create a point, distant from the referenced point
1195 on the given distances along the coordinate axes.
1198 theReference The referenced point.
1199 theX Displacement from the referenced point along OX axis.
1200 theY Displacement from the referenced point along OY axis.
1201 theZ Displacement from the referenced point along OZ axis.
1202 theName Object name; when specified, this parameter is used
1203 for result publication in the study. Otherwise, if automatic
1204 publication is switched on, default value is used for result name.
1207 New GEOM.GEOM_Object, containing the created point.
1209 # Example: see GEOM_TestAll.py
1210 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1211 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1212 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1213 anObj.SetParameters(Parameters)
1214 self._autoPublish(anObj, theName, "vertex")
1217 ## Create a point, corresponding to the given parameter on the given curve.
1218 # @param theRefCurve The referenced curve.
1219 # @param theParameter Value of parameter on the referenced curve.
1220 # @param takeOrientationIntoAccount flag that tells if it is necessary
1221 # to take the curve's orientation into account for the
1222 # operation. I.e. if this flag is set, the results for the same
1223 # parameters (except the value 0.5) is different for forward
1224 # and reversed curves. If it is not set the result is the same.
1225 # @param theName Object name; when specified, this parameter is used
1226 # for result publication in the study. Otherwise, if automatic
1227 # publication is switched on, default value is used for result name.
1229 # @return New GEOM.GEOM_Object, containing the created point.
1231 # @ref tui_creation_point "Example"
1232 @ManageTransactions("BasicOp")
1233 def MakeVertexOnCurve(self, theRefCurve, theParameter,
1234 takeOrientationIntoAccount=False, theName=None):
1236 Create a point, corresponding to the given parameter on the given curve.
1239 theRefCurve The referenced curve.
1240 theParameter Value of parameter on the referenced curve.
1241 takeOrientationIntoAccount flag that tells if it is necessary
1242 to take the curve's orientation into account for the
1243 operation. I.e. if this flag is set, the results for
1244 the same parameters (except the value 0.5) is different
1245 for forward and reversed curves. If it is not set
1246 the result is the same.
1247 theName Object name; when specified, this parameter is used
1248 for result publication in the study. Otherwise, if automatic
1249 publication is switched on, default value is used for result name.
1252 New GEOM.GEOM_Object, containing the created point.
1255 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1257 # Example: see GEOM_TestAll.py
1258 theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1259 theParameter, takeOrientationIntoAccount)
1260 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1261 takeOrientationIntoAccount)
1262 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1263 anObj.SetParameters(Parameters)
1264 self._autoPublish(anObj, theName, "vertex")
1267 ## Create a point by projection give coordinates on the given curve
1268 # @param theRefCurve The referenced curve.
1269 # @param theX X-coordinate in 3D space
1270 # @param theY Y-coordinate in 3D space
1271 # @param theZ Z-coordinate in 3D space
1272 # @param theName Object name; when specified, this parameter is used
1273 # for result publication in the study. Otherwise, if automatic
1274 # publication is switched on, default value is used for result name.
1276 # @return New GEOM.GEOM_Object, containing the created point.
1278 # @ref tui_creation_point "Example"
1279 @ManageTransactions("BasicOp")
1280 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1282 Create a point by projection give coordinates on the given curve
1285 theRefCurve The referenced curve.
1286 theX X-coordinate in 3D space
1287 theY Y-coordinate in 3D space
1288 theZ Z-coordinate in 3D space
1289 theName Object name; when specified, this parameter is used
1290 for result publication in the study. Otherwise, if automatic
1291 publication is switched on, default value is used for result name.
1294 New GEOM.GEOM_Object, containing the created point.
1297 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1299 # Example: see GEOM_TestAll.py
1300 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1301 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1302 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1303 anObj.SetParameters(Parameters)
1304 self._autoPublish(anObj, theName, "vertex")
1307 ## Create a point, corresponding to the given length on the given curve.
1308 # @param theRefCurve The referenced curve.
1309 # @param theLength Length on the referenced curve. It can be negative.
1310 # @param theStartPoint Point allowing to choose the direction for the calculation
1311 # of the length. If None, start from the first point of theRefCurve.
1312 # @param theName Object name; when specified, this parameter is used
1313 # for result publication in the study. Otherwise, if automatic
1314 # publication is switched on, default value is used for result name.
1316 # @return New GEOM.GEOM_Object, containing the created point.
1318 # @ref tui_creation_point "Example"
1319 @ManageTransactions("BasicOp")
1320 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1322 Create a point, corresponding to the given length on the given curve.
1325 theRefCurve The referenced curve.
1326 theLength Length on the referenced curve. It can be negative.
1327 theStartPoint Point allowing to choose the direction for the calculation
1328 of the length. If None, start from the first point of theRefCurve.
1329 theName Object name; when specified, this parameter is used
1330 for result publication in the study. Otherwise, if automatic
1331 publication is switched on, default value is used for result name.
1334 New GEOM.GEOM_Object, containing the created point.
1336 # Example: see GEOM_TestAll.py
1337 theLength, Parameters = ParseParameters(theLength)
1338 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1339 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1340 anObj.SetParameters(Parameters)
1341 self._autoPublish(anObj, theName, "vertex")
1344 ## Create a point, corresponding to the given parameters on the
1346 # @param theRefSurf The referenced surface.
1347 # @param theUParameter Value of U-parameter on the referenced surface.
1348 # @param theVParameter Value of V-parameter on the referenced surface.
1349 # @param theName Object name; when specified, this parameter is used
1350 # for result publication in the study. Otherwise, if automatic
1351 # publication is switched on, default value is used for result name.
1353 # @return New GEOM.GEOM_Object, containing the created point.
1355 # @ref swig_MakeVertexOnSurface "Example"
1356 @ManageTransactions("BasicOp")
1357 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1359 Create a point, corresponding to the given parameters on the
1363 theRefSurf The referenced surface.
1364 theUParameter Value of U-parameter on the referenced surface.
1365 theVParameter Value of V-parameter on the referenced surface.
1366 theName Object name; when specified, this parameter is used
1367 for result publication in the study. Otherwise, if automatic
1368 publication is switched on, default value is used for result name.
1371 New GEOM.GEOM_Object, containing the created point.
1374 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1376 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1377 # Example: see GEOM_TestAll.py
1378 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1379 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1380 anObj.SetParameters(Parameters);
1381 self._autoPublish(anObj, theName, "vertex")
1384 ## Create a point by projection give coordinates on the given surface
1385 # @param theRefSurf The referenced surface.
1386 # @param theX X-coordinate in 3D space
1387 # @param theY Y-coordinate in 3D space
1388 # @param theZ Z-coordinate in 3D space
1389 # @param theName Object name; when specified, this parameter is used
1390 # for result publication in the study. Otherwise, if automatic
1391 # publication is switched on, default value is used for result name.
1393 # @return New GEOM.GEOM_Object, containing the created point.
1395 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1396 @ManageTransactions("BasicOp")
1397 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1399 Create a point by projection give coordinates on the given surface
1402 theRefSurf The referenced surface.
1403 theX X-coordinate in 3D space
1404 theY Y-coordinate in 3D space
1405 theZ Z-coordinate in 3D space
1406 theName Object name; when specified, this parameter is used
1407 for result publication in the study. Otherwise, if automatic
1408 publication is switched on, default value is used for result name.
1411 New GEOM.GEOM_Object, containing the created point.
1414 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1416 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1417 # Example: see GEOM_TestAll.py
1418 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1419 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1420 anObj.SetParameters(Parameters);
1421 self._autoPublish(anObj, theName, "vertex")
1424 ## Create a point, which lays on the given face.
1425 # The point will lay in arbitrary place of the face.
1426 # The only condition on it is a non-zero distance to the face boundary.
1427 # Such point can be used to uniquely identify the face inside any
1428 # shape in case, when the shape does not contain overlapped faces.
1429 # @param theFace The referenced face.
1430 # @param theName Object name; when specified, this parameter is used
1431 # for result publication in the study. Otherwise, if automatic
1432 # publication is switched on, default value is used for result name.
1434 # @return New GEOM.GEOM_Object, containing the created point.
1436 # @ref swig_MakeVertexInsideFace "Example"
1437 @ManageTransactions("BasicOp")
1438 def MakeVertexInsideFace (self, theFace, theName=None):
1440 Create a point, which lays on the given face.
1441 The point will lay in arbitrary place of the face.
1442 The only condition on it is a non-zero distance to the face boundary.
1443 Such point can be used to uniquely identify the face inside any
1444 shape in case, when the shape does not contain overlapped faces.
1447 theFace The referenced face.
1448 theName Object name; when specified, this parameter is used
1449 for result publication in the study. Otherwise, if automatic
1450 publication is switched on, default value is used for result name.
1453 New GEOM.GEOM_Object, containing the created point.
1456 p_on_face = geompy.MakeVertexInsideFace(Face)
1458 # Example: see GEOM_TestAll.py
1459 anObj = self.BasicOp.MakePointOnFace(theFace)
1460 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1461 self._autoPublish(anObj, theName, "vertex")
1464 ## Create a point on intersection of two lines.
1465 # @param theRefLine1, theRefLine2 The referenced lines.
1466 # @param theName Object name; when specified, this parameter is used
1467 # for result publication in the study. Otherwise, if automatic
1468 # publication is switched on, default value is used for result name.
1470 # @return New GEOM.GEOM_Object, containing the created point.
1472 # @ref swig_MakeVertexOnLinesIntersection "Example"
1473 @ManageTransactions("BasicOp")
1474 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1476 Create a point on intersection of two lines.
1479 theRefLine1, theRefLine2 The referenced lines.
1480 theName Object name; when specified, this parameter is used
1481 for result publication in the study. Otherwise, if automatic
1482 publication is switched on, default value is used for result name.
1485 New GEOM.GEOM_Object, containing the created point.
1487 # Example: see GEOM_TestAll.py
1488 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1489 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1490 self._autoPublish(anObj, theName, "vertex")
1493 ## Create a tangent, corresponding to the given parameter on the given curve.
1494 # @param theRefCurve The referenced curve.
1495 # @param theParameter Value of parameter on the referenced curve.
1496 # @param theName Object name; when specified, this parameter is used
1497 # for result publication in the study. Otherwise, if automatic
1498 # publication is switched on, default value is used for result name.
1500 # @return New GEOM.GEOM_Object, containing the created tangent.
1502 # @ref swig_MakeTangentOnCurve "Example"
1503 @ManageTransactions("BasicOp")
1504 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1506 Create a tangent, corresponding to the given parameter on the given curve.
1509 theRefCurve The referenced curve.
1510 theParameter Value of parameter on the referenced curve.
1511 theName Object name; when specified, this parameter is used
1512 for result publication in the study. Otherwise, if automatic
1513 publication is switched on, default value is used for result name.
1516 New GEOM.GEOM_Object, containing the created tangent.
1519 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1521 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1522 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1523 self._autoPublish(anObj, theName, "tangent")
1526 ## Create a tangent plane, corresponding to the given parameter on the given face.
1527 # @param theFace The face for which tangent plane should be built.
1528 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1529 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1530 # @param theTrimSize the size of plane.
1531 # @param theName Object name; when specified, this parameter is used
1532 # for result publication in the study. Otherwise, if automatic
1533 # publication is switched on, default value is used for result name.
1535 # @return New GEOM.GEOM_Object, containing the created tangent.
1537 # @ref swig_MakeTangentPlaneOnFace "Example"
1538 @ManageTransactions("BasicOp")
1539 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1541 Create a tangent plane, corresponding to the given parameter on the given face.
1544 theFace The face for which tangent plane should be built.
1545 theParameterV vertical value of the center point (0.0 - 1.0).
1546 theParameterU horisontal value of the center point (0.0 - 1.0).
1547 theTrimSize the size of plane.
1548 theName Object name; when specified, this parameter is used
1549 for result publication in the study. Otherwise, if automatic
1550 publication is switched on, default value is used for result name.
1553 New GEOM.GEOM_Object, containing the created tangent.
1556 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1558 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1559 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1560 self._autoPublish(anObj, theName, "tangent")
1563 ## Create a vector with the given components.
1564 # @param theDX X component of the vector.
1565 # @param theDY Y component of the vector.
1566 # @param theDZ Z component of the vector.
1567 # @param theName Object name; when specified, this parameter is used
1568 # for result publication in the study. Otherwise, if automatic
1569 # publication is switched on, default value is used for result name.
1571 # @return New GEOM.GEOM_Object, containing the created vector.
1573 # @ref tui_creation_vector "Example"
1574 @ManageTransactions("BasicOp")
1575 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1577 Create a vector with the given components.
1580 theDX X component of the vector.
1581 theDY Y component of the vector.
1582 theDZ Z component of the vector.
1583 theName Object name; when specified, this parameter is used
1584 for result publication in the study. Otherwise, if automatic
1585 publication is switched on, default value is used for result name.
1588 New GEOM.GEOM_Object, containing the created vector.
1590 # Example: see GEOM_TestAll.py
1591 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1592 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1593 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1594 anObj.SetParameters(Parameters)
1595 self._autoPublish(anObj, theName, "vector")
1598 ## Create a vector between two points.
1599 # @param thePnt1 Start point for the vector.
1600 # @param thePnt2 End point for the vector.
1601 # @param theName Object name; when specified, this parameter is used
1602 # for result publication in the study. Otherwise, if automatic
1603 # publication is switched on, default value is used for result name.
1605 # @return New GEOM.GEOM_Object, containing the created vector.
1607 # @ref tui_creation_vector "Example"
1608 @ManageTransactions("BasicOp")
1609 def MakeVector(self, thePnt1, thePnt2, theName=None):
1611 Create a vector between two points.
1614 thePnt1 Start point for the vector.
1615 thePnt2 End point for the vector.
1616 theName Object name; when specified, this parameter is used
1617 for result publication in the study. Otherwise, if automatic
1618 publication is switched on, default value is used for result name.
1621 New GEOM.GEOM_Object, containing the created vector.
1623 # Example: see GEOM_TestAll.py
1624 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1625 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1626 self._autoPublish(anObj, theName, "vector")
1629 ## Create a line, passing through the given point
1630 # and parallel to the given direction
1631 # @param thePnt Point. The resulting line will pass through it.
1632 # @param theDir Direction. The resulting line will be parallel to it.
1633 # @param theName Object name; when specified, this parameter is used
1634 # for result publication in the study. Otherwise, if automatic
1635 # publication is switched on, default value is used for result name.
1637 # @return New GEOM.GEOM_Object, containing the created line.
1639 # @ref tui_creation_line "Example"
1640 @ManageTransactions("BasicOp")
1641 def MakeLine(self, thePnt, theDir, theName=None):
1643 Create a line, passing through the given point
1644 and parallel to the given direction
1647 thePnt Point. The resulting line will pass through it.
1648 theDir Direction. The resulting line will be parallel to it.
1649 theName Object name; when specified, this parameter is used
1650 for result publication in the study. Otherwise, if automatic
1651 publication is switched on, default value is used for result name.
1654 New GEOM.GEOM_Object, containing the created line.
1656 # Example: see GEOM_TestAll.py
1657 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1658 RaiseIfFailed("MakeLine", self.BasicOp)
1659 self._autoPublish(anObj, theName, "line")
1662 ## Create a line, passing through the given points
1663 # @param thePnt1 First of two points, defining the line.
1664 # @param thePnt2 Second of two points, defining the line.
1665 # @param theName Object name; when specified, this parameter is used
1666 # for result publication in the study. Otherwise, if automatic
1667 # publication is switched on, default value is used for result name.
1669 # @return New GEOM.GEOM_Object, containing the created line.
1671 # @ref tui_creation_line "Example"
1672 @ManageTransactions("BasicOp")
1673 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1675 Create a line, passing through the given points
1678 thePnt1 First of two points, defining the line.
1679 thePnt2 Second of two points, defining the line.
1680 theName Object name; when specified, this parameter is used
1681 for result publication in the study. Otherwise, if automatic
1682 publication is switched on, default value is used for result name.
1685 New GEOM.GEOM_Object, containing the created line.
1687 # Example: see GEOM_TestAll.py
1688 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1689 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1690 self._autoPublish(anObj, theName, "line")
1693 ## Create a line on two faces intersection.
1694 # @param theFace1 First of two faces, defining the line.
1695 # @param theFace2 Second of two faces, defining the line.
1696 # @param theName Object name; when specified, this parameter is used
1697 # for result publication in the study. Otherwise, if automatic
1698 # publication is switched on, default value is used for result name.
1700 # @return New GEOM.GEOM_Object, containing the created line.
1702 # @ref swig_MakeLineTwoFaces "Example"
1703 @ManageTransactions("BasicOp")
1704 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1706 Create a line on two faces intersection.
1709 theFace1 First of two faces, defining the line.
1710 theFace2 Second of two faces, defining the line.
1711 theName Object name; when specified, this parameter is used
1712 for result publication in the study. Otherwise, if automatic
1713 publication is switched on, default value is used for result name.
1716 New GEOM.GEOM_Object, containing the created line.
1718 # Example: see GEOM_TestAll.py
1719 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1720 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1721 self._autoPublish(anObj, theName, "line")
1724 ## Create a plane, passing through the given point
1725 # and normal to the given vector.
1726 # @param thePnt Point, the plane has to pass through.
1727 # @param theVec Vector, defining the plane normal direction.
1728 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1729 # @param theName Object name; when specified, this parameter is used
1730 # for result publication in the study. Otherwise, if automatic
1731 # publication is switched on, default value is used for result name.
1733 # @return New GEOM.GEOM_Object, containing the created plane.
1735 # @ref tui_creation_plane "Example"
1736 @ManageTransactions("BasicOp")
1737 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1739 Create a plane, passing through the given point
1740 and normal to the given vector.
1743 thePnt Point, the plane has to pass through.
1744 theVec Vector, defining the plane normal direction.
1745 theTrimSize Half size of a side of quadrangle face, representing the plane.
1746 theName Object name; when specified, this parameter is used
1747 for result publication in the study. Otherwise, if automatic
1748 publication is switched on, default value is used for result name.
1751 New GEOM.GEOM_Object, containing the created plane.
1753 # Example: see GEOM_TestAll.py
1754 theTrimSize, Parameters = ParseParameters(theTrimSize);
1755 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1756 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1757 anObj.SetParameters(Parameters)
1758 self._autoPublish(anObj, theName, "plane")
1761 ## Create a plane, passing through the three given points
1762 # @param thePnt1 First of three points, defining the plane.
1763 # @param thePnt2 Second of three points, defining the plane.
1764 # @param thePnt3 Third of three points, defining the plane.
1765 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1766 # @param theName Object name; when specified, this parameter is used
1767 # for result publication in the study. Otherwise, if automatic
1768 # publication is switched on, default value is used for result name.
1770 # @return New GEOM.GEOM_Object, containing the created plane.
1772 # @ref tui_creation_plane "Example"
1773 @ManageTransactions("BasicOp")
1774 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1776 Create a plane, passing through the three given points
1779 thePnt1 First of three points, defining the plane.
1780 thePnt2 Second of three points, defining the plane.
1781 thePnt3 Third of three points, defining the plane.
1782 theTrimSize Half size of a side of quadrangle face, representing the plane.
1783 theName Object name; when specified, this parameter is used
1784 for result publication in the study. Otherwise, if automatic
1785 publication is switched on, default value is used for result name.
1788 New GEOM.GEOM_Object, containing the created plane.
1790 # Example: see GEOM_TestAll.py
1791 theTrimSize, Parameters = ParseParameters(theTrimSize);
1792 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1793 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1794 anObj.SetParameters(Parameters)
1795 self._autoPublish(anObj, theName, "plane")
1798 ## Create a plane, similar to the existing one, but with another size of representing face.
1799 # @param theFace Referenced plane or LCS(Marker).
1800 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1801 # @param theName Object name; when specified, this parameter is used
1802 # for result publication in the study. Otherwise, if automatic
1803 # publication is switched on, default value is used for result name.
1805 # @return New GEOM.GEOM_Object, containing the created plane.
1807 # @ref tui_creation_plane "Example"
1808 @ManageTransactions("BasicOp")
1809 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1811 Create a plane, similar to the existing one, but with another size of representing face.
1814 theFace Referenced plane or LCS(Marker).
1815 theTrimSize New half size of a side of quadrangle face, representing the plane.
1816 theName Object name; when specified, this parameter is used
1817 for result publication in the study. Otherwise, if automatic
1818 publication is switched on, default value is used for result name.
1821 New GEOM.GEOM_Object, containing the created plane.
1823 # Example: see GEOM_TestAll.py
1824 theTrimSize, Parameters = ParseParameters(theTrimSize);
1825 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1826 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1827 anObj.SetParameters(Parameters)
1828 self._autoPublish(anObj, theName, "plane")
1831 ## Create a plane, passing through the 2 vectors
1832 # with center in a start point of the first vector.
1833 # @param theVec1 Vector, defining center point and plane direction.
1834 # @param theVec2 Vector, defining the plane normal direction.
1835 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1836 # @param theName Object name; when specified, this parameter is used
1837 # for result publication in the study. Otherwise, if automatic
1838 # publication is switched on, default value is used for result name.
1840 # @return New GEOM.GEOM_Object, containing the created plane.
1842 # @ref tui_creation_plane "Example"
1843 @ManageTransactions("BasicOp")
1844 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1846 Create a plane, passing through the 2 vectors
1847 with center in a start point of the first vector.
1850 theVec1 Vector, defining center point and plane direction.
1851 theVec2 Vector, defining the plane normal direction.
1852 theTrimSize Half size of a side of quadrangle face, representing the plane.
1853 theName Object name; when specified, this parameter is used
1854 for result publication in the study. Otherwise, if automatic
1855 publication is switched on, default value is used for result name.
1858 New GEOM.GEOM_Object, containing the created plane.
1860 # Example: see GEOM_TestAll.py
1861 theTrimSize, Parameters = ParseParameters(theTrimSize);
1862 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1863 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1864 anObj.SetParameters(Parameters)
1865 self._autoPublish(anObj, theName, "plane")
1868 ## Create a plane, based on a Local coordinate system.
1869 # @param theLCS coordinate system, defining plane.
1870 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1871 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1872 # @param theName Object name; when specified, this parameter is used
1873 # for result publication in the study. Otherwise, if automatic
1874 # publication is switched on, default value is used for result name.
1876 # @return New GEOM.GEOM_Object, containing the created plane.
1878 # @ref tui_creation_plane "Example"
1879 @ManageTransactions("BasicOp")
1880 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1882 Create a plane, based on a Local coordinate system.
1885 theLCS coordinate system, defining plane.
1886 theTrimSize Half size of a side of quadrangle face, representing the plane.
1887 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1888 theName Object name; when specified, this parameter is used
1889 for result publication in the study. Otherwise, if automatic
1890 publication is switched on, default value is used for result name.
1893 New GEOM.GEOM_Object, containing the created plane.
1895 # Example: see GEOM_TestAll.py
1896 theTrimSize, Parameters = ParseParameters(theTrimSize);
1897 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1898 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1899 anObj.SetParameters(Parameters)
1900 self._autoPublish(anObj, theName, "plane")
1903 ## Create a local coordinate system.
1904 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1905 # @param XDX,XDY,XDZ Three components of OX direction
1906 # @param YDX,YDY,YDZ Three components of OY direction
1907 # @param theName Object name; when specified, this parameter is used
1908 # for result publication in the study. Otherwise, if automatic
1909 # publication is switched on, default value is used for result name.
1911 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1913 # @ref swig_MakeMarker "Example"
1914 @ManageTransactions("BasicOp")
1915 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1917 Create a local coordinate system.
1920 OX,OY,OZ Three coordinates of coordinate system origin.
1921 XDX,XDY,XDZ Three components of OX direction
1922 YDX,YDY,YDZ Three components of OY direction
1923 theName Object name; when specified, this parameter is used
1924 for result publication in the study. Otherwise, if automatic
1925 publication is switched on, default value is used for result name.
1928 New GEOM.GEOM_Object, containing the created coordinate system.
1930 # Example: see GEOM_TestAll.py
1931 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1932 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1933 RaiseIfFailed("MakeMarker", self.BasicOp)
1934 anObj.SetParameters(Parameters)
1935 self._autoPublish(anObj, theName, "lcs")
1938 ## Create a local coordinate system from shape.
1939 # @param theShape The initial shape to detect the coordinate system.
1940 # @param theName Object name; when specified, this parameter is used
1941 # for result publication in the study. Otherwise, if automatic
1942 # publication is switched on, default value is used for result name.
1944 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1946 # @ref tui_creation_lcs "Example"
1947 @ManageTransactions("BasicOp")
1948 def MakeMarkerFromShape(self, theShape, theName=None):
1950 Create a local coordinate system from shape.
1953 theShape The initial shape to detect the coordinate system.
1954 theName Object name; when specified, this parameter is used
1955 for result publication in the study. Otherwise, if automatic
1956 publication is switched on, default value is used for result name.
1959 New GEOM.GEOM_Object, containing the created coordinate system.
1961 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1962 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1963 self._autoPublish(anObj, theName, "lcs")
1966 ## Create a local coordinate system from point and two vectors.
1967 # @param theOrigin Point of coordinate system origin.
1968 # @param theXVec Vector of X direction
1969 # @param theYVec Vector of Y direction
1970 # @param theName Object name; when specified, this parameter is used
1971 # for result publication in the study. Otherwise, if automatic
1972 # publication is switched on, default value is used for result name.
1974 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1976 # @ref tui_creation_lcs "Example"
1977 @ManageTransactions("BasicOp")
1978 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1980 Create a local coordinate system from point and two vectors.
1983 theOrigin Point of coordinate system origin.
1984 theXVec Vector of X direction
1985 theYVec Vector of Y direction
1986 theName Object name; when specified, this parameter is used
1987 for result publication in the study. Otherwise, if automatic
1988 publication is switched on, default value is used for result name.
1991 New GEOM.GEOM_Object, containing the created coordinate system.
1994 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1995 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1996 self._autoPublish(anObj, theName, "lcs")
1999 # end of l3_basic_go
2002 ## @addtogroup l4_curves
2005 ## Create an arc of circle, passing through three given points.
2006 # @param thePnt1 Start point of the arc.
2007 # @param thePnt2 Middle point of the arc.
2008 # @param thePnt3 End point of the arc.
2009 # @param theName Object name; when specified, this parameter is used
2010 # for result publication in the study. Otherwise, if automatic
2011 # publication is switched on, default value is used for result name.
2013 # @return New GEOM.GEOM_Object, containing the created arc.
2015 # @ref swig_MakeArc "Example"
2016 @ManageTransactions("CurvesOp")
2017 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2019 Create an arc of circle, passing through three given points.
2022 thePnt1 Start point of the arc.
2023 thePnt2 Middle point of the arc.
2024 thePnt3 End point of the arc.
2025 theName Object name; when specified, this parameter is used
2026 for result publication in the study. Otherwise, if automatic
2027 publication is switched on, default value is used for result name.
2030 New GEOM.GEOM_Object, containing the created arc.
2032 # Example: see GEOM_TestAll.py
2033 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2034 RaiseIfFailed("MakeArc", self.CurvesOp)
2035 self._autoPublish(anObj, theName, "arc")
2038 ## Create an arc of circle from a center and 2 points.
2039 # @param thePnt1 Center of the arc
2040 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2041 # @param thePnt3 End point of the arc (Gives also a direction)
2042 # @param theSense Orientation of the arc
2043 # @param theName Object name; when specified, this parameter is used
2044 # for result publication in the study. Otherwise, if automatic
2045 # publication is switched on, default value is used for result name.
2047 # @return New GEOM.GEOM_Object, containing the created arc.
2049 # @ref swig_MakeArc "Example"
2050 @ManageTransactions("CurvesOp")
2051 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2053 Create an arc of circle from a center and 2 points.
2056 thePnt1 Center of the arc
2057 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2058 thePnt3 End point of the arc (Gives also a direction)
2059 theSense Orientation of the arc
2060 theName Object name; when specified, this parameter is used
2061 for result publication in the study. Otherwise, if automatic
2062 publication is switched on, default value is used for result name.
2065 New GEOM.GEOM_Object, containing the created arc.
2067 # Example: see GEOM_TestAll.py
2068 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2069 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2070 self._autoPublish(anObj, theName, "arc")
2073 ## Create an arc of ellipse, of center and two points.
2074 # @param theCenter Center of the arc.
2075 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2076 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2077 # @param theName Object name; when specified, this parameter is used
2078 # for result publication in the study. Otherwise, if automatic
2079 # publication is switched on, default value is used for result name.
2081 # @return New GEOM.GEOM_Object, containing the created arc.
2083 # @ref swig_MakeArc "Example"
2084 @ManageTransactions("CurvesOp")
2085 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2087 Create an arc of ellipse, of center and two points.
2090 theCenter Center of the arc.
2091 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2092 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2093 theName Object name; when specified, this parameter is used
2094 for result publication in the study. Otherwise, if automatic
2095 publication is switched on, default value is used for result name.
2098 New GEOM.GEOM_Object, containing the created arc.
2100 # Example: see GEOM_TestAll.py
2101 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2102 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2103 self._autoPublish(anObj, theName, "arc")
2106 ## Create a circle with given center, normal vector and radius.
2107 # @param thePnt Circle center.
2108 # @param theVec Vector, normal to the plane of the circle.
2109 # @param theR Circle radius.
2110 # @param theName Object name; when specified, this parameter is used
2111 # for result publication in the study. Otherwise, if automatic
2112 # publication is switched on, default value is used for result name.
2114 # @return New GEOM.GEOM_Object, containing the created circle.
2116 # @ref tui_creation_circle "Example"
2117 @ManageTransactions("CurvesOp")
2118 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2120 Create a circle with given center, normal vector and radius.
2123 thePnt Circle center.
2124 theVec Vector, normal to the plane of the circle.
2126 theName Object name; when specified, this parameter is used
2127 for result publication in the study. Otherwise, if automatic
2128 publication is switched on, default value is used for result name.
2131 New GEOM.GEOM_Object, containing the created circle.
2133 # Example: see GEOM_TestAll.py
2134 theR, Parameters = ParseParameters(theR)
2135 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2136 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2137 anObj.SetParameters(Parameters)
2138 self._autoPublish(anObj, theName, "circle")
2141 ## Create a circle with given radius.
2142 # Center of the circle will be in the origin of global
2143 # coordinate system and normal vector will be codirected with Z axis
2144 # @param theR Circle radius.
2145 # @param theName Object name; when specified, this parameter is used
2146 # for result publication in the study. Otherwise, if automatic
2147 # publication is switched on, default value is used for result name.
2149 # @return New GEOM.GEOM_Object, containing the created circle.
2150 @ManageTransactions("CurvesOp")
2151 def MakeCircleR(self, theR, theName=None):
2153 Create a circle with given radius.
2154 Center of the circle will be in the origin of global
2155 coordinate system and normal vector will be codirected with Z axis
2159 theName Object name; when specified, this parameter is used
2160 for result publication in the study. Otherwise, if automatic
2161 publication is switched on, default value is used for result name.
2164 New GEOM.GEOM_Object, containing the created circle.
2166 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2167 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2168 self._autoPublish(anObj, theName, "circle")
2171 ## Create a circle, passing through three given points
2172 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2173 # @param theName Object name; when specified, this parameter is used
2174 # for result publication in the study. Otherwise, if automatic
2175 # publication is switched on, default value is used for result name.
2177 # @return New GEOM.GEOM_Object, containing the created circle.
2179 # @ref tui_creation_circle "Example"
2180 @ManageTransactions("CurvesOp")
2181 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2183 Create a circle, passing through three given points
2186 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2187 theName Object name; when specified, this parameter is used
2188 for result publication in the study. Otherwise, if automatic
2189 publication is switched on, default value is used for result name.
2192 New GEOM.GEOM_Object, containing the created circle.
2194 # Example: see GEOM_TestAll.py
2195 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2196 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2197 self._autoPublish(anObj, theName, "circle")
2200 ## Create a circle, with given point1 as center,
2201 # passing through the point2 as radius and laying in the plane,
2202 # defined by all three given points.
2203 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2204 # @param theName Object name; when specified, this parameter is used
2205 # for result publication in the study. Otherwise, if automatic
2206 # publication is switched on, default value is used for result name.
2208 # @return New GEOM.GEOM_Object, containing the created circle.
2210 # @ref swig_MakeCircle "Example"
2211 @ManageTransactions("CurvesOp")
2212 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2214 Create a circle, with given point1 as center,
2215 passing through the point2 as radius and laying in the plane,
2216 defined by all three given points.
2219 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2220 theName Object name; when specified, this parameter is used
2221 for result publication in the study. Otherwise, if automatic
2222 publication is switched on, default value is used for result name.
2225 New GEOM.GEOM_Object, containing the created circle.
2227 # Example: see GEOM_example6.py
2228 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2229 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2230 self._autoPublish(anObj, theName, "circle")
2233 ## Create an ellipse with given center, normal vector and radiuses.
2234 # @param thePnt Ellipse center.
2235 # @param theVec Vector, normal to the plane of the ellipse.
2236 # @param theRMajor Major ellipse radius.
2237 # @param theRMinor Minor ellipse radius.
2238 # @param theVecMaj Vector, direction of the ellipse's main axis.
2239 # @param theName Object name; when specified, this parameter is used
2240 # for result publication in the study. Otherwise, if automatic
2241 # publication is switched on, default value is used for result name.
2243 # @return New GEOM.GEOM_Object, containing the created ellipse.
2245 # @ref tui_creation_ellipse "Example"
2246 @ManageTransactions("CurvesOp")
2247 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2249 Create an ellipse with given center, normal vector and radiuses.
2252 thePnt Ellipse center.
2253 theVec Vector, normal to the plane of the ellipse.
2254 theRMajor Major ellipse radius.
2255 theRMinor Minor ellipse radius.
2256 theVecMaj Vector, direction of the ellipse's main axis.
2257 theName Object name; when specified, this parameter is used
2258 for result publication in the study. Otherwise, if automatic
2259 publication is switched on, default value is used for result name.
2262 New GEOM.GEOM_Object, containing the created ellipse.
2264 # Example: see GEOM_TestAll.py
2265 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2266 if theVecMaj is not None:
2267 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2269 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2271 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2272 anObj.SetParameters(Parameters)
2273 self._autoPublish(anObj, theName, "ellipse")
2276 ## Create an ellipse with given radiuses.
2277 # Center of the ellipse will be in the origin of global
2278 # coordinate system and normal vector will be codirected with Z axis
2279 # @param theRMajor Major ellipse radius.
2280 # @param theRMinor Minor ellipse radius.
2281 # @param theName Object name; when specified, this parameter is used
2282 # for result publication in the study. Otherwise, if automatic
2283 # publication is switched on, default value is used for result name.
2285 # @return New GEOM.GEOM_Object, containing the created ellipse.
2286 @ManageTransactions("CurvesOp")
2287 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2289 Create an ellipse with given radiuses.
2290 Center of the ellipse will be in the origin of global
2291 coordinate system and normal vector will be codirected with Z axis
2294 theRMajor Major ellipse radius.
2295 theRMinor Minor ellipse radius.
2296 theName Object name; when specified, this parameter is used
2297 for result publication in the study. Otherwise, if automatic
2298 publication is switched on, default value is used for result name.
2301 New GEOM.GEOM_Object, containing the created ellipse.
2303 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2304 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2305 self._autoPublish(anObj, theName, "ellipse")
2308 ## Create a polyline on the set of points.
2309 # @param thePoints Sequence of points for the polyline.
2310 # @param theIsClosed If True, build a closed wire.
2311 # @param theName Object name; when specified, this parameter is used
2312 # for result publication in the study. Otherwise, if automatic
2313 # publication is switched on, default value is used for result name.
2315 # @return New GEOM.GEOM_Object, containing the created polyline.
2317 # @ref tui_creation_curve "Example"
2318 @ManageTransactions("CurvesOp")
2319 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2321 Create a polyline on the set of points.
2324 thePoints Sequence of points for the polyline.
2325 theIsClosed If True, build a closed wire.
2326 theName Object name; when specified, this parameter is used
2327 for result publication in the study. Otherwise, if automatic
2328 publication is switched on, default value is used for result name.
2331 New GEOM.GEOM_Object, containing the created polyline.
2333 # Example: see GEOM_TestAll.py
2334 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2335 RaiseIfFailed("MakePolyline", self.CurvesOp)
2336 self._autoPublish(anObj, theName, "polyline")
2339 ## Create bezier curve on the set of points.
2340 # @param thePoints Sequence of points for the bezier curve.
2341 # @param theIsClosed If True, build a closed curve.
2342 # @param theName Object name; when specified, this parameter is used
2343 # for result publication in the study. Otherwise, if automatic
2344 # publication is switched on, default value is used for result name.
2346 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2348 # @ref tui_creation_curve "Example"
2349 @ManageTransactions("CurvesOp")
2350 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2352 Create bezier curve on the set of points.
2355 thePoints Sequence of points for the bezier curve.
2356 theIsClosed If True, build a closed curve.
2357 theName Object name; when specified, this parameter is used
2358 for result publication in the study. Otherwise, if automatic
2359 publication is switched on, default value is used for result name.
2362 New GEOM.GEOM_Object, containing the created bezier curve.
2364 # Example: see GEOM_TestAll.py
2365 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2366 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2367 self._autoPublish(anObj, theName, "bezier")
2370 ## Create B-Spline curve on the set of points.
2371 # @param thePoints Sequence of points for the B-Spline curve.
2372 # @param theIsClosed If True, build a closed curve.
2373 # @param theDoReordering If TRUE, the algo does not follow the order of
2374 # \a thePoints but searches for the closest vertex.
2375 # @param theName Object name; when specified, this parameter is used
2376 # for result publication in the study. Otherwise, if automatic
2377 # publication is switched on, default value is used for result name.
2379 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2381 # @ref tui_creation_curve "Example"
2382 @ManageTransactions("CurvesOp")
2383 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2385 Create B-Spline curve on the set of points.
2388 thePoints Sequence of points for the B-Spline curve.
2389 theIsClosed If True, build a closed curve.
2390 theDoReordering If True, the algo does not follow the order of
2391 thePoints but searches for the closest vertex.
2392 theName Object name; when specified, this parameter is used
2393 for result publication in the study. Otherwise, if automatic
2394 publication is switched on, default value is used for result name.
2397 New GEOM.GEOM_Object, containing the created B-Spline curve.
2399 # Example: see GEOM_TestAll.py
2400 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2401 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2402 self._autoPublish(anObj, theName, "bspline")
2405 ## Create B-Spline curve on the set of points.
2406 # @param thePoints Sequence of points for the B-Spline curve.
2407 # @param theFirstVec Vector object, defining the curve direction at its first point.
2408 # @param theLastVec Vector object, defining the curve direction at its last point.
2409 # @param theName Object name; when specified, this parameter is used
2410 # for result publication in the study. Otherwise, if automatic
2411 # publication is switched on, default value is used for result name.
2413 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2415 # @ref tui_creation_curve "Example"
2416 @ManageTransactions("CurvesOp")
2417 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2419 Create B-Spline curve on the set of points.
2422 thePoints Sequence of points for the B-Spline curve.
2423 theFirstVec Vector object, defining the curve direction at its first point.
2424 theLastVec Vector object, defining the curve direction at its last point.
2425 theName Object name; when specified, this parameter is used
2426 for result publication in the study. Otherwise, if automatic
2427 publication is switched on, default value is used for result name.
2430 New GEOM.GEOM_Object, containing the created B-Spline curve.
2432 # Example: see GEOM_TestAll.py
2433 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2434 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2435 self._autoPublish(anObj, theName, "bspline")
2438 ## Creates a curve using the parametric definition of the basic points.
2439 # @param thexExpr parametric equation of the coordinates X.
2440 # @param theyExpr parametric equation of the coordinates Y.
2441 # @param thezExpr parametric equation of the coordinates Z.
2442 # @param theParamMin the minimal value of the parameter.
2443 # @param theParamMax the maximum value of the parameter.
2444 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2445 # @param theCurveType the type of the curve,
2446 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2447 # @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.
2448 # @param theName Object name; when specified, this parameter is used
2449 # for result publication in the study. Otherwise, if automatic
2450 # publication is switched on, default value is used for result name.
2452 # @return New GEOM.GEOM_Object, containing the created curve.
2454 # @ref tui_creation_curve "Example"
2455 @ManageTransactions("CurvesOp")
2456 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2457 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2459 Creates a curve using the parametric definition of the basic points.
2462 thexExpr parametric equation of the coordinates X.
2463 theyExpr parametric equation of the coordinates Y.
2464 thezExpr parametric equation of the coordinates Z.
2465 theParamMin the minimal value of the parameter.
2466 theParamMax the maximum value of the parameter.
2467 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2468 theCurveType the type of the curve,
2469 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2470 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2471 method is used which can lead to a bug.
2472 theName Object name; when specified, this parameter is used
2473 for result publication in the study. Otherwise, if automatic
2474 publication is switched on, default value is used for result name.
2477 New GEOM.GEOM_Object, containing the created curve.
2479 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2481 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2483 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2484 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2485 anObj.SetParameters(Parameters)
2486 self._autoPublish(anObj, theName, "curve")
2489 ## Create an isoline curve on a face.
2490 # @param theFace the face for which an isoline is created.
2491 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2493 # @param theParameter the U parameter for U-isoline or V parameter
2495 # @param theName Object name; when specified, this parameter is used
2496 # for result publication in the study. Otherwise, if automatic
2497 # publication is switched on, default value is used for result name.
2499 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2500 # a compound of edges.
2502 # @ref tui_creation_curve "Example"
2503 @ManageTransactions("CurvesOp")
2504 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2506 Create an isoline curve on a face.
2509 theFace the face for which an isoline is created.
2510 IsUIsoline True for U-isoline creation; False for V-isoline
2512 theParameter the U parameter for U-isoline or V parameter
2514 theName Object name; when specified, this parameter is used
2515 for result publication in the study. Otherwise, if automatic
2516 publication is switched on, default value is used for result name.
2519 New GEOM.GEOM_Object, containing the created isoline edge or a
2522 # Example: see GEOM_TestAll.py
2523 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2524 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2526 self._autoPublish(anObj, theName, "U-Isoline")
2528 self._autoPublish(anObj, theName, "V-Isoline")
2534 ## @addtogroup l3_sketcher
2537 ## Create a sketcher (wire or face), following the textual description,
2538 # passed through <VAR>theCommand</VAR> argument. \n
2539 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2540 # Format of the description string have to be the following:
2542 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2545 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2547 # - "R angle" : Set the direction by angle
2548 # - "D dx dy" : Set the direction by DX & DY
2551 # - "TT x y" : Create segment by point at X & Y
2552 # - "T dx dy" : Create segment by point with DX & DY
2553 # - "L length" : Create segment by direction & Length
2554 # - "IX x" : Create segment by direction & Intersect. X
2555 # - "IY y" : Create segment by direction & Intersect. Y
2558 # - "C radius length" : Create arc by direction, radius and length(in degree)
2559 # - "AA x y": Create arc by point at X & Y
2560 # - "A dx dy" : Create arc by point with DX & DY
2561 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2562 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2563 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2564 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2567 # - "WW" : Close Wire (to finish)
2568 # - "WF" : Close Wire and build face (to finish)
2571 # - Flag1 (= reverse) is 0 or 2 ...
2572 # - if 0 the drawn arc is the one of lower angle (< Pi)
2573 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2576 # - Flag2 (= control tolerance) is 0 or 1 ...
2577 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2578 # - if 1 the wire is built only if the end point is on the arc
2579 # with a tolerance of 10^-7 on the distance else the creation fails
2581 # @param theCommand String, defining the sketcher in local
2582 # coordinates of the working plane.
2583 # @param theWorkingPlane Nine double values, defining origin,
2584 # OZ and OX directions of the working plane.
2585 # @param theName Object name; when specified, this parameter is used
2586 # for result publication in the study. Otherwise, if automatic
2587 # publication is switched on, default value is used for result name.
2589 # @return New GEOM.GEOM_Object, containing the created wire.
2591 # @ref tui_sketcher_page "Example"
2592 @ManageTransactions("CurvesOp")
2593 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2595 Create a sketcher (wire or face), following the textual description, passed
2596 through theCommand argument.
2597 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2598 Format of the description string have to be the following:
2599 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2601 - x1, y1 are coordinates of the first sketcher point (zero by default),
2603 - "R angle" : Set the direction by angle
2604 - "D dx dy" : Set the direction by DX & DY
2606 - "TT x y" : Create segment by point at X & Y
2607 - "T dx dy" : Create segment by point with DX & DY
2608 - "L length" : Create segment by direction & Length
2609 - "IX x" : Create segment by direction & Intersect. X
2610 - "IY y" : Create segment by direction & Intersect. Y
2612 - "C radius length" : Create arc by direction, radius and length(in degree)
2613 - "AA x y": Create arc by point at X & Y
2614 - "A dx dy" : Create arc by point with DX & DY
2615 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2616 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2617 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2618 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2620 - "WW" : Close Wire (to finish)
2621 - "WF" : Close Wire and build face (to finish)
2623 - Flag1 (= reverse) is 0 or 2 ...
2624 - if 0 the drawn arc is the one of lower angle (< Pi)
2625 - if 2 the drawn arc ius the one of greater angle (> Pi)
2627 - Flag2 (= control tolerance) is 0 or 1 ...
2628 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2629 - if 1 the wire is built only if the end point is on the arc
2630 with a tolerance of 10^-7 on the distance else the creation fails
2633 theCommand String, defining the sketcher in local
2634 coordinates of the working plane.
2635 theWorkingPlane Nine double values, defining origin,
2636 OZ and OX directions of the working plane.
2637 theName Object name; when specified, this parameter is used
2638 for result publication in the study. Otherwise, if automatic
2639 publication is switched on, default value is used for result name.
2642 New GEOM.GEOM_Object, containing the created wire.
2644 # Example: see GEOM_TestAll.py
2645 theCommand,Parameters = ParseSketcherCommand(theCommand)
2646 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2647 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2648 anObj.SetParameters(Parameters)
2649 self._autoPublish(anObj, theName, "wire")
2652 ## Create a sketcher (wire or face), following the textual description,
2653 # passed through <VAR>theCommand</VAR> argument. \n
2654 # For format of the description string see MakeSketcher() method.\n
2655 # @param theCommand String, defining the sketcher in local
2656 # coordinates of the working plane.
2657 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2658 # @param theName Object name; when specified, this parameter is used
2659 # for result publication in the study. Otherwise, if automatic
2660 # publication is switched on, default value is used for result name.
2662 # @return New GEOM.GEOM_Object, containing the created wire.
2664 # @ref tui_sketcher_page "Example"
2665 @ManageTransactions("CurvesOp")
2666 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2668 Create a sketcher (wire or face), following the textual description,
2669 passed through theCommand argument.
2670 For format of the description string see geompy.MakeSketcher() method.
2673 theCommand String, defining the sketcher in local
2674 coordinates of the working plane.
2675 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2676 theName Object name; when specified, this parameter is used
2677 for result publication in the study. Otherwise, if automatic
2678 publication is switched on, default value is used for result name.
2681 New GEOM.GEOM_Object, containing the created wire.
2683 theCommand,Parameters = ParseSketcherCommand(theCommand)
2684 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2685 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2686 anObj.SetParameters(Parameters)
2687 self._autoPublish(anObj, theName, "wire")
2690 ## Obtain a 2D sketcher interface
2691 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2692 def Sketcher2D (self):
2694 Obtain a 2D sketcher interface.
2697 sk = geompy.Sketcher2D()
2699 sk.addSegmentRelative(15, 70)
2700 sk.addSegmentPerpY(50)
2701 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2702 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2703 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2705 Sketch_1 = sk.wire(geomObj_1)
2707 sk = Sketcher2D (self)
2710 ## Create a sketcher wire, following the numerical description,
2711 # passed through <VAR>theCoordinates</VAR> argument. \n
2712 # @param theCoordinates double values, defining points to create a wire,
2714 # @param theName Object name; when specified, this parameter is used
2715 # for result publication in the study. Otherwise, if automatic
2716 # publication is switched on, default value is used for result name.
2718 # @return New GEOM.GEOM_Object, containing the created wire.
2720 # @ref tui_3dsketcher_page "Example"
2721 @ManageTransactions("CurvesOp")
2722 def Make3DSketcher(self, theCoordinates, theName=None):
2724 Create a sketcher wire, following the numerical description,
2725 passed through theCoordinates argument.
2728 theCoordinates double values, defining points to create a wire,
2730 theName Object name; when specified, this parameter is used
2731 for result publication in the study. Otherwise, if automatic
2732 publication is switched on, default value is used for result name.
2735 New GEOM_Object, containing the created wire.
2737 theCoordinates,Parameters = ParseParameters(theCoordinates)
2738 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2739 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2740 anObj.SetParameters(Parameters)
2741 self._autoPublish(anObj, theName, "wire")
2744 ## Obtain a 3D sketcher interface
2745 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2747 # @ref tui_3dsketcher_page "Example"
2748 def Sketcher3D (self):
2750 Obtain a 3D sketcher interface.
2753 sk = geompy.Sketcher3D()
2754 sk.addPointsAbsolute(0,0,0, 70,0,0)
2755 sk.addPointsRelative(0, 0, 130)
2756 sk.addPointAnglesLength("OXY", 50, 0, 100)
2757 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2759 a3D_Sketcher_1 = sk.wire()
2761 sk = Sketcher3D (self)
2764 ## Obtain a 2D polyline creation interface
2765 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2767 # @ref tui_3dsketcher_page "Example"
2768 def Polyline2D (self):
2770 Obtain a 2D polyline creation interface.
2773 pl = geompy.Polyline2D()
2774 pl.addSection("section 1", GEOM.Polyline, True)
2775 pl.addPoints(0, 0, 10, 0, 10, 10)
2776 pl.addSection("section 2", GEOM.Interpolation, False)
2777 pl.addPoints(20, 0, 30, 0, 30, 10)
2778 resultObj = pl.result(WorkingPlane)
2780 pl = Polyline2D (self)
2783 # end of l3_sketcher
2786 ## @addtogroup l3_3d_primitives
2789 ## Create a box by coordinates of two opposite vertices.
2791 # @param x1,y1,z1 double values, defining first point it.
2792 # @param x2,y2,z2 double values, defining first point it.
2793 # @param theName Object name; when specified, this parameter is used
2794 # for result publication in the study. Otherwise, if automatic
2795 # publication is switched on, default value is used for result name.
2797 # @return New GEOM.GEOM_Object, containing the created box.
2799 # @ref tui_creation_box "Example"
2800 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2802 Create a box by coordinates of two opposite vertices.
2805 x1,y1,z1 double values, defining first point.
2806 x2,y2,z2 double values, defining second point.
2807 theName Object name; when specified, this parameter is used
2808 for result publication in the study. Otherwise, if automatic
2809 publication is switched on, default value is used for result name.
2812 New GEOM.GEOM_Object, containing the created box.
2814 # Example: see GEOM_TestAll.py
2815 pnt1 = self.MakeVertex(x1,y1,z1)
2816 pnt2 = self.MakeVertex(x2,y2,z2)
2817 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2818 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2820 ## Create a box with specified dimensions along the coordinate axes
2821 # and with edges, parallel to the coordinate axes.
2822 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2823 # @param theDX Length of Box edges, parallel to OX axis.
2824 # @param theDY Length of Box edges, parallel to OY axis.
2825 # @param theDZ Length of Box edges, parallel to OZ axis.
2826 # @param theName Object name; when specified, this parameter is used
2827 # for result publication in the study. Otherwise, if automatic
2828 # publication is switched on, default value is used for result name.
2830 # @return New GEOM.GEOM_Object, containing the created box.
2832 # @ref tui_creation_box "Example"
2833 @ManageTransactions("PrimOp")
2834 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2836 Create a box with specified dimensions along the coordinate axes
2837 and with edges, parallel to the coordinate axes.
2838 Center of the box will be at point (DX/2, DY/2, DZ/2).
2841 theDX Length of Box edges, parallel to OX axis.
2842 theDY Length of Box edges, parallel to OY axis.
2843 theDZ Length of Box edges, parallel to OZ axis.
2844 theName Object name; when specified, this parameter is used
2845 for result publication in the study. Otherwise, if automatic
2846 publication is switched on, default value is used for result name.
2849 New GEOM.GEOM_Object, containing the created box.
2851 # Example: see GEOM_TestAll.py
2852 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2853 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2854 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2855 anObj.SetParameters(Parameters)
2856 self._autoPublish(anObj, theName, "box")
2859 ## Create a box with two specified opposite vertices,
2860 # and with edges, parallel to the coordinate axes
2861 # @param thePnt1 First of two opposite vertices.
2862 # @param thePnt2 Second of two opposite vertices.
2863 # @param theName Object name; when specified, this parameter is used
2864 # for result publication in the study. Otherwise, if automatic
2865 # publication is switched on, default value is used for result name.
2867 # @return New GEOM.GEOM_Object, containing the created box.
2869 # @ref tui_creation_box "Example"
2870 @ManageTransactions("PrimOp")
2871 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2873 Create a box with two specified opposite vertices,
2874 and with edges, parallel to the coordinate axes
2877 thePnt1 First of two opposite vertices.
2878 thePnt2 Second of two opposite vertices.
2879 theName Object name; when specified, this parameter is used
2880 for result publication in the study. Otherwise, if automatic
2881 publication is switched on, default value is used for result name.
2884 New GEOM.GEOM_Object, containing the created box.
2886 # Example: see GEOM_TestAll.py
2887 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2888 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2889 self._autoPublish(anObj, theName, "box")
2892 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2893 # @param theH height of Face.
2894 # @param theW width of Face.
2895 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2896 # @param theName Object name; when specified, this parameter is used
2897 # for result publication in the study. Otherwise, if automatic
2898 # publication is switched on, default value is used for result name.
2900 # @return New GEOM.GEOM_Object, containing the created face.
2902 # @ref tui_creation_face "Example"
2903 @ManageTransactions("PrimOp")
2904 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2906 Create a face with specified dimensions with edges parallel to coordinate axes.
2909 theH height of Face.
2911 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2912 theName Object name; when specified, this parameter is used
2913 for result publication in the study. Otherwise, if automatic
2914 publication is switched on, default value is used for result name.
2917 New GEOM.GEOM_Object, containing the created face.
2919 # Example: see GEOM_TestAll.py
2920 theH,theW,Parameters = ParseParameters(theH, theW)
2921 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2922 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2923 anObj.SetParameters(Parameters)
2924 self._autoPublish(anObj, theName, "rectangle")
2927 ## Create a face from another plane and two sizes,
2928 # vertical size and horisontal size.
2929 # @param theObj Normale vector to the creating face or
2931 # @param theH Height (vertical size).
2932 # @param theW Width (horisontal size).
2933 # @param theName Object name; when specified, this parameter is used
2934 # for result publication in the study. Otherwise, if automatic
2935 # publication is switched on, default value is used for result name.
2937 # @return New GEOM.GEOM_Object, containing the created face.
2939 # @ref tui_creation_face "Example"
2940 @ManageTransactions("PrimOp")
2941 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2943 Create a face from another plane and two sizes,
2944 vertical size and horisontal size.
2947 theObj Normale vector to the creating face or
2949 theH Height (vertical size).
2950 theW Width (horisontal size).
2951 theName Object name; when specified, this parameter is used
2952 for result publication in the study. Otherwise, if automatic
2953 publication is switched on, default value is used for result name.
2956 New GEOM_Object, containing the created face.
2958 # Example: see GEOM_TestAll.py
2959 theH,theW,Parameters = ParseParameters(theH, theW)
2960 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2961 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2962 anObj.SetParameters(Parameters)
2963 self._autoPublish(anObj, theName, "rectangle")
2966 ## Create a disk with given center, normal vector and radius.
2967 # @param thePnt Disk center.
2968 # @param theVec Vector, normal to the plane of the disk.
2969 # @param theR Disk radius.
2970 # @param theName Object name; when specified, this parameter is used
2971 # for result publication in the study. Otherwise, if automatic
2972 # publication is switched on, default value is used for result name.
2974 # @return New GEOM.GEOM_Object, containing the created disk.
2976 # @ref tui_creation_disk "Example"
2977 @ManageTransactions("PrimOp")
2978 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2980 Create a disk with given center, normal vector and radius.
2984 theVec Vector, normal to the plane of the disk.
2986 theName Object name; when specified, this parameter is used
2987 for result publication in the study. Otherwise, if automatic
2988 publication is switched on, default value is used for result name.
2991 New GEOM.GEOM_Object, containing the created disk.
2993 # Example: see GEOM_TestAll.py
2994 theR,Parameters = ParseParameters(theR)
2995 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2996 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2997 anObj.SetParameters(Parameters)
2998 self._autoPublish(anObj, theName, "disk")
3001 ## Create a disk, passing through three given points
3002 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3003 # @param theName Object name; when specified, this parameter is used
3004 # for result publication in the study. Otherwise, if automatic
3005 # publication is switched on, default value is used for result name.
3007 # @return New GEOM.GEOM_Object, containing the created disk.
3009 # @ref tui_creation_disk "Example"
3010 @ManageTransactions("PrimOp")
3011 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3013 Create a disk, passing through three given points
3016 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3017 theName Object name; when specified, this parameter is used
3018 for result publication in the study. Otherwise, if automatic
3019 publication is switched on, default value is used for result name.
3022 New GEOM.GEOM_Object, containing the created disk.
3024 # Example: see GEOM_TestAll.py
3025 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3026 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3027 self._autoPublish(anObj, theName, "disk")
3030 ## Create a disk with specified dimensions along OX-OY coordinate axes.
3031 # @param theR Radius of Face.
3032 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3033 # @param theName Object name; when specified, this parameter is used
3034 # for result publication in the study. Otherwise, if automatic
3035 # publication is switched on, default value is used for result name.
3037 # @return New GEOM.GEOM_Object, containing the created disk.
3039 # @ref tui_creation_face "Example"
3040 @ManageTransactions("PrimOp")
3041 def MakeDiskR(self, theR, theOrientation, theName=None):
3043 Create a disk with specified dimensions along OX-OY coordinate axes.
3046 theR Radius of Face.
3047 theOrientation set the orientation belong axis OXY or OYZ or OZX
3048 theName Object name; when specified, this parameter is used
3049 for result publication in the study. Otherwise, if automatic
3050 publication is switched on, default value is used for result name.
3053 New GEOM.GEOM_Object, containing the created disk.
3056 Disk3 = geompy.MakeDiskR(100., 1)
3058 # Example: see GEOM_TestAll.py
3059 theR,Parameters = ParseParameters(theR)
3060 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3061 RaiseIfFailed("MakeDiskR", self.PrimOp)
3062 anObj.SetParameters(Parameters)
3063 self._autoPublish(anObj, theName, "disk")
3066 ## Create a cylinder with given base point, axis, radius and height.
3067 # @param thePnt Central point of cylinder base.
3068 # @param theAxis Cylinder axis.
3069 # @param theR Cylinder radius.
3070 # @param theH Cylinder height.
3071 # @param theName Object name; when specified, this parameter is used
3072 # for result publication in the study. Otherwise, if automatic
3073 # publication is switched on, default value is used for result name.
3075 # @return New GEOM.GEOM_Object, containing the created cylinder.
3077 # @ref tui_creation_cylinder "Example"
3078 @ManageTransactions("PrimOp")
3079 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3081 Create a cylinder with given base point, axis, radius and height.
3084 thePnt Central point of cylinder base.
3085 theAxis Cylinder axis.
3086 theR Cylinder radius.
3087 theH Cylinder height.
3088 theName Object name; when specified, this parameter is used
3089 for result publication in the study. Otherwise, if automatic
3090 publication is switched on, default value is used for result name.
3093 New GEOM.GEOM_Object, containing the created cylinder.
3095 # Example: see GEOM_TestAll.py
3096 theR,theH,Parameters = ParseParameters(theR, theH)
3097 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3098 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3099 anObj.SetParameters(Parameters)
3100 self._autoPublish(anObj, theName, "cylinder")
3103 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3104 # @param thePnt Central point of cylinder base.
3105 # @param theAxis Cylinder axis.
3106 # @param theR Cylinder radius.
3107 # @param theH Cylinder height.
3108 # @param theA Cylinder angle in radians.
3109 # @param theName Object name; when specified, this parameter is used
3110 # for result publication in the study. Otherwise, if automatic
3111 # publication is switched on, default value is used for result name.
3113 # @return New GEOM.GEOM_Object, containing the created cylinder.
3115 # @ref tui_creation_cylinder "Example"
3116 @ManageTransactions("PrimOp")
3117 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3119 Create a portion of cylinder with given base point, axis, radius, height and angle.
3122 thePnt Central point of cylinder base.
3123 theAxis Cylinder axis.
3124 theR Cylinder radius.
3125 theH Cylinder height.
3126 theA Cylinder angle in radians.
3127 theName Object name; when specified, this parameter is used
3128 for result publication in the study. Otherwise, if automatic
3129 publication is switched on, default value is used for result name.
3132 New GEOM.GEOM_Object, containing the created cylinder.
3134 # Example: see GEOM_TestAll.py
3136 if isinstance(theA,str):
3138 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3140 theA = theA*math.pi/180.
3141 if theA<=0. or theA>=2*math.pi:
3142 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3143 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3144 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3145 anObj.SetParameters(Parameters)
3146 self._autoPublish(anObj, theName, "cylinder")
3149 ## Create a cylinder with given radius and height at
3150 # the origin of coordinate system. Axis of the cylinder
3151 # will be collinear to the OZ axis of the coordinate system.
3152 # @param theR Cylinder radius.
3153 # @param theH Cylinder height.
3154 # @param theName Object name; when specified, this parameter is used
3155 # for result publication in the study. Otherwise, if automatic
3156 # publication is switched on, default value is used for result name.
3158 # @return New GEOM.GEOM_Object, containing the created cylinder.
3160 # @ref tui_creation_cylinder "Example"
3161 @ManageTransactions("PrimOp")
3162 def MakeCylinderRH(self, theR, theH, theName=None):
3164 Create a cylinder with given radius and height at
3165 the origin of coordinate system. Axis of the cylinder
3166 will be collinear to the OZ axis of the coordinate system.
3169 theR Cylinder radius.
3170 theH Cylinder height.
3171 theName Object name; when specified, this parameter is used
3172 for result publication in the study. Otherwise, if automatic
3173 publication is switched on, default value is used for result name.
3176 New GEOM.GEOM_Object, containing the created cylinder.
3178 # Example: see GEOM_TestAll.py
3179 theR,theH,Parameters = ParseParameters(theR, theH)
3180 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3181 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3182 anObj.SetParameters(Parameters)
3183 self._autoPublish(anObj, theName, "cylinder")
3186 ## Create a portion of cylinder with given radius, height and angle at
3187 # the origin of coordinate system. Axis of the cylinder
3188 # will be collinear to the OZ axis of the coordinate system.
3189 # @param theR Cylinder radius.
3190 # @param theH Cylinder height.
3191 # @param theA Cylinder angle in radians.
3192 # @param theName Object name; when specified, this parameter is used
3193 # for result publication in the study. Otherwise, if automatic
3194 # publication is switched on, default value is used for result name.
3196 # @return New GEOM.GEOM_Object, containing the created cylinder.
3198 # @ref tui_creation_cylinder "Example"
3199 @ManageTransactions("PrimOp")
3200 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3202 Create a portion of cylinder with given radius, height and angle at
3203 the origin of coordinate system. Axis of the cylinder
3204 will be collinear to the OZ axis of the coordinate system.
3207 theR Cylinder radius.
3208 theH Cylinder height.
3209 theA Cylinder angle in radians.
3210 theName Object name; when specified, this parameter is used
3211 for result publication in the study. Otherwise, if automatic
3212 publication is switched on, default value is used for result name.
3215 New GEOM.GEOM_Object, containing the created cylinder.
3217 # Example: see GEOM_TestAll.py
3219 if isinstance(theA,str):
3221 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3223 theA = theA*math.pi/180.
3224 if theA<=0. or theA>=2*math.pi:
3225 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3226 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3227 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3228 anObj.SetParameters(Parameters)
3229 self._autoPublish(anObj, theName, "cylinder")
3232 ## Create a sphere with given center and radius.
3233 # @param thePnt Sphere center.
3234 # @param theR Sphere radius.
3235 # @param theName Object name; when specified, this parameter is used
3236 # for result publication in the study. Otherwise, if automatic
3237 # publication is switched on, default value is used for result name.
3239 # @return New GEOM.GEOM_Object, containing the created sphere.
3241 # @ref tui_creation_sphere "Example"
3242 @ManageTransactions("PrimOp")
3243 def MakeSpherePntR(self, thePnt, theR, theName=None):
3245 Create a sphere with given center and radius.
3248 thePnt Sphere center.
3250 theName Object name; when specified, this parameter is used
3251 for result publication in the study. Otherwise, if automatic
3252 publication is switched on, default value is used for result name.
3255 New GEOM.GEOM_Object, containing the created sphere.
3257 # Example: see GEOM_TestAll.py
3258 theR,Parameters = ParseParameters(theR)
3259 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3260 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3261 anObj.SetParameters(Parameters)
3262 self._autoPublish(anObj, theName, "sphere")
3265 ## Create a sphere with given center and radius.
3266 # @param x,y,z Coordinates of sphere center.
3267 # @param theR Sphere radius.
3268 # @param theName Object name; when specified, this parameter is used
3269 # for result publication in the study. Otherwise, if automatic
3270 # publication is switched on, default value is used for result name.
3272 # @return New GEOM.GEOM_Object, containing the created sphere.
3274 # @ref tui_creation_sphere "Example"
3275 def MakeSphere(self, x, y, z, theR, theName=None):
3277 Create a sphere with given center and radius.
3280 x,y,z Coordinates of sphere center.
3282 theName Object name; when specified, this parameter is used
3283 for result publication in the study. Otherwise, if automatic
3284 publication is switched on, default value is used for result name.
3287 New GEOM.GEOM_Object, containing the created sphere.
3289 # Example: see GEOM_TestAll.py
3290 point = self.MakeVertex(x, y, z)
3291 # note: auto-publishing is done in self.MakeSpherePntR()
3292 anObj = self.MakeSpherePntR(point, theR, theName)
3295 ## Create a sphere with given radius at the origin of coordinate system.
3296 # @param theR Sphere radius.
3297 # @param theName Object name; when specified, this parameter is used
3298 # for result publication in the study. Otherwise, if automatic
3299 # publication is switched on, default value is used for result name.
3301 # @return New GEOM.GEOM_Object, containing the created sphere.
3303 # @ref tui_creation_sphere "Example"
3304 @ManageTransactions("PrimOp")
3305 def MakeSphereR(self, theR, theName=None):
3307 Create a sphere with given radius at the origin of coordinate system.
3311 theName Object name; when specified, this parameter is used
3312 for result publication in the study. Otherwise, if automatic
3313 publication is switched on, default value is used for result name.
3316 New GEOM.GEOM_Object, containing the created sphere.
3318 # Example: see GEOM_TestAll.py
3319 theR,Parameters = ParseParameters(theR)
3320 anObj = self.PrimOp.MakeSphereR(theR)
3321 RaiseIfFailed("MakeSphereR", self.PrimOp)
3322 anObj.SetParameters(Parameters)
3323 self._autoPublish(anObj, theName, "sphere")
3326 ## Create a cone with given base point, axis, height and radiuses.
3327 # @param thePnt Central point of the first cone base.
3328 # @param theAxis Cone axis.
3329 # @param theR1 Radius of the first cone base.
3330 # @param theR2 Radius of the second cone base.
3331 # \note If both radiuses are non-zero, the cone will be truncated.
3332 # \note If the radiuses are equal, a cylinder will be created instead.
3333 # @param theH Cone height.
3334 # @param theName Object name; when specified, this parameter is used
3335 # for result publication in the study. Otherwise, if automatic
3336 # publication is switched on, default value is used for result name.
3338 # @return New GEOM.GEOM_Object, containing the created cone.
3340 # @ref tui_creation_cone "Example"
3341 @ManageTransactions("PrimOp")
3342 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3344 Create a cone with given base point, axis, height and radiuses.
3347 thePnt Central point of the first cone base.
3349 theR1 Radius of the first cone base.
3350 theR2 Radius of the second cone base.
3352 theName Object name; when specified, this parameter is used
3353 for result publication in the study. Otherwise, if automatic
3354 publication is switched on, default value is used for result name.
3357 If both radiuses are non-zero, the cone will be truncated.
3358 If the radiuses are equal, a cylinder will be created instead.
3361 New GEOM.GEOM_Object, containing the created cone.
3363 # Example: see GEOM_TestAll.py
3364 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3365 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3366 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3367 anObj.SetParameters(Parameters)
3368 self._autoPublish(anObj, theName, "cone")
3371 ## Create a cone with given height and radiuses at
3372 # the origin of coordinate system. Axis of the cone will
3373 # be collinear to the OZ axis of the coordinate system.
3374 # @param theR1 Radius of the first cone base.
3375 # @param theR2 Radius of the second cone base.
3376 # \note If both radiuses are non-zero, the cone will be truncated.
3377 # \note If the radiuses are equal, a cylinder will be created instead.
3378 # @param theH Cone height.
3379 # @param theName Object name; when specified, this parameter is used
3380 # for result publication in the study. Otherwise, if automatic
3381 # publication is switched on, default value is used for result name.
3383 # @return New GEOM.GEOM_Object, containing the created cone.
3385 # @ref tui_creation_cone "Example"
3386 @ManageTransactions("PrimOp")
3387 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3389 Create a cone with given height and radiuses at
3390 the origin of coordinate system. Axis of the cone will
3391 be collinear to the OZ axis of the coordinate system.
3394 theR1 Radius of the first cone base.
3395 theR2 Radius of the second cone base.
3397 theName Object name; when specified, this parameter is used
3398 for result publication in the study. Otherwise, if automatic
3399 publication is switched on, default value is used for result name.
3402 If both radiuses are non-zero, the cone will be truncated.
3403 If the radiuses are equal, a cylinder will be created instead.
3406 New GEOM.GEOM_Object, containing the created cone.
3408 # Example: see GEOM_TestAll.py
3409 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3410 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3411 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3412 anObj.SetParameters(Parameters)
3413 self._autoPublish(anObj, theName, "cone")
3416 ## Create a torus with given center, normal vector and radiuses.
3417 # @param thePnt Torus central point.
3418 # @param theVec Torus axis of symmetry.
3419 # @param theRMajor Torus major radius.
3420 # @param theRMinor Torus minor radius.
3421 # @param theName Object name; when specified, this parameter is used
3422 # for result publication in the study. Otherwise, if automatic
3423 # publication is switched on, default value is used for result name.
3425 # @return New GEOM.GEOM_Object, containing the created torus.
3427 # @ref tui_creation_torus "Example"
3428 @ManageTransactions("PrimOp")
3429 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3431 Create a torus with given center, normal vector and radiuses.
3434 thePnt Torus central point.
3435 theVec Torus axis of symmetry.
3436 theRMajor Torus major radius.
3437 theRMinor Torus minor radius.
3438 theName Object name; when specified, this parameter is used
3439 for result publication in the study. Otherwise, if automatic
3440 publication is switched on, default value is used for result name.
3443 New GEOM.GEOM_Object, containing the created torus.
3445 # Example: see GEOM_TestAll.py
3446 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3447 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3448 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3449 anObj.SetParameters(Parameters)
3450 self._autoPublish(anObj, theName, "torus")
3453 ## Create a torus with given radiuses at the origin of coordinate system.
3454 # @param theRMajor Torus major radius.
3455 # @param theRMinor Torus minor radius.
3456 # @param theName Object name; when specified, this parameter is used
3457 # for result publication in the study. Otherwise, if automatic
3458 # publication is switched on, default value is used for result name.
3460 # @return New GEOM.GEOM_Object, containing the created torus.
3462 # @ref tui_creation_torus "Example"
3463 @ManageTransactions("PrimOp")
3464 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3466 Create a torus with given radiuses at the origin of coordinate system.
3469 theRMajor Torus major radius.
3470 theRMinor Torus minor radius.
3471 theName Object name; when specified, this parameter is used
3472 for result publication in the study. Otherwise, if automatic
3473 publication is switched on, default value is used for result name.
3476 New GEOM.GEOM_Object, containing the created torus.
3478 # Example: see GEOM_TestAll.py
3479 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3480 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3481 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3482 anObj.SetParameters(Parameters)
3483 self._autoPublish(anObj, theName, "torus")
3486 # end of l3_3d_primitives
3489 ## @addtogroup l3_complex
3492 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3493 # @param theBase Base shape to be extruded.
3494 # @param thePoint1 First end of extrusion vector.
3495 # @param thePoint2 Second end of extrusion vector.
3496 # @param theScaleFactor Use it to make prism with scaled second base.
3497 # Nagative value means not scaled second base.
3498 # @param theName Object name; when specified, this parameter is used
3499 # for result publication in the study. Otherwise, if automatic
3500 # publication is switched on, default value is used for result name.
3502 # @return New GEOM.GEOM_Object, containing the created prism.
3504 # @ref tui_creation_prism "Example"
3505 @ManageTransactions("PrimOp")
3506 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3508 Create a shape by extrusion of the base shape along a vector, defined by two points.
3511 theBase Base shape to be extruded.
3512 thePoint1 First end of extrusion vector.
3513 thePoint2 Second end of extrusion vector.
3514 theScaleFactor Use it to make prism with scaled second base.
3515 Nagative value means not scaled second base.
3516 theName Object name; when specified, this parameter is used
3517 for result publication in the study. Otherwise, if automatic
3518 publication is switched on, default value is used for result name.
3521 New GEOM.GEOM_Object, containing the created prism.
3523 # Example: see GEOM_TestAll.py
3526 if theScaleFactor > 0:
3527 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3528 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3530 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3531 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3532 anObj.SetParameters(Parameters)
3533 self._autoPublish(anObj, theName, "prism")
3536 ## Create a shape by extrusion of the base shape along a
3537 # vector, defined by two points, in 2 Ways (forward/backward).
3538 # @param theBase Base shape to be extruded.
3539 # @param thePoint1 First end of extrusion vector.
3540 # @param thePoint2 Second end of extrusion vector.
3541 # @param theName Object name; when specified, this parameter is used
3542 # for result publication in the study. Otherwise, if automatic
3543 # publication is switched on, default value is used for result name.
3545 # @return New GEOM.GEOM_Object, containing the created prism.
3547 # @ref tui_creation_prism "Example"
3548 @ManageTransactions("PrimOp")
3549 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3551 Create a shape by extrusion of the base shape along a
3552 vector, defined by two points, in 2 Ways (forward/backward).
3555 theBase Base shape to be extruded.
3556 thePoint1 First end of extrusion vector.
3557 thePoint2 Second end of extrusion vector.
3558 theName Object name; when specified, this parameter is used
3559 for result publication in the study. Otherwise, if automatic
3560 publication is switched on, default value is used for result name.
3563 New GEOM.GEOM_Object, containing the created prism.
3565 # Example: see GEOM_TestAll.py
3566 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3567 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3568 self._autoPublish(anObj, theName, "prism")
3571 ## Create a shape by extrusion of the base shape along the vector,
3572 # i.e. all the space, transfixed by the base shape during its translation
3573 # along the vector on the given distance.
3574 # @param theBase Base shape to be extruded.
3575 # @param theVec Direction of extrusion.
3576 # @param theH Prism dimension along theVec.
3577 # @param theScaleFactor Use it to make prism with scaled second base.
3578 # Negative value means not scaled second base.
3579 # @param theName Object name; when specified, this parameter is used
3580 # for result publication in the study. Otherwise, if automatic
3581 # publication is switched on, default value is used for result name.
3583 # @return New GEOM.GEOM_Object, containing the created prism.
3585 # @ref tui_creation_prism "Example"
3586 @ManageTransactions("PrimOp")
3587 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3589 Create a shape by extrusion of the base shape along the vector,
3590 i.e. all the space, transfixed by the base shape during its translation
3591 along the vector on the given distance.
3594 theBase Base shape to be extruded.
3595 theVec Direction of extrusion.
3596 theH Prism dimension along theVec.
3597 theScaleFactor Use it to make prism with scaled second base.
3598 Negative value means not scaled second base.
3599 theName Object name; when specified, this parameter is used
3600 for result publication in the study. Otherwise, if automatic
3601 publication is switched on, default value is used for result name.
3604 New GEOM.GEOM_Object, containing the created prism.
3606 # Example: see GEOM_TestAll.py
3609 if theScaleFactor > 0:
3610 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3611 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3613 theH,Parameters = ParseParameters(theH)
3614 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3615 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3616 anObj.SetParameters(Parameters)
3617 self._autoPublish(anObj, theName, "prism")
3620 ## Create a shape by extrusion of the base shape along the vector,
3621 # i.e. all the space, transfixed by the base shape during its translation
3622 # along the vector on the given distance in 2 Ways (forward/backward).
3623 # @param theBase Base shape to be extruded.
3624 # @param theVec Direction of extrusion.
3625 # @param theH Prism dimension along theVec in forward direction.
3626 # @param theName Object name; when specified, this parameter is used
3627 # for result publication in the study. Otherwise, if automatic
3628 # publication is switched on, default value is used for result name.
3630 # @return New GEOM.GEOM_Object, containing the created prism.
3632 # @ref tui_creation_prism "Example"
3633 @ManageTransactions("PrimOp")
3634 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3636 Create a shape by extrusion of the base shape along the vector,
3637 i.e. all the space, transfixed by the base shape during its translation
3638 along the vector on the given distance in 2 Ways (forward/backward).
3641 theBase Base shape to be extruded.
3642 theVec Direction of extrusion.
3643 theH Prism dimension along theVec in forward direction.
3644 theName Object name; when specified, this parameter is used
3645 for result publication in the study. Otherwise, if automatic
3646 publication is switched on, default value is used for result name.
3649 New GEOM.GEOM_Object, containing the created prism.
3651 # Example: see GEOM_TestAll.py
3652 theH,Parameters = ParseParameters(theH)
3653 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3654 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3655 anObj.SetParameters(Parameters)
3656 self._autoPublish(anObj, theName, "prism")
3659 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3660 # @param theBase Base shape to be extruded.
3661 # @param theDX, theDY, theDZ Directions of extrusion.
3662 # @param theScaleFactor Use it to make prism with scaled second base.
3663 # Nagative value means not scaled second base.
3664 # @param theName Object name; when specified, this parameter is used
3665 # for result publication in the study. Otherwise, if automatic
3666 # publication is switched on, default value is used for result name.
3668 # @return New GEOM.GEOM_Object, containing the created prism.
3670 # @ref tui_creation_prism "Example"
3671 @ManageTransactions("PrimOp")
3672 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3674 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3677 theBase Base shape to be extruded.
3678 theDX, theDY, theDZ Directions of extrusion.
3679 theScaleFactor Use it to make prism with scaled second base.
3680 Nagative value means not scaled second base.
3681 theName Object name; when specified, this parameter is used
3682 for result publication in the study. Otherwise, if automatic
3683 publication is switched on, default value is used for result name.
3686 New GEOM.GEOM_Object, containing the created prism.
3688 # Example: see GEOM_TestAll.py
3691 if theScaleFactor > 0:
3692 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3693 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3695 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3696 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3697 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3698 anObj.SetParameters(Parameters)
3699 self._autoPublish(anObj, theName, "prism")
3702 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3703 # i.e. all the space, transfixed by the base shape during its translation
3704 # along the vector on the given distance in 2 Ways (forward/backward).
3705 # @param theBase Base shape to be extruded.
3706 # @param theDX, theDY, theDZ Directions of extrusion.
3707 # @param theName Object name; when specified, this parameter is used
3708 # for result publication in the study. Otherwise, if automatic
3709 # publication is switched on, default value is used for result name.
3711 # @return New GEOM.GEOM_Object, containing the created prism.
3713 # @ref tui_creation_prism "Example"
3714 @ManageTransactions("PrimOp")
3715 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3717 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3718 i.e. all the space, transfixed by the base shape during its translation
3719 along the vector on the given distance in 2 Ways (forward/backward).
3722 theBase Base shape to be extruded.
3723 theDX, theDY, theDZ Directions of extrusion.
3724 theName Object name; when specified, this parameter is used
3725 for result publication in the study. Otherwise, if automatic
3726 publication is switched on, default value is used for result name.
3729 New GEOM.GEOM_Object, containing the created prism.
3731 # Example: see GEOM_TestAll.py
3732 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3733 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3734 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3735 anObj.SetParameters(Parameters)
3736 self._autoPublish(anObj, theName, "prism")
3739 ## Create a shape by revolution of the base shape around the axis
3740 # on the given angle, i.e. all the space, transfixed by the base
3741 # shape during its rotation around the axis on the given angle.
3742 # @param theBase Base shape to be rotated.
3743 # @param theAxis Rotation axis.
3744 # @param theAngle Rotation angle in radians.
3745 # @param theName Object name; when specified, this parameter is used
3746 # for result publication in the study. Otherwise, if automatic
3747 # publication is switched on, default value is used for result name.
3749 # @return New GEOM.GEOM_Object, containing the created revolution.
3751 # @ref tui_creation_revolution "Example"
3752 @ManageTransactions("PrimOp")
3753 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3755 Create a shape by revolution of the base shape around the axis
3756 on the given angle, i.e. all the space, transfixed by the base
3757 shape during its rotation around the axis on the given angle.
3760 theBase Base shape to be rotated.
3761 theAxis Rotation axis.
3762 theAngle Rotation angle in radians.
3763 theName Object name; when specified, this parameter is used
3764 for result publication in the study. Otherwise, if automatic
3765 publication is switched on, default value is used for result name.
3768 New GEOM.GEOM_Object, containing the created revolution.
3770 # Example: see GEOM_TestAll.py
3771 theAngle,Parameters = ParseParameters(theAngle)
3772 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3773 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3774 anObj.SetParameters(Parameters)
3775 self._autoPublish(anObj, theName, "revolution")
3778 ## Create a shape by revolution of the base shape around the axis
3779 # on the given angle, i.e. all the space, transfixed by the base
3780 # shape during its rotation around the axis on the given angle in
3781 # both directions (forward/backward)
3782 # @param theBase Base shape to be rotated.
3783 # @param theAxis Rotation axis.
3784 # @param theAngle Rotation angle in radians.
3785 # @param theName Object name; when specified, this parameter is used
3786 # for result publication in the study. Otherwise, if automatic
3787 # publication is switched on, default value is used for result name.
3789 # @return New GEOM.GEOM_Object, containing the created revolution.
3791 # @ref tui_creation_revolution "Example"
3792 @ManageTransactions("PrimOp")
3793 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3795 Create a shape by revolution of the base shape around the axis
3796 on the given angle, i.e. all the space, transfixed by the base
3797 shape during its rotation around the axis on the given angle in
3798 both directions (forward/backward).
3801 theBase Base shape to be rotated.
3802 theAxis Rotation axis.
3803 theAngle Rotation angle in radians.
3804 theName Object name; when specified, this parameter is used
3805 for result publication in the study. Otherwise, if automatic
3806 publication is switched on, default value is used for result name.
3809 New GEOM.GEOM_Object, containing the created revolution.
3811 theAngle,Parameters = ParseParameters(theAngle)
3812 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3813 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3814 anObj.SetParameters(Parameters)
3815 self._autoPublish(anObj, theName, "revolution")
3818 ## Create a face from a given set of contours.
3819 # @param theContours either a list or a compound of edges/wires.
3820 # @param theMinDeg a minimal degree of BSpline surface to create.
3821 # @param theMaxDeg a maximal degree of BSpline surface to create.
3822 # @param theTol2D a 2d tolerance to be reached.
3823 # @param theTol3D a 3d tolerance to be reached.
3824 # @param theNbIter a number of iteration of approximation algorithm.
3825 # @param theMethod Kind of method to perform filling operation
3826 # (see GEOM.filling_oper_method enum).
3827 # @param isApprox if True, BSpline curves are generated in the process
3828 # of surface construction. By default it is False, that means
3829 # the surface is created using given curves. The usage of
3830 # Approximation makes the algorithm work slower, but allows
3831 # building the surface for rather complex cases.
3832 # @param theName Object name; when specified, this parameter is used
3833 # for result publication in the study. Otherwise, if automatic
3834 # publication is switched on, default value is used for result name.
3836 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3838 # @ref tui_creation_filling "Example"
3839 @ManageTransactions("PrimOp")
3840 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3841 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3843 Create a face from a given set of contours.
3846 theContours either a list or a compound of edges/wires.
3847 theMinDeg a minimal degree of BSpline surface to create.
3848 theMaxDeg a maximal degree of BSpline surface to create.
3849 theTol2D a 2d tolerance to be reached.
3850 theTol3D a 3d tolerance to be reached.
3851 theNbIter a number of iteration of approximation algorithm.
3852 theMethod Kind of method to perform filling operation
3853 (see GEOM.filling_oper_method enum).
3854 isApprox if True, BSpline curves are generated in the process
3855 of surface construction. By default it is False, that means
3856 the surface is created using given curves. The usage of
3857 Approximation makes the algorithm work slower, but allows
3858 building the surface for rather complex cases.
3859 theName Object name; when specified, this parameter is used
3860 for result publication in the study. Otherwise, if automatic
3861 publication is switched on, default value is used for result name.
3864 New GEOM.GEOM_Object (face), containing the created filling surface.
3867 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3869 # Example: see GEOM_TestAll.py
3870 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3871 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3872 theTol2D, theTol3D, theNbIter,
3873 theMethod, isApprox)
3874 RaiseIfFailed("MakeFilling", self.PrimOp)
3875 anObj.SetParameters(Parameters)
3876 self._autoPublish(anObj, theName, "filling")
3880 ## Create a face from a given set of contours.
3881 # This method corresponds to MakeFilling() with isApprox=True.
3882 # @param theContours either a list or a compound of edges/wires.
3883 # @param theMinDeg a minimal degree of BSpline surface to create.
3884 # @param theMaxDeg a maximal degree of BSpline surface to create.
3885 # @param theTol3D a 3d tolerance to be reached.
3886 # @param theName Object name; when specified, this parameter is used
3887 # for result publication in the study. Otherwise, if automatic
3888 # publication is switched on, default value is used for result name.
3890 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3892 # @ref tui_creation_filling "Example"
3893 @ManageTransactions("PrimOp")
3894 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3896 Create a filling from the given compound of contours.
3897 This method corresponds to MakeFilling() with isApprox=True.
3900 theContours either a list or a compound of edges/wires.
3901 theMinDeg a minimal degree of BSpline surface to create.
3902 theMaxDeg a maximal degree of BSpline surface to create.
3903 theTol3D a 3d tolerance to be reached.
3904 theName Object name; when specified, this parameter is used
3905 for result publication in the study. Otherwise, if automatic
3906 publication is switched on, default value is used for result name.
3909 New GEOM.GEOM_Object (face), containing the created filling surface.
3912 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3914 # Example: see GEOM_TestAll.py
3915 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3916 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3917 0, theTol3D, 0, GEOM.FOM_Default, True)
3918 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3919 anObj.SetParameters(Parameters)
3920 self._autoPublish(anObj, theName, "filling")
3923 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3924 # @param theSeqSections - set of specified sections.
3925 # @param theModeSolid - mode defining building solid or shell
3926 # @param thePreci - precision 3D used for smoothing
3927 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3928 # @param theName Object name; when specified, this parameter is used
3929 # for result publication in the study. Otherwise, if automatic
3930 # publication is switched on, default value is used for result name.
3932 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3934 # @ref swig_todo "Example"
3935 @ManageTransactions("PrimOp")
3936 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3938 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3941 theSeqSections - set of specified sections.
3942 theModeSolid - mode defining building solid or shell
3943 thePreci - precision 3D used for smoothing
3944 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3945 theName Object name; when specified, this parameter is used
3946 for result publication in the study. Otherwise, if automatic
3947 publication is switched on, default value is used for result name.
3950 New GEOM.GEOM_Object, containing the created shell or solid.
3952 # Example: see GEOM_TestAll.py
3953 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3954 RaiseIfFailed("MakeThruSections", self.PrimOp)
3955 self._autoPublish(anObj, theName, "filling")
3958 ## Create a shape by extrusion of the base shape along
3959 # the path shape. The path shape can be a wire or an edge. It is
3960 # possible to generate groups along with the result by means of
3961 # setting the flag \a IsGenerateGroups.<BR>
3962 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3963 # set, an error is occurred. If \a thePath is not closed edge/wire,
3964 # the following groups are returned:
3965 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3967 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3970 # "Down" and "Up" groups contain:
3971 # - Edges if \a theBase is edge or wire;
3972 # - Faces if \a theBase is face or shell.<BR>
3974 # "Side1" and "Side2" groups contain edges generated from the first
3975 # and last vertices of \a theBase. The first and last vertices are
3976 # determined taking into account edge/wire orientation.<BR>
3977 # "Other" group represents faces generated from the bounding edges of
3980 # @param theBase Base shape to be extruded.
3981 # @param thePath Path shape to extrude the base shape along it.
3982 # @param IsGenerateGroups flag that tells if it is necessary to
3983 # create groups. It is equal to False by default.
3984 # @param theName Object name; when specified, this parameter is used
3985 # for result publication in the study. Otherwise, if automatic
3986 # publication is switched on, default value is used for result name.
3988 # @return New GEOM.GEOM_Object, containing the created pipe if
3989 # \a IsGenerateGroups is not set. Otherwise it returns a
3990 # list of GEOM.GEOM_Object. Its first element is the created pipe, the
3991 # remaining ones are created groups.
3993 # @ref tui_creation_pipe "Example"
3994 @ManageTransactions("PrimOp")
3995 def MakePipe(self, theBase, thePath,
3996 IsGenerateGroups=False, theName=None):
3998 Create a shape by extrusion of the base shape along
3999 the path shape. The path shape can be a wire or an edge. It is
4000 possible to generate groups along with the result by means of
4001 setting the flag IsGenerateGroups.
4002 If thePath is a closed edge or wire and IsGenerateGroups is
4003 set, an error is occurred. If thePath is not closed edge/wire,
4004 the following groups are returned:
4005 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4007 - If theBase is closed edge or wire, face or shell: "Down", "Up",
4009 "Down" and "Up" groups contain:
4010 - Edges if theBase is edge or wire;
4011 - Faces if theBase is face or shell.
4012 "Side1" and "Side2" groups contain edges generated from the first
4013 and last vertices of theBase. The first and last vertices are
4014 determined taking into account edge/wire orientation.
4015 "Other" group represents faces generated from the bounding edges of
4019 theBase Base shape to be extruded.
4020 thePath Path shape to extrude the base shape along it.
4021 IsGenerateGroups flag that tells if it is necessary to
4022 create groups. It is equal to False by default.
4023 theName Object name; when specified, this parameter is used
4024 for result publication in the study. Otherwise, if automatic
4025 publication is switched on, default value is used for result name.
4028 New GEOM.GEOM_Object, containing the created pipe if
4029 IsGenerateGroups is not set. Otherwise it returns a
4030 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4031 remaining ones are created groups.
4033 # Example: see GEOM_TestAll.py
4034 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4035 RaiseIfFailed("MakePipe", self.PrimOp)
4037 if IsGenerateGroups:
4038 self._autoPublish(aList, theName, "pipe")
4041 self._autoPublish(aList[0], theName, "pipe")
4044 ## Create a shape by extrusion of the profile shape along
4045 # the path shape. The path shape can be a wire or an edge.
4046 # the several profiles can be specified in the several locations of path.
4047 # It is possible to generate groups along with the result by means of
4048 # setting the flag \a IsGenerateGroups. For detailed information on
4049 # groups that can be created please see the method MakePipe().
4050 # @param theSeqBases - list of Bases shape to be extruded.
4051 # @param theLocations - list of locations on the path corresponding
4052 # specified list of the Bases shapes. Number of locations
4053 # should be equal to number of bases or list of locations can be empty.
4054 # @param thePath - Path shape to extrude the base shape along it.
4055 # @param theWithContact - the mode defining that the section is translated to be in
4056 # contact with the spine.
4057 # @param theWithCorrection - defining that the section is rotated to be
4058 # orthogonal to the spine tangent in the correspondent point
4059 # @param IsGenerateGroups - flag that tells if it is necessary to
4060 # create groups. It is equal to False by default.
4061 # @param theName Object name; when specified, this parameter is used
4062 # for result publication in the study. Otherwise, if automatic
4063 # publication is switched on, default value is used for result name.
4065 # @return New GEOM.GEOM_Object, containing the created pipe if
4066 # \a IsGenerateGroups is not set. Otherwise it returns new
4067 # GEOM.ListOfGO. Its first element is the created pipe, the
4068 # remaining ones are created groups.
4070 # @ref tui_creation_pipe_with_diff_sec "Example"
4071 @ManageTransactions("PrimOp")
4072 def MakePipeWithDifferentSections(self, theSeqBases,
4073 theLocations, thePath,
4074 theWithContact, theWithCorrection,
4075 IsGenerateGroups=False, theName=None):
4077 Create a shape by extrusion of the profile shape along
4078 the path shape. The path shape can be a wire or an edge.
4079 the several profiles can be specified in the several locations of path.
4080 It is possible to generate groups along with the result by means of
4081 setting the flag IsGenerateGroups. For detailed information on
4082 groups that can be created please see the method geompy.MakePipe().
4085 theSeqBases - list of Bases shape to be extruded.
4086 theLocations - list of locations on the path corresponding
4087 specified list of the Bases shapes. Number of locations
4088 should be equal to number of bases or list of locations can be empty.
4089 thePath - Path shape to extrude the base shape along it.
4090 theWithContact - the mode defining that the section is translated to be in
4091 contact with the spine(0/1)
4092 theWithCorrection - defining that the section is rotated to be
4093 orthogonal to the spine tangent in the correspondent point (0/1)
4094 IsGenerateGroups - flag that tells if it is necessary to
4095 create groups. It is equal to False by default.
4096 theName Object name; when specified, this parameter is used
4097 for result publication in the study. Otherwise, if automatic
4098 publication is switched on, default value is used for result name.
4101 New GEOM.GEOM_Object, containing the created pipe if
4102 IsGenerateGroups is not set. Otherwise it returns new
4103 GEOM.ListOfGO. Its first element is the created pipe, the
4104 remaining ones are created groups.
4106 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4107 theLocations, thePath,
4108 theWithContact, theWithCorrection,
4109 False, IsGenerateGroups)
4110 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4112 if IsGenerateGroups:
4113 self._autoPublish(aList, theName, "pipe")
4116 self._autoPublish(aList[0], theName, "pipe")
4119 ## Create a shape by extrusion of the profile shape along
4120 # the path shape. This function is a version of
4121 # MakePipeWithDifferentSections() with the same parameters, except
4122 # eliminated theWithContact and theWithCorrection. So it is
4123 # possible to find the description of all parameters is in this
4124 # method. The difference is that this method performs the operation
4125 # step by step, i.e. it creates pipes between each pair of neighbor
4126 # sections and fuses them into a single shape.
4128 # @ref tui_creation_pipe_with_diff_sec "Example"
4129 @ManageTransactions("PrimOp")
4130 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4131 theLocations, thePath,
4132 IsGenerateGroups=False, theName=None):
4134 Create a shape by extrusion of the profile shape along
4135 the path shape. This function is a version of
4136 MakePipeWithDifferentSections() with the same parameters, except
4137 eliminated theWithContact and theWithCorrection. So it is
4138 possible to find the description of all parameters is in this
4139 method. The difference is that this method performs the operation
4140 step by step, i.e. it creates pipes between each pair of neighbor
4141 sections and fuses them into a single shape.
4143 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4144 theLocations, thePath,
4146 True, IsGenerateGroups)
4147 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4149 if IsGenerateGroups:
4150 self._autoPublish(aList, theName, "pipe")
4153 self._autoPublish(aList[0], theName, "pipe")
4156 ## Create a shape by extrusion of the profile shape along
4157 # the path shape. The path shape can be a wire or an edge.
4158 # the several profiles can be specified in the several locations of path.
4159 # It is possible to generate groups along with the result by means of
4160 # setting the flag \a IsGenerateGroups. For detailed information on
4161 # groups that can be created please see the method MakePipe().
4162 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4163 # shell or face. If number of faces in neighbour sections
4164 # aren't coincided result solid between such sections will
4165 # be created using external boundaries of this shells.
4166 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4167 # This list is used for searching correspondences between
4168 # faces in the sections. Size of this list must be equal
4169 # to size of list of base shapes.
4170 # @param theLocations - list of locations on the path corresponding
4171 # specified list of the Bases shapes. Number of locations
4172 # should be equal to number of bases. First and last
4173 # locations must be coincided with first and last vertexes
4174 # of path correspondingly.
4175 # @param thePath - Path shape to extrude the base shape along it.
4176 # @param theWithContact - the mode defining that the section is translated to be in
4177 # contact with the spine.
4178 # @param theWithCorrection - defining that the section is rotated to be
4179 # orthogonal to the spine tangent in the correspondent point
4180 # @param IsGenerateGroups - flag that tells if it is necessary to
4181 # create groups. It is equal to False by default.
4182 # @param theName Object name; when specified, this parameter is used
4183 # for result publication in the study. Otherwise, if automatic
4184 # publication is switched on, default value is used for result name.
4186 # @return New GEOM.GEOM_Object, containing the created solids if
4187 # \a IsGenerateGroups is not set. Otherwise it returns new
4188 # GEOM.ListOfGO. Its first element is the created solids, the
4189 # remaining ones are created groups.
4191 # @ref tui_creation_pipe_with_shell_sec "Example"
4192 @ManageTransactions("PrimOp")
4193 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4194 theLocations, thePath,
4195 theWithContact, theWithCorrection,
4196 IsGenerateGroups=False, theName=None):
4198 Create a shape by extrusion of the profile shape along
4199 the path shape. The path shape can be a wire or an edge.
4200 the several profiles can be specified in the several locations of path.
4201 It is possible to generate groups along with the result by means of
4202 setting the flag IsGenerateGroups. For detailed information on
4203 groups that can be created please see the method geompy.MakePipe().
4206 theSeqBases - list of Bases shape to be extruded. Base shape must be
4207 shell or face. If number of faces in neighbour sections
4208 aren't coincided result solid between such sections will
4209 be created using external boundaries of this shells.
4210 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4211 This list is used for searching correspondences between
4212 faces in the sections. Size of this list must be equal
4213 to size of list of base shapes.
4214 theLocations - list of locations on the path corresponding
4215 specified list of the Bases shapes. Number of locations
4216 should be equal to number of bases. First and last
4217 locations must be coincided with first and last vertexes
4218 of path correspondingly.
4219 thePath - Path shape to extrude the base shape along it.
4220 theWithContact - the mode defining that the section is translated to be in
4221 contact with the spine (0/1)
4222 theWithCorrection - defining that the section is rotated to be
4223 orthogonal to the spine tangent in the correspondent point (0/1)
4224 IsGenerateGroups - flag that tells if it is necessary to
4225 create groups. It is equal to False by default.
4226 theName Object name; when specified, this parameter is used
4227 for result publication in the study. Otherwise, if automatic
4228 publication is switched on, default value is used for result name.
4231 New GEOM.GEOM_Object, containing the created solids if
4232 IsGenerateGroups is not set. Otherwise it returns new
4233 GEOM.ListOfGO. Its first element is the created solids, the
4234 remaining ones are created groups.
4236 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4237 theLocations, thePath,
4238 theWithContact, theWithCorrection,
4240 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4242 if IsGenerateGroups:
4243 self._autoPublish(aList, theName, "pipe")
4246 self._autoPublish(aList[0], theName, "pipe")
4249 ## Create a shape by extrusion of the profile shape along
4250 # the path shape. This function is used only for debug pipe
4251 # functionality - it is a version of function MakePipeWithShellSections()
4252 # which give a possibility to receive information about
4253 # creating pipe between each pair of sections step by step.
4254 @ManageTransactions("PrimOp")
4255 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4256 theLocations, thePath,
4257 theWithContact, theWithCorrection,
4258 IsGenerateGroups=False, theName=None):
4260 Create a shape by extrusion of the profile shape along
4261 the path shape. This function is used only for debug pipe
4262 functionality - it is a version of previous function
4263 geompy.MakePipeWithShellSections() which give a possibility to
4264 receive information about creating pipe between each pair of
4265 sections step by step.
4268 nbsect = len(theSeqBases)
4269 nbsubsect = len(theSeqSubBases)
4270 #print "nbsect = ",nbsect
4271 for i in range(1,nbsect):
4273 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4274 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4276 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4277 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4278 tmpLocations, thePath,
4279 theWithContact, theWithCorrection,
4281 if self.PrimOp.IsDone() == 0:
4282 print("Problems with pipe creation between ",i," and ",i+1," sections")
4283 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4286 print("Pipe between ",i," and ",i+1," sections is OK")
4287 res.append(aList[0])
4291 resc = self.MakeCompound(res)
4292 #resc = self.MakeSewing(res, 0.001)
4293 #print "resc: ",resc
4294 self._autoPublish(resc, theName, "pipe")
4297 ## Create solids between given sections.
4298 # It is possible to generate groups along with the result by means of
4299 # setting the flag \a IsGenerateGroups. For detailed information on
4300 # groups that can be created please see the method MakePipe().
4301 # @param theSeqBases - list of sections (shell or face).
4302 # @param theLocations - list of corresponding vertexes
4303 # @param IsGenerateGroups - flag that tells if it is necessary to
4304 # create groups. It is equal to False by default.
4305 # @param theName Object name; when specified, this parameter is used
4306 # for result publication in the study. Otherwise, if automatic
4307 # publication is switched on, default value is used for result name.
4309 # @return New GEOM.GEOM_Object, containing the created solids if
4310 # \a IsGenerateGroups is not set. Otherwise it returns new
4311 # GEOM.ListOfGO. Its first element is the created solids, the
4312 # remaining ones are created groups.
4314 # @ref tui_creation_pipe_without_path "Example"
4315 @ManageTransactions("PrimOp")
4316 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4317 IsGenerateGroups=False, theName=None):
4319 Create solids between given sections.
4320 It is possible to generate groups along with the result by means of
4321 setting the flag IsGenerateGroups. For detailed information on
4322 groups that can be created please see the method geompy.MakePipe().
4325 theSeqBases - list of sections (shell or face).
4326 theLocations - list of corresponding vertexes
4327 IsGenerateGroups - flag that tells if it is necessary to
4328 create groups. It is equal to False by default.
4329 theName Object name; when specified, this parameter is used
4330 for result publication in the study. Otherwise, if automatic
4331 publication is switched on, default value is used for result name.
4334 New GEOM.GEOM_Object, containing the created solids if
4335 IsGenerateGroups is not set. Otherwise it returns new
4336 GEOM.ListOfGO. Its first element is the created solids, the
4337 remaining ones are created groups.
4339 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4341 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4343 if IsGenerateGroups:
4344 self._autoPublish(aList, theName, "pipe")
4347 self._autoPublish(aList[0], theName, "pipe")
4350 ## Create a shape by extrusion of the base shape along
4351 # the path shape with constant bi-normal direction along the given vector.
4352 # The path shape can be a wire or an edge.
4353 # It is possible to generate groups along with the result by means of
4354 # setting the flag \a IsGenerateGroups. For detailed information on
4355 # groups that can be created please see the method MakePipe().
4356 # @param theBase Base shape to be extruded.
4357 # @param thePath Path shape to extrude the base shape along it.
4358 # @param theVec Vector defines a constant binormal direction to keep the
4359 # same angle between the direction and the sections
4360 # along the sweep surface.
4361 # @param IsGenerateGroups flag that tells if it is necessary to
4362 # create groups. It is equal to False by default.
4363 # @param theName Object name; when specified, this parameter is used
4364 # for result publication in the study. Otherwise, if automatic
4365 # publication is switched on, default value is used for result name.
4367 # @return New GEOM.GEOM_Object, containing the created pipe if
4368 # \a IsGenerateGroups is not set. Otherwise it returns new
4369 # GEOM.ListOfGO. Its first element is the created pipe, the
4370 # remaining ones are created groups.
4372 # @ref tui_creation_pipe "Example"
4373 @ManageTransactions("PrimOp")
4374 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4375 IsGenerateGroups=False, theName=None):
4377 Create a shape by extrusion of the base shape along
4378 the path shape with constant bi-normal direction along the given vector.
4379 The path shape can be a wire or an edge.
4380 It is possible to generate groups along with the result by means of
4381 setting the flag IsGenerateGroups. For detailed information on
4382 groups that can be created please see the method geompy.MakePipe().
4385 theBase Base shape to be extruded.
4386 thePath Path shape to extrude the base shape along it.
4387 theVec Vector defines a constant binormal direction to keep the
4388 same angle between the direction and the sections
4389 along the sweep surface.
4390 IsGenerateGroups flag that tells if it is necessary to
4391 create groups. It is equal to False by default.
4392 theName Object name; when specified, this parameter is used
4393 for result publication in the study. Otherwise, if automatic
4394 publication is switched on, default value is used for result name.
4397 New GEOM.GEOM_Object, containing the created pipe if
4398 IsGenerateGroups is not set. Otherwise it returns new
4399 GEOM.ListOfGO. Its first element is the created pipe, the
4400 remaining ones are created groups.
4402 # Example: see GEOM_TestAll.py
4403 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4404 theVec, IsGenerateGroups)
4405 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4407 if IsGenerateGroups:
4408 self._autoPublish(aList, theName, "pipe")
4411 self._autoPublish(aList[0], theName, "pipe")
4414 ## Makes a thick solid from a shape. If the input is a surface shape
4415 # (face or shell) the result is a thick solid. If an input shape is
4416 # a solid the result is a hollowed solid with removed faces.
4417 # @param theShape Face or Shell to get thick solid or solid to get
4419 # @param theThickness Thickness of the resulting solid
4420 # @param theFacesIDs the list of face IDs to be removed from the
4421 # result. It is ignored if \a theShape is a face or a shell.
4422 # It is empty by default.
4423 # @param theInside If true the thickness is applied towards inside
4424 # @param theName Object name; when specified, this parameter is used
4425 # for result publication in the study. Otherwise, if automatic
4426 # publication is switched on, default value is used for result name.
4428 # @return New GEOM.GEOM_Object, containing the created solid
4430 # @ref tui_creation_thickness "Example"
4431 @ManageTransactions("PrimOp")
4432 def MakeThickSolid(self, theShape, theThickness,
4433 theFacesIDs=[], theInside=False, theName=None):
4435 Make a thick solid from a shape. If the input is a surface shape
4436 (face or shell) the result is a thick solid. If an input shape is
4437 a solid the result is a hollowed solid with removed faces.
4440 theShape Face or Shell to get thick solid or solid to get
4442 theThickness Thickness of the resulting solid
4443 theFacesIDs the list of face IDs to be removed from the
4444 result. It is ignored if theShape is a face or a
4445 shell. It is empty by default.
4446 theInside If true the thickness is applied towards inside
4447 theName Object name; when specified, this parameter is used
4448 for result publication in the study. Otherwise, if automatic
4449 publication is switched on, default value is used for result name.
4452 New GEOM.GEOM_Object, containing the created solid
4454 # Example: see GEOM_TestAll.py
4455 theThickness,Parameters = ParseParameters(theThickness)
4456 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4457 theThickness, True, theInside)
4458 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4459 anObj.SetParameters(Parameters)
4460 self._autoPublish(anObj, theName, "thickSolid")
4464 ## Modifies a shape to make it a thick solid. If the input is a surface
4465 # shape (face or shell) the result is a thick solid. If an input shape
4466 # is a solid the result is a hollowed solid with removed faces.
4467 # @param theShape Face or Shell to get thick solid or solid to get
4469 # @param theThickness Thickness of the resulting solid
4470 # @param theFacesIDs the list of face IDs to be removed from the
4471 # result. It is ignored if \a theShape is a face or a shell.
4472 # It is empty by default.
4473 # @param theInside If true the thickness is applied towards inside
4475 # @return The modified shape
4477 # @ref tui_creation_thickness "Example"
4478 @ManageTransactions("PrimOp")
4479 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4481 Modifies a shape to make it a thick solid. If the input is a
4482 surface shape (face or shell) the result is a thick solid. If
4483 an input shape is a solid the result is a hollowed solid with
4487 theShape Face or Shell to get thick solid or solid to get
4489 theThickness Thickness of the resulting solid
4490 theFacesIDs the list of face IDs to be removed from the
4491 result. It is ignored if \a theShape is a face or
4492 a shell. It is empty by default.
4493 theInside If true the thickness is applied towards inside
4498 # Example: see GEOM_TestAll.py
4499 theThickness,Parameters = ParseParameters(theThickness)
4500 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4501 theThickness, False, theInside)
4502 RaiseIfFailed("Thicken", self.PrimOp)
4503 anObj.SetParameters(Parameters)
4506 ## Build a middle path of a pipe-like shape.
4507 # The path shape can be a wire or an edge.
4508 # @param theShape It can be closed or unclosed pipe-like shell
4509 # or a pipe-like solid.
4510 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4511 # should be wires or faces of theShape.
4512 # @param theName Object name; when specified, this parameter is used
4513 # for result publication in the study. Otherwise, if automatic
4514 # publication is switched on, default value is used for result name.
4516 # @note It is not assumed that exact or approximate copy of theShape
4517 # can be obtained by applying existing Pipe operation on the
4518 # resulting "Path" wire taking theBase1 as the base - it is not
4519 # always possible; though in some particular cases it might work
4520 # it is not guaranteed. Thus, RestorePath function should not be
4521 # considered as an exact reverse operation of the Pipe.
4523 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4524 # source pipe's "path".
4526 # @ref tui_creation_pipe_path "Example"
4527 @ManageTransactions("PrimOp")
4528 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4530 Build a middle path of a pipe-like shape.
4531 The path shape can be a wire or an edge.
4534 theShape It can be closed or unclosed pipe-like shell
4535 or a pipe-like solid.
4536 theBase1, theBase2 Two bases of the supposed pipe. This
4537 should be wires or faces of theShape.
4538 theName Object name; when specified, this parameter is used
4539 for result publication in the study. Otherwise, if automatic
4540 publication is switched on, default value is used for result name.
4543 New GEOM_Object, containing an edge or wire that represent
4546 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4547 RaiseIfFailed("RestorePath", self.PrimOp)
4548 self._autoPublish(anObj, theName, "path")
4551 ## Build a middle path of a pipe-like shape.
4552 # The path shape can be a wire or an edge.
4553 # @param theShape It can be closed or unclosed pipe-like shell
4554 # or a pipe-like solid.
4555 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4556 # should be lists of edges of theShape.
4557 # @param theName Object name; when specified, this parameter is used
4558 # for result publication in the study. Otherwise, if automatic
4559 # publication is switched on, default value is used for result name.
4561 # @note It is not assumed that exact or approximate copy of theShape
4562 # can be obtained by applying existing Pipe operation on the
4563 # resulting "Path" wire taking theBase1 as the base - it is not
4564 # always possible; though in some particular cases it might work
4565 # it is not guaranteed. Thus, RestorePath function should not be
4566 # considered as an exact reverse operation of the Pipe.
4568 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4569 # source pipe's "path".
4571 # @ref tui_creation_pipe_path "Example"
4572 @ManageTransactions("PrimOp")
4573 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4575 Build a middle path of a pipe-like shape.
4576 The path shape can be a wire or an edge.
4579 theShape It can be closed or unclosed pipe-like shell
4580 or a pipe-like solid.
4581 listEdges1, listEdges2 Two bases of the supposed pipe. This
4582 should be lists of edges of theShape.
4583 theName Object name; when specified, this parameter is used
4584 for result publication in the study. Otherwise, if automatic
4585 publication is switched on, default value is used for result name.
4588 New GEOM_Object, containing an edge or wire that represent
4591 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4592 RaiseIfFailed("RestorePath", self.PrimOp)
4593 self._autoPublish(anObj, theName, "path")
4599 ## @addtogroup l3_basic_go
4602 ## Create a linear edge with specified ends.
4603 # @param thePnt1 Point for the first end of edge.
4604 # @param thePnt2 Point for the second end of edge.
4605 # @param theName Object name; when specified, this parameter is used
4606 # for result publication in the study. Otherwise, if automatic
4607 # publication is switched on, default value is used for result name.
4609 # @return New GEOM.GEOM_Object, containing the created edge.
4611 # @ref tui_creation_edge "Example"
4612 @ManageTransactions("ShapesOp")
4613 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4615 Create a linear edge with specified ends.
4618 thePnt1 Point for the first end of edge.
4619 thePnt2 Point for the second end of edge.
4620 theName Object name; when specified, this parameter is used
4621 for result publication in the study. Otherwise, if automatic
4622 publication is switched on, default value is used for result name.
4625 New GEOM.GEOM_Object, containing the created edge.
4627 # Example: see GEOM_TestAll.py
4628 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4629 RaiseIfFailed("MakeEdge", self.ShapesOp)
4630 self._autoPublish(anObj, theName, "edge")
4633 ## Create a new edge, corresponding to the given length on the given curve.
4634 # @param theRefCurve The referenced curve (edge).
4635 # @param theLength Length on the referenced curve. It can be negative.
4636 # @param theStartPoint Any point can be selected for it, the new edge will begin
4637 # at the end of \a theRefCurve, close to the selected point.
4638 # If None, start from the first point of \a theRefCurve.
4639 # @param theName Object name; when specified, this parameter is used
4640 # for result publication in the study. Otherwise, if automatic
4641 # publication is switched on, default value is used for result name.
4643 # @return New GEOM.GEOM_Object, containing the created edge.
4645 # @ref tui_creation_edge "Example"
4646 @ManageTransactions("ShapesOp")
4647 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4649 Create a new edge, corresponding to the given length on the given curve.
4652 theRefCurve The referenced curve (edge).
4653 theLength Length on the referenced curve. It can be negative.
4654 theStartPoint Any point can be selected for it, the new edge will begin
4655 at the end of theRefCurve, close to the selected point.
4656 If None, start from the first point of theRefCurve.
4657 theName Object name; when specified, this parameter is used
4658 for result publication in the study. Otherwise, if automatic
4659 publication is switched on, default value is used for result name.
4662 New GEOM.GEOM_Object, containing the created edge.
4664 # Example: see GEOM_TestAll.py
4665 theLength, Parameters = ParseParameters(theLength)
4666 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4667 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4668 anObj.SetParameters(Parameters)
4669 self._autoPublish(anObj, theName, "edge")
4672 ## Create an edge from specified wire.
4673 # @param theWire source Wire
4674 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4675 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4676 # @param theName Object name; when specified, this parameter is used
4677 # for result publication in the study. Otherwise, if automatic
4678 # publication is switched on, default value is used for result name.
4680 # @return New GEOM.GEOM_Object, containing the created edge.
4682 # @ref tui_creation_edge "Example"
4683 @ManageTransactions("ShapesOp")
4684 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4686 Create an edge from specified wire.
4690 theLinearTolerance linear tolerance value (default = 1e-07)
4691 theAngularTolerance angular tolerance value (default = 1e-12)
4692 theName Object name; when specified, this parameter is used
4693 for result publication in the study. Otherwise, if automatic
4694 publication is switched on, default value is used for result name.
4697 New GEOM.GEOM_Object, containing the created edge.
4699 # Example: see GEOM_TestAll.py
4700 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4701 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4702 self._autoPublish(anObj, theName, "edge")
4705 ## Create a wire from the set of edges and wires.
4706 # @param theEdgesAndWires List of edges and/or wires.
4707 # @param theTolerance Maximum distance between vertices, that will be merged.
4708 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4709 # @param theName Object name; when specified, this parameter is used
4710 # for result publication in the study. Otherwise, if automatic
4711 # publication is switched on, default value is used for result name.
4713 # @return New GEOM.GEOM_Object, containing the created wire.
4715 # @ref tui_creation_wire "Example"
4716 @ManageTransactions("ShapesOp")
4717 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4719 Create a wire from the set of edges and wires.
4722 theEdgesAndWires List of edges and/or wires.
4723 theTolerance Maximum distance between vertices, that will be merged.
4724 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4725 theName Object name; when specified, this parameter is used
4726 for result publication in the study. Otherwise, if automatic
4727 publication is switched on, default value is used for result name.
4730 New GEOM.GEOM_Object, containing the created wire.
4732 # Example: see GEOM_TestAll.py
4733 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4734 RaiseIfFailed("MakeWire", self.ShapesOp)
4735 self._autoPublish(anObj, theName, "wire")
4738 ## Create a face on the given wire.
4739 # @param theWire closed Wire or Edge to build the face on.
4740 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4741 # If the tolerance of the obtained planar face is less
4742 # than 1e-06, this face will be returned, otherwise the
4743 # algorithm tries to build any suitable face on the given
4744 # wire and prints a warning message.
4745 # @param theName Object name; when specified, this parameter is used
4746 # for result publication in the study. Otherwise, if automatic
4747 # publication is switched on, default value is used for result name.
4749 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4751 # @ref tui_creation_face "Example"
4752 @ManageTransactions("ShapesOp")
4753 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4755 Create a face on the given wire.
4758 theWire closed Wire or Edge to build the face on.
4759 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4760 If the tolerance of the obtained planar face is less
4761 than 1e-06, this face will be returned, otherwise the
4762 algorithm tries to build any suitable face on the given
4763 wire and prints a warning message.
4764 theName Object name; when specified, this parameter is used
4765 for result publication in the study. Otherwise, if automatic
4766 publication is switched on, default value is used for result name.
4769 New GEOM.GEOM_Object, containing the created face (compound of faces).
4771 # Example: see GEOM_TestAll.py
4772 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4773 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4774 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4776 RaiseIfFailed("MakeFace", self.ShapesOp)
4777 self._autoPublish(anObj, theName, "face")
4780 ## Create a face on the given wires set.
4781 # @param theWires List of closed wires or edges to build the face on.
4782 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4783 # If the tolerance of the obtained planar face is less
4784 # than 1e-06, this face will be returned, otherwise the
4785 # algorithm tries to build any suitable face on the given
4786 # wire and prints a warning message.
4787 # @param theName Object name; when specified, this parameter is used
4788 # for result publication in the study. Otherwise, if automatic
4789 # publication is switched on, default value is used for result name.
4791 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4793 # @ref tui_creation_face "Example"
4794 @ManageTransactions("ShapesOp")
4795 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4797 Create a face on the given wires set.
4800 theWires List of closed wires or edges to build the face on.
4801 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4802 If the tolerance of the obtained planar face is less
4803 than 1e-06, this face will be returned, otherwise the
4804 algorithm tries to build any suitable face on the given
4805 wire and prints a warning message.
4806 theName Object name; when specified, this parameter is used
4807 for result publication in the study. Otherwise, if automatic
4808 publication is switched on, default value is used for result name.
4811 New GEOM.GEOM_Object, containing the created face (compound of faces).
4813 # Example: see GEOM_TestAll.py
4814 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4815 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4816 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4818 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4819 self._autoPublish(anObj, theName, "face")
4822 ## See MakeFaceWires() method for details.
4824 # @ref tui_creation_face "Example 1"
4825 # \n @ref swig_MakeFaces "Example 2"
4826 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4828 See geompy.MakeFaceWires() method for details.
4830 # Example: see GEOM_TestOthers.py
4831 # note: auto-publishing is done in self.MakeFaceWires()
4832 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4835 ## Create a face based on a surface from given face bounded
4837 # @param theFace the face whose surface is used to create a new face.
4838 # @param theWire the wire that will bound a new face.
4839 # @param theName Object name; when specified, this parameter is used
4840 # for result publication in the study. Otherwise, if automatic
4841 # publication is switched on, default value is used for result name.
4843 # @return New GEOM.GEOM_Object, containing the created face.
4845 # @ref tui_creation_face "Example"
4846 @ManageTransactions("ShapesOp")
4847 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4849 Create a face based on a surface from given face bounded
4853 theFace the face whose surface is used to create a new face.
4854 theWire the wire that will bound a new face.
4855 theName Object name; when specified, this parameter is used
4856 for result publication in the study. Otherwise, if automatic
4857 publication is switched on, default value is used for result name.
4860 New GEOM.GEOM_Object, containing the created face.
4862 # Example: see GEOM_TestAll.py
4863 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4864 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4865 self._autoPublish(anObj, theName, "face")
4868 ## Create a face from a set of edges with the given constraints.
4869 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4870 # - edges should form a closed wire;
4871 # - for each edge, constraint face is optional: if a constraint face is missing
4872 # for some edge, this means that there no constraint associated with this edge.
4873 # @param theName Object name; when specified, this parameter is used
4874 # for result publication in the study. Otherwise, if automatic
4875 # publication is switched on, default value is used for result name.
4877 # @return New GEOM.GEOM_Object, containing the created face.
4879 # @ref tui_creation_face "Example"
4880 @ManageTransactions("ShapesOp")
4881 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4883 Create a face from a set of edges with the given constraints.
4886 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4887 - edges should form a closed wire;
4888 - for each edge, constraint face is optional: if a constraint face is missing
4889 for some edge, this means that there no constraint associated with this edge.
4890 theName Object name; when specified, this parameter is used
4891 for result publication in the study. Otherwise, if automatic
4892 publication is switched on, default value is used for result name.
4895 New GEOM.GEOM_Object, containing the created face.
4897 # Example: see GEOM_TestAll.py
4898 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4900 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4901 self._autoPublish(anObj, theName, "face")
4904 ## Create a shell from the set of faces, shells and/or compounds of faces.
4905 # @param theFacesAndShells List of faces, shells and/or compounds of faces.
4906 # @param theName Object name; when specified, this parameter is used
4907 # for result publication in the study. Otherwise, if automatic
4908 # publication is switched on, default value is used for result name.
4910 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4912 # @ref tui_creation_shell "Example"
4913 @ManageTransactions("ShapesOp")
4914 def MakeShell(self, theFacesAndShells, theName=None):
4916 Create a shell from the set of faces and shells.
4919 theFacesAndShells List of faces and/or shells.
4920 theName Object name; when specified, this parameter is used
4921 for result publication in the study. Otherwise, if automatic
4922 publication is switched on, default value is used for result name.
4925 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4927 # Example: see GEOM_TestAll.py
4928 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4929 RaiseIfFailed("MakeShell", self.ShapesOp)
4930 self._autoPublish(anObj, theName, "shell")
4933 ## Create a solid, bounded by the given shells.
4934 # @param theShells Sequence of bounding shells.
4935 # @param theName Object name; when specified, this parameter is used
4936 # for result publication in the study. Otherwise, if automatic
4937 # publication is switched on, default value is used for result name.
4939 # @return New GEOM.GEOM_Object, containing the created solid.
4941 # @ref tui_creation_solid "Example"
4942 @ManageTransactions("ShapesOp")
4943 def MakeSolid(self, theShells, theName=None):
4945 Create a solid, bounded by the given shells.
4948 theShells Sequence of bounding shells.
4949 theName Object name; when specified, this parameter is used
4950 for result publication in the study. Otherwise, if automatic
4951 publication is switched on, default value is used for result name.
4954 New GEOM.GEOM_Object, containing the created solid.
4956 # Example: see GEOM_TestAll.py
4957 theShells = ToList(theShells)
4958 if len(theShells) == 1:
4959 descr = self._IsGoodForSolid(theShells[0])
4961 # raise RuntimeError, "MakeSolidShells : " + descr
4962 if descr == "WRN_SHAPE_UNCLOSED":
4963 raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4964 anObj = self.ShapesOp.MakeSolidShells(theShells)
4965 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4966 self._autoPublish(anObj, theName, "solid")
4969 ## Create a compound of the given shapes.
4970 # @param theShapes List of shapes to put in compound.
4971 # @param theName Object name; when specified, this parameter is used
4972 # for result publication in the study. Otherwise, if automatic
4973 # publication is switched on, default value is used for result name.
4975 # @return New GEOM.GEOM_Object, containing the created compound.
4977 # @ref tui_creation_compound "Example"
4978 @ManageTransactions("ShapesOp")
4979 def MakeCompound(self, theShapes, theName=None):
4981 Create a compound of the given shapes.
4984 theShapes List of shapes to put in compound.
4985 theName Object name; when specified, this parameter is used
4986 for result publication in the study. Otherwise, if automatic
4987 publication is switched on, default value is used for result name.
4990 New GEOM.GEOM_Object, containing the created compound.
4992 # Example: see GEOM_TestAll.py
4993 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4994 RaiseIfFailed("MakeCompound", self.ShapesOp)
4995 self._autoPublish(anObj, theName, "compound")
4998 ## Create a solid (or solids) from the set of faces and/or shells.
4999 # @param theFacesOrShells List of faces and/or shells.
5000 # @param isIntersect If TRUE, forces performing intersections
5001 # between arguments; otherwise (default) intersection is not performed.
5002 # @param theName Object name; when specified, this parameter is used
5003 # for result publication in the study. Otherwise, if automatic
5004 # publication is switched on, default value is used for result name.
5006 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5008 # @ref tui_creation_solid_from_faces "Example"
5009 @ManageTransactions("ShapesOp")
5010 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5012 Create a solid (or solids) from the set of connected faces and/or shells.
5015 theFacesOrShells List of faces and/or shells.
5016 isIntersect If TRUE, forces performing intersections
5017 between arguments; otherwise (default) intersection is not performed
5018 theName Object name; when specified, this parameter is used.
5019 for result publication in the study. Otherwise, if automatic
5020 publication is switched on, default value is used for result name.
5023 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5025 # Example: see GEOM_TestAll.py
5026 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5027 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5028 self._autoPublish(anObj, theName, "solid")
5031 # end of l3_basic_go
5034 ## @addtogroup l2_measure
5037 ## Gives quantity of faces in the given shape.
5038 # @param theShape Shape to count faces of.
5039 # @return Quantity of faces.
5041 # @ref swig_NumberOf "Example"
5042 @ManageTransactions("ShapesOp")
5043 def NumberOfFaces(self, theShape):
5045 Gives quantity of faces in the given shape.
5048 theShape Shape to count faces of.
5053 # Example: see GEOM_TestOthers.py
5054 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5055 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5058 ## Gives quantity of edges in the given shape.
5059 # @param theShape Shape to count edges of.
5060 # @return Quantity of edges.
5062 # @ref swig_NumberOf "Example"
5063 @ManageTransactions("ShapesOp")
5064 def NumberOfEdges(self, theShape):
5066 Gives quantity of edges in the given shape.
5069 theShape Shape to count edges of.
5074 # Example: see GEOM_TestOthers.py
5075 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5076 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5079 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5080 # @param theShape Shape to count sub-shapes of.
5081 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5082 # @return Quantity of sub-shapes of given type.
5084 # @ref swig_NumberOf "Example"
5085 @ManageTransactions("ShapesOp")
5086 def NumberOfSubShapes(self, theShape, theShapeType):
5088 Gives quantity of sub-shapes of type theShapeType in the given shape.
5091 theShape Shape to count sub-shapes of.
5092 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5095 Quantity of sub-shapes of given type.
5097 # Example: see GEOM_TestOthers.py
5098 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5099 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5102 ## Gives quantity of solids in the given shape.
5103 # @param theShape Shape to count solids in.
5104 # @return Quantity of solids.
5106 # @ref swig_NumberOf "Example"
5107 @ManageTransactions("ShapesOp")
5108 def NumberOfSolids(self, theShape):
5110 Gives quantity of solids in the given shape.
5113 theShape Shape to count solids in.
5118 # Example: see GEOM_TestOthers.py
5119 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5120 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5126 ## @addtogroup l3_healing
5129 ## Reverses an orientation the given shape.
5130 # @param theShape Shape to be reversed.
5131 # @param theName Object name; when specified, this parameter is used
5132 # for result publication in the study. Otherwise, if automatic
5133 # publication is switched on, default value is used for result name.
5135 # @return The reversed copy of theShape.
5137 # @ref swig_ChangeOrientation "Example"
5138 @ManageTransactions("ShapesOp")
5139 def ChangeOrientation(self, theShape, theName=None):
5141 Reverses an orientation the given shape.
5144 theShape Shape to be reversed.
5145 theName Object name; when specified, this parameter is used
5146 for result publication in the study. Otherwise, if automatic
5147 publication is switched on, default value is used for result name.
5150 The reversed copy of theShape.
5152 # Example: see GEOM_TestAll.py
5153 anObj = self.ShapesOp.ChangeOrientation(theShape)
5154 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5155 self._autoPublish(anObj, theName, "reversed")
5158 ## See ChangeOrientation() method for details.
5160 # @ref swig_OrientationChange "Example"
5161 def OrientationChange(self, theShape, theName=None):
5163 See geompy.ChangeOrientation method for details.
5165 # Example: see GEOM_TestOthers.py
5166 # note: auto-publishing is done in self.ChangeOrientation()
5167 anObj = self.ChangeOrientation(theShape, theName)
5173 ## @addtogroup l4_obtain
5176 ## Retrieve all free faces from the given shape.
5177 # Free face is a face, which is not shared between two shells of the shape.
5178 # @param theShape Shape to find free faces in.
5179 # @return List of IDs of all free faces, contained in theShape.
5181 # @ref tui_free_faces_page "Example"
5182 @ManageTransactions("ShapesOp")
5183 def GetFreeFacesIDs(self,theShape):
5185 Retrieve all free faces from the given shape.
5186 Free face is a face, which is not shared between two shells of the shape.
5189 theShape Shape to find free faces in.
5192 List of IDs of all free faces, contained in theShape.
5194 # Example: see GEOM_TestOthers.py
5195 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5196 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5199 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5200 # @param theShape1 Shape to find sub-shapes in.
5201 # @param theShape2 Shape to find shared sub-shapes with.
5202 # @param theShapeType Type of sub-shapes to be retrieved.
5203 # @param theName Object name; when specified, this parameter is used
5204 # for result publication in the study. Otherwise, if automatic
5205 # publication is switched on, default value is used for result name.
5207 # @return List of sub-shapes of theShape1, shared with theShape2.
5209 # @ref swig_GetSharedShapes "Example"
5210 @ManageTransactions("ShapesOp")
5211 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5213 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5216 theShape1 Shape to find sub-shapes in.
5217 theShape2 Shape to find shared sub-shapes with.
5218 theShapeType Type of sub-shapes to be retrieved.
5219 theName Object name; when specified, this parameter is used
5220 for result publication in the study. Otherwise, if automatic
5221 publication is switched on, default value is used for result name.
5224 List of sub-shapes of theShape1, shared with theShape2.
5226 # Example: see GEOM_TestOthers.py
5227 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5228 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5229 self._autoPublish(aList, theName, "shared")
5232 ## Get sub-shapes, shared by input shapes.
5233 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5234 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5235 # @param theMultiShare Specifies what type of shares should be checked:
5236 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5237 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5238 # @param theName Object name; when specified, this parameter is used
5239 # for result publication in the study. Otherwise, if automatic
5240 # publication is switched on, default value is used for result name.
5242 # @note If @a theShapes contains single compound, the shares between all possible couples of
5243 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5244 # and all rest input shapes are returned.
5246 # @return List of all found sub-shapes.
5249 # - @ref tui_shared_shapes "Example 1"
5250 # - @ref swig_GetSharedShapes "Example 2"
5251 @ManageTransactions("ShapesOp")
5252 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5254 Get sub-shapes, shared by input shapes.
5257 theShapes Either a list or compound of shapes to find common sub-shapes of.
5258 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5259 theMultiShare Specifies what type of shares should be checked:
5260 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5261 - False: causes to search sub-shapes shared between couples of input shapes.
5262 theName Object name; when specified, this parameter is used
5263 for result publication in the study. Otherwise, if automatic
5264 publication is switched on, default value is used for result name.
5266 Note: if theShapes contains single compound, the shares between all possible couples of
5267 its top-level shapes are returned; otherwise, only shares between 1st input shape
5268 and all rest input shapes are returned.
5271 List of all found sub-shapes.
5273 # Example: see GEOM_TestOthers.py
5274 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5275 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5276 self._autoPublish(aList, theName, "shared")
5279 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5280 # situated relatively the specified plane by the certain way,
5281 # defined through <VAR>theState</VAR> parameter.
5282 # @param theShape Shape to find sub-shapes of.
5283 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5284 # @param theAx1 Vector (or line, or linear edge), specifying normal
5285 # direction and location of the plane to find shapes on.
5286 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5287 # @param theName Object name; when specified, this parameter is used
5288 # for result publication in the study. Otherwise, if automatic
5289 # publication is switched on, default value is used for result name.
5291 # @return List of all found sub-shapes.
5293 # @ref swig_GetShapesOnPlane "Example"
5294 @ManageTransactions("ShapesOp")
5295 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5297 Find in theShape all sub-shapes of type theShapeType,
5298 situated relatively the specified plane by the certain way,
5299 defined through theState parameter.
5302 theShape Shape to find sub-shapes of.
5303 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5304 theAx1 Vector (or line, or linear edge), specifying normal
5305 direction and location of the plane to find shapes on.
5306 theState The state of the sub-shapes to find (see GEOM::shape_state)
5307 theName Object name; when specified, this parameter is used
5308 for result publication in the study. Otherwise, if automatic
5309 publication is switched on, default value is used for result name.
5312 List of all found sub-shapes.
5314 # Example: see GEOM_TestOthers.py
5315 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5316 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5317 self._autoPublish(aList, theName, "shapeOnPlane")
5320 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5321 # situated relatively the specified plane by the certain way,
5322 # defined through <VAR>theState</VAR> parameter.
5323 # @param theShape Shape to find sub-shapes of.
5324 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5325 # @param theAx1 Vector (or line, or linear edge), specifying normal
5326 # direction and location of the plane to find shapes on.
5327 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5329 # @return List of all found sub-shapes indices.
5331 # @ref swig_GetShapesOnPlaneIDs "Example"
5332 @ManageTransactions("ShapesOp")
5333 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5335 Find in theShape all sub-shapes of type theShapeType,
5336 situated relatively the specified plane by the certain way,
5337 defined through theState parameter.
5340 theShape Shape to find sub-shapes of.
5341 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5342 theAx1 Vector (or line, or linear edge), specifying normal
5343 direction and location of the plane to find shapes on.
5344 theState The state of the sub-shapes to find (see GEOM::shape_state)
5347 List of all found sub-shapes indices.
5349 # Example: see GEOM_TestOthers.py
5350 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5351 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5354 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5355 # situated relatively the specified plane by the certain way,
5356 # defined through <VAR>theState</VAR> parameter.
5357 # @param theShape Shape to find sub-shapes of.
5358 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5359 # @param theAx1 Vector (or line, or linear edge), specifying normal
5360 # direction of the plane to find shapes on.
5361 # @param thePnt Point specifying location of the plane to find shapes on.
5362 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5363 # @param theName Object name; when specified, this parameter is used
5364 # for result publication in the study. Otherwise, if automatic
5365 # publication is switched on, default value is used for result name.
5367 # @return List of all found sub-shapes.
5369 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5370 @ManageTransactions("ShapesOp")
5371 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5373 Find in theShape all sub-shapes of type theShapeType,
5374 situated relatively the specified plane by the certain way,
5375 defined through theState parameter.
5378 theShape Shape to find sub-shapes of.
5379 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5380 theAx1 Vector (or line, or linear edge), specifying normal
5381 direction and location of the plane to find shapes on.
5382 thePnt Point specifying location of the plane to find shapes on.
5383 theState The state of the sub-shapes to find (see GEOM::shape_state)
5384 theName Object name; when specified, this parameter is used
5385 for result publication in the study. Otherwise, if automatic
5386 publication is switched on, default value is used for result name.
5389 List of all found sub-shapes.
5391 # Example: see GEOM_TestOthers.py
5392 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5393 theAx1, thePnt, theState)
5394 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5395 self._autoPublish(aList, theName, "shapeOnPlane")
5398 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5399 # situated relatively the specified plane by the certain way,
5400 # defined through <VAR>theState</VAR> parameter.
5401 # @param theShape Shape to find sub-shapes of.
5402 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5403 # @param theAx1 Vector (or line, or linear edge), specifying normal
5404 # direction of the plane to find shapes on.
5405 # @param thePnt Point specifying location of the plane to find shapes on.
5406 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5408 # @return List of all found sub-shapes indices.
5410 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5411 @ManageTransactions("ShapesOp")
5412 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5414 Find in theShape all sub-shapes of type theShapeType,
5415 situated relatively the specified plane by the certain way,
5416 defined through theState parameter.
5419 theShape Shape to find sub-shapes of.
5420 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5421 theAx1 Vector (or line, or linear edge), specifying normal
5422 direction and location of the plane to find shapes on.
5423 thePnt Point specifying location of the plane to find shapes on.
5424 theState The state of the sub-shapes to find (see GEOM::shape_state)
5427 List of all found sub-shapes indices.
5429 # Example: see GEOM_TestOthers.py
5430 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5431 theAx1, thePnt, theState)
5432 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5435 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5436 # the specified cylinder by the certain way, defined through \a theState parameter.
5437 # @param theShape Shape to find sub-shapes of.
5438 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5439 # @param theAxis Vector (or line, or linear edge), specifying
5440 # axis of the cylinder to find shapes on.
5441 # @param theRadius Radius of the cylinder to find shapes on.
5442 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5443 # @param theName Object name; when specified, this parameter is used
5444 # for result publication in the study. Otherwise, if automatic
5445 # publication is switched on, default value is used for result name.
5447 # @return List of all found sub-shapes.
5449 # @ref swig_GetShapesOnCylinder "Example"
5450 @ManageTransactions("ShapesOp")
5451 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5453 Find in theShape all sub-shapes of type theShapeType, situated relatively
5454 the specified cylinder by the certain way, defined through theState parameter.
5457 theShape Shape to find sub-shapes of.
5458 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5459 theAxis Vector (or line, or linear edge), specifying
5460 axis of the cylinder to find shapes on.
5461 theRadius Radius of the cylinder to find shapes on.
5462 theState The state of the sub-shapes to find (see GEOM::shape_state)
5463 theName Object name; when specified, this parameter is used
5464 for result publication in the study. Otherwise, if automatic
5465 publication is switched on, default value is used for result name.
5468 List of all found sub-shapes.
5470 # Example: see GEOM_TestOthers.py
5471 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5472 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5473 self._autoPublish(aList, theName, "shapeOnCylinder")
5476 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5477 # the specified cylinder by the certain way, defined through \a theState parameter.
5478 # @param theShape Shape to find sub-shapes of.
5479 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5480 # @param theAxis Vector (or line, or linear edge), specifying
5481 # axis of the cylinder to find shapes on.
5482 # @param theRadius Radius of the cylinder to find shapes on.
5483 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5485 # @return List of all found sub-shapes indices.
5487 # @ref swig_GetShapesOnCylinderIDs "Example"
5488 @ManageTransactions("ShapesOp")
5489 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5491 Find in theShape all sub-shapes of type theShapeType, situated relatively
5492 the specified cylinder by the certain way, defined through theState parameter.
5495 theShape Shape to find sub-shapes of.
5496 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5497 theAxis Vector (or line, or linear edge), specifying
5498 axis of the cylinder to find shapes on.
5499 theRadius Radius of the cylinder to find shapes on.
5500 theState The state of the sub-shapes to find (see GEOM::shape_state)
5503 List of all found sub-shapes indices.
5505 # Example: see GEOM_TestOthers.py
5506 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5507 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5510 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5511 # the specified cylinder by the certain way, defined through \a theState parameter.
5512 # @param theShape Shape to find sub-shapes of.
5513 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5514 # @param theAxis Vector (or line, or linear edge), specifying
5515 # axis of the cylinder to find shapes on.
5516 # @param thePnt Point specifying location of the bottom of the cylinder.
5517 # @param theRadius Radius of the cylinder to find shapes on.
5518 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5519 # @param theName Object name; when specified, this parameter is used
5520 # for result publication in the study. Otherwise, if automatic
5521 # publication is switched on, default value is used for result name.
5523 # @return List of all found sub-shapes.
5525 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5526 @ManageTransactions("ShapesOp")
5527 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5529 Find in theShape all sub-shapes of type theShapeType, situated relatively
5530 the specified cylinder by the certain way, defined through theState parameter.
5533 theShape Shape to find sub-shapes of.
5534 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5535 theAxis Vector (or line, or linear edge), specifying
5536 axis of the cylinder to find shapes on.
5537 theRadius Radius of the cylinder to find shapes on.
5538 theState The state of the sub-shapes to find (see GEOM::shape_state)
5539 theName Object name; when specified, this parameter is used
5540 for result publication in the study. Otherwise, if automatic
5541 publication is switched on, default value is used for result name.
5544 List of all found sub-shapes.
5546 # Example: see GEOM_TestOthers.py
5547 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5548 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5549 self._autoPublish(aList, theName, "shapeOnCylinder")
5552 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5553 # the specified cylinder by the certain way, defined through \a theState parameter.
5554 # @param theShape Shape to find sub-shapes of.
5555 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5556 # @param theAxis Vector (or line, or linear edge), specifying
5557 # axis of the cylinder to find shapes on.
5558 # @param thePnt Point specifying location of the bottom of the cylinder.
5559 # @param theRadius Radius of the cylinder to find shapes on.
5560 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5562 # @return List of all found sub-shapes indices
5564 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5565 @ManageTransactions("ShapesOp")
5566 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5568 Find in theShape all sub-shapes of type theShapeType, situated relatively
5569 the specified cylinder by the certain way, defined through theState parameter.
5572 theShape Shape to find sub-shapes of.
5573 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5574 theAxis Vector (or line, or linear edge), specifying
5575 axis of the cylinder to find shapes on.
5576 theRadius Radius of the cylinder to find shapes on.
5577 theState The state of the sub-shapes to find (see GEOM::shape_state)
5580 List of all found sub-shapes indices.
5582 # Example: see GEOM_TestOthers.py
5583 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5584 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5587 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5588 # the specified sphere by the certain way, defined through \a theState parameter.
5589 # @param theShape Shape to find sub-shapes of.
5590 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5591 # @param theCenter Point, specifying center of the sphere to find shapes on.
5592 # @param theRadius Radius of the sphere to find shapes on.
5593 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5594 # @param theName Object name; when specified, this parameter is used
5595 # for result publication in the study. Otherwise, if automatic
5596 # publication is switched on, default value is used for result name.
5598 # @return List of all found sub-shapes.
5600 # @ref swig_GetShapesOnSphere "Example"
5601 @ManageTransactions("ShapesOp")
5602 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5604 Find in theShape all sub-shapes of type theShapeType, situated relatively
5605 the specified sphere by the certain way, defined through theState parameter.
5608 theShape Shape to find sub-shapes of.
5609 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5610 theCenter Point, specifying center of the sphere to find shapes on.
5611 theRadius Radius of the sphere to find shapes on.
5612 theState The state of the sub-shapes to find (see GEOM::shape_state)
5613 theName Object name; when specified, this parameter is used
5614 for result publication in the study. Otherwise, if automatic
5615 publication is switched on, default value is used for result name.
5618 List of all found sub-shapes.
5620 # Example: see GEOM_TestOthers.py
5621 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5622 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5623 self._autoPublish(aList, theName, "shapeOnSphere")
5626 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5627 # the specified sphere by the certain way, defined through \a theState parameter.
5628 # @param theShape Shape to find sub-shapes of.
5629 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5630 # @param theCenter Point, specifying center of the sphere to find shapes on.
5631 # @param theRadius Radius of the sphere to find shapes on.
5632 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5634 # @return List of all found sub-shapes indices.
5636 # @ref swig_GetShapesOnSphereIDs "Example"
5637 @ManageTransactions("ShapesOp")
5638 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5640 Find in theShape all sub-shapes of type theShapeType, situated relatively
5641 the specified sphere by the certain way, defined through theState parameter.
5644 theShape Shape to find sub-shapes of.
5645 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5646 theCenter Point, specifying center of the sphere to find shapes on.
5647 theRadius Radius of the sphere to find shapes on.
5648 theState The state of the sub-shapes to find (see GEOM::shape_state)
5651 List of all found sub-shapes indices.
5653 # Example: see GEOM_TestOthers.py
5654 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5655 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5658 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5659 # the specified quadrangle by the certain way, defined through \a theState parameter.
5660 # @param theShape Shape to find sub-shapes of.
5661 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5662 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5663 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5664 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5665 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5666 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5667 # @param theName Object name; when specified, this parameter is used
5668 # for result publication in the study. Otherwise, if automatic
5669 # publication is switched on, default value is used for result name.
5671 # @return List of all found sub-shapes.
5673 # @ref swig_GetShapesOnQuadrangle "Example"
5674 @ManageTransactions("ShapesOp")
5675 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5676 theTopLeftPoint, theTopRightPoint,
5677 theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5679 Find in theShape all sub-shapes of type theShapeType, situated relatively
5680 the specified quadrangle by the certain way, defined through theState parameter.
5683 theShape Shape to find sub-shapes of.
5684 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5685 theTopLeftPoint Point, specifying top left corner of a quadrangle
5686 theTopRightPoint Point, specifying top right corner of a quadrangle
5687 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5688 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5689 theState The state of the sub-shapes to find (see GEOM::shape_state)
5690 theName Object name; when specified, this parameter is used
5691 for result publication in the study. Otherwise, if automatic
5692 publication is switched on, default value is used for result name.
5695 List of all found sub-shapes.
5697 # Example: see GEOM_TestOthers.py
5698 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5699 theTopLeftPoint, theTopRightPoint,
5700 theBottomLeftPoint, theBottomRightPoint, theState)
5701 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5702 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5705 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5706 # the specified quadrangle by the certain way, defined through \a theState parameter.
5707 # @param theShape Shape to find sub-shapes of.
5708 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5709 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5710 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5711 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5712 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5713 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5715 # @return List of all found sub-shapes indices.
5717 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5718 @ManageTransactions("ShapesOp")
5719 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5720 theTopLeftPoint, theTopRightPoint,
5721 theBottomLeftPoint, theBottomRightPoint, theState):
5723 Find in theShape all sub-shapes of type theShapeType, situated relatively
5724 the specified quadrangle by the certain way, defined through theState parameter.
5727 theShape Shape to find sub-shapes of.
5728 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5729 theTopLeftPoint Point, specifying top left corner of a quadrangle
5730 theTopRightPoint Point, specifying top right corner of a quadrangle
5731 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5732 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5733 theState The state of the sub-shapes to find (see GEOM::shape_state)
5736 List of all found sub-shapes indices.
5739 # Example: see GEOM_TestOthers.py
5740 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5741 theTopLeftPoint, theTopRightPoint,
5742 theBottomLeftPoint, theBottomRightPoint, theState)
5743 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5746 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5747 # the specified \a theBox by the certain way, defined through \a theState parameter.
5748 # @param theBox Shape for relative comparing.
5749 # @param theShape Shape to find sub-shapes of.
5750 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5751 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5752 # @param theName Object name; when specified, this parameter is used
5753 # for result publication in the study. Otherwise, if automatic
5754 # publication is switched on, default value is used for result name.
5756 # @return List of all found sub-shapes.
5758 # @ref swig_GetShapesOnBox "Example"
5759 @ManageTransactions("ShapesOp")
5760 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5762 Find in theShape all sub-shapes of type theShapeType, situated relatively
5763 the specified theBox by the certain way, defined through theState parameter.
5766 theBox Shape for relative comparing.
5767 theShape Shape to find sub-shapes of.
5768 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5769 theState The state of the sub-shapes to find (see GEOM::shape_state)
5770 theName Object name; when specified, this parameter is used
5771 for result publication in the study. Otherwise, if automatic
5772 publication is switched on, default value is used for result name.
5775 List of all found sub-shapes.
5777 # Example: see GEOM_TestOthers.py
5778 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5779 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5780 self._autoPublish(aList, theName, "shapeOnBox")
5783 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5784 # the specified \a theBox by the certain way, defined through \a theState parameter.
5785 # @param theBox Shape for relative comparing.
5786 # @param theShape Shape to find sub-shapes of.
5787 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5788 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5790 # @return List of all found sub-shapes indices.
5792 # @ref swig_GetShapesOnBoxIDs "Example"
5793 @ManageTransactions("ShapesOp")
5794 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5796 Find in theShape all sub-shapes of type theShapeType, situated relatively
5797 the specified theBox by the certain way, defined through theState parameter.
5800 theBox Shape for relative comparing.
5801 theShape Shape to find sub-shapes of.
5802 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5803 theState The state of the sub-shapes to find (see GEOM::shape_state)
5806 List of all found sub-shapes indices.
5808 # Example: see GEOM_TestOthers.py
5809 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5810 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5813 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5814 # situated relatively the specified \a theCheckShape by the
5815 # certain way, defined through \a theState parameter.
5816 # @param theCheckShape Shape for relative comparing. It must be a solid.
5817 # @param theShape Shape to find sub-shapes of.
5818 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5819 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5820 # @param theName Object name; when specified, this parameter is used
5821 # for result publication in the study. Otherwise, if automatic
5822 # publication is switched on, default value is used for result name.
5824 # @return List of all found sub-shapes.
5826 # @ref swig_GetShapesOnShape "Example"
5827 @ManageTransactions("ShapesOp")
5828 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5830 Find in theShape all sub-shapes of type theShapeType,
5831 situated relatively the specified theCheckShape by the
5832 certain way, defined through theState parameter.
5835 theCheckShape Shape for relative comparing. It must be a solid.
5836 theShape Shape to find sub-shapes of.
5837 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5838 theState The state of the sub-shapes to find (see GEOM::shape_state)
5839 theName Object name; when specified, this parameter is used
5840 for result publication in the study. Otherwise, if automatic
5841 publication is switched on, default value is used for result name.
5844 List of all found sub-shapes.
5846 # Example: see GEOM_TestOthers.py
5847 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5848 theShapeType, theState)
5849 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5850 self._autoPublish(aList, theName, "shapeOnShape")
5853 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5854 # situated relatively the specified \a theCheckShape by the
5855 # certain way, defined through \a theState parameter.
5856 # @param theCheckShape Shape for relative comparing. It must be a solid.
5857 # @param theShape Shape to find sub-shapes of.
5858 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5859 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5860 # @param theName Object name; when specified, this parameter is used
5861 # for result publication in the study. Otherwise, if automatic
5862 # publication is switched on, default value is used for result name.
5864 # @return All found sub-shapes as compound.
5866 # @ref swig_GetShapesOnShapeAsCompound "Example"
5867 @ManageTransactions("ShapesOp")
5868 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5870 Find in theShape all sub-shapes of type theShapeType,
5871 situated relatively the specified theCheckShape by the
5872 certain way, defined through theState parameter.
5875 theCheckShape Shape for relative comparing. It must be a solid.
5876 theShape Shape to find sub-shapes of.
5877 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5878 theState The state of the sub-shapes to find (see GEOM::shape_state)
5879 theName Object name; when specified, this parameter is used
5880 for result publication in the study. Otherwise, if automatic
5881 publication is switched on, default value is used for result name.
5884 All found sub-shapes as compound.
5886 # Example: see GEOM_TestOthers.py
5887 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5888 theShapeType, theState)
5889 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5890 self._autoPublish(anObj, theName, "shapeOnShape")
5893 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5894 # situated relatively the specified \a theCheckShape by the
5895 # certain way, defined through \a theState parameter.
5896 # @param theCheckShape Shape for relative comparing. It must be a solid.
5897 # @param theShape Shape to find sub-shapes of.
5898 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5899 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5901 # @return List of all found sub-shapes indices.
5903 # @ref swig_GetShapesOnShapeIDs "Example"
5904 @ManageTransactions("ShapesOp")
5905 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5907 Find in theShape all sub-shapes of type theShapeType,
5908 situated relatively the specified theCheckShape by the
5909 certain way, defined through theState parameter.
5912 theCheckShape Shape for relative comparing. It must be a solid.
5913 theShape Shape to find sub-shapes of.
5914 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5915 theState The state of the sub-shapes to find (see GEOM::shape_state)
5918 List of all found sub-shapes indices.
5920 # Example: see GEOM_TestOthers.py
5921 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5922 theShapeType, theState)
5923 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5926 ## Get sub-shape(s) of theShapeWhere, which are
5927 # coincident with \a theShapeWhat or could be a part of it.
5928 # @param theShapeWhere Shape to find sub-shapes of.
5929 # @param theShapeWhat Shape, specifying what to find.
5930 # @param isNewImplementation implementation of GetInPlace functionality
5931 # (default = False, old alghorithm based on shape properties)
5932 # @param theName Object name; when specified, this parameter is used
5933 # for result publication in the study. Otherwise, if automatic
5934 # publication is switched on, default value is used for result name.
5936 # @return Compound which includes all found sub-shapes if they have different types;
5937 # or group of all found shapes of the equal type; or a single found sub-shape.
5939 # @note This function has a restriction on argument shapes.
5940 # If \a theShapeWhere has curved parts with significantly
5941 # outstanding centres (i.e. the mass centre of a part is closer to
5942 # \a theShapeWhat than to the part), such parts will not be found.
5943 # @image html get_in_place_lost_part.png
5945 # @ref swig_GetInPlace "Example"
5946 @ManageTransactions("ShapesOp")
5947 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5949 Get sub-shape(s) of theShapeWhere, which are
5950 coincident with theShapeWhat or could be a part of it.
5953 theShapeWhere Shape to find sub-shapes of.
5954 theShapeWhat Shape, specifying what to find.
5955 isNewImplementation Implementation of GetInPlace functionality
5956 (default = False, old alghorithm based on shape properties)
5957 theName Object name; when specified, this parameter is used
5958 for result publication in the study. Otherwise, if automatic
5959 publication is switched on, default value is used for result name.
5962 Compound which includes all found sub-shapes if they have different types;
5963 or group of all found shapes of the equal type; or a single found sub-shape.
5967 This function has a restriction on argument shapes.
5968 If theShapeWhere has curved parts with significantly
5969 outstanding centres (i.e. the mass centre of a part is closer to
5970 theShapeWhat than to the part), such parts will not be found.
5972 # Example: see GEOM_TestOthers.py
5974 if isNewImplementation:
5975 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5977 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5979 RaiseIfFailed("GetInPlace", self.ShapesOp)
5980 self._autoPublish(anObj, theName, "inplace")
5983 ## Get sub-shape(s) of \a theShapeWhere, which are
5984 # coincident with \a theShapeWhat or could be a part of it.
5986 # Implementation of this method is based on a saved history of an operation,
5987 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5988 # arguments (an argument shape or a sub-shape of an argument shape).
5989 # The operation could be the Partition or one of boolean operations,
5990 # performed on simple shapes (not on compounds).
5992 # @param theShapeWhere Shape to find sub-shapes of.
5993 # @param theShapeWhat Shape, specifying what to find (must be in the
5994 # building history of the ShapeWhere).
5995 # @param theName Object name; when specified, this parameter is used
5996 # for result publication in the study. Otherwise, if automatic
5997 # publication is switched on, default value is used for result name.
5999 # @return Compound which includes all found sub-shapes if they have different types;
6000 # or group of all found shapes of the equal type; or a single found sub-shape.
6002 # @ref swig_GetInPlace "Example"
6003 @ManageTransactions("ShapesOp")
6004 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6006 Implementation of this method is based on a saved history of an operation,
6007 produced theShapeWhere. The theShapeWhat must be among this operation's
6008 arguments (an argument shape or a sub-shape of an argument shape).
6009 The operation could be the Partition or one of boolean operations,
6010 performed on simple shapes (not on compounds).
6013 theShapeWhere Shape to find sub-shapes of.
6014 theShapeWhat Shape, specifying what to find (must be in the
6015 building history of the ShapeWhere).
6016 theName Object name; when specified, this parameter is used
6017 for result publication in the study. Otherwise, if automatic
6018 publication is switched on, default value is used for result name.
6021 Compound which includes all found sub-shapes if they have different types;
6022 or group of all found shapes of the equal type; or a single found sub-shape.
6024 # Example: see GEOM_TestOthers.py
6025 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6026 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6027 self._autoPublish(anObj, theName, "inplace")
6030 ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6031 # For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6032 # IDs of @a theShapeWhere.
6033 # For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6034 # two parts by a plane, then the result can be as this:
6035 # len( result_list ) = 35,
6036 # result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6037 # solids with IDs 2 and 36 within theShapeWhere
6039 # @param theShapeWhere Shape to find sub-shapes of.
6040 # @param theShapeWhat Shape, specifying what to find.
6041 # @return List of lists of sub-shape IDS of theShapeWhere.
6042 def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6044 A sort of GetInPlace functionality, returning IDs of sub-shapes.
6045 For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6046 IDs of @a theShapeWhere.
6047 For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6048 two parts by a plane, then the result can be as this:
6049 len( result_list ) = 35,
6050 result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6051 solids with IDs 2 and 36 within theShapeWhere
6054 theShapeWhere Shape to find sub-shapes of.
6055 theShapeWhat Shape, specifying what to find.
6058 List of lists of sub-shape IDS of theShapeWhere.
6060 return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6062 ## Get sub-shape of theShapeWhere, which is
6063 # equal to \a theShapeWhat.
6064 # @param theShapeWhere Shape to find sub-shape of.
6065 # @param theShapeWhat Shape, specifying what to find.
6066 # @param theName Object name; when specified, this parameter is used
6067 # for result publication in the study. Otherwise, if automatic
6068 # publication is switched on, default value is used for result name.
6070 # @return New GEOM.GEOM_Object for found sub-shape.
6072 # @ref swig_GetSame "Example"
6073 @ManageTransactions("ShapesOp")
6074 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6076 Get sub-shape of theShapeWhere, which is
6077 equal to theShapeWhat.
6080 theShapeWhere Shape to find sub-shape of.
6081 theShapeWhat Shape, specifying what to find.
6082 theName Object name; when specified, this parameter is used
6083 for result publication in the study. Otherwise, if automatic
6084 publication is switched on, default value is used for result name.
6087 New GEOM.GEOM_Object for found sub-shape.
6089 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6090 RaiseIfFailed("GetSame", self.ShapesOp)
6091 self._autoPublish(anObj, theName, "sameShape")
6095 ## Get sub-shape indices of theShapeWhere, which is
6096 # equal to \a theShapeWhat.
6097 # @param theShapeWhere Shape to find sub-shape of.
6098 # @param theShapeWhat Shape, specifying what to find.
6099 # @return List of all found sub-shapes indices.
6101 # @ref swig_GetSame "Example"
6102 @ManageTransactions("ShapesOp")
6103 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6105 Get sub-shape indices of theShapeWhere, which is
6106 equal to theShapeWhat.
6109 theShapeWhere Shape to find sub-shape of.
6110 theShapeWhat Shape, specifying what to find.
6113 List of all found sub-shapes indices.
6115 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6116 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6119 ## Resize the input edge with the new Min and Max parameters.
6120 # The input edge parameters range is [0, 1]. If theMin parameter is
6121 # negative, the input edge is extended, otherwise it is shrinked by
6122 # theMin parameter. If theMax is greater than 1, the edge is extended,
6123 # otherwise it is shrinked by theMax parameter.
6124 # @param theEdge the input edge to be resized.
6125 # @param theMin the minimal parameter value.
6126 # @param theMax the maximal parameter value.
6127 # @param theName Object name; when specified, this parameter is used
6128 # for result publication in the study. Otherwise, if automatic
6129 # publication is switched on, default value is used for result name.
6130 # @return New GEOM.GEOM_Object, containing the created edge.
6132 # @ref tui_extend "Example"
6133 @ManageTransactions("ShapesOp")
6134 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6136 Resize the input edge with the new Min and Max parameters.
6137 The input edge parameters range is [0, 1]. If theMin parameter is
6138 negative, the input edge is extended, otherwise it is shrinked by
6139 theMin parameter. If theMax is greater than 1, the edge is extended,
6140 otherwise it is shrinked by theMax parameter.
6143 theEdge the input edge to be resized.
6144 theMin the minimal parameter value.
6145 theMax the maximal parameter value.
6146 theName Object name; when specified, this parameter is used
6147 for result publication in the study. Otherwise, if automatic
6148 publication is switched on, default value is used for result name.
6151 New GEOM.GEOM_Object, containing the created edge.
6153 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6154 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6155 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6156 anObj.SetParameters(Parameters)
6157 self._autoPublish(anObj, theName, "edge")
6160 ## Resize the input face with the new UMin, UMax, VMin and VMax
6161 # parameters. The input face U and V parameters range is [0, 1]. If
6162 # theUMin parameter is negative, the input face is extended, otherwise
6163 # it is shrinked along U direction by theUMin parameter. If theUMax is
6164 # greater than 1, the face is extended, otherwise it is shrinked along
6165 # U direction by theUMax parameter. So as for theVMin, theVMax and
6166 # V direction of the input face.
6167 # @param theFace the input face to be resized.
6168 # @param theUMin the minimal U parameter value.
6169 # @param theUMax the maximal U parameter value.
6170 # @param theVMin the minimal V parameter value.
6171 # @param theVMax the maximal V parameter value.
6172 # @param theName Object name; when specified, this parameter is used
6173 # for result publication in the study. Otherwise, if automatic
6174 # publication is switched on, default value is used for result name.
6175 # @return New GEOM.GEOM_Object, containing the created face.
6177 # @ref tui_extend "Example"
6178 @ManageTransactions("ShapesOp")
6179 def ExtendFace(self, theFace, theUMin, theUMax,
6180 theVMin, theVMax, theName=None):
6182 Resize the input face with the new UMin, UMax, VMin and VMax
6183 parameters. The input face U and V parameters range is [0, 1]. If
6184 theUMin parameter is negative, the input face is extended, otherwise
6185 it is shrinked along U direction by theUMin parameter. If theUMax is
6186 greater than 1, the face is extended, otherwise it is shrinked along
6187 U direction by theUMax parameter. So as for theVMin, theVMax and
6188 V direction of the input face.
6191 theFace the input face to be resized.
6192 theUMin the minimal U parameter value.
6193 theUMax the maximal U parameter value.
6194 theVMin the minimal V parameter value.
6195 theVMax the maximal V parameter value.
6196 theName Object name; when specified, this parameter is used
6197 for result publication in the study. Otherwise, if automatic
6198 publication is switched on, default value is used for result name.
6201 New GEOM.GEOM_Object, containing the created face.
6203 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6204 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6206 RaiseIfFailed("ExtendFace", self.ShapesOp)
6207 anObj.SetParameters(Parameters)
6208 self._autoPublish(anObj, theName, "face")
6211 ## This function takes some face as input parameter and creates new
6212 # GEOM_Object, i.e. topological shape by extracting underlying surface
6213 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6214 # parameters of the source face (in the parametrical space).
6215 # @param theFace the input face.
6216 # @param theName Object name; when specified, this parameter is used
6217 # for result publication in the study. Otherwise, if automatic
6218 # publication is switched on, default value is used for result name.
6219 # @return New GEOM.GEOM_Object, containing the created face.
6221 # @ref tui_creation_surface "Example"
6222 @ManageTransactions("ShapesOp")
6223 def MakeSurfaceFromFace(self, theFace, theName=None):
6225 This function takes some face as input parameter and creates new
6226 GEOM_Object, i.e. topological shape by extracting underlying surface
6227 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6228 parameters of the source face (in the parametrical space).
6231 theFace the input face.
6232 theName Object name; when specified, this parameter is used
6233 for result publication in the study. Otherwise, if automatic
6234 publication is switched on, default value is used for result name.
6237 New GEOM.GEOM_Object, containing the created face.
6239 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6240 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6241 self._autoPublish(anObj, theName, "surface")
6247 ## @addtogroup l4_access
6250 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6251 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6252 # @param aShape Shape to get sub-shape of.
6253 # @param ListOfID List of sub-shapes indices.
6254 # @param theName Object name; when specified, this parameter is used
6255 # for result publication in the study. Otherwise, if automatic
6256 # publication is switched on, default value is used for result name.
6258 # @return Found sub-shape.
6260 # @ref swig_all_decompose "Example"
6261 def GetSubShape(self, aShape, ListOfID, theName=None):
6263 Obtain a composite sub-shape of aShape, composed from sub-shapes
6264 of aShape, selected by their unique IDs inside aShape
6267 aShape Shape to get sub-shape of.
6268 ListOfID List of sub-shapes indices.
6269 theName Object name; when specified, this parameter is used
6270 for result publication in the study. Otherwise, if automatic
6271 publication is switched on, default value is used for result name.
6276 # Example: see GEOM_TestAll.py
6277 anObj = self.AddSubShape(aShape,ListOfID)
6278 self._autoPublish(anObj, theName, "subshape")
6281 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6282 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6283 # @param aShape Shape to get sub-shape of.
6284 # @param aSubShape Sub-shapes of aShape.
6285 # @return ID of found sub-shape.
6287 # @ref swig_all_decompose "Example"
6288 @ManageTransactions("LocalOp")
6289 def GetSubShapeID(self, aShape, aSubShape):
6291 Obtain unique ID of sub-shape aSubShape inside aShape
6292 of aShape, selected by their unique IDs inside aShape
6295 aShape Shape to get sub-shape of.
6296 aSubShape Sub-shapes of aShape.
6299 ID of found sub-shape.
6301 # Example: see GEOM_TestAll.py
6302 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6303 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6306 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6307 # This function is provided for performance purpose. The complexity is O(n) with n
6308 # the number of subobjects of aShape
6309 # @param aShape Shape to get sub-shape of.
6310 # @param aSubShapes Sub-shapes of aShape.
6311 # @return list of IDs of found sub-shapes.
6313 # @ref swig_all_decompose "Example"
6314 @ManageTransactions("ShapesOp")
6315 def GetSubShapesIDs(self, aShape, aSubShapes):
6317 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6318 This function is provided for performance purpose. The complexity is O(n) with n
6319 the number of subobjects of aShape
6322 aShape Shape to get sub-shape of.
6323 aSubShapes Sub-shapes of aShape.
6326 List of IDs of found sub-shape.
6328 # Example: see GEOM_TestAll.py
6329 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6330 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6336 ## @addtogroup l4_decompose
6339 ## Get all sub-shapes and groups of \a theShape,
6340 # that were created already by any other methods.
6341 # @param theShape Any shape.
6342 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6343 # returned, else all found sub-shapes and groups.
6344 # @return List of existing sub-objects of \a theShape.
6346 # @ref swig_all_decompose "Example"
6347 @ManageTransactions("ShapesOp")
6348 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6350 Get all sub-shapes and groups of theShape,
6351 that were created already by any other methods.
6355 theGroupsOnly If this parameter is TRUE, only groups will be
6356 returned, else all found sub-shapes and groups.
6359 List of existing sub-objects of theShape.
6361 # Example: see GEOM_TestAll.py
6362 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6363 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6366 ## Get all groups of \a theShape,
6367 # that were created already by any other methods.
6368 # @param theShape Any shape.
6369 # @return List of existing groups of \a theShape.
6371 # @ref swig_all_decompose "Example"
6372 @ManageTransactions("ShapesOp")
6373 def GetGroups(self, theShape):
6375 Get all groups of theShape,
6376 that were created already by any other methods.
6382 List of existing groups of theShape.
6384 # Example: see GEOM_TestAll.py
6385 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6386 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6389 ## Explode a shape on sub-shapes of a given type.
6390 # If the shape itself matches the type, it is also returned.
6391 # @param aShape Shape to be exploded.
6392 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6393 # @param theName Object name; when specified, this parameter is used
6394 # for result publication in the study. Otherwise, if automatic
6395 # publication is switched on, default value is used for result name.
6397 # @return List of sub-shapes of type theShapeType, contained in theShape.
6399 # @ref swig_all_decompose "Example"
6400 @ManageTransactions("ShapesOp")
6401 def SubShapeAll(self, aShape, aType, theName=None):
6403 Explode a shape on sub-shapes of a given type.
6404 If the shape itself matches the type, it is also returned.
6407 aShape Shape to be exploded.
6408 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6409 theName Object name; when specified, this parameter is used
6410 for result publication in the study. Otherwise, if automatic
6411 publication is switched on, default value is used for result name.
6414 List of sub-shapes of type theShapeType, contained in theShape.
6416 # Example: see GEOM_TestAll.py
6417 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6418 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6419 self._autoPublish(ListObj, theName, "subshape")
6422 ## Explode a shape on sub-shapes of a given type.
6423 # @param aShape Shape to be exploded.
6424 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6425 # @return List of IDs of sub-shapes.
6427 # @ref swig_all_decompose "Example"
6428 @ManageTransactions("ShapesOp")
6429 def SubShapeAllIDs(self, aShape, aType):
6431 Explode a shape on sub-shapes of a given type.
6434 aShape Shape to be exploded (see geompy.ShapeType)
6435 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6438 List of IDs of sub-shapes.
6440 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6441 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6444 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6445 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6446 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6447 # @param aShape Shape to get sub-shape of.
6448 # @param ListOfInd List of sub-shapes indices.
6449 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6450 # @param theName Object name; when specified, this parameter is used
6451 # for result publication in the study. Otherwise, if automatic
6452 # publication is switched on, default value is used for result name.
6454 # @return A compound of sub-shapes of aShape.
6456 # @ref swig_all_decompose "Example"
6457 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6459 Obtain a compound of sub-shapes of aShape,
6460 selected by their indices in list of all sub-shapes of type aType.
6461 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6464 aShape Shape to get sub-shape of.
6465 ListOfID List of sub-shapes indices.
6466 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6467 theName Object name; when specified, this parameter is used
6468 for result publication in the study. Otherwise, if automatic
6469 publication is switched on, default value is used for result name.
6472 A compound of sub-shapes of aShape.
6474 # Example: see GEOM_TestAll.py
6476 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6477 for ind in ListOfInd:
6478 ListOfIDs.append(AllShapeIDsList[ind - 1])
6479 # note: auto-publishing is done in self.GetSubShape()
6480 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6483 ## Explode a shape on sub-shapes of a given type.
6484 # Sub-shapes will be sorted taking into account their gravity centers,
6485 # to provide stable order of sub-shapes. Please see
6486 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6487 # If the shape itself matches the type, it is also returned.
6488 # @param aShape Shape to be exploded.
6489 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6490 # @param theName Object name; when specified, this parameter is used
6491 # for result publication in the study. Otherwise, if automatic
6492 # publication is switched on, default value is used for result name.
6494 # @return List of sub-shapes of type theShapeType, contained in theShape.
6496 # @ref swig_SubShapeAllSorted "Example"
6497 @ManageTransactions("ShapesOp")
6498 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6500 Explode a shape on sub-shapes of a given type.
6501 Sub-shapes will be sorted taking into account their gravity centers,
6502 to provide stable order of sub-shapes.
6503 If the shape itself matches the type, it is also returned.
6506 aShape Shape to be exploded.
6507 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6508 theName Object name; when specified, this parameter is used
6509 for result publication in the study. Otherwise, if automatic
6510 publication is switched on, default value is used for result name.
6513 List of sub-shapes of type theShapeType, contained in theShape.
6515 # Example: see GEOM_TestAll.py
6516 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6517 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6518 self._autoPublish(ListObj, theName, "subshape")
6521 ## Explode a shape on sub-shapes of a given type.
6522 # Sub-shapes will be sorted taking into account their gravity centers,
6523 # to provide stable order of sub-shapes. Please see
6524 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6525 # @param aShape Shape to be exploded.
6526 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6527 # @return List of IDs of sub-shapes.
6529 # @ref swig_all_decompose "Example"
6530 @ManageTransactions("ShapesOp")
6531 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6533 Explode a shape on sub-shapes of a given type.
6534 Sub-shapes will be sorted taking into account their gravity centers,
6535 to provide stable order of sub-shapes.
6538 aShape Shape to be exploded.
6539 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6542 List of IDs of sub-shapes.
6544 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6545 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6548 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6549 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6550 # Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6551 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6552 # @param aShape Shape to get sub-shape of.
6553 # @param ListOfInd List of sub-shapes indices.
6554 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6555 # @param theName Object name; when specified, this parameter is used
6556 # for result publication in the study. Otherwise, if automatic
6557 # publication is switched on, default value is used for result name.
6559 # @return A compound of sub-shapes of aShape.
6561 # @ref swig_all_decompose "Example"
6562 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6564 Obtain a compound of sub-shapes of aShape,
6565 selected by they indices in sorted list of all sub-shapes of type aType.
6566 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6569 aShape Shape to get sub-shape of.
6570 ListOfID List of sub-shapes indices.
6571 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6572 theName Object name; when specified, this parameter is used
6573 for result publication in the study. Otherwise, if automatic
6574 publication is switched on, default value is used for result name.
6577 A compound of sub-shapes of aShape.
6579 # Example: see GEOM_TestAll.py
6581 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6582 for ind in ListOfInd:
6583 ListOfIDs.append(AllShapeIDsList[ind - 1])
6584 # note: auto-publishing is done in self.GetSubShape()
6585 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6588 ## Extract shapes (excluding the main shape) of given type.
6589 # @param aShape The shape.
6590 # @param aType The shape type (see ShapeType())
6591 # @param isSorted Boolean flag to switch sorting on/off. Please see
6592 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6593 # @param theName Object name; when specified, this parameter is used
6594 # for result publication in the study. Otherwise, if automatic
6595 # publication is switched on, default value is used for result name.
6597 # @return List of sub-shapes of type aType, contained in aShape.
6599 # @ref swig_FilletChamfer "Example"
6600 @ManageTransactions("ShapesOp")
6601 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6603 Extract shapes (excluding the main shape) of given type.
6607 aType The shape type (see geompy.ShapeType)
6608 isSorted Boolean flag to switch sorting on/off.
6609 theName Object name; when specified, this parameter is used
6610 for result publication in the study. Otherwise, if automatic
6611 publication is switched on, default value is used for result name.
6614 List of sub-shapes of type aType, contained in aShape.
6616 # Example: see GEOM_TestAll.py
6617 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6618 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6619 self._autoPublish(ListObj, theName, "subshape")
6622 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6623 # @param aShape Main shape.
6624 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6625 # @param theName Object name; when specified, this parameter is used
6626 # for result publication in the study. Otherwise, if automatic
6627 # publication is switched on, default value is used for result name.
6628 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6630 # @ref swig_all_decompose "Example"
6631 @ManageTransactions("ShapesOp")
6632 def SubShapes(self, aShape, anIDs, theName=None):
6634 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6638 anIDs List of unique IDs of sub-shapes inside theMainShape.
6639 theName Object name; when specified, this parameter is used
6640 for result publication in the study. Otherwise, if automatic
6641 publication is switched on, default value is used for result name.
6644 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6646 # Example: see GEOM_TestAll.py
6647 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6648 RaiseIfFailed("SubShapes", self.ShapesOp)
6649 self._autoPublish(ListObj, theName, "subshape")
6652 ## Explode a shape into edges sorted in a row from a starting point.
6653 # @param theShape the shape to be exploded on edges.
6654 # @param theStartPoint the starting point.
6655 # @param theName Object name; when specified, this parameter is used
6656 # for result publication in the study. Otherwise, if automatic
6657 # publication is switched on, default value is used for result name.
6658 # @return List of GEOM.GEOM_Object that is actually an ordered list
6659 # of edges sorted in a row from a starting point.
6661 # @ref swig_GetSubShapeEdgeSorted "Example"
6662 @ManageTransactions("ShapesOp")
6663 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6665 Explode a shape into edges sorted in a row from a starting point.
6668 theShape the shape to be exploded on edges.
6669 theStartPoint the starting point.
6670 theName Object name; when specified, this parameter is used
6671 for result publication in the study. Otherwise, if automatic
6672 publication is switched on, default value is used for result name.
6675 List of GEOM.GEOM_Object that is actually an ordered list
6676 of edges sorted in a row from a starting point.
6678 # Example: see GEOM_TestAll.py
6679 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6680 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6681 self._autoPublish(ListObj, theName, "SortedEdges")
6685 # Return the list of subshapes that satisfies a certain tolerance
6686 # criterion. The user defines the type of shapes to be returned, the
6687 # condition and the tolerance value. The operation is defined for
6688 # faces, edges and vertices only. E.g. for theShapeType FACE,
6689 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6690 # all faces of theShape that have tolerances greater then 1.e7.
6692 # @param theShape the shape to be exploded
6693 # @param theShapeType the type of sub-shapes to be returned (see
6694 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6695 # @param theCondition the condition type (see GEOM::comparison_condition).
6696 # @param theTolerance the tolerance filter.
6697 # @param theName Object name; when specified, this parameter is used
6698 # for result publication in the study. Otherwise, if automatic
6699 # publication is switched on, default value is used for result name.
6700 # @return the list of shapes that satisfy the conditions.
6702 # @ref swig_GetSubShapesWithTolerance "Example"
6703 @ManageTransactions("ShapesOp")
6704 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6705 theCondition, theTolerance, theName=None):
6707 Return the list of subshapes that satisfies a certain tolerance
6708 criterion. The user defines the type of shapes to be returned, the
6709 condition and the tolerance value. The operation is defined for
6710 faces, edges and vertices only. E.g. for theShapeType FACE,
6711 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6712 all faces of theShape that have tolerances greater then 1.e7.
6715 theShape the shape to be exploded
6716 theShapeType the type of sub-shapes to be returned (see
6717 ShapeType()). Can have the values FACE,
6718 EDGE and VERTEX only.
6719 theCondition the condition type (see GEOM::comparison_condition).
6720 theTolerance the tolerance filter.
6721 theName Object name; when specified, this parameter is used
6722 for result publication in the study. Otherwise, if automatic
6723 publication is switched on, default value is used for result name.
6726 The list of shapes that satisfy the conditions.
6728 # Example: see GEOM_TestAll.py
6729 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6730 theCondition, theTolerance)
6731 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6732 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6735 ## Check if the object is a sub-object of another GEOM object.
6736 # @param aSubObject Checked sub-object (or its parent object, in case if
6737 # \a theSubObjectIndex is non-zero).
6738 # @param anObject An object that is checked for ownership (or its parent object,
6739 # in case if \a theObjectIndex is non-zero).
6740 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6741 # identifies a sub-object within its parent specified via \a theSubObject.
6742 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6743 # identifies an object within its parent specified via \a theObject.
6744 # @return TRUE, if the given object contains sub-object.
6745 @ManageTransactions("ShapesOp")
6746 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6748 Check if the object is a sub-object of another GEOM object.
6751 aSubObject Checked sub-object (or its parent object, in case if
6752 \a theSubObjectIndex is non-zero).
6753 anObject An object that is checked for ownership (or its parent object,
6754 in case if \a theObjectIndex is non-zero).
6755 aSubObjectIndex When non-zero, specifies a sub-shape index that
6756 identifies a sub-object within its parent specified via \a theSubObject.
6757 anObjectIndex When non-zero, specifies a sub-shape index that
6758 identifies an object within its parent specified via \a theObject.
6761 TRUE, if the given object contains sub-object.
6763 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6764 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6767 ## Perform extraction of sub-shapes from the main shape.
6769 # @param theShape the main shape
6770 # @param theListOfID the list of sub-shape IDs to be extracted from
6772 # @return New GEOM.GEOM_Object, containing the shape without
6773 # extracted sub-shapes.
6775 # @ref swig_MakeExtraction "Example"
6776 @ManageTransactions("ShapesOp")
6777 def MakeExtraction(self, theShape, theListOfID, theName=None):
6779 Perform extraction of sub-shapes from the main shape.
6782 theShape the main shape
6783 theListOfID the list of sub-shape IDs to be extracted from
6787 New GEOM.GEOM_Object, containing the shape without
6788 extracted sub-shapes.
6790 # Example: see GEOM_TestAll.py
6791 (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6792 RaiseIfFailed("MakeExtraction", self.ShapesOp)
6793 self._autoPublish(anObj, theName, "Extraction")
6796 # end of l4_decompose
6799 ## @addtogroup l4_decompose_d
6802 ## Deprecated method
6803 # It works like SubShapeAllSortedCentres(), but wrongly
6804 # defines centres of faces, shells and solids.
6805 @ManageTransactions("ShapesOp")
6806 def SubShapeAllSorted(self, aShape, aType, theName=None):
6809 It works like geompy.SubShapeAllSortedCentres, but wrongly
6810 defines centres of faces, shells and solids.
6812 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6813 RaiseIfFailed("MakeExplode", self.ShapesOp)
6814 self._autoPublish(ListObj, theName, "subshape")
6817 ## Deprecated method
6818 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6819 # defines centres of faces, shells and solids.
6820 @ManageTransactions("ShapesOp")
6821 def SubShapeAllSortedIDs(self, aShape, aType):
6824 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6825 defines centres of faces, shells and solids.
6827 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6828 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6831 ## Deprecated method
6832 # It works like SubShapeSortedCentres(), but has a bug
6833 # (wrongly defines centres of faces, shells and solids).
6834 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6837 It works like geompy.SubShapeSortedCentres, but has a bug
6838 (wrongly defines centres of faces, shells and solids).
6841 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6842 for ind in ListOfInd:
6843 ListOfIDs.append(AllShapeIDsList[ind - 1])
6844 # note: auto-publishing is done in self.GetSubShape()
6845 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6848 # end of l4_decompose_d
6851 ## @addtogroup l3_healing
6854 ## Apply a sequence of Shape Healing operators to the given object.
6855 # @param theShape Shape to be processed.
6856 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6857 # @param theParameters List of names of parameters
6858 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6859 # @param theValues List of values of parameters, in the same order
6860 # as parameters are listed in <VAR>theParameters</VAR> list.
6861 # @param theName Object name; when specified, this parameter is used
6862 # for result publication in the study. Otherwise, if automatic
6863 # publication is switched on, default value is used for result name.
6865 # <b> Operators and Parameters: </b> \n
6867 # * \b FixShape - corrects invalid shapes. \n
6868 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6869 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6871 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6872 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6873 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6874 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6875 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6876 # - \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
6877 # - \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
6878 # - \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
6880 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6881 # surfaces in segments using a certain angle. \n
6882 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6883 # if Angle=180, four if Angle=90, etc). \n
6884 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6886 # * \b SplitClosedFaces - splits closed faces in segments.
6887 # The number of segments depends on the number of splitting points.\n
6888 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6890 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6891 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6892 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6893 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6894 # This and the previous parameters can take the following values:\n
6895 # \b Parametric \b Continuity \n
6896 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6897 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6898 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6899 # ruling out sharp edges).\n
6900 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6901 # are of the same magnitude).\n
6902 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6903 # or surfaces (d/du C(u)) are the same at junction. \n
6904 # \b Geometric \b Continuity \n
6905 # \b G1: first derivatives are proportional at junction.\n
6906 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6907 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6908 # \b G2: first and second derivatives are proportional at junction.
6909 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6910 # continuity requires that the underlying parameterization was continuous as well.
6911 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6913 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6914 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6915 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6916 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6917 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6918 # with the specified parameters.\n
6919 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6920 # with the specified parameters.\n
6921 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6922 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6923 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6924 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6926 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6927 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6928 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6929 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6930 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6932 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6933 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6936 # @return New GEOM.GEOM_Object, containing processed shape.
6938 # \n @ref tui_shape_processing "Example"
6939 @ManageTransactions("HealOp")
6940 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6942 Apply a sequence of Shape Healing operators to the given object.
6945 theShape Shape to be processed.
6946 theValues List of values of parameters, in the same order
6947 as parameters are listed in theParameters list.
6948 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6949 theParameters List of names of parameters
6950 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6951 theName Object name; when specified, this parameter is used
6952 for result publication in the study. Otherwise, if automatic
6953 publication is switched on, default value is used for result name.
6955 Operators and Parameters:
6957 * FixShape - corrects invalid shapes.
6958 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6959 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6960 * FixFaceSize - removes small faces, such as spots and strips.
6961 * FixFaceSize.Tolerance - defines minimum possible face size.
6962 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6963 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6964 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6965 * 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.
6966 * 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.
6967 * 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.
6969 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6970 in segments using a certain angle.
6971 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6972 if Angle=180, four if Angle=90, etc).
6973 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6974 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6976 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6977 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6978 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6979 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6980 * SplitContinuity.CurveContinuity - required continuity for curves.
6981 This and the previous parameters can take the following values:
6983 Parametric Continuity:
6984 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6985 coincidental. The curves or surfaces may still meet at an angle,
6986 giving rise to a sharp corner or edge).
6987 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6988 are parallel, ruling out sharp edges).
6989 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6990 or surfaces are of the same magnitude).
6991 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6992 curves or surfaces (d/du C(u)) are the same at junction.
6994 Geometric Continuity:
6995 G1: first derivatives are proportional at junction.
6996 The curve tangents thus have the same direction, but not necessarily the same magnitude.
6997 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
6998 G2: first and second derivatives are proportional at junction. As the names imply,
6999 geometric continuity requires the geometry to be continuous, while parametric continuity requires
7000 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
7001 geometric continuity of order n, but not vice-versa.
7002 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7003 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7004 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7005 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7006 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7007 the specified parameters.
7008 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7009 the specified parameters.
7010 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7011 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7012 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7013 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7014 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7015 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7016 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7017 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7018 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7019 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7020 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7023 New GEOM.GEOM_Object, containing processed shape.
7025 Note: For more information look through SALOME Geometry User's Guide->
7026 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7028 # Example: see GEOM_TestHealing.py
7029 theValues,Parameters = ParseList(theValues)
7030 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7031 # To avoid script failure in case of good argument shape
7032 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7034 RaiseIfFailed("ProcessShape", self.HealOp)
7035 for string in (theOperators + theParameters):
7036 Parameters = ":" + Parameters
7038 anObj.SetParameters(Parameters)
7039 self._autoPublish(anObj, theName, "healed")
7042 ## Remove faces from the given object (shape).
7043 # @param theObject Shape to be processed.
7044 # @param theFaces Indices of faces to be removed, if EMPTY then the method
7045 # removes ALL faces of the given object.
7046 # @param theName Object name; when specified, this parameter is used
7047 # for result publication in the study. Otherwise, if automatic
7048 # publication is switched on, default value is used for result name.
7050 # @return New GEOM.GEOM_Object, containing processed shape.
7052 # @ref tui_suppress_faces "Example"
7053 @ManageTransactions("HealOp")
7054 def SuppressFaces(self, theObject, theFaces, theName=None):
7056 Remove faces from the given object (shape).
7059 theObject Shape to be processed.
7060 theFaces Indices of faces to be removed, if EMPTY then the method
7061 removes ALL faces of the given object.
7062 theName Object name; when specified, this parameter is used
7063 for result publication in the study. Otherwise, if automatic
7064 publication is switched on, default value is used for result name.
7067 New GEOM.GEOM_Object, containing processed shape.
7069 # Example: see GEOM_TestHealing.py
7070 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7071 RaiseIfFailed("SuppressFaces", self.HealOp)
7072 self._autoPublish(anObj, theName, "suppressFaces")
7075 ## Sewing of faces into a single shell.
7076 # @param ListShape Shapes to be processed.
7077 # @param theTolerance Required tolerance value.
7078 # @param AllowNonManifold Flag that allows non-manifold sewing.
7079 # @param theName Object name; when specified, this parameter is used
7080 # for result publication in the study. Otherwise, if automatic
7081 # publication is switched on, default value is used for result name.
7083 # @return New GEOM.GEOM_Object, containing a result shell.
7085 # @ref tui_sewing "Example"
7086 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7088 Sewing of faces into a single shell.
7091 ListShape Shapes to be processed.
7092 theTolerance Required tolerance value.
7093 AllowNonManifold Flag that allows non-manifold sewing.
7094 theName Object name; when specified, this parameter is used
7095 for result publication in the study. Otherwise, if automatic
7096 publication is switched on, default value is used for result name.
7099 New GEOM.GEOM_Object, containing containing a result shell.
7101 # Example: see GEOM_TestHealing.py
7102 # note: auto-publishing is done in self.Sew()
7103 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7106 ## Sewing of faces into a single shell.
7107 # @param ListShape Shapes to be processed.
7108 # @param theTolerance Required tolerance value.
7109 # @param AllowNonManifold Flag that allows non-manifold sewing.
7110 # @param theName Object name; when specified, this parameter is used
7111 # for result publication in the study. Otherwise, if automatic
7112 # publication is switched on, default value is used for result name.
7114 # @return New GEOM.GEOM_Object, containing a result shell.
7115 @ManageTransactions("HealOp")
7116 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7118 Sewing of faces into a single shell.
7121 ListShape Shapes to be processed.
7122 theTolerance Required tolerance value.
7123 AllowNonManifold Flag that allows non-manifold sewing.
7124 theName Object name; when specified, this parameter is used
7125 for result publication in the study. Otherwise, if automatic
7126 publication is switched on, default value is used for result name.
7129 New GEOM.GEOM_Object, containing a result shell.
7131 # Example: see MakeSewing() above
7132 theTolerance,Parameters = ParseParameters(theTolerance)
7133 if AllowNonManifold:
7134 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7136 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7137 # To avoid script failure in case of good argument shape
7138 # (Fix of test cases geom/bugs11/L7,L8)
7139 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7141 RaiseIfFailed("Sew", self.HealOp)
7142 anObj.SetParameters(Parameters)
7143 self._autoPublish(anObj, theName, "sewed")
7146 ## Rebuild the topology of theSolids by removing
7147 # the faces that are shared by several solids.
7148 # @param theSolids A compound or a list of solids to be processed.
7149 # @param theName Object name; when specified, this parameter is used
7150 # for result publication in the study. Otherwise, if automatic
7151 # publication is switched on, default value is used for result name.
7153 # @return New GEOM.GEOM_Object, containing processed shape.
7155 # @ref tui_remove_webs "Example"
7156 @ManageTransactions("HealOp")
7157 def RemoveInternalFaces (self, theSolids, theName=None):
7159 Rebuild the topology of theSolids by removing
7160 the faces that are shared by several solids.
7163 theSolids A compound or a list of solids to be processed.
7164 theName Object name; when specified, this parameter is used
7165 for result publication in the study. Otherwise, if automatic
7166 publication is switched on, default value is used for result name.
7169 New GEOM.GEOM_Object, containing processed shape.
7171 # Example: see GEOM_TestHealing.py
7172 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7173 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7174 self._autoPublish(anObj, theName, "removeWebs")
7177 ## Remove internal wires and edges from the given object (face).
7178 # @param theObject Shape to be processed.
7179 # @param theWires Indices of wires to be removed, if EMPTY then the method
7180 # removes ALL internal wires of the given object.
7181 # @param theName Object name; when specified, this parameter is used
7182 # for result publication in the study. Otherwise, if automatic
7183 # publication is switched on, default value is used for result name.
7185 # @return New GEOM.GEOM_Object, containing processed shape.
7187 # @ref tui_suppress_internal_wires "Example"
7188 @ManageTransactions("HealOp")
7189 def SuppressInternalWires(self, theObject, theWires, theName=None):
7191 Remove internal wires and edges from the given object (face).
7194 theObject Shape to be processed.
7195 theWires Indices of wires to be removed, if EMPTY then the method
7196 removes ALL internal wires of the given object.
7197 theName Object name; when specified, this parameter is used
7198 for result publication in the study. Otherwise, if automatic
7199 publication is switched on, default value is used for result name.
7202 New GEOM.GEOM_Object, containing processed shape.
7204 # Example: see GEOM_TestHealing.py
7205 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7206 RaiseIfFailed("RemoveIntWires", self.HealOp)
7207 self._autoPublish(anObj, theName, "suppressWires")
7210 ## Remove internal closed contours (holes) from the given object.
7211 # @param theObject Shape to be processed.
7212 # @param theWires Indices of wires to be removed, if EMPTY then the method
7213 # removes ALL internal holes of the given object
7214 # @param theName Object name; when specified, this parameter is used
7215 # for result publication in the study. Otherwise, if automatic
7216 # publication is switched on, default value is used for result name.
7218 # @return New GEOM.GEOM_Object, containing processed shape.
7220 # @ref tui_suppress_holes "Example"
7221 @ManageTransactions("HealOp")
7222 def SuppressHoles(self, theObject, theWires, theName=None):
7224 Remove internal closed contours (holes) from the given object.
7227 theObject Shape to be processed.
7228 theWires Indices of wires to be removed, if EMPTY then the method
7229 removes ALL internal holes of the given object
7230 theName Object name; when specified, this parameter is used
7231 for result publication in the study. Otherwise, if automatic
7232 publication is switched on, default value is used for result name.
7235 New GEOM.GEOM_Object, containing processed shape.
7237 # Example: see GEOM_TestHealing.py
7238 anObj = self.HealOp.FillHoles(theObject, theWires)
7239 RaiseIfFailed("FillHoles", self.HealOp)
7240 self._autoPublish(anObj, theName, "suppressHoles")
7243 ## Close an open wire.
7244 # @param theObject Shape to be processed.
7245 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7246 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7247 # @param isCommonVertex If True : closure by creation of a common vertex,
7248 # If False : closure by creation of an edge between ends.
7249 # @param theName Object name; when specified, this parameter is used
7250 # for result publication in the study. Otherwise, if automatic
7251 # publication is switched on, default value is used for result name.
7253 # @return New GEOM.GEOM_Object, containing processed shape.
7255 # @ref tui_close_contour "Example"
7256 @ManageTransactions("HealOp")
7257 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7262 theObject Shape to be processed.
7263 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7264 if [ ], then theObject itself is a wire.
7265 isCommonVertex If True : closure by creation of a common vertex,
7266 If False : closure by creation of an edge between ends.
7267 theName Object name; when specified, this parameter is used
7268 for result publication in the study. Otherwise, if automatic
7269 publication is switched on, default value is used for result name.
7272 New GEOM.GEOM_Object, containing processed shape.
7274 # Example: see GEOM_TestHealing.py
7275 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7276 RaiseIfFailed("CloseContour", self.HealOp)
7277 self._autoPublish(anObj, theName, "closeContour")
7280 ## Addition of a point to a given edge object.
7281 # @param theObject Shape to be processed.
7282 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7283 # if -1, then theObject itself is the edge.
7284 # @param theValue Value of parameter on edge or length parameter,
7285 # depending on \a isByParameter.
7286 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7287 # if FALSE : \a theValue is treated as a length parameter [0..1]
7288 # @param theName Object name; when specified, this parameter is used
7289 # for result publication in the study. Otherwise, if automatic
7290 # publication is switched on, default value is used for result name.
7292 # @return New GEOM.GEOM_Object, containing processed shape.
7294 # @ref tui_add_point_on_edge "Example"
7295 @ManageTransactions("HealOp")
7296 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7298 Addition of a point to a given edge object.
7301 theObject Shape to be processed.
7302 theEdgeIndex Index of edge to be divided within theObject's shape,
7303 if -1, then theObject itself is the edge.
7304 theValue Value of parameter on edge or length parameter,
7305 depending on isByParameter.
7306 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7307 if FALSE : theValue is treated as a length parameter [0..1]
7308 theName Object name; when specified, this parameter is used
7309 for result publication in the study. Otherwise, if automatic
7310 publication is switched on, default value is used for result name.
7313 New GEOM.GEOM_Object, containing processed shape.
7315 # Example: see GEOM_TestHealing.py
7316 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7317 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7318 RaiseIfFailed("DivideEdge", self.HealOp)
7319 anObj.SetParameters(Parameters)
7320 self._autoPublish(anObj, theName, "divideEdge")
7323 ## Addition of points to a given edge of \a theObject by projecting
7324 # other points to the given edge.
7325 # @param theObject Shape to be processed.
7326 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7327 # if -1, then theObject itself is the edge.
7328 # @param thePoints List of points to project to theEdgeIndex-th edge.
7329 # @param theName Object name; when specified, this parameter is used
7330 # for result publication in the study. Otherwise, if automatic
7331 # publication is switched on, default value is used for result name.
7333 # @return New GEOM.GEOM_Object, containing processed shape.
7335 # @ref tui_add_point_on_edge "Example"
7336 @ManageTransactions("HealOp")
7337 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7339 Addition of points to a given edge of \a theObject by projecting
7340 other points to the given edge.
7343 theObject Shape to be processed.
7344 theEdgeIndex The edge or its index to be divided within theObject's shape,
7345 if -1, then theObject itself is the edge.
7346 thePoints List of points to project to theEdgeIndex-th edge.
7347 theName Object name; when specified, this parameter is used
7348 for result publication in the study. Otherwise, if automatic
7349 publication is switched on, default value is used for result name.
7352 New GEOM.GEOM_Object, containing processed shape.
7354 # Example: see GEOM_TestHealing.py
7355 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7356 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7357 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7358 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7359 self._autoPublish(anObj, theName, "divideEdge")
7362 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7363 # @param theWire Wire to minimize the number of C1 continuous edges in.
7364 # @param theVertices A list of vertices to suppress. If the list
7365 # is empty, all vertices in a wire will be assumed.
7366 # @param theName Object name; when specified, this parameter is used
7367 # for result publication in the study. Otherwise, if automatic
7368 # publication is switched on, default value is used for result name.
7370 # @return New GEOM.GEOM_Object with modified wire.
7372 # @ref tui_fuse_collinear_edges "Example"
7373 @ManageTransactions("HealOp")
7374 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7376 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7379 theWire Wire to minimize the number of C1 continuous edges in.
7380 theVertices A list of vertices to suppress. If the list
7381 is empty, all vertices in a wire will be assumed.
7382 theName Object name; when specified, this parameter is used
7383 for result publication in the study. Otherwise, if automatic
7384 publication is switched on, default value is used for result name.
7387 New GEOM.GEOM_Object with modified wire.
7389 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7390 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7391 self._autoPublish(anObj, theName, "fuseEdges")
7394 ## Change orientation of the given object. Updates given shape.
7395 # @param theObject Shape to be processed.
7396 # @return Updated <var>theObject</var>
7398 # @ref swig_todo "Example"
7399 @ManageTransactions("HealOp")
7400 def ChangeOrientationShell(self,theObject):
7402 Change orientation of the given object. Updates given shape.
7405 theObject Shape to be processed.
7410 theObject = self.HealOp.ChangeOrientation(theObject)
7411 RaiseIfFailed("ChangeOrientation", self.HealOp)
7414 ## Change orientation of the given object.
7415 # @param theObject Shape to be processed.
7416 # @param theName Object name; when specified, this parameter is used
7417 # for result publication in the study. Otherwise, if automatic
7418 # publication is switched on, default value is used for result name.
7420 # @return New GEOM.GEOM_Object, containing processed shape.
7422 # @ref swig_todo "Example"
7423 @ManageTransactions("HealOp")
7424 def ChangeOrientationShellCopy(self, theObject, theName=None):
7426 Change orientation of the given object.
7429 theObject Shape to be processed.
7430 theName Object name; when specified, this parameter is used
7431 for result publication in the study. Otherwise, if automatic
7432 publication is switched on, default value is used for result name.
7435 New GEOM.GEOM_Object, containing processed shape.
7437 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7438 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7439 self._autoPublish(anObj, theName, "reversed")
7442 ## Try to limit tolerance of the given object by value \a theTolerance.
7443 # @param theObject Shape to be processed.
7444 # @param theTolerance Required tolerance value.
7445 # @param theName Object name; when specified, this parameter is used
7446 # for result publication in the study. Otherwise, if automatic
7447 # publication is switched on, default value is used for result name.
7449 # @return New GEOM.GEOM_Object, containing processed shape.
7451 # @ref tui_limit_tolerance "Example"
7452 @ManageTransactions("HealOp")
7453 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7455 Try to limit tolerance of the given object by value theTolerance.
7458 theObject Shape to be processed.
7459 theTolerance Required tolerance value.
7460 theName Object name; when specified, this parameter is used
7461 for result publication in the study. Otherwise, if automatic
7462 publication is switched on, default value is used for result name.
7465 New GEOM.GEOM_Object, containing processed shape.
7467 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7468 RaiseIfFailed("LimitTolerance", self.HealOp)
7469 self._autoPublish(anObj, theName, "limitTolerance")
7472 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7473 # that constitute a free boundary of the given shape.
7474 # @param theObject Shape to get free boundary of.
7475 # @param theName Object name; when specified, this parameter is used
7476 # for result publication in the study. Otherwise, if automatic
7477 # publication is switched on, default value is used for result name.
7479 # @return [\a status, \a theClosedWires, \a theOpenWires]
7480 # \n \a status: FALSE, if an error(s) occurred during the method execution.
7481 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7482 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7484 # @ref tui_free_boundaries_page "Example"
7485 @ManageTransactions("HealOp")
7486 def GetFreeBoundary(self, theObject, theName=None):
7488 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7489 that constitute a free boundary of the given shape.
7492 theObject Shape to get free boundary of.
7493 theName Object name; when specified, this parameter is used
7494 for result publication in the study. Otherwise, if automatic
7495 publication is switched on, default value is used for result name.
7498 [status, theClosedWires, theOpenWires]
7499 status: FALSE, if an error(s) occurred during the method execution.
7500 theClosedWires: Closed wires on the free boundary of the given shape.
7501 theOpenWires: Open wires on the free boundary of the given shape.
7503 # Example: see GEOM_TestHealing.py
7504 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7505 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7506 self._autoPublish(anObj[1], theName, "closedWire")
7507 self._autoPublish(anObj[2], theName, "openWire")
7510 ## Replace coincident faces in \a theShapes by one face.
7511 # @param theShapes Initial shapes, either a list or compound of shapes.
7512 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7513 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7514 # otherwise all initial shapes.
7515 # @param theName Object name; when specified, this parameter is used
7516 # for result publication in the study. Otherwise, if automatic
7517 # publication is switched on, default value is used for result name.
7519 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7521 # @ref tui_glue_faces "Example"
7522 @ManageTransactions("ShapesOp")
7523 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7525 Replace coincident faces in theShapes by one face.
7528 theShapes Initial shapes, either a list or compound of shapes.
7529 theTolerance Maximum distance between faces, which can be considered as coincident.
7530 doKeepNonSolids If FALSE, only solids will present in the result,
7531 otherwise all initial shapes.
7532 theName Object name; when specified, this parameter is used
7533 for result publication in the study. Otherwise, if automatic
7534 publication is switched on, default value is used for result name.
7537 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7539 # Example: see GEOM_Spanner.py
7540 theTolerance,Parameters = ParseParameters(theTolerance)
7541 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7543 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7544 anObj.SetParameters(Parameters)
7545 self._autoPublish(anObj, theName, "glueFaces")
7548 ## Find coincident faces in \a theShapes for possible gluing.
7549 # @param theShapes Initial shapes, either a list or compound of shapes.
7550 # @param theTolerance Maximum distance between faces,
7551 # which can be considered as coincident.
7552 # @param theName Object name; when specified, this parameter is used
7553 # for result publication in the study. Otherwise, if automatic
7554 # publication is switched on, default value is used for result name.
7556 # @return GEOM.ListOfGO
7558 # @ref tui_glue_faces "Example"
7559 @ManageTransactions("ShapesOp")
7560 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7562 Find coincident faces in theShapes for possible gluing.
7565 theShapes Initial shapes, either a list or compound of shapes.
7566 theTolerance Maximum distance between faces,
7567 which can be considered as coincident.
7568 theName Object name; when specified, this parameter is used
7569 for result publication in the study. Otherwise, if automatic
7570 publication is switched on, default value is used for result name.
7575 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7576 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7577 self._autoPublish(anObj, theName, "facesToGlue")
7580 ## Replace coincident faces in \a theShapes by one face
7581 # in compliance with given list of faces
7582 # @param theShapes Initial shapes, either a list or compound of shapes.
7583 # @param theTolerance Maximum distance between faces,
7584 # which can be considered as coincident.
7585 # @param theFaces List of faces for gluing.
7586 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7587 # otherwise all initial shapes.
7588 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7589 # will be glued, otherwise only the edges,
7590 # belonging to <VAR>theFaces</VAR>.
7591 # @param theName Object name; when specified, this parameter is used
7592 # for result publication in the study. Otherwise, if automatic
7593 # publication is switched on, default value is used for result name.
7595 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7597 # @ref tui_glue_faces "Example"
7598 @ManageTransactions("ShapesOp")
7599 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7600 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7602 Replace coincident faces in theShapes by one face
7603 in compliance with given list of faces
7606 theShapes theShapes Initial shapes, either a list or compound of shapes.
7607 theTolerance Maximum distance between faces,
7608 which can be considered as coincident.
7609 theFaces List of faces for gluing.
7610 doKeepNonSolids If FALSE, only solids will present in the result,
7611 otherwise all initial shapes.
7612 doGlueAllEdges If TRUE, all coincident edges of theShape
7613 will be glued, otherwise only the edges,
7614 belonging to theFaces.
7615 theName Object name; when specified, this parameter is used
7616 for result publication in the study. Otherwise, if automatic
7617 publication is switched on, default value is used for result name.
7620 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7622 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7623 doKeepNonSolids, doGlueAllEdges)
7625 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7626 self._autoPublish(anObj, theName, "glueFaces")
7629 ## Replace coincident edges in \a theShapes by one edge.
7630 # @param theShapes Initial shapes, either a list or compound of shapes.
7631 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7632 # @param theName Object name; when specified, this parameter is used
7633 # for result publication in the study. Otherwise, if automatic
7634 # publication is switched on, default value is used for result name.
7636 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7638 # @ref tui_glue_edges "Example"
7639 @ManageTransactions("ShapesOp")
7640 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7642 Replace coincident edges in theShapes by one edge.
7645 theShapes Initial shapes, either a list or compound of shapes.
7646 theTolerance Maximum distance between edges, which can be considered as coincident.
7647 theName Object name; when specified, this parameter is used
7648 for result publication in the study. Otherwise, if automatic
7649 publication is switched on, default value is used for result name.
7652 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7654 theTolerance,Parameters = ParseParameters(theTolerance)
7655 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7657 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7658 anObj.SetParameters(Parameters)
7659 self._autoPublish(anObj, theName, "glueEdges")
7662 ## Find coincident edges in \a theShapes for possible gluing.
7663 # @param theShapes Initial shapes, either a list or compound of shapes.
7664 # @param theTolerance Maximum distance between edges,
7665 # which can be considered as coincident.
7666 # @param theName Object name; when specified, this parameter is used
7667 # for result publication in the study. Otherwise, if automatic
7668 # publication is switched on, default value is used for result name.
7670 # @return GEOM.ListOfGO
7672 # @ref tui_glue_edges "Example"
7673 @ManageTransactions("ShapesOp")
7674 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7676 Find coincident edges in theShapes for possible gluing.
7679 theShapes Initial shapes, either a list or compound of shapes.
7680 theTolerance Maximum distance between edges,
7681 which can be considered as coincident.
7682 theName Object name; when specified, this parameter is used
7683 for result publication in the study. Otherwise, if automatic
7684 publication is switched on, default value is used for result name.
7689 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7690 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7691 self._autoPublish(anObj, theName, "edgesToGlue")
7694 ## Replace coincident edges in theShapes by one edge
7695 # in compliance with given list of edges.
7696 # @param theShapes Initial shapes, either a list or compound of shapes.
7697 # @param theTolerance Maximum distance between edges,
7698 # which can be considered as coincident.
7699 # @param theEdges List of edges for gluing.
7700 # @param theName Object name; when specified, this parameter is used
7701 # for result publication in the study. Otherwise, if automatic
7702 # publication is switched on, default value is used for result name.
7704 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7706 # @ref tui_glue_edges "Example"
7707 @ManageTransactions("ShapesOp")
7708 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7710 Replace coincident edges in theShapes by one edge
7711 in compliance with given list of edges.
7714 theShapes Initial shapes, either a list or compound of shapes.
7715 theTolerance Maximum distance between edges,
7716 which can be considered as coincident.
7717 theEdges List of edges for gluing.
7718 theName Object name; when specified, this parameter is used
7719 for result publication in the study. Otherwise, if automatic
7720 publication is switched on, default value is used for result name.
7723 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7725 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7727 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7728 self._autoPublish(anObj, theName, "glueEdges")
7734 ## @addtogroup l3_boolean Boolean Operations
7737 # -----------------------------------------------------------------------------
7738 # Boolean (Common, Cut, Fuse, Section)
7739 # -----------------------------------------------------------------------------
7741 ## Perform one of boolean operations on two given shapes.
7742 # @param theShape1 First argument for boolean operation.
7743 # @param theShape2 Second argument for boolean operation.
7744 # @param theOperation Indicates the operation to be done:\n
7745 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7746 # @param checkSelfInte The flag that tells if the arguments should
7747 # be checked for self-intersection prior to the operation.
7748 # @param theName Object name; when specified, this parameter is used
7749 # for result publication in the study. Otherwise, if automatic
7750 # publication is switched on, default value is used for result name.
7752 # @note This algorithm doesn't find all types of self-intersections.
7753 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7754 # vertex/face and edge/face intersections. Face/face
7755 # intersections detection is switched off as it is a
7756 # time-consuming operation that gives an impact on performance.
7757 # To find all self-intersections please use
7758 # CheckSelfIntersections() method.
7760 # @return New GEOM.GEOM_Object, containing the result shape.
7762 # @ref tui_fuse "Example"
7763 @ManageTransactions("BoolOp")
7764 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7766 Perform one of boolean operations on two given shapes.
7769 theShape1 First argument for boolean operation.
7770 theShape2 Second argument for boolean operation.
7771 theOperation Indicates the operation to be done:
7772 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7773 checkSelfInte The flag that tells if the arguments should
7774 be checked for self-intersection prior to
7776 theName Object name; when specified, this parameter is used
7777 for result publication in the study. Otherwise, if automatic
7778 publication is switched on, default value is used for result name.
7781 This algorithm doesn't find all types of self-intersections.
7782 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7783 vertex/face and edge/face intersections. Face/face
7784 intersections detection is switched off as it is a
7785 time-consuming operation that gives an impact on performance.
7786 To find all self-intersections please use
7787 CheckSelfIntersections() method.
7790 New GEOM.GEOM_Object, containing the result shape.
7792 # Example: see GEOM_TestAll.py
7793 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7794 RaiseIfFailed("MakeBoolean", self.BoolOp)
7795 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7796 self._autoPublish(anObj, theName, def_names[theOperation])
7799 ## Perform Common boolean operation on two given shapes.
7800 # @param theShape1 First argument for boolean operation.
7801 # @param theShape2 Second argument for boolean operation.
7802 # @param checkSelfInte The flag that tells if the arguments should
7803 # be checked for self-intersection prior to the operation.
7804 # @param theName Object name; when specified, this parameter is used
7805 # for result publication in the study. Otherwise, if automatic
7806 # publication is switched on, default value is used for result name.
7808 # @note This algorithm doesn't find all types of self-intersections.
7809 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7810 # vertex/face and edge/face intersections. Face/face
7811 # intersections detection is switched off as it is a
7812 # time-consuming operation that gives an impact on performance.
7813 # To find all self-intersections please use
7814 # CheckSelfIntersections() method.
7816 # @return New GEOM.GEOM_Object, containing the result shape.
7818 # @ref tui_common "Example 1"
7819 # \n @ref swig_MakeCommon "Example 2"
7820 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7822 Perform Common boolean operation on two given shapes.
7825 theShape1 First argument for boolean operation.
7826 theShape2 Second argument for boolean operation.
7827 checkSelfInte The flag that tells if the arguments should
7828 be checked for self-intersection prior to
7830 theName Object name; when specified, this parameter is used
7831 for result publication in the study. Otherwise, if automatic
7832 publication is switched on, default value is used for result name.
7835 This algorithm doesn't find all types of self-intersections.
7836 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7837 vertex/face and edge/face intersections. Face/face
7838 intersections detection is switched off as it is a
7839 time-consuming operation that gives an impact on performance.
7840 To find all self-intersections please use
7841 CheckSelfIntersections() method.
7844 New GEOM.GEOM_Object, containing the result shape.
7846 # Example: see GEOM_TestOthers.py
7847 # note: auto-publishing is done in self.MakeBoolean()
7848 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7850 ## Perform Cut boolean operation on two given shapes.
7851 # @param theShape1 First argument for boolean operation.
7852 # @param theShape2 Second argument for boolean operation.
7853 # @param checkSelfInte The flag that tells if the arguments should
7854 # be checked for self-intersection prior to the operation.
7855 # @param theName Object name; when specified, this parameter is used
7856 # for result publication in the study. Otherwise, if automatic
7857 # publication is switched on, default value is used for result name.
7859 # @note This algorithm doesn't find all types of self-intersections.
7860 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7861 # vertex/face and edge/face intersections. Face/face
7862 # intersections detection is switched off as it is a
7863 # time-consuming operation that gives an impact on performance.
7864 # To find all self-intersections please use
7865 # CheckSelfIntersections() method.
7867 # @return New GEOM.GEOM_Object, containing the result shape.
7869 # @ref tui_cut "Example 1"
7870 # \n @ref swig_MakeCommon "Example 2"
7871 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7873 Perform Cut boolean operation on two given shapes.
7876 theShape1 First argument for boolean operation.
7877 theShape2 Second argument for boolean operation.
7878 checkSelfInte The flag that tells if the arguments should
7879 be checked for self-intersection prior to
7881 theName Object name; when specified, this parameter is used
7882 for result publication in the study. Otherwise, if automatic
7883 publication is switched on, default value is used for result name.
7886 This algorithm doesn't find all types of self-intersections.
7887 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7888 vertex/face and edge/face intersections. Face/face
7889 intersections detection is switched off as it is a
7890 time-consuming operation that gives an impact on performance.
7891 To find all self-intersections please use
7892 CheckSelfIntersections() method.
7895 New GEOM.GEOM_Object, containing the result shape.
7898 # Example: see GEOM_TestOthers.py
7899 # note: auto-publishing is done in self.MakeBoolean()
7900 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7902 ## Perform Fuse boolean operation on two given shapes.
7903 # @param theShape1 First argument for boolean operation.
7904 # @param theShape2 Second argument for boolean operation.
7905 # @param checkSelfInte The flag that tells if the arguments should
7906 # be checked for self-intersection prior to the operation.
7907 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7908 # operation should be performed during the operation.
7909 # @param theName Object name; when specified, this parameter is used
7910 # for result publication in the study. Otherwise, if automatic
7911 # publication is switched on, default value is used for result name.
7913 # @note This algorithm doesn't find all types of self-intersections.
7914 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7915 # vertex/face and edge/face intersections. Face/face
7916 # intersections detection is switched off as it is a
7917 # time-consuming operation that gives an impact on performance.
7918 # To find all self-intersections please use
7919 # CheckSelfIntersections() method.
7921 # @return New GEOM.GEOM_Object, containing the result shape.
7923 # @ref tui_fuse "Example 1"
7924 # \n @ref swig_MakeCommon "Example 2"
7925 @ManageTransactions("BoolOp")
7926 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7927 rmExtraEdges=False, theName=None):
7929 Perform Fuse boolean operation on two given shapes.
7932 theShape1 First argument for boolean operation.
7933 theShape2 Second argument for boolean operation.
7934 checkSelfInte The flag that tells if the arguments should
7935 be checked for self-intersection prior to
7937 rmExtraEdges The flag that tells if Remove Extra Edges
7938 operation should be performed during the operation.
7939 theName Object name; when specified, this parameter is used
7940 for result publication in the study. Otherwise, if automatic
7941 publication is switched on, default value is used for result name.
7944 This algorithm doesn't find all types of self-intersections.
7945 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7946 vertex/face and edge/face intersections. Face/face
7947 intersections detection is switched off as it is a
7948 time-consuming operation that gives an impact on performance.
7949 To find all self-intersections please use
7950 CheckSelfIntersections() method.
7953 New GEOM.GEOM_Object, containing the result shape.
7956 # Example: see GEOM_TestOthers.py
7957 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7958 checkSelfInte, rmExtraEdges)
7959 RaiseIfFailed("MakeFuse", self.BoolOp)
7960 self._autoPublish(anObj, theName, "fuse")
7963 ## Perform Section boolean operation on two given shapes.
7964 # @param theShape1 First argument for boolean operation.
7965 # @param theShape2 Second argument for boolean operation.
7966 # @param checkSelfInte The flag that tells if the arguments should
7967 # be checked for self-intersection prior to the operation.
7968 # If a self-intersection detected the operation fails.
7969 # @param theName Object name; when specified, this parameter is used
7970 # for result publication in the study. Otherwise, if automatic
7971 # publication is switched on, default value is used for result name.
7972 # @return New GEOM.GEOM_Object, containing the result shape.
7974 # @ref tui_section "Example 1"
7975 # \n @ref swig_MakeCommon "Example 2"
7976 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7978 Perform Section boolean operation on two given shapes.
7981 theShape1 First argument for boolean operation.
7982 theShape2 Second argument for boolean operation.
7983 checkSelfInte The flag that tells if the arguments should
7984 be checked for self-intersection prior to the operation.
7985 If a self-intersection detected the operation fails.
7986 theName Object name; when specified, this parameter is used
7987 for result publication in the study. Otherwise, if automatic
7988 publication is switched on, default value is used for result name.
7990 New GEOM.GEOM_Object, containing the result shape.
7993 # Example: see GEOM_TestOthers.py
7994 # note: auto-publishing is done in self.MakeBoolean()
7995 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
7997 ## Perform Fuse boolean operation on the list of shapes.
7998 # @param theShapesList Shapes to be fused.
7999 # @param checkSelfInte The flag that tells if the arguments should
8000 # be checked for self-intersection prior to the operation.
8001 # @param rmExtraEdges The flag that tells if Remove Extra Edges
8002 # operation should be performed during the operation.
8003 # @param theName Object name; when specified, this parameter is used
8004 # for result publication in the study. Otherwise, if automatic
8005 # publication is switched on, default value is used for result name.
8007 # @note This algorithm doesn't find all types of self-intersections.
8008 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8009 # vertex/face and edge/face intersections. Face/face
8010 # intersections detection is switched off as it is a
8011 # time-consuming operation that gives an impact on performance.
8012 # To find all self-intersections please use
8013 # CheckSelfIntersections() method.
8015 # @return New GEOM.GEOM_Object, containing the result shape.
8017 # @ref tui_fuse "Example 1"
8018 # \n @ref swig_MakeCommon "Example 2"
8019 @ManageTransactions("BoolOp")
8020 def MakeFuseList(self, theShapesList, checkSelfInte=False,
8021 rmExtraEdges=False, theName=None):
8023 Perform Fuse boolean operation on the list of shapes.
8026 theShapesList Shapes to be fused.
8027 checkSelfInte The flag that tells if the arguments should
8028 be checked for self-intersection prior to
8030 rmExtraEdges The flag that tells if Remove Extra Edges
8031 operation should be performed during the operation.
8032 theName Object name; when specified, this parameter is used
8033 for result publication in the study. Otherwise, if automatic
8034 publication is switched on, default value is used for result name.
8037 This algorithm doesn't find all types of self-intersections.
8038 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8039 vertex/face and edge/face intersections. Face/face
8040 intersections detection is switched off as it is a
8041 time-consuming operation that gives an impact on performance.
8042 To find all self-intersections please use
8043 CheckSelfIntersections() method.
8046 New GEOM.GEOM_Object, containing the result shape.
8049 # Example: see GEOM_TestOthers.py
8050 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8052 RaiseIfFailed("MakeFuseList", self.BoolOp)
8053 self._autoPublish(anObj, theName, "fuse")
8056 ## Perform Common boolean operation on the list of shapes.
8057 # @param theShapesList Shapes for Common operation.
8058 # @param checkSelfInte The flag that tells if the arguments should
8059 # be checked for self-intersection prior to the operation.
8060 # @param theName Object name; when specified, this parameter is used
8061 # for result publication in the study. Otherwise, if automatic
8062 # publication is switched on, default value is used for result name.
8064 # @note This algorithm doesn't find all types of self-intersections.
8065 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8066 # vertex/face and edge/face intersections. Face/face
8067 # intersections detection is switched off as it is a
8068 # time-consuming operation that gives an impact on performance.
8069 # To find all self-intersections please use
8070 # CheckSelfIntersections() method.
8072 # @return New GEOM.GEOM_Object, containing the result shape.
8074 # @ref tui_common "Example 1"
8075 # \n @ref swig_MakeCommon "Example 2"
8076 @ManageTransactions("BoolOp")
8077 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8079 Perform Common boolean operation on the list of shapes.
8082 theShapesList Shapes for Common operation.
8083 checkSelfInte The flag that tells if the arguments should
8084 be checked for self-intersection prior to
8086 theName Object name; when specified, this parameter is used
8087 for result publication in the study. Otherwise, if automatic
8088 publication is switched on, default value is used for result name.
8091 This algorithm doesn't find all types of self-intersections.
8092 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8093 vertex/face and edge/face intersections. Face/face
8094 intersections detection is switched off as it is a
8095 time-consuming operation that gives an impact on performance.
8096 To find all self-intersections please use
8097 CheckSelfIntersections() method.
8100 New GEOM.GEOM_Object, containing the result shape.
8103 # Example: see GEOM_TestOthers.py
8104 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8105 RaiseIfFailed("MakeCommonList", self.BoolOp)
8106 self._autoPublish(anObj, theName, "common")
8109 ## Perform Cut boolean operation on one object and the list of tools.
8110 # @param theMainShape The object of the operation.
8111 # @param theShapesList The list of tools of the operation.
8112 # @param checkSelfInte The flag that tells if the arguments should
8113 # be checked for self-intersection prior to the operation.
8114 # @param theName Object name; when specified, this parameter is used
8115 # for result publication in the study. Otherwise, if automatic
8116 # publication is switched on, default value is used for result name.
8118 # @note This algorithm doesn't find all types of self-intersections.
8119 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8120 # vertex/face and edge/face intersections. Face/face
8121 # intersections detection is switched off as it is a
8122 # time-consuming operation that gives an impact on performance.
8123 # To find all self-intersections please use
8124 # CheckSelfIntersections() method.
8126 # @return New GEOM.GEOM_Object, containing the result shape.
8128 # @ref tui_cut "Example 1"
8129 # \n @ref swig_MakeCommon "Example 2"
8130 @ManageTransactions("BoolOp")
8131 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8133 Perform Cut boolean operation on one object and the list of tools.
8136 theMainShape The object of the operation.
8137 theShapesList The list of tools of the operation.
8138 checkSelfInte The flag that tells if the arguments should
8139 be checked for self-intersection prior to
8141 theName Object name; when specified, this parameter is used
8142 for result publication in the study. Otherwise, if automatic
8143 publication is switched on, default value is used for result name.
8146 This algorithm doesn't find all types of self-intersections.
8147 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8148 vertex/face and edge/face intersections. Face/face
8149 intersections detection is switched off as it is a
8150 time-consuming operation that gives an impact on performance.
8151 To find all self-intersections please use
8152 CheckSelfIntersections() method.
8155 New GEOM.GEOM_Object, containing the result shape.
8158 # Example: see GEOM_TestOthers.py
8159 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8160 RaiseIfFailed("MakeCutList", self.BoolOp)
8161 self._autoPublish(anObj, theName, "cut")
8167 ## @addtogroup l3_basic_op
8170 ## Perform partition operation.
8171 # @param ListShapes Shapes to be intersected.
8172 # @param ListTools Shapes to intersect theShapes.
8173 # @param Limit Type of resulting shapes (see ShapeType()).\n
8174 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8175 # type will be detected automatically.
8176 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8177 # target type (equal to Limit) are kept in the result,
8178 # else standalone shapes of lower dimension
8179 # are kept also (if they exist).
8181 # @param theName Object name; when specified, this parameter is used
8182 # for result publication in the study. Otherwise, if automatic
8183 # publication is switched on, default value is used for result name.
8185 # @note Each compound from ListShapes and ListTools will be exploded
8186 # in order to avoid possible intersection between shapes from this compound.
8188 # After implementation new version of PartitionAlgo (October 2006)
8189 # other parameters are ignored by current functionality. They are kept
8190 # in this function only for support old versions.
8191 # @param ListKeepInside Shapes, outside which the results will be deleted.
8192 # Each shape from theKeepInside must belong to theShapes also.
8193 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8194 # Each shape from theRemoveInside must belong to theShapes also.
8195 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8196 # @param ListMaterials Material indices for each shape. Make sense,
8197 # only if theRemoveWebs is TRUE.
8199 # @return New GEOM.GEOM_Object, containing the result shapes.
8201 # @ref tui_partition "Example"
8202 @ManageTransactions("BoolOp")
8203 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8204 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8205 KeepNonlimitShapes=0, theName=None):
8207 Perform partition operation.
8210 ListShapes Shapes to be intersected.
8211 ListTools Shapes to intersect theShapes.
8212 Limit Type of resulting shapes (see geompy.ShapeType)
8213 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8214 type will be detected automatically.
8215 KeepNonlimitShapes if this parameter == 0, then only shapes of
8216 target type (equal to Limit) are kept in the result,
8217 else standalone shapes of lower dimension
8218 are kept also (if they exist).
8220 theName Object name; when specified, this parameter is used
8221 for result publication in the study. Otherwise, if automatic
8222 publication is switched on, default value is used for result name.
8224 Each compound from ListShapes and ListTools will be exploded
8225 in order to avoid possible intersection between shapes from
8228 After implementation new version of PartitionAlgo (October 2006) other
8229 parameters are ignored by current functionality. They are kept in this
8230 function only for support old versions.
8233 ListKeepInside Shapes, outside which the results will be deleted.
8234 Each shape from theKeepInside must belong to theShapes also.
8235 ListRemoveInside Shapes, inside which the results will be deleted.
8236 Each shape from theRemoveInside must belong to theShapes also.
8237 RemoveWebs If TRUE, perform Glue 3D algorithm.
8238 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8241 New GEOM.GEOM_Object, containing the result shapes.
8243 # Example: see GEOM_TestAll.py
8244 if Limit == self.ShapeType["AUTO"]:
8245 # automatic detection of the most appropriate shape limit type
8247 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8248 Limit = EnumToLong(lim)
8250 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8251 ListKeepInside, ListRemoveInside,
8252 Limit, RemoveWebs, ListMaterials,
8253 KeepNonlimitShapes);
8254 RaiseIfFailed("MakePartition", self.BoolOp)
8255 self._autoPublish(anObj, theName, "partition")
8258 ## Perform partition operation.
8259 # This method may be useful if it is needed to make a partition for
8260 # compound contains nonintersected shapes. Performance will be better
8261 # since intersection between shapes from compound is not performed.
8263 # Description of all parameters as in previous method MakePartition().
8264 # One additional parameter is provided:
8265 # @param checkSelfInte The flag that tells if the arguments should
8266 # be checked for self-intersection prior to the operation.
8268 # @note This algorithm doesn't find all types of self-intersections.
8269 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8270 # vertex/face and edge/face intersections. Face/face
8271 # intersections detection is switched off as it is a
8272 # time-consuming operation that gives an impact on performance.
8273 # To find all self-intersections please use
8274 # CheckSelfIntersections() method.
8276 # @note Passed compounds (via ListShapes or via ListTools)
8277 # have to consist of nonintersecting shapes.
8279 # @return New GEOM.GEOM_Object, containing the result shapes.
8281 # @ref swig_todo "Example"
8282 @ManageTransactions("BoolOp")
8283 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8284 ListKeepInside=[], ListRemoveInside=[],
8285 Limit=ShapeType["AUTO"], RemoveWebs=0,
8286 ListMaterials=[], KeepNonlimitShapes=0,
8287 checkSelfInte=False, theName=None):
8289 Perform partition operation.
8290 This method may be useful if it is needed to make a partition for
8291 compound contains nonintersected shapes. Performance will be better
8292 since intersection between shapes from compound is not performed.
8295 Description of all parameters as in method geompy.MakePartition.
8296 One additional parameter is provided:
8297 checkSelfInte The flag that tells if the arguments should
8298 be checked for self-intersection prior to
8302 This algorithm doesn't find all types of self-intersections.
8303 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8304 vertex/face and edge/face intersections. Face/face
8305 intersections detection is switched off as it is a
8306 time-consuming operation that gives an impact on performance.
8307 To find all self-intersections please use
8308 CheckSelfIntersections() method.
8311 Passed compounds (via ListShapes or via ListTools)
8312 have to consist of nonintersecting shapes.
8315 New GEOM.GEOM_Object, containing the result shapes.
8317 if Limit == self.ShapeType["AUTO"]:
8318 # automatic detection of the most appropriate shape limit type
8320 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8321 Limit = EnumToLong(lim)
8323 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8324 ListKeepInside, ListRemoveInside,
8325 Limit, RemoveWebs, ListMaterials,
8326 KeepNonlimitShapes, checkSelfInte);
8327 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8328 self._autoPublish(anObj, theName, "partition")
8331 ## See method MakePartition() for more information.
8333 # @ref tui_partition "Example 1"
8334 # \n @ref swig_Partition "Example 2"
8335 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8336 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8337 KeepNonlimitShapes=0, theName=None):
8339 See method geompy.MakePartition for more information.
8341 # Example: see GEOM_TestOthers.py
8342 # note: auto-publishing is done in self.MakePartition()
8343 anObj = self.MakePartition(ListShapes, ListTools,
8344 ListKeepInside, ListRemoveInside,
8345 Limit, RemoveWebs, ListMaterials,
8346 KeepNonlimitShapes, theName);
8349 ## Perform partition of the Shape with the Plane
8350 # @param theShape Shape to be intersected.
8351 # @param thePlane Tool shape, to intersect theShape.
8352 # @param theName Object name; when specified, this parameter is used
8353 # for result publication in the study. Otherwise, if automatic
8354 # publication is switched on, default value is used for result name.
8356 # @return New GEOM.GEOM_Object, containing the result shape.
8358 # @note This operation is a shortcut to the more general @ref MakePartition
8359 # operation, where @a theShape specifies single "object" (shape being partitioned)
8360 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8361 # @ref MakePartition operation have default values:
8362 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8363 # - @a KeepNonlimitShapes: 0
8364 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8365 # @a Materials (obsolete parameters): empty
8367 # @note I.e. the following two operations are equivalent:
8369 # Result = geompy.MakeHalfPartition(Object, Plane)
8370 # Result = geompy.MakePartition([Object], [Plane])
8373 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8375 # @ref tui_partition "Example"
8376 @ManageTransactions("BoolOp")
8377 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8379 Perform partition of the Shape with the Plane
8382 theShape Shape to be intersected.
8383 thePlane Tool shape, to intersect theShape.
8384 theName Object name; when specified, this parameter is used
8385 for result publication in the study. Otherwise, if automatic
8386 publication is switched on, default value is used for result name.
8389 New GEOM.GEOM_Object, containing the result shape.
8391 Note: This operation is a shortcut to the more general MakePartition
8392 operation, where theShape specifies single "object" (shape being partitioned)
8393 and thePlane specifies single "tool" (intersector shape). Other parameters of
8394 MakePartition operation have default values:
8395 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8396 - KeepNonlimitShapes: 0
8397 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8399 I.e. the following two operations are equivalent:
8400 Result = geompy.MakeHalfPartition(Object, Plane)
8401 Result = geompy.MakePartition([Object], [Plane])
8403 # Example: see GEOM_TestAll.py
8404 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8405 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8406 self._autoPublish(anObj, theName, "partition")
8409 # end of l3_basic_op
8412 ## @addtogroup l3_transform
8415 ## Translate the given object along the vector, specified
8416 # by its end points.
8417 # @param theObject The object to be translated.
8418 # @param thePoint1 Start point of translation vector.
8419 # @param thePoint2 End point of translation vector.
8420 # @param theCopy Flag used to translate object itself or create a copy.
8421 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8422 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8423 @ManageTransactions("TrsfOp")
8424 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8426 Translate the given object along the vector, specified by its end points.
8429 theObject The object to be translated.
8430 thePoint1 Start point of translation vector.
8431 thePoint2 End point of translation vector.
8432 theCopy Flag used to translate object itself or create a copy.
8435 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8436 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8439 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8441 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8442 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8445 ## Translate the given object along the vector, specified
8446 # by its end points, creating its copy before the translation.
8447 # @param theObject The object to be translated.
8448 # @param thePoint1 Start point of translation vector.
8449 # @param thePoint2 End point of translation vector.
8450 # @param theName Object name; when specified, this parameter is used
8451 # for result publication in the study. Otherwise, if automatic
8452 # publication is switched on, default value is used for result name.
8454 # @return New GEOM.GEOM_Object, containing the translated object.
8456 # @ref tui_translation "Example 1"
8457 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8458 @ManageTransactions("TrsfOp")
8459 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8461 Translate the given object along the vector, specified
8462 by its end points, creating its copy before the translation.
8465 theObject The object to be translated.
8466 thePoint1 Start point of translation vector.
8467 thePoint2 End point of translation vector.
8468 theName Object name; when specified, this parameter is used
8469 for result publication in the study. Otherwise, if automatic
8470 publication is switched on, default value is used for result name.
8473 New GEOM.GEOM_Object, containing the translated object.
8475 # Example: see GEOM_TestAll.py
8476 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8477 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8478 self._autoPublish(anObj, theName, "translated")
8481 ## Translate the given object along the vector, specified by its components.
8482 # @param theObject The object to be translated.
8483 # @param theDX,theDY,theDZ Components of translation vector.
8484 # @param theCopy Flag used to translate object itself or create a copy.
8485 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8486 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8488 # @ref tui_translation "Example"
8489 @ManageTransactions("TrsfOp")
8490 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8492 Translate the given object along the vector, specified by its components.
8495 theObject The object to be translated.
8496 theDX,theDY,theDZ Components of translation vector.
8497 theCopy Flag used to translate object itself or create a copy.
8500 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8501 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8503 # Example: see GEOM_TestAll.py
8504 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8506 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8508 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8509 anObj.SetParameters(Parameters)
8510 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8513 ## Translate the given object along the vector, specified
8514 # by its components, creating its copy before the translation.
8515 # @param theObject The object to be translated.
8516 # @param theDX,theDY,theDZ Components of translation vector.
8517 # @param theName Object name; when specified, this parameter is used
8518 # for result publication in the study. Otherwise, if automatic
8519 # publication is switched on, default value is used for result name.
8521 # @return New GEOM.GEOM_Object, containing the translated object.
8523 # @ref tui_translation "Example"
8524 @ManageTransactions("TrsfOp")
8525 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8527 Translate the given object along the vector, specified
8528 by its components, creating its copy before the translation.
8531 theObject The object to be translated.
8532 theDX,theDY,theDZ Components of translation vector.
8533 theName Object name; when specified, this parameter is used
8534 for result publication in the study. Otherwise, if automatic
8535 publication is switched on, default value is used for result name.
8538 New GEOM.GEOM_Object, containing the translated object.
8540 # Example: see GEOM_TestAll.py
8541 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8542 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8543 anObj.SetParameters(Parameters)
8544 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8545 self._autoPublish(anObj, theName, "translated")
8548 ## Translate the given object along the given vector.
8549 # @param theObject The object to be translated.
8550 # @param theVector The translation vector.
8551 # @param theCopy Flag used to translate object itself or create a copy.
8552 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8553 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8554 @ManageTransactions("TrsfOp")
8555 def TranslateVector(self, theObject, theVector, theCopy=False):
8557 Translate the given object along the given vector.
8560 theObject The object to be translated.
8561 theVector The translation vector.
8562 theCopy Flag used to translate object itself or create a copy.
8565 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8566 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8569 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8571 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8572 RaiseIfFailed("TranslateVector", self.TrsfOp)
8575 ## Translate the given object along the given vector,
8576 # creating its copy before the translation.
8577 # @param theObject The object to be translated.
8578 # @param theVector The translation vector.
8579 # @param theName Object name; when specified, this parameter is used
8580 # for result publication in the study. Otherwise, if automatic
8581 # publication is switched on, default value is used for result name.
8583 # @return New GEOM.GEOM_Object, containing the translated object.
8585 # @ref tui_translation "Example"
8586 @ManageTransactions("TrsfOp")
8587 def MakeTranslationVector(self, theObject, theVector, theName=None):
8589 Translate the given object along the given vector,
8590 creating its copy before the translation.
8593 theObject The object to be translated.
8594 theVector The translation vector.
8595 theName Object name; when specified, this parameter is used
8596 for result publication in the study. Otherwise, if automatic
8597 publication is switched on, default value is used for result name.
8600 New GEOM.GEOM_Object, containing the translated object.
8602 # Example: see GEOM_TestAll.py
8603 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8604 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8605 self._autoPublish(anObj, theName, "translated")
8608 ## Translate the given object along the given vector on given distance.
8609 # @param theObject The object to be translated.
8610 # @param theVector The translation vector.
8611 # @param theDistance The translation distance.
8612 # @param theCopy Flag used to translate object itself or create a copy.
8613 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8614 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8616 # @ref tui_translation "Example"
8617 @ManageTransactions("TrsfOp")
8618 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8620 Translate the given object along the given vector on given distance.
8623 theObject The object to be translated.
8624 theVector The translation vector.
8625 theDistance The translation distance.
8626 theCopy Flag used to translate object itself or create a copy.
8629 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8630 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8632 # Example: see GEOM_TestAll.py
8633 theDistance,Parameters = ParseParameters(theDistance)
8634 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8635 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8636 anObj.SetParameters(Parameters)
8639 ## Translate the given object along the given vector on given distance,
8640 # creating its copy before the translation.
8641 # @param theObject The object to be translated.
8642 # @param theVector The translation vector.
8643 # @param theDistance The translation distance.
8644 # @param theName Object name; when specified, this parameter is used
8645 # for result publication in the study. Otherwise, if automatic
8646 # publication is switched on, default value is used for result name.
8648 # @return New GEOM.GEOM_Object, containing the translated object.
8650 # @ref tui_translation "Example"
8651 @ManageTransactions("TrsfOp")
8652 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8654 Translate the given object along the given vector on given distance,
8655 creating its copy before the translation.
8658 theObject The object to be translated.
8659 theVector The translation vector.
8660 theDistance The translation distance.
8661 theName Object name; when specified, this parameter is used
8662 for result publication in the study. Otherwise, if automatic
8663 publication is switched on, default value is used for result name.
8666 New GEOM.GEOM_Object, containing the translated object.
8668 # Example: see GEOM_TestAll.py
8669 theDistance,Parameters = ParseParameters(theDistance)
8670 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8671 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8672 anObj.SetParameters(Parameters)
8673 self._autoPublish(anObj, theName, "translated")
8676 ## Rotate the given object around the given axis on the given angle.
8677 # @param theObject The object to be rotated.
8678 # @param theAxis Rotation axis.
8679 # @param theAngle Rotation angle in radians.
8680 # @param theCopy Flag used to rotate object itself or create a copy.
8682 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8683 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8685 # @ref tui_rotation "Example"
8686 @ManageTransactions("TrsfOp")
8687 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8689 Rotate the given object around the given axis on the given angle.
8692 theObject The object to be rotated.
8693 theAxis Rotation axis.
8694 theAngle Rotation angle in radians.
8695 theCopy Flag used to rotate object itself or create a copy.
8698 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8699 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8701 # Example: see GEOM_TestAll.py
8703 if isinstance(theAngle,str):
8705 theAngle, Parameters = ParseParameters(theAngle)
8707 theAngle = theAngle*math.pi/180.0
8709 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8711 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8712 RaiseIfFailed("Rotate", self.TrsfOp)
8713 anObj.SetParameters(Parameters)
8716 ## Rotate the given object around the given axis
8717 # on the given angle, creating its copy before the rotation.
8718 # @param theObject The object to be rotated.
8719 # @param theAxis Rotation axis.
8720 # @param theAngle Rotation angle in radians.
8721 # @param theName Object name; when specified, this parameter is used
8722 # for result publication in the study. Otherwise, if automatic
8723 # publication is switched on, default value is used for result name.
8725 # @return New GEOM.GEOM_Object, containing the rotated object.
8727 # @ref tui_rotation "Example"
8728 @ManageTransactions("TrsfOp")
8729 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8731 Rotate the given object around the given axis
8732 on the given angle, creating its copy before the rotatation.
8735 theObject The object to be rotated.
8736 theAxis Rotation axis.
8737 theAngle Rotation angle in radians.
8738 theName Object name; when specified, this parameter is used
8739 for result publication in the study. Otherwise, if automatic
8740 publication is switched on, default value is used for result name.
8743 New GEOM.GEOM_Object, containing the rotated object.
8745 # Example: see GEOM_TestAll.py
8747 if isinstance(theAngle,str):
8749 theAngle, Parameters = ParseParameters(theAngle)
8751 theAngle = theAngle*math.pi/180.0
8752 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8753 RaiseIfFailed("RotateCopy", self.TrsfOp)
8754 anObj.SetParameters(Parameters)
8755 self._autoPublish(anObj, theName, "rotated")
8758 ## Rotate given object around vector perpendicular to plane
8759 # containing three points.
8760 # @param theObject The object to be rotated.
8761 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8762 # containing the three points.
8763 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8764 # @param theCopy Flag used to rotate object itself or create a copy.
8765 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8766 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8767 @ManageTransactions("TrsfOp")
8768 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8770 Rotate given object around vector perpendicular to plane
8771 containing three points.
8774 theObject The object to be rotated.
8775 theCentPoint central point the axis is the vector perpendicular to the plane
8776 containing the three points.
8777 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8778 theCopy Flag used to rotate object itself or create a copy.
8781 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8782 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8785 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8787 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8788 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8791 ## Rotate given object around vector perpendicular to plane
8792 # containing three points, creating its copy before the rotatation.
8793 # @param theObject The object to be rotated.
8794 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8795 # containing the three points.
8796 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8797 # @param theName Object name; when specified, this parameter is used
8798 # for result publication in the study. Otherwise, if automatic
8799 # publication is switched on, default value is used for result name.
8801 # @return New GEOM.GEOM_Object, containing the rotated object.
8803 # @ref tui_rotation "Example"
8804 @ManageTransactions("TrsfOp")
8805 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8807 Rotate given object around vector perpendicular to plane
8808 containing three points, creating its copy before the rotatation.
8811 theObject The object to be rotated.
8812 theCentPoint central point the axis is the vector perpendicular to the plane
8813 containing the three points.
8814 thePoint1,thePoint2 in a perpendicular plane of the axis.
8815 theName Object name; when specified, this parameter is used
8816 for result publication in the study. Otherwise, if automatic
8817 publication is switched on, default value is used for result name.
8820 New GEOM.GEOM_Object, containing the rotated object.
8822 # Example: see GEOM_TestAll.py
8823 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8824 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8825 self._autoPublish(anObj, theName, "rotated")
8828 ## Scale the given object by the specified factor.
8829 # @param theObject The object to be scaled.
8830 # @param thePoint Center point for scaling.
8831 # Passing None for it means scaling relatively the origin of global CS.
8832 # @param theFactor Scaling factor value.
8833 # @param theCopy Flag used to scale object itself or create a copy.
8834 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8835 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8836 @ManageTransactions("TrsfOp")
8837 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8839 Scale the given object by the specified factor.
8842 theObject The object to be scaled.
8843 thePoint Center point for scaling.
8844 Passing None for it means scaling relatively the origin of global CS.
8845 theFactor Scaling factor value.
8846 theCopy Flag used to scale object itself or create a copy.
8849 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8850 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8852 # Example: see GEOM_TestAll.py
8853 theFactor, Parameters = ParseParameters(theFactor)
8855 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8857 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8858 RaiseIfFailed("Scale", self.TrsfOp)
8859 anObj.SetParameters(Parameters)
8862 ## Scale the given object by the factor, creating its copy before the scaling.
8863 # @param theObject The object to be scaled.
8864 # @param thePoint Center point for scaling.
8865 # Passing None for it means scaling relatively the origin of global CS.
8866 # @param theFactor Scaling factor value.
8867 # @param theName Object name; when specified, this parameter is used
8868 # for result publication in the study. Otherwise, if automatic
8869 # publication is switched on, default value is used for result name.
8871 # @return New GEOM.GEOM_Object, containing the scaled shape.
8873 # @ref tui_scale "Example"
8874 @ManageTransactions("TrsfOp")
8875 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8877 Scale the given object by the factor, creating its copy before the scaling.
8880 theObject The object to be scaled.
8881 thePoint Center point for scaling.
8882 Passing None for it means scaling relatively the origin of global CS.
8883 theFactor Scaling factor value.
8884 theName Object name; when specified, this parameter is used
8885 for result publication in the study. Otherwise, if automatic
8886 publication is switched on, default value is used for result name.
8889 New GEOM.GEOM_Object, containing the scaled shape.
8891 # Example: see GEOM_TestAll.py
8892 theFactor, Parameters = ParseParameters(theFactor)
8893 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8894 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8895 anObj.SetParameters(Parameters)
8896 self._autoPublish(anObj, theName, "scaled")
8899 ## Scale the given object by different factors along coordinate axes.
8900 # @param theObject The object to be scaled.
8901 # @param thePoint Center point for scaling.
8902 # Passing None for it means scaling relatively the origin of global CS.
8903 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8904 # @param theCopy Flag used to scale object itself or create a copy.
8905 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8906 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8907 @ManageTransactions("TrsfOp")
8908 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8910 Scale the given object by different factors along coordinate axes.
8913 theObject The object to be scaled.
8914 thePoint Center point for scaling.
8915 Passing None for it means scaling relatively the origin of global CS.
8916 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8917 theCopy Flag used to scale object itself or create a copy.
8920 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8921 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8923 # Example: see GEOM_TestAll.py
8924 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8926 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8927 theFactorX, theFactorY, theFactorZ)
8929 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8930 theFactorX, theFactorY, theFactorZ)
8931 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8932 anObj.SetParameters(Parameters)
8935 ## Scale the given object by different factors along coordinate axes,
8936 # creating its copy before the scaling.
8937 # @param theObject The object to be scaled.
8938 # @param thePoint Center point for scaling.
8939 # Passing None for it means scaling relatively the origin of global CS.
8940 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8941 # @param theName Object name; when specified, this parameter is used
8942 # for result publication in the study. Otherwise, if automatic
8943 # publication is switched on, default value is used for result name.
8945 # @return New GEOM.GEOM_Object, containing the scaled shape.
8947 # @ref swig_scale "Example"
8948 @ManageTransactions("TrsfOp")
8949 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8951 Scale the given object by different factors along coordinate axes,
8952 creating its copy before the scaling.
8955 theObject The object to be scaled.
8956 thePoint Center point for scaling.
8957 Passing None for it means scaling relatively the origin of global CS.
8958 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8959 theName Object name; when specified, this parameter is used
8960 for result publication in the study. Otherwise, if automatic
8961 publication is switched on, default value is used for result name.
8964 New GEOM.GEOM_Object, containing the scaled shape.
8966 # Example: see GEOM_TestAll.py
8967 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8968 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8969 theFactorX, theFactorY, theFactorZ)
8970 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8971 anObj.SetParameters(Parameters)
8972 self._autoPublish(anObj, theName, "scaled")
8975 ## Mirror an object relatively the given plane.
8976 # @param theObject The object to be mirrored.
8977 # @param thePlane Plane of symmetry.
8978 # @param theCopy Flag used to mirror object itself or create a copy.
8979 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8980 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8981 @ManageTransactions("TrsfOp")
8982 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8984 Mirror an object relatively the given plane.
8987 theObject The object to be mirrored.
8988 thePlane Plane of symmetry.
8989 theCopy Flag used to mirror object itself or create a copy.
8992 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8993 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
8996 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
8998 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
8999 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
9002 ## Create an object, symmetrical
9003 # to the given one relatively the given plane.
9004 # @param theObject The object to be mirrored.
9005 # @param thePlane Plane of symmetry.
9006 # @param theName Object name; when specified, this parameter is used
9007 # for result publication in the study. Otherwise, if automatic
9008 # publication is switched on, default value is used for result name.
9010 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9012 # @ref tui_mirror "Example"
9013 @ManageTransactions("TrsfOp")
9014 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9016 Create an object, symmetrical to the given one relatively the given plane.
9019 theObject The object to be mirrored.
9020 thePlane Plane of symmetry.
9021 theName Object name; when specified, this parameter is used
9022 for result publication in the study. Otherwise, if automatic
9023 publication is switched on, default value is used for result name.
9026 New GEOM.GEOM_Object, containing the mirrored shape.
9028 # Example: see GEOM_TestAll.py
9029 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9030 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9031 self._autoPublish(anObj, theName, "mirrored")
9034 ## Mirror an object relatively the given axis.
9035 # @param theObject The object to be mirrored.
9036 # @param theAxis Axis of symmetry.
9037 # @param theCopy Flag used to mirror object itself or create a copy.
9038 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9039 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9040 @ManageTransactions("TrsfOp")
9041 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9043 Mirror an object relatively the given axis.
9046 theObject The object to be mirrored.
9047 theAxis Axis of symmetry.
9048 theCopy Flag used to mirror object itself or create a copy.
9051 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9052 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9055 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9057 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9058 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9061 ## Create an object, symmetrical
9062 # to the given one relatively the given axis.
9063 # @param theObject The object to be mirrored.
9064 # @param theAxis Axis of symmetry.
9065 # @param theName Object name; when specified, this parameter is used
9066 # for result publication in the study. Otherwise, if automatic
9067 # publication is switched on, default value is used for result name.
9069 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9071 # @ref tui_mirror "Example"
9072 @ManageTransactions("TrsfOp")
9073 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9075 Create an object, symmetrical to the given one relatively the given axis.
9078 theObject The object to be mirrored.
9079 theAxis Axis of symmetry.
9080 theName Object name; when specified, this parameter is used
9081 for result publication in the study. Otherwise, if automatic
9082 publication is switched on, default value is used for result name.
9085 New GEOM.GEOM_Object, containing the mirrored shape.
9087 # Example: see GEOM_TestAll.py
9088 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9089 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9090 self._autoPublish(anObj, theName, "mirrored")
9093 ## Mirror an object relatively the given point.
9094 # @param theObject The object to be mirrored.
9095 # @param thePoint Point of symmetry.
9096 # @param theCopy Flag used to mirror object itself or create a copy.
9097 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9098 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9099 @ManageTransactions("TrsfOp")
9100 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9102 Mirror an object relatively the given point.
9105 theObject The object to be mirrored.
9106 thePoint Point of symmetry.
9107 theCopy Flag used to mirror object itself or create a copy.
9110 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9111 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9113 # Example: see GEOM_TestAll.py
9115 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9117 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9118 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9121 ## Create an object, symmetrical
9122 # to the given one relatively the given point.
9123 # @param theObject The object to be mirrored.
9124 # @param thePoint Point of symmetry.
9125 # @param theName Object name; when specified, this parameter is used
9126 # for result publication in the study. Otherwise, if automatic
9127 # publication is switched on, default value is used for result name.
9129 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9131 # @ref tui_mirror "Example"
9132 @ManageTransactions("TrsfOp")
9133 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9135 Create an object, symmetrical
9136 to the given one relatively the given point.
9139 theObject The object to be mirrored.
9140 thePoint Point of symmetry.
9141 theName Object name; when specified, this parameter is used
9142 for result publication in the study. Otherwise, if automatic
9143 publication is switched on, default value is used for result name.
9146 New GEOM.GEOM_Object, containing the mirrored shape.
9148 # Example: see GEOM_TestAll.py
9149 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9150 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9151 self._autoPublish(anObj, theName, "mirrored")
9154 ## Modify the location of the given object.
9155 # @param theObject The object to be displaced.
9156 # @param theStartLCS Coordinate system to perform displacement from it.\n
9157 # If \a theStartLCS is NULL, displacement
9158 # will be performed from global CS.\n
9159 # If \a theObject itself is used as \a theStartLCS,
9160 # its location will be changed to \a theEndLCS.
9161 # @param theEndLCS Coordinate system to perform displacement to it.
9162 # @param theCopy Flag used to displace object itself or create a copy.
9163 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9164 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9165 @ManageTransactions("TrsfOp")
9166 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9168 Modify the Location of the given object by LCS, creating its copy before the setting.
9171 theObject The object to be displaced.
9172 theStartLCS Coordinate system to perform displacement from it.
9173 If theStartLCS is NULL, displacement
9174 will be performed from global CS.
9175 If theObject itself is used as theStartLCS,
9176 its location will be changed to theEndLCS.
9177 theEndLCS Coordinate system to perform displacement to it.
9178 theCopy Flag used to displace object itself or create a copy.
9181 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9182 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9184 # Example: see GEOM_TestAll.py
9186 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9188 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9189 RaiseIfFailed("Displace", self.TrsfOp)
9192 ## Modify the Location of the given object by LCS,
9193 # creating its copy before the setting.
9194 # @param theObject The object to be displaced.
9195 # @param theStartLCS Coordinate system to perform displacement from it.\n
9196 # If \a theStartLCS is NULL, displacement
9197 # will be performed from global CS.\n
9198 # If \a theObject itself is used as \a theStartLCS,
9199 # its location will be changed to \a theEndLCS.
9200 # @param theEndLCS Coordinate system to perform displacement to it.
9201 # @param theName Object name; when specified, this parameter is used
9202 # for result publication in the study. Otherwise, if automatic
9203 # publication is switched on, default value is used for result name.
9205 # @return New GEOM.GEOM_Object, containing the displaced shape.
9207 # @ref tui_modify_location "Example"
9208 @ManageTransactions("TrsfOp")
9209 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9211 Modify the Location of the given object by LCS, creating its copy before the setting.
9214 theObject The object to be displaced.
9215 theStartLCS Coordinate system to perform displacement from it.
9216 If theStartLCS is NULL, displacement
9217 will be performed from global CS.
9218 If theObject itself is used as theStartLCS,
9219 its location will be changed to theEndLCS.
9220 theEndLCS Coordinate system to perform displacement to it.
9221 theName Object name; when specified, this parameter is used
9222 for result publication in the study. Otherwise, if automatic
9223 publication is switched on, default value is used for result name.
9226 New GEOM.GEOM_Object, containing the displaced shape.
9229 # create local coordinate systems
9230 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9231 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9232 # modify the location of the given object
9233 position = geompy.MakePosition(cylinder, cs1, cs2)
9235 # Example: see GEOM_TestAll.py
9236 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9237 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9238 self._autoPublish(anObj, theName, "displaced")
9241 ## Modify the Location of the given object by Path.
9242 # @param theObject The object to be displaced.
9243 # @param thePath Wire or Edge along that the object will be translated.
9244 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9245 # @param theCopy is to create a copy objects if true.
9246 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9247 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9248 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9250 # @ref tui_modify_location "Example"
9251 @ManageTransactions("TrsfOp")
9252 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9254 Modify the Location of the given object by Path.
9257 theObject The object to be displaced.
9258 thePath Wire or Edge along that the object will be translated.
9259 theDistance progress of Path (0 = start location, 1 = end of path location).
9260 theCopy is to create a copy objects if true.
9261 theReverse 0 - for usual direction, 1 - to reverse path direction.
9264 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9265 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9268 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9270 # Example: see GEOM_TestAll.py
9271 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9272 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9275 ## Modify the Location of the given object by Path, creating its copy before the operation.
9276 # @param theObject The object to be displaced.
9277 # @param thePath Wire or Edge along that the object will be translated.
9278 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9279 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9280 # @param theName Object name; when specified, this parameter is used
9281 # for result publication in the study. Otherwise, if automatic
9282 # publication is switched on, default value is used for result name.
9284 # @return New GEOM.GEOM_Object, containing the displaced shape.
9285 @ManageTransactions("TrsfOp")
9286 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9288 Modify the Location of the given object by Path, creating its copy before the operation.
9291 theObject The object to be displaced.
9292 thePath Wire or Edge along that the object will be translated.
9293 theDistance progress of Path (0 = start location, 1 = end of path location).
9294 theReverse 0 - for usual direction, 1 - to reverse path direction.
9295 theName Object name; when specified, this parameter is used
9296 for result publication in the study. Otherwise, if automatic
9297 publication is switched on, default value is used for result name.
9300 New GEOM.GEOM_Object, containing the displaced shape.
9302 # Example: see GEOM_TestAll.py
9303 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9304 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9305 self._autoPublish(anObj, theName, "displaced")
9308 ## Offset given shape.
9309 # @param theObject The base object for the offset.
9310 # @param theOffset Offset value.
9311 # @param theCopy Flag used to offset object itself or create a copy.
9312 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9313 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9314 @ManageTransactions("TrsfOp")
9315 def Offset(self, theObject, theOffset, theCopy=False):
9320 theObject The base object for the offset.
9321 theOffset Offset value.
9322 theCopy Flag used to offset object itself or create a copy.
9325 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9326 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9328 theOffset, Parameters = ParseParameters(theOffset)
9330 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9332 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9333 RaiseIfFailed("Offset", self.TrsfOp)
9334 anObj.SetParameters(Parameters)
9337 ## Create new object as offset of the given one. Gap between two adjacent
9338 # offset surfaces is filled by a pipe.
9339 # @param theObject The base object for the offset.
9340 # @param theOffset Offset value.
9341 # @param theName Object name; when specified, this parameter is used
9342 # for result publication in the study. Otherwise, if automatic
9343 # publication is switched on, default value is used for result name.
9345 # @return New GEOM.GEOM_Object, containing the offset object.
9347 # @sa MakeOffsetIntersectionJoin
9348 # @ref tui_offset "Example"
9349 @ManageTransactions("TrsfOp")
9350 def MakeOffset(self, theObject, theOffset, theName=None):
9352 Create new object as offset of the given one. Gap between adjacent
9353 offset surfaces is filled by a pipe.
9356 theObject The base object for the offset.
9357 theOffset Offset value.
9358 theName Object name; when specified, this parameter is used
9359 for result publication in the study. Otherwise, if automatic
9360 publication is switched on, default value is used for result name.
9363 New GEOM.GEOM_Object, containing the offset object.
9366 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9367 # create a new object as offset of the given object
9368 offset = geompy.MakeOffset(box, 70.)
9370 # Example: see GEOM_TestAll.py
9371 theOffset, Parameters = ParseParameters(theOffset)
9372 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9373 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9374 anObj.SetParameters(Parameters)
9375 self._autoPublish(anObj, theName, "offset")
9378 ## Create new object as offset of the given one. Gap between adjacent
9379 # offset surfaces is filled by extending and intersecting them.
9380 # @param theObject The base object for the offset.
9381 # @param theOffset Offset value.
9382 # @param theName Object name; when specified, this parameter is used
9383 # for result publication in the study. Otherwise, if automatic
9384 # publication is switched on, default value is used for result name.
9386 # @return New GEOM.GEOM_Object, containing the offset object.
9389 # @ref tui_offset "Example"
9390 @ManageTransactions("TrsfOp")
9391 def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9393 Create new object as offset of the given one. Gap between adjacent
9394 offset surfaces is filled by extending and intersecting them.
9397 theObject The base object for the offset.
9398 theOffset Offset value.
9399 theName Object name; when specified, this parameter is used
9400 for result publication in the study. Otherwise, if automatic
9401 publication is switched on, default value is used for result name.
9404 New GEOM.GEOM_Object, containing the offset object.
9407 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9408 # create a new box extended by 70
9409 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9411 # Example: see GEOM_TestAll.py
9412 theOffset, Parameters = ParseParameters( theOffset )
9413 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9414 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9415 anObj.SetParameters(Parameters)
9416 self._autoPublish(anObj, theName, "offset")
9419 ## Create new object as projection of the given one on another.
9420 # @param theSource The source object for the projection. It can be a point, edge or wire.
9421 # Edge and wire are acceptable if @a theTarget is a face.
9422 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9423 # @param theName Object name; when specified, this parameter is used
9424 # for result publication in the study. Otherwise, if automatic
9425 # publication is switched on, default value is used for result name.
9427 # @return New GEOM.GEOM_Object, containing the projection.
9429 # @ref tui_projection "Example"
9430 @ManageTransactions("TrsfOp")
9431 def MakeProjection(self, theSource, theTarget, theName=None):
9433 Create new object as projection of the given one on another.
9436 theSource The source object for the projection. It can be a point, edge or wire.
9437 Edge and wire are acceptable if theTarget is a face.
9438 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9439 theName Object name; when specified, this parameter is used
9440 for result publication in the study. Otherwise, if automatic
9441 publication is switched on, default value is used for result name.
9444 New GEOM.GEOM_Object, containing the projection.
9446 # Example: see GEOM_TestAll.py
9447 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9448 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9449 self._autoPublish(anObj, theName, "projection")
9452 ## Create a projection of the given point on a wire or an edge.
9453 # If there are no solutions or there are 2 or more solutions It throws an
9455 # @param thePoint the point to be projected.
9456 # @param theWire the wire. The edge is accepted as well.
9457 # @param theName Object name; when specified, this parameter is used
9458 # for result publication in the study. Otherwise, if automatic
9459 # publication is switched on, default value is used for result name.
9461 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9462 # \n \a u: The parameter of projection point on edge.
9463 # \n \a PointOnEdge: The projection point.
9464 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9466 # @ref tui_projection "Example"
9467 @ManageTransactions("TrsfOp")
9468 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9470 Create a projection of the given point on a wire or an edge.
9471 If there are no solutions or there are 2 or more solutions It throws an
9475 thePoint the point to be projected.
9476 theWire the wire. The edge is accepted as well.
9477 theName Object name; when specified, this parameter is used
9478 for result publication in the study. Otherwise, if automatic
9479 publication is switched on, default value is used for result name.
9482 [u, PointOnEdge, EdgeInWireIndex]
9483 u: The parameter of projection point on edge.
9484 PointOnEdge: The projection point.
9485 EdgeInWireIndex: The index of an edge in a wire.
9487 # Example: see GEOM_TestAll.py
9488 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9489 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9490 self._autoPublish(anObj[1], theName, "projection")
9493 # -----------------------------------------------------------------------------
9495 # -----------------------------------------------------------------------------
9497 ## Translate the given object along the given vector a given number times
9498 # @param theObject The object to be translated.
9499 # @param theVector Direction of the translation. DX if None.
9500 # @param theStep Distance to translate on.
9501 # @param theNbTimes Quantity of translations to be done.
9502 # @param theName Object name; when specified, this parameter is used
9503 # for result publication in the study. Otherwise, if automatic
9504 # publication is switched on, default value is used for result name.
9506 # @return New GEOM.GEOM_Object, containing compound of all
9507 # the shapes, obtained after each translation.
9509 # @ref tui_multi_translation "Example"
9510 @ManageTransactions("TrsfOp")
9511 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9513 Translate the given object along the given vector a given number times
9516 theObject The object to be translated.
9517 theVector Direction of the translation. DX if None.
9518 theStep Distance to translate on.
9519 theNbTimes Quantity of translations to be done.
9520 theName Object name; when specified, this parameter is used
9521 for result publication in the study. Otherwise, if automatic
9522 publication is switched on, default value is used for result name.
9525 New GEOM.GEOM_Object, containing compound of all
9526 the shapes, obtained after each translation.
9529 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9531 # Example: see GEOM_TestAll.py
9532 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9533 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9534 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9535 anObj.SetParameters(Parameters)
9536 self._autoPublish(anObj, theName, "multitranslation")
9539 ## Conseqently apply two specified translations to theObject specified number of times.
9540 # @param theObject The object to be translated.
9541 # @param theVector1 Direction of the first translation. DX if None.
9542 # @param theStep1 Step of the first translation.
9543 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9544 # @param theVector2 Direction of the second translation. DY if None.
9545 # @param theStep2 Step of the second translation.
9546 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9547 # @param theName Object name; when specified, this parameter is used
9548 # for result publication in the study. Otherwise, if automatic
9549 # publication is switched on, default value is used for result name.
9551 # @return New GEOM.GEOM_Object, containing compound of all
9552 # the shapes, obtained after each translation.
9554 # @ref tui_multi_translation "Example"
9555 @ManageTransactions("TrsfOp")
9556 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9557 theVector2, theStep2, theNbTimes2, theName=None):
9559 Conseqently apply two specified translations to theObject specified number of times.
9562 theObject The object to be translated.
9563 theVector1 Direction of the first translation. DX if None.
9564 theStep1 Step of the first translation.
9565 theNbTimes1 Quantity of translations to be done along theVector1.
9566 theVector2 Direction of the second translation. DY if None.
9567 theStep2 Step of the second translation.
9568 theNbTimes2 Quantity of translations to be done along theVector2.
9569 theName Object name; when specified, this parameter is used
9570 for result publication in the study. Otherwise, if automatic
9571 publication is switched on, default value is used for result name.
9574 New GEOM.GEOM_Object, containing compound of all
9575 the shapes, obtained after each translation.
9578 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9580 # Example: see GEOM_TestAll.py
9581 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9582 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9583 theVector2, theStep2, theNbTimes2)
9584 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9585 anObj.SetParameters(Parameters)
9586 self._autoPublish(anObj, theName, "multitranslation")
9589 ## Rotate the given object around the given axis a given number times.
9590 # Rotation angle will be 2*PI/theNbTimes.
9591 # @param theObject The object to be rotated.
9592 # @param theAxis The rotation axis. DZ if None.
9593 # @param theNbTimes Quantity of rotations to be done.
9594 # @param theName Object name; when specified, this parameter is used
9595 # for result publication in the study. Otherwise, if automatic
9596 # publication is switched on, default value is used for result name.
9598 # @return New GEOM.GEOM_Object, containing compound of all the
9599 # shapes, obtained after each rotation.
9601 # @ref tui_multi_rotation "Example"
9602 @ManageTransactions("TrsfOp")
9603 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9605 Rotate the given object around the given axis a given number times.
9606 Rotation angle will be 2*PI/theNbTimes.
9609 theObject The object to be rotated.
9610 theAxis The rotation axis. DZ if None.
9611 theNbTimes Quantity of rotations to be done.
9612 theName Object name; when specified, this parameter is used
9613 for result publication in the study. Otherwise, if automatic
9614 publication is switched on, default value is used for result name.
9617 New GEOM.GEOM_Object, containing compound of all the
9618 shapes, obtained after each rotation.
9621 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9623 # Example: see GEOM_TestAll.py
9624 theNbTimes, Parameters = ParseParameters(theNbTimes)
9625 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9626 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9627 anObj.SetParameters(Parameters)
9628 self._autoPublish(anObj, theName, "multirotation")
9631 ## Rotate the given object around the given axis
9632 # a given number times on the given angle.
9633 # @param theObject The object to be rotated.
9634 # @param theAxis The rotation axis. DZ if None.
9635 # @param theAngleStep Rotation angle in radians.
9636 # @param theNbTimes Quantity of rotations to be done.
9637 # @param theName Object name; when specified, this parameter is used
9638 # for result publication in the study. Otherwise, if automatic
9639 # publication is switched on, default value is used for result name.
9641 # @return New GEOM.GEOM_Object, containing compound of all the
9642 # shapes, obtained after each rotation.
9644 # @ref tui_multi_rotation "Example"
9645 @ManageTransactions("TrsfOp")
9646 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9648 Rotate the given object around the given axis
9649 a given number times on the given angle.
9652 theObject The object to be rotated.
9653 theAxis The rotation axis. DZ if None.
9654 theAngleStep Rotation angle in radians.
9655 theNbTimes Quantity of rotations to be done.
9656 theName Object name; when specified, this parameter is used
9657 for result publication in the study. Otherwise, if automatic
9658 publication is switched on, default value is used for result name.
9661 New GEOM.GEOM_Object, containing compound of all the
9662 shapes, obtained after each rotation.
9665 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9667 # Example: see GEOM_TestAll.py
9668 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9669 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9670 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9671 anObj.SetParameters(Parameters)
9672 self._autoPublish(anObj, theName, "multirotation")
9675 ## Rotate the given object around the given axis a given
9676 # number times and multi-translate each rotation result.
9677 # Rotation angle will be 2*PI/theNbTimes1.
9678 # Translation direction passes through center of gravity
9679 # of rotated shape and its projection on the rotation axis.
9680 # @param theObject The object to be rotated.
9681 # @param theAxis Rotation axis. DZ if None.
9682 # @param theNbTimes1 Quantity of rotations to be done.
9683 # @param theRadialStep Translation distance.
9684 # @param theNbTimes2 Quantity of translations to be done.
9685 # @param theName Object name; when specified, this parameter is used
9686 # for result publication in the study. Otherwise, if automatic
9687 # publication is switched on, default value is used for result name.
9689 # @return New GEOM.GEOM_Object, containing compound of all the
9690 # shapes, obtained after each transformation.
9692 # @ref tui_multi_rotation "Example"
9693 @ManageTransactions("TrsfOp")
9694 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9696 Rotate the given object around the
9697 given axis on the given angle a given number
9698 times and multi-translate each rotation result.
9699 Translation direction passes through center of gravity
9700 of rotated shape and its projection on the rotation axis.
9703 theObject The object to be rotated.
9704 theAxis Rotation axis. DZ if None.
9705 theNbTimes1 Quantity of rotations to be done.
9706 theRadialStep Translation distance.
9707 theNbTimes2 Quantity of translations to be done.
9708 theName Object name; when specified, this parameter is used
9709 for result publication in the study. Otherwise, if automatic
9710 publication is switched on, default value is used for result name.
9713 New GEOM.GEOM_Object, containing compound of all the
9714 shapes, obtained after each transformation.
9717 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9719 # Example: see GEOM_TestAll.py
9720 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9721 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9722 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9723 anObj.SetParameters(Parameters)
9724 self._autoPublish(anObj, theName, "multirotation")
9727 ## Rotate the given object around the
9728 # given axis on the given angle a given number
9729 # times and multi-translate each rotation result.
9730 # Translation direction passes through center of gravity
9731 # of rotated shape and its projection on the rotation axis.
9732 # @param theObject The object to be rotated.
9733 # @param theAxis Rotation axis. DZ if None.
9734 # @param theAngleStep Rotation angle in radians.
9735 # @param theNbTimes1 Quantity of rotations to be done.
9736 # @param theRadialStep Translation distance.
9737 # @param theNbTimes2 Quantity of translations to be done.
9738 # @param theName Object name; when specified, this parameter is used
9739 # for result publication in the study. Otherwise, if automatic
9740 # publication is switched on, default value is used for result name.
9742 # @return New GEOM.GEOM_Object, containing compound of all the
9743 # shapes, obtained after each transformation.
9745 # @ref tui_multi_rotation "Example"
9746 @ManageTransactions("TrsfOp")
9747 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9749 Rotate the given object around the
9750 given axis on the given angle a given number
9751 times and multi-translate each rotation result.
9752 Translation direction passes through center of gravity
9753 of rotated shape and its projection on the rotation axis.
9756 theObject The object to be rotated.
9757 theAxis Rotation axis. DZ if None.
9758 theAngleStep Rotation angle in radians.
9759 theNbTimes1 Quantity of rotations to be done.
9760 theRadialStep Translation distance.
9761 theNbTimes2 Quantity of translations to be done.
9762 theName Object name; when specified, this parameter is used
9763 for result publication in the study. Otherwise, if automatic
9764 publication is switched on, default value is used for result name.
9767 New GEOM.GEOM_Object, containing compound of all the
9768 shapes, obtained after each transformation.
9771 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9773 # Example: see GEOM_TestAll.py
9774 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9775 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9776 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9777 anObj.SetParameters(Parameters)
9778 self._autoPublish(anObj, theName, "multirotation")
9781 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9783 # @ref swig_MakeMultiRotation "Example"
9784 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9786 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9789 pz = geompy.MakeVertex(0, 0, 100)
9790 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9791 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9793 # Example: see GEOM_TestOthers.py
9794 aVec = self.MakeLine(aPoint,aDir)
9795 # note: auto-publishing is done in self.MultiRotate1D()
9796 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9799 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9801 # @ref swig_MakeMultiRotation "Example"
9802 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9804 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9807 pz = geompy.MakeVertex(0, 0, 100)
9808 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9809 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9811 # Example: see GEOM_TestOthers.py
9812 aVec = self.MakeLine(aPoint,aDir)
9813 # note: auto-publishing is done in self.MultiRotate1D()
9814 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9817 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9819 # @ref swig_MakeMultiRotation "Example"
9820 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9822 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9825 pz = geompy.MakeVertex(0, 0, 100)
9826 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9827 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9829 # Example: see GEOM_TestOthers.py
9830 aVec = self.MakeLine(aPoint,aDir)
9831 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9832 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9835 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9837 # @ref swig_MakeMultiRotation "Example"
9838 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9840 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9843 pz = geompy.MakeVertex(0, 0, 100)
9844 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9845 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9847 # Example: see GEOM_TestOthers.py
9848 aVec = self.MakeLine(aPoint,aDir)
9849 # note: auto-publishing is done in self.MultiRotate2D()
9850 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9854 # Compute a wire or a face that represents a projection of the source
9855 # shape onto cylinder. The cylinder's coordinate system is the same
9856 # as the global coordinate system.
9858 # @param theObject The object to be projected. It can be either
9859 # a planar wire or a face.
9860 # @param theRadius The radius of the cylinder.
9861 # @param theStartAngle The starting angle in radians from
9862 # the cylinder's X axis around Z axis. The angle from which
9863 # the projection is started.
9864 # @param theAngleLength The projection length angle in radians.
9865 # The angle in which to project the total length of the wire.
9866 # If it is negative the projection is not scaled and natural
9867 # wire length is kept for the projection.
9868 # @param theAngleRotation The desired angle in radians between
9869 # the tangent vector to the first curve at the first point of
9870 # the theObject's projection in 2D space and U-direction of
9871 # cylinder's 2D space.
9872 # @param theName Object name; when specified, this parameter is used
9873 # for result publication in the study. Otherwise, if automatic
9874 # publication is switched on, default value is used for result name.
9876 # @return New GEOM.GEOM_Object, containing the result shape. The result
9877 # represents a wire or a face that represents a projection of
9878 # the source shape onto a cylinder.
9880 # @ref tui_projection "Example"
9881 def MakeProjectionOnCylinder (self, theObject, theRadius,
9882 theStartAngle=0.0, theAngleLength=-1.0,
9883 theAngleRotation=0.0,
9886 Compute a wire or a face that represents a projection of the source
9887 shape onto cylinder. The cylinder's coordinate system is the same
9888 as the global coordinate system.
9891 theObject The object to be projected. It can be either
9892 a planar wire or a face.
9893 theRadius The radius of the cylinder.
9894 theStartAngle The starting angle in radians from the cylinder's X axis
9895 around Z axis. The angle from which the projection is started.
9896 theAngleLength The projection length angle in radians. The angle in which
9897 to project the total length of the wire. If it is negative the
9898 projection is not scaled and natural wire length is kept for
9900 theAngleRotation The desired angle in radians between
9901 the tangent vector to the first curve at the first
9902 point of the theObject's projection in 2D space and
9903 U-direction of cylinder's 2D space.
9904 theName Object name; when specified, this parameter is used
9905 for result publication in the study. Otherwise, if automatic
9906 publication is switched on, default value is used for result name.
9909 New GEOM.GEOM_Object, containing the result shape. The result
9910 represents a wire or a face that represents a projection of
9911 the source shape onto a cylinder.
9913 # Example: see GEOM_TestAll.py
9914 flagStartAngle = False
9915 if isinstance(theStartAngle,str):
9916 flagStartAngle = True
9917 flagAngleLength = False
9918 if isinstance(theAngleLength,str):
9919 flagAngleLength = True
9920 flagAngleRotation = False
9921 if isinstance(theAngleRotation,str):
9922 flagAngleRotation = True
9923 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9924 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9926 theStartAngle = theStartAngle*math.pi/180.
9928 theAngleLength = theAngleLength*math.pi/180.
9929 if flagAngleRotation:
9930 theAngleRotation = theAngleRotation*math.pi/180.
9931 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9932 theStartAngle, theAngleLength, theAngleRotation)
9933 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9934 anObj.SetParameters(Parameters)
9935 self._autoPublish(anObj, theName, "projection")
9938 # end of l3_transform
9941 ## @addtogroup l3_transform_d
9944 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9945 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9947 Deprecated method. Use MultiRotate1DNbTimes instead.
9949 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9950 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9952 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9953 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9954 @ManageTransactions("TrsfOp")
9955 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9957 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9958 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9961 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9963 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9964 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9965 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9966 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9967 anObj.SetParameters(Parameters)
9968 self._autoPublish(anObj, theName, "multirotation")
9971 ## The same, as MultiRotate1D(), but axis is given by direction and point
9972 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9973 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9975 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9976 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9979 pz = geompy.MakeVertex(0, 0, 100)
9980 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9981 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9983 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9984 aVec = self.MakeLine(aPoint,aDir)
9985 # note: auto-publishing is done in self.MultiRotate1D()
9986 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9989 ## The same, as MultiRotate2D(), but axis is given by direction and point
9990 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9991 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9993 The same, as MultiRotate2D(), but axis is given by direction and point
9994 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9997 pz = geompy.MakeVertex(0, 0, 100)
9998 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9999 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
10001 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
10002 aVec = self.MakeLine(aPoint,aDir)
10003 # note: auto-publishing is done in self.MultiRotate2D()
10004 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10007 # end of l3_transform_d
10010 ## @addtogroup l3_local
10013 ## Perform a fillet on all edges of the given shape.
10014 # @param theShape Shape, to perform fillet on.
10015 # @param theR Fillet radius.
10016 # @param theName Object name; when specified, this parameter is used
10017 # for result publication in the study. Otherwise, if automatic
10018 # publication is switched on, default value is used for result name.
10020 # @return New GEOM.GEOM_Object, containing the result shape.
10022 # @ref tui_fillet "Example 1"
10023 # \n @ref swig_MakeFilletAll "Example 2"
10024 @ManageTransactions("LocalOp")
10025 def MakeFilletAll(self, theShape, theR, theName=None):
10027 Perform a fillet on all edges of the given shape.
10030 theShape Shape, to perform fillet on.
10031 theR Fillet radius.
10032 theName Object name; when specified, this parameter is used
10033 for result publication in the study. Otherwise, if automatic
10034 publication is switched on, default value is used for result name.
10037 New GEOM.GEOM_Object, containing the result shape.
10040 filletall = geompy.MakeFilletAll(prism, 10.)
10042 # Example: see GEOM_TestOthers.py
10043 theR,Parameters = ParseParameters(theR)
10044 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10045 RaiseIfFailed("MakeFilletAll", self.LocalOp)
10046 anObj.SetParameters(Parameters)
10047 self._autoPublish(anObj, theName, "fillet")
10050 ## Perform a fillet on the specified edges/faces of the given shape
10051 # @param theShape Shape, to perform fillet on.
10052 # @param theR Fillet radius.
10053 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10054 # @param theListShapes Global indices of edges/faces to perform fillet on.
10055 # @param theName Object name; when specified, this parameter is used
10056 # for result publication in the study. Otherwise, if automatic
10057 # publication is switched on, default value is used for result name.
10059 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10061 # @return New GEOM.GEOM_Object, containing the result shape.
10063 # @ref tui_fillet "Example"
10064 @ManageTransactions("LocalOp")
10065 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10067 Perform a fillet on the specified edges/faces of the given shape
10070 theShape Shape, to perform fillet on.
10071 theR Fillet radius.
10072 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10073 theListShapes Global indices of edges/faces to perform fillet on.
10074 theName Object name; when specified, this parameter is used
10075 for result publication in the study. Otherwise, if automatic
10076 publication is switched on, default value is used for result name.
10079 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10082 New GEOM.GEOM_Object, containing the result shape.
10085 # get the list of IDs (IDList) for the fillet
10086 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10088 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10089 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10090 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10091 # make a fillet on the specified edges of the given shape
10092 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10094 # Example: see GEOM_TestAll.py
10095 theR,Parameters = ParseParameters(theR)
10097 if theShapeType == self.ShapeType["EDGE"]:
10098 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10099 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10101 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10102 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10103 anObj.SetParameters(Parameters)
10104 self._autoPublish(anObj, theName, "fillet")
10107 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10108 @ManageTransactions("LocalOp")
10109 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10111 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10114 # get the list of IDs (IDList) for the fillet
10115 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10117 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10118 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10119 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10120 # make a fillet on the specified edges of the given shape
10121 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10123 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10125 if theShapeType == self.ShapeType["EDGE"]:
10126 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10127 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10129 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10130 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10131 anObj.SetParameters(Parameters)
10132 self._autoPublish(anObj, theName, "fillet")
10135 ## Perform a fillet on the specified edges of the given shape
10136 # @param theShape Wire Shape to perform fillet on.
10137 # @param theR Fillet radius.
10138 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10139 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10140 # \note The list of vertices could be empty,
10141 # in this case fillet will done done at all vertices in wire
10142 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10143 # by the length of the edges, nearest to the fillet vertex.
10144 # But sometimes the next edge is C1 continuous with the one, nearest to
10145 # the fillet point, and such two (or more) edges can be united to allow
10146 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10147 # thus ignoring the secant vertex (vertices).
10148 # @param theName Object name; when specified, this parameter is used
10149 # for result publication in the study. Otherwise, if automatic
10150 # publication is switched on, default value is used for result name.
10152 # @return New GEOM.GEOM_Object, containing the result shape.
10154 # @ref tui_fillet2d "Example"
10155 @ManageTransactions("LocalOp")
10156 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10158 Perform a fillet on the specified edges of the given shape
10161 theShape Wire Shape to perform fillet on.
10162 theR Fillet radius.
10163 theListOfVertexes Global indices of vertexes to perform fillet on.
10164 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10165 by the length of the edges, nearest to the fillet vertex.
10166 But sometimes the next edge is C1 continuous with the one, nearest to
10167 the fillet point, and such two (or more) edges can be united to allow
10168 bigger radius. Set this flag to TRUE to allow collinear edges union,
10169 thus ignoring the secant vertex (vertices).
10170 theName Object name; when specified, this parameter is used
10171 for result publication in the study. Otherwise, if automatic
10172 publication is switched on, default value is used for result name.
10174 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10176 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10179 New GEOM.GEOM_Object, containing the result shape.
10183 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10184 # make fillet at given wire vertices with giver radius
10185 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10187 # Example: see GEOM_TestAll.py
10188 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10189 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10190 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10191 anObj.SetParameters(Parameters)
10192 self._autoPublish(anObj, theName, "fillet")
10195 ## Perform a fillet at the specified vertices of the given face/shell.
10196 # @param theShape Face or Shell shape to perform fillet on.
10197 # @param theR Fillet radius.
10198 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10199 # @param theName Object name; when specified, this parameter is used
10200 # for result publication in the study. Otherwise, if automatic
10201 # publication is switched on, default value is used for result name.
10203 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10205 # @return New GEOM.GEOM_Object, containing the result shape.
10207 # @ref tui_fillet2d "Example"
10208 @ManageTransactions("LocalOp")
10209 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10211 Perform a fillet at the specified vertices of the given face/shell.
10214 theShape Face or Shell shape to perform fillet on.
10215 theR Fillet radius.
10216 theListOfVertexes Global indices of vertexes to perform fillet on.
10217 theName Object name; when specified, this parameter is used
10218 for result publication in the study. Otherwise, if automatic
10219 publication is switched on, default value is used for result name.
10221 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10224 New GEOM.GEOM_Object, containing the result shape.
10227 face = geompy.MakeFaceHW(100, 100, 1)
10228 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10230 # Example: see GEOM_TestAll.py
10231 theR,Parameters = ParseParameters(theR)
10232 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10233 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10234 anObj.SetParameters(Parameters)
10235 self._autoPublish(anObj, theName, "fillet")
10238 ## Perform a symmetric chamfer on all edges of the given shape.
10239 # @param theShape Shape, to perform chamfer on.
10240 # @param theD Chamfer size along each face.
10241 # @param theName Object name; when specified, this parameter is used
10242 # for result publication in the study. Otherwise, if automatic
10243 # publication is switched on, default value is used for result name.
10245 # @return New GEOM.GEOM_Object, containing the result shape.
10247 # @ref tui_chamfer "Example 1"
10248 # \n @ref swig_MakeChamferAll "Example 2"
10249 @ManageTransactions("LocalOp")
10250 def MakeChamferAll(self, theShape, theD, theName=None):
10252 Perform a symmetric chamfer on all edges of the given shape.
10255 theShape Shape, to perform chamfer on.
10256 theD Chamfer size along each face.
10257 theName Object name; when specified, this parameter is used
10258 for result publication in the study. Otherwise, if automatic
10259 publication is switched on, default value is used for result name.
10262 New GEOM.GEOM_Object, containing the result shape.
10265 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10267 # Example: see GEOM_TestOthers.py
10268 theD,Parameters = ParseParameters(theD)
10269 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10270 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10271 anObj.SetParameters(Parameters)
10272 self._autoPublish(anObj, theName, "chamfer")
10275 ## Perform a chamfer on edges, common to the specified faces,
10276 # with distance D1 on the Face1
10277 # @param theShape Shape, to perform chamfer on.
10278 # @param theD1 Chamfer size along \a theFace1.
10279 # @param theD2 Chamfer size along \a theFace2.
10280 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10281 # @param theName Object name; when specified, this parameter is used
10282 # for result publication in the study. Otherwise, if automatic
10283 # publication is switched on, default value is used for result name.
10285 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10287 # @return New GEOM.GEOM_Object, containing the result shape.
10289 # @ref tui_chamfer "Example"
10290 @ManageTransactions("LocalOp")
10291 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10293 Perform a chamfer on edges, common to the specified faces,
10294 with distance D1 on the Face1
10297 theShape Shape, to perform chamfer on.
10298 theD1 Chamfer size along theFace1.
10299 theD2 Chamfer size along theFace2.
10300 theFace1,theFace2 Global indices of two faces of theShape.
10301 theName Object name; when specified, this parameter is used
10302 for result publication in the study. Otherwise, if automatic
10303 publication is switched on, default value is used for result name.
10306 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10309 New GEOM.GEOM_Object, containing the result shape.
10312 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10313 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10314 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10315 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10317 # Example: see GEOM_TestAll.py
10318 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10319 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10320 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10321 anObj.SetParameters(Parameters)
10322 self._autoPublish(anObj, theName, "chamfer")
10325 ## Perform a chamfer on edges
10326 # @param theShape Shape, to perform chamfer on.
10327 # @param theD Chamfer length
10328 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10329 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10330 # @param theName Object name; when specified, this parameter is used
10331 # for result publication in the study. Otherwise, if automatic
10332 # publication is switched on, default value is used for result name.
10334 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10336 # @return New GEOM.GEOM_Object, containing the result shape.
10337 @ManageTransactions("LocalOp")
10338 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10340 Perform a chamfer on edges
10343 theShape Shape, to perform chamfer on.
10344 theD1 Chamfer size along theFace1.
10345 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10346 theFace1,theFace2 Global indices of two faces of theShape.
10347 theName Object name; when specified, this parameter is used
10348 for result publication in the study. Otherwise, if automatic
10349 publication is switched on, default value is used for result name.
10352 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10355 New GEOM.GEOM_Object, containing the result shape.
10358 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10359 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10360 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10362 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10365 if isinstance(theAngle,str):
10367 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10369 theAngle = theAngle*math.pi/180.0
10370 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10371 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10372 anObj.SetParameters(Parameters)
10373 self._autoPublish(anObj, theName, "chamfer")
10376 ## Perform a chamfer on all edges of the specified faces,
10377 # with distance D1 on the first specified face (if several for one edge)
10378 # @param theShape Shape, to perform chamfer on.
10379 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10380 # connected to the edge, are in \a theFaces, \a theD1
10381 # will be get along face, which is nearer to \a theFaces beginning.
10382 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10383 # @param theFaces Sequence of global indices of faces of \a theShape.
10384 # @param theName Object name; when specified, this parameter is used
10385 # for result publication in the study. Otherwise, if automatic
10386 # publication is switched on, default value is used for result name.
10388 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10390 # @return New GEOM.GEOM_Object, containing the result shape.
10392 # @ref tui_chamfer "Example"
10393 @ManageTransactions("LocalOp")
10394 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10396 Perform a chamfer on all edges of the specified faces,
10397 with distance D1 on the first specified face (if several for one edge)
10400 theShape Shape, to perform chamfer on.
10401 theD1 Chamfer size along face from theFaces. If both faces,
10402 connected to the edge, are in theFaces, theD1
10403 will be get along face, which is nearer to theFaces beginning.
10404 theD2 Chamfer size along another of two faces, connected to the edge.
10405 theFaces Sequence of global indices of faces of theShape.
10406 theName Object name; when specified, this parameter is used
10407 for result publication in the study. Otherwise, if automatic
10408 publication is switched on, default value is used for result name.
10410 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10413 New GEOM.GEOM_Object, containing the result shape.
10415 # Example: see GEOM_TestAll.py
10416 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10417 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10418 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10419 anObj.SetParameters(Parameters)
10420 self._autoPublish(anObj, theName, "chamfer")
10423 ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10424 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10426 # @ref swig_FilletChamfer "Example"
10427 @ManageTransactions("LocalOp")
10428 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10430 The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10431 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10434 if isinstance(theAngle,str):
10436 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10438 theAngle = theAngle*math.pi/180.0
10439 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10440 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10441 anObj.SetParameters(Parameters)
10442 self._autoPublish(anObj, theName, "chamfer")
10445 ## Perform a chamfer on edges,
10446 # with distance D1 on the first specified face (if several for one edge)
10447 # @param theShape Shape, to perform chamfer on.
10448 # @param theD1,theD2 Chamfer size
10449 # @param theEdges Sequence of edges of \a theShape.
10450 # @param theName Object name; when specified, this parameter is used
10451 # for result publication in the study. Otherwise, if automatic
10452 # publication is switched on, default value is used for result name.
10454 # @return New GEOM.GEOM_Object, containing the result shape.
10456 # @ref swig_FilletChamfer "Example"
10457 @ManageTransactions("LocalOp")
10458 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10460 Perform a chamfer on edges,
10461 with distance D1 on the first specified face (if several for one edge)
10464 theShape Shape, to perform chamfer on.
10465 theD1,theD2 Chamfer size
10466 theEdges Sequence of edges of theShape.
10467 theName Object name; when specified, this parameter is used
10468 for result publication in the study. Otherwise, if automatic
10469 publication is switched on, default value is used for result name.
10472 New GEOM.GEOM_Object, containing the result shape.
10474 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10475 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10476 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10477 anObj.SetParameters(Parameters)
10478 self._autoPublish(anObj, theName, "chamfer")
10481 ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10482 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10483 @ManageTransactions("LocalOp")
10484 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10486 The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10487 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10490 if isinstance(theAngle,str):
10492 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10494 theAngle = theAngle*math.pi/180.0
10495 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10496 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10497 anObj.SetParameters(Parameters)
10498 self._autoPublish(anObj, theName, "chamfer")
10501 ## @sa MakeChamferEdge(), MakeChamferFaces()
10503 # @ref swig_MakeChamfer "Example"
10504 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10506 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10508 # Example: see GEOM_TestOthers.py
10510 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10511 if aShapeType == self.ShapeType["EDGE"]:
10512 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10514 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10517 ## Remove material from a solid by extrusion of the base shape on the given distance.
10518 # @param theInit Shape to remove material from. It must be a solid or
10519 # a compound made of a single solid.
10520 # @param theBase Closed edge or wire defining the base shape to be extruded.
10521 # @param theH Prism dimension along the normal to theBase
10522 # @param theAngle Draft angle in degrees.
10523 # @param theInvert If true material changes the direction
10524 # @param theName Object name; when specified, this parameter is used
10525 # for result publication in the study. Otherwise, if automatic
10526 # publication is switched on, default value is used for result name.
10528 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10530 # @ref tui_creation_prism "Example"
10531 @ManageTransactions("PrimOp")
10532 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10534 Add material to a solid by extrusion of the base shape on the given distance.
10537 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10538 theBase Closed edge or wire defining the base shape to be extruded.
10539 theH Prism dimension along the normal to theBase
10540 theAngle Draft angle in degrees.
10541 theInvert If true material changes the direction.
10542 theName Object name; when specified, this parameter is used
10543 for result publication in the study. Otherwise, if automatic
10544 publication is switched on, default value is used for result name.
10547 New GEOM.GEOM_Object, containing the initial shape with removed material.
10549 # Example: see GEOM_TestAll.py
10550 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10551 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10552 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10553 anObj.SetParameters(Parameters)
10554 self._autoPublish(anObj, theName, "extrudedCut")
10557 ## Add material to a solid by extrusion of the base shape on the given distance.
10558 # @param theInit Shape to add material to. It must be a solid or
10559 # a compound made of a single solid.
10560 # @param theBase Closed edge or wire defining the base shape to be extruded.
10561 # @param theH Prism dimension along the normal to theBase
10562 # @param theAngle Draft angle in degrees.
10563 # @param theInvert If true material changes the direction
10564 # @param theName Object name; when specified, this parameter is used
10565 # for result publication in the study. Otherwise, if automatic
10566 # publication is switched on, default value is used for result name.
10568 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10570 # @ref tui_creation_prism "Example"
10571 @ManageTransactions("PrimOp")
10572 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10574 Add material to a solid by extrusion of the base shape on the given distance.
10577 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10578 theBase Closed edge or wire defining the base shape to be extruded.
10579 theH Prism dimension along the normal to theBase
10580 theAngle Draft angle in degrees.
10581 theInvert If true material changes the direction.
10582 theName Object name; when specified, this parameter is used
10583 for result publication in the study. Otherwise, if automatic
10584 publication is switched on, default value is used for result name.
10587 New GEOM.GEOM_Object, containing the initial shape with added material.
10589 # Example: see GEOM_TestAll.py
10590 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10591 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10592 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10593 anObj.SetParameters(Parameters)
10594 self._autoPublish(anObj, theName, "extrudedBoss")
10600 ## @addtogroup l3_basic_op
10603 ## Perform an Archimde operation on the given shape with given parameters.
10604 # The object presenting the resulting face is returned.
10605 # @param theShape Shape to be put in water.
10606 # @param theWeight Weight of the shape.
10607 # @param theWaterDensity Density of the water.
10608 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10609 # @param theName Object name; when specified, this parameter is used
10610 # for result publication in the study. Otherwise, if automatic
10611 # publication is switched on, default value is used for result name.
10613 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10614 # by a plane, corresponding to water level.
10616 # @ref tui_archimede "Example"
10617 @ManageTransactions("LocalOp")
10618 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10620 Perform an Archimde operation on the given shape with given parameters.
10621 The object presenting the resulting face is returned.
10624 theShape Shape to be put in water.
10625 theWeight Weight of the shape.
10626 theWaterDensity Density of the water.
10627 theMeshDeflection Deflection of the mesh, using to compute the section.
10628 theName Object name; when specified, this parameter is used
10629 for result publication in the study. Otherwise, if automatic
10630 publication is switched on, default value is used for result name.
10633 New GEOM.GEOM_Object, containing a section of theShape
10634 by a plane, corresponding to water level.
10636 # Example: see GEOM_TestAll.py
10637 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10638 theWeight,theWaterDensity,theMeshDeflection)
10639 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10640 RaiseIfFailed("MakeArchimede", self.LocalOp)
10641 anObj.SetParameters(Parameters)
10642 self._autoPublish(anObj, theName, "archimede")
10645 # end of l3_basic_op
10648 ## @addtogroup l2_measure
10651 ## Get point coordinates
10652 # @return [x, y, z]
10654 # @ref tui_point_coordinates_page "Example"
10655 @ManageTransactions("MeasuOp")
10656 def PointCoordinates(self,Point):
10658 Get point coordinates
10663 # Example: see GEOM_TestMeasures.py
10664 aTuple = self.MeasuOp.PointCoordinates(Point)
10665 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10668 ## Get vector coordinates
10669 # @return [x, y, z]
10671 # @ref tui_measurement_tools_page "Example"
10672 def VectorCoordinates(self,Vector):
10674 Get vector coordinates
10680 p1=self.GetFirstVertex(Vector)
10681 p2=self.GetLastVertex(Vector)
10683 X1=self.PointCoordinates(p1)
10684 X2=self.PointCoordinates(p2)
10686 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10689 ## Compute cross product
10690 # @return vector w=u^v
10692 # @ref tui_measurement_tools_page "Example"
10693 def CrossProduct(self, Vector1, Vector2):
10695 Compute cross product
10697 Returns: vector w=u^v
10699 u=self.VectorCoordinates(Vector1)
10700 v=self.VectorCoordinates(Vector2)
10701 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])
10705 ## Compute cross product
10706 # @return dot product p=u.v
10708 # @ref tui_measurement_tools_page "Example"
10709 def DotProduct(self, Vector1, Vector2):
10711 Compute cross product
10713 Returns: dot product p=u.v
10715 u=self.VectorCoordinates(Vector1)
10716 v=self.VectorCoordinates(Vector2)
10717 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10722 ## Get summarized length of all wires,
10723 # area of surface and volume of the given shape.
10724 # @param theShape Shape to define properties of.
10725 # @param theTolerance maximal relative error of area
10726 # and volume computation.
10727 # @return [theLength, theSurfArea, theVolume]\n
10728 # theLength: Summarized length of all wires of the given shape.\n
10729 # theSurfArea: Area of surface of the given shape.\n
10730 # theVolume: Volume of the given shape.
10732 # @ref tui_basic_properties_page "Example"
10733 @ManageTransactions("MeasuOp")
10734 def BasicProperties(self,theShape, theTolerance=1.e-6):
10736 Get summarized length of all wires,
10737 area of surface and volume of the given shape.
10740 theShape Shape to define properties of.
10741 theTolerance maximal relative error of area
10742 and volume computation.
10745 [theLength, theSurfArea, theVolume]
10746 theLength: Summarized length of all wires of the given shape.
10747 theSurfArea: Area of surface of the given shape.
10748 theVolume: Volume of the given shape.
10750 # Example: see GEOM_TestMeasures.py
10751 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10752 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10755 ## Get parameters of bounding box of the given shape
10756 # @param theShape Shape to obtain bounding box of.
10757 # @param precise TRUE for precise computation; FALSE for fast one.
10758 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10759 # Xmin,Xmax: Limits of shape along OX axis.
10760 # Ymin,Ymax: Limits of shape along OY axis.
10761 # Zmin,Zmax: Limits of shape along OZ axis.
10763 # @ref tui_bounding_box_page "Example"
10764 @ManageTransactions("MeasuOp")
10765 def BoundingBox (self, theShape, precise=False):
10767 Get parameters of bounding box of the given shape
10770 theShape Shape to obtain bounding box of.
10771 precise TRUE for precise computation; FALSE for fast one.
10774 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10775 Xmin,Xmax: Limits of shape along OX axis.
10776 Ymin,Ymax: Limits of shape along OY axis.
10777 Zmin,Zmax: Limits of shape along OZ axis.
10779 # Example: see GEOM_TestMeasures.py
10780 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10781 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10784 ## Get bounding box of the given shape
10785 # @param theShape Shape to obtain bounding box of.
10786 # @param precise TRUE for precise computation; FALSE for fast one.
10787 # @param theName Object name; when specified, this parameter is used
10788 # for result publication in the study. Otherwise, if automatic
10789 # publication is switched on, default value is used for result name.
10791 # @return New GEOM.GEOM_Object, containing the created box.
10793 # @ref tui_bounding_box_page "Example"
10794 @ManageTransactions("MeasuOp")
10795 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10797 Get bounding box of the given shape
10800 theShape Shape to obtain bounding box of.
10801 precise TRUE for precise computation; FALSE for fast one.
10802 theName Object name; when specified, this parameter is used
10803 for result publication in the study. Otherwise, if automatic
10804 publication is switched on, default value is used for result name.
10807 New GEOM.GEOM_Object, containing the created box.
10809 # Example: see GEOM_TestMeasures.py
10810 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10811 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10812 self._autoPublish(anObj, theName, "bndbox")
10815 ## Get inertia matrix and moments of inertia of theShape.
10816 # @param theShape Shape to calculate inertia of.
10817 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10818 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10819 # Ix,Iy,Iz: Moments of inertia of the given shape.
10821 # @ref tui_inertia_page "Example"
10822 @ManageTransactions("MeasuOp")
10823 def Inertia(self,theShape):
10825 Get inertia matrix and moments of inertia of theShape.
10828 theShape Shape to calculate inertia of.
10831 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10832 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10833 Ix,Iy,Iz: Moments of inertia of the given shape.
10835 # Example: see GEOM_TestMeasures.py
10836 aTuple = self.MeasuOp.GetInertia(theShape)
10837 RaiseIfFailed("GetInertia", self.MeasuOp)
10840 ## Get if coords are included in the shape (ST_IN or ST_ON)
10841 # @param theShape Shape
10842 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10843 # @param tolerance to be used (default is 1.0e-7)
10844 # @return list_of_boolean = [res1, res2, ...]
10845 @ManageTransactions("MeasuOp")
10846 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10848 Get if coords are included in the shape (ST_IN or ST_ON)
10852 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10853 tolerance to be used (default is 1.0e-7)
10856 list_of_boolean = [res1, res2, ...]
10858 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10860 ## Get minimal distance between the given shapes.
10861 # @param theShape1,theShape2 Shapes to find minimal distance between.
10862 # @return Value of the minimal distance between the given shapes.
10864 # @ref tui_min_distance_page "Example"
10865 @ManageTransactions("MeasuOp")
10866 def MinDistance(self, theShape1, theShape2):
10868 Get minimal distance between the given shapes.
10871 theShape1,theShape2 Shapes to find minimal distance between.
10874 Value of the minimal distance between the given shapes.
10876 # Example: see GEOM_TestMeasures.py
10877 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10878 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10881 ## Get minimal distance between the given shapes.
10882 # @param theShape1,theShape2 Shapes to find minimal distance between.
10883 # @return Value of the minimal distance between the given shapes, in form of list
10884 # [Distance, DX, DY, DZ].
10886 # @ref tui_min_distance_page "Example"
10887 @ManageTransactions("MeasuOp")
10888 def MinDistanceComponents(self, theShape1, theShape2):
10890 Get minimal distance between the given shapes.
10893 theShape1,theShape2 Shapes to find minimal distance between.
10896 Value of the minimal distance between the given shapes, in form of list
10897 [Distance, DX, DY, DZ]
10899 # Example: see GEOM_TestMeasures.py
10900 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10901 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10902 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10905 ## Get closest points of the given shapes.
10906 # @param theShape1,theShape2 Shapes to find closest points of.
10907 # @return The number of found solutions (-1 in case of infinite number of
10908 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10910 # @ref tui_min_distance_page "Example"
10911 @ManageTransactions("MeasuOp")
10912 def ClosestPoints (self, theShape1, theShape2):
10914 Get closest points of the given shapes.
10917 theShape1,theShape2 Shapes to find closest points of.
10920 The number of found solutions (-1 in case of infinite number of
10921 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10923 # Example: see GEOM_TestMeasures.py
10924 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10925 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10928 ## Get angle between the given shapes in degrees.
10929 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10930 # @note If both arguments are vectors, the angle is computed in accordance
10931 # with their orientations, otherwise the minimum angle is computed.
10932 # @return Value of the angle between the given shapes in degrees.
10934 # @ref tui_angle_page "Example"
10935 @ManageTransactions("MeasuOp")
10936 def GetAngle(self, theShape1, theShape2):
10938 Get angle between the given shapes in degrees.
10941 theShape1,theShape2 Lines or linear edges to find angle between.
10944 If both arguments are vectors, the angle is computed in accordance
10945 with their orientations, otherwise the minimum angle is computed.
10948 Value of the angle between the given shapes in degrees.
10950 # Example: see GEOM_TestMeasures.py
10951 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10952 RaiseIfFailed("GetAngle", self.MeasuOp)
10955 ## Get angle between the given shapes in radians.
10956 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10957 # @note If both arguments are vectors, the angle is computed in accordance
10958 # with their orientations, otherwise the minimum angle is computed.
10959 # @return Value of the angle between the given shapes in radians.
10961 # @ref tui_angle_page "Example"
10962 @ManageTransactions("MeasuOp")
10963 def GetAngleRadians(self, theShape1, theShape2):
10965 Get angle between the given shapes in radians.
10968 theShape1,theShape2 Lines or linear edges to find angle between.
10972 If both arguments are vectors, the angle is computed in accordance
10973 with their orientations, otherwise the minimum angle is computed.
10976 Value of the angle between the given shapes in radians.
10978 # Example: see GEOM_TestMeasures.py
10979 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10980 RaiseIfFailed("GetAngle", self.MeasuOp)
10983 ## Get angle between the given vectors in degrees.
10984 # @param theShape1,theShape2 Vectors to find angle between.
10985 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10986 # if False, the opposite vector to the normal vector is used.
10987 # @return Value of the angle between the given vectors in degrees.
10989 # @ref tui_angle_page "Example"
10990 @ManageTransactions("MeasuOp")
10991 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10993 Get angle between the given vectors in degrees.
10996 theShape1,theShape2 Vectors to find angle between.
10997 theFlag If True, the normal vector is defined by the two vectors cross,
10998 if False, the opposite vector to the normal vector is used.
11001 Value of the angle between the given vectors in degrees.
11003 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11005 anAngle = 360. - anAngle
11006 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11009 ## The same as GetAngleVectors, but the result is in radians.
11010 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11012 Get angle between the given vectors in radians.
11015 theShape1,theShape2 Vectors to find angle between.
11016 theFlag If True, the normal vector is defined by the two vectors cross,
11017 if False, the opposite vector to the normal vector is used.
11020 Value of the angle between the given vectors in radians.
11022 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11025 ## @name Curve Curvature Measurement
11026 # Methods for receiving radius of curvature of curves
11027 # in the given point
11030 ## Measure curvature of a curve at a point, set by parameter.
11031 # @param theCurve a curve.
11032 # @param theParam parameter.
11033 # @return radius of curvature of \a theCurve.
11035 # @ref swig_todo "Example"
11036 @ManageTransactions("MeasuOp")
11037 def CurveCurvatureByParam(self, theCurve, theParam):
11039 Measure curvature of a curve at a point, set by parameter.
11043 theParam parameter.
11046 radius of curvature of theCurve.
11048 # Example: see GEOM_TestMeasures.py
11049 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11050 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11053 ## Measure curvature of a curve at a point.
11054 # @param theCurve a curve.
11055 # @param thePoint given point.
11056 # @return radius of curvature of \a theCurve.
11058 # @ref swig_todo "Example"
11059 @ManageTransactions("MeasuOp")
11060 def CurveCurvatureByPoint(self, theCurve, thePoint):
11062 Measure curvature of a curve at a point.
11066 thePoint given point.
11069 radius of curvature of theCurve.
11071 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11072 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11076 ## @name Surface Curvature Measurement
11077 # Methods for receiving max and min radius of curvature of surfaces
11078 # in the given point
11081 ## Measure max radius of curvature of surface.
11082 # @param theSurf the given surface.
11083 # @param theUParam Value of U-parameter on the referenced surface.
11084 # @param theVParam Value of V-parameter on the referenced surface.
11085 # @return max radius of curvature of theSurf.
11087 ## @ref swig_todo "Example"
11088 @ManageTransactions("MeasuOp")
11089 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11091 Measure max radius of curvature of surface.
11094 theSurf the given surface.
11095 theUParam Value of U-parameter on the referenced surface.
11096 theVParam Value of V-parameter on the referenced surface.
11099 max radius of curvature of theSurf.
11101 # Example: see GEOM_TestMeasures.py
11102 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11103 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11106 ## Measure max radius of curvature of surface in the given point
11107 # @param theSurf the given surface.
11108 # @param thePoint given point.
11109 # @return max radius of curvature of theSurf.
11111 ## @ref swig_todo "Example"
11112 @ManageTransactions("MeasuOp")
11113 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11115 Measure max radius of curvature of surface in the given point.
11118 theSurf the given surface.
11119 thePoint given point.
11122 max radius of curvature of theSurf.
11124 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11125 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11128 ## Measure min radius of curvature of surface.
11129 # @param theSurf the given surface.
11130 # @param theUParam Value of U-parameter on the referenced surface.
11131 # @param theVParam Value of V-parameter on the referenced surface.
11132 # @return min radius of curvature of theSurf.
11134 ## @ref swig_todo "Example"
11135 @ManageTransactions("MeasuOp")
11136 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11138 Measure min radius of curvature of surface.
11141 theSurf the given surface.
11142 theUParam Value of U-parameter on the referenced surface.
11143 theVParam Value of V-parameter on the referenced surface.
11146 Min radius of curvature of theSurf.
11148 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11149 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11152 ## Measure min radius of curvature of surface in the given point
11153 # @param theSurf the given surface.
11154 # @param thePoint given point.
11155 # @return min radius of curvature of theSurf.
11157 ## @ref swig_todo "Example"
11158 @ManageTransactions("MeasuOp")
11159 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11161 Measure min radius of curvature of surface in the given point.
11164 theSurf the given surface.
11165 thePoint given point.
11168 Min radius of curvature of theSurf.
11170 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11171 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11175 ## Get min and max tolerances of sub-shapes of theShape
11176 # @param theShape Shape, to get tolerances of.
11177 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11178 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11179 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11180 # VertMin,VertMax: Min and max tolerances of the vertices.
11182 # @ref tui_tolerance_page "Example"
11183 @ManageTransactions("MeasuOp")
11184 def Tolerance(self,theShape):
11186 Get min and max tolerances of sub-shapes of theShape
11189 theShape Shape, to get tolerances of.
11192 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11193 FaceMin,FaceMax: Min and max tolerances of the faces.
11194 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11195 VertMin,VertMax: Min and max tolerances of the vertices.
11197 # Example: see GEOM_TestMeasures.py
11198 aTuple = self.MeasuOp.GetTolerance(theShape)
11199 RaiseIfFailed("GetTolerance", self.MeasuOp)
11202 ## Obtain description of the given shape (number of sub-shapes of each type)
11203 # @param theShape Shape to be described.
11204 # @return Description of the given shape.
11206 # @ref tui_whatis_page "Example"
11207 @ManageTransactions("MeasuOp")
11208 def WhatIs(self,theShape):
11210 Obtain description of the given shape (number of sub-shapes of each type)
11213 theShape Shape to be described.
11216 Description of the given shape.
11218 # Example: see GEOM_TestMeasures.py
11219 aDescr = self.MeasuOp.WhatIs(theShape)
11220 RaiseIfFailed("WhatIs", self.MeasuOp)
11223 ## Obtain quantity of shapes of the given type in \a theShape.
11224 # If \a theShape is of type \a theType, it is also counted.
11225 # @param theShape Shape to be described.
11226 # @param theType the given ShapeType().
11227 # @return Quantity of shapes of type \a theType in \a theShape.
11229 # @ref tui_measurement_tools_page "Example"
11230 def NbShapes (self, theShape, theType):
11232 Obtain quantity of shapes of the given type in theShape.
11233 If theShape is of type theType, it is also counted.
11236 theShape Shape to be described.
11237 theType the given geompy.ShapeType
11240 Quantity of shapes of type theType in theShape.
11242 # Example: see GEOM_TestMeasures.py
11243 listSh = self.SubShapeAllIDs(theShape, theType)
11247 ## Obtain quantity of shapes of each type in \a theShape.
11248 # The \a theShape is also counted.
11249 # @param theShape Shape to be described.
11250 # @return Dictionary of ShapeType() with bound quantities of shapes.
11252 # @ref tui_measurement_tools_page "Example"
11253 def ShapeInfo (self, theShape):
11255 Obtain quantity of shapes of each type in theShape.
11256 The theShape is also counted.
11259 theShape Shape to be described.
11262 Dictionary of geompy.ShapeType with bound quantities of shapes.
11264 # Example: see GEOM_TestMeasures.py
11266 for typeSh in self.ShapeType:
11267 if typeSh in ( "AUTO", "SHAPE" ): continue
11268 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11274 def GetCreationInformation(self, theShape):
11276 infos = theShape.GetCreationInformation()
11279 opName = info.operationName
11280 if not opName: opName = "no info available"
11281 if res: res += "\n"
11282 res += "Operation: " + opName
11284 for parVal in info.params:
11285 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11288 ## Get a point, situated at the centre of mass of theShape.
11289 # @param theShape Shape to define centre of mass of.
11290 # @param theName Object name; when specified, this parameter is used
11291 # for result publication in the study. Otherwise, if automatic
11292 # publication is switched on, default value is used for result name.
11294 # @return New GEOM.GEOM_Object, containing the created point.
11296 # @ref tui_center_of_mass_page "Example"
11297 @ManageTransactions("MeasuOp")
11298 def MakeCDG(self, theShape, theName=None):
11300 Get a point, situated at the centre of mass of theShape.
11303 theShape Shape to define centre of mass of.
11304 theName Object name; when specified, this parameter is used
11305 for result publication in the study. Otherwise, if automatic
11306 publication is switched on, default value is used for result name.
11309 New GEOM.GEOM_Object, containing the created point.
11311 # Example: see GEOM_TestMeasures.py
11312 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11313 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11314 self._autoPublish(anObj, theName, "centerOfMass")
11317 ## Get a vertex sub-shape by index.
11318 # @param theShape Shape to find sub-shape.
11319 # @param theIndex Index to find vertex by this index (starting from zero)
11320 # @param theUseOri To consider edge/wire orientation or not
11321 # @param theName Object name; when specified, this parameter is used
11322 # for result publication in the study. Otherwise, if automatic
11323 # publication is switched on, default value is used for result name.
11325 # @return New GEOM.GEOM_Object, containing the created vertex.
11327 # @ref tui_measurement_tools_page "Example"
11328 @ManageTransactions("MeasuOp")
11329 def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
11331 Get a vertex sub-shape by index.
11334 theShape Shape to find sub-shape.
11335 theIndex Index to find vertex by this index (starting from zero)
11336 theUseOri To consider edge/wire orientation or not
11337 theName Object name; when specified, this parameter is used
11338 for result publication in the study. Otherwise, if automatic
11339 publication is switched on, default value is used for result name.
11342 New GEOM.GEOM_Object, containing the created vertex.
11344 # Example: see GEOM_TestMeasures.py
11345 if isinstance( theUseOri, str ): # theUseOri was inserted before theName
11346 theUseOri, theName = True, theUseOri
11347 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
11348 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11349 self._autoPublish(anObj, theName, "vertex")
11352 ## Get the first vertex of wire/edge depended orientation.
11353 # @param theShape Shape to find first vertex.
11354 # @param theName Object name; when specified, this parameter is used
11355 # for result publication in the study. Otherwise, if automatic
11356 # publication is switched on, default value is used for result name.
11358 # @return New GEOM.GEOM_Object, containing the created vertex.
11360 # @ref tui_measurement_tools_page "Example"
11361 def GetFirstVertex(self, theShape, theName=None):
11363 Get the first vertex of wire/edge depended orientation.
11366 theShape Shape to find first vertex.
11367 theName Object name; when specified, this parameter is used
11368 for result publication in the study. Otherwise, if automatic
11369 publication is switched on, default value is used for result name.
11372 New GEOM.GEOM_Object, containing the created vertex.
11374 # Example: see GEOM_TestMeasures.py
11375 # note: auto-publishing is done in self.GetVertexByIndex()
11376 return self.GetVertexByIndex(theShape, 0, True, theName)
11378 ## Get the last vertex of wire/edge depended orientation.
11379 # @param theShape Shape to find last vertex.
11380 # @param theName Object name; when specified, this parameter is used
11381 # for result publication in the study. Otherwise, if automatic
11382 # publication is switched on, default value is used for result name.
11384 # @return New GEOM.GEOM_Object, containing the created vertex.
11386 # @ref tui_measurement_tools_page "Example"
11387 def GetLastVertex(self, theShape, theName=None):
11389 Get the last vertex of wire/edge depended orientation.
11392 theShape Shape to find last vertex.
11393 theName Object name; when specified, this parameter is used
11394 for result publication in the study. Otherwise, if automatic
11395 publication is switched on, default value is used for result name.
11398 New GEOM.GEOM_Object, containing the created vertex.
11400 # Example: see GEOM_TestMeasures.py
11401 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11402 # note: auto-publishing is done in self.GetVertexByIndex()
11403 return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
11405 ## Get a normale to the given face. If the point is not given,
11406 # the normale is calculated at the center of mass.
11407 # @param theFace Face to define normale of.
11408 # @param theOptionalPoint Point to compute the normale at.
11409 # @param theName Object name; when specified, this parameter is used
11410 # for result publication in the study. Otherwise, if automatic
11411 # publication is switched on, default value is used for result name.
11413 # @return New GEOM.GEOM_Object, containing the created vector.
11415 # @ref swig_todo "Example"
11416 @ManageTransactions("MeasuOp")
11417 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11419 Get a normale to the given face. If the point is not given,
11420 the normale is calculated at the center of mass.
11423 theFace Face to define normale of.
11424 theOptionalPoint Point to compute the normale at.
11425 theName Object name; when specified, this parameter is used
11426 for result publication in the study. Otherwise, if automatic
11427 publication is switched on, default value is used for result name.
11430 New GEOM.GEOM_Object, containing the created vector.
11432 # Example: see GEOM_TestMeasures.py
11433 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11434 RaiseIfFailed("GetNormal", self.MeasuOp)
11435 self._autoPublish(anObj, theName, "normal")
11438 ## Print shape errors obtained from CheckShape.
11439 # @param theShape Shape that was checked.
11440 # @param theShapeErrors the shape errors obtained by CheckShape.
11441 # @param theReturnStatus If 0 the description of problem is printed.
11442 # If 1 the description of problem is returned.
11443 # @return If theReturnStatus is equal to 1 the description is returned.
11444 # Otherwise doesn't return anything.
11446 # @ref tui_check_shape_page "Example"
11447 @ManageTransactions("MeasuOp")
11448 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11450 Print shape errors obtained from CheckShape.
11453 theShape Shape that was checked.
11454 theShapeErrors the shape errors obtained by CheckShape.
11455 theReturnStatus If 0 the description of problem is printed.
11456 If 1 the description of problem is returned.
11459 If theReturnStatus is equal to 1 the description is returned.
11460 Otherwise doesn't return anything.
11462 # Example: see GEOM_TestMeasures.py
11463 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11464 if theReturnStatus == 1:
11469 ## Check a topology of the given shape.
11470 # @param theShape Shape to check validity of.
11471 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11472 # if TRUE, the shape's geometry will be checked also.
11473 # @param theReturnStatus If 0 and if theShape is invalid, a description
11474 # of problem is printed.
11475 # If 1 isValid flag and the description of
11476 # problem is returned.
11477 # If 2 isValid flag and the list of error data
11479 # @return TRUE, if the shape "seems to be valid".
11480 # If theShape is invalid, prints a description of problem.
11481 # If theReturnStatus is equal to 1 the description is returned
11482 # along with IsValid flag.
11483 # If theReturnStatus is equal to 2 the list of error data is
11484 # returned along with IsValid flag.
11486 # @ref tui_check_shape_page "Example"
11487 @ManageTransactions("MeasuOp")
11488 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11490 Check a topology of the given shape.
11493 theShape Shape to check validity of.
11494 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11495 if TRUE, the shape's geometry will be checked also.
11496 theReturnStatus If 0 and if theShape is invalid, a description
11497 of problem is printed.
11498 If 1 IsValid flag and the description of
11499 problem is returned.
11500 If 2 IsValid flag and the list of error data
11504 TRUE, if the shape "seems to be valid".
11505 If theShape is invalid, prints a description of problem.
11506 If theReturnStatus is equal to 1 the description is returned
11507 along with IsValid flag.
11508 If theReturnStatus is equal to 2 the list of error data is
11509 returned along with IsValid flag.
11511 # Example: see GEOM_TestMeasures.py
11513 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11514 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11516 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11517 RaiseIfFailed("CheckShape", self.MeasuOp)
11519 if theReturnStatus == 0:
11520 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11522 if theReturnStatus == 1:
11523 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11524 return (IsValid, Descr)
11525 elif theReturnStatus == 2:
11526 return (IsValid, ShapeErrors)
11529 ## Detect self-intersections in the given shape.
11530 # @param theShape Shape to check.
11531 # @param theCheckLevel is the level of self-intersection check.
11532 # Possible input values are:
11533 # - GEOM.SI_V_V(0) - only V/V interferences
11534 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11535 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11536 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11537 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11538 # - GEOM.SI_ALL(5) - all interferences.
11539 # @return TRUE, if the shape contains no self-intersections.
11541 # @ref tui_check_self_intersections_page "Example"
11542 @ManageTransactions("MeasuOp")
11543 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11545 Detect self-intersections in the given shape.
11548 theShape Shape to check.
11549 theCheckLevel is the level of self-intersection check.
11550 Possible input values are:
11551 - GEOM.SI_V_V(0) - only V/V interferences
11552 - GEOM.SI_V_E(1) - V/V and V/E interferences
11553 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11554 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11555 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11556 - GEOM.SI_ALL(5) - all interferences.
11559 TRUE, if the shape contains no self-intersections.
11561 # Example: see GEOM_TestMeasures.py
11562 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11563 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11566 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11567 # @param theShape Shape to check.
11568 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11569 # - if \a theDeflection <= 0, default deflection 0.001 is used
11570 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11571 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11572 # - if \a theTolerance > 0, algorithm detects gaps
11573 # @return TRUE, if the shape contains no self-intersections.
11575 # @ref tui_check_self_intersections_fast_page "Example"
11576 @ManageTransactions("MeasuOp")
11577 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11579 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11582 theShape Shape to check.
11583 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11584 - if theDeflection <= 0, default deflection 0.001 is used
11585 theTolerance Specifies a distance between shapes used for detecting gaps:
11586 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11587 - if theTolerance > 0, algorithm detects gaps
11590 TRUE, if the shape contains no self-intersections.
11592 # Example: see GEOM_TestMeasures.py
11593 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11594 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11597 ## Check boolean and partition operations arguments.
11598 # @param theShape the argument of an operation to be checked
11599 # @return TRUE if the argument is valid for a boolean or partition
11600 # operation; FALSE otherwise.
11601 @ManageTransactions("MeasuOp")
11602 def CheckBOPArguments(self, theShape):
11604 Check boolean and partition operations arguments.
11607 theShape the argument of an operation to be checked
11610 TRUE if the argument is valid for a boolean or partition
11611 operation; FALSE otherwise.
11613 return self.MeasuOp.CheckBOPArguments(theShape)
11615 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11616 # @param theShape1 First source object
11617 # @param theShape2 Second source object
11618 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11619 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11620 # - if \a theTolerance > 0, algorithm detects gaps
11621 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11622 # - if \a theDeflection <= 0, default deflection 0.001 is used
11623 # @return TRUE, if there are intersections (gaps) between source shapes
11624 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11625 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11627 # @ref tui_fast_intersection_page "Example"
11628 @ManageTransactions("MeasuOp")
11629 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11631 Detect intersections of the given shapes with algorithm based on mesh intersections.
11634 theShape1 First source object
11635 theShape2 Second source object
11636 theTolerance Specifies a distance between shapes used for detecting gaps:
11637 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11638 - if theTolerance > 0, algorithm detects gaps
11639 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11640 - if theDeflection <= 0, default deflection 0.001 is used
11643 TRUE, if there are intersections (gaps) between source shapes
11644 List of sub-shapes IDs from 1st shape that localize intersection.
11645 List of sub-shapes IDs from 2nd shape that localize intersection.
11647 # Example: see GEOM_TestMeasures.py
11648 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11649 RaiseIfFailed("FastIntersect", self.MeasuOp)
11650 return IsOk, Res1, Res2
11652 ## Get position (LCS) of theShape.
11654 # Origin of the LCS is situated at the shape's center of mass.
11655 # Axes of the LCS are obtained from shape's location or,
11656 # if the shape is a planar face, from position of its plane.
11658 # @param theShape Shape to calculate position of.
11659 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11660 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11661 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11662 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11664 # @ref swig_todo "Example"
11665 @ManageTransactions("MeasuOp")
11666 def GetPosition(self,theShape):
11668 Get position (LCS) of theShape.
11669 Origin of the LCS is situated at the shape's center of mass.
11670 Axes of the LCS are obtained from shape's location or,
11671 if the shape is a planar face, from position of its plane.
11674 theShape Shape to calculate position of.
11677 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11678 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11679 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11680 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11682 # Example: see GEOM_TestMeasures.py
11683 aTuple = self.MeasuOp.GetPosition(theShape)
11684 RaiseIfFailed("GetPosition", self.MeasuOp)
11687 ## Get kind of theShape.
11689 # @param theShape Shape to get a kind of.
11690 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11691 # and a list of parameters, describing the shape.
11692 # @note Concrete meaning of each value, returned via \a theIntegers
11693 # or \a theDoubles list depends on the kind() of the shape.
11695 # @ref swig_todo "Example"
11696 @ManageTransactions("MeasuOp")
11697 def KindOfShape(self,theShape):
11699 Get kind of theShape.
11702 theShape Shape to get a kind of.
11705 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11706 and a list of parameters, describing the shape.
11708 Concrete meaning of each value, returned via theIntegers
11709 or theDoubles list depends on the geompy.kind of the shape
11711 # Example: see GEOM_TestMeasures.py
11712 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11713 RaiseIfFailed("KindOfShape", self.MeasuOp)
11715 aKind = aRoughTuple[0]
11716 anInts = aRoughTuple[1]
11717 aDbls = aRoughTuple[2]
11719 # Now there is no exception from this rule:
11720 aKindTuple = [aKind] + aDbls + anInts
11722 # If they are we will regroup parameters for such kind of shape.
11724 #if aKind == kind.SOME_KIND:
11725 # # SOME_KIND int int double int double double
11726 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11730 ## Returns the string that describes if the shell is good for solid.
11731 # This is a support method for MakeSolid.
11733 # @param theShell the shell to be checked.
11734 # @return Returns a string that describes the shell validity for
11735 # solid construction.
11736 @ManageTransactions("MeasuOp")
11737 def _IsGoodForSolid(self, theShell):
11739 Returns the string that describes if the shell is good for solid.
11740 This is a support method for MakeSolid.
11743 theShell the shell to be checked.
11746 Returns a string that describes the shell validity for
11747 solid construction.
11749 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11752 # end of l2_measure
11755 ## @addtogroup l2_import_export
11758 ## Import a shape from the BREP, IGES, STEP or other file
11759 # (depends on given format) with given name.
11761 # Note: this function is deprecated, it is kept for backward compatibility only
11762 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11764 # @param theFileName The file, containing the shape.
11765 # @param theFormatName Specify format for the file reading.
11766 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11767 # If format 'IGES_SCALE' is used instead of 'IGES' or
11768 # format 'STEP_SCALE' is used instead of 'STEP',
11769 # length unit will be set to 'meter' and result model will be scaled.
11770 # @param theName Object name; when specified, this parameter is used
11771 # for result publication in the study. Otherwise, if automatic
11772 # publication is switched on, default value is used for result name.
11774 # @return New GEOM.GEOM_Object, containing the imported shape.
11775 # If material names are imported it returns the list of
11776 # objects. The first one is the imported object followed by
11778 # @note Auto publishing is allowed for the shape itself. Imported
11779 # material groups are not automatically published.
11781 # @ref swig_Import_Export "Example"
11782 @ManageTransactions("InsertOp")
11783 def ImportFile(self, theFileName, theFormatName, theName=None):
11785 Import a shape from the BREP, IGES, STEP or other file
11786 (depends on given format) with given name.
11788 Note: this function is deprecated, it is kept for backward compatibility only
11789 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11792 theFileName The file, containing the shape.
11793 theFormatName Specify format for the file reading.
11794 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11795 If format 'IGES_SCALE' is used instead of 'IGES' or
11796 format 'STEP_SCALE' is used instead of 'STEP',
11797 length unit will be set to 'meter' and result model will be scaled.
11798 theName Object name; when specified, this parameter is used
11799 for result publication in the study. Otherwise, if automatic
11800 publication is switched on, default value is used for result name.
11803 New GEOM.GEOM_Object, containing the imported shape.
11804 If material names are imported it returns the list of
11805 objects. The first one is the imported object followed by
11808 Auto publishing is allowed for the shape itself. Imported
11809 material groups are not automatically published.
11811 # Example: see GEOM_TestOthers.py
11813 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11814 where <FormatName> is a name of desirable format for importing.
11816 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11817 RaiseIfFailed("ImportFile", self.InsertOp)
11818 aNbObj = len(aListObj)
11820 self._autoPublish(aListObj[0], theName, "imported")
11825 ## Deprecated analog of ImportFile()
11826 def Import(self, theFileName, theFormatName, theName=None):
11828 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11830 # note: auto-publishing is done in self.ImportFile()
11831 return self.ImportFile(theFileName, theFormatName, theName)
11833 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11835 # @note As the byte-stream representing the shape data can be quite large, this method
11836 # is not automatically dumped to the Python script with the DumpStudy functionality;
11837 # so please use this method carefully, only for strong reasons.
11839 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11842 # @param theStream The BRep binary stream.
11843 # @param theName Object name; when specified, this parameter is used
11844 # for result publication in the study. Otherwise, if automatic
11845 # publication is switched on, default value is used for result name.
11847 # @return New GEOM_Object, containing the shape, read from theStream.
11849 # @ref swig_Import_Export "Example"
11850 @ManageTransactions("InsertOp")
11851 def RestoreShape (self, theStream, theName=None):
11853 Read a shape from the binary stream, containing its bounding representation (BRep).
11856 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11859 theStream The BRep binary stream.
11860 theName Object name; when specified, this parameter is used
11861 for result publication in the study. Otherwise, if automatic
11862 publication is switched on, default value is used for result name.
11865 New GEOM_Object, containing the shape, read from theStream.
11867 # Example: see GEOM_TestOthers.py
11869 # this is the workaround to ignore invalid case when data stream is empty
11870 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11871 print("WARNING: Result of RestoreShape is a NULL shape!")
11873 anObj = self.InsertOp.RestoreShape(theStream)
11874 RaiseIfFailed("RestoreShape", self.InsertOp)
11875 self._autoPublish(anObj, theName, "restored")
11878 ## Export the given shape into a file with given name.
11880 # Note: this function is deprecated, it is kept for backward compatibility only
11881 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11883 # @param theObject Shape to be stored in the file.
11884 # @param theFileName Name of the file to store the given shape in.
11885 # @param theFormatName Specify format for the shape storage.
11886 # Available formats can be obtained with
11887 # geompy.InsertOp.ExportTranslators()[0] method.
11889 # @ref swig_Import_Export "Example"
11890 @ManageTransactions("InsertOp")
11891 def Export(self, theObject, theFileName, theFormatName):
11893 Export the given shape into a file with given name.
11895 Note: this function is deprecated, it is kept for backward compatibility only
11896 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11899 theObject Shape to be stored in the file.
11900 theFileName Name of the file to store the given shape in.
11901 theFormatName Specify format for the shape storage.
11902 Available formats can be obtained with
11903 geompy.InsertOp.ExportTranslators()[0] method.
11905 # Example: see GEOM_TestOthers.py
11907 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11908 where <FormatName> is a name of desirable format for exporting.
11910 self.InsertOp.Export(theObject, theFileName, theFormatName)
11911 if self.InsertOp.IsDone() == 0:
11912 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11916 # end of l2_import_export
11919 ## @addtogroup l3_blocks
11922 ## Create a quadrangle face from four edges. Order of Edges is not
11923 # important. It is not necessary that edges share the same vertex.
11924 # @param E1,E2,E3,E4 Edges for the face bound.
11925 # @param theName Object name; when specified, this parameter is used
11926 # for result publication in the study. Otherwise, if automatic
11927 # publication is switched on, default value is used for result name.
11929 # @return New GEOM.GEOM_Object, containing the created face.
11931 # @ref tui_building_by_blocks_page "Example"
11932 @ManageTransactions("BlocksOp")
11933 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11935 Create a quadrangle face from four edges. Order of Edges is not
11936 important. It is not necessary that edges share the same vertex.
11939 E1,E2,E3,E4 Edges for the face bound.
11940 theName Object name; when specified, this parameter is used
11941 for result publication in the study. Otherwise, if automatic
11942 publication is switched on, default value is used for result name.
11945 New GEOM.GEOM_Object, containing the created face.
11948 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11950 # Example: see GEOM_Spanner.py
11951 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11952 RaiseIfFailed("MakeQuad", self.BlocksOp)
11953 self._autoPublish(anObj, theName, "quad")
11956 ## Create a quadrangle face on two edges.
11957 # The missing edges will be built by creating the shortest ones.
11958 # @param E1,E2 Two opposite edges for the face.
11959 # @param theName Object name; when specified, this parameter is used
11960 # for result publication in the study. Otherwise, if automatic
11961 # publication is switched on, default value is used for result name.
11963 # @return New GEOM.GEOM_Object, containing the created face.
11965 # @ref tui_building_by_blocks_page "Example"
11966 @ManageTransactions("BlocksOp")
11967 def MakeQuad2Edges(self, E1, E2, theName=None):
11969 Create a quadrangle face on two edges.
11970 The missing edges will be built by creating the shortest ones.
11973 E1,E2 Two opposite edges for the face.
11974 theName Object name; when specified, this parameter is used
11975 for result publication in the study. Otherwise, if automatic
11976 publication is switched on, default value is used for result name.
11979 New GEOM.GEOM_Object, containing the created face.
11983 p1 = geompy.MakeVertex( 0., 0., 0.)
11984 p2 = geompy.MakeVertex(150., 30., 0.)
11985 p3 = geompy.MakeVertex( 0., 120., 50.)
11986 p4 = geompy.MakeVertex( 0., 40., 70.)
11988 edge1 = geompy.MakeEdge(p1, p2)
11989 edge2 = geompy.MakeEdge(p3, p4)
11990 # create a quadrangle face from two edges
11991 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11993 # Example: see GEOM_Spanner.py
11994 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11995 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
11996 self._autoPublish(anObj, theName, "quad")
11999 ## Create a quadrangle face with specified corners.
12000 # The missing edges will be built by creating the shortest ones.
12001 # @param V1,V2,V3,V4 Corner vertices for the face.
12002 # @param theName Object name; when specified, this parameter is used
12003 # for result publication in the study. Otherwise, if automatic
12004 # publication is switched on, default value is used for result name.
12006 # @return New GEOM.GEOM_Object, containing the created face.
12008 # @ref tui_building_by_blocks_page "Example 1"
12009 # \n @ref swig_MakeQuad4Vertices "Example 2"
12010 @ManageTransactions("BlocksOp")
12011 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12013 Create a quadrangle face with specified corners.
12014 The missing edges will be built by creating the shortest ones.
12017 V1,V2,V3,V4 Corner vertices for the face.
12018 theName Object name; when specified, this parameter is used
12019 for result publication in the study. Otherwise, if automatic
12020 publication is switched on, default value is used for result name.
12023 New GEOM.GEOM_Object, containing the created face.
12027 p1 = geompy.MakeVertex( 0., 0., 0.)
12028 p2 = geompy.MakeVertex(150., 30., 0.)
12029 p3 = geompy.MakeVertex( 0., 120., 50.)
12030 p4 = geompy.MakeVertex( 0., 40., 70.)
12031 # create a quadrangle from four points in its corners
12032 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12034 # Example: see GEOM_Spanner.py
12035 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12036 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12037 self._autoPublish(anObj, theName, "quad")
12040 ## Create a hexahedral solid, bounded by the six given faces. Order of
12041 # faces is not important. It is not necessary that Faces share the same edge.
12042 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12043 # @param theName Object name; when specified, this parameter is used
12044 # for result publication in the study. Otherwise, if automatic
12045 # publication is switched on, default value is used for result name.
12047 # @return New GEOM.GEOM_Object, containing the created solid.
12049 # @ref tui_building_by_blocks_page "Example 1"
12050 # \n @ref swig_MakeHexa "Example 2"
12051 @ManageTransactions("BlocksOp")
12052 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12054 Create a hexahedral solid, bounded by the six given faces. Order of
12055 faces is not important. It is not necessary that Faces share the same edge.
12058 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12059 theName Object name; when specified, this parameter is used
12060 for result publication in the study. Otherwise, if automatic
12061 publication is switched on, default value is used for result name.
12064 New GEOM.GEOM_Object, containing the created solid.
12067 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12069 # Example: see GEOM_Spanner.py
12070 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12071 RaiseIfFailed("MakeHexa", self.BlocksOp)
12072 self._autoPublish(anObj, theName, "hexa")
12075 ## Create a hexahedral solid between two given faces.
12076 # The missing faces will be built by creating the smallest ones.
12077 # @param F1,F2 Two opposite faces for the hexahedral solid.
12078 # @param theName Object name; when specified, this parameter is used
12079 # for result publication in the study. Otherwise, if automatic
12080 # publication is switched on, default value is used for result name.
12082 # @return New GEOM.GEOM_Object, containing the created solid.
12084 # @ref tui_building_by_blocks_page "Example 1"
12085 # \n @ref swig_MakeHexa2Faces "Example 2"
12086 @ManageTransactions("BlocksOp")
12087 def MakeHexa2Faces(self, F1, F2, theName=None):
12089 Create a hexahedral solid between two given faces.
12090 The missing faces will be built by creating the smallest ones.
12093 F1,F2 Two opposite faces for the hexahedral solid.
12094 theName Object name; when specified, this parameter is used
12095 for result publication in the study. Otherwise, if automatic
12096 publication is switched on, default value is used for result name.
12099 New GEOM.GEOM_Object, containing the created solid.
12102 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12104 # Example: see GEOM_Spanner.py
12105 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12106 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12107 self._autoPublish(anObj, theName, "hexa")
12113 ## @addtogroup l3_blocks_op
12116 ## Get a vertex, found in the given shape by its coordinates.
12117 # @param theShape Block or a compound of blocks.
12118 # @param theX,theY,theZ Coordinates of the sought vertex.
12119 # @param theEpsilon Maximum allowed distance between the resulting
12120 # vertex and point with the given coordinates.
12121 # @param theName Object name; when specified, this parameter is used
12122 # for result publication in the study. Otherwise, if automatic
12123 # publication is switched on, default value is used for result name.
12125 # @return New GEOM.GEOM_Object, containing the found vertex.
12127 # @ref swig_GetPoint "Example"
12128 @ManageTransactions("BlocksOp")
12129 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12131 Get a vertex, found in the given shape by its coordinates.
12134 theShape Block or a compound of blocks.
12135 theX,theY,theZ Coordinates of the sought vertex.
12136 theEpsilon Maximum allowed distance between the resulting
12137 vertex and point with the given coordinates.
12138 theName Object name; when specified, this parameter is used
12139 for result publication in the study. Otherwise, if automatic
12140 publication is switched on, default value is used for result name.
12143 New GEOM.GEOM_Object, containing the found vertex.
12146 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12148 # Example: see GEOM_TestOthers.py
12149 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12150 RaiseIfFailed("GetPoint", self.BlocksOp)
12151 self._autoPublish(anObj, theName, "vertex")
12154 ## Find a vertex of the given shape, which has minimal distance to the given point.
12155 # @param theShape Any shape.
12156 # @param thePoint Point, close to the desired vertex.
12157 # @param theName Object name; when specified, this parameter is used
12158 # for result publication in the study. Otherwise, if automatic
12159 # publication is switched on, default value is used for result name.
12161 # @return New GEOM.GEOM_Object, containing the found vertex.
12163 # @ref swig_GetVertexNearPoint "Example"
12164 @ManageTransactions("BlocksOp")
12165 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12167 Find a vertex of the given shape, which has minimal distance to the given point.
12170 theShape Any shape.
12171 thePoint Point, close to the desired vertex.
12172 theName Object name; when specified, this parameter is used
12173 for result publication in the study. Otherwise, if automatic
12174 publication is switched on, default value is used for result name.
12177 New GEOM.GEOM_Object, containing the found vertex.
12180 pmidle = geompy.MakeVertex(50, 0, 50)
12181 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12183 # Example: see GEOM_TestOthers.py
12184 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12185 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12186 self._autoPublish(anObj, theName, "vertex")
12189 ## Get an edge, found in the given shape by two given vertices.
12190 # @param theShape Block or a compound of blocks.
12191 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12192 # @param theName Object name; when specified, this parameter is used
12193 # for result publication in the study. Otherwise, if automatic
12194 # publication is switched on, default value is used for result name.
12196 # @return New GEOM.GEOM_Object, containing the found edge.
12198 # @ref swig_GetEdge "Example"
12199 @ManageTransactions("BlocksOp")
12200 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12202 Get an edge, found in the given shape by two given vertices.
12205 theShape Block or a compound of blocks.
12206 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12207 theName Object name; when specified, this parameter is used
12208 for result publication in the study. Otherwise, if automatic
12209 publication is switched on, default value is used for result name.
12212 New GEOM.GEOM_Object, containing the found edge.
12214 # Example: see GEOM_Spanner.py
12215 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12216 RaiseIfFailed("GetEdge", self.BlocksOp)
12217 self._autoPublish(anObj, theName, "edge")
12220 ## Find an edge of the given shape, which has minimal distance to the given point.
12221 # @param theShape Block or a compound of blocks.
12222 # @param thePoint Point, close to the desired edge.
12223 # @param theName Object name; when specified, this parameter is used
12224 # for result publication in the study. Otherwise, if automatic
12225 # publication is switched on, default value is used for result name.
12227 # @return New GEOM.GEOM_Object, containing the found edge.
12229 # @ref swig_GetEdgeNearPoint "Example"
12230 @ManageTransactions("BlocksOp")
12231 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12233 Find an edge of the given shape, which has minimal distance to the given point.
12236 theShape Block or a compound of blocks.
12237 thePoint Point, close to the desired edge.
12238 theName Object name; when specified, this parameter is used
12239 for result publication in the study. Otherwise, if automatic
12240 publication is switched on, default value is used for result name.
12243 New GEOM.GEOM_Object, containing the found edge.
12245 # Example: see GEOM_TestOthers.py
12246 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12247 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12248 self._autoPublish(anObj, theName, "edge")
12251 ## Returns a face, found in the given shape by four given corner vertices.
12252 # @param theShape Block or a compound of blocks.
12253 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12254 # @param theName Object name; when specified, this parameter is used
12255 # for result publication in the study. Otherwise, if automatic
12256 # publication is switched on, default value is used for result name.
12258 # @return New GEOM.GEOM_Object, containing the found face.
12260 # @ref swig_todo "Example"
12261 @ManageTransactions("BlocksOp")
12262 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12264 Returns a face, found in the given shape by four given corner vertices.
12267 theShape Block or a compound of blocks.
12268 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12269 theName Object name; when specified, this parameter is used
12270 for result publication in the study. Otherwise, if automatic
12271 publication is switched on, default value is used for result name.
12274 New GEOM.GEOM_Object, containing the found face.
12276 # Example: see GEOM_Spanner.py
12277 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12278 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12279 self._autoPublish(anObj, theName, "face")
12282 ## Get a face of block, found in the given shape by two given edges.
12283 # @param theShape Block or a compound of blocks.
12284 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12285 # @param theName Object name; when specified, this parameter is used
12286 # for result publication in the study. Otherwise, if automatic
12287 # publication is switched on, default value is used for result name.
12289 # @return New GEOM.GEOM_Object, containing the found face.
12291 # @ref swig_todo "Example"
12292 @ManageTransactions("BlocksOp")
12293 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12295 Get a face of block, found in the given shape by two given edges.
12298 theShape Block or a compound of blocks.
12299 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12300 theName Object name; when specified, this parameter is used
12301 for result publication in the study. Otherwise, if automatic
12302 publication is switched on, default value is used for result name.
12305 New GEOM.GEOM_Object, containing the found face.
12307 # Example: see GEOM_Spanner.py
12308 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12309 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12310 self._autoPublish(anObj, theName, "face")
12313 ## Find a face, opposite to the given one in the given block.
12314 # @param theBlock Must be a hexahedral solid.
12315 # @param theFace Face of \a theBlock, opposite to the desired face.
12316 # @param theName Object name; when specified, this parameter is used
12317 # for result publication in the study. Otherwise, if automatic
12318 # publication is switched on, default value is used for result name.
12320 # @return New GEOM.GEOM_Object, containing the found face.
12322 # @ref swig_GetOppositeFace "Example"
12323 @ManageTransactions("BlocksOp")
12324 def GetOppositeFace(self, theBlock, theFace, theName=None):
12326 Find a face, opposite to the given one in the given block.
12329 theBlock Must be a hexahedral solid.
12330 theFace Face of theBlock, opposite to the desired face.
12331 theName Object name; when specified, this parameter is used
12332 for result publication in the study. Otherwise, if automatic
12333 publication is switched on, default value is used for result name.
12336 New GEOM.GEOM_Object, containing the found face.
12338 # Example: see GEOM_Spanner.py
12339 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12340 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12341 self._autoPublish(anObj, theName, "face")
12344 ## Find a face of the given shape, which has minimal distance to the given point.
12345 # @param theShape Block or a compound of blocks.
12346 # @param thePoint Point, close to the desired face.
12347 # @param theName Object name; when specified, this parameter is used
12348 # for result publication in the study. Otherwise, if automatic
12349 # publication is switched on, default value is used for result name.
12351 # @return New GEOM.GEOM_Object, containing the found face.
12353 # @ref swig_GetFaceNearPoint "Example"
12354 @ManageTransactions("BlocksOp")
12355 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12357 Find a face of the given shape, which has minimal distance to the given point.
12360 theShape Block or a compound of blocks.
12361 thePoint Point, close to the desired face.
12362 theName Object name; when specified, this parameter is used
12363 for result publication in the study. Otherwise, if automatic
12364 publication is switched on, default value is used for result name.
12367 New GEOM.GEOM_Object, containing the found face.
12369 # Example: see GEOM_Spanner.py
12370 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12371 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12372 self._autoPublish(anObj, theName, "face")
12375 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12376 # @param theBlock Block or a compound of blocks.
12377 # @param theVector Vector, close to the normale of the desired face.
12378 # @param theName Object name; when specified, this parameter is used
12379 # for result publication in the study. Otherwise, if automatic
12380 # publication is switched on, default value is used for result name.
12382 # @return New GEOM.GEOM_Object, containing the found face.
12384 # @ref swig_todo "Example"
12385 @ManageTransactions("BlocksOp")
12386 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12388 Find a face of block, whose outside normale has minimal angle with the given vector.
12391 theBlock Block or a compound of blocks.
12392 theVector Vector, close to the normale of the desired face.
12393 theName Object name; when specified, this parameter is used
12394 for result publication in the study. Otherwise, if automatic
12395 publication is switched on, default value is used for result name.
12398 New GEOM.GEOM_Object, containing the found face.
12400 # Example: see GEOM_Spanner.py
12401 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12402 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12403 self._autoPublish(anObj, theName, "face")
12406 ## Find all sub-shapes of type \a theShapeType of the given shape,
12407 # which have minimal distance to the given point.
12408 # @param theShape Any shape.
12409 # @param thePoint Point, close to the desired shape.
12410 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12411 # @param theTolerance The tolerance for distances comparison. All shapes
12412 # with distances to the given point in interval
12413 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12414 # @param theName Object name; when specified, this parameter is used
12415 # for result publication in the study. Otherwise, if automatic
12416 # publication is switched on, default value is used for result name.
12418 # @return New GEOM_Object, containing a group of all found shapes.
12420 # @ref swig_GetShapesNearPoint "Example"
12421 @ManageTransactions("BlocksOp")
12422 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12424 Find all sub-shapes of type theShapeType of the given shape,
12425 which have minimal distance to the given point.
12428 theShape Any shape.
12429 thePoint Point, close to the desired shape.
12430 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12431 theTolerance The tolerance for distances comparison. All shapes
12432 with distances to the given point in interval
12433 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12434 theName Object name; when specified, this parameter is used
12435 for result publication in the study. Otherwise, if automatic
12436 publication is switched on, default value is used for result name.
12439 New GEOM_Object, containing a group of all found shapes.
12441 # Example: see GEOM_TestOthers.py
12442 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12443 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12444 self._autoPublish(anObj, theName, "group")
12447 # end of l3_blocks_op
12450 ## @addtogroup l4_blocks_measure
12453 ## Check, if the compound of blocks is given.
12454 # To be considered as a compound of blocks, the
12455 # given shape must satisfy the following conditions:
12456 # - Each element of the compound should be a Block (6 faces).
12457 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12458 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12459 # there are more than 4 edges in the only wire of a face,
12460 # this face is considered to be quadrangle if it has 4 bounds
12461 # (1 or more edge) of C1 continuity.
12462 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12463 # - The compound should be connexe.
12464 # - The glue between two quadrangle faces should be applied.
12465 # @param theCompound The compound to check.
12466 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12467 # taking into account C1 continuity.
12468 # @param theAngTolerance the angular tolerance to check if two neighbor
12469 # edges are codirectional in the common vertex with this
12470 # tolerance. This parameter is used only if
12471 # <VAR>theIsUseC1</VAR> is set to True.
12472 # @return TRUE, if the given shape is a compound of blocks.
12473 # If theCompound is not valid, prints all discovered errors.
12475 # @ref tui_check_compound_of_blocks_page "Example 1"
12476 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12477 @ManageTransactions("BlocksOp")
12478 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12479 theAngTolerance = 1.e-12):
12481 Check, if the compound of blocks is given.
12482 To be considered as a compound of blocks, the
12483 given shape must satisfy the following conditions:
12484 - Each element of the compound should be a Block (6 faces).
12485 - Each face should be a quadrangle, i.e. it should have only 1 wire
12486 with 4 edges. If theIsUseC1 is set to True and
12487 there are more than 4 edges in the only wire of a face,
12488 this face is considered to be quadrangle if it has 4 bounds
12489 (1 or more edge) of C1 continuity.
12490 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12491 - The compound should be connexe.
12492 - The glue between two quadrangle faces should be applied.
12495 theCompound The compound to check.
12496 theIsUseC1 Flag to check if there are 4 bounds on a face
12497 taking into account C1 continuity.
12498 theAngTolerance the angular tolerance to check if two neighbor
12499 edges are codirectional in the common vertex with this
12500 tolerance. This parameter is used only if
12501 theIsUseC1 is set to True.
12504 TRUE, if the given shape is a compound of blocks.
12505 If theCompound is not valid, prints all discovered errors.
12507 # Example: see GEOM_Spanner.py
12510 aTolerance = theAngTolerance
12511 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12512 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12514 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12518 ## Retrieve all non blocks solids and faces from \a theShape.
12519 # @param theShape The shape to explore.
12520 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12521 # taking into account C1 continuity.
12522 # @param theAngTolerance the angular tolerance to check if two neighbor
12523 # edges are codirectional in the common vertex with this
12524 # tolerance. This parameter is used only if
12525 # <VAR>theIsUseC1</VAR> is set to True.
12526 # @param theName Object name; when specified, this parameter is used
12527 # for result publication in the study. Otherwise, if automatic
12528 # publication is switched on, default value is used for result name.
12530 # @return A tuple of two GEOM_Objects. The first object is a group of all
12531 # non block solids (= not 6 faces, or with 6 faces, but with the
12532 # presence of non-quadrangular faces). The second object is a
12533 # group of all non quadrangular faces (= faces with more then
12534 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12535 # with 1 wire with not 4 edges that do not form 4 bounds of
12538 # @ref tui_get_non_blocks_page "Example 1"
12539 # \n @ref swig_GetNonBlocks "Example 2"
12540 @ManageTransactions("BlocksOp")
12541 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12542 theAngTolerance = 1.e-12, theName=None):
12544 Retrieve all non blocks solids and faces from theShape.
12547 theShape The shape to explore.
12548 theIsUseC1 Flag to check if there are 4 bounds on a face
12549 taking into account C1 continuity.
12550 theAngTolerance the angular tolerance to check if two neighbor
12551 edges are codirectional in the common vertex with this
12552 tolerance. This parameter is used only if
12553 theIsUseC1 is set to True.
12554 theName Object name; when specified, this parameter is used
12555 for result publication in the study. Otherwise, if automatic
12556 publication is switched on, default value is used for result name.
12559 A tuple of two GEOM_Objects. The first object is a group of all
12560 non block solids (= not 6 faces, or with 6 faces, but with the
12561 presence of non-quadrangular faces). The second object is a
12562 group of all non quadrangular faces (= faces with more then
12563 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12564 with 1 wire with not 4 edges that do not form 4 bounds of
12568 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12570 # Example: see GEOM_Spanner.py
12573 aTolerance = theAngTolerance
12574 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12575 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12576 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12579 ## Remove all seam and degenerated edges from \a theShape.
12580 # Unite faces and edges, sharing one surface. It means that
12581 # this faces must have references to one C++ surface object (handle).
12582 # @param theShape The compound or single solid to remove irregular edges from.
12583 # @param doUnionFaces If True, then unite faces. If False (the default value),
12584 # do not unite faces.
12585 # @param theName Object name; when specified, this parameter is used
12586 # for result publication in the study. Otherwise, if automatic
12587 # publication is switched on, default value is used for result name.
12589 # @return Improved shape.
12591 # @ref swig_RemoveExtraEdges "Example"
12592 @ManageTransactions("BlocksOp")
12593 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12595 Remove all seam and degenerated edges from theShape.
12596 Unite faces and edges, sharing one surface. It means that
12597 this faces must have references to one C++ surface object (handle).
12600 theShape The compound or single solid to remove irregular edges from.
12601 doUnionFaces If True, then unite faces. If False (the default value),
12602 do not unite faces.
12603 theName Object name; when specified, this parameter is used
12604 for result publication in the study. Otherwise, if automatic
12605 publication is switched on, default value is used for result name.
12610 # Example: see GEOM_TestOthers.py
12611 nbFacesOptimum = -1 # -1 means do not unite faces
12612 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12613 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12614 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12615 self._autoPublish(anObj, theName, "removeExtraEdges")
12618 ## Performs union faces of \a theShape
12619 # Unite faces sharing one surface. It means that
12620 # these faces must have references to one C++ surface object (handle).
12621 # @param theShape The compound or single solid that contains faces
12622 # to perform union.
12623 # @param theName Object name; when specified, this parameter is used
12624 # for result publication in the study. Otherwise, if automatic
12625 # publication is switched on, default value is used for result name.
12627 # @return Improved shape.
12629 # @ref swig_UnionFaces "Example"
12630 @ManageTransactions("BlocksOp")
12631 def UnionFaces(self, theShape, theName=None):
12633 Performs union faces of theShape.
12634 Unite faces sharing one surface. It means that
12635 these faces must have references to one C++ surface object (handle).
12638 theShape The compound or single solid that contains faces
12640 theName Object name; when specified, this parameter is used
12641 for result publication in the study. Otherwise, if automatic
12642 publication is switched on, default value is used for result name.
12647 # Example: see GEOM_TestOthers.py
12648 anObj = self.BlocksOp.UnionFaces(theShape)
12649 RaiseIfFailed("UnionFaces", self.BlocksOp)
12650 self._autoPublish(anObj, theName, "unionFaces")
12653 ## Check, if the given shape is a blocks compound.
12654 # Fix all detected errors.
12655 # \note Single block can be also fixed by this method.
12656 # @param theShape The compound to check and improve.
12657 # @param theName Object name; when specified, this parameter is used
12658 # for result publication in the study. Otherwise, if automatic
12659 # publication is switched on, default value is used for result name.
12661 # @return Improved compound.
12663 # @ref swig_CheckAndImprove "Example"
12664 @ManageTransactions("BlocksOp")
12665 def CheckAndImprove(self, theShape, theName=None):
12667 Check, if the given shape is a blocks compound.
12668 Fix all detected errors.
12671 Single block can be also fixed by this method.
12674 theShape The compound to check and improve.
12675 theName Object name; when specified, this parameter is used
12676 for result publication in the study. Otherwise, if automatic
12677 publication is switched on, default value is used for result name.
12682 # Example: see GEOM_TestOthers.py
12683 anObj = self.BlocksOp.CheckAndImprove(theShape)
12684 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12685 self._autoPublish(anObj, theName, "improved")
12688 # end of l4_blocks_measure
12691 ## @addtogroup l3_blocks_op
12694 ## Get all the blocks, contained in the given compound.
12695 # @param theCompound The compound to explode.
12696 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12697 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12698 # @param theName Object name; when specified, this parameter is used
12699 # for result publication in the study. Otherwise, if automatic
12700 # publication is switched on, default value is used for result name.
12702 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12704 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12706 # @ref tui_explode_on_blocks "Example 1"
12707 # \n @ref swig_MakeBlockExplode "Example 2"
12708 @ManageTransactions("BlocksOp")
12709 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12711 Get all the blocks, contained in the given compound.
12714 theCompound The compound to explode.
12715 theMinNbFaces If solid has lower number of faces, it is not a block.
12716 theMaxNbFaces If solid has higher number of faces, it is not a block.
12717 theName Object name; when specified, this parameter is used
12718 for result publication in the study. Otherwise, if automatic
12719 publication is switched on, default value is used for result name.
12722 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12725 List of GEOM.GEOM_Object, containing the retrieved blocks.
12727 # Example: see GEOM_TestOthers.py
12728 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12729 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12730 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12731 for anObj in aList:
12732 anObj.SetParameters(Parameters)
12734 self._autoPublish(aList, theName, "block")
12737 ## Find block, containing the given point inside its volume or on boundary.
12738 # @param theCompound Compound, to find block in.
12739 # @param thePoint Point, close to the desired block. If the point lays on
12740 # boundary between some blocks, we return block with nearest center.
12741 # @param theName Object name; when specified, this parameter is used
12742 # for result publication in the study. Otherwise, if automatic
12743 # publication is switched on, default value is used for result name.
12745 # @return New GEOM.GEOM_Object, containing the found block.
12747 # @ref swig_todo "Example"
12748 @ManageTransactions("BlocksOp")
12749 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12751 Find block, containing the given point inside its volume or on boundary.
12754 theCompound Compound, to find block in.
12755 thePoint Point, close to the desired block. If the point lays on
12756 boundary between some blocks, we return block with nearest center.
12757 theName Object name; when specified, this parameter is used
12758 for result publication in the study. Otherwise, if automatic
12759 publication is switched on, default value is used for result name.
12762 New GEOM.GEOM_Object, containing the found block.
12764 # Example: see GEOM_Spanner.py
12765 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12766 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12767 self._autoPublish(anObj, theName, "block")
12770 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12771 # @param theCompound Compound, to find block in.
12772 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12773 # @param theName Object name; when specified, this parameter is used
12774 # for result publication in the study. Otherwise, if automatic
12775 # publication is switched on, default value is used for result name.
12777 # @return New GEOM.GEOM_Object, containing the found block.
12779 # @ref swig_GetBlockByParts "Example"
12780 @ManageTransactions("BlocksOp")
12781 def GetBlockByParts(self, theCompound, theParts, theName=None):
12783 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12786 theCompound Compound, to find block in.
12787 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12788 theName Object name; when specified, this parameter is used
12789 for result publication in the study. Otherwise, if automatic
12790 publication is switched on, default value is used for result name.
12793 New GEOM_Object, containing the found block.
12795 # Example: see GEOM_TestOthers.py
12796 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12797 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12798 self._autoPublish(anObj, theName, "block")
12801 ## Return all blocks, containing all the elements, passed as the parts.
12802 # @param theCompound Compound, to find blocks in.
12803 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12804 # @param theName Object name; when specified, this parameter is used
12805 # for result publication in the study. Otherwise, if automatic
12806 # publication is switched on, default value is used for result name.
12808 # @return List of GEOM.GEOM_Object, containing the found blocks.
12810 # @ref swig_todo "Example"
12811 @ManageTransactions("BlocksOp")
12812 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12814 Return all blocks, containing all the elements, passed as the parts.
12817 theCompound Compound, to find blocks in.
12818 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12819 theName Object name; when specified, this parameter is used
12820 for result publication in the study. Otherwise, if automatic
12821 publication is switched on, default value is used for result name.
12824 List of GEOM.GEOM_Object, containing the found blocks.
12826 # Example: see GEOM_Spanner.py
12827 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12828 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12829 self._autoPublish(aList, theName, "block")
12832 ## Multi-transformate block and glue the result.
12833 # Transformation is defined so, as to superpose direction faces.
12834 # @param Block Hexahedral solid to be multi-transformed.
12835 # @param DirFace1 ID of First direction face.
12836 # @param DirFace2 ID of Second direction face.
12837 # @param NbTimes Quantity of transformations to be done.
12838 # @param theName Object name; when specified, this parameter is used
12839 # for result publication in the study. Otherwise, if automatic
12840 # publication is switched on, default value is used for result name.
12842 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12844 # @return New GEOM.GEOM_Object, containing the result shape.
12846 # @ref tui_multi_transformation "Example"
12847 @ManageTransactions("BlocksOp")
12848 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12850 Multi-transformate block and glue the result.
12851 Transformation is defined so, as to superpose direction faces.
12854 Block Hexahedral solid to be multi-transformed.
12855 DirFace1 ID of First direction face.
12856 DirFace2 ID of Second direction face.
12857 NbTimes Quantity of transformations to be done.
12858 theName Object name; when specified, this parameter is used
12859 for result publication in the study. Otherwise, if automatic
12860 publication is switched on, default value is used for result name.
12863 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12866 New GEOM.GEOM_Object, containing the result shape.
12868 # Example: see GEOM_Spanner.py
12869 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12870 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12871 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12872 anObj.SetParameters(Parameters)
12873 self._autoPublish(anObj, theName, "transformed")
12876 ## Multi-transformate block and glue the result.
12877 # @param Block Hexahedral solid to be multi-transformed.
12878 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12879 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12880 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12881 # @param theName Object name; when specified, this parameter is used
12882 # for result publication in the study. Otherwise, if automatic
12883 # publication is switched on, default value is used for result name.
12885 # @return New GEOM.GEOM_Object, containing the result shape.
12887 # @ref tui_multi_transformation "Example"
12888 @ManageTransactions("BlocksOp")
12889 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12890 DirFace1V, DirFace2V, NbTimesV, theName=None):
12892 Multi-transformate block and glue the result.
12895 Block Hexahedral solid to be multi-transformed.
12896 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12897 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12898 NbTimesU,NbTimesV Quantity of transformations to be done.
12899 theName Object name; when specified, this parameter is used
12900 for result publication in the study. Otherwise, if automatic
12901 publication is switched on, default value is used for result name.
12904 New GEOM.GEOM_Object, containing the result shape.
12906 # Example: see GEOM_Spanner.py
12907 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12908 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12909 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12910 DirFace1V, DirFace2V, NbTimesV)
12911 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12912 anObj.SetParameters(Parameters)
12913 self._autoPublish(anObj, theName, "transformed")
12916 ## Build all possible propagation groups.
12917 # Propagation group is a set of all edges, opposite to one (main)
12918 # edge of this group directly or through other opposite edges.
12919 # Notion of Opposite Edge make sense only on quadrangle face.
12920 # @param theShape Shape to build propagation groups on.
12921 # @param theName Object name; when specified, this parameter is used
12922 # for result publication in the study. Otherwise, if automatic
12923 # publication is switched on, default value is used for result name.
12925 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12927 # @ref swig_Propagate "Example"
12928 @ManageTransactions("BlocksOp")
12929 def Propagate(self, theShape, theName=None):
12931 Build all possible propagation groups.
12932 Propagation group is a set of all edges, opposite to one (main)
12933 edge of this group directly or through other opposite edges.
12934 Notion of Opposite Edge make sense only on quadrangle face.
12937 theShape Shape to build propagation groups on.
12938 theName Object name; when specified, this parameter is used
12939 for result publication in the study. Otherwise, if automatic
12940 publication is switched on, default value is used for result name.
12943 List of GEOM.GEOM_Object, each of them is a propagation group.
12945 # Example: see GEOM_TestOthers.py
12946 listChains = self.BlocksOp.Propagate(theShape)
12947 RaiseIfFailed("Propagate", self.BlocksOp)
12948 self._autoPublish(listChains, theName, "propagate")
12951 # end of l3_blocks_op
12954 ## @addtogroup l3_groups
12957 ## Creates a new group which will store sub-shapes of theMainShape
12958 # @param theMainShape is a GEOM object on which the group is selected
12959 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12960 # @param theName Object name; when specified, this parameter is used
12961 # for result publication in the study. Otherwise, if automatic
12962 # publication is switched on, default value is used for result name.
12964 # @return a newly created GEOM group (GEOM.GEOM_Object)
12966 # @ref tui_working_with_groups_page "Example 1"
12967 # \n @ref swig_CreateGroup "Example 2"
12968 @ManageTransactions("GroupOp")
12969 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12971 Creates a new group which will store sub-shapes of theMainShape
12974 theMainShape is a GEOM object on which the group is selected
12975 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12976 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12977 theName Object name; when specified, this parameter is used
12978 for result publication in the study. Otherwise, if automatic
12979 publication is switched on, default value is used for result name.
12982 a newly created GEOM group
12985 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12988 # Example: see GEOM_TestOthers.py
12989 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12990 RaiseIfFailed("CreateGroup", self.GroupOp)
12991 self._autoPublish(anObj, theName, "group")
12994 ## Adds a sub-object with ID theSubShapeId to the group
12995 # @param theGroup is a GEOM group to which the new sub-shape is added
12996 # @param theSubShapeID is a sub-shape ID in the main object.
12997 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
12999 # @ref tui_working_with_groups_page "Example"
13000 @ManageTransactions("GroupOp")
13001 def AddObject(self,theGroup, theSubShapeID):
13003 Adds a sub-object with ID theSubShapeId to the group
13006 theGroup is a GEOM group to which the new sub-shape is added
13007 theSubShapeID is a sub-shape ID in the main object.
13010 Use method GetSubShapeID() to get an unique ID of the sub-shape
13012 # Example: see GEOM_TestOthers.py
13013 self.GroupOp.AddObject(theGroup, theSubShapeID)
13014 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13015 RaiseIfFailed("AddObject", self.GroupOp)
13019 ## Removes a sub-object with ID \a theSubShapeId from the group
13020 # @param theGroup is a GEOM group from which the new sub-shape is removed
13021 # @param theSubShapeID is a sub-shape ID in the main object.
13022 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13024 # @ref tui_working_with_groups_page "Example"
13025 @ManageTransactions("GroupOp")
13026 def RemoveObject(self,theGroup, theSubShapeID):
13028 Removes a sub-object with ID theSubShapeId from the group
13031 theGroup is a GEOM group from which the new sub-shape is removed
13032 theSubShapeID is a sub-shape ID in the main object.
13035 Use method GetSubShapeID() to get an unique ID of the sub-shape
13037 # Example: see GEOM_TestOthers.py
13038 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13039 RaiseIfFailed("RemoveObject", self.GroupOp)
13042 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13043 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13044 # @param theSubShapes is a list of sub-shapes to be added.
13046 # @ref tui_working_with_groups_page "Example"
13047 @ManageTransactions("GroupOp")
13048 def UnionList (self,theGroup, theSubShapes):
13050 Adds to the group all the given shapes. No errors, if some shapes are already included.
13053 theGroup is a GEOM group to which the new sub-shapes are added.
13054 theSubShapes is a list of sub-shapes to be added.
13056 # Example: see GEOM_TestOthers.py
13057 self.GroupOp.UnionList(theGroup, theSubShapes)
13058 RaiseIfFailed("UnionList", self.GroupOp)
13061 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13062 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13063 # @param theSubShapes is a list of indices of sub-shapes to be added.
13065 # @ref swig_UnionIDs "Example"
13066 @ManageTransactions("GroupOp")
13067 def UnionIDs(self,theGroup, theSubShapes):
13069 Adds to the group all the given shapes. No errors, if some shapes are already included.
13072 theGroup is a GEOM group to which the new sub-shapes are added.
13073 theSubShapes is a list of indices of sub-shapes to be added.
13075 # Example: see GEOM_TestOthers.py
13076 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13077 RaiseIfFailed("UnionIDs", self.GroupOp)
13080 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13081 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13082 # @param theSubShapes is a list of sub-shapes to be removed.
13084 # @ref tui_working_with_groups_page "Example"
13085 @ManageTransactions("GroupOp")
13086 def DifferenceList (self,theGroup, theSubShapes):
13088 Removes from the group all the given shapes. No errors, if some shapes are not included.
13091 theGroup is a GEOM group from which the sub-shapes are removed.
13092 theSubShapes is a list of sub-shapes to be removed.
13094 # Example: see GEOM_TestOthers.py
13095 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13096 RaiseIfFailed("DifferenceList", self.GroupOp)
13099 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13100 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13101 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13103 # @ref swig_DifferenceIDs "Example"
13104 @ManageTransactions("GroupOp")
13105 def DifferenceIDs(self,theGroup, theSubShapes):
13107 Removes from the group all the given shapes. No errors, if some shapes are not included.
13110 theGroup is a GEOM group from which the sub-shapes are removed.
13111 theSubShapes is a list of indices of sub-shapes to be removed.
13113 # Example: see GEOM_TestOthers.py
13114 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13115 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13118 ## Union of two groups.
13119 # New group is created. It will contain all entities
13120 # which are present in groups theGroup1 and theGroup2.
13121 # @param theGroup1, theGroup2 are the initial GEOM groups
13122 # to create the united group from.
13123 # @param theName Object name; when specified, this parameter is used
13124 # for result publication in the study. Otherwise, if automatic
13125 # publication is switched on, default value is used for result name.
13127 # @return a newly created GEOM group.
13129 # @ref tui_union_groups_anchor "Example"
13130 @ManageTransactions("GroupOp")
13131 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13133 Union of two groups.
13134 New group is created. It will contain all entities
13135 which are present in groups theGroup1 and theGroup2.
13138 theGroup1, theGroup2 are the initial GEOM groups
13139 to create the united group from.
13140 theName Object name; when specified, this parameter is used
13141 for result publication in the study. Otherwise, if automatic
13142 publication is switched on, default value is used for result name.
13145 a newly created GEOM group.
13147 # Example: see GEOM_TestOthers.py
13148 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13149 RaiseIfFailed("UnionGroups", self.GroupOp)
13150 self._autoPublish(aGroup, theName, "group")
13153 ## Intersection of two groups.
13154 # New group is created. It will contain only those entities
13155 # which are present in both groups theGroup1 and theGroup2.
13156 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13157 # @param theName Object name; when specified, this parameter is used
13158 # for result publication in the study. Otherwise, if automatic
13159 # publication is switched on, default value is used for result name.
13161 # @return a newly created GEOM group.
13163 # @ref tui_intersect_groups_anchor "Example"
13164 @ManageTransactions("GroupOp")
13165 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13167 Intersection of two groups.
13168 New group is created. It will contain only those entities
13169 which are present in both groups theGroup1 and theGroup2.
13172 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13173 theName Object name; when specified, this parameter is used
13174 for result publication in the study. Otherwise, if automatic
13175 publication is switched on, default value is used for result name.
13178 a newly created GEOM group.
13180 # Example: see GEOM_TestOthers.py
13181 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13182 RaiseIfFailed("IntersectGroups", self.GroupOp)
13183 self._autoPublish(aGroup, theName, "group")
13186 ## Cut of two groups.
13187 # New group is created. It will contain entities which are
13188 # present in group theGroup1 but are not present in group theGroup2.
13189 # @param theGroup1 is a GEOM group to include elements of.
13190 # @param theGroup2 is a GEOM group to exclude elements of.
13191 # @param theName Object name; when specified, this parameter is used
13192 # for result publication in the study. Otherwise, if automatic
13193 # publication is switched on, default value is used for result name.
13195 # @return a newly created GEOM group.
13197 # @ref tui_cut_groups_anchor "Example"
13198 @ManageTransactions("GroupOp")
13199 def CutGroups (self, theGroup1, theGroup2, theName=None):
13202 New group is created. It will contain entities which are
13203 present in group theGroup1 but are not present in group theGroup2.
13206 theGroup1 is a GEOM group to include elements of.
13207 theGroup2 is a GEOM group to exclude elements of.
13208 theName Object name; when specified, this parameter is used
13209 for result publication in the study. Otherwise, if automatic
13210 publication is switched on, default value is used for result name.
13213 a newly created GEOM group.
13215 # Example: see GEOM_TestOthers.py
13216 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13217 RaiseIfFailed("CutGroups", self.GroupOp)
13218 self._autoPublish(aGroup, theName, "group")
13221 ## Union of list of groups.
13222 # New group is created. It will contain all entities that are
13223 # present in groups listed in theGList.
13224 # @param theGList is a list of GEOM groups to create the united group from.
13225 # @param theName Object name; when specified, this parameter is used
13226 # for result publication in the study. Otherwise, if automatic
13227 # publication is switched on, default value is used for result name.
13229 # @return a newly created GEOM group.
13231 # @ref tui_union_groups_anchor "Example"
13232 @ManageTransactions("GroupOp")
13233 def UnionListOfGroups (self, theGList, theName=None):
13235 Union of list of groups.
13236 New group is created. It will contain all entities that are
13237 present in groups listed in theGList.
13240 theGList is a list of GEOM groups to create the united group from.
13241 theName Object name; when specified, this parameter is used
13242 for result publication in the study. Otherwise, if automatic
13243 publication is switched on, default value is used for result name.
13246 a newly created GEOM group.
13248 # Example: see GEOM_TestOthers.py
13249 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13250 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13251 self._autoPublish(aGroup, theName, "group")
13254 ## Cut of lists of groups.
13255 # New group is created. It will contain only entities
13256 # which are present in groups listed in theGList.
13257 # @param theGList is a list of GEOM groups to include elements of.
13258 # @param theName Object name; when specified, this parameter is used
13259 # for result publication in the study. Otherwise, if automatic
13260 # publication is switched on, default value is used for result name.
13262 # @return a newly created GEOM group.
13264 # @ref tui_intersect_groups_anchor "Example"
13265 @ManageTransactions("GroupOp")
13266 def IntersectListOfGroups (self, theGList, theName=None):
13268 Cut of lists of groups.
13269 New group is created. It will contain only entities
13270 which are present in groups listed in theGList.
13273 theGList is a list of GEOM groups to include elements of.
13274 theName Object name; when specified, this parameter is used
13275 for result publication in the study. Otherwise, if automatic
13276 publication is switched on, default value is used for result name.
13279 a newly created GEOM group.
13281 # Example: see GEOM_TestOthers.py
13282 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13283 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13284 self._autoPublish(aGroup, theName, "group")
13287 ## Cut of lists of groups.
13288 # New group is created. It will contain only entities
13289 # which are present in groups listed in theGList1 but
13290 # are not present in groups from theGList2.
13291 # @param theGList1 is a list of GEOM groups to include elements of.
13292 # @param theGList2 is a list of GEOM groups to exclude elements of.
13293 # @param theName Object name; when specified, this parameter is used
13294 # for result publication in the study. Otherwise, if automatic
13295 # publication is switched on, default value is used for result name.
13297 # @return a newly created GEOM group.
13299 # @ref tui_cut_groups_anchor "Example"
13300 @ManageTransactions("GroupOp")
13301 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13303 Cut of lists of groups.
13304 New group is created. It will contain only entities
13305 which are present in groups listed in theGList1 but
13306 are not present in groups from theGList2.
13309 theGList1 is a list of GEOM groups to include elements of.
13310 theGList2 is a list of GEOM groups to exclude elements of.
13311 theName Object name; when specified, this parameter is used
13312 for result publication in the study. Otherwise, if automatic
13313 publication is switched on, default value is used for result name.
13316 a newly created GEOM group.
13318 # Example: see GEOM_TestOthers.py
13319 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13320 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13321 self._autoPublish(aGroup, theName, "group")
13324 ## Returns a list of sub-objects ID stored in the group
13325 # @param theGroup is a GEOM group for which a list of IDs is requested
13327 # @ref swig_GetObjectIDs "Example"
13328 @ManageTransactions("GroupOp")
13329 def GetObjectIDs(self,theGroup):
13331 Returns a list of sub-objects ID stored in the group
13334 theGroup is a GEOM group for which a list of IDs is requested
13336 # Example: see GEOM_TestOthers.py
13337 ListIDs = self.GroupOp.GetObjects(theGroup)
13338 RaiseIfFailed("GetObjects", self.GroupOp)
13341 ## Returns a type of sub-objects stored in the group
13342 # @param theGroup is a GEOM group which type is returned.
13344 # @ref swig_GetType "Example"
13345 @ManageTransactions("GroupOp")
13346 def GetType(self,theGroup):
13348 Returns a type of sub-objects stored in the group
13351 theGroup is a GEOM group which type is returned.
13353 # Example: see GEOM_TestOthers.py
13354 aType = self.GroupOp.GetType(theGroup)
13355 RaiseIfFailed("GetType", self.GroupOp)
13358 ## Convert a type of geom object from id to string value
13359 # @param theId is a GEOM object type id.
13360 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13361 # @ref swig_GetType "Example"
13362 def ShapeIdToType(self, theId):
13364 Convert a type of geom object from id to string value
13367 theId is a GEOM object type id.
13370 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13397 return "REVOLUTION"
13445 return "FREE_BOUNDS"
13453 return "THRUSECTIONS"
13455 return "COMPOUNDFILTER"
13457 return "SHAPES_ON_SHAPE"
13459 return "ELLIPSE_ARC"
13461 return "3DSKETCHER"
13467 return "PIPETSHAPE"
13468 return "Shape Id not exist."
13470 ## Returns a main shape associated with the group
13471 # @param theGroup is a GEOM group for which a main shape object is requested
13472 # @return a GEOM object which is a main shape for theGroup
13474 # @ref swig_GetMainShape "Example"
13475 @ManageTransactions("GroupOp")
13476 def GetMainShape(self,theGroup):
13478 Returns a main shape associated with the group
13481 theGroup is a GEOM group for which a main shape object is requested
13484 a GEOM object which is a main shape for theGroup
13486 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13488 # Example: see GEOM_TestOthers.py
13489 anObj = self.GroupOp.GetMainShape(theGroup)
13490 RaiseIfFailed("GetMainShape", self.GroupOp)
13493 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13494 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13495 # @param theShape given shape (see GEOM.GEOM_Object)
13496 # @param min_length minimum length of edges of theShape
13497 # @param max_length maximum length of edges of theShape
13498 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13499 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13500 # @param theName Object name; when specified, this parameter is used
13501 # for result publication in the study. Otherwise, if automatic
13502 # publication is switched on, default value is used for result name.
13504 # @return a newly created GEOM group of edges
13506 # @@ref swig_todo "Example"
13507 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13509 Create group of edges of theShape, whose length is in range [min_length, max_length].
13510 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13513 theShape given shape
13514 min_length minimum length of edges of theShape
13515 max_length maximum length of edges of theShape
13516 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13517 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13518 theName Object name; when specified, this parameter is used
13519 for result publication in the study. Otherwise, if automatic
13520 publication is switched on, default value is used for result name.
13523 a newly created GEOM group of edges.
13525 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13526 edges_in_range = []
13528 Props = self.BasicProperties(edge)
13529 if min_length <= Props[0] and Props[0] <= max_length:
13530 if (not include_min) and (min_length == Props[0]):
13533 if (not include_max) and (Props[0] == max_length):
13536 edges_in_range.append(edge)
13538 if len(edges_in_range) <= 0:
13539 print("No edges found by given criteria")
13542 # note: auto-publishing is done in self.CreateGroup()
13543 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13544 self.UnionList(group_edges, edges_in_range)
13548 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13549 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13550 # @param min_length minimum length of edges of selected shape
13551 # @param max_length maximum length of edges of selected shape
13552 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13553 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13554 # @return a newly created GEOM group of edges
13555 # @ref swig_todo "Example"
13556 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13558 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13559 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13562 min_length minimum length of edges of selected shape
13563 max_length maximum length of edges of selected shape
13564 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13565 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13568 a newly created GEOM group of edges.
13570 nb_selected = sg.SelectedCount()
13571 if nb_selected < 1:
13572 print("Select a shape before calling this function, please.")
13574 if nb_selected > 1:
13575 print("Only one shape must be selected")
13578 id_shape = sg.getSelected(0)
13579 shape = IDToObject( id_shape )
13581 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13585 if include_min: left_str = " <= "
13586 if include_max: right_str = " <= "
13588 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13589 + left_str + "length" + right_str + repr(max_length))
13591 sg.updateObjBrowser()
13598 #@@ insert new functions before this line @@ do not remove this line @@#
13600 ## Create a copy of the given object
13602 # @param theOriginal geometry object for copy
13603 # @param theName Object name; when specified, this parameter is used
13604 # for result publication in the study. Otherwise, if automatic
13605 # publication is switched on, default value is used for result name.
13607 # @return New GEOM_Object, containing the copied shape.
13609 # @ingroup l1_geomBuilder_auxiliary
13610 # @ref swig_MakeCopy "Example"
13611 @ManageTransactions("InsertOp")
13612 def MakeCopy(self, theOriginal, theName=None):
13614 Create a copy of the given object
13617 theOriginal geometry object for copy
13618 theName Object name; when specified, this parameter is used
13619 for result publication in the study. Otherwise, if automatic
13620 publication is switched on, default value is used for result name.
13623 New GEOM_Object, containing the copied shape.
13625 Example of usage: Copy = geompy.MakeCopy(Box)
13627 # Example: see GEOM_TestAll.py
13628 anObj = self.InsertOp.MakeCopy(theOriginal)
13629 RaiseIfFailed("MakeCopy", self.InsertOp)
13630 self._autoPublish(anObj, theName, "copy")
13633 ## Add Path to load python scripts from
13634 # @param Path a path to load python scripts from
13635 # @ingroup l1_geomBuilder_auxiliary
13636 def addPath(self,Path):
13638 Add Path to load python scripts from
13641 Path a path to load python scripts from
13643 if (sys.path.count(Path) < 1):
13644 sys.path.append(Path)
13648 ## Load marker texture from the file
13649 # @param Path a path to the texture file
13650 # @return unique texture identifier
13651 # @ingroup l1_geomBuilder_auxiliary
13652 @ManageTransactions("InsertOp")
13653 def LoadTexture(self, Path):
13655 Load marker texture from the file
13658 Path a path to the texture file
13661 unique texture identifier
13663 # Example: see GEOM_TestAll.py
13664 ID = self.InsertOp.LoadTexture(Path)
13665 RaiseIfFailed("LoadTexture", self.InsertOp)
13668 ## Get internal name of the object based on its study entry
13669 # @note This method does not provide an unique identifier of the geometry object.
13670 # @note This is internal function of GEOM component, though it can be used outside it for
13671 # appropriate reason (e.g. for identification of geometry object).
13672 # @param obj geometry object
13673 # @return unique object identifier
13674 # @ingroup l1_geomBuilder_auxiliary
13675 def getObjectID(self, obj):
13677 Get internal name of the object based on its study entry.
13678 Note: this method does not provide an unique identifier of the geometry object.
13679 It is an internal function of GEOM component, though it can be used outside GEOM for
13680 appropriate reason (e.g. for identification of geometry object).
13683 obj geometry object
13686 unique object identifier
13689 entry = salome.ObjectToID(obj)
13690 if entry is not None:
13691 lst = entry.split(":")
13693 ID = lst[-1] # -1 means last item in the list
13694 return "GEOM_" + ID
13699 ## Add marker texture. @a Width and @a Height parameters
13700 # specify width and height of the texture in pixels.
13701 # If @a RowData is @c True, @a Texture parameter should represent texture data
13702 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13703 # parameter should be unpacked string, in which '1' symbols represent opaque
13704 # pixels and '0' represent transparent pixels of the texture bitmap.
13706 # @param Width texture width in pixels
13707 # @param Height texture height in pixels
13708 # @param Texture texture data
13709 # @param RowData if @c True, @a Texture data are packed in the byte stream
13710 # @return unique texture identifier
13711 # @ingroup l1_geomBuilder_auxiliary
13712 @ManageTransactions("InsertOp")
13713 def AddTexture(self, Width, Height, Texture, RowData=False):
13715 Add marker texture. Width and Height parameters
13716 specify width and height of the texture in pixels.
13717 If RowData is True, Texture parameter should represent texture data
13718 packed into the byte array. If RowData is False (default), Texture
13719 parameter should be unpacked string, in which '1' symbols represent opaque
13720 pixels and '0' represent transparent pixels of the texture bitmap.
13723 Width texture width in pixels
13724 Height texture height in pixels
13725 Texture texture data
13726 RowData if True, Texture data are packed in the byte stream
13729 return unique texture identifier
13731 if not RowData: Texture = PackData(Texture)
13732 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13733 RaiseIfFailed("AddTexture", self.InsertOp)
13736 ## Transfer not topological data from one GEOM object to another.
13738 # @param theObjectFrom the source object of non-topological data
13739 # @param theObjectTo the destination object of non-topological data
13740 # @param theFindMethod method to search sub-shapes of theObjectFrom
13741 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13742 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13743 # Other values of GEOM.find_shape_method are not supported.
13745 # @return True in case of success; False otherwise.
13747 # @ingroup l1_geomBuilder_auxiliary
13749 # @ref swig_TransferData "Example"
13750 @ManageTransactions("InsertOp")
13751 def TransferData(self, theObjectFrom, theObjectTo,
13752 theFindMethod=GEOM.FSM_GetInPlace):
13754 Transfer not topological data from one GEOM object to another.
13757 theObjectFrom the source object of non-topological data
13758 theObjectTo the destination object of non-topological data
13759 theFindMethod method to search sub-shapes of theObjectFrom
13760 in shape theObjectTo. Possible values are:
13761 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13762 and GEOM.FSM_GetInPlace_Old. Other values of
13763 GEOM.find_shape_method are not supported.
13766 True in case of success; False otherwise.
13768 # Example: see GEOM_TestOthers.py
13770 # Example: see GEOM_TestAll.py
13771 isOk = self.InsertOp.TransferData(theObjectFrom,
13772 theObjectTo, theFindMethod)
13773 RaiseIfFailed("TransferData", self.InsertOp)
13776 ## Creates a new folder object. It is a container for any GEOM objects.
13777 # @param Name name of the container
13778 # @param Father parent object. If None,
13779 # folder under 'Geometry' root object will be created.
13780 # @return a new created folder
13781 # @ingroup l1_publish_data
13782 def NewFolder(self, Name, Father=None):
13784 Create a new folder object. It is an auxiliary container for any GEOM objects.
13787 Name name of the container
13788 Father parent object. If None,
13789 folder under 'Geometry' root object will be created.
13792 a new created folder
13794 return self.CreateFolder(Name, Father)
13796 ## Move object to the specified folder
13797 # @param Object object to move
13798 # @param Folder target folder
13799 # @ingroup l1_publish_data
13800 def PutToFolder(self, Object, Folder):
13802 Move object to the specified folder
13805 Object object to move
13806 Folder target folder
13808 self.MoveToFolder(Object, Folder)
13811 ## Move list of objects to the specified folder
13812 # @param ListOfSO list of objects to move
13813 # @param Folder target folder
13814 # @ingroup l1_publish_data
13815 def PutListToFolder(self, ListOfSO, Folder):
13817 Move list of objects to the specified folder
13820 ListOfSO list of objects to move
13821 Folder target folder
13823 self.MoveListToFolder(ListOfSO, Folder)
13826 ## @addtogroup l2_field
13830 # @param shape the shape the field lies on
13831 # @param name the field name
13832 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13833 # @param dimension dimension of the shape the field lies on
13834 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13835 # @param componentNames names of components
13836 # @return a created field
13837 @ManageTransactions("FieldOp")
13838 def CreateField(self, shape, name, type, dimension, componentNames):
13843 shape the shape the field lies on
13844 name the field name
13845 type type of field data
13846 dimension dimension of the shape the field lies on
13847 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13848 componentNames names of components
13853 if isinstance( type, int ):
13854 if type < 0 or type > 3:
13855 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13856 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13858 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13859 RaiseIfFailed("CreateField", self.FieldOp)
13861 geom._autoPublish( f, "", name)
13864 ## Removes a field from the GEOM component
13865 # @param field the field to remove
13866 def RemoveField(self, field):
13867 "Removes a field from the GEOM component"
13869 if isinstance( field, GEOM._objref_GEOM_Field ):
13870 geom.RemoveObject( field )
13871 elif isinstance( field, geomField ):
13872 geom.RemoveObject( field.field )
13874 raise RuntimeError("RemoveField() : the object is not a field")
13877 ## Returns number of fields on a shape
13878 @ManageTransactions("FieldOp")
13879 def CountFields(self, shape):
13880 "Returns number of fields on a shape"
13881 nb = self.FieldOp.CountFields( shape )
13882 RaiseIfFailed("CountFields", self.FieldOp)
13885 ## Returns all fields on a shape
13886 @ManageTransactions("FieldOp")
13887 def GetFields(self, shape):
13888 "Returns all fields on a shape"
13889 ff = self.FieldOp.GetFields( shape )
13890 RaiseIfFailed("GetFields", self.FieldOp)
13893 ## Returns a field on a shape by its name
13894 @ManageTransactions("FieldOp")
13895 def GetField(self, shape, name):
13896 "Returns a field on a shape by its name"
13897 f = self.FieldOp.GetField( shape, name )
13898 RaiseIfFailed("GetField", self.FieldOp)
13904 ## @addtogroup l2_testing
13907 ## Build a mesh on the given shape.
13908 # @param shape the source shape
13909 # @param linear_deflection linear deflection coefficient
13910 # @param is_relative says if given value of deflection is relative to shape's bounding box
13911 # @param angular_deflection angular deflection for edges in degrees
13912 # @return True in case of success; otherwise False.
13913 @ManageTransactions("TestOp")
13914 def Tesselate(self, shape, linear_deflection=0, is_relative=True, angular_deflection=0):
13915 """Build a mesh on the given shape.
13918 shape the source shape
13919 linear_deflection linear deflection coefficient
13920 is_relative says if given value of deflection is relative to shape's bounding box
13921 angular_deflection angular deflection for edges in degrees
13924 True in case of success; otherwise False.
13926 if angular_deflection > 0:
13927 angular_deflection = angular_deflection * math.pi / 180.
13928 r = self.TestOp.Tesselate(shape, linear_deflection, is_relative, angular_deflection)
13929 RaiseIfFailed("Tesselate", self.TestOp)
13932 # end of l2_testing
13936 # Register the new proxy for GEOM_Gen
13937 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13940 ## Field on Geometry
13941 # @ingroup l2_field
13942 class geomField( GEOM._objref_GEOM_Field ):
13944 def __init__(self, *args):
13945 GEOM._objref_GEOM_Field.__init__(self, *args)
13946 self.field = GEOM._objref_GEOM_Field
13949 ## Returns the shape the field lies on
13950 def getShape(self):
13951 "Returns the shape the field lies on"
13952 return self.field.GetShape(self)
13954 ## Returns the field name
13956 "Returns the field name"
13957 return self.field.GetName(self)
13959 ## Returns type of field data as integer [0-3]
13961 "Returns type of field data"
13962 return EnumToLong(self.field.GetDataType(self))
13964 ## Returns type of field data:
13965 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13966 def getTypeEnum(self):
13967 "Returns type of field data"
13968 return self.field.GetDataType(self)
13970 ## Returns dimension of the shape the field lies on:
13971 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13972 def getDimension(self):
13973 """Returns dimension of the shape the field lies on:
13974 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13975 return self.field.GetDimension(self)
13977 ## Returns names of components
13978 def getComponents(self):
13979 "Returns names of components"
13980 return self.field.GetComponents(self)
13982 ## Adds a time step to the field
13983 # @param step the time step number further used as the step identifier
13984 # @param stamp the time step time
13985 # @param values the values of the time step
13986 def addStep(self, step, stamp, values):
13987 "Adds a time step to the field"
13988 stp = self.field.AddStep( self, step, stamp )
13990 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
13992 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13993 self.setValues( step, values )
13996 ## Remove a time step from the field
13997 def removeStep(self,step):
13998 "Remove a time step from the field"
14001 stepObj = self.field.GetStep( self, step )
14003 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
14006 #traceback.print_exc()
14008 self.field.RemoveStep( self, step )
14010 geom.myBuilder.RemoveObjectWithChildren( stepSO )
14013 ## Returns number of time steps in the field
14014 def countSteps(self):
14015 "Returns number of time steps in the field"
14016 return self.field.CountSteps(self)
14018 ## Returns a list of time step IDs in the field
14019 def getSteps(self):
14020 "Returns a list of time step IDs in the field"
14021 return self.field.GetSteps(self)
14023 ## Returns a time step by its ID
14024 def getStep(self,step):
14025 "Returns a time step by its ID"
14026 stp = self.field.GetStep(self, step)
14028 raise RuntimeError("Step %s is missing from this field"%step)
14031 ## Returns the time of the field step
14032 def getStamp(self,step):
14033 "Returns the time of the field step"
14034 return self.getStep(step).GetStamp()
14036 ## Changes the time of the field step
14037 def setStamp(self, step, stamp):
14038 "Changes the time of the field step"
14039 return self.getStep(step).SetStamp(stamp)
14041 ## Returns values of the field step
14042 def getValues(self, step):
14043 "Returns values of the field step"
14044 return self.getStep(step).GetValues()
14046 ## Changes values of the field step
14047 def setValues(self, step, values):
14048 "Changes values of the field step"
14049 stp = self.getStep(step)
14050 errBeg = "Field.setValues(values) : Error: "
14052 ok = stp.SetValues( values )
14053 except Exception as e:
14055 if excStr.find("WrongPythonType") > 0:
14056 raise RuntimeError(errBeg +\
14057 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14058 raise RuntimeError(errBeg + str(e))
14060 nbOK = self.field.GetArraySize(self)
14063 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14065 raise RuntimeError(errBeg + "failed")
14068 pass # end of class geomField
14070 # Register the new proxy for GEOM_Field
14071 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14074 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14075 # interface to GEOM operations.
14080 # salome.salome_init()
14081 # from salome.geom import geomBuilder
14082 # geompy = geomBuilder.New()
14084 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14085 # @return geomBuilder instance
14086 def New( instance=None):
14088 Create a new geomBuilder instance.The geomBuilder class provides the Python
14089 interface to GEOM operations.
14093 salome.salome_init()
14094 from salome.geom import geomBuilder
14095 geompy = geomBuilder.New()
14098 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14100 geomBuilder instance
14102 #print "New geomBuilder ", study, instance
14106 if instance and isinstance( instance, SALOMEDS._objref_Study ):
14108 sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14113 geom = geomBuilder()
14114 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14119 # Register methods from the plug-ins in the geomBuilder class
14120 plugins_var = os.environ.get( "GEOM_PluginsList" )
14123 if plugins_var is not None:
14124 plugins = plugins_var.split( ":" )
14125 plugins=[x for x in plugins if len(x)>0]
14126 if plugins is not None:
14127 for pluginName in plugins:
14128 pluginBuilderName = pluginName + "Builder"
14130 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14131 except Exception as e:
14132 from salome_utils import verbose
14133 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14135 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14136 plugin = eval( pluginBuilderName )
14138 # add methods from plugin module to the geomBuilder class
14139 for k in dir( plugin ):
14140 if k[0] == '_': continue
14141 method = getattr( plugin, k )
14142 if type( method ).__name__ == 'function':
14143 if not hasattr( geomBuilder, k ):
14144 setattr( geomBuilder, k, method )