1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New()
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New()
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still contains all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New()
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
245 # initialize SALOME session in try/except block
246 # to avoid problems in some cases, e.g. when generating documentation
254 from salome_notebook import *
261 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
263 # In case the omniORBpy EnumItem class does not fully support Python 3
264 # (for instance in version 4.2.1-2), the comparison ordering methods must be
268 GEOM.COMPOUND < GEOM.SOLID
270 def enumitem_eq(self, other):
272 if isinstance(other, omniORB.EnumItem):
273 if other._parent_id == self._parent_id:
274 return self._v == other._v
276 return self._parent_id == other._parent_id
278 return id(self) == id(other)
280 return id(self) == id(other)
282 def enumitem_lt(self, other):
284 if isinstance(other, omniORB.EnumItem):
285 if other._parent_id == self._parent_id:
286 return self._v < other._v
288 return self._parent_id < other._parent_id
290 return id(self) < id(other)
292 return id(self) < id(other)
294 def enumitem_le(self, other):
296 if isinstance(other, omniORB.EnumItem):
297 if other._parent_id == self._parent_id:
298 return self._v <= other._v
300 return self._parent_id <= other._parent_id
302 return id(self) <= id(other)
304 return id(self) <= id(other)
306 def enumitem_gt(self, other):
308 if isinstance(other, omniORB.EnumItem):
309 if other._parent_id == self._parent_id:
310 return self._v > other._v
312 return self._parent_id > other._parent_id
314 return id(self) > id(other)
316 return id(self) > id(other)
318 def enumitem_ge(self, other):
320 if isinstance(other, omniORB.EnumItem):
321 if other._parent_id == self._parent_id:
322 return self._v >= other._v
324 return self._parent_id >= other._parent_id
326 return id(self) >= id(other)
328 return id(self) >= id(other)
330 GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
331 GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
332 GEOM.omniORB.EnumItem.__le__ = enumitem_le
333 GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
334 GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
335 omniORB.EnumItem.__eq__ = enumitem_eq
336 omniORB.EnumItem.__lt__ = enumitem_lt
337 omniORB.EnumItem.__le__ = enumitem_le
338 omniORB.EnumItem.__gt__ = enumitem_gt
339 omniORB.EnumItem.__ge__ = enumitem_ge
342 def _toListOfNames(_names, _size=-1):
345 if type(_names) in [list, tuple]:
346 for i in _names: l.append(i)
349 if l and len(l) < _size:
350 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
353 # Decorator function to manage transactions for all geometric operations.
354 def ManageTransactions(theOpeName):
355 def MTDecorator(theFunction):
356 # To keep the original function name an documentation.
357 @functools.wraps(theFunction)
358 def OpenCallClose(self, *args, **kwargs):
360 anOperation = getattr(self, theOpeName)
361 anOperation.StartOperation()
364 res = theFunction(self, *args, **kwargs)
366 anOperation.FinishOperation()
370 anOperation.AbortOperation()
375 ## Raise an Error, containing the Method_name, if Operation is Failed
376 ## @ingroup l1_geomBuilder_auxiliary
377 def RaiseIfFailed (Method_name, Operation):
378 if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
379 raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
381 ## Return list of variables value from salome notebook
382 ## @ingroup l1_geomBuilder_auxiliary
383 def ParseParameters(*parameters):
386 for parameter in parameters:
387 if isinstance(parameter, list):
388 lResults = ParseParameters(*parameter)
389 if len(lResults) > 0:
390 Result.append(lResults[:-1])
391 StringResult += lResults[-1].split(":")
395 if isinstance(parameter,str):
396 if notebook.isVariable(parameter):
397 Result.append(notebook.get(parameter))
399 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
402 Result.append(parameter)
404 StringResult.append(str(parameter))
408 Result.append(":".join(StringResult))
410 Result = ":".join(StringResult)
413 ## Return list of variables value from salome notebook
414 ## @ingroup l1_geomBuilder_auxiliary
418 for parameter in list:
419 if isinstance(parameter,str) and notebook.isVariable(parameter):
420 Result.append(str(notebook.get(parameter)))
423 Result.append(str(parameter))
426 StringResult = StringResult + str(parameter)
427 StringResult = StringResult + ":"
429 StringResult = StringResult[:len(StringResult)-1]
430 return Result, StringResult
432 ## Return list of variables value from salome notebook
433 ## @ingroup l1_geomBuilder_auxiliary
434 def ParseSketcherCommand(command):
437 sections = command.split(":")
438 for section in sections:
439 parameters = section.split(" ")
441 for parameter in parameters:
442 if paramIndex > 1 and parameter.find("'") != -1:
443 parameter = parameter.replace("'","")
444 if notebook.isVariable(parameter):
445 Result = Result + str(notebook.get(parameter)) + " "
448 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
452 Result = Result + str(parameter) + " "
455 StringResult = StringResult + parameter
456 StringResult = StringResult + ":"
458 paramIndex = paramIndex + 1
460 Result = Result[:len(Result)-1] + ":"
462 Result = Result[:len(Result)-1]
463 return Result, StringResult
465 ## Helper function which can be used to pack the passed string to the byte data.
466 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
467 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
470 ## val = PackData("10001110") # val = 0xAE
471 ## val = PackData("1") # val = 0x80
473 ## @param data unpacked data - a string containing '1' and '0' symbols
474 ## @return data packed to the byte stream
475 ## @ingroup l1_geomBuilder_auxiliary
478 Helper function which can be used to pack the passed string to the byte data.
479 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
480 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
483 data unpacked data - a string containing '1' and '0' symbols
486 data packed to the byte stream
489 val = PackData("10001110") # val = 0xAE
490 val = PackData("1") # val = 0x80
493 if len(data)%8: bytes += 1
495 for b in range(bytes):
496 d = data[b*8:(b+1)*8]
501 if d[i] == "1": val += 1
503 raise "Invalid symbol %s" % d[i]
510 ## Read bitmap texture from the text file.
511 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
512 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
513 ## The function returns width and height of the pixmap in pixels and byte stream representing
514 ## texture bitmap itself.
516 ## This function can be used to read the texture to the byte stream in order to pass it to
517 ## the AddTexture() function of geomBuilder class.
520 ## from salome.geom import geomBuilder
521 ## geompy = geomBuilder.New()
522 ## texture = geompy.readtexture('mytexture.dat')
523 ## texture = geompy.AddTexture(*texture)
524 ## obj.SetMarkerTexture(texture)
526 ## @param fname texture file name
527 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
528 ## @ingroup l1_geomBuilder_auxiliary
529 def ReadTexture(fname):
531 Read bitmap texture from the text file.
532 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
533 A zero symbol ('0') represents transparent pixel of the texture bitmap.
534 The function returns width and height of the pixmap in pixels and byte stream representing
535 texture bitmap itself.
536 This function can be used to read the texture to the byte stream in order to pass it to
537 the AddTexture() function of geomBuilder class.
540 fname texture file name
543 sequence of tree values: texture's width, height in pixels and its byte stream
546 from salome.geom import geomBuilder
547 geompy = geomBuilder.New()
548 texture = geompy.readtexture('mytexture.dat')
549 texture = geompy.AddTexture(*texture)
550 obj.SetMarkerTexture(texture)
554 lines = [ l.strip() for l in f.readlines()]
557 if lines: maxlen = max([len(x) for x in lines])
559 if maxlen%8: lenbytes += 1
563 lenline = (len(line)/8+1)*8
566 lenline = (len(line)/8)*8
568 for i in range(lenline/8):
571 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
574 bytedata += PackData(byte)
576 for i in range(lenline/8, lenbytes):
577 bytedata += PackData("0")
579 return lenbytes*8, len(lines), bytedata
584 ## Returns a long value from enumeration type
585 # Can be used for CORBA enumerator types like GEOM.shape_type
586 # @param theItem enumeration type
587 # @ingroup l1_geomBuilder_auxiliary
588 def EnumToLong(theItem):
590 Returns a long value from enumeration type
591 Can be used for CORBA enumerator types like geomBuilder.ShapeType
594 theItem enumeration type
597 if hasattr(theItem, "_v"): ret = theItem._v
600 ## Pack an argument into a list
602 if isinstance( arg, list ):
604 if hasattr( arg, "__getitem__" ):
608 ## Information about closed/unclosed state of shell or wire
609 # @ingroup l1_geomBuilder_auxiliary
612 Information about closed/unclosed state of shell or wire
618 ## Private class used to bind calls of plugin operations to geomBuilder
619 class PluginOperation:
620 def __init__(self, operation, function):
621 self.operation = operation
622 self.function = function
625 @ManageTransactions("operation")
626 def __call__(self, *args):
627 res = self.function(self.operation, *args)
628 RaiseIfFailed(self.function.__name__, self.operation)
631 # Warning: geom is a singleton
637 class geomBuilder(GEOM._objref_GEOM_Gen):
639 ## Enumeration ShapeType as a dictionary. \n
640 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
641 # @ingroup l1_geomBuilder_auxiliary
642 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
644 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
645 # and a list of parameters, describing the shape.
646 # List of parameters, describing the shape:
647 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
648 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
650 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
652 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
654 # - SPHERE: [xc yc zc R]
655 # - CYLINDER: [xb yb zb dx dy dz R H]
656 # - BOX: [xc yc zc ax ay az]
657 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
658 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
659 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
660 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
661 # - SOLID: [nb_faces nb_edges nb_vertices]
663 # - SPHERE2D: [xc yc zc R]
664 # - CYLINDER2D: [xb yb zb dx dy dz R H]
665 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
666 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
667 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
668 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
669 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
670 # - PLANE: [xo yo zo dx dy dz]
671 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
672 # - FACE: [nb_edges nb_vertices]
674 # - CIRCLE: [xc yc zc dx dy dz R]
675 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
676 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
677 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
678 # - LINE: [xo yo zo dx dy dz]
679 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
680 # - EDGE: [nb_vertices]
684 # - LCS: [x y z xx xy xz yx yy yz zx zy zz]
685 # @ingroup l1_geomBuilder_auxiliary
686 kind = GEOM.GEOM_IKindOfShape
688 def __new__(cls, *args):
693 #print "==== __new__ ", engine, geom, doLcc, created
695 # geom engine is either retrieved from engine, or created
697 # Following test avoids a recursive loop
700 # geom engine not created: existing engine found
702 if doLcc and not created:
704 # FindOrLoadComponent called:
705 # 1. CORBA resolution of server
706 # 2. the __new__ method is called again
707 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
708 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
711 # FindOrLoadComponent not called
713 # geomBuilder instance is created from lcc.FindOrLoadComponent
714 #print "==== super ", engine, geom, doLcc, created
715 geom = super(geomBuilder,cls).__new__(cls)
718 # geom engine not created: existing engine found
719 #print "==== existing ", engine, geom, doLcc, created
721 #print "return geom 1 ", geom
724 #print "return geom 2 ", geom
727 def __init__(self, *args):
729 #print "-------- geomBuilder __init__ --- ", created, self
732 GEOM._objref_GEOM_Gen.__init__(self, *args)
733 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
734 self.myBuilder = None
752 ## Process object publication in the study, as follows:
753 # - if @a theName is specified (not None), the object is published in the study
754 # with this name, not taking into account "auto-publishing" option;
755 # - if @a theName is NOT specified, the object is published in the study
756 # (using default name, which can be customized using @a theDefaultName parameter)
757 # only if auto-publishing is switched on.
759 # @param theObj object, a subject for publishing
760 # @param theName object name for study
761 # @param theDefaultName default name for the auto-publishing
763 # @sa addToStudyAuto()
764 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
766 def _item_name(_names, _defname, _idx=-1):
767 if not _names: _names = _defname
768 if type(_names) in [list, tuple]:
770 if _idx >= len(_names) or not _names[_idx]:
771 if type(_defname) not in [list, tuple]:
772 _name = "%s_%d"%(_defname, _idx+1)
773 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
774 _name = _defname[_idx]
776 _name = "%noname_%d"%(dn, _idx+1)
782 # must be wrong usage
787 _name = "%s_%d"%(_names, _idx+1)
793 def _publish( _name, _obj ):
795 if isinstance( _obj, GEOM._objref_GEOM_Field ):
796 fatherObj = _obj.GetShape()
797 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
798 fatherObj = _obj.GetField()
799 elif not _obj.IsMainShape():
800 fatherObj = _obj.GetMainShape()
802 if fatherObj and fatherObj.GetStudyEntry():
803 self.addToStudyInFather(fatherObj, _obj, _name)
805 self.addToStudy(_obj, _name)
811 if not theName and not self.myMaxNbSubShapesAllowed:
812 return # nothing to do: auto-publishing is disabled
813 if not theName and not theDefaultName:
814 return # neither theName nor theDefaultName is given
816 if type(theObj) in [list, tuple]:
817 # list of objects is being published
820 if not obj: continue # bad object
821 name = _item_name(theName, theDefaultName, idx)
822 _publish( name, obj )
824 if not theName and idx == self.myMaxNbSubShapesAllowed: break
828 # single object is published
829 name = _item_name(theName, theDefaultName)
830 _publish( name, theObj )
833 ## @addtogroup l1_geomBuilder_auxiliary
836 self.myStudy = salome.myStudy
837 self.myBuilder = self.myStudy.NewBuilder()
838 self.father = self.myStudy.FindComponent("GEOM")
840 # load data from the study file, if necessary
842 self.myBuilder.LoadWith(self.father, 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 ()
858 # set GEOM as root in the use case tree
859 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
860 self.myUseCaseBuilder.SetRootCurrent()
861 self.myUseCaseBuilder.Append(self.father)
863 notebook.myStudy = salome.myStudy
866 def GetPluginOperations(self, libraryName):
867 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
870 ## Enable / disable results auto-publishing
872 # The automatic publishing is managed in the following way:
873 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
874 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
875 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
876 # value passed as parameter has the same effect.
877 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
878 # maximum number of sub-shapes allowed for publishing is set to specified value.
880 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
881 # @ingroup l1_publish_data
882 def addToStudyAuto(self, maxNbSubShapes=-1):
884 Enable / disable results auto-publishing
886 The automatic publishing is managed in the following way:
887 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
888 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
889 maximum number of sub-shapes allowed for publishing is unlimited; any negative
890 value passed as parameter has the same effect.
891 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
892 maximum number of sub-shapes allowed for publishing is set to this value.
895 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
898 geompy.addToStudyAuto() # enable auto-publishing
899 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
900 geompy.addToStudyAuto(0) # disable auto-publishing
902 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
905 ## Dump component to the Python script
906 # This method overrides IDL function to allow default values for the parameters.
907 def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
909 Dump component to the Python script
910 This method overrides IDL function to allow default values for the parameters.
912 return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
914 ## Get name for sub-shape aSubObj of shape aMainObj
916 # @ref swig_SubShapeName "Example"
917 @ManageTransactions("ShapesOp")
918 def SubShapeName(self,aSubObj, aMainObj):
920 Get name for sub-shape aSubObj of shape aMainObj
922 # Example: see GEOM_TestAll.py
924 #aSubId = orb.object_to_string(aSubObj)
925 #aMainId = orb.object_to_string(aMainObj)
926 #index = gg.getIndexTopology(aSubId, aMainId)
927 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
928 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
929 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
932 ## Publish in study aShape with name aName
934 # \param aShape the shape to be published
935 # \param aName the name for the shape
936 # \param doRestoreSubShapes if True, finds and publishes also
937 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
938 # and published sub-shapes of arguments
939 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
940 # these arguments description
941 # \return study entry of the published shape in form of string
943 # @ingroup l1_publish_data
944 # @ref swig_all_addtostudy "Example"
945 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
946 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
948 Publish in study aShape with name aName
951 aShape the shape to be published
952 aName the name for the shape
953 doRestoreSubShapes if True, finds and publishes also
954 sub-shapes of aShape, corresponding to its arguments
955 and published sub-shapes of arguments
956 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
957 these arguments description
960 study entry of the published shape in form of string
963 id_block1 = geompy.addToStudy(Block1, "Block 1")
965 # Example: see GEOM_TestAll.py
967 aSObject = self.AddInStudy(aShape, aName, None)
968 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
969 if doRestoreSubShapes:
970 self.RestoreSubShapesSO(aSObject, theArgs,
971 theFindMethod, theInheritFirstArg, True )
973 print("addToStudy() failed")
975 return aShape.GetStudyEntry()
977 ## Publish in study aShape with name aName as sub-object of previously published aFather
978 # \param aFather previously published object
979 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
980 # \param aName the name for the shape
982 # \return study entry of the published shape in form of string
984 # @ingroup l1_publish_data
985 # @ref swig_all_addtostudyInFather "Example"
986 def addToStudyInFather(self, aFather, aShape, aName):
988 Publish in study aShape with name aName as sub-object of previously published aFather
991 aFather previously published object
992 aShape the shape to be published as sub-object of aFather
993 aName the name for the shape
996 study entry of the published shape in form of string
998 # Example: see GEOM_TestAll.py
1000 aSObject = self.AddInStudy(aShape, aName, aFather)
1001 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
1003 print("addToStudyInFather() failed")
1005 return aShape.GetStudyEntry()
1007 ## Unpublish object in study
1009 # \param obj the object to be unpublished
1010 def hideInStudy(self, obj):
1012 Unpublish object in study
1015 obj the object to be unpublished
1017 ior = salome.orb.object_to_string(obj)
1018 aSObject = self.myStudy.FindObjectIOR(ior)
1019 if aSObject is not None:
1020 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1021 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1022 drwAttribute.SetDrawable(False)
1023 # hide references if any
1024 vso = self.myStudy.FindDependances(aSObject);
1026 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1027 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1028 drwAttribute.SetDrawable(False)
1032 # end of l1_geomBuilder_auxiliary
1035 ## @addtogroup l3_restore_ss
1038 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1039 # To be used from python scripts out of addToStudy() (non-default usage)
1040 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1041 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1042 # If this list is empty, all operation arguments will be published
1043 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1044 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
1045 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1046 # Do not publish sub-shapes in place of arguments, but only
1047 # in place of sub-shapes of the first argument,
1048 # because the whole shape corresponds to the first argument.
1049 # Mainly to be used after transformations, but it also can be
1050 # useful after partition with one object shape, and some other
1051 # operations, where only the first argument has to be considered.
1052 # If theObject has only one argument shape, this flag is automatically
1053 # considered as True, not regarding really passed value.
1054 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1055 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1056 # \return list of published sub-shapes
1058 # @ref tui_restore_prs_params "Example"
1059 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1060 theInheritFirstArg=False, theAddPrefix=True):
1062 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1063 To be used from python scripts out of geompy.addToStudy (non-default usage)
1066 theObject published GEOM.GEOM_Object, arguments of which will be published
1067 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1068 If this list is empty, all operation arguments will be published
1069 theFindMethod method to search sub-shapes, corresponding to arguments and
1070 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1071 theInheritFirstArg set properties of the first argument for theObject.
1072 Do not publish sub-shapes in place of arguments, but only
1073 in place of sub-shapes of the first argument,
1074 because the whole shape corresponds to the first argument.
1075 Mainly to be used after transformations, but it also can be
1076 useful after partition with one object shape, and some other
1077 operations, where only the first argument has to be considered.
1078 If theObject has only one argument shape, this flag is automatically
1079 considered as True, not regarding really passed value.
1080 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1081 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1083 list of published sub-shapes
1085 # Example: see GEOM_TestAll.py
1086 return self.RestoreSubShapesO(theObject, theArgs,
1087 theFindMethod, theInheritFirstArg, theAddPrefix)
1089 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1090 # To be used from python scripts out of addToStudy() (non-default usage)
1091 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1092 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1093 # If this list is empty, all operation arguments will be published
1094 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1095 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1096 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1097 # Do not publish sub-shapes in place of arguments, but only
1098 # in place of sub-shapes of the first argument,
1099 # because the whole shape corresponds to the first argument.
1100 # Mainly to be used after transformations, but it also can be
1101 # useful after partition with one object shape, and some other
1102 # operations, where only the first argument has to be considered.
1103 # If theObject has only one argument shape, this flag is automatically
1104 # considered as True, not regarding really passed value.
1105 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1106 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1107 # \return list of published sub-shapes
1109 # @ref tui_restore_prs_params "Example"
1110 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1111 theInheritFirstArg=False, theAddPrefix=True):
1113 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1114 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1117 theObject published GEOM.GEOM_Object, arguments of which will be published
1118 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1119 If this list is empty, all operation arguments will be published
1120 theFindMethod method to search sub-shapes, corresponding to arguments and
1121 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1122 theInheritFirstArg set properties of the first argument for theObject.
1123 Do not publish sub-shapes in place of arguments, but only
1124 in place of sub-shapes of the first argument,
1125 because the whole shape corresponds to the first argument.
1126 Mainly to be used after transformations, but it also can be
1127 useful after partition with one object shape, and some other
1128 operations, where only the first argument has to be considered.
1129 If theObject has only one argument shape, this flag is automatically
1130 considered as True, not regarding really passed value.
1131 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1132 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1135 list of published sub-shapes
1137 # Example: see GEOM_TestAll.py
1138 return self.RestoreGivenSubShapesO(theObject, theArgs,
1139 theFindMethod, theInheritFirstArg, theAddPrefix)
1141 # end of l3_restore_ss
1144 ## @addtogroup l3_basic_go
1147 ## Create point by three coordinates.
1148 # @param theX The X coordinate of the point.
1149 # @param theY The Y coordinate of the point.
1150 # @param theZ The Z coordinate of the point.
1151 # @param theName Object name; when specified, this parameter is used
1152 # for result publication in the study. Otherwise, if automatic
1153 # publication is switched on, default value is used for result name.
1155 # @return New GEOM.GEOM_Object, containing the created point.
1157 # @ref tui_creation_point "Example"
1158 @ManageTransactions("BasicOp")
1159 def MakeVertex(self, theX, theY, theZ, theName=None):
1161 Create point by three coordinates.
1164 theX The X coordinate of the point.
1165 theY The Y coordinate of the point.
1166 theZ The Z coordinate of the point.
1167 theName Object name; when specified, this parameter is used
1168 for result publication in the study. Otherwise, if automatic
1169 publication is switched on, default value is used for result name.
1172 New GEOM.GEOM_Object, containing the created point.
1174 # Example: see GEOM_TestAll.py
1175 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1176 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1177 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1178 anObj.SetParameters(Parameters)
1179 self._autoPublish(anObj, theName, "vertex")
1182 ## Create a point, distant from the referenced point
1183 # on the given distances along the coordinate axes.
1184 # @param theReference The referenced point.
1185 # @param theX Displacement from the referenced point along OX axis.
1186 # @param theY Displacement from the referenced point along OY axis.
1187 # @param theZ Displacement from the referenced point along OZ axis.
1188 # @param theName Object name; when specified, this parameter is used
1189 # for result publication in the study. Otherwise, if automatic
1190 # publication is switched on, default value is used for result name.
1192 # @return New GEOM.GEOM_Object, containing the created point.
1194 # @ref tui_creation_point "Example"
1195 @ManageTransactions("BasicOp")
1196 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1198 Create a point, distant from the referenced point
1199 on the given distances along the coordinate axes.
1202 theReference The referenced point.
1203 theX Displacement from the referenced point along OX axis.
1204 theY Displacement from the referenced point along OY axis.
1205 theZ Displacement from the referenced point along OZ axis.
1206 theName Object name; when specified, this parameter is used
1207 for result publication in the study. Otherwise, if automatic
1208 publication is switched on, default value is used for result name.
1211 New GEOM.GEOM_Object, containing the created point.
1213 # Example: see GEOM_TestAll.py
1214 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1215 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1216 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1217 anObj.SetParameters(Parameters)
1218 self._autoPublish(anObj, theName, "vertex")
1221 ## Create a point, corresponding to the given parameter on the given curve.
1222 # @param theRefCurve The referenced curve.
1223 # @param theParameter Value of parameter on the referenced curve.
1224 # @param takeOrientationIntoAccount flag that tells if it is necessary
1225 # to take the curve's orientation into account for the
1226 # operation. I.e. if this flag is set, the results for the same
1227 # parameters (except the value 0.5) is different for forward
1228 # and reversed curves. If it is not set the result is the same.
1229 # @param theName Object name; when specified, this parameter is used
1230 # for result publication in the study. Otherwise, if automatic
1231 # publication is switched on, default value is used for result name.
1233 # @return New GEOM.GEOM_Object, containing the created point.
1235 # @ref tui_creation_point "Example"
1236 @ManageTransactions("BasicOp")
1237 def MakeVertexOnCurve(self, theRefCurve, theParameter,
1238 takeOrientationIntoAccount=False, theName=None):
1240 Create a point, corresponding to the given parameter on the given curve.
1243 theRefCurve The referenced curve.
1244 theParameter Value of parameter on the referenced curve.
1245 takeOrientationIntoAccount flag that tells if it is necessary
1246 to take the curve's orientation into account for the
1247 operation. I.e. if this flag is set, the results for
1248 the same parameters (except the value 0.5) is different
1249 for forward and reversed curves. If it is not set
1250 the result is the same.
1251 theName Object name; when specified, this parameter is used
1252 for result publication in the study. Otherwise, if automatic
1253 publication is switched on, default value is used for result name.
1256 New GEOM.GEOM_Object, containing the created point.
1259 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1261 # Example: see GEOM_TestAll.py
1262 theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1263 theParameter, takeOrientationIntoAccount)
1264 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1265 takeOrientationIntoAccount)
1266 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1267 anObj.SetParameters(Parameters)
1268 self._autoPublish(anObj, theName, "vertex")
1271 ## Create a point by projection give coordinates on the given curve
1272 # @param theRefCurve The referenced curve.
1273 # @param theX X-coordinate in 3D space
1274 # @param theY Y-coordinate in 3D space
1275 # @param theZ Z-coordinate in 3D space
1276 # @param theName Object name; when specified, this parameter is used
1277 # for result publication in the study. Otherwise, if automatic
1278 # publication is switched on, default value is used for result name.
1280 # @return New GEOM.GEOM_Object, containing the created point.
1282 # @ref tui_creation_point "Example"
1283 @ManageTransactions("BasicOp")
1284 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1286 Create a point by projection give coordinates on the given curve
1289 theRefCurve The referenced curve.
1290 theX X-coordinate in 3D space
1291 theY Y-coordinate in 3D space
1292 theZ Z-coordinate in 3D space
1293 theName Object name; when specified, this parameter is used
1294 for result publication in the study. Otherwise, if automatic
1295 publication is switched on, default value is used for result name.
1298 New GEOM.GEOM_Object, containing the created point.
1301 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1303 # Example: see GEOM_TestAll.py
1304 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1305 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1306 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1307 anObj.SetParameters(Parameters)
1308 self._autoPublish(anObj, theName, "vertex")
1311 ## Create a point, corresponding to the given length on the given curve.
1312 # @param theRefCurve The referenced curve.
1313 # @param theLength Length on the referenced curve. It can be negative.
1314 # @param theStartPoint Point allowing to choose the direction for the calculation
1315 # of the length. If None, start from the first point of theRefCurve.
1316 # @param theName Object name; when specified, this parameter is used
1317 # for result publication in the study. Otherwise, if automatic
1318 # publication is switched on, default value is used for result name.
1320 # @return New GEOM.GEOM_Object, containing the created point.
1322 # @ref tui_creation_point "Example"
1323 @ManageTransactions("BasicOp")
1324 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1326 Create a point, corresponding to the given length on the given curve.
1329 theRefCurve The referenced curve.
1330 theLength Length on the referenced curve. It can be negative.
1331 theStartPoint Point allowing to choose the direction for the calculation
1332 of the length. If None, start from the first point of theRefCurve.
1333 theName Object name; when specified, this parameter is used
1334 for result publication in the study. Otherwise, if automatic
1335 publication is switched on, default value is used for result name.
1338 New GEOM.GEOM_Object, containing the created point.
1340 # Example: see GEOM_TestAll.py
1341 theLength, Parameters = ParseParameters(theLength)
1342 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1343 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1344 anObj.SetParameters(Parameters)
1345 self._autoPublish(anObj, theName, "vertex")
1348 ## Create a point, corresponding to the given parameters on the
1350 # @param theRefSurf The referenced surface.
1351 # @param theUParameter Value of U-parameter on the referenced surface.
1352 # @param theVParameter Value of V-parameter on the referenced surface.
1353 # @param theName Object name; when specified, this parameter is used
1354 # for result publication in the study. Otherwise, if automatic
1355 # publication is switched on, default value is used for result name.
1357 # @return New GEOM.GEOM_Object, containing the created point.
1359 # @ref swig_MakeVertexOnSurface "Example"
1360 @ManageTransactions("BasicOp")
1361 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1363 Create a point, corresponding to the given parameters on the
1367 theRefSurf The referenced surface.
1368 theUParameter Value of U-parameter on the referenced surface.
1369 theVParameter Value of V-parameter on the referenced surface.
1370 theName Object name; when specified, this parameter is used
1371 for result publication in the study. Otherwise, if automatic
1372 publication is switched on, default value is used for result name.
1375 New GEOM.GEOM_Object, containing the created point.
1378 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1380 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1381 # Example: see GEOM_TestAll.py
1382 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1383 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1384 anObj.SetParameters(Parameters);
1385 self._autoPublish(anObj, theName, "vertex")
1388 ## Create a point by projection give coordinates on the given surface
1389 # @param theRefSurf The referenced surface.
1390 # @param theX X-coordinate in 3D space
1391 # @param theY Y-coordinate in 3D space
1392 # @param theZ Z-coordinate in 3D space
1393 # @param theName Object name; when specified, this parameter is used
1394 # for result publication in the study. Otherwise, if automatic
1395 # publication is switched on, default value is used for result name.
1397 # @return New GEOM.GEOM_Object, containing the created point.
1399 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1400 @ManageTransactions("BasicOp")
1401 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1403 Create a point by projection give coordinates on the given surface
1406 theRefSurf The referenced surface.
1407 theX X-coordinate in 3D space
1408 theY Y-coordinate in 3D space
1409 theZ Z-coordinate in 3D space
1410 theName Object name; when specified, this parameter is used
1411 for result publication in the study. Otherwise, if automatic
1412 publication is switched on, default value is used for result name.
1415 New GEOM.GEOM_Object, containing the created point.
1418 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1420 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1421 # Example: see GEOM_TestAll.py
1422 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1423 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1424 anObj.SetParameters(Parameters);
1425 self._autoPublish(anObj, theName, "vertex")
1428 ## Create a point, which lays on the given face.
1429 # The point will lay in arbitrary place of the face.
1430 # The only condition on it is a non-zero distance to the face boundary.
1431 # Such point can be used to uniquely identify the face inside any
1432 # shape in case, when the shape does not contain overlapped faces.
1433 # @param theFace The referenced face.
1434 # @param theName Object name; when specified, this parameter is used
1435 # for result publication in the study. Otherwise, if automatic
1436 # publication is switched on, default value is used for result name.
1438 # @return New GEOM.GEOM_Object, containing the created point.
1440 # @ref swig_MakeVertexInsideFace "Example"
1441 @ManageTransactions("BasicOp")
1442 def MakeVertexInsideFace (self, theFace, theName=None):
1444 Create a point, which lays on the given face.
1445 The point will lay in arbitrary place of the face.
1446 The only condition on it is a non-zero distance to the face boundary.
1447 Such point can be used to uniquely identify the face inside any
1448 shape in case, when the shape does not contain overlapped faces.
1451 theFace The referenced face.
1452 theName Object name; when specified, this parameter is used
1453 for result publication in the study. Otherwise, if automatic
1454 publication is switched on, default value is used for result name.
1457 New GEOM.GEOM_Object, containing the created point.
1460 p_on_face = geompy.MakeVertexInsideFace(Face)
1462 # Example: see GEOM_TestAll.py
1463 anObj = self.BasicOp.MakePointOnFace(theFace)
1464 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1465 self._autoPublish(anObj, theName, "vertex")
1468 ## Create a point on intersection of two lines.
1469 # @param theRefLine1, theRefLine2 The referenced lines.
1470 # @param theName Object name; when specified, this parameter is used
1471 # for result publication in the study. Otherwise, if automatic
1472 # publication is switched on, default value is used for result name.
1474 # @return New GEOM.GEOM_Object, containing the created point.
1476 # @ref swig_MakeVertexOnLinesIntersection "Example"
1477 @ManageTransactions("BasicOp")
1478 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1480 Create a point on intersection of two lines.
1483 theRefLine1, theRefLine2 The referenced lines.
1484 theName Object name; when specified, this parameter is used
1485 for result publication in the study. Otherwise, if automatic
1486 publication is switched on, default value is used for result name.
1489 New GEOM.GEOM_Object, containing the created point.
1491 # Example: see GEOM_TestAll.py
1492 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1493 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1494 self._autoPublish(anObj, theName, "vertex")
1497 ## Create a tangent, corresponding to the given parameter on the given curve.
1498 # @param theRefCurve The referenced curve.
1499 # @param theParameter Value of parameter on the referenced curve.
1500 # @param theName Object name; when specified, this parameter is used
1501 # for result publication in the study. Otherwise, if automatic
1502 # publication is switched on, default value is used for result name.
1504 # @return New GEOM.GEOM_Object, containing the created tangent.
1506 # @ref swig_MakeTangentOnCurve "Example"
1507 @ManageTransactions("BasicOp")
1508 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1510 Create a tangent, corresponding to the given parameter on the given curve.
1513 theRefCurve The referenced curve.
1514 theParameter Value of parameter on the referenced curve.
1515 theName Object name; when specified, this parameter is used
1516 for result publication in the study. Otherwise, if automatic
1517 publication is switched on, default value is used for result name.
1520 New GEOM.GEOM_Object, containing the created tangent.
1523 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1525 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1526 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1527 self._autoPublish(anObj, theName, "tangent")
1530 ## Create a tangent plane, corresponding to the given parameter on the given face.
1531 # @param theFace The face for which tangent plane should be built.
1532 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1533 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1534 # @param theTrimSize the size of plane.
1535 # @param theName Object name; when specified, this parameter is used
1536 # for result publication in the study. Otherwise, if automatic
1537 # publication is switched on, default value is used for result name.
1539 # @return New GEOM.GEOM_Object, containing the created tangent.
1541 # @ref swig_MakeTangentPlaneOnFace "Example"
1542 @ManageTransactions("BasicOp")
1543 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1545 Create a tangent plane, corresponding to the given parameter on the given face.
1548 theFace The face for which tangent plane should be built.
1549 theParameterV vertical value of the center point (0.0 - 1.0).
1550 theParameterU horisontal value of the center point (0.0 - 1.0).
1551 theTrimSize the size of plane.
1552 theName Object name; when specified, this parameter is used
1553 for result publication in the study. Otherwise, if automatic
1554 publication is switched on, default value is used for result name.
1557 New GEOM.GEOM_Object, containing the created tangent.
1560 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1562 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1563 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1564 self._autoPublish(anObj, theName, "tangent")
1567 ## Create a vector with the given components.
1568 # @param theDX X component of the vector.
1569 # @param theDY Y component of the vector.
1570 # @param theDZ Z component of the vector.
1571 # @param theName Object name; when specified, this parameter is used
1572 # for result publication in the study. Otherwise, if automatic
1573 # publication is switched on, default value is used for result name.
1575 # @return New GEOM.GEOM_Object, containing the created vector.
1577 # @ref tui_creation_vector "Example"
1578 @ManageTransactions("BasicOp")
1579 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1581 Create a vector with the given components.
1584 theDX X component of the vector.
1585 theDY Y component of the vector.
1586 theDZ Z component of the vector.
1587 theName Object name; when specified, this parameter is used
1588 for result publication in the study. Otherwise, if automatic
1589 publication is switched on, default value is used for result name.
1592 New GEOM.GEOM_Object, containing the created vector.
1594 # Example: see GEOM_TestAll.py
1595 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1596 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1597 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1598 anObj.SetParameters(Parameters)
1599 self._autoPublish(anObj, theName, "vector")
1602 ## Create a vector between two points.
1603 # @param thePnt1 Start point for the vector.
1604 # @param thePnt2 End point for the vector.
1605 # @param theName Object name; when specified, this parameter is used
1606 # for result publication in the study. Otherwise, if automatic
1607 # publication is switched on, default value is used for result name.
1609 # @return New GEOM.GEOM_Object, containing the created vector.
1611 # @ref tui_creation_vector "Example"
1612 @ManageTransactions("BasicOp")
1613 def MakeVector(self, thePnt1, thePnt2, theName=None):
1615 Create a vector between two points.
1618 thePnt1 Start point for the vector.
1619 thePnt2 End point for the vector.
1620 theName Object name; when specified, this parameter is used
1621 for result publication in the study. Otherwise, if automatic
1622 publication is switched on, default value is used for result name.
1625 New GEOM.GEOM_Object, containing the created vector.
1627 # Example: see GEOM_TestAll.py
1628 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1629 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1630 self._autoPublish(anObj, theName, "vector")
1633 ## Create a line, passing through the given point
1634 # and parallel to the given direction
1635 # @param thePnt Point. The resulting line will pass through it.
1636 # @param theDir Direction. The resulting line will be parallel to it.
1637 # @param theName Object name; when specified, this parameter is used
1638 # for result publication in the study. Otherwise, if automatic
1639 # publication is switched on, default value is used for result name.
1641 # @return New GEOM.GEOM_Object, containing the created line.
1643 # @ref tui_creation_line "Example"
1644 @ManageTransactions("BasicOp")
1645 def MakeLine(self, thePnt, theDir, theName=None):
1647 Create a line, passing through the given point
1648 and parallel to the given direction
1651 thePnt Point. The resulting line will pass through it.
1652 theDir Direction. The resulting line will be parallel to it.
1653 theName Object name; when specified, this parameter is used
1654 for result publication in the study. Otherwise, if automatic
1655 publication is switched on, default value is used for result name.
1658 New GEOM.GEOM_Object, containing the created line.
1660 # Example: see GEOM_TestAll.py
1661 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1662 RaiseIfFailed("MakeLine", self.BasicOp)
1663 self._autoPublish(anObj, theName, "line")
1666 ## Create a line, passing through the given points
1667 # @param thePnt1 First of two points, defining the line.
1668 # @param thePnt2 Second of two points, defining the line.
1669 # @param theName Object name; when specified, this parameter is used
1670 # for result publication in the study. Otherwise, if automatic
1671 # publication is switched on, default value is used for result name.
1673 # @return New GEOM.GEOM_Object, containing the created line.
1675 # @ref tui_creation_line "Example"
1676 @ManageTransactions("BasicOp")
1677 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1679 Create a line, passing through the given points
1682 thePnt1 First of two points, defining the line.
1683 thePnt2 Second of two points, defining the line.
1684 theName Object name; when specified, this parameter is used
1685 for result publication in the study. Otherwise, if automatic
1686 publication is switched on, default value is used for result name.
1689 New GEOM.GEOM_Object, containing the created line.
1691 # Example: see GEOM_TestAll.py
1692 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1693 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1694 self._autoPublish(anObj, theName, "line")
1697 ## Create a line on two faces intersection.
1698 # @param theFace1 First of two faces, defining the line.
1699 # @param theFace2 Second of two faces, defining the line.
1700 # @param theName Object name; when specified, this parameter is used
1701 # for result publication in the study. Otherwise, if automatic
1702 # publication is switched on, default value is used for result name.
1704 # @return New GEOM.GEOM_Object, containing the created line.
1706 # @ref swig_MakeLineTwoFaces "Example"
1707 @ManageTransactions("BasicOp")
1708 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1710 Create a line on two faces intersection.
1713 theFace1 First of two faces, defining the line.
1714 theFace2 Second of two faces, defining the line.
1715 theName Object name; when specified, this parameter is used
1716 for result publication in the study. Otherwise, if automatic
1717 publication is switched on, default value is used for result name.
1720 New GEOM.GEOM_Object, containing the created line.
1722 # Example: see GEOM_TestAll.py
1723 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1724 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1725 self._autoPublish(anObj, theName, "line")
1728 ## Create a plane, passing through the given point
1729 # and normal to the given vector.
1730 # @param thePnt Point, the plane has to pass through.
1731 # @param theVec Vector, defining the plane normal direction.
1732 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1733 # @param theName Object name; when specified, this parameter is used
1734 # for result publication in the study. Otherwise, if automatic
1735 # publication is switched on, default value is used for result name.
1737 # @return New GEOM.GEOM_Object, containing the created plane.
1739 # @ref tui_creation_plane "Example"
1740 @ManageTransactions("BasicOp")
1741 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1743 Create a plane, passing through the given point
1744 and normal to the given vector.
1747 thePnt Point, the plane has to pass through.
1748 theVec Vector, defining the plane normal direction.
1749 theTrimSize Half size of a side of quadrangle face, representing the plane.
1750 theName Object name; when specified, this parameter is used
1751 for result publication in the study. Otherwise, if automatic
1752 publication is switched on, default value is used for result name.
1755 New GEOM.GEOM_Object, containing the created plane.
1757 # Example: see GEOM_TestAll.py
1758 theTrimSize, Parameters = ParseParameters(theTrimSize);
1759 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1760 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1761 anObj.SetParameters(Parameters)
1762 self._autoPublish(anObj, theName, "plane")
1765 ## Create a plane, passing through the three given points
1766 # @param thePnt1 First of three points, defining the plane.
1767 # @param thePnt2 Second of three points, defining the plane.
1768 # @param thePnt3 Third of three points, defining the plane.
1769 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1770 # @param theName Object name; when specified, this parameter is used
1771 # for result publication in the study. Otherwise, if automatic
1772 # publication is switched on, default value is used for result name.
1774 # @return New GEOM.GEOM_Object, containing the created plane.
1776 # @ref tui_creation_plane "Example"
1777 @ManageTransactions("BasicOp")
1778 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1780 Create a plane, passing through the three given points
1783 thePnt1 First of three points, defining the plane.
1784 thePnt2 Second of three points, defining the plane.
1785 thePnt3 Third of three points, defining the plane.
1786 theTrimSize Half size of a side of quadrangle face, representing the plane.
1787 theName Object name; when specified, this parameter is used
1788 for result publication in the study. Otherwise, if automatic
1789 publication is switched on, default value is used for result name.
1792 New GEOM.GEOM_Object, containing the created plane.
1794 # Example: see GEOM_TestAll.py
1795 theTrimSize, Parameters = ParseParameters(theTrimSize);
1796 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1797 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1798 anObj.SetParameters(Parameters)
1799 self._autoPublish(anObj, theName, "plane")
1802 ## Create a plane, similar to the existing one, but with another size of representing face.
1803 # @param theFace Referenced plane or LCS(Marker).
1804 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1805 # @param theName Object name; when specified, this parameter is used
1806 # for result publication in the study. Otherwise, if automatic
1807 # publication is switched on, default value is used for result name.
1809 # @return New GEOM.GEOM_Object, containing the created plane.
1811 # @ref tui_creation_plane "Example"
1812 @ManageTransactions("BasicOp")
1813 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1815 Create a plane, similar to the existing one, but with another size of representing face.
1818 theFace Referenced plane or LCS(Marker).
1819 theTrimSize New half size of a side of quadrangle face, representing the plane.
1820 theName Object name; when specified, this parameter is used
1821 for result publication in the study. Otherwise, if automatic
1822 publication is switched on, default value is used for result name.
1825 New GEOM.GEOM_Object, containing the created plane.
1827 # Example: see GEOM_TestAll.py
1828 theTrimSize, Parameters = ParseParameters(theTrimSize);
1829 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1830 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1831 anObj.SetParameters(Parameters)
1832 self._autoPublish(anObj, theName, "plane")
1835 ## Create a plane, passing through the 2 vectors
1836 # with center in a start point of the first vector.
1837 # @param theVec1 Vector, defining center point and plane direction.
1838 # @param theVec2 Vector, defining the plane normal direction.
1839 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1840 # @param theName Object name; when specified, this parameter is used
1841 # for result publication in the study. Otherwise, if automatic
1842 # publication is switched on, default value is used for result name.
1844 # @return New GEOM.GEOM_Object, containing the created plane.
1846 # @ref tui_creation_plane "Example"
1847 @ManageTransactions("BasicOp")
1848 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1850 Create a plane, passing through the 2 vectors
1851 with center in a start point of the first vector.
1854 theVec1 Vector, defining center point and plane direction.
1855 theVec2 Vector, defining the plane normal direction.
1856 theTrimSize Half size of a side of quadrangle face, representing the plane.
1857 theName Object name; when specified, this parameter is used
1858 for result publication in the study. Otherwise, if automatic
1859 publication is switched on, default value is used for result name.
1862 New GEOM.GEOM_Object, containing the created plane.
1864 # Example: see GEOM_TestAll.py
1865 theTrimSize, Parameters = ParseParameters(theTrimSize);
1866 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1867 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1868 anObj.SetParameters(Parameters)
1869 self._autoPublish(anObj, theName, "plane")
1872 ## Create a plane, based on a Local coordinate system.
1873 # @param theLCS coordinate system, defining plane.
1874 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1875 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1876 # @param theName Object name; when specified, this parameter is used
1877 # for result publication in the study. Otherwise, if automatic
1878 # publication is switched on, default value is used for result name.
1880 # @return New GEOM.GEOM_Object, containing the created plane.
1882 # @ref tui_creation_plane "Example"
1883 @ManageTransactions("BasicOp")
1884 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1886 Create a plane, based on a Local coordinate system.
1889 theLCS coordinate system, defining plane.
1890 theTrimSize Half size of a side of quadrangle face, representing the plane.
1891 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1892 theName Object name; when specified, this parameter is used
1893 for result publication in the study. Otherwise, if automatic
1894 publication is switched on, default value is used for result name.
1897 New GEOM.GEOM_Object, containing the created plane.
1899 # Example: see GEOM_TestAll.py
1900 theTrimSize, Parameters = ParseParameters(theTrimSize);
1901 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1902 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1903 anObj.SetParameters(Parameters)
1904 self._autoPublish(anObj, theName, "plane")
1907 ## Create a local coordinate system.
1908 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1909 # @param XDX,XDY,XDZ Three components of OX direction
1910 # @param YDX,YDY,YDZ Three components of OY direction
1911 # @param theName Object name; when specified, this parameter is used
1912 # for result publication in the study. Otherwise, if automatic
1913 # publication is switched on, default value is used for result name.
1915 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1917 # @ref swig_MakeMarker "Example"
1918 @ManageTransactions("BasicOp")
1919 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1921 Create a local coordinate system.
1924 OX,OY,OZ Three coordinates of coordinate system origin.
1925 XDX,XDY,XDZ Three components of OX direction
1926 YDX,YDY,YDZ Three components of OY direction
1927 theName Object name; when specified, this parameter is used
1928 for result publication in the study. Otherwise, if automatic
1929 publication is switched on, default value is used for result name.
1932 New GEOM.GEOM_Object, containing the created coordinate system.
1934 # Example: see GEOM_TestAll.py
1935 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1936 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1937 RaiseIfFailed("MakeMarker", self.BasicOp)
1938 anObj.SetParameters(Parameters)
1939 self._autoPublish(anObj, theName, "lcs")
1942 ## Create a local coordinate system from shape.
1943 # @param theShape The initial shape to detect the coordinate system.
1944 # @param theName Object name; when specified, this parameter is used
1945 # for result publication in the study. Otherwise, if automatic
1946 # publication is switched on, default value is used for result name.
1948 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1950 # @ref tui_creation_lcs "Example"
1951 @ManageTransactions("BasicOp")
1952 def MakeMarkerFromShape(self, theShape, theName=None):
1954 Create a local coordinate system from shape.
1957 theShape The initial shape to detect the coordinate system.
1958 theName Object name; when specified, this parameter is used
1959 for result publication in the study. Otherwise, if automatic
1960 publication is switched on, default value is used for result name.
1963 New GEOM.GEOM_Object, containing the created coordinate system.
1965 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1966 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1967 self._autoPublish(anObj, theName, "lcs")
1970 ## Create a local coordinate system from point and two vectors.
1971 # @param theOrigin Point of coordinate system origin.
1972 # @param theXVec Vector of X direction
1973 # @param theYVec Vector of Y direction
1974 # @param theName Object name; when specified, this parameter is used
1975 # for result publication in the study. Otherwise, if automatic
1976 # publication is switched on, default value is used for result name.
1978 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1980 # @ref tui_creation_lcs "Example"
1981 @ManageTransactions("BasicOp")
1982 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1984 Create a local coordinate system from point and two vectors.
1987 theOrigin Point of coordinate system origin.
1988 theXVec Vector of X direction
1989 theYVec Vector of Y direction
1990 theName Object name; when specified, this parameter is used
1991 for result publication in the study. Otherwise, if automatic
1992 publication is switched on, default value is used for result name.
1995 New GEOM.GEOM_Object, containing the created coordinate system.
1998 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1999 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
2000 self._autoPublish(anObj, theName, "lcs")
2003 # end of l3_basic_go
2006 ## @addtogroup l4_curves
2009 ## Create an arc of circle, passing through three given points.
2010 # @param thePnt1 Start point of the arc.
2011 # @param thePnt2 Middle point of the arc.
2012 # @param thePnt3 End point of the arc.
2013 # @param theName Object name; when specified, this parameter is used
2014 # for result publication in the study. Otherwise, if automatic
2015 # publication is switched on, default value is used for result name.
2017 # @return New GEOM.GEOM_Object, containing the created arc.
2019 # @ref swig_MakeArc "Example"
2020 @ManageTransactions("CurvesOp")
2021 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2023 Create an arc of circle, passing through three given points.
2026 thePnt1 Start point of the arc.
2027 thePnt2 Middle point of the arc.
2028 thePnt3 End point of the arc.
2029 theName Object name; when specified, this parameter is used
2030 for result publication in the study. Otherwise, if automatic
2031 publication is switched on, default value is used for result name.
2034 New GEOM.GEOM_Object, containing the created arc.
2036 # Example: see GEOM_TestAll.py
2037 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2038 RaiseIfFailed("MakeArc", self.CurvesOp)
2039 self._autoPublish(anObj, theName, "arc")
2042 ## Create an arc of circle from a center and 2 points.
2043 # @param thePnt1 Center of the arc
2044 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2045 # @param thePnt3 End point of the arc (Gives also a direction)
2046 # @param theSense Orientation of the arc
2047 # @param theName Object name; when specified, this parameter is used
2048 # for result publication in the study. Otherwise, if automatic
2049 # publication is switched on, default value is used for result name.
2051 # @return New GEOM.GEOM_Object, containing the created arc.
2053 # @ref swig_MakeArc "Example"
2054 @ManageTransactions("CurvesOp")
2055 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2057 Create an arc of circle from a center and 2 points.
2060 thePnt1 Center of the arc
2061 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2062 thePnt3 End point of the arc (Gives also a direction)
2063 theSense Orientation of the arc
2064 theName Object name; when specified, this parameter is used
2065 for result publication in the study. Otherwise, if automatic
2066 publication is switched on, default value is used for result name.
2069 New GEOM.GEOM_Object, containing the created arc.
2071 # Example: see GEOM_TestAll.py
2072 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2073 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2074 self._autoPublish(anObj, theName, "arc")
2077 ## Create an arc of ellipse, of center and two points.
2078 # @param theCenter Center of the arc.
2079 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2080 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2081 # @param theName Object name; when specified, this parameter is used
2082 # for result publication in the study. Otherwise, if automatic
2083 # publication is switched on, default value is used for result name.
2085 # @return New GEOM.GEOM_Object, containing the created arc.
2087 # @ref swig_MakeArc "Example"
2088 @ManageTransactions("CurvesOp")
2089 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2091 Create an arc of ellipse, of center and two points.
2094 theCenter Center of the arc.
2095 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2096 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2097 theName Object name; when specified, this parameter is used
2098 for result publication in the study. Otherwise, if automatic
2099 publication is switched on, default value is used for result name.
2102 New GEOM.GEOM_Object, containing the created arc.
2104 # Example: see GEOM_TestAll.py
2105 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2106 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2107 self._autoPublish(anObj, theName, "arc")
2110 ## Create a circle with given center, normal vector and radius.
2111 # @param thePnt Circle center.
2112 # @param theVec Vector, normal to the plane of the circle.
2113 # @param theR Circle radius.
2114 # @param theName Object name; when specified, this parameter is used
2115 # for result publication in the study. Otherwise, if automatic
2116 # publication is switched on, default value is used for result name.
2118 # @return New GEOM.GEOM_Object, containing the created circle.
2120 # @ref tui_creation_circle "Example"
2121 @ManageTransactions("CurvesOp")
2122 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2124 Create a circle with given center, normal vector and radius.
2127 thePnt Circle center.
2128 theVec Vector, normal to the plane of the circle.
2130 theName Object name; when specified, this parameter is used
2131 for result publication in the study. Otherwise, if automatic
2132 publication is switched on, default value is used for result name.
2135 New GEOM.GEOM_Object, containing the created circle.
2137 # Example: see GEOM_TestAll.py
2138 theR, Parameters = ParseParameters(theR)
2139 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2140 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2141 anObj.SetParameters(Parameters)
2142 self._autoPublish(anObj, theName, "circle")
2145 ## Create a circle with given radius.
2146 # Center of the circle will be in the origin of global
2147 # coordinate system and normal vector will be codirected with Z axis
2148 # @param theR Circle radius.
2149 # @param theName Object name; when specified, this parameter is used
2150 # for result publication in the study. Otherwise, if automatic
2151 # publication is switched on, default value is used for result name.
2153 # @return New GEOM.GEOM_Object, containing the created circle.
2154 @ManageTransactions("CurvesOp")
2155 def MakeCircleR(self, theR, theName=None):
2157 Create a circle with given radius.
2158 Center of the circle will be in the origin of global
2159 coordinate system and normal vector will be codirected with Z axis
2163 theName Object name; when specified, this parameter is used
2164 for result publication in the study. Otherwise, if automatic
2165 publication is switched on, default value is used for result name.
2168 New GEOM.GEOM_Object, containing the created circle.
2170 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2171 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2172 self._autoPublish(anObj, theName, "circle")
2175 ## Create a circle, passing through three given points
2176 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2177 # @param theName Object name; when specified, this parameter is used
2178 # for result publication in the study. Otherwise, if automatic
2179 # publication is switched on, default value is used for result name.
2181 # @return New GEOM.GEOM_Object, containing the created circle.
2183 # @ref tui_creation_circle "Example"
2184 @ManageTransactions("CurvesOp")
2185 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2187 Create a circle, passing through three given points
2190 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2191 theName Object name; when specified, this parameter is used
2192 for result publication in the study. Otherwise, if automatic
2193 publication is switched on, default value is used for result name.
2196 New GEOM.GEOM_Object, containing the created circle.
2198 # Example: see GEOM_TestAll.py
2199 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2200 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2201 self._autoPublish(anObj, theName, "circle")
2204 ## Create a circle, with given point1 as center,
2205 # passing through the point2 as radius and laying in the plane,
2206 # defined by all three given points.
2207 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2208 # @param theName Object name; when specified, this parameter is used
2209 # for result publication in the study. Otherwise, if automatic
2210 # publication is switched on, default value is used for result name.
2212 # @return New GEOM.GEOM_Object, containing the created circle.
2214 # @ref swig_MakeCircle "Example"
2215 @ManageTransactions("CurvesOp")
2216 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2218 Create a circle, with given point1 as center,
2219 passing through the point2 as radius and laying in the plane,
2220 defined by all three given points.
2223 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2224 theName Object name; when specified, this parameter is used
2225 for result publication in the study. Otherwise, if automatic
2226 publication is switched on, default value is used for result name.
2229 New GEOM.GEOM_Object, containing the created circle.
2231 # Example: see GEOM_example6.py
2232 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2233 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2234 self._autoPublish(anObj, theName, "circle")
2237 ## Create an ellipse with given center, normal vector and radiuses.
2238 # @param thePnt Ellipse center.
2239 # @param theVec Vector, normal to the plane of the ellipse.
2240 # @param theRMajor Major ellipse radius.
2241 # @param theRMinor Minor ellipse radius.
2242 # @param theVecMaj Vector, direction of the ellipse's main axis.
2243 # @param theName Object name; when specified, this parameter is used
2244 # for result publication in the study. Otherwise, if automatic
2245 # publication is switched on, default value is used for result name.
2247 # @return New GEOM.GEOM_Object, containing the created ellipse.
2249 # @ref tui_creation_ellipse "Example"
2250 @ManageTransactions("CurvesOp")
2251 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2253 Create an ellipse with given center, normal vector and radiuses.
2256 thePnt Ellipse center.
2257 theVec Vector, normal to the plane of the ellipse.
2258 theRMajor Major ellipse radius.
2259 theRMinor Minor ellipse radius.
2260 theVecMaj Vector, direction of the ellipse's main axis.
2261 theName Object name; when specified, this parameter is used
2262 for result publication in the study. Otherwise, if automatic
2263 publication is switched on, default value is used for result name.
2266 New GEOM.GEOM_Object, containing the created ellipse.
2268 # Example: see GEOM_TestAll.py
2269 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2270 if theVecMaj is not None:
2271 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2273 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2275 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2276 anObj.SetParameters(Parameters)
2277 self._autoPublish(anObj, theName, "ellipse")
2280 ## Create an ellipse with given radiuses.
2281 # Center of the ellipse will be in the origin of global
2282 # coordinate system and normal vector will be codirected with Z axis
2283 # @param theRMajor Major ellipse radius.
2284 # @param theRMinor Minor ellipse radius.
2285 # @param theName Object name; when specified, this parameter is used
2286 # for result publication in the study. Otherwise, if automatic
2287 # publication is switched on, default value is used for result name.
2289 # @return New GEOM.GEOM_Object, containing the created ellipse.
2290 @ManageTransactions("CurvesOp")
2291 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2293 Create an ellipse with given radiuses.
2294 Center of the ellipse will be in the origin of global
2295 coordinate system and normal vector will be codirected with Z axis
2298 theRMajor Major ellipse radius.
2299 theRMinor Minor ellipse radius.
2300 theName Object name; when specified, this parameter is used
2301 for result publication in the study. Otherwise, if automatic
2302 publication is switched on, default value is used for result name.
2305 New GEOM.GEOM_Object, containing the created ellipse.
2307 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2308 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2309 self._autoPublish(anObj, theName, "ellipse")
2312 ## Create a polyline on the set of points.
2313 # @param thePoints Sequence of points for the polyline.
2314 # @param theIsClosed If True, build a closed wire.
2315 # @param theName Object name; when specified, this parameter is used
2316 # for result publication in the study. Otherwise, if automatic
2317 # publication is switched on, default value is used for result name.
2319 # @return New GEOM.GEOM_Object, containing the created polyline.
2321 # @ref tui_creation_curve "Example"
2322 @ManageTransactions("CurvesOp")
2323 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2325 Create a polyline on the set of points.
2328 thePoints Sequence of points for the polyline.
2329 theIsClosed If True, build a closed wire.
2330 theName Object name; when specified, this parameter is used
2331 for result publication in the study. Otherwise, if automatic
2332 publication is switched on, default value is used for result name.
2335 New GEOM.GEOM_Object, containing the created polyline.
2337 # Example: see GEOM_TestAll.py
2338 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2339 RaiseIfFailed("MakePolyline", self.CurvesOp)
2340 self._autoPublish(anObj, theName, "polyline")
2343 ## Create bezier curve on the set of points.
2344 # @param thePoints Sequence of points for the bezier curve.
2345 # @param theIsClosed If True, build a closed curve.
2346 # @param theName Object name; when specified, this parameter is used
2347 # for result publication in the study. Otherwise, if automatic
2348 # publication is switched on, default value is used for result name.
2350 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2352 # @ref tui_creation_curve "Example"
2353 @ManageTransactions("CurvesOp")
2354 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2356 Create bezier curve on the set of points.
2359 thePoints Sequence of points for the bezier curve.
2360 theIsClosed If True, build a closed curve.
2361 theName Object name; when specified, this parameter is used
2362 for result publication in the study. Otherwise, if automatic
2363 publication is switched on, default value is used for result name.
2366 New GEOM.GEOM_Object, containing the created bezier curve.
2368 # Example: see GEOM_TestAll.py
2369 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2370 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2371 self._autoPublish(anObj, theName, "bezier")
2374 ## Create B-Spline curve on the set of points.
2375 # @param thePoints Sequence of points for the B-Spline curve.
2376 # @param theIsClosed If True, build a closed curve.
2377 # @param theDoReordering If TRUE, the algo does not follow the order of
2378 # \a thePoints but searches for the closest vertex.
2379 # @param theName Object name; when specified, this parameter is used
2380 # for result publication in the study. Otherwise, if automatic
2381 # publication is switched on, default value is used for result name.
2383 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2385 # @ref tui_creation_curve "Example"
2386 @ManageTransactions("CurvesOp")
2387 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2389 Create B-Spline curve on the set of points.
2392 thePoints Sequence of points for the B-Spline curve.
2393 theIsClosed If True, build a closed curve.
2394 theDoReordering If True, the algo does not follow the order of
2395 thePoints but searches for the closest vertex.
2396 theName Object name; when specified, this parameter is used
2397 for result publication in the study. Otherwise, if automatic
2398 publication is switched on, default value is used for result name.
2401 New GEOM.GEOM_Object, containing the created B-Spline curve.
2403 # Example: see GEOM_TestAll.py
2404 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2405 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2406 self._autoPublish(anObj, theName, "bspline")
2409 ## Create B-Spline curve on the set of points.
2410 # @param thePoints Sequence of points for the B-Spline curve.
2411 # @param theFirstVec Vector object, defining the curve direction at its first point.
2412 # @param theLastVec Vector object, defining the curve direction at its last point.
2413 # @param theName Object name; when specified, this parameter is used
2414 # for result publication in the study. Otherwise, if automatic
2415 # publication is switched on, default value is used for result name.
2417 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2419 # @ref tui_creation_curve "Example"
2420 @ManageTransactions("CurvesOp")
2421 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2423 Create B-Spline curve on the set of points.
2426 thePoints Sequence of points for the B-Spline curve.
2427 theFirstVec Vector object, defining the curve direction at its first point.
2428 theLastVec Vector object, defining the curve direction at its last point.
2429 theName Object name; when specified, this parameter is used
2430 for result publication in the study. Otherwise, if automatic
2431 publication is switched on, default value is used for result name.
2434 New GEOM.GEOM_Object, containing the created B-Spline curve.
2436 # Example: see GEOM_TestAll.py
2437 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2438 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2439 self._autoPublish(anObj, theName, "bspline")
2442 ## Creates a curve using the parametric definition of the basic points.
2443 # @param thexExpr parametric equation of the coordinates X.
2444 # @param theyExpr parametric equation of the coordinates Y.
2445 # @param thezExpr parametric equation of the coordinates Z.
2446 # @param theParamMin the minimal value of the parameter.
2447 # @param theParamMax the maximum value of the parameter.
2448 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2449 # @param theCurveType the type of the curve,
2450 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2451 # @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.
2452 # @param theName Object name; when specified, this parameter is used
2453 # for result publication in the study. Otherwise, if automatic
2454 # publication is switched on, default value is used for result name.
2456 # @return New GEOM.GEOM_Object, containing the created curve.
2458 # @ref tui_creation_curve "Example"
2459 @ManageTransactions("CurvesOp")
2460 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2461 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2463 Creates a curve using the parametric definition of the basic points.
2466 thexExpr parametric equation of the coordinates X.
2467 theyExpr parametric equation of the coordinates Y.
2468 thezExpr parametric equation of the coordinates Z.
2469 theParamMin the minimal value of the parameter.
2470 theParamMax the maximum value of the parameter.
2471 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2472 theCurveType the type of the curve,
2473 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2474 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2475 method is used which can lead to a bug.
2476 theName Object name; when specified, this parameter is used
2477 for result publication in the study. Otherwise, if automatic
2478 publication is switched on, default value is used for result name.
2481 New GEOM.GEOM_Object, containing the created curve.
2483 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2485 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2487 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2488 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2489 anObj.SetParameters(Parameters)
2490 self._autoPublish(anObj, theName, "curve")
2493 ## Create an isoline curve on a face.
2494 # @param theFace the face for which an isoline is created.
2495 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2497 # @param theParameter the U parameter for U-isoline or V parameter
2499 # @param theName Object name; when specified, this parameter is used
2500 # for result publication in the study. Otherwise, if automatic
2501 # publication is switched on, default value is used for result name.
2503 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2504 # a compound of edges.
2506 # @ref tui_creation_curve "Example"
2507 @ManageTransactions("CurvesOp")
2508 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2510 Create an isoline curve on a face.
2513 theFace the face for which an isoline is created.
2514 IsUIsoline True for U-isoline creation; False for V-isoline
2516 theParameter the U parameter for U-isoline or V parameter
2518 theName Object name; when specified, this parameter is used
2519 for result publication in the study. Otherwise, if automatic
2520 publication is switched on, default value is used for result name.
2523 New GEOM.GEOM_Object, containing the created isoline edge or a
2526 # Example: see GEOM_TestAll.py
2527 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2528 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2530 self._autoPublish(anObj, theName, "U-Isoline")
2532 self._autoPublish(anObj, theName, "V-Isoline")
2538 ## @addtogroup l3_sketcher
2541 ## Create a sketcher (wire or face), following the textual description,
2542 # passed through <VAR>theCommand</VAR> argument. \n
2543 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2544 # Format of the description string have to be the following:
2546 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2549 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2551 # - "R angle" : Set the direction by angle
2552 # - "D dx dy" : Set the direction by DX & DY
2555 # - "TT x y" : Create segment by point at X & Y
2556 # - "T dx dy" : Create segment by point with DX & DY
2557 # - "L length" : Create segment by direction & Length
2558 # - "IX x" : Create segment by direction & Intersect. X
2559 # - "IY y" : Create segment by direction & Intersect. Y
2562 # - "C radius length" : Create arc by direction, radius and length(in degree)
2563 # - "AA x y": Create arc by point at X & Y
2564 # - "A dx dy" : Create arc by point with DX & DY
2565 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2566 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2567 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2568 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2571 # - "WW" : Close Wire (to finish)
2572 # - "WF" : Close Wire and build face (to finish)
2575 # - Flag1 (= reverse) is 0 or 2 ...
2576 # - if 0 the drawn arc is the one of lower angle (< Pi)
2577 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2580 # - Flag2 (= control tolerance) is 0 or 1 ...
2581 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2582 # - if 1 the wire is built only if the end point is on the arc
2583 # with a tolerance of 10^-7 on the distance else the creation fails
2585 # @param theCommand String, defining the sketcher in local
2586 # coordinates of the working plane.
2587 # @param theWorkingPlane Nine double values, defining origin,
2588 # OZ and OX directions of the working plane.
2589 # @param theName Object name; when specified, this parameter is used
2590 # for result publication in the study. Otherwise, if automatic
2591 # publication is switched on, default value is used for result name.
2593 # @return New GEOM.GEOM_Object, containing the created wire.
2595 # @ref tui_sketcher_page "Example"
2596 @ManageTransactions("CurvesOp")
2597 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2599 Create a sketcher (wire or face), following the textual description, passed
2600 through theCommand argument.
2601 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2602 Format of the description string have to be the following:
2603 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2605 - x1, y1 are coordinates of the first sketcher point (zero by default),
2607 - "R angle" : Set the direction by angle
2608 - "D dx dy" : Set the direction by DX & DY
2610 - "TT x y" : Create segment by point at X & Y
2611 - "T dx dy" : Create segment by point with DX & DY
2612 - "L length" : Create segment by direction & Length
2613 - "IX x" : Create segment by direction & Intersect. X
2614 - "IY y" : Create segment by direction & Intersect. Y
2616 - "C radius length" : Create arc by direction, radius and length(in degree)
2617 - "AA x y": Create arc by point at X & Y
2618 - "A dx dy" : Create arc by point with DX & DY
2619 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2620 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2621 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2622 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2624 - "WW" : Close Wire (to finish)
2625 - "WF" : Close Wire and build face (to finish)
2627 - Flag1 (= reverse) is 0 or 2 ...
2628 - if 0 the drawn arc is the one of lower angle (< Pi)
2629 - if 2 the drawn arc ius the one of greater angle (> Pi)
2631 - Flag2 (= control tolerance) is 0 or 1 ...
2632 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2633 - if 1 the wire is built only if the end point is on the arc
2634 with a tolerance of 10^-7 on the distance else the creation fails
2637 theCommand String, defining the sketcher in local
2638 coordinates of the working plane.
2639 theWorkingPlane Nine double values, defining origin,
2640 OZ and OX directions of the working plane.
2641 theName Object name; when specified, this parameter is used
2642 for result publication in the study. Otherwise, if automatic
2643 publication is switched on, default value is used for result name.
2646 New GEOM.GEOM_Object, containing the created wire.
2648 # Example: see GEOM_TestAll.py
2649 theCommand,Parameters = ParseSketcherCommand(theCommand)
2650 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2651 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2652 anObj.SetParameters(Parameters)
2653 self._autoPublish(anObj, theName, "wire")
2656 ## Create a sketcher (wire or face), following the textual description,
2657 # passed through <VAR>theCommand</VAR> argument. \n
2658 # For format of the description string see MakeSketcher() method.\n
2659 # @param theCommand String, defining the sketcher in local
2660 # coordinates of the working plane.
2661 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2662 # @param theName Object name; when specified, this parameter is used
2663 # for result publication in the study. Otherwise, if automatic
2664 # publication is switched on, default value is used for result name.
2666 # @return New GEOM.GEOM_Object, containing the created wire.
2668 # @ref tui_sketcher_page "Example"
2669 @ManageTransactions("CurvesOp")
2670 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2672 Create a sketcher (wire or face), following the textual description,
2673 passed through theCommand argument.
2674 For format of the description string see geompy.MakeSketcher() method.
2677 theCommand String, defining the sketcher in local
2678 coordinates of the working plane.
2679 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2680 theName Object name; when specified, this parameter is used
2681 for result publication in the study. Otherwise, if automatic
2682 publication is switched on, default value is used for result name.
2685 New GEOM.GEOM_Object, containing the created wire.
2687 theCommand,Parameters = ParseSketcherCommand(theCommand)
2688 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2689 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2690 anObj.SetParameters(Parameters)
2691 self._autoPublish(anObj, theName, "wire")
2694 ## Obtain a 2D sketcher interface
2695 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2696 def Sketcher2D (self):
2698 Obtain a 2D sketcher interface.
2701 sk = geompy.Sketcher2D()
2703 sk.addSegmentRelative(15, 70)
2704 sk.addSegmentPerpY(50)
2705 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2706 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2707 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2709 Sketch_1 = sk.wire(geomObj_1)
2711 sk = Sketcher2D (self)
2714 ## Create a sketcher wire, following the numerical description,
2715 # passed through <VAR>theCoordinates</VAR> argument. \n
2716 # @param theCoordinates double values, defining points to create a wire,
2718 # @param theName Object name; when specified, this parameter is used
2719 # for result publication in the study. Otherwise, if automatic
2720 # publication is switched on, default value is used for result name.
2722 # @return New GEOM.GEOM_Object, containing the created wire.
2724 # @ref tui_3dsketcher_page "Example"
2725 @ManageTransactions("CurvesOp")
2726 def Make3DSketcher(self, theCoordinates, theName=None):
2728 Create a sketcher wire, following the numerical description,
2729 passed through theCoordinates argument.
2732 theCoordinates double values, defining points to create a wire,
2734 theName Object name; when specified, this parameter is used
2735 for result publication in the study. Otherwise, if automatic
2736 publication is switched on, default value is used for result name.
2739 New GEOM_Object, containing the created wire.
2741 theCoordinates,Parameters = ParseParameters(theCoordinates)
2742 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2743 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2744 anObj.SetParameters(Parameters)
2745 self._autoPublish(anObj, theName, "wire")
2748 ## Obtain a 3D sketcher interface
2749 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2751 # @ref tui_3dsketcher_page "Example"
2752 def Sketcher3D (self):
2754 Obtain a 3D sketcher interface.
2757 sk = geompy.Sketcher3D()
2758 sk.addPointsAbsolute(0,0,0, 70,0,0)
2759 sk.addPointsRelative(0, 0, 130)
2760 sk.addPointAnglesLength("OXY", 50, 0, 100)
2761 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2763 a3D_Sketcher_1 = sk.wire()
2765 sk = Sketcher3D (self)
2768 ## Obtain a 2D polyline creation interface
2769 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2771 # @ref tui_3dsketcher_page "Example"
2772 def Polyline2D (self):
2774 Obtain a 2D polyline creation interface.
2777 pl = geompy.Polyline2D()
2778 pl.addSection("section 1", GEOM.Polyline, True)
2779 pl.addPoints(0, 0, 10, 0, 10, 10)
2780 pl.addSection("section 2", GEOM.Interpolation, False)
2781 pl.addPoints(20, 0, 30, 0, 30, 10)
2782 resultObj = pl.result(WorkingPlane)
2784 pl = Polyline2D (self)
2787 # end of l3_sketcher
2790 ## @addtogroup l3_3d_primitives
2793 ## Create a box by coordinates of two opposite vertices.
2795 # @param x1,y1,z1 double values, defining first point it.
2796 # @param x2,y2,z2 double values, defining first point it.
2797 # @param theName Object name; when specified, this parameter is used
2798 # for result publication in the study. Otherwise, if automatic
2799 # publication is switched on, default value is used for result name.
2801 # @return New GEOM.GEOM_Object, containing the created box.
2803 # @ref tui_creation_box "Example"
2804 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2806 Create a box by coordinates of two opposite vertices.
2809 x1,y1,z1 double values, defining first point.
2810 x2,y2,z2 double values, defining second point.
2811 theName Object name; when specified, this parameter is used
2812 for result publication in the study. Otherwise, if automatic
2813 publication is switched on, default value is used for result name.
2816 New GEOM.GEOM_Object, containing the created box.
2818 # Example: see GEOM_TestAll.py
2819 pnt1 = self.MakeVertex(x1,y1,z1)
2820 pnt2 = self.MakeVertex(x2,y2,z2)
2821 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2822 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2824 ## Create a box with specified dimensions along the coordinate axes
2825 # and with edges, parallel to the coordinate axes.
2826 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2827 # @param theDX Length of Box edges, parallel to OX axis.
2828 # @param theDY Length of Box edges, parallel to OY axis.
2829 # @param theDZ Length of Box edges, parallel to OZ axis.
2830 # @param theName Object name; when specified, this parameter is used
2831 # for result publication in the study. Otherwise, if automatic
2832 # publication is switched on, default value is used for result name.
2834 # @return New GEOM.GEOM_Object, containing the created box.
2836 # @ref tui_creation_box "Example"
2837 @ManageTransactions("PrimOp")
2838 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2840 Create a box with specified dimensions along the coordinate axes
2841 and with edges, parallel to the coordinate axes.
2842 Center of the box will be at point (DX/2, DY/2, DZ/2).
2845 theDX Length of Box edges, parallel to OX axis.
2846 theDY Length of Box edges, parallel to OY axis.
2847 theDZ Length of Box edges, parallel to OZ axis.
2848 theName Object name; when specified, this parameter is used
2849 for result publication in the study. Otherwise, if automatic
2850 publication is switched on, default value is used for result name.
2853 New GEOM.GEOM_Object, containing the created box.
2855 # Example: see GEOM_TestAll.py
2856 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2857 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2858 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2859 anObj.SetParameters(Parameters)
2860 self._autoPublish(anObj, theName, "box")
2863 ## Create a box with two specified opposite vertices,
2864 # and with edges, parallel to the coordinate axes
2865 # @param thePnt1 First of two opposite vertices.
2866 # @param thePnt2 Second of two opposite vertices.
2867 # @param theName Object name; when specified, this parameter is used
2868 # for result publication in the study. Otherwise, if automatic
2869 # publication is switched on, default value is used for result name.
2871 # @return New GEOM.GEOM_Object, containing the created box.
2873 # @ref tui_creation_box "Example"
2874 @ManageTransactions("PrimOp")
2875 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2877 Create a box with two specified opposite vertices,
2878 and with edges, parallel to the coordinate axes
2881 thePnt1 First of two opposite vertices.
2882 thePnt2 Second of two opposite vertices.
2883 theName Object name; when specified, this parameter is used
2884 for result publication in the study. Otherwise, if automatic
2885 publication is switched on, default value is used for result name.
2888 New GEOM.GEOM_Object, containing the created box.
2890 # Example: see GEOM_TestAll.py
2891 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2892 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2893 self._autoPublish(anObj, theName, "box")
2896 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2897 # @param theH height of Face.
2898 # @param theW width of Face.
2899 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2900 # @param theName Object name; when specified, this parameter is used
2901 # for result publication in the study. Otherwise, if automatic
2902 # publication is switched on, default value is used for result name.
2904 # @return New GEOM.GEOM_Object, containing the created face.
2906 # @ref tui_creation_face "Example"
2907 @ManageTransactions("PrimOp")
2908 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2910 Create a face with specified dimensions with edges parallel to coordinate axes.
2913 theH height of Face.
2915 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2916 theName Object name; when specified, this parameter is used
2917 for result publication in the study. Otherwise, if automatic
2918 publication is switched on, default value is used for result name.
2921 New GEOM.GEOM_Object, containing the created face.
2923 # Example: see GEOM_TestAll.py
2924 theH,theW,Parameters = ParseParameters(theH, theW)
2925 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2926 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2927 anObj.SetParameters(Parameters)
2928 self._autoPublish(anObj, theName, "rectangle")
2931 ## Create a face from another plane and two sizes,
2932 # vertical size and horisontal size.
2933 # @param theObj Normale vector to the creating face or
2935 # @param theH Height (vertical size).
2936 # @param theW Width (horisontal size).
2937 # @param theName Object name; when specified, this parameter is used
2938 # for result publication in the study. Otherwise, if automatic
2939 # publication is switched on, default value is used for result name.
2941 # @return New GEOM.GEOM_Object, containing the created face.
2943 # @ref tui_creation_face "Example"
2944 @ManageTransactions("PrimOp")
2945 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2947 Create a face from another plane and two sizes,
2948 vertical size and horisontal size.
2951 theObj Normale vector to the creating face or
2953 theH Height (vertical size).
2954 theW Width (horisontal size).
2955 theName Object name; when specified, this parameter is used
2956 for result publication in the study. Otherwise, if automatic
2957 publication is switched on, default value is used for result name.
2960 New GEOM_Object, containing the created face.
2962 # Example: see GEOM_TestAll.py
2963 theH,theW,Parameters = ParseParameters(theH, theW)
2964 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2965 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2966 anObj.SetParameters(Parameters)
2967 self._autoPublish(anObj, theName, "rectangle")
2970 ## Create a disk with given center, normal vector and radius.
2971 # @param thePnt Disk center.
2972 # @param theVec Vector, normal to the plane of the disk.
2973 # @param theR Disk radius.
2974 # @param theName Object name; when specified, this parameter is used
2975 # for result publication in the study. Otherwise, if automatic
2976 # publication is switched on, default value is used for result name.
2978 # @return New GEOM.GEOM_Object, containing the created disk.
2980 # @ref tui_creation_disk "Example"
2981 @ManageTransactions("PrimOp")
2982 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2984 Create a disk with given center, normal vector and radius.
2988 theVec Vector, normal to the plane of the disk.
2990 theName Object name; when specified, this parameter is used
2991 for result publication in the study. Otherwise, if automatic
2992 publication is switched on, default value is used for result name.
2995 New GEOM.GEOM_Object, containing the created disk.
2997 # Example: see GEOM_TestAll.py
2998 theR,Parameters = ParseParameters(theR)
2999 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
3000 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
3001 anObj.SetParameters(Parameters)
3002 self._autoPublish(anObj, theName, "disk")
3005 ## Create a disk, passing through three given points
3006 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3007 # @param theName Object name; when specified, this parameter is used
3008 # for result publication in the study. Otherwise, if automatic
3009 # publication is switched on, default value is used for result name.
3011 # @return New GEOM.GEOM_Object, containing the created disk.
3013 # @ref tui_creation_disk "Example"
3014 @ManageTransactions("PrimOp")
3015 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3017 Create a disk, passing through three given points
3020 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3021 theName Object name; when specified, this parameter is used
3022 for result publication in the study. Otherwise, if automatic
3023 publication is switched on, default value is used for result name.
3026 New GEOM.GEOM_Object, containing the created disk.
3028 # Example: see GEOM_TestAll.py
3029 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3030 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3031 self._autoPublish(anObj, theName, "disk")
3034 ## Create a disk with specified dimensions along OX-OY coordinate axes.
3035 # @param theR Radius of Face.
3036 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3037 # @param theName Object name; when specified, this parameter is used
3038 # for result publication in the study. Otherwise, if automatic
3039 # publication is switched on, default value is used for result name.
3041 # @return New GEOM.GEOM_Object, containing the created disk.
3043 # @ref tui_creation_face "Example"
3044 @ManageTransactions("PrimOp")
3045 def MakeDiskR(self, theR, theOrientation, theName=None):
3047 Create a disk with specified dimensions along OX-OY coordinate axes.
3050 theR Radius of Face.
3051 theOrientation set the orientation belong axis OXY or OYZ or OZX
3052 theName Object name; when specified, this parameter is used
3053 for result publication in the study. Otherwise, if automatic
3054 publication is switched on, default value is used for result name.
3057 New GEOM.GEOM_Object, containing the created disk.
3060 Disk3 = geompy.MakeDiskR(100., 1)
3062 # Example: see GEOM_TestAll.py
3063 theR,Parameters = ParseParameters(theR)
3064 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3065 RaiseIfFailed("MakeDiskR", self.PrimOp)
3066 anObj.SetParameters(Parameters)
3067 self._autoPublish(anObj, theName, "disk")
3070 ## Create a cylinder with given base point, axis, radius and height.
3071 # @param thePnt Central point of cylinder base.
3072 # @param theAxis Cylinder axis.
3073 # @param theR Cylinder radius.
3074 # @param theH Cylinder height.
3075 # @param theName Object name; when specified, this parameter is used
3076 # for result publication in the study. Otherwise, if automatic
3077 # publication is switched on, default value is used for result name.
3079 # @return New GEOM.GEOM_Object, containing the created cylinder.
3081 # @ref tui_creation_cylinder "Example"
3082 @ManageTransactions("PrimOp")
3083 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3085 Create a cylinder with given base point, axis, radius and height.
3088 thePnt Central point of cylinder base.
3089 theAxis Cylinder axis.
3090 theR Cylinder radius.
3091 theH Cylinder height.
3092 theName Object name; when specified, this parameter is used
3093 for result publication in the study. Otherwise, if automatic
3094 publication is switched on, default value is used for result name.
3097 New GEOM.GEOM_Object, containing the created cylinder.
3099 # Example: see GEOM_TestAll.py
3100 theR,theH,Parameters = ParseParameters(theR, theH)
3101 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3102 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3103 anObj.SetParameters(Parameters)
3104 self._autoPublish(anObj, theName, "cylinder")
3107 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3108 # @param thePnt Central point of cylinder base.
3109 # @param theAxis Cylinder axis.
3110 # @param theR Cylinder radius.
3111 # @param theH Cylinder height.
3112 # @param theA Cylinder angle in radians.
3113 # @param theName Object name; when specified, this parameter is used
3114 # for result publication in the study. Otherwise, if automatic
3115 # publication is switched on, default value is used for result name.
3117 # @return New GEOM.GEOM_Object, containing the created cylinder.
3119 # @ref tui_creation_cylinder "Example"
3120 @ManageTransactions("PrimOp")
3121 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3123 Create a portion of cylinder with given base point, axis, radius, height and angle.
3126 thePnt Central point of cylinder base.
3127 theAxis Cylinder axis.
3128 theR Cylinder radius.
3129 theH Cylinder height.
3130 theA Cylinder angle in radians.
3131 theName Object name; when specified, this parameter is used
3132 for result publication in the study. Otherwise, if automatic
3133 publication is switched on, default value is used for result name.
3136 New GEOM.GEOM_Object, containing the created cylinder.
3138 # Example: see GEOM_TestAll.py
3140 if isinstance(theA,str):
3142 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3144 theA = theA*math.pi/180.
3145 if theA<=0. or theA>=2*math.pi:
3146 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3147 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3148 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3149 anObj.SetParameters(Parameters)
3150 self._autoPublish(anObj, theName, "cylinder")
3153 ## Create a cylinder with given radius and height at
3154 # the origin of coordinate system. Axis of the cylinder
3155 # will be collinear to the OZ axis of the coordinate system.
3156 # @param theR Cylinder radius.
3157 # @param theH Cylinder height.
3158 # @param theName Object name; when specified, this parameter is used
3159 # for result publication in the study. Otherwise, if automatic
3160 # publication is switched on, default value is used for result name.
3162 # @return New GEOM.GEOM_Object, containing the created cylinder.
3164 # @ref tui_creation_cylinder "Example"
3165 @ManageTransactions("PrimOp")
3166 def MakeCylinderRH(self, theR, theH, theName=None):
3168 Create a cylinder with given radius and height at
3169 the origin of coordinate system. Axis of the cylinder
3170 will be collinear to the OZ axis of the coordinate system.
3173 theR Cylinder radius.
3174 theH Cylinder height.
3175 theName Object name; when specified, this parameter is used
3176 for result publication in the study. Otherwise, if automatic
3177 publication is switched on, default value is used for result name.
3180 New GEOM.GEOM_Object, containing the created cylinder.
3182 # Example: see GEOM_TestAll.py
3183 theR,theH,Parameters = ParseParameters(theR, theH)
3184 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3185 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3186 anObj.SetParameters(Parameters)
3187 self._autoPublish(anObj, theName, "cylinder")
3190 ## Create a portion of cylinder with given radius, height and angle at
3191 # the origin of coordinate system. Axis of the cylinder
3192 # will be collinear to the OZ axis of the coordinate system.
3193 # @param theR Cylinder radius.
3194 # @param theH Cylinder height.
3195 # @param theA Cylinder angle in radians.
3196 # @param theName Object name; when specified, this parameter is used
3197 # for result publication in the study. Otherwise, if automatic
3198 # publication is switched on, default value is used for result name.
3200 # @return New GEOM.GEOM_Object, containing the created cylinder.
3202 # @ref tui_creation_cylinder "Example"
3203 @ManageTransactions("PrimOp")
3204 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3206 Create a portion of cylinder with given radius, height and angle at
3207 the origin of coordinate system. Axis of the cylinder
3208 will be collinear to the OZ axis of the coordinate system.
3211 theR Cylinder radius.
3212 theH Cylinder height.
3213 theA Cylinder angle in radians.
3214 theName Object name; when specified, this parameter is used
3215 for result publication in the study. Otherwise, if automatic
3216 publication is switched on, default value is used for result name.
3219 New GEOM.GEOM_Object, containing the created cylinder.
3221 # Example: see GEOM_TestAll.py
3223 if isinstance(theA,str):
3225 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3227 theA = theA*math.pi/180.
3228 if theA<=0. or theA>=2*math.pi:
3229 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3230 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3231 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3232 anObj.SetParameters(Parameters)
3233 self._autoPublish(anObj, theName, "cylinder")
3236 ## Create a sphere with given center and radius.
3237 # @param thePnt Sphere center.
3238 # @param theR Sphere radius.
3239 # @param theName Object name; when specified, this parameter is used
3240 # for result publication in the study. Otherwise, if automatic
3241 # publication is switched on, default value is used for result name.
3243 # @return New GEOM.GEOM_Object, containing the created sphere.
3245 # @ref tui_creation_sphere "Example"
3246 @ManageTransactions("PrimOp")
3247 def MakeSpherePntR(self, thePnt, theR, theName=None):
3249 Create a sphere with given center and radius.
3252 thePnt Sphere center.
3254 theName Object name; when specified, this parameter is used
3255 for result publication in the study. Otherwise, if automatic
3256 publication is switched on, default value is used for result name.
3259 New GEOM.GEOM_Object, containing the created sphere.
3261 # Example: see GEOM_TestAll.py
3262 theR,Parameters = ParseParameters(theR)
3263 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3264 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3265 anObj.SetParameters(Parameters)
3266 self._autoPublish(anObj, theName, "sphere")
3269 ## Create a sphere with given center and radius.
3270 # @param x,y,z Coordinates of sphere center.
3271 # @param theR Sphere radius.
3272 # @param theName Object name; when specified, this parameter is used
3273 # for result publication in the study. Otherwise, if automatic
3274 # publication is switched on, default value is used for result name.
3276 # @return New GEOM.GEOM_Object, containing the created sphere.
3278 # @ref tui_creation_sphere "Example"
3279 def MakeSphere(self, x, y, z, theR, theName=None):
3281 Create a sphere with given center and radius.
3284 x,y,z Coordinates of sphere center.
3286 theName Object name; when specified, this parameter is used
3287 for result publication in the study. Otherwise, if automatic
3288 publication is switched on, default value is used for result name.
3291 New GEOM.GEOM_Object, containing the created sphere.
3293 # Example: see GEOM_TestAll.py
3294 point = self.MakeVertex(x, y, z)
3295 # note: auto-publishing is done in self.MakeSpherePntR()
3296 anObj = self.MakeSpherePntR(point, theR, theName)
3299 ## Create a sphere with given radius at the origin of coordinate system.
3300 # @param theR Sphere radius.
3301 # @param theName Object name; when specified, this parameter is used
3302 # for result publication in the study. Otherwise, if automatic
3303 # publication is switched on, default value is used for result name.
3305 # @return New GEOM.GEOM_Object, containing the created sphere.
3307 # @ref tui_creation_sphere "Example"
3308 @ManageTransactions("PrimOp")
3309 def MakeSphereR(self, theR, theName=None):
3311 Create a sphere with given radius at the origin of coordinate system.
3315 theName Object name; when specified, this parameter is used
3316 for result publication in the study. Otherwise, if automatic
3317 publication is switched on, default value is used for result name.
3320 New GEOM.GEOM_Object, containing the created sphere.
3322 # Example: see GEOM_TestAll.py
3323 theR,Parameters = ParseParameters(theR)
3324 anObj = self.PrimOp.MakeSphereR(theR)
3325 RaiseIfFailed("MakeSphereR", self.PrimOp)
3326 anObj.SetParameters(Parameters)
3327 self._autoPublish(anObj, theName, "sphere")
3330 ## Create a cone with given base point, axis, height and radiuses.
3331 # @param thePnt Central point of the first cone base.
3332 # @param theAxis Cone axis.
3333 # @param theR1 Radius of the first cone base.
3334 # @param theR2 Radius of the second cone base.
3335 # \note If both radiuses are non-zero, the cone will be truncated.
3336 # \note If the radiuses are equal, a cylinder will be created instead.
3337 # @param theH Cone height.
3338 # @param theName Object name; when specified, this parameter is used
3339 # for result publication in the study. Otherwise, if automatic
3340 # publication is switched on, default value is used for result name.
3342 # @return New GEOM.GEOM_Object, containing the created cone.
3344 # @ref tui_creation_cone "Example"
3345 @ManageTransactions("PrimOp")
3346 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3348 Create a cone with given base point, axis, height and radiuses.
3351 thePnt Central point of the first cone base.
3353 theR1 Radius of the first cone base.
3354 theR2 Radius of the second cone base.
3356 theName Object name; when specified, this parameter is used
3357 for result publication in the study. Otherwise, if automatic
3358 publication is switched on, default value is used for result name.
3361 If both radiuses are non-zero, the cone will be truncated.
3362 If the radiuses are equal, a cylinder will be created instead.
3365 New GEOM.GEOM_Object, containing the created cone.
3367 # Example: see GEOM_TestAll.py
3368 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3369 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3370 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3371 anObj.SetParameters(Parameters)
3372 self._autoPublish(anObj, theName, "cone")
3375 ## Create a cone with given height and radiuses at
3376 # the origin of coordinate system. Axis of the cone will
3377 # be collinear to the OZ axis of the coordinate system.
3378 # @param theR1 Radius of the first cone base.
3379 # @param theR2 Radius of the second cone base.
3380 # \note If both radiuses are non-zero, the cone will be truncated.
3381 # \note If the radiuses are equal, a cylinder will be created instead.
3382 # @param theH Cone height.
3383 # @param theName Object name; when specified, this parameter is used
3384 # for result publication in the study. Otherwise, if automatic
3385 # publication is switched on, default value is used for result name.
3387 # @return New GEOM.GEOM_Object, containing the created cone.
3389 # @ref tui_creation_cone "Example"
3390 @ManageTransactions("PrimOp")
3391 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3393 Create a cone with given height and radiuses at
3394 the origin of coordinate system. Axis of the cone will
3395 be collinear to the OZ axis of the coordinate system.
3398 theR1 Radius of the first cone base.
3399 theR2 Radius of the second cone base.
3401 theName Object name; when specified, this parameter is used
3402 for result publication in the study. Otherwise, if automatic
3403 publication is switched on, default value is used for result name.
3406 If both radiuses are non-zero, the cone will be truncated.
3407 If the radiuses are equal, a cylinder will be created instead.
3410 New GEOM.GEOM_Object, containing the created cone.
3412 # Example: see GEOM_TestAll.py
3413 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3414 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3415 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3416 anObj.SetParameters(Parameters)
3417 self._autoPublish(anObj, theName, "cone")
3420 ## Create a torus with given center, normal vector and radiuses.
3421 # @param thePnt Torus central point.
3422 # @param theVec Torus axis of symmetry.
3423 # @param theRMajor Torus major radius.
3424 # @param theRMinor Torus minor radius.
3425 # @param theName Object name; when specified, this parameter is used
3426 # for result publication in the study. Otherwise, if automatic
3427 # publication is switched on, default value is used for result name.
3429 # @return New GEOM.GEOM_Object, containing the created torus.
3431 # @ref tui_creation_torus "Example"
3432 @ManageTransactions("PrimOp")
3433 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3435 Create a torus with given center, normal vector and radiuses.
3438 thePnt Torus central point.
3439 theVec Torus axis of symmetry.
3440 theRMajor Torus major radius.
3441 theRMinor Torus minor radius.
3442 theName Object name; when specified, this parameter is used
3443 for result publication in the study. Otherwise, if automatic
3444 publication is switched on, default value is used for result name.
3447 New GEOM.GEOM_Object, containing the created torus.
3449 # Example: see GEOM_TestAll.py
3450 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3451 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3452 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3453 anObj.SetParameters(Parameters)
3454 self._autoPublish(anObj, theName, "torus")
3457 ## Create a torus with given radiuses at the origin of coordinate system.
3458 # @param theRMajor Torus major radius.
3459 # @param theRMinor Torus minor radius.
3460 # @param theName Object name; when specified, this parameter is used
3461 # for result publication in the study. Otherwise, if automatic
3462 # publication is switched on, default value is used for result name.
3464 # @return New GEOM.GEOM_Object, containing the created torus.
3466 # @ref tui_creation_torus "Example"
3467 @ManageTransactions("PrimOp")
3468 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3470 Create a torus with given radiuses at the origin of coordinate system.
3473 theRMajor Torus major radius.
3474 theRMinor Torus minor radius.
3475 theName Object name; when specified, this parameter is used
3476 for result publication in the study. Otherwise, if automatic
3477 publication is switched on, default value is used for result name.
3480 New GEOM.GEOM_Object, containing the created torus.
3482 # Example: see GEOM_TestAll.py
3483 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3484 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3485 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3486 anObj.SetParameters(Parameters)
3487 self._autoPublish(anObj, theName, "torus")
3490 # end of l3_3d_primitives
3493 ## @addtogroup l3_complex
3496 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3497 # @param theBase Base shape to be extruded.
3498 # @param thePoint1 First end of extrusion vector.
3499 # @param thePoint2 Second end of extrusion vector.
3500 # @param theScaleFactor Use it to make prism with scaled second base.
3501 # Nagative value means not scaled second base.
3502 # @param theName Object name; when specified, this parameter is used
3503 # for result publication in the study. Otherwise, if automatic
3504 # publication is switched on, default value is used for result name.
3506 # @return New GEOM.GEOM_Object, containing the created prism.
3508 # @ref tui_creation_prism "Example"
3509 @ManageTransactions("PrimOp")
3510 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3512 Create a shape by extrusion of the base shape along a vector, defined by two points.
3515 theBase Base shape to be extruded.
3516 thePoint1 First end of extrusion vector.
3517 thePoint2 Second end of extrusion vector.
3518 theScaleFactor Use it to make prism with scaled second base.
3519 Nagative value means not scaled second base.
3520 theName Object name; when specified, this parameter is used
3521 for result publication in the study. Otherwise, if automatic
3522 publication is switched on, default value is used for result name.
3525 New GEOM.GEOM_Object, containing the created prism.
3527 # Example: see GEOM_TestAll.py
3530 if theScaleFactor > 0:
3531 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3532 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3534 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3535 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3536 anObj.SetParameters(Parameters)
3537 self._autoPublish(anObj, theName, "prism")
3540 ## Create a shape by extrusion of the base shape along a
3541 # vector, defined by two points, in 2 Ways (forward/backward).
3542 # @param theBase Base shape to be extruded.
3543 # @param thePoint1 First end of extrusion vector.
3544 # @param thePoint2 Second end of extrusion vector.
3545 # @param theName Object name; when specified, this parameter is used
3546 # for result publication in the study. Otherwise, if automatic
3547 # publication is switched on, default value is used for result name.
3549 # @return New GEOM.GEOM_Object, containing the created prism.
3551 # @ref tui_creation_prism "Example"
3552 @ManageTransactions("PrimOp")
3553 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3555 Create a shape by extrusion of the base shape along a
3556 vector, defined by two points, in 2 Ways (forward/backward).
3559 theBase Base shape to be extruded.
3560 thePoint1 First end of extrusion vector.
3561 thePoint2 Second end of extrusion vector.
3562 theName Object name; when specified, this parameter is used
3563 for result publication in the study. Otherwise, if automatic
3564 publication is switched on, default value is used for result name.
3567 New GEOM.GEOM_Object, containing the created prism.
3569 # Example: see GEOM_TestAll.py
3570 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3571 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3572 self._autoPublish(anObj, theName, "prism")
3575 ## Create a shape by extrusion of the base shape along the vector,
3576 # i.e. all the space, transfixed by the base shape during its translation
3577 # along the vector on the given distance.
3578 # @param theBase Base shape to be extruded.
3579 # @param theVec Direction of extrusion.
3580 # @param theH Prism dimension along theVec.
3581 # @param theScaleFactor Use it to make prism with scaled second base.
3582 # Negative value means not scaled second base.
3583 # @param theName Object name; when specified, this parameter is used
3584 # for result publication in the study. Otherwise, if automatic
3585 # publication is switched on, default value is used for result name.
3587 # @return New GEOM.GEOM_Object, containing the created prism.
3589 # @ref tui_creation_prism "Example"
3590 @ManageTransactions("PrimOp")
3591 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3593 Create a shape by extrusion of the base shape along the vector,
3594 i.e. all the space, transfixed by the base shape during its translation
3595 along the vector on the given distance.
3598 theBase Base shape to be extruded.
3599 theVec Direction of extrusion.
3600 theH Prism dimension along theVec.
3601 theScaleFactor Use it to make prism with scaled second base.
3602 Negative value means not scaled second base.
3603 theName Object name; when specified, this parameter is used
3604 for result publication in the study. Otherwise, if automatic
3605 publication is switched on, default value is used for result name.
3608 New GEOM.GEOM_Object, containing the created prism.
3610 # Example: see GEOM_TestAll.py
3613 if theScaleFactor > 0:
3614 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3615 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3617 theH,Parameters = ParseParameters(theH)
3618 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3619 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3620 anObj.SetParameters(Parameters)
3621 self._autoPublish(anObj, theName, "prism")
3624 ## Create a shape by extrusion of the base shape along the vector,
3625 # i.e. all the space, transfixed by the base shape during its translation
3626 # along the vector on the given distance in 2 Ways (forward/backward).
3627 # @param theBase Base shape to be extruded.
3628 # @param theVec Direction of extrusion.
3629 # @param theH Prism dimension along theVec in forward direction.
3630 # @param theName Object name; when specified, this parameter is used
3631 # for result publication in the study. Otherwise, if automatic
3632 # publication is switched on, default value is used for result name.
3634 # @return New GEOM.GEOM_Object, containing the created prism.
3636 # @ref tui_creation_prism "Example"
3637 @ManageTransactions("PrimOp")
3638 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3640 Create a shape by extrusion of the base shape along the vector,
3641 i.e. all the space, transfixed by the base shape during its translation
3642 along the vector on the given distance in 2 Ways (forward/backward).
3645 theBase Base shape to be extruded.
3646 theVec Direction of extrusion.
3647 theH Prism dimension along theVec in forward direction.
3648 theName Object name; when specified, this parameter is used
3649 for result publication in the study. Otherwise, if automatic
3650 publication is switched on, default value is used for result name.
3653 New GEOM.GEOM_Object, containing the created prism.
3655 # Example: see GEOM_TestAll.py
3656 theH,Parameters = ParseParameters(theH)
3657 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3658 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3659 anObj.SetParameters(Parameters)
3660 self._autoPublish(anObj, theName, "prism")
3663 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3664 # @param theBase Base shape to be extruded.
3665 # @param theDX, theDY, theDZ Directions of extrusion.
3666 # @param theScaleFactor Use it to make prism with scaled second base.
3667 # Nagative value means not scaled second base.
3668 # @param theName Object name; when specified, this parameter is used
3669 # for result publication in the study. Otherwise, if automatic
3670 # publication is switched on, default value is used for result name.
3672 # @return New GEOM.GEOM_Object, containing the created prism.
3674 # @ref tui_creation_prism "Example"
3675 @ManageTransactions("PrimOp")
3676 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3678 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3681 theBase Base shape to be extruded.
3682 theDX, theDY, theDZ Directions of extrusion.
3683 theScaleFactor Use it to make prism with scaled second base.
3684 Nagative value means not scaled second base.
3685 theName Object name; when specified, this parameter is used
3686 for result publication in the study. Otherwise, if automatic
3687 publication is switched on, default value is used for result name.
3690 New GEOM.GEOM_Object, containing the created prism.
3692 # Example: see GEOM_TestAll.py
3695 if theScaleFactor > 0:
3696 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3697 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3699 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3700 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3701 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3702 anObj.SetParameters(Parameters)
3703 self._autoPublish(anObj, theName, "prism")
3706 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3707 # i.e. all the space, transfixed by the base shape during its translation
3708 # along the vector on the given distance in 2 Ways (forward/backward).
3709 # @param theBase Base shape to be extruded.
3710 # @param theDX, theDY, theDZ Directions of extrusion.
3711 # @param theName Object name; when specified, this parameter is used
3712 # for result publication in the study. Otherwise, if automatic
3713 # publication is switched on, default value is used for result name.
3715 # @return New GEOM.GEOM_Object, containing the created prism.
3717 # @ref tui_creation_prism "Example"
3718 @ManageTransactions("PrimOp")
3719 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3721 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3722 i.e. all the space, transfixed by the base shape during its translation
3723 along the vector on the given distance in 2 Ways (forward/backward).
3726 theBase Base shape to be extruded.
3727 theDX, theDY, theDZ Directions of extrusion.
3728 theName Object name; when specified, this parameter is used
3729 for result publication in the study. Otherwise, if automatic
3730 publication is switched on, default value is used for result name.
3733 New GEOM.GEOM_Object, containing the created prism.
3735 # Example: see GEOM_TestAll.py
3736 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3737 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3738 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3739 anObj.SetParameters(Parameters)
3740 self._autoPublish(anObj, theName, "prism")
3743 ## Create a shape by revolution of the base shape around the axis
3744 # on the given angle, i.e. all the space, transfixed by the base
3745 # shape during its rotation around the axis on the given angle.
3746 # @param theBase Base shape to be rotated.
3747 # @param theAxis Rotation axis.
3748 # @param theAngle Rotation angle in radians.
3749 # @param theName Object name; when specified, this parameter is used
3750 # for result publication in the study. Otherwise, if automatic
3751 # publication is switched on, default value is used for result name.
3753 # @return New GEOM.GEOM_Object, containing the created revolution.
3755 # @ref tui_creation_revolution "Example"
3756 @ManageTransactions("PrimOp")
3757 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3759 Create a shape by revolution of the base shape around the axis
3760 on the given angle, i.e. all the space, transfixed by the base
3761 shape during its rotation around the axis on the given angle.
3764 theBase Base shape to be rotated.
3765 theAxis Rotation axis.
3766 theAngle Rotation angle in radians.
3767 theName Object name; when specified, this parameter is used
3768 for result publication in the study. Otherwise, if automatic
3769 publication is switched on, default value is used for result name.
3772 New GEOM.GEOM_Object, containing the created revolution.
3774 # Example: see GEOM_TestAll.py
3775 theAngle,Parameters = ParseParameters(theAngle)
3776 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3777 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3778 anObj.SetParameters(Parameters)
3779 self._autoPublish(anObj, theName, "revolution")
3782 ## Create a shape by revolution of the base shape around the axis
3783 # on the given angle, i.e. all the space, transfixed by the base
3784 # shape during its rotation around the axis on the given angle in
3785 # both directions (forward/backward)
3786 # @param theBase Base shape to be rotated.
3787 # @param theAxis Rotation axis.
3788 # @param theAngle Rotation angle in radians.
3789 # @param theName Object name; when specified, this parameter is used
3790 # for result publication in the study. Otherwise, if automatic
3791 # publication is switched on, default value is used for result name.
3793 # @return New GEOM.GEOM_Object, containing the created revolution.
3795 # @ref tui_creation_revolution "Example"
3796 @ManageTransactions("PrimOp")
3797 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3799 Create a shape by revolution of the base shape around the axis
3800 on the given angle, i.e. all the space, transfixed by the base
3801 shape during its rotation around the axis on the given angle in
3802 both directions (forward/backward).
3805 theBase Base shape to be rotated.
3806 theAxis Rotation axis.
3807 theAngle Rotation angle in radians.
3808 theName Object name; when specified, this parameter is used
3809 for result publication in the study. Otherwise, if automatic
3810 publication is switched on, default value is used for result name.
3813 New GEOM.GEOM_Object, containing the created revolution.
3815 theAngle,Parameters = ParseParameters(theAngle)
3816 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3817 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3818 anObj.SetParameters(Parameters)
3819 self._autoPublish(anObj, theName, "revolution")
3822 ## Create a face from a given set of contours.
3823 # @param theContours either a list or a compound of edges/wires.
3824 # @param theMinDeg a minimal degree of BSpline surface to create.
3825 # @param theMaxDeg a maximal degree of BSpline surface to create.
3826 # @param theTol2D a 2d tolerance to be reached.
3827 # @param theTol3D a 3d tolerance to be reached.
3828 # @param theNbIter a number of iteration of approximation algorithm.
3829 # @param theMethod Kind of method to perform filling operation
3830 # (see GEOM.filling_oper_method enum).
3831 # @param isApprox if True, BSpline curves are generated in the process
3832 # of surface construction. By default it is False, that means
3833 # the surface is created using given curves. The usage of
3834 # Approximation makes the algorithm work slower, but allows
3835 # building the surface for rather complex cases.
3836 # @param theName Object name; when specified, this parameter is used
3837 # for result publication in the study. Otherwise, if automatic
3838 # publication is switched on, default value is used for result name.
3840 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3842 # @ref tui_creation_filling "Example"
3843 @ManageTransactions("PrimOp")
3844 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3845 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3847 Create a face from a given set of contours.
3850 theContours either a list or a compound of edges/wires.
3851 theMinDeg a minimal degree of BSpline surface to create.
3852 theMaxDeg a maximal degree of BSpline surface to create.
3853 theTol2D a 2d tolerance to be reached.
3854 theTol3D a 3d tolerance to be reached.
3855 theNbIter a number of iteration of approximation algorithm.
3856 theMethod Kind of method to perform filling operation
3857 (see GEOM.filling_oper_method enum).
3858 isApprox if True, BSpline curves are generated in the process
3859 of surface construction. By default it is False, that means
3860 the surface is created using given curves. The usage of
3861 Approximation makes the algorithm work slower, but allows
3862 building the surface for rather complex cases.
3863 theName Object name; when specified, this parameter is used
3864 for result publication in the study. Otherwise, if automatic
3865 publication is switched on, default value is used for result name.
3868 New GEOM.GEOM_Object (face), containing the created filling surface.
3871 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3873 # Example: see GEOM_TestAll.py
3874 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3875 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3876 theTol2D, theTol3D, theNbIter,
3877 theMethod, isApprox)
3878 RaiseIfFailed("MakeFilling", self.PrimOp)
3879 anObj.SetParameters(Parameters)
3880 self._autoPublish(anObj, theName, "filling")
3884 ## Create a face from a given set of contours.
3885 # This method corresponds to MakeFilling() with isApprox=True.
3886 # @param theContours either a list or a compound of edges/wires.
3887 # @param theMinDeg a minimal degree of BSpline surface to create.
3888 # @param theMaxDeg a maximal degree of BSpline surface to create.
3889 # @param theTol3D a 3d tolerance to be reached.
3890 # @param theName Object name; when specified, this parameter is used
3891 # for result publication in the study. Otherwise, if automatic
3892 # publication is switched on, default value is used for result name.
3894 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3896 # @ref tui_creation_filling "Example"
3897 @ManageTransactions("PrimOp")
3898 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3900 Create a filling from the given compound of contours.
3901 This method corresponds to MakeFilling() with isApprox=True.
3904 theContours either a list or a compound of edges/wires.
3905 theMinDeg a minimal degree of BSpline surface to create.
3906 theMaxDeg a maximal degree of BSpline surface to create.
3907 theTol3D a 3d tolerance to be reached.
3908 theName Object name; when specified, this parameter is used
3909 for result publication in the study. Otherwise, if automatic
3910 publication is switched on, default value is used for result name.
3913 New GEOM.GEOM_Object (face), containing the created filling surface.
3916 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3918 # Example: see GEOM_TestAll.py
3919 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3920 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3921 0, theTol3D, 0, GEOM.FOM_Default, True)
3922 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3923 anObj.SetParameters(Parameters)
3924 self._autoPublish(anObj, theName, "filling")
3927 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3928 # @param theSeqSections - set of specified sections.
3929 # @param theModeSolid - mode defining building solid or shell
3930 # @param thePreci - precision 3D used for smoothing
3931 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3932 # @param theName Object name; when specified, this parameter is used
3933 # for result publication in the study. Otherwise, if automatic
3934 # publication is switched on, default value is used for result name.
3936 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3938 # @ref swig_todo "Example"
3939 @ManageTransactions("PrimOp")
3940 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3942 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3945 theSeqSections - set of specified sections.
3946 theModeSolid - mode defining building solid or shell
3947 thePreci - precision 3D used for smoothing
3948 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3949 theName Object name; when specified, this parameter is used
3950 for result publication in the study. Otherwise, if automatic
3951 publication is switched on, default value is used for result name.
3954 New GEOM.GEOM_Object, containing the created shell or solid.
3956 # Example: see GEOM_TestAll.py
3957 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3958 RaiseIfFailed("MakeThruSections", self.PrimOp)
3959 self._autoPublish(anObj, theName, "filling")
3962 ## Create a shape by extrusion of the base shape along
3963 # the path shape. The path shape can be a wire or an edge. It is
3964 # possible to generate groups along with the result by means of
3965 # setting the flag \a IsGenerateGroups.<BR>
3966 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3967 # set, an error is occurred. If \a thePath is not closed edge/wire,
3968 # the following groups are returned:
3969 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3971 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3974 # "Down" and "Up" groups contain:
3975 # - Edges if \a theBase is edge or wire;
3976 # - Faces if \a theBase is face or shell.<BR>
3978 # "Side1" and "Side2" groups contain edges generated from the first
3979 # and last vertices of \a theBase. The first and last vertices are
3980 # determined taking into account edge/wire orientation.<BR>
3981 # "Other" group represents faces generated from the bounding edges of
3984 # @param theBase Base shape to be extruded.
3985 # @param thePath Path shape to extrude the base shape along it.
3986 # @param IsGenerateGroups flag that tells if it is necessary to
3987 # create groups. It is equal to False by default.
3988 # @param theName Object name; when specified, this parameter is used
3989 # for result publication in the study. Otherwise, if automatic
3990 # publication is switched on, default value is used for result name.
3992 # @return New GEOM.GEOM_Object, containing the created pipe if
3993 # \a IsGenerateGroups is not set. Otherwise it returns a
3994 # list of GEOM.GEOM_Object. Its first element is the created pipe, the
3995 # remaining ones are created groups.
3997 # @ref tui_creation_pipe "Example"
3998 @ManageTransactions("PrimOp")
3999 def MakePipe(self, theBase, thePath,
4000 IsGenerateGroups=False, theName=None):
4002 Create a shape by extrusion of the base shape along
4003 the path shape. The path shape can be a wire or an edge. It is
4004 possible to generate groups along with the result by means of
4005 setting the flag IsGenerateGroups.
4006 If thePath is a closed edge or wire and IsGenerateGroups is
4007 set, an error is occurred. If thePath is not closed edge/wire,
4008 the following groups are returned:
4009 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4011 - If theBase is closed edge or wire, face or shell: "Down", "Up",
4013 "Down" and "Up" groups contain:
4014 - Edges if theBase is edge or wire;
4015 - Faces if theBase is face or shell.
4016 "Side1" and "Side2" groups contain edges generated from the first
4017 and last vertices of theBase. The first and last vertices are
4018 determined taking into account edge/wire orientation.
4019 "Other" group represents faces generated from the bounding edges of
4023 theBase Base shape to be extruded.
4024 thePath Path shape to extrude the base shape along it.
4025 IsGenerateGroups flag that tells if it is necessary to
4026 create groups. It is equal to False by default.
4027 theName Object name; when specified, this parameter is used
4028 for result publication in the study. Otherwise, if automatic
4029 publication is switched on, default value is used for result name.
4032 New GEOM.GEOM_Object, containing the created pipe if
4033 IsGenerateGroups is not set. Otherwise it returns a
4034 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4035 remaining ones are created groups.
4037 # Example: see GEOM_TestAll.py
4038 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4039 RaiseIfFailed("MakePipe", self.PrimOp)
4041 if IsGenerateGroups:
4042 self._autoPublish(aList, theName, "pipe")
4045 self._autoPublish(aList[0], theName, "pipe")
4048 ## Create a shape by extrusion of the profile shape along
4049 # the path shape. The path shape can be a wire or an edge.
4050 # the several profiles can be specified in the several locations of path.
4051 # It is possible to generate groups along with the result by means of
4052 # setting the flag \a IsGenerateGroups. For detailed information on
4053 # groups that can be created please see the method MakePipe().
4054 # @param theSeqBases - list of Bases shape to be extruded.
4055 # @param theLocations - list of locations on the path corresponding
4056 # specified list of the Bases shapes. Number of locations
4057 # should be equal to number of bases or list of locations can be empty.
4058 # @param thePath - Path shape to extrude the base shape along it.
4059 # @param theWithContact - the mode defining that the section is translated to be in
4060 # contact with the spine.
4061 # @param theWithCorrection - defining that the section is rotated to be
4062 # orthogonal to the spine tangent in the correspondent point
4063 # @param IsGenerateGroups - flag that tells if it is necessary to
4064 # create groups. It is equal to False by default.
4065 # @param theName Object name; when specified, this parameter is used
4066 # for result publication in the study. Otherwise, if automatic
4067 # publication is switched on, default value is used for result name.
4069 # @return New GEOM.GEOM_Object, containing the created pipe if
4070 # \a IsGenerateGroups is not set. Otherwise it returns new
4071 # GEOM.ListOfGO. Its first element is the created pipe, the
4072 # remaining ones are created groups.
4074 # @ref tui_creation_pipe_with_diff_sec "Example"
4075 @ManageTransactions("PrimOp")
4076 def MakePipeWithDifferentSections(self, theSeqBases,
4077 theLocations, thePath,
4078 theWithContact, theWithCorrection,
4079 IsGenerateGroups=False, theName=None):
4081 Create a shape by extrusion of the profile shape along
4082 the path shape. The path shape can be a wire or an edge.
4083 the several profiles can be specified in the several locations of path.
4084 It is possible to generate groups along with the result by means of
4085 setting the flag IsGenerateGroups. For detailed information on
4086 groups that can be created please see the method geompy.MakePipe().
4089 theSeqBases - list of Bases shape to be extruded.
4090 theLocations - list of locations on the path corresponding
4091 specified list of the Bases shapes. Number of locations
4092 should be equal to number of bases or list of locations can be empty.
4093 thePath - Path shape to extrude the base shape along it.
4094 theWithContact - the mode defining that the section is translated to be in
4095 contact with the spine(0/1)
4096 theWithCorrection - defining that the section is rotated to be
4097 orthogonal to the spine tangent in the correspondent point (0/1)
4098 IsGenerateGroups - flag that tells if it is necessary to
4099 create groups. It is equal to False by default.
4100 theName Object name; when specified, this parameter is used
4101 for result publication in the study. Otherwise, if automatic
4102 publication is switched on, default value is used for result name.
4105 New GEOM.GEOM_Object, containing the created pipe if
4106 IsGenerateGroups is not set. Otherwise it returns new
4107 GEOM.ListOfGO. Its first element is the created pipe, the
4108 remaining ones are created groups.
4110 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4111 theLocations, thePath,
4112 theWithContact, theWithCorrection,
4113 False, IsGenerateGroups)
4114 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4116 if IsGenerateGroups:
4117 self._autoPublish(aList, theName, "pipe")
4120 self._autoPublish(aList[0], theName, "pipe")
4123 ## Create a shape by extrusion of the profile shape along
4124 # the path shape. This function is a version of
4125 # MakePipeWithDifferentSections() with the same parameters, except
4126 # eliminated theWithContact and theWithCorrection. So it is
4127 # possible to find the description of all parameters is in this
4128 # method. The difference is that this method performs the operation
4129 # step by step, i.e. it creates pipes between each pair of neighbor
4130 # sections and fuses them into a single shape.
4132 # @ref tui_creation_pipe_with_diff_sec "Example"
4133 @ManageTransactions("PrimOp")
4134 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4135 theLocations, thePath,
4136 IsGenerateGroups=False, theName=None):
4138 Create a shape by extrusion of the profile shape along
4139 the path shape. This function is a version of
4140 MakePipeWithDifferentSections() with the same parameters, except
4141 eliminated theWithContact and theWithCorrection. So it is
4142 possible to find the description of all parameters is in this
4143 method. The difference is that this method performs the operation
4144 step by step, i.e. it creates pipes between each pair of neighbor
4145 sections and fuses them into a single shape.
4147 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4148 theLocations, thePath,
4150 True, IsGenerateGroups)
4151 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4153 if IsGenerateGroups:
4154 self._autoPublish(aList, theName, "pipe")
4157 self._autoPublish(aList[0], theName, "pipe")
4160 ## Create a shape by extrusion of the profile shape along
4161 # the path shape. The path shape can be a wire or an edge.
4162 # the several profiles can be specified in the several locations of path.
4163 # It is possible to generate groups along with the result by means of
4164 # setting the flag \a IsGenerateGroups. For detailed information on
4165 # groups that can be created please see the method MakePipe().
4166 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4167 # shell or face. If number of faces in neighbour sections
4168 # aren't coincided result solid between such sections will
4169 # be created using external boundaries of this shells.
4170 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4171 # This list is used for searching correspondences between
4172 # faces in the sections. Size of this list must be equal
4173 # to size of list of base shapes.
4174 # @param theLocations - list of locations on the path corresponding
4175 # specified list of the Bases shapes. Number of locations
4176 # should be equal to number of bases. First and last
4177 # locations must be coincided with first and last vertexes
4178 # of path correspondingly.
4179 # @param thePath - Path shape to extrude the base shape along it.
4180 # @param theWithContact - the mode defining that the section is translated to be in
4181 # contact with the spine.
4182 # @param theWithCorrection - defining that the section is rotated to be
4183 # orthogonal to the spine tangent in the correspondent point
4184 # @param IsGenerateGroups - flag that tells if it is necessary to
4185 # create groups. It is equal to False by default.
4186 # @param theName Object name; when specified, this parameter is used
4187 # for result publication in the study. Otherwise, if automatic
4188 # publication is switched on, default value is used for result name.
4190 # @return New GEOM.GEOM_Object, containing the created solids if
4191 # \a IsGenerateGroups is not set. Otherwise it returns new
4192 # GEOM.ListOfGO. Its first element is the created solids, the
4193 # remaining ones are created groups.
4195 # @ref tui_creation_pipe_with_shell_sec "Example"
4196 @ManageTransactions("PrimOp")
4197 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4198 theLocations, thePath,
4199 theWithContact, theWithCorrection,
4200 IsGenerateGroups=False, theName=None):
4202 Create a shape by extrusion of the profile shape along
4203 the path shape. The path shape can be a wire or an edge.
4204 the several profiles can be specified in the several locations of path.
4205 It is possible to generate groups along with the result by means of
4206 setting the flag IsGenerateGroups. For detailed information on
4207 groups that can be created please see the method geompy.MakePipe().
4210 theSeqBases - list of Bases shape to be extruded. Base shape must be
4211 shell or face. If number of faces in neighbour sections
4212 aren't coincided result solid between such sections will
4213 be created using external boundaries of this shells.
4214 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4215 This list is used for searching correspondences between
4216 faces in the sections. Size of this list must be equal
4217 to size of list of base shapes.
4218 theLocations - list of locations on the path corresponding
4219 specified list of the Bases shapes. Number of locations
4220 should be equal to number of bases. First and last
4221 locations must be coincided with first and last vertexes
4222 of path correspondingly.
4223 thePath - Path shape to extrude the base shape along it.
4224 theWithContact - the mode defining that the section is translated to be in
4225 contact with the spine (0/1)
4226 theWithCorrection - defining that the section is rotated to be
4227 orthogonal to the spine tangent in the correspondent point (0/1)
4228 IsGenerateGroups - flag that tells if it is necessary to
4229 create groups. It is equal to False by default.
4230 theName Object name; when specified, this parameter is used
4231 for result publication in the study. Otherwise, if automatic
4232 publication is switched on, default value is used for result name.
4235 New GEOM.GEOM_Object, containing the created solids if
4236 IsGenerateGroups is not set. Otherwise it returns new
4237 GEOM.ListOfGO. Its first element is the created solids, the
4238 remaining ones are created groups.
4240 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4241 theLocations, thePath,
4242 theWithContact, theWithCorrection,
4244 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4246 if IsGenerateGroups:
4247 self._autoPublish(aList, theName, "pipe")
4250 self._autoPublish(aList[0], theName, "pipe")
4253 ## Create a shape by extrusion of the profile shape along
4254 # the path shape. This function is used only for debug pipe
4255 # functionality - it is a version of function MakePipeWithShellSections()
4256 # which give a possibility to receive information about
4257 # creating pipe between each pair of sections step by step.
4258 @ManageTransactions("PrimOp")
4259 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4260 theLocations, thePath,
4261 theWithContact, theWithCorrection,
4262 IsGenerateGroups=False, theName=None):
4264 Create a shape by extrusion of the profile shape along
4265 the path shape. This function is used only for debug pipe
4266 functionality - it is a version of previous function
4267 geompy.MakePipeWithShellSections() which give a possibility to
4268 receive information about creating pipe between each pair of
4269 sections step by step.
4272 nbsect = len(theSeqBases)
4273 nbsubsect = len(theSeqSubBases)
4274 #print "nbsect = ",nbsect
4275 for i in range(1,nbsect):
4277 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4278 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4280 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4281 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4282 tmpLocations, thePath,
4283 theWithContact, theWithCorrection,
4285 if self.PrimOp.IsDone() == 0:
4286 print("Problems with pipe creation between ",i," and ",i+1," sections")
4287 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4290 print("Pipe between ",i," and ",i+1," sections is OK")
4291 res.append(aList[0])
4295 resc = self.MakeCompound(res)
4296 #resc = self.MakeSewing(res, 0.001)
4297 #print "resc: ",resc
4298 self._autoPublish(resc, theName, "pipe")
4301 ## Create solids between given sections.
4302 # It is possible to generate groups along with the result by means of
4303 # setting the flag \a IsGenerateGroups. For detailed information on
4304 # groups that can be created please see the method MakePipe().
4305 # @param theSeqBases - list of sections (shell or face).
4306 # @param theLocations - list of corresponding vertexes
4307 # @param IsGenerateGroups - flag that tells if it is necessary to
4308 # create groups. It is equal to False by default.
4309 # @param theName Object name; when specified, this parameter is used
4310 # for result publication in the study. Otherwise, if automatic
4311 # publication is switched on, default value is used for result name.
4313 # @return New GEOM.GEOM_Object, containing the created solids if
4314 # \a IsGenerateGroups is not set. Otherwise it returns new
4315 # GEOM.ListOfGO. Its first element is the created solids, the
4316 # remaining ones are created groups.
4318 # @ref tui_creation_pipe_without_path "Example"
4319 @ManageTransactions("PrimOp")
4320 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4321 IsGenerateGroups=False, theName=None):
4323 Create solids between given sections.
4324 It is possible to generate groups along with the result by means of
4325 setting the flag IsGenerateGroups. For detailed information on
4326 groups that can be created please see the method geompy.MakePipe().
4329 theSeqBases - list of sections (shell or face).
4330 theLocations - list of corresponding vertexes
4331 IsGenerateGroups - flag that tells if it is necessary to
4332 create groups. It is equal to False by default.
4333 theName Object name; when specified, this parameter is used
4334 for result publication in the study. Otherwise, if automatic
4335 publication is switched on, default value is used for result name.
4338 New GEOM.GEOM_Object, containing the created solids if
4339 IsGenerateGroups is not set. Otherwise it returns new
4340 GEOM.ListOfGO. Its first element is the created solids, the
4341 remaining ones are created groups.
4343 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4345 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4347 if IsGenerateGroups:
4348 self._autoPublish(aList, theName, "pipe")
4351 self._autoPublish(aList[0], theName, "pipe")
4354 ## Create a shape by extrusion of the base shape along
4355 # the path shape with constant bi-normal direction along the given vector.
4356 # The path shape can be a wire or an edge.
4357 # It is possible to generate groups along with the result by means of
4358 # setting the flag \a IsGenerateGroups. For detailed information on
4359 # groups that can be created please see the method MakePipe().
4360 # @param theBase Base shape to be extruded.
4361 # @param thePath Path shape to extrude the base shape along it.
4362 # @param theVec Vector defines a constant binormal direction to keep the
4363 # same angle between the direction and the sections
4364 # along the sweep surface.
4365 # @param IsGenerateGroups flag that tells if it is necessary to
4366 # create groups. It is equal to False by default.
4367 # @param theName Object name; when specified, this parameter is used
4368 # for result publication in the study. Otherwise, if automatic
4369 # publication is switched on, default value is used for result name.
4371 # @return New GEOM.GEOM_Object, containing the created pipe if
4372 # \a IsGenerateGroups is not set. Otherwise it returns new
4373 # GEOM.ListOfGO. Its first element is the created pipe, the
4374 # remaining ones are created groups.
4376 # @ref tui_creation_pipe "Example"
4377 @ManageTransactions("PrimOp")
4378 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4379 IsGenerateGroups=False, theName=None):
4381 Create a shape by extrusion of the base shape along
4382 the path shape with constant bi-normal direction along the given vector.
4383 The path shape can be a wire or an edge.
4384 It is possible to generate groups along with the result by means of
4385 setting the flag IsGenerateGroups. For detailed information on
4386 groups that can be created please see the method geompy.MakePipe().
4389 theBase Base shape to be extruded.
4390 thePath Path shape to extrude the base shape along it.
4391 theVec Vector defines a constant binormal direction to keep the
4392 same angle between the direction and the sections
4393 along the sweep surface.
4394 IsGenerateGroups flag that tells if it is necessary to
4395 create groups. It is equal to False by default.
4396 theName Object name; when specified, this parameter is used
4397 for result publication in the study. Otherwise, if automatic
4398 publication is switched on, default value is used for result name.
4401 New GEOM.GEOM_Object, containing the created pipe if
4402 IsGenerateGroups is not set. Otherwise it returns new
4403 GEOM.ListOfGO. Its first element is the created pipe, the
4404 remaining ones are created groups.
4406 # Example: see GEOM_TestAll.py
4407 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4408 theVec, IsGenerateGroups)
4409 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4411 if IsGenerateGroups:
4412 self._autoPublish(aList, theName, "pipe")
4415 self._autoPublish(aList[0], theName, "pipe")
4418 ## Makes a thick solid from a shape. If the input is a surface shape
4419 # (face or shell) the result is a thick solid. If an input shape is
4420 # a solid the result is a hollowed solid with removed faces.
4421 # @param theShape Face or Shell to get thick solid or solid to get
4423 # @param theThickness Thickness of the resulting solid
4424 # @param theFacesIDs the list of face IDs to be removed from the
4425 # result. It is ignored if \a theShape is a face or a shell.
4426 # It is empty by default.
4427 # @param theInside If true the thickness is applied towards inside
4428 # @param theName Object name; when specified, this parameter is used
4429 # for result publication in the study. Otherwise, if automatic
4430 # publication is switched on, default value is used for result name.
4432 # @return New GEOM.GEOM_Object, containing the created solid
4434 # @ref tui_creation_thickness "Example"
4435 @ManageTransactions("PrimOp")
4436 def MakeThickSolid(self, theShape, theThickness,
4437 theFacesIDs=[], theInside=False, theName=None):
4439 Make a thick solid from a shape. If the input is a surface shape
4440 (face or shell) the result is a thick solid. If an input shape is
4441 a solid the result is a hollowed solid with removed faces.
4444 theShape Face or Shell to get thick solid or solid to get
4446 theThickness Thickness of the resulting solid
4447 theFacesIDs the list of face IDs to be removed from the
4448 result. It is ignored if theShape is a face or a
4449 shell. It is empty by default.
4450 theInside If true the thickness is applied towards inside
4451 theName Object name; when specified, this parameter is used
4452 for result publication in the study. Otherwise, if automatic
4453 publication is switched on, default value is used for result name.
4456 New GEOM.GEOM_Object, containing the created solid
4458 # Example: see GEOM_TestAll.py
4459 theThickness,Parameters = ParseParameters(theThickness)
4460 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4461 theThickness, True, theInside)
4462 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4463 anObj.SetParameters(Parameters)
4464 self._autoPublish(anObj, theName, "thickSolid")
4468 ## Modifies a shape to make it a thick solid. If the input is a surface
4469 # shape (face or shell) the result is a thick solid. If an input shape
4470 # is a solid the result is a hollowed solid with removed faces.
4471 # @param theShape Face or Shell to get thick solid or solid to get
4473 # @param theThickness Thickness of the resulting solid
4474 # @param theFacesIDs the list of face IDs to be removed from the
4475 # result. It is ignored if \a theShape is a face or a shell.
4476 # It is empty by default.
4477 # @param theInside If true the thickness is applied towards inside
4479 # @return The modified shape
4481 # @ref tui_creation_thickness "Example"
4482 @ManageTransactions("PrimOp")
4483 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4485 Modifies a shape to make it a thick solid. If the input is a
4486 surface shape (face or shell) the result is a thick solid. If
4487 an input shape is a solid the result is a hollowed solid with
4491 theShape Face or Shell to get thick solid or solid to get
4493 theThickness Thickness of the resulting solid
4494 theFacesIDs the list of face IDs to be removed from the
4495 result. It is ignored if \a theShape is a face or
4496 a shell. It is empty by default.
4497 theInside If true the thickness is applied towards inside
4502 # Example: see GEOM_TestAll.py
4503 theThickness,Parameters = ParseParameters(theThickness)
4504 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4505 theThickness, False, theInside)
4506 RaiseIfFailed("Thicken", self.PrimOp)
4507 anObj.SetParameters(Parameters)
4510 ## Build a middle path of a pipe-like shape.
4511 # The path shape can be a wire or an edge.
4512 # @param theShape It can be closed or unclosed pipe-like shell
4513 # or a pipe-like solid.
4514 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4515 # should be wires or faces of theShape.
4516 # @param theName Object name; when specified, this parameter is used
4517 # for result publication in the study. Otherwise, if automatic
4518 # publication is switched on, default value is used for result name.
4520 # @note It is not assumed that exact or approximate copy of theShape
4521 # can be obtained by applying existing Pipe operation on the
4522 # resulting "Path" wire taking theBase1 as the base - it is not
4523 # always possible; though in some particular cases it might work
4524 # it is not guaranteed. Thus, RestorePath function should not be
4525 # considered as an exact reverse operation of the Pipe.
4527 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4528 # source pipe's "path".
4530 # @ref tui_creation_pipe_path "Example"
4531 @ManageTransactions("PrimOp")
4532 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4534 Build a middle path of a pipe-like shape.
4535 The path shape can be a wire or an edge.
4538 theShape It can be closed or unclosed pipe-like shell
4539 or a pipe-like solid.
4540 theBase1, theBase2 Two bases of the supposed pipe. This
4541 should be wires or faces of theShape.
4542 theName Object name; when specified, this parameter is used
4543 for result publication in the study. Otherwise, if automatic
4544 publication is switched on, default value is used for result name.
4547 New GEOM_Object, containing an edge or wire that represent
4550 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4551 RaiseIfFailed("RestorePath", self.PrimOp)
4552 self._autoPublish(anObj, theName, "path")
4555 ## Build a middle path of a pipe-like shape.
4556 # The path shape can be a wire or an edge.
4557 # @param theShape It can be closed or unclosed pipe-like shell
4558 # or a pipe-like solid.
4559 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4560 # should be lists of edges of theShape.
4561 # @param theName Object name; when specified, this parameter is used
4562 # for result publication in the study. Otherwise, if automatic
4563 # publication is switched on, default value is used for result name.
4565 # @note It is not assumed that exact or approximate copy of theShape
4566 # can be obtained by applying existing Pipe operation on the
4567 # resulting "Path" wire taking theBase1 as the base - it is not
4568 # always possible; though in some particular cases it might work
4569 # it is not guaranteed. Thus, RestorePath function should not be
4570 # considered as an exact reverse operation of the Pipe.
4572 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4573 # source pipe's "path".
4575 # @ref tui_creation_pipe_path "Example"
4576 @ManageTransactions("PrimOp")
4577 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4579 Build a middle path of a pipe-like shape.
4580 The path shape can be a wire or an edge.
4583 theShape It can be closed or unclosed pipe-like shell
4584 or a pipe-like solid.
4585 listEdges1, listEdges2 Two bases of the supposed pipe. This
4586 should be lists of edges of theShape.
4587 theName Object name; when specified, this parameter is used
4588 for result publication in the study. Otherwise, if automatic
4589 publication is switched on, default value is used for result name.
4592 New GEOM_Object, containing an edge or wire that represent
4595 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4596 RaiseIfFailed("RestorePath", self.PrimOp)
4597 self._autoPublish(anObj, theName, "path")
4603 ## @addtogroup l3_basic_go
4606 ## Create a linear edge with specified ends.
4607 # @param thePnt1 Point for the first end of edge.
4608 # @param thePnt2 Point for the second end of edge.
4609 # @param theName Object name; when specified, this parameter is used
4610 # for result publication in the study. Otherwise, if automatic
4611 # publication is switched on, default value is used for result name.
4613 # @return New GEOM.GEOM_Object, containing the created edge.
4615 # @ref tui_creation_edge "Example"
4616 @ManageTransactions("ShapesOp")
4617 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4619 Create a linear edge with specified ends.
4622 thePnt1 Point for the first end of edge.
4623 thePnt2 Point for the second end of edge.
4624 theName Object name; when specified, this parameter is used
4625 for result publication in the study. Otherwise, if automatic
4626 publication is switched on, default value is used for result name.
4629 New GEOM.GEOM_Object, containing the created edge.
4631 # Example: see GEOM_TestAll.py
4632 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4633 RaiseIfFailed("MakeEdge", self.ShapesOp)
4634 self._autoPublish(anObj, theName, "edge")
4637 ## Create a new edge, corresponding to the given length on the given curve.
4638 # @param theRefCurve The referenced curve (edge).
4639 # @param theLength Length on the referenced curve. It can be negative.
4640 # @param theStartPoint Any point can be selected for it, the new edge will begin
4641 # at the end of \a theRefCurve, close to the selected point.
4642 # If None, start from the first point of \a theRefCurve.
4643 # @param theName Object name; when specified, this parameter is used
4644 # for result publication in the study. Otherwise, if automatic
4645 # publication is switched on, default value is used for result name.
4647 # @return New GEOM.GEOM_Object, containing the created edge.
4649 # @ref tui_creation_edge "Example"
4650 @ManageTransactions("ShapesOp")
4651 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4653 Create a new edge, corresponding to the given length on the given curve.
4656 theRefCurve The referenced curve (edge).
4657 theLength Length on the referenced curve. It can be negative.
4658 theStartPoint Any point can be selected for it, the new edge will begin
4659 at the end of theRefCurve, close to the selected point.
4660 If None, start from the first point of theRefCurve.
4661 theName Object name; when specified, this parameter is used
4662 for result publication in the study. Otherwise, if automatic
4663 publication is switched on, default value is used for result name.
4666 New GEOM.GEOM_Object, containing the created edge.
4668 # Example: see GEOM_TestAll.py
4669 theLength, Parameters = ParseParameters(theLength)
4670 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4671 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4672 anObj.SetParameters(Parameters)
4673 self._autoPublish(anObj, theName, "edge")
4676 ## Create an edge from specified wire.
4677 # @param theWire source Wire
4678 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4679 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4680 # @param theName Object name; when specified, this parameter is used
4681 # for result publication in the study. Otherwise, if automatic
4682 # publication is switched on, default value is used for result name.
4684 # @return New GEOM.GEOM_Object, containing the created edge.
4686 # @ref tui_creation_edge "Example"
4687 @ManageTransactions("ShapesOp")
4688 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4690 Create an edge from specified wire.
4694 theLinearTolerance linear tolerance value (default = 1e-07)
4695 theAngularTolerance angular tolerance value (default = 1e-12)
4696 theName Object name; when specified, this parameter is used
4697 for result publication in the study. Otherwise, if automatic
4698 publication is switched on, default value is used for result name.
4701 New GEOM.GEOM_Object, containing the created edge.
4703 # Example: see GEOM_TestAll.py
4704 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4705 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4706 self._autoPublish(anObj, theName, "edge")
4709 ## Create a wire from the set of edges and wires.
4710 # @param theEdgesAndWires List of edges and/or wires.
4711 # @param theTolerance Maximum distance between vertices, that will be merged.
4712 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4713 # @param theName Object name; when specified, this parameter is used
4714 # for result publication in the study. Otherwise, if automatic
4715 # publication is switched on, default value is used for result name.
4717 # @return New GEOM.GEOM_Object, containing the created wire.
4719 # @ref tui_creation_wire "Example"
4720 @ManageTransactions("ShapesOp")
4721 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4723 Create a wire from the set of edges and wires.
4726 theEdgesAndWires List of edges and/or wires.
4727 theTolerance Maximum distance between vertices, that will be merged.
4728 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4729 theName Object name; when specified, this parameter is used
4730 for result publication in the study. Otherwise, if automatic
4731 publication is switched on, default value is used for result name.
4734 New GEOM.GEOM_Object, containing the created wire.
4736 # Example: see GEOM_TestAll.py
4737 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4738 RaiseIfFailed("MakeWire", self.ShapesOp)
4739 self._autoPublish(anObj, theName, "wire")
4742 ## Create a face on the given wire.
4743 # @param theWire closed Wire or Edge to build the face on.
4744 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4745 # If the tolerance of the obtained planar face is less
4746 # than 1e-06, this face will be returned, otherwise the
4747 # algorithm tries to build any suitable face on the given
4748 # wire and prints a warning message.
4749 # @param theName Object name; when specified, this parameter is used
4750 # for result publication in the study. Otherwise, if automatic
4751 # publication is switched on, default value is used for result name.
4753 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4755 # @ref tui_creation_face "Example"
4756 @ManageTransactions("ShapesOp")
4757 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4759 Create a face on the given wire.
4762 theWire closed Wire or Edge to build the face on.
4763 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4764 If the tolerance of the obtained planar face is less
4765 than 1e-06, this face will be returned, otherwise the
4766 algorithm tries to build any suitable face on the given
4767 wire and prints a warning message.
4768 theName Object name; when specified, this parameter is used
4769 for result publication in the study. Otherwise, if automatic
4770 publication is switched on, default value is used for result name.
4773 New GEOM.GEOM_Object, containing the created face (compound of faces).
4775 # Example: see GEOM_TestAll.py
4776 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4777 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4778 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4780 RaiseIfFailed("MakeFace", self.ShapesOp)
4781 self._autoPublish(anObj, theName, "face")
4784 ## Create a face on the given wires set.
4785 # @param theWires List of closed wires or edges to build the face on.
4786 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4787 # If the tolerance of the obtained planar face is less
4788 # than 1e-06, this face will be returned, otherwise the
4789 # algorithm tries to build any suitable face on the given
4790 # wire and prints a warning message.
4791 # @param theName Object name; when specified, this parameter is used
4792 # for result publication in the study. Otherwise, if automatic
4793 # publication is switched on, default value is used for result name.
4795 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4797 # @ref tui_creation_face "Example"
4798 @ManageTransactions("ShapesOp")
4799 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4801 Create a face on the given wires set.
4804 theWires List of closed wires or edges to build the face on.
4805 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4806 If the tolerance of the obtained planar face is less
4807 than 1e-06, this face will be returned, otherwise the
4808 algorithm tries to build any suitable face on the given
4809 wire and prints a warning message.
4810 theName Object name; when specified, this parameter is used
4811 for result publication in the study. Otherwise, if automatic
4812 publication is switched on, default value is used for result name.
4815 New GEOM.GEOM_Object, containing the created face (compound of faces).
4817 # Example: see GEOM_TestAll.py
4818 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4819 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4820 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4822 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4823 self._autoPublish(anObj, theName, "face")
4826 ## See MakeFaceWires() method for details.
4828 # @ref tui_creation_face "Example 1"
4829 # \n @ref swig_MakeFaces "Example 2"
4830 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4832 See geompy.MakeFaceWires() method for details.
4834 # Example: see GEOM_TestOthers.py
4835 # note: auto-publishing is done in self.MakeFaceWires()
4836 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4839 ## Create a face based on a surface from given face bounded
4841 # @param theFace the face whose surface is used to create a new face.
4842 # @param theWire the wire that will bound a new face.
4843 # @param theName Object name; when specified, this parameter is used
4844 # for result publication in the study. Otherwise, if automatic
4845 # publication is switched on, default value is used for result name.
4847 # @return New GEOM.GEOM_Object, containing the created face.
4849 # @ref tui_creation_face "Example"
4850 @ManageTransactions("ShapesOp")
4851 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4853 Create a face based on a surface from given face bounded
4857 theFace the face whose surface is used to create a new face.
4858 theWire the wire that will bound a new face.
4859 theName Object name; when specified, this parameter is used
4860 for result publication in the study. Otherwise, if automatic
4861 publication is switched on, default value is used for result name.
4864 New GEOM.GEOM_Object, containing the created face.
4866 # Example: see GEOM_TestAll.py
4867 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4868 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4869 self._autoPublish(anObj, theName, "face")
4872 ## Create a face from a set of edges with the given constraints.
4873 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4874 # - edges should form a closed wire;
4875 # - for each edge, constraint face is optional: if a constraint face is missing
4876 # for some edge, this means that there no constraint associated with this edge.
4877 # @param theName Object name; when specified, this parameter is used
4878 # for result publication in the study. Otherwise, if automatic
4879 # publication is switched on, default value is used for result name.
4881 # @return New GEOM.GEOM_Object, containing the created face.
4883 # @ref tui_creation_face "Example"
4884 @ManageTransactions("ShapesOp")
4885 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4887 Create a face from a set of edges with the given constraints.
4890 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4891 - edges should form a closed wire;
4892 - for each edge, constraint face is optional: if a constraint face is missing
4893 for some edge, this means that there no constraint associated with this edge.
4894 theName Object name; when specified, this parameter is used
4895 for result publication in the study. Otherwise, if automatic
4896 publication is switched on, default value is used for result name.
4899 New GEOM.GEOM_Object, containing the created face.
4901 # Example: see GEOM_TestAll.py
4902 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4904 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4905 self._autoPublish(anObj, theName, "face")
4908 ## Create a shell from the set of faces, shells and/or compounds of faces.
4909 # @param theFacesAndShells List of faces, shells and/or compounds of faces.
4910 # @param theName Object name; when specified, this parameter is used
4911 # for result publication in the study. Otherwise, if automatic
4912 # publication is switched on, default value is used for result name.
4914 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4916 # @ref tui_creation_shell "Example"
4917 @ManageTransactions("ShapesOp")
4918 def MakeShell(self, theFacesAndShells, theName=None):
4920 Create a shell from the set of faces and shells.
4923 theFacesAndShells List of faces and/or shells.
4924 theName Object name; when specified, this parameter is used
4925 for result publication in the study. Otherwise, if automatic
4926 publication is switched on, default value is used for result name.
4929 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4931 # Example: see GEOM_TestAll.py
4932 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4933 RaiseIfFailed("MakeShell", self.ShapesOp)
4934 self._autoPublish(anObj, theName, "shell")
4937 ## Create a solid, bounded by the given shells.
4938 # @param theShells Sequence of bounding shells.
4939 # @param theName Object name; when specified, this parameter is used
4940 # for result publication in the study. Otherwise, if automatic
4941 # publication is switched on, default value is used for result name.
4943 # @return New GEOM.GEOM_Object, containing the created solid.
4945 # @ref tui_creation_solid "Example"
4946 @ManageTransactions("ShapesOp")
4947 def MakeSolid(self, theShells, theName=None):
4949 Create a solid, bounded by the given shells.
4952 theShells Sequence of bounding shells.
4953 theName Object name; when specified, this parameter is used
4954 for result publication in the study. Otherwise, if automatic
4955 publication is switched on, default value is used for result name.
4958 New GEOM.GEOM_Object, containing the created solid.
4960 # Example: see GEOM_TestAll.py
4961 theShells = ToList(theShells)
4962 if len(theShells) == 1:
4963 descr = self._IsGoodForSolid(theShells[0])
4965 # raise RuntimeError, "MakeSolidShells : " + descr
4966 if descr == "WRN_SHAPE_UNCLOSED":
4967 raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4968 anObj = self.ShapesOp.MakeSolidShells(theShells)
4969 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4970 self._autoPublish(anObj, theName, "solid")
4973 ## Create a compound of the given shapes.
4974 # @param theShapes List of shapes to put in compound.
4975 # @param theName Object name; when specified, this parameter is used
4976 # for result publication in the study. Otherwise, if automatic
4977 # publication is switched on, default value is used for result name.
4979 # @return New GEOM.GEOM_Object, containing the created compound.
4981 # @ref tui_creation_compound "Example"
4982 @ManageTransactions("ShapesOp")
4983 def MakeCompound(self, theShapes, theName=None):
4985 Create a compound of the given shapes.
4988 theShapes List of shapes to put in compound.
4989 theName Object name; when specified, this parameter is used
4990 for result publication in the study. Otherwise, if automatic
4991 publication is switched on, default value is used for result name.
4994 New GEOM.GEOM_Object, containing the created compound.
4996 # Example: see GEOM_TestAll.py
4997 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
4998 RaiseIfFailed("MakeCompound", self.ShapesOp)
4999 self._autoPublish(anObj, theName, "compound")
5002 ## Create a solid (or solids) from the set of faces and/or shells.
5003 # @param theFacesOrShells List of faces and/or shells.
5004 # @param isIntersect If TRUE, forces performing intersections
5005 # between arguments; otherwise (default) intersection is not performed.
5006 # @param theName Object name; when specified, this parameter is used
5007 # for result publication in the study. Otherwise, if automatic
5008 # publication is switched on, default value is used for result name.
5010 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5012 # @ref tui_creation_solid_from_faces "Example"
5013 @ManageTransactions("ShapesOp")
5014 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5016 Create a solid (or solids) from the set of connected faces and/or shells.
5019 theFacesOrShells List of faces and/or shells.
5020 isIntersect If TRUE, forces performing intersections
5021 between arguments; otherwise (default) intersection is not performed
5022 theName Object name; when specified, this parameter is used.
5023 for result publication in the study. Otherwise, if automatic
5024 publication is switched on, default value is used for result name.
5027 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5029 # Example: see GEOM_TestAll.py
5030 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5031 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5032 self._autoPublish(anObj, theName, "solid")
5035 # end of l3_basic_go
5038 ## @addtogroup l2_measure
5041 ## Gives quantity of faces in the given shape.
5042 # @param theShape Shape to count faces of.
5043 # @return Quantity of faces.
5045 # @ref swig_NumberOf "Example"
5046 @ManageTransactions("ShapesOp")
5047 def NumberOfFaces(self, theShape):
5049 Gives quantity of faces in the given shape.
5052 theShape Shape to count faces of.
5057 # Example: see GEOM_TestOthers.py
5058 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5059 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5062 ## Gives quantity of edges in the given shape.
5063 # @param theShape Shape to count edges of.
5064 # @return Quantity of edges.
5066 # @ref swig_NumberOf "Example"
5067 @ManageTransactions("ShapesOp")
5068 def NumberOfEdges(self, theShape):
5070 Gives quantity of edges in the given shape.
5073 theShape Shape to count edges of.
5078 # Example: see GEOM_TestOthers.py
5079 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5080 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5083 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5084 # @param theShape Shape to count sub-shapes of.
5085 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5086 # @return Quantity of sub-shapes of given type.
5088 # @ref swig_NumberOf "Example"
5089 @ManageTransactions("ShapesOp")
5090 def NumberOfSubShapes(self, theShape, theShapeType):
5092 Gives quantity of sub-shapes of type theShapeType in the given shape.
5095 theShape Shape to count sub-shapes of.
5096 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5099 Quantity of sub-shapes of given type.
5101 # Example: see GEOM_TestOthers.py
5102 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5103 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5106 ## Gives quantity of solids in the given shape.
5107 # @param theShape Shape to count solids in.
5108 # @return Quantity of solids.
5110 # @ref swig_NumberOf "Example"
5111 @ManageTransactions("ShapesOp")
5112 def NumberOfSolids(self, theShape):
5114 Gives quantity of solids in the given shape.
5117 theShape Shape to count solids in.
5122 # Example: see GEOM_TestOthers.py
5123 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5124 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5130 ## @addtogroup l3_healing
5133 ## Reverses an orientation the given shape.
5134 # @param theShape Shape to be reversed.
5135 # @param theName Object name; when specified, this parameter is used
5136 # for result publication in the study. Otherwise, if automatic
5137 # publication is switched on, default value is used for result name.
5139 # @return The reversed copy of theShape.
5141 # @ref swig_ChangeOrientation "Example"
5142 @ManageTransactions("ShapesOp")
5143 def ChangeOrientation(self, theShape, theName=None):
5145 Reverses an orientation the given shape.
5148 theShape Shape to be reversed.
5149 theName Object name; when specified, this parameter is used
5150 for result publication in the study. Otherwise, if automatic
5151 publication is switched on, default value is used for result name.
5154 The reversed copy of theShape.
5156 # Example: see GEOM_TestAll.py
5157 anObj = self.ShapesOp.ChangeOrientation(theShape)
5158 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5159 self._autoPublish(anObj, theName, "reversed")
5162 ## See ChangeOrientation() method for details.
5164 # @ref swig_OrientationChange "Example"
5165 def OrientationChange(self, theShape, theName=None):
5167 See geompy.ChangeOrientation method for details.
5169 # Example: see GEOM_TestOthers.py
5170 # note: auto-publishing is done in self.ChangeOrientation()
5171 anObj = self.ChangeOrientation(theShape, theName)
5177 ## @addtogroup l4_obtain
5180 ## Retrieve all free faces from the given shape.
5181 # Free face is a face, which is not shared between two shells of the shape.
5182 # @param theShape Shape to find free faces in.
5183 # @return List of IDs of all free faces, contained in theShape.
5185 # @ref tui_free_faces_page "Example"
5186 @ManageTransactions("ShapesOp")
5187 def GetFreeFacesIDs(self,theShape):
5189 Retrieve all free faces from the given shape.
5190 Free face is a face, which is not shared between two shells of the shape.
5193 theShape Shape to find free faces in.
5196 List of IDs of all free faces, contained in theShape.
5198 # Example: see GEOM_TestOthers.py
5199 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5200 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5203 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5204 # @param theShape1 Shape to find sub-shapes in.
5205 # @param theShape2 Shape to find shared sub-shapes with.
5206 # @param theShapeType Type of sub-shapes to be retrieved.
5207 # @param theName Object name; when specified, this parameter is used
5208 # for result publication in the study. Otherwise, if automatic
5209 # publication is switched on, default value is used for result name.
5211 # @return List of sub-shapes of theShape1, shared with theShape2.
5213 # @ref swig_GetSharedShapes "Example"
5214 @ManageTransactions("ShapesOp")
5215 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5217 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5220 theShape1 Shape to find sub-shapes in.
5221 theShape2 Shape to find shared sub-shapes with.
5222 theShapeType Type of sub-shapes to be retrieved.
5223 theName Object name; when specified, this parameter is used
5224 for result publication in the study. Otherwise, if automatic
5225 publication is switched on, default value is used for result name.
5228 List of sub-shapes of theShape1, shared with theShape2.
5230 # Example: see GEOM_TestOthers.py
5231 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5232 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5233 self._autoPublish(aList, theName, "shared")
5236 ## Get sub-shapes, shared by input shapes.
5237 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5238 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5239 # @param theMultiShare Specifies what type of shares should be checked:
5240 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5241 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5242 # @param theName Object name; when specified, this parameter is used
5243 # for result publication in the study. Otherwise, if automatic
5244 # publication is switched on, default value is used for result name.
5246 # @note If @a theShapes contains single compound, the shares between all possible couples of
5247 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5248 # and all rest input shapes are returned.
5250 # @return List of all found sub-shapes.
5253 # - @ref tui_shared_shapes "Example 1"
5254 # - @ref swig_GetSharedShapes "Example 2"
5255 @ManageTransactions("ShapesOp")
5256 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5258 Get sub-shapes, shared by input shapes.
5261 theShapes Either a list or compound of shapes to find common sub-shapes of.
5262 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5263 theMultiShare Specifies what type of shares should be checked:
5264 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5265 - False: causes to search sub-shapes shared between couples of input shapes.
5266 theName Object name; when specified, this parameter is used
5267 for result publication in the study. Otherwise, if automatic
5268 publication is switched on, default value is used for result name.
5270 Note: if theShapes contains single compound, the shares between all possible couples of
5271 its top-level shapes are returned; otherwise, only shares between 1st input shape
5272 and all rest input shapes are returned.
5275 List of all found sub-shapes.
5277 # Example: see GEOM_TestOthers.py
5278 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5279 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5280 self._autoPublish(aList, theName, "shared")
5283 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5284 # situated relatively the specified plane by the certain way,
5285 # defined through <VAR>theState</VAR> parameter.
5286 # @param theShape Shape to find sub-shapes of.
5287 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5288 # @param theAx1 Vector (or line, or linear edge), specifying normal
5289 # direction and location of the plane to find shapes on.
5290 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5291 # @param theName Object name; when specified, this parameter is used
5292 # for result publication in the study. Otherwise, if automatic
5293 # publication is switched on, default value is used for result name.
5295 # @return List of all found sub-shapes.
5297 # @ref swig_GetShapesOnPlane "Example"
5298 @ManageTransactions("ShapesOp")
5299 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5301 Find in theShape all sub-shapes of type theShapeType,
5302 situated relatively the specified plane by the certain way,
5303 defined through theState parameter.
5306 theShape Shape to find sub-shapes of.
5307 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5308 theAx1 Vector (or line, or linear edge), specifying normal
5309 direction and location of the plane to find shapes on.
5310 theState The state of the sub-shapes to find (see GEOM::shape_state)
5311 theName Object name; when specified, this parameter is used
5312 for result publication in the study. Otherwise, if automatic
5313 publication is switched on, default value is used for result name.
5316 List of all found sub-shapes.
5318 # Example: see GEOM_TestOthers.py
5319 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5320 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5321 self._autoPublish(aList, theName, "shapeOnPlane")
5324 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5325 # situated relatively the specified plane by the certain way,
5326 # defined through <VAR>theState</VAR> parameter.
5327 # @param theShape Shape to find sub-shapes of.
5328 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5329 # @param theAx1 Vector (or line, or linear edge), specifying normal
5330 # direction and location of the plane to find shapes on.
5331 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5333 # @return List of all found sub-shapes indices.
5335 # @ref swig_GetShapesOnPlaneIDs "Example"
5336 @ManageTransactions("ShapesOp")
5337 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5339 Find in theShape all sub-shapes of type theShapeType,
5340 situated relatively the specified plane by the certain way,
5341 defined through theState parameter.
5344 theShape Shape to find sub-shapes of.
5345 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5346 theAx1 Vector (or line, or linear edge), specifying normal
5347 direction and location of the plane to find shapes on.
5348 theState The state of the sub-shapes to find (see GEOM::shape_state)
5351 List of all found sub-shapes indices.
5353 # Example: see GEOM_TestOthers.py
5354 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5355 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5358 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5359 # situated relatively the specified plane by the certain way,
5360 # defined through <VAR>theState</VAR> parameter.
5361 # @param theShape Shape to find sub-shapes of.
5362 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5363 # @param theAx1 Vector (or line, or linear edge), specifying normal
5364 # direction of the plane to find shapes on.
5365 # @param thePnt Point specifying location of the plane to find shapes on.
5366 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5367 # @param theName Object name; when specified, this parameter is used
5368 # for result publication in the study. Otherwise, if automatic
5369 # publication is switched on, default value is used for result name.
5371 # @return List of all found sub-shapes.
5373 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5374 @ManageTransactions("ShapesOp")
5375 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5377 Find in theShape all sub-shapes of type theShapeType,
5378 situated relatively the specified plane by the certain way,
5379 defined through theState parameter.
5382 theShape Shape to find sub-shapes of.
5383 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5384 theAx1 Vector (or line, or linear edge), specifying normal
5385 direction and location of the plane to find shapes on.
5386 thePnt Point specifying location of the plane to find shapes on.
5387 theState The state of the sub-shapes to find (see GEOM::shape_state)
5388 theName Object name; when specified, this parameter is used
5389 for result publication in the study. Otherwise, if automatic
5390 publication is switched on, default value is used for result name.
5393 List of all found sub-shapes.
5395 # Example: see GEOM_TestOthers.py
5396 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5397 theAx1, thePnt, theState)
5398 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5399 self._autoPublish(aList, theName, "shapeOnPlane")
5402 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5403 # situated relatively the specified plane by the certain way,
5404 # defined through <VAR>theState</VAR> parameter.
5405 # @param theShape Shape to find sub-shapes of.
5406 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5407 # @param theAx1 Vector (or line, or linear edge), specifying normal
5408 # direction of the plane to find shapes on.
5409 # @param thePnt Point specifying location of the plane to find shapes on.
5410 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5412 # @return List of all found sub-shapes indices.
5414 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5415 @ManageTransactions("ShapesOp")
5416 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5418 Find in theShape all sub-shapes of type theShapeType,
5419 situated relatively the specified plane by the certain way,
5420 defined through theState parameter.
5423 theShape Shape to find sub-shapes of.
5424 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5425 theAx1 Vector (or line, or linear edge), specifying normal
5426 direction and location of the plane to find shapes on.
5427 thePnt Point specifying location of the plane to find shapes on.
5428 theState The state of the sub-shapes to find (see GEOM::shape_state)
5431 List of all found sub-shapes indices.
5433 # Example: see GEOM_TestOthers.py
5434 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5435 theAx1, thePnt, theState)
5436 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5439 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5440 # the specified cylinder by the certain way, defined through \a theState parameter.
5441 # @param theShape Shape to find sub-shapes of.
5442 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5443 # @param theAxis Vector (or line, or linear edge), specifying
5444 # axis of the cylinder to find shapes on.
5445 # @param theRadius Radius of the cylinder to find shapes on.
5446 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5447 # @param theName Object name; when specified, this parameter is used
5448 # for result publication in the study. Otherwise, if automatic
5449 # publication is switched on, default value is used for result name.
5451 # @return List of all found sub-shapes.
5453 # @ref swig_GetShapesOnCylinder "Example"
5454 @ManageTransactions("ShapesOp")
5455 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5457 Find in theShape all sub-shapes of type theShapeType, situated relatively
5458 the specified cylinder by the certain way, defined through theState parameter.
5461 theShape Shape to find sub-shapes of.
5462 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5463 theAxis Vector (or line, or linear edge), specifying
5464 axis of the cylinder to find shapes on.
5465 theRadius Radius of the cylinder to find shapes on.
5466 theState The state of the sub-shapes to find (see GEOM::shape_state)
5467 theName Object name; when specified, this parameter is used
5468 for result publication in the study. Otherwise, if automatic
5469 publication is switched on, default value is used for result name.
5472 List of all found sub-shapes.
5474 # Example: see GEOM_TestOthers.py
5475 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5476 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5477 self._autoPublish(aList, theName, "shapeOnCylinder")
5480 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5481 # the specified cylinder by the certain way, defined through \a theState parameter.
5482 # @param theShape Shape to find sub-shapes of.
5483 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5484 # @param theAxis Vector (or line, or linear edge), specifying
5485 # axis of the cylinder to find shapes on.
5486 # @param theRadius Radius of the cylinder to find shapes on.
5487 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5489 # @return List of all found sub-shapes indices.
5491 # @ref swig_GetShapesOnCylinderIDs "Example"
5492 @ManageTransactions("ShapesOp")
5493 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5495 Find in theShape all sub-shapes of type theShapeType, situated relatively
5496 the specified cylinder by the certain way, defined through theState parameter.
5499 theShape Shape to find sub-shapes of.
5500 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5501 theAxis Vector (or line, or linear edge), specifying
5502 axis of the cylinder to find shapes on.
5503 theRadius Radius of the cylinder to find shapes on.
5504 theState The state of the sub-shapes to find (see GEOM::shape_state)
5507 List of all found sub-shapes indices.
5509 # Example: see GEOM_TestOthers.py
5510 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5511 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5514 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5515 # the specified cylinder by the certain way, defined through \a theState parameter.
5516 # @param theShape Shape to find sub-shapes of.
5517 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5518 # @param theAxis Vector (or line, or linear edge), specifying
5519 # axis of the cylinder to find shapes on.
5520 # @param thePnt Point specifying location of the bottom of the cylinder.
5521 # @param theRadius Radius of the cylinder to find shapes on.
5522 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5523 # @param theName Object name; when specified, this parameter is used
5524 # for result publication in the study. Otherwise, if automatic
5525 # publication is switched on, default value is used for result name.
5527 # @return List of all found sub-shapes.
5529 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5530 @ManageTransactions("ShapesOp")
5531 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5533 Find in theShape all sub-shapes of type theShapeType, situated relatively
5534 the specified cylinder by the certain way, defined through theState parameter.
5537 theShape Shape to find sub-shapes of.
5538 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5539 theAxis Vector (or line, or linear edge), specifying
5540 axis of the cylinder to find shapes on.
5541 theRadius Radius of the cylinder to find shapes on.
5542 theState The state of the sub-shapes to find (see GEOM::shape_state)
5543 theName Object name; when specified, this parameter is used
5544 for result publication in the study. Otherwise, if automatic
5545 publication is switched on, default value is used for result name.
5548 List of all found sub-shapes.
5550 # Example: see GEOM_TestOthers.py
5551 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5552 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5553 self._autoPublish(aList, theName, "shapeOnCylinder")
5556 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5557 # the specified cylinder by the certain way, defined through \a theState parameter.
5558 # @param theShape Shape to find sub-shapes of.
5559 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5560 # @param theAxis Vector (or line, or linear edge), specifying
5561 # axis of the cylinder to find shapes on.
5562 # @param thePnt Point specifying location of the bottom of the cylinder.
5563 # @param theRadius Radius of the cylinder to find shapes on.
5564 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5566 # @return List of all found sub-shapes indices
5568 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5569 @ManageTransactions("ShapesOp")
5570 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5572 Find in theShape all sub-shapes of type theShapeType, situated relatively
5573 the specified cylinder by the certain way, defined through theState parameter.
5576 theShape Shape to find sub-shapes of.
5577 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5578 theAxis Vector (or line, or linear edge), specifying
5579 axis of the cylinder to find shapes on.
5580 theRadius Radius of the cylinder to find shapes on.
5581 theState The state of the sub-shapes to find (see GEOM::shape_state)
5584 List of all found sub-shapes indices.
5586 # Example: see GEOM_TestOthers.py
5587 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5588 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5591 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5592 # the specified sphere by the certain way, defined through \a theState parameter.
5593 # @param theShape Shape to find sub-shapes of.
5594 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5595 # @param theCenter Point, specifying center of the sphere to find shapes on.
5596 # @param theRadius Radius of the sphere to find shapes on.
5597 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5598 # @param theName Object name; when specified, this parameter is used
5599 # for result publication in the study. Otherwise, if automatic
5600 # publication is switched on, default value is used for result name.
5602 # @return List of all found sub-shapes.
5604 # @ref swig_GetShapesOnSphere "Example"
5605 @ManageTransactions("ShapesOp")
5606 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5608 Find in theShape all sub-shapes of type theShapeType, situated relatively
5609 the specified sphere by the certain way, defined through theState parameter.
5612 theShape Shape to find sub-shapes of.
5613 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5614 theCenter Point, specifying center of the sphere to find shapes on.
5615 theRadius Radius of the sphere to find shapes on.
5616 theState The state of the sub-shapes to find (see GEOM::shape_state)
5617 theName Object name; when specified, this parameter is used
5618 for result publication in the study. Otherwise, if automatic
5619 publication is switched on, default value is used for result name.
5622 List of all found sub-shapes.
5624 # Example: see GEOM_TestOthers.py
5625 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5626 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5627 self._autoPublish(aList, theName, "shapeOnSphere")
5630 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5631 # the specified sphere by the certain way, defined through \a theState parameter.
5632 # @param theShape Shape to find sub-shapes of.
5633 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5634 # @param theCenter Point, specifying center of the sphere to find shapes on.
5635 # @param theRadius Radius of the sphere to find shapes on.
5636 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5638 # @return List of all found sub-shapes indices.
5640 # @ref swig_GetShapesOnSphereIDs "Example"
5641 @ManageTransactions("ShapesOp")
5642 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5644 Find in theShape all sub-shapes of type theShapeType, situated relatively
5645 the specified sphere by the certain way, defined through theState parameter.
5648 theShape Shape to find sub-shapes of.
5649 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5650 theCenter Point, specifying center of the sphere to find shapes on.
5651 theRadius Radius of the sphere to find shapes on.
5652 theState The state of the sub-shapes to find (see GEOM::shape_state)
5655 List of all found sub-shapes indices.
5657 # Example: see GEOM_TestOthers.py
5658 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5659 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5662 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5663 # the specified quadrangle by the certain way, defined through \a theState parameter.
5664 # @param theShape Shape to find sub-shapes of.
5665 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5666 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5667 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5668 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5669 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5670 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5671 # @param theName Object name; when specified, this parameter is used
5672 # for result publication in the study. Otherwise, if automatic
5673 # publication is switched on, default value is used for result name.
5675 # @return List of all found sub-shapes.
5677 # @ref swig_GetShapesOnQuadrangle "Example"
5678 @ManageTransactions("ShapesOp")
5679 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5680 theTopLeftPoint, theTopRightPoint,
5681 theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5683 Find in theShape all sub-shapes of type theShapeType, situated relatively
5684 the specified quadrangle by the certain way, defined through theState parameter.
5687 theShape Shape to find sub-shapes of.
5688 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5689 theTopLeftPoint Point, specifying top left corner of a quadrangle
5690 theTopRightPoint Point, specifying top right corner of a quadrangle
5691 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5692 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5693 theState The state of the sub-shapes to find (see GEOM::shape_state)
5694 theName Object name; when specified, this parameter is used
5695 for result publication in the study. Otherwise, if automatic
5696 publication is switched on, default value is used for result name.
5699 List of all found sub-shapes.
5701 # Example: see GEOM_TestOthers.py
5702 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5703 theTopLeftPoint, theTopRightPoint,
5704 theBottomLeftPoint, theBottomRightPoint, theState)
5705 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5706 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5709 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5710 # the specified quadrangle by the certain way, defined through \a theState parameter.
5711 # @param theShape Shape to find sub-shapes of.
5712 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5713 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5714 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5715 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5716 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5717 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5719 # @return List of all found sub-shapes indices.
5721 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5722 @ManageTransactions("ShapesOp")
5723 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5724 theTopLeftPoint, theTopRightPoint,
5725 theBottomLeftPoint, theBottomRightPoint, theState):
5727 Find in theShape all sub-shapes of type theShapeType, situated relatively
5728 the specified quadrangle by the certain way, defined through theState parameter.
5731 theShape Shape to find sub-shapes of.
5732 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5733 theTopLeftPoint Point, specifying top left corner of a quadrangle
5734 theTopRightPoint Point, specifying top right corner of a quadrangle
5735 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5736 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5737 theState The state of the sub-shapes to find (see GEOM::shape_state)
5740 List of all found sub-shapes indices.
5743 # Example: see GEOM_TestOthers.py
5744 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5745 theTopLeftPoint, theTopRightPoint,
5746 theBottomLeftPoint, theBottomRightPoint, theState)
5747 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5750 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5751 # the specified \a theBox by the certain way, defined through \a theState parameter.
5752 # @param theBox Shape for relative comparing.
5753 # @param theShape Shape to find sub-shapes of.
5754 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5755 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5756 # @param theName Object name; when specified, this parameter is used
5757 # for result publication in the study. Otherwise, if automatic
5758 # publication is switched on, default value is used for result name.
5760 # @return List of all found sub-shapes.
5762 # @ref swig_GetShapesOnBox "Example"
5763 @ManageTransactions("ShapesOp")
5764 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5766 Find in theShape all sub-shapes of type theShapeType, situated relatively
5767 the specified theBox by the certain way, defined through theState parameter.
5770 theBox Shape for relative comparing.
5771 theShape Shape to find sub-shapes of.
5772 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5773 theState The state of the sub-shapes to find (see GEOM::shape_state)
5774 theName Object name; when specified, this parameter is used
5775 for result publication in the study. Otherwise, if automatic
5776 publication is switched on, default value is used for result name.
5779 List of all found sub-shapes.
5781 # Example: see GEOM_TestOthers.py
5782 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5783 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5784 self._autoPublish(aList, theName, "shapeOnBox")
5787 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5788 # the specified \a theBox by the certain way, defined through \a theState parameter.
5789 # @param theBox Shape for relative comparing.
5790 # @param theShape Shape to find sub-shapes of.
5791 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5792 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5794 # @return List of all found sub-shapes indices.
5796 # @ref swig_GetShapesOnBoxIDs "Example"
5797 @ManageTransactions("ShapesOp")
5798 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5800 Find in theShape all sub-shapes of type theShapeType, situated relatively
5801 the specified theBox by the certain way, defined through theState parameter.
5804 theBox Shape for relative comparing.
5805 theShape Shape to find sub-shapes of.
5806 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5807 theState The state of the sub-shapes to find (see GEOM::shape_state)
5810 List of all found sub-shapes indices.
5812 # Example: see GEOM_TestOthers.py
5813 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5814 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5817 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5818 # situated relatively the specified \a theCheckShape by the
5819 # certain way, defined through \a theState parameter.
5820 # @param theCheckShape Shape for relative comparing. It must be a solid.
5821 # @param theShape Shape to find sub-shapes of.
5822 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5823 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5824 # @param theName Object name; when specified, this parameter is used
5825 # for result publication in the study. Otherwise, if automatic
5826 # publication is switched on, default value is used for result name.
5828 # @return List of all found sub-shapes.
5830 # @ref swig_GetShapesOnShape "Example"
5831 @ManageTransactions("ShapesOp")
5832 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5834 Find in theShape all sub-shapes of type theShapeType,
5835 situated relatively the specified theCheckShape by the
5836 certain way, defined through theState parameter.
5839 theCheckShape Shape for relative comparing. It must be a solid.
5840 theShape Shape to find sub-shapes of.
5841 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5842 theState The state of the sub-shapes to find (see GEOM::shape_state)
5843 theName Object name; when specified, this parameter is used
5844 for result publication in the study. Otherwise, if automatic
5845 publication is switched on, default value is used for result name.
5848 List of all found sub-shapes.
5850 # Example: see GEOM_TestOthers.py
5851 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5852 theShapeType, theState)
5853 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5854 self._autoPublish(aList, theName, "shapeOnShape")
5857 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5858 # situated relatively the specified \a theCheckShape by the
5859 # certain way, defined through \a theState parameter.
5860 # @param theCheckShape Shape for relative comparing. It must be a solid.
5861 # @param theShape Shape to find sub-shapes of.
5862 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5863 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5864 # @param theName Object name; when specified, this parameter is used
5865 # for result publication in the study. Otherwise, if automatic
5866 # publication is switched on, default value is used for result name.
5868 # @return All found sub-shapes as compound.
5870 # @ref swig_GetShapesOnShapeAsCompound "Example"
5871 @ManageTransactions("ShapesOp")
5872 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5874 Find in theShape all sub-shapes of type theShapeType,
5875 situated relatively the specified theCheckShape by the
5876 certain way, defined through theState parameter.
5879 theCheckShape Shape for relative comparing. It must be a solid.
5880 theShape Shape to find sub-shapes of.
5881 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5882 theState The state of the sub-shapes to find (see GEOM::shape_state)
5883 theName Object name; when specified, this parameter is used
5884 for result publication in the study. Otherwise, if automatic
5885 publication is switched on, default value is used for result name.
5888 All found sub-shapes as compound.
5890 # Example: see GEOM_TestOthers.py
5891 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5892 theShapeType, theState)
5893 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5894 self._autoPublish(anObj, theName, "shapeOnShape")
5897 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5898 # situated relatively the specified \a theCheckShape by the
5899 # certain way, defined through \a theState parameter.
5900 # @param theCheckShape Shape for relative comparing. It must be a solid.
5901 # @param theShape Shape to find sub-shapes of.
5902 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5903 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5905 # @return List of all found sub-shapes indices.
5907 # @ref swig_GetShapesOnShapeIDs "Example"
5908 @ManageTransactions("ShapesOp")
5909 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5911 Find in theShape all sub-shapes of type theShapeType,
5912 situated relatively the specified theCheckShape by the
5913 certain way, defined through theState parameter.
5916 theCheckShape Shape for relative comparing. It must be a solid.
5917 theShape Shape to find sub-shapes of.
5918 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5919 theState The state of the sub-shapes to find (see GEOM::shape_state)
5922 List of all found sub-shapes indices.
5924 # Example: see GEOM_TestOthers.py
5925 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5926 theShapeType, theState)
5927 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5930 ## Get sub-shape(s) of theShapeWhere, which are
5931 # coincident with \a theShapeWhat or could be a part of it.
5932 # @param theShapeWhere Shape to find sub-shapes of.
5933 # @param theShapeWhat Shape, specifying what to find.
5934 # @param isNewImplementation implementation of GetInPlace functionality
5935 # (default = False, old alghorithm based on shape properties)
5936 # @param theName Object name; when specified, this parameter is used
5937 # for result publication in the study. Otherwise, if automatic
5938 # publication is switched on, default value is used for result name.
5940 # @return Compound which includes all found sub-shapes if they have different types;
5941 # or group of all found shapes of the equal type; or a single found sub-shape.
5943 # @note This function has a restriction on argument shapes.
5944 # If \a theShapeWhere has curved parts with significantly
5945 # outstanding centres (i.e. the mass centre of a part is closer to
5946 # \a theShapeWhat than to the part), such parts will not be found.
5947 # @image html get_in_place_lost_part.png
5949 # @ref swig_GetInPlace "Example"
5950 @ManageTransactions("ShapesOp")
5951 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5953 Get sub-shape(s) of theShapeWhere, which are
5954 coincident with theShapeWhat or could be a part of it.
5957 theShapeWhere Shape to find sub-shapes of.
5958 theShapeWhat Shape, specifying what to find.
5959 isNewImplementation Implementation of GetInPlace functionality
5960 (default = False, old alghorithm based on shape properties)
5961 theName Object name; when specified, this parameter is used
5962 for result publication in the study. Otherwise, if automatic
5963 publication is switched on, default value is used for result name.
5966 Compound which includes all found sub-shapes if they have different types;
5967 or group of all found shapes of the equal type; or a single found sub-shape.
5971 This function has a restriction on argument shapes.
5972 If theShapeWhere has curved parts with significantly
5973 outstanding centres (i.e. the mass centre of a part is closer to
5974 theShapeWhat than to the part), such parts will not be found.
5976 # Example: see GEOM_TestOthers.py
5978 if isNewImplementation:
5979 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5981 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5983 RaiseIfFailed("GetInPlace", self.ShapesOp)
5984 self._autoPublish(anObj, theName, "inplace")
5987 ## Get sub-shape(s) of \a theShapeWhere, which are
5988 # coincident with \a theShapeWhat or could be a part of it.
5990 # Implementation of this method is based on a saved history of an operation,
5991 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5992 # arguments (an argument shape or a sub-shape of an argument shape).
5993 # The operation could be the Partition or one of boolean operations,
5994 # performed on simple shapes (not on compounds).
5996 # @param theShapeWhere Shape to find sub-shapes of.
5997 # @param theShapeWhat Shape, specifying what to find (must be in the
5998 # building history of the ShapeWhere).
5999 # @param theName Object name; when specified, this parameter is used
6000 # for result publication in the study. Otherwise, if automatic
6001 # publication is switched on, default value is used for result name.
6003 # @return Compound which includes all found sub-shapes if they have different types;
6004 # or group of all found shapes of the equal type; or a single found sub-shape.
6006 # @ref swig_GetInPlace "Example"
6007 @ManageTransactions("ShapesOp")
6008 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6010 Implementation of this method is based on a saved history of an operation,
6011 produced theShapeWhere. The theShapeWhat must be among this operation's
6012 arguments (an argument shape or a sub-shape of an argument shape).
6013 The operation could be the Partition or one of boolean operations,
6014 performed on simple shapes (not on compounds).
6017 theShapeWhere Shape to find sub-shapes of.
6018 theShapeWhat Shape, specifying what to find (must be in the
6019 building history of the ShapeWhere).
6020 theName Object name; when specified, this parameter is used
6021 for result publication in the study. Otherwise, if automatic
6022 publication is switched on, default value is used for result name.
6025 Compound which includes all found sub-shapes if they have different types;
6026 or group of all found shapes of the equal type; or a single found sub-shape.
6028 # Example: see GEOM_TestOthers.py
6029 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6030 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6031 self._autoPublish(anObj, theName, "inplace")
6034 ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6035 # For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6036 # IDs of @a theShapeWhere.
6037 # For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6038 # two parts by a plane, then the result can be as this:
6039 # len( result_list ) = 35,
6040 # result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6041 # solids with IDs 2 and 36 within theShapeWhere
6043 # @param theShapeWhere Shape to find sub-shapes of.
6044 # @param theShapeWhat Shape, specifying what to find.
6045 # @return List of lists of sub-shape IDS of theShapeWhere.
6046 def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6048 A sort of GetInPlace functionality, returning IDs of sub-shapes.
6049 For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6050 IDs of @a theShapeWhere.
6051 For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6052 two parts by a plane, then the result can be as this:
6053 len( result_list ) = 35,
6054 result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6055 solids with IDs 2 and 36 within theShapeWhere
6058 theShapeWhere Shape to find sub-shapes of.
6059 theShapeWhat Shape, specifying what to find.
6062 List of lists of sub-shape IDS of theShapeWhere.
6064 return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6066 ## Get sub-shape of theShapeWhere, which is
6067 # equal to \a theShapeWhat.
6068 # @param theShapeWhere Shape to find sub-shape of.
6069 # @param theShapeWhat Shape, specifying what to find.
6070 # @param theName Object name; when specified, this parameter is used
6071 # for result publication in the study. Otherwise, if automatic
6072 # publication is switched on, default value is used for result name.
6074 # @return New GEOM.GEOM_Object for found sub-shape.
6076 # @ref swig_GetSame "Example"
6077 @ManageTransactions("ShapesOp")
6078 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6080 Get sub-shape of theShapeWhere, which is
6081 equal to theShapeWhat.
6084 theShapeWhere Shape to find sub-shape of.
6085 theShapeWhat Shape, specifying what to find.
6086 theName Object name; when specified, this parameter is used
6087 for result publication in the study. Otherwise, if automatic
6088 publication is switched on, default value is used for result name.
6091 New GEOM.GEOM_Object for found sub-shape.
6093 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6094 RaiseIfFailed("GetSame", self.ShapesOp)
6095 self._autoPublish(anObj, theName, "sameShape")
6099 ## Get sub-shape indices of theShapeWhere, which is
6100 # equal to \a theShapeWhat.
6101 # @param theShapeWhere Shape to find sub-shape of.
6102 # @param theShapeWhat Shape, specifying what to find.
6103 # @return List of all found sub-shapes indices.
6105 # @ref swig_GetSame "Example"
6106 @ManageTransactions("ShapesOp")
6107 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6109 Get sub-shape indices of theShapeWhere, which is
6110 equal to theShapeWhat.
6113 theShapeWhere Shape to find sub-shape of.
6114 theShapeWhat Shape, specifying what to find.
6117 List of all found sub-shapes indices.
6119 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6120 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6123 ## Resize the input edge with the new Min and Max parameters.
6124 # The input edge parameters range is [0, 1]. If theMin parameter is
6125 # negative, the input edge is extended, otherwise it is shrinked by
6126 # theMin parameter. If theMax is greater than 1, the edge is extended,
6127 # otherwise it is shrinked by theMax parameter.
6128 # @param theEdge the input edge to be resized.
6129 # @param theMin the minimal parameter value.
6130 # @param theMax the maximal parameter value.
6131 # @param theName Object name; when specified, this parameter is used
6132 # for result publication in the study. Otherwise, if automatic
6133 # publication is switched on, default value is used for result name.
6134 # @return New GEOM.GEOM_Object, containing the created edge.
6136 # @ref tui_extend "Example"
6137 @ManageTransactions("ShapesOp")
6138 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6140 Resize the input edge with the new Min and Max parameters.
6141 The input edge parameters range is [0, 1]. If theMin parameter is
6142 negative, the input edge is extended, otherwise it is shrinked by
6143 theMin parameter. If theMax is greater than 1, the edge is extended,
6144 otherwise it is shrinked by theMax parameter.
6147 theEdge the input edge to be resized.
6148 theMin the minimal parameter value.
6149 theMax the maximal parameter value.
6150 theName Object name; when specified, this parameter is used
6151 for result publication in the study. Otherwise, if automatic
6152 publication is switched on, default value is used for result name.
6155 New GEOM.GEOM_Object, containing the created edge.
6157 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6158 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6159 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6160 anObj.SetParameters(Parameters)
6161 self._autoPublish(anObj, theName, "edge")
6164 ## Resize the input face with the new UMin, UMax, VMin and VMax
6165 # parameters. The input face U and V parameters range is [0, 1]. If
6166 # theUMin parameter is negative, the input face is extended, otherwise
6167 # it is shrinked along U direction by theUMin parameter. If theUMax is
6168 # greater than 1, the face is extended, otherwise it is shrinked along
6169 # U direction by theUMax parameter. So as for theVMin, theVMax and
6170 # V direction of the input face.
6171 # @param theFace the input face to be resized.
6172 # @param theUMin the minimal U parameter value.
6173 # @param theUMax the maximal U parameter value.
6174 # @param theVMin the minimal V parameter value.
6175 # @param theVMax the maximal V parameter value.
6176 # @param theName Object name; when specified, this parameter is used
6177 # for result publication in the study. Otherwise, if automatic
6178 # publication is switched on, default value is used for result name.
6179 # @return New GEOM.GEOM_Object, containing the created face.
6181 # @ref tui_extend "Example"
6182 @ManageTransactions("ShapesOp")
6183 def ExtendFace(self, theFace, theUMin, theUMax,
6184 theVMin, theVMax, theName=None):
6186 Resize the input face with the new UMin, UMax, VMin and VMax
6187 parameters. The input face U and V parameters range is [0, 1]. If
6188 theUMin parameter is negative, the input face is extended, otherwise
6189 it is shrinked along U direction by theUMin parameter. If theUMax is
6190 greater than 1, the face is extended, otherwise it is shrinked along
6191 U direction by theUMax parameter. So as for theVMin, theVMax and
6192 V direction of the input face.
6195 theFace the input face to be resized.
6196 theUMin the minimal U parameter value.
6197 theUMax the maximal U parameter value.
6198 theVMin the minimal V parameter value.
6199 theVMax the maximal V parameter value.
6200 theName Object name; when specified, this parameter is used
6201 for result publication in the study. Otherwise, if automatic
6202 publication is switched on, default value is used for result name.
6205 New GEOM.GEOM_Object, containing the created face.
6207 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6208 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6210 RaiseIfFailed("ExtendFace", self.ShapesOp)
6211 anObj.SetParameters(Parameters)
6212 self._autoPublish(anObj, theName, "face")
6215 ## This function takes some face as input parameter and creates new
6216 # GEOM_Object, i.e. topological shape by extracting underlying surface
6217 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6218 # parameters of the source face (in the parametrical space).
6219 # @param theFace the input face.
6220 # @param theName Object name; when specified, this parameter is used
6221 # for result publication in the study. Otherwise, if automatic
6222 # publication is switched on, default value is used for result name.
6223 # @return New GEOM.GEOM_Object, containing the created face.
6225 # @ref tui_creation_surface "Example"
6226 @ManageTransactions("ShapesOp")
6227 def MakeSurfaceFromFace(self, theFace, theName=None):
6229 This function takes some face as input parameter and creates new
6230 GEOM_Object, i.e. topological shape by extracting underlying surface
6231 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6232 parameters of the source face (in the parametrical space).
6235 theFace the input face.
6236 theName Object name; when specified, this parameter is used
6237 for result publication in the study. Otherwise, if automatic
6238 publication is switched on, default value is used for result name.
6241 New GEOM.GEOM_Object, containing the created face.
6243 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6244 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6245 self._autoPublish(anObj, theName, "surface")
6251 ## @addtogroup l4_access
6254 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6255 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6256 # @param aShape Shape to get sub-shape of.
6257 # @param ListOfID List of sub-shapes indices.
6258 # @param theName Object name; when specified, this parameter is used
6259 # for result publication in the study. Otherwise, if automatic
6260 # publication is switched on, default value is used for result name.
6262 # @return Found sub-shape.
6264 # @ref swig_all_decompose "Example"
6265 def GetSubShape(self, aShape, ListOfID, theName=None):
6267 Obtain a composite sub-shape of aShape, composed from sub-shapes
6268 of aShape, selected by their unique IDs inside aShape
6271 aShape Shape to get sub-shape of.
6272 ListOfID List of sub-shapes indices.
6273 theName Object name; when specified, this parameter is used
6274 for result publication in the study. Otherwise, if automatic
6275 publication is switched on, default value is used for result name.
6280 # Example: see GEOM_TestAll.py
6281 anObj = self.AddSubShape(aShape,ListOfID)
6282 self._autoPublish(anObj, theName, "subshape")
6285 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6286 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6287 # @param aShape Shape to get sub-shape of.
6288 # @param aSubShape Sub-shapes of aShape.
6289 # @return ID of found sub-shape.
6291 # @ref swig_all_decompose "Example"
6292 @ManageTransactions("LocalOp")
6293 def GetSubShapeID(self, aShape, aSubShape):
6295 Obtain unique ID of sub-shape aSubShape inside aShape
6296 of aShape, selected by their unique IDs inside aShape
6299 aShape Shape to get sub-shape of.
6300 aSubShape Sub-shapes of aShape.
6303 ID of found sub-shape.
6305 # Example: see GEOM_TestAll.py
6306 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6307 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6310 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6311 # This function is provided for performance purpose. The complexity is O(n) with n
6312 # the number of subobjects of aShape
6313 # @param aShape Shape to get sub-shape of.
6314 # @param aSubShapes Sub-shapes of aShape.
6315 # @return list of IDs of found sub-shapes.
6317 # @ref swig_all_decompose "Example"
6318 @ManageTransactions("ShapesOp")
6319 def GetSubShapesIDs(self, aShape, aSubShapes):
6321 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6322 This function is provided for performance purpose. The complexity is O(n) with n
6323 the number of subobjects of aShape
6326 aShape Shape to get sub-shape of.
6327 aSubShapes Sub-shapes of aShape.
6330 List of IDs of found sub-shape.
6332 # Example: see GEOM_TestAll.py
6333 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6334 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6340 ## @addtogroup l4_decompose
6343 ## Get all sub-shapes and groups of \a theShape,
6344 # that were created already by any other methods.
6345 # @param theShape Any shape.
6346 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6347 # returned, else all found sub-shapes and groups.
6348 # @return List of existing sub-objects of \a theShape.
6350 # @ref swig_all_decompose "Example"
6351 @ManageTransactions("ShapesOp")
6352 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6354 Get all sub-shapes and groups of theShape,
6355 that were created already by any other methods.
6359 theGroupsOnly If this parameter is TRUE, only groups will be
6360 returned, else all found sub-shapes and groups.
6363 List of existing sub-objects of theShape.
6365 # Example: see GEOM_TestAll.py
6366 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6367 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6370 ## Get all groups of \a theShape,
6371 # that were created already by any other methods.
6372 # @param theShape Any shape.
6373 # @return List of existing groups of \a theShape.
6375 # @ref swig_all_decompose "Example"
6376 @ManageTransactions("ShapesOp")
6377 def GetGroups(self, theShape):
6379 Get all groups of theShape,
6380 that were created already by any other methods.
6386 List of existing groups of theShape.
6388 # Example: see GEOM_TestAll.py
6389 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6390 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6393 ## Explode a shape on sub-shapes of a given type.
6394 # If the shape itself matches the type, it is also returned.
6395 # @param aShape Shape to be exploded.
6396 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6397 # @param theName Object name; when specified, this parameter is used
6398 # for result publication in the study. Otherwise, if automatic
6399 # publication is switched on, default value is used for result name.
6401 # @return List of sub-shapes of type theShapeType, contained in theShape.
6403 # @ref swig_all_decompose "Example"
6404 @ManageTransactions("ShapesOp")
6405 def SubShapeAll(self, aShape, aType, theName=None):
6407 Explode a shape on sub-shapes of a given type.
6408 If the shape itself matches the type, it is also returned.
6411 aShape Shape to be exploded.
6412 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6413 theName Object name; when specified, this parameter is used
6414 for result publication in the study. Otherwise, if automatic
6415 publication is switched on, default value is used for result name.
6418 List of sub-shapes of type theShapeType, contained in theShape.
6420 # Example: see GEOM_TestAll.py
6421 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6422 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6423 self._autoPublish(ListObj, theName, "subshape")
6426 ## Explode a shape on sub-shapes of a given type.
6427 # @param aShape Shape to be exploded.
6428 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6429 # @return List of IDs of sub-shapes.
6431 # @ref swig_all_decompose "Example"
6432 @ManageTransactions("ShapesOp")
6433 def SubShapeAllIDs(self, aShape, aType):
6435 Explode a shape on sub-shapes of a given type.
6438 aShape Shape to be exploded (see geompy.ShapeType)
6439 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6442 List of IDs of sub-shapes.
6444 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6445 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6448 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6449 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6450 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6451 # @param aShape Shape to get sub-shape of.
6452 # @param ListOfInd List of sub-shapes indices.
6453 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6454 # @param theName Object name; when specified, this parameter is used
6455 # for result publication in the study. Otherwise, if automatic
6456 # publication is switched on, default value is used for result name.
6458 # @return A compound of sub-shapes of aShape.
6460 # @ref swig_all_decompose "Example"
6461 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6463 Obtain a compound of sub-shapes of aShape,
6464 selected by their indices in list of all sub-shapes of type aType.
6465 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6468 aShape Shape to get sub-shape of.
6469 ListOfID List of sub-shapes indices.
6470 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6471 theName Object name; when specified, this parameter is used
6472 for result publication in the study. Otherwise, if automatic
6473 publication is switched on, default value is used for result name.
6476 A compound of sub-shapes of aShape.
6478 # Example: see GEOM_TestAll.py
6480 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6481 for ind in ListOfInd:
6482 ListOfIDs.append(AllShapeIDsList[ind - 1])
6483 # note: auto-publishing is done in self.GetSubShape()
6484 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6487 ## Explode a shape on sub-shapes of a given type.
6488 # Sub-shapes will be sorted taking into account their gravity centers,
6489 # to provide stable order of sub-shapes. Please see
6490 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6491 # If the shape itself matches the type, it is also returned.
6492 # @param aShape Shape to be exploded.
6493 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6494 # @param theName Object name; when specified, this parameter is used
6495 # for result publication in the study. Otherwise, if automatic
6496 # publication is switched on, default value is used for result name.
6498 # @return List of sub-shapes of type theShapeType, contained in theShape.
6500 # @ref swig_SubShapeAllSorted "Example"
6501 @ManageTransactions("ShapesOp")
6502 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6504 Explode a shape on sub-shapes of a given type.
6505 Sub-shapes will be sorted taking into account their gravity centers,
6506 to provide stable order of sub-shapes.
6507 If the shape itself matches the type, it is also returned.
6510 aShape Shape to be exploded.
6511 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6512 theName Object name; when specified, this parameter is used
6513 for result publication in the study. Otherwise, if automatic
6514 publication is switched on, default value is used for result name.
6517 List of sub-shapes of type theShapeType, contained in theShape.
6519 # Example: see GEOM_TestAll.py
6520 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6521 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6522 self._autoPublish(ListObj, theName, "subshape")
6525 ## Explode a shape on sub-shapes of a given type.
6526 # Sub-shapes will be sorted taking into account their gravity centers,
6527 # to provide stable order of sub-shapes. Please see
6528 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6529 # @param aShape Shape to be exploded.
6530 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6531 # @return List of IDs of sub-shapes.
6533 # @ref swig_all_decompose "Example"
6534 @ManageTransactions("ShapesOp")
6535 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6537 Explode a shape on sub-shapes of a given type.
6538 Sub-shapes will be sorted taking into account their gravity centers,
6539 to provide stable order of sub-shapes.
6542 aShape Shape to be exploded.
6543 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6546 List of IDs of sub-shapes.
6548 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6549 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6552 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6553 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6554 # Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6555 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6556 # @param aShape Shape to get sub-shape of.
6557 # @param ListOfInd List of sub-shapes indices.
6558 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6559 # @param theName Object name; when specified, this parameter is used
6560 # for result publication in the study. Otherwise, if automatic
6561 # publication is switched on, default value is used for result name.
6563 # @return A compound of sub-shapes of aShape.
6565 # @ref swig_all_decompose "Example"
6566 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6568 Obtain a compound of sub-shapes of aShape,
6569 selected by they indices in sorted list of all sub-shapes of type aType.
6570 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6573 aShape Shape to get sub-shape of.
6574 ListOfID List of sub-shapes indices.
6575 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6576 theName Object name; when specified, this parameter is used
6577 for result publication in the study. Otherwise, if automatic
6578 publication is switched on, default value is used for result name.
6581 A compound of sub-shapes of aShape.
6583 # Example: see GEOM_TestAll.py
6585 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6586 for ind in ListOfInd:
6587 ListOfIDs.append(AllShapeIDsList[ind - 1])
6588 # note: auto-publishing is done in self.GetSubShape()
6589 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6592 ## Extract shapes (excluding the main shape) of given type.
6593 # @param aShape The shape.
6594 # @param aType The shape type (see ShapeType())
6595 # @param isSorted Boolean flag to switch sorting on/off. Please see
6596 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6597 # @param theName Object name; when specified, this parameter is used
6598 # for result publication in the study. Otherwise, if automatic
6599 # publication is switched on, default value is used for result name.
6601 # @return List of sub-shapes of type aType, contained in aShape.
6603 # @ref swig_FilletChamfer "Example"
6604 @ManageTransactions("ShapesOp")
6605 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6607 Extract shapes (excluding the main shape) of given type.
6611 aType The shape type (see geompy.ShapeType)
6612 isSorted Boolean flag to switch sorting on/off.
6613 theName Object name; when specified, this parameter is used
6614 for result publication in the study. Otherwise, if automatic
6615 publication is switched on, default value is used for result name.
6618 List of sub-shapes of type aType, contained in aShape.
6620 # Example: see GEOM_TestAll.py
6621 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6622 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6623 self._autoPublish(ListObj, theName, "subshape")
6626 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6627 # @param aShape Main shape.
6628 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6629 # @param theName Object name; when specified, this parameter is used
6630 # for result publication in the study. Otherwise, if automatic
6631 # publication is switched on, default value is used for result name.
6632 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6634 # @ref swig_all_decompose "Example"
6635 @ManageTransactions("ShapesOp")
6636 def SubShapes(self, aShape, anIDs, theName=None):
6638 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6642 anIDs List of unique IDs of sub-shapes inside theMainShape.
6643 theName Object name; when specified, this parameter is used
6644 for result publication in the study. Otherwise, if automatic
6645 publication is switched on, default value is used for result name.
6648 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6650 # Example: see GEOM_TestAll.py
6651 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6652 RaiseIfFailed("SubShapes", self.ShapesOp)
6653 self._autoPublish(ListObj, theName, "subshape")
6656 ## Explode a shape into edges sorted in a row from a starting point.
6657 # @param theShape the shape to be exploded on edges.
6658 # @param theStartPoint the starting point.
6659 # @param theName Object name; when specified, this parameter is used
6660 # for result publication in the study. Otherwise, if automatic
6661 # publication is switched on, default value is used for result name.
6662 # @return List of GEOM.GEOM_Object that is actually an ordered list
6663 # of edges sorted in a row from a starting point.
6665 # @ref swig_GetSubShapeEdgeSorted "Example"
6666 @ManageTransactions("ShapesOp")
6667 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6669 Explode a shape into edges sorted in a row from a starting point.
6672 theShape the shape to be exploded on edges.
6673 theStartPoint the starting point.
6674 theName Object name; when specified, this parameter is used
6675 for result publication in the study. Otherwise, if automatic
6676 publication is switched on, default value is used for result name.
6679 List of GEOM.GEOM_Object that is actually an ordered list
6680 of edges sorted in a row from a starting point.
6682 # Example: see GEOM_TestAll.py
6683 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6684 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6685 self._autoPublish(ListObj, theName, "SortedEdges")
6689 # Return the list of subshapes that satisfies a certain tolerance
6690 # criterion. The user defines the type of shapes to be returned, the
6691 # condition and the tolerance value. The operation is defined for
6692 # faces, edges and vertices only. E.g. for theShapeType FACE,
6693 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6694 # all faces of theShape that have tolerances greater then 1.e7.
6696 # @param theShape the shape to be exploded
6697 # @param theShapeType the type of sub-shapes to be returned (see
6698 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6699 # @param theCondition the condition type (see GEOM::comparison_condition).
6700 # @param theTolerance the tolerance filter.
6701 # @param theName Object name; when specified, this parameter is used
6702 # for result publication in the study. Otherwise, if automatic
6703 # publication is switched on, default value is used for result name.
6704 # @return the list of shapes that satisfy the conditions.
6706 # @ref swig_GetSubShapesWithTolerance "Example"
6707 @ManageTransactions("ShapesOp")
6708 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6709 theCondition, theTolerance, theName=None):
6711 Return the list of subshapes that satisfies a certain tolerance
6712 criterion. The user defines the type of shapes to be returned, the
6713 condition and the tolerance value. The operation is defined for
6714 faces, edges and vertices only. E.g. for theShapeType FACE,
6715 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6716 all faces of theShape that have tolerances greater then 1.e7.
6719 theShape the shape to be exploded
6720 theShapeType the type of sub-shapes to be returned (see
6721 ShapeType()). Can have the values FACE,
6722 EDGE and VERTEX only.
6723 theCondition the condition type (see GEOM::comparison_condition).
6724 theTolerance the tolerance filter.
6725 theName Object name; when specified, this parameter is used
6726 for result publication in the study. Otherwise, if automatic
6727 publication is switched on, default value is used for result name.
6730 The list of shapes that satisfy the conditions.
6732 # Example: see GEOM_TestAll.py
6733 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6734 theCondition, theTolerance)
6735 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6736 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6739 ## Check if the object is a sub-object of another GEOM object.
6740 # @param aSubObject Checked sub-object (or its parent object, in case if
6741 # \a theSubObjectIndex is non-zero).
6742 # @param anObject An object that is checked for ownership (or its parent object,
6743 # in case if \a theObjectIndex is non-zero).
6744 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6745 # identifies a sub-object within its parent specified via \a theSubObject.
6746 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6747 # identifies an object within its parent specified via \a theObject.
6748 # @return TRUE, if the given object contains sub-object.
6749 @ManageTransactions("ShapesOp")
6750 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6752 Check if the object is a sub-object of another GEOM object.
6755 aSubObject Checked sub-object (or its parent object, in case if
6756 \a theSubObjectIndex is non-zero).
6757 anObject An object that is checked for ownership (or its parent object,
6758 in case if \a theObjectIndex is non-zero).
6759 aSubObjectIndex When non-zero, specifies a sub-shape index that
6760 identifies a sub-object within its parent specified via \a theSubObject.
6761 anObjectIndex When non-zero, specifies a sub-shape index that
6762 identifies an object within its parent specified via \a theObject.
6765 TRUE, if the given object contains sub-object.
6767 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6768 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6771 ## Perform extraction of sub-shapes from the main shape.
6773 # @param theShape the main shape
6774 # @param theListOfID the list of sub-shape IDs to be extracted from
6776 # @return New GEOM.GEOM_Object, containing the shape without
6777 # extracted sub-shapes.
6779 # @ref swig_MakeExtraction "Example"
6780 @ManageTransactions("ShapesOp")
6781 def MakeExtraction(self, theShape, theListOfID, theName=None):
6783 Perform extraction of sub-shapes from the main shape.
6786 theShape the main shape
6787 theListOfID the list of sub-shape IDs to be extracted from
6791 New GEOM.GEOM_Object, containing the shape without
6792 extracted sub-shapes.
6794 # Example: see GEOM_TestAll.py
6795 (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6796 RaiseIfFailed("MakeExtraction", self.ShapesOp)
6797 self._autoPublish(anObj, theName, "Extraction")
6800 # end of l4_decompose
6803 ## @addtogroup l4_decompose_d
6806 ## Deprecated method
6807 # It works like SubShapeAllSortedCentres(), but wrongly
6808 # defines centres of faces, shells and solids.
6809 @ManageTransactions("ShapesOp")
6810 def SubShapeAllSorted(self, aShape, aType, theName=None):
6813 It works like geompy.SubShapeAllSortedCentres, but wrongly
6814 defines centres of faces, shells and solids.
6816 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6817 RaiseIfFailed("MakeExplode", self.ShapesOp)
6818 self._autoPublish(ListObj, theName, "subshape")
6821 ## Deprecated method
6822 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6823 # defines centres of faces, shells and solids.
6824 @ManageTransactions("ShapesOp")
6825 def SubShapeAllSortedIDs(self, aShape, aType):
6828 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6829 defines centres of faces, shells and solids.
6831 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6832 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6835 ## Deprecated method
6836 # It works like SubShapeSortedCentres(), but has a bug
6837 # (wrongly defines centres of faces, shells and solids).
6838 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6841 It works like geompy.SubShapeSortedCentres, but has a bug
6842 (wrongly defines centres of faces, shells and solids).
6845 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6846 for ind in ListOfInd:
6847 ListOfIDs.append(AllShapeIDsList[ind - 1])
6848 # note: auto-publishing is done in self.GetSubShape()
6849 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6852 # end of l4_decompose_d
6855 ## @addtogroup l3_healing
6858 ## Apply a sequence of Shape Healing operators to the given object.
6859 # @param theShape Shape to be processed.
6860 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6861 # @param theParameters List of names of parameters
6862 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6863 # @param theValues List of values of parameters, in the same order
6864 # as parameters are listed in <VAR>theParameters</VAR> list.
6865 # @param theName Object name; when specified, this parameter is used
6866 # for result publication in the study. Otherwise, if automatic
6867 # publication is switched on, default value is used for result name.
6869 # <b> Operators and Parameters: </b> \n
6871 # * \b FixShape - corrects invalid shapes. \n
6872 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6873 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6875 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6876 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6877 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6878 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6879 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6880 # - \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
6881 # - \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
6882 # - \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
6884 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6885 # surfaces in segments using a certain angle. \n
6886 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6887 # if Angle=180, four if Angle=90, etc). \n
6888 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6890 # * \b SplitClosedFaces - splits closed faces in segments.
6891 # The number of segments depends on the number of splitting points.\n
6892 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6894 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6895 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6896 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6897 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6898 # This and the previous parameters can take the following values:\n
6899 # \b Parametric \b Continuity \n
6900 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6901 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6902 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6903 # ruling out sharp edges).\n
6904 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6905 # are of the same magnitude).\n
6906 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6907 # or surfaces (d/du C(u)) are the same at junction. \n
6908 # \b Geometric \b Continuity \n
6909 # \b G1: first derivatives are proportional at junction.\n
6910 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6911 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6912 # \b G2: first and second derivatives are proportional at junction.
6913 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6914 # continuity requires that the underlying parameterization was continuous as well.
6915 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6917 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6918 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6919 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6920 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6921 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6922 # with the specified parameters.\n
6923 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6924 # with the specified parameters.\n
6925 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6926 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6927 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6928 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6930 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6931 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6932 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6933 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6934 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6936 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6937 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6940 # @return New GEOM.GEOM_Object, containing processed shape.
6942 # \n @ref tui_shape_processing "Example"
6943 @ManageTransactions("HealOp")
6944 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6946 Apply a sequence of Shape Healing operators to the given object.
6949 theShape Shape to be processed.
6950 theValues List of values of parameters, in the same order
6951 as parameters are listed in theParameters list.
6952 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6953 theParameters List of names of parameters
6954 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6955 theName Object name; when specified, this parameter is used
6956 for result publication in the study. Otherwise, if automatic
6957 publication is switched on, default value is used for result name.
6959 Operators and Parameters:
6961 * FixShape - corrects invalid shapes.
6962 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6963 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6964 * FixFaceSize - removes small faces, such as spots and strips.
6965 * FixFaceSize.Tolerance - defines minimum possible face size.
6966 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6967 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6968 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6969 * 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.
6970 * 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.
6971 * 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.
6973 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6974 in segments using a certain angle.
6975 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6976 if Angle=180, four if Angle=90, etc).
6977 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6978 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6980 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6981 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6982 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6983 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6984 * SplitContinuity.CurveContinuity - required continuity for curves.
6985 This and the previous parameters can take the following values:
6987 Parametric Continuity:
6988 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6989 coincidental. The curves or surfaces may still meet at an angle,
6990 giving rise to a sharp corner or edge).
6991 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6992 are parallel, ruling out sharp edges).
6993 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6994 or surfaces are of the same magnitude).
6995 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6996 curves or surfaces (d/du C(u)) are the same at junction.
6998 Geometric Continuity:
6999 G1: first derivatives are proportional at junction.
7000 The curve tangents thus have the same direction, but not necessarily the same magnitude.
7001 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
7002 G2: first and second derivatives are proportional at junction. As the names imply,
7003 geometric continuity requires the geometry to be continuous, while parametric continuity requires
7004 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
7005 geometric continuity of order n, but not vice-versa.
7006 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7007 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7008 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7009 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7010 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7011 the specified parameters.
7012 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7013 the specified parameters.
7014 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7015 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7016 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7017 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7018 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7019 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7020 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7021 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7022 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7023 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7024 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7027 New GEOM.GEOM_Object, containing processed shape.
7029 Note: For more information look through SALOME Geometry User's Guide->
7030 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7032 # Example: see GEOM_TestHealing.py
7033 theValues,Parameters = ParseList(theValues)
7034 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7035 # To avoid script failure in case of good argument shape
7036 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7038 RaiseIfFailed("ProcessShape", self.HealOp)
7039 for string in (theOperators + theParameters):
7040 Parameters = ":" + Parameters
7042 anObj.SetParameters(Parameters)
7043 self._autoPublish(anObj, theName, "healed")
7046 ## Remove faces from the given object (shape).
7047 # @param theObject Shape to be processed.
7048 # @param theFaces Indices of faces to be removed, if EMPTY then the method
7049 # removes ALL faces of the given object.
7050 # @param theName Object name; when specified, this parameter is used
7051 # for result publication in the study. Otherwise, if automatic
7052 # publication is switched on, default value is used for result name.
7054 # @return New GEOM.GEOM_Object, containing processed shape.
7056 # @ref tui_suppress_faces "Example"
7057 @ManageTransactions("HealOp")
7058 def SuppressFaces(self, theObject, theFaces, theName=None):
7060 Remove faces from the given object (shape).
7063 theObject Shape to be processed.
7064 theFaces Indices of faces to be removed, if EMPTY then the method
7065 removes ALL faces of the given object.
7066 theName Object name; when specified, this parameter is used
7067 for result publication in the study. Otherwise, if automatic
7068 publication is switched on, default value is used for result name.
7071 New GEOM.GEOM_Object, containing processed shape.
7073 # Example: see GEOM_TestHealing.py
7074 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7075 RaiseIfFailed("SuppressFaces", self.HealOp)
7076 self._autoPublish(anObj, theName, "suppressFaces")
7079 ## Sewing of faces into a single shell.
7080 # @param ListShape Shapes to be processed.
7081 # @param theTolerance Required tolerance value.
7082 # @param AllowNonManifold Flag that allows non-manifold sewing.
7083 # @param theName Object name; when specified, this parameter is used
7084 # for result publication in the study. Otherwise, if automatic
7085 # publication is switched on, default value is used for result name.
7087 # @return New GEOM.GEOM_Object, containing a result shell.
7089 # @ref tui_sewing "Example"
7090 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7092 Sewing of faces into a single shell.
7095 ListShape Shapes to be processed.
7096 theTolerance Required tolerance value.
7097 AllowNonManifold Flag that allows non-manifold sewing.
7098 theName Object name; when specified, this parameter is used
7099 for result publication in the study. Otherwise, if automatic
7100 publication is switched on, default value is used for result name.
7103 New GEOM.GEOM_Object, containing containing a result shell.
7105 # Example: see GEOM_TestHealing.py
7106 # note: auto-publishing is done in self.Sew()
7107 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7110 ## Sewing of faces into a single shell.
7111 # @param ListShape Shapes to be processed.
7112 # @param theTolerance Required tolerance value.
7113 # @param AllowNonManifold Flag that allows non-manifold sewing.
7114 # @param theName Object name; when specified, this parameter is used
7115 # for result publication in the study. Otherwise, if automatic
7116 # publication is switched on, default value is used for result name.
7118 # @return New GEOM.GEOM_Object, containing a result shell.
7119 @ManageTransactions("HealOp")
7120 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7122 Sewing of faces into a single shell.
7125 ListShape Shapes to be processed.
7126 theTolerance Required tolerance value.
7127 AllowNonManifold Flag that allows non-manifold sewing.
7128 theName Object name; when specified, this parameter is used
7129 for result publication in the study. Otherwise, if automatic
7130 publication is switched on, default value is used for result name.
7133 New GEOM.GEOM_Object, containing a result shell.
7135 # Example: see MakeSewing() above
7136 theTolerance,Parameters = ParseParameters(theTolerance)
7137 if AllowNonManifold:
7138 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7140 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7141 # To avoid script failure in case of good argument shape
7142 # (Fix of test cases geom/bugs11/L7,L8)
7143 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7145 RaiseIfFailed("Sew", self.HealOp)
7146 anObj.SetParameters(Parameters)
7147 self._autoPublish(anObj, theName, "sewed")
7150 ## Rebuild the topology of theSolids by removing
7151 # the faces that are shared by several solids.
7152 # @param theSolids A compound or a list of solids to be processed.
7153 # @param theName Object name; when specified, this parameter is used
7154 # for result publication in the study. Otherwise, if automatic
7155 # publication is switched on, default value is used for result name.
7157 # @return New GEOM.GEOM_Object, containing processed shape.
7159 # @ref tui_remove_webs "Example"
7160 @ManageTransactions("HealOp")
7161 def RemoveInternalFaces (self, theSolids, theName=None):
7163 Rebuild the topology of theSolids by removing
7164 the faces that are shared by several solids.
7167 theSolids A compound or a list of solids to be processed.
7168 theName Object name; when specified, this parameter is used
7169 for result publication in the study. Otherwise, if automatic
7170 publication is switched on, default value is used for result name.
7173 New GEOM.GEOM_Object, containing processed shape.
7175 # Example: see GEOM_TestHealing.py
7176 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7177 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7178 self._autoPublish(anObj, theName, "removeWebs")
7181 ## Remove internal wires and edges from the given object (face).
7182 # @param theObject Shape to be processed.
7183 # @param theWires Indices of wires to be removed, if EMPTY then the method
7184 # removes ALL internal wires of the given object.
7185 # @param theName Object name; when specified, this parameter is used
7186 # for result publication in the study. Otherwise, if automatic
7187 # publication is switched on, default value is used for result name.
7189 # @return New GEOM.GEOM_Object, containing processed shape.
7191 # @ref tui_suppress_internal_wires "Example"
7192 @ManageTransactions("HealOp")
7193 def SuppressInternalWires(self, theObject, theWires, theName=None):
7195 Remove internal wires and edges from the given object (face).
7198 theObject Shape to be processed.
7199 theWires Indices of wires to be removed, if EMPTY then the method
7200 removes ALL internal wires of the given object.
7201 theName Object name; when specified, this parameter is used
7202 for result publication in the study. Otherwise, if automatic
7203 publication is switched on, default value is used for result name.
7206 New GEOM.GEOM_Object, containing processed shape.
7208 # Example: see GEOM_TestHealing.py
7209 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7210 RaiseIfFailed("RemoveIntWires", self.HealOp)
7211 self._autoPublish(anObj, theName, "suppressWires")
7214 ## Remove internal closed contours (holes) from the given object.
7215 # @param theObject Shape to be processed.
7216 # @param theWires Indices of wires to be removed, if EMPTY then the method
7217 # removes ALL internal holes of the given object
7218 # @param theName Object name; when specified, this parameter is used
7219 # for result publication in the study. Otherwise, if automatic
7220 # publication is switched on, default value is used for result name.
7222 # @return New GEOM.GEOM_Object, containing processed shape.
7224 # @ref tui_suppress_holes "Example"
7225 @ManageTransactions("HealOp")
7226 def SuppressHoles(self, theObject, theWires, theName=None):
7228 Remove internal closed contours (holes) from the given object.
7231 theObject Shape to be processed.
7232 theWires Indices of wires to be removed, if EMPTY then the method
7233 removes ALL internal holes of the given object
7234 theName Object name; when specified, this parameter is used
7235 for result publication in the study. Otherwise, if automatic
7236 publication is switched on, default value is used for result name.
7239 New GEOM.GEOM_Object, containing processed shape.
7241 # Example: see GEOM_TestHealing.py
7242 anObj = self.HealOp.FillHoles(theObject, theWires)
7243 RaiseIfFailed("FillHoles", self.HealOp)
7244 self._autoPublish(anObj, theName, "suppressHoles")
7247 ## Close an open wire.
7248 # @param theObject Shape to be processed.
7249 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7250 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7251 # @param isCommonVertex If True : closure by creation of a common vertex,
7252 # If False : closure by creation of an edge between ends.
7253 # @param theName Object name; when specified, this parameter is used
7254 # for result publication in the study. Otherwise, if automatic
7255 # publication is switched on, default value is used for result name.
7257 # @return New GEOM.GEOM_Object, containing processed shape.
7259 # @ref tui_close_contour "Example"
7260 @ManageTransactions("HealOp")
7261 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7266 theObject Shape to be processed.
7267 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7268 if [ ], then theObject itself is a wire.
7269 isCommonVertex If True : closure by creation of a common vertex,
7270 If False : closure by creation of an edge between ends.
7271 theName Object name; when specified, this parameter is used
7272 for result publication in the study. Otherwise, if automatic
7273 publication is switched on, default value is used for result name.
7276 New GEOM.GEOM_Object, containing processed shape.
7278 # Example: see GEOM_TestHealing.py
7279 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7280 RaiseIfFailed("CloseContour", self.HealOp)
7281 self._autoPublish(anObj, theName, "closeContour")
7284 ## Addition of a point to a given edge object.
7285 # @param theObject Shape to be processed.
7286 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7287 # if -1, then theObject itself is the edge.
7288 # @param theValue Value of parameter on edge or length parameter,
7289 # depending on \a isByParameter.
7290 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7291 # if FALSE : \a theValue is treated as a length parameter [0..1]
7292 # @param theName Object name; when specified, this parameter is used
7293 # for result publication in the study. Otherwise, if automatic
7294 # publication is switched on, default value is used for result name.
7296 # @return New GEOM.GEOM_Object, containing processed shape.
7298 # @ref tui_add_point_on_edge "Example"
7299 @ManageTransactions("HealOp")
7300 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7302 Addition of a point to a given edge object.
7305 theObject Shape to be processed.
7306 theEdgeIndex Index of edge to be divided within theObject's shape,
7307 if -1, then theObject itself is the edge.
7308 theValue Value of parameter on edge or length parameter,
7309 depending on isByParameter.
7310 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7311 if FALSE : theValue is treated as a length parameter [0..1]
7312 theName Object name; when specified, this parameter is used
7313 for result publication in the study. Otherwise, if automatic
7314 publication is switched on, default value is used for result name.
7317 New GEOM.GEOM_Object, containing processed shape.
7319 # Example: see GEOM_TestHealing.py
7320 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7321 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7322 RaiseIfFailed("DivideEdge", self.HealOp)
7323 anObj.SetParameters(Parameters)
7324 self._autoPublish(anObj, theName, "divideEdge")
7327 ## Addition of points to a given edge of \a theObject by projecting
7328 # other points to the given edge.
7329 # @param theObject Shape to be processed.
7330 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7331 # if -1, then theObject itself is the edge.
7332 # @param thePoints List of points to project to theEdgeIndex-th edge.
7333 # @param theName Object name; when specified, this parameter is used
7334 # for result publication in the study. Otherwise, if automatic
7335 # publication is switched on, default value is used for result name.
7337 # @return New GEOM.GEOM_Object, containing processed shape.
7339 # @ref tui_add_point_on_edge "Example"
7340 @ManageTransactions("HealOp")
7341 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7343 Addition of points to a given edge of \a theObject by projecting
7344 other points to the given edge.
7347 theObject Shape to be processed.
7348 theEdgeIndex The edge or its index to be divided within theObject's shape,
7349 if -1, then theObject itself is the edge.
7350 thePoints List of points to project to theEdgeIndex-th edge.
7351 theName Object name; when specified, this parameter is used
7352 for result publication in the study. Otherwise, if automatic
7353 publication is switched on, default value is used for result name.
7356 New GEOM.GEOM_Object, containing processed shape.
7358 # Example: see GEOM_TestHealing.py
7359 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7360 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7361 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7362 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7363 self._autoPublish(anObj, theName, "divideEdge")
7366 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7367 # @param theWire Wire to minimize the number of C1 continuous edges in.
7368 # @param theVertices A list of vertices to suppress. If the list
7369 # is empty, all vertices in a wire will be assumed.
7370 # @param theName Object name; when specified, this parameter is used
7371 # for result publication in the study. Otherwise, if automatic
7372 # publication is switched on, default value is used for result name.
7374 # @return New GEOM.GEOM_Object with modified wire.
7376 # @ref tui_fuse_collinear_edges "Example"
7377 @ManageTransactions("HealOp")
7378 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7380 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7383 theWire Wire to minimize the number of C1 continuous edges in.
7384 theVertices A list of vertices to suppress. If the list
7385 is empty, all vertices in a wire will be assumed.
7386 theName Object name; when specified, this parameter is used
7387 for result publication in the study. Otherwise, if automatic
7388 publication is switched on, default value is used for result name.
7391 New GEOM.GEOM_Object with modified wire.
7393 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7394 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7395 self._autoPublish(anObj, theName, "fuseEdges")
7398 ## Change orientation of the given object. Updates given shape.
7399 # @param theObject Shape to be processed.
7400 # @return Updated <var>theObject</var>
7402 # @ref swig_todo "Example"
7403 @ManageTransactions("HealOp")
7404 def ChangeOrientationShell(self,theObject):
7406 Change orientation of the given object. Updates given shape.
7409 theObject Shape to be processed.
7414 theObject = self.HealOp.ChangeOrientation(theObject)
7415 RaiseIfFailed("ChangeOrientation", self.HealOp)
7418 ## Change orientation of the given object.
7419 # @param theObject Shape to be processed.
7420 # @param theName Object name; when specified, this parameter is used
7421 # for result publication in the study. Otherwise, if automatic
7422 # publication is switched on, default value is used for result name.
7424 # @return New GEOM.GEOM_Object, containing processed shape.
7426 # @ref swig_todo "Example"
7427 @ManageTransactions("HealOp")
7428 def ChangeOrientationShellCopy(self, theObject, theName=None):
7430 Change orientation of the given object.
7433 theObject Shape to be processed.
7434 theName Object name; when specified, this parameter is used
7435 for result publication in the study. Otherwise, if automatic
7436 publication is switched on, default value is used for result name.
7439 New GEOM.GEOM_Object, containing processed shape.
7441 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7442 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7443 self._autoPublish(anObj, theName, "reversed")
7446 ## Try to limit tolerance of the given object by value \a theTolerance.
7447 # @param theObject Shape to be processed.
7448 # @param theTolerance Required tolerance value.
7449 # @param theName Object name; when specified, this parameter is used
7450 # for result publication in the study. Otherwise, if automatic
7451 # publication is switched on, default value is used for result name.
7453 # @return New GEOM.GEOM_Object, containing processed shape.
7455 # @ref tui_limit_tolerance "Example"
7456 @ManageTransactions("HealOp")
7457 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7459 Try to limit tolerance of the given object by value theTolerance.
7462 theObject Shape to be processed.
7463 theTolerance Required tolerance value.
7464 theName Object name; when specified, this parameter is used
7465 for result publication in the study. Otherwise, if automatic
7466 publication is switched on, default value is used for result name.
7469 New GEOM.GEOM_Object, containing processed shape.
7471 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7472 RaiseIfFailed("LimitTolerance", self.HealOp)
7473 self._autoPublish(anObj, theName, "limitTolerance")
7476 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7477 # that constitute a free boundary of the given shape.
7478 # @param theObject Shape to get free boundary of.
7479 # @param theName Object name; when specified, this parameter is used
7480 # for result publication in the study. Otherwise, if automatic
7481 # publication is switched on, default value is used for result name.
7483 # @return [\a status, \a theClosedWires, \a theOpenWires]
7484 # \n \a status: FALSE, if an error(s) occurred during the method execution.
7485 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7486 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7488 # @ref tui_free_boundaries_page "Example"
7489 @ManageTransactions("HealOp")
7490 def GetFreeBoundary(self, theObject, theName=None):
7492 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7493 that constitute a free boundary of the given shape.
7496 theObject Shape to get free boundary of.
7497 theName Object name; when specified, this parameter is used
7498 for result publication in the study. Otherwise, if automatic
7499 publication is switched on, default value is used for result name.
7502 [status, theClosedWires, theOpenWires]
7503 status: FALSE, if an error(s) occurred during the method execution.
7504 theClosedWires: Closed wires on the free boundary of the given shape.
7505 theOpenWires: Open wires on the free boundary of the given shape.
7507 # Example: see GEOM_TestHealing.py
7508 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7509 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7510 self._autoPublish(anObj[1], theName, "closedWire")
7511 self._autoPublish(anObj[2], theName, "openWire")
7514 ## Replace coincident faces in \a theShapes by one face.
7515 # @param theShapes Initial shapes, either a list or compound of shapes.
7516 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7517 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7518 # otherwise all initial shapes.
7519 # @param theName Object name; when specified, this parameter is used
7520 # for result publication in the study. Otherwise, if automatic
7521 # publication is switched on, default value is used for result name.
7523 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7525 # @ref tui_glue_faces "Example"
7526 @ManageTransactions("ShapesOp")
7527 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7529 Replace coincident faces in theShapes by one face.
7532 theShapes Initial shapes, either a list or compound of shapes.
7533 theTolerance Maximum distance between faces, which can be considered as coincident.
7534 doKeepNonSolids If FALSE, only solids will present in the result,
7535 otherwise all initial shapes.
7536 theName Object name; when specified, this parameter is used
7537 for result publication in the study. Otherwise, if automatic
7538 publication is switched on, default value is used for result name.
7541 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7543 # Example: see GEOM_Spanner.py
7544 theTolerance,Parameters = ParseParameters(theTolerance)
7545 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7547 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7548 anObj.SetParameters(Parameters)
7549 self._autoPublish(anObj, theName, "glueFaces")
7552 ## Find coincident faces in \a theShapes for possible gluing.
7553 # @param theShapes Initial shapes, either a list or compound of shapes.
7554 # @param theTolerance Maximum distance between faces,
7555 # which can be considered as coincident.
7556 # @param theName Object name; when specified, this parameter is used
7557 # for result publication in the study. Otherwise, if automatic
7558 # publication is switched on, default value is used for result name.
7560 # @return GEOM.ListOfGO
7562 # @ref tui_glue_faces "Example"
7563 @ManageTransactions("ShapesOp")
7564 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7566 Find coincident faces in theShapes for possible gluing.
7569 theShapes Initial shapes, either a list or compound of shapes.
7570 theTolerance Maximum distance between faces,
7571 which can be considered as coincident.
7572 theName Object name; when specified, this parameter is used
7573 for result publication in the study. Otherwise, if automatic
7574 publication is switched on, default value is used for result name.
7579 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7580 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7581 self._autoPublish(anObj, theName, "facesToGlue")
7584 ## Replace coincident faces in \a theShapes by one face
7585 # in compliance with given list of faces
7586 # @param theShapes Initial shapes, either a list or compound of shapes.
7587 # @param theTolerance Maximum distance between faces,
7588 # which can be considered as coincident.
7589 # @param theFaces List of faces for gluing.
7590 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7591 # otherwise all initial shapes.
7592 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7593 # will be glued, otherwise only the edges,
7594 # belonging to <VAR>theFaces</VAR>.
7595 # @param theName Object name; when specified, this parameter is used
7596 # for result publication in the study. Otherwise, if automatic
7597 # publication is switched on, default value is used for result name.
7599 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7601 # @ref tui_glue_faces "Example"
7602 @ManageTransactions("ShapesOp")
7603 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7604 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7606 Replace coincident faces in theShapes by one face
7607 in compliance with given list of faces
7610 theShapes theShapes Initial shapes, either a list or compound of shapes.
7611 theTolerance Maximum distance between faces,
7612 which can be considered as coincident.
7613 theFaces List of faces for gluing.
7614 doKeepNonSolids If FALSE, only solids will present in the result,
7615 otherwise all initial shapes.
7616 doGlueAllEdges If TRUE, all coincident edges of theShape
7617 will be glued, otherwise only the edges,
7618 belonging to theFaces.
7619 theName Object name; when specified, this parameter is used
7620 for result publication in the study. Otherwise, if automatic
7621 publication is switched on, default value is used for result name.
7624 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7626 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7627 doKeepNonSolids, doGlueAllEdges)
7629 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7630 self._autoPublish(anObj, theName, "glueFaces")
7633 ## Replace coincident edges in \a theShapes by one edge.
7634 # @param theShapes Initial shapes, either a list or compound of shapes.
7635 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7636 # @param theName Object name; when specified, this parameter is used
7637 # for result publication in the study. Otherwise, if automatic
7638 # publication is switched on, default value is used for result name.
7640 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7642 # @ref tui_glue_edges "Example"
7643 @ManageTransactions("ShapesOp")
7644 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7646 Replace coincident edges in theShapes by one edge.
7649 theShapes Initial shapes, either a list or compound of shapes.
7650 theTolerance Maximum distance between edges, which can be considered as coincident.
7651 theName Object name; when specified, this parameter is used
7652 for result publication in the study. Otherwise, if automatic
7653 publication is switched on, default value is used for result name.
7656 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7658 theTolerance,Parameters = ParseParameters(theTolerance)
7659 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7661 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7662 anObj.SetParameters(Parameters)
7663 self._autoPublish(anObj, theName, "glueEdges")
7666 ## Find coincident edges in \a theShapes for possible gluing.
7667 # @param theShapes Initial shapes, either a list or compound of shapes.
7668 # @param theTolerance Maximum distance between edges,
7669 # which can be considered as coincident.
7670 # @param theName Object name; when specified, this parameter is used
7671 # for result publication in the study. Otherwise, if automatic
7672 # publication is switched on, default value is used for result name.
7674 # @return GEOM.ListOfGO
7676 # @ref tui_glue_edges "Example"
7677 @ManageTransactions("ShapesOp")
7678 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7680 Find coincident edges in theShapes for possible gluing.
7683 theShapes Initial shapes, either a list or compound of shapes.
7684 theTolerance Maximum distance between edges,
7685 which can be considered as coincident.
7686 theName Object name; when specified, this parameter is used
7687 for result publication in the study. Otherwise, if automatic
7688 publication is switched on, default value is used for result name.
7693 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7694 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7695 self._autoPublish(anObj, theName, "edgesToGlue")
7698 ## Replace coincident edges in theShapes by one edge
7699 # in compliance with given list of edges.
7700 # @param theShapes Initial shapes, either a list or compound of shapes.
7701 # @param theTolerance Maximum distance between edges,
7702 # which can be considered as coincident.
7703 # @param theEdges List of edges for gluing.
7704 # @param theName Object name; when specified, this parameter is used
7705 # for result publication in the study. Otherwise, if automatic
7706 # publication is switched on, default value is used for result name.
7708 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7710 # @ref tui_glue_edges "Example"
7711 @ManageTransactions("ShapesOp")
7712 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7714 Replace coincident edges in theShapes by one edge
7715 in compliance with given list of edges.
7718 theShapes Initial shapes, either a list or compound of shapes.
7719 theTolerance Maximum distance between edges,
7720 which can be considered as coincident.
7721 theEdges List of edges for gluing.
7722 theName Object name; when specified, this parameter is used
7723 for result publication in the study. Otherwise, if automatic
7724 publication is switched on, default value is used for result name.
7727 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7729 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7731 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7732 self._autoPublish(anObj, theName, "glueEdges")
7738 ## @addtogroup l3_boolean Boolean Operations
7741 # -----------------------------------------------------------------------------
7742 # Boolean (Common, Cut, Fuse, Section)
7743 # -----------------------------------------------------------------------------
7745 ## Perform one of boolean operations on two given shapes.
7746 # @param theShape1 First argument for boolean operation.
7747 # @param theShape2 Second argument for boolean operation.
7748 # @param theOperation Indicates the operation to be done:\n
7749 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7750 # @param checkSelfInte The flag that tells if the arguments should
7751 # be checked for self-intersection prior to the operation.
7752 # @param theName Object name; when specified, this parameter is used
7753 # for result publication in the study. Otherwise, if automatic
7754 # publication is switched on, default value is used for result name.
7756 # @note This algorithm doesn't find all types of self-intersections.
7757 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7758 # vertex/face and edge/face intersections. Face/face
7759 # intersections detection is switched off as it is a
7760 # time-consuming operation that gives an impact on performance.
7761 # To find all self-intersections please use
7762 # CheckSelfIntersections() method.
7764 # @return New GEOM.GEOM_Object, containing the result shape.
7766 # @ref tui_fuse "Example"
7767 @ManageTransactions("BoolOp")
7768 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7770 Perform one of boolean operations on two given shapes.
7773 theShape1 First argument for boolean operation.
7774 theShape2 Second argument for boolean operation.
7775 theOperation Indicates the operation to be done:
7776 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7777 checkSelfInte The flag that tells if the arguments should
7778 be checked for self-intersection prior to
7780 theName Object name; when specified, this parameter is used
7781 for result publication in the study. Otherwise, if automatic
7782 publication is switched on, default value is used for result name.
7785 This algorithm doesn't find all types of self-intersections.
7786 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7787 vertex/face and edge/face intersections. Face/face
7788 intersections detection is switched off as it is a
7789 time-consuming operation that gives an impact on performance.
7790 To find all self-intersections please use
7791 CheckSelfIntersections() method.
7794 New GEOM.GEOM_Object, containing the result shape.
7796 # Example: see GEOM_TestAll.py
7797 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7798 RaiseIfFailed("MakeBoolean", self.BoolOp)
7799 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7800 self._autoPublish(anObj, theName, def_names[theOperation])
7803 ## Perform Common boolean operation on two given shapes.
7804 # @param theShape1 First argument for boolean operation.
7805 # @param theShape2 Second argument for boolean operation.
7806 # @param checkSelfInte The flag that tells if the arguments should
7807 # be checked for self-intersection prior to the operation.
7808 # @param theName Object name; when specified, this parameter is used
7809 # for result publication in the study. Otherwise, if automatic
7810 # publication is switched on, default value is used for result name.
7812 # @note This algorithm doesn't find all types of self-intersections.
7813 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7814 # vertex/face and edge/face intersections. Face/face
7815 # intersections detection is switched off as it is a
7816 # time-consuming operation that gives an impact on performance.
7817 # To find all self-intersections please use
7818 # CheckSelfIntersections() method.
7820 # @return New GEOM.GEOM_Object, containing the result shape.
7822 # @ref tui_common "Example 1"
7823 # \n @ref swig_MakeCommon "Example 2"
7824 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7826 Perform Common boolean operation on two given shapes.
7829 theShape1 First argument for boolean operation.
7830 theShape2 Second argument for boolean operation.
7831 checkSelfInte The flag that tells if the arguments should
7832 be checked for self-intersection prior to
7834 theName Object name; when specified, this parameter is used
7835 for result publication in the study. Otherwise, if automatic
7836 publication is switched on, default value is used for result name.
7839 This algorithm doesn't find all types of self-intersections.
7840 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7841 vertex/face and edge/face intersections. Face/face
7842 intersections detection is switched off as it is a
7843 time-consuming operation that gives an impact on performance.
7844 To find all self-intersections please use
7845 CheckSelfIntersections() method.
7848 New GEOM.GEOM_Object, containing the result shape.
7850 # Example: see GEOM_TestOthers.py
7851 # note: auto-publishing is done in self.MakeBoolean()
7852 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7854 ## Perform Cut boolean operation on two given shapes.
7855 # @param theShape1 First argument for boolean operation.
7856 # @param theShape2 Second argument for boolean operation.
7857 # @param checkSelfInte The flag that tells if the arguments should
7858 # be checked for self-intersection prior to the operation.
7859 # @param theName Object name; when specified, this parameter is used
7860 # for result publication in the study. Otherwise, if automatic
7861 # publication is switched on, default value is used for result name.
7863 # @note This algorithm doesn't find all types of self-intersections.
7864 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7865 # vertex/face and edge/face intersections. Face/face
7866 # intersections detection is switched off as it is a
7867 # time-consuming operation that gives an impact on performance.
7868 # To find all self-intersections please use
7869 # CheckSelfIntersections() method.
7871 # @return New GEOM.GEOM_Object, containing the result shape.
7873 # @ref tui_cut "Example 1"
7874 # \n @ref swig_MakeCommon "Example 2"
7875 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7877 Perform Cut boolean operation on two given shapes.
7880 theShape1 First argument for boolean operation.
7881 theShape2 Second argument for boolean operation.
7882 checkSelfInte The flag that tells if the arguments should
7883 be checked for self-intersection prior to
7885 theName Object name; when specified, this parameter is used
7886 for result publication in the study. Otherwise, if automatic
7887 publication is switched on, default value is used for result name.
7890 This algorithm doesn't find all types of self-intersections.
7891 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7892 vertex/face and edge/face intersections. Face/face
7893 intersections detection is switched off as it is a
7894 time-consuming operation that gives an impact on performance.
7895 To find all self-intersections please use
7896 CheckSelfIntersections() method.
7899 New GEOM.GEOM_Object, containing the result shape.
7902 # Example: see GEOM_TestOthers.py
7903 # note: auto-publishing is done in self.MakeBoolean()
7904 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7906 ## Perform Fuse boolean operation on two given shapes.
7907 # @param theShape1 First argument for boolean operation.
7908 # @param theShape2 Second argument for boolean operation.
7909 # @param checkSelfInte The flag that tells if the arguments should
7910 # be checked for self-intersection prior to the operation.
7911 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7912 # operation should be performed during the operation.
7913 # @param theName Object name; when specified, this parameter is used
7914 # for result publication in the study. Otherwise, if automatic
7915 # publication is switched on, default value is used for result name.
7917 # @note This algorithm doesn't find all types of self-intersections.
7918 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7919 # vertex/face and edge/face intersections. Face/face
7920 # intersections detection is switched off as it is a
7921 # time-consuming operation that gives an impact on performance.
7922 # To find all self-intersections please use
7923 # CheckSelfIntersections() method.
7925 # @return New GEOM.GEOM_Object, containing the result shape.
7927 # @ref tui_fuse "Example 1"
7928 # \n @ref swig_MakeCommon "Example 2"
7929 @ManageTransactions("BoolOp")
7930 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7931 rmExtraEdges=False, theName=None):
7933 Perform Fuse boolean operation on two given shapes.
7936 theShape1 First argument for boolean operation.
7937 theShape2 Second argument for boolean operation.
7938 checkSelfInte The flag that tells if the arguments should
7939 be checked for self-intersection prior to
7941 rmExtraEdges The flag that tells if Remove Extra Edges
7942 operation should be performed during the operation.
7943 theName Object name; when specified, this parameter is used
7944 for result publication in the study. Otherwise, if automatic
7945 publication is switched on, default value is used for result name.
7948 This algorithm doesn't find all types of self-intersections.
7949 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7950 vertex/face and edge/face intersections. Face/face
7951 intersections detection is switched off as it is a
7952 time-consuming operation that gives an impact on performance.
7953 To find all self-intersections please use
7954 CheckSelfIntersections() method.
7957 New GEOM.GEOM_Object, containing the result shape.
7960 # Example: see GEOM_TestOthers.py
7961 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7962 checkSelfInte, rmExtraEdges)
7963 RaiseIfFailed("MakeFuse", self.BoolOp)
7964 self._autoPublish(anObj, theName, "fuse")
7967 ## Perform Section boolean operation on two given shapes.
7968 # @param theShape1 First argument for boolean operation.
7969 # @param theShape2 Second argument for boolean operation.
7970 # @param checkSelfInte The flag that tells if the arguments should
7971 # be checked for self-intersection prior to the operation.
7972 # If a self-intersection detected the operation fails.
7973 # @param theName Object name; when specified, this parameter is used
7974 # for result publication in the study. Otherwise, if automatic
7975 # publication is switched on, default value is used for result name.
7976 # @return New GEOM.GEOM_Object, containing the result shape.
7978 # @ref tui_section "Example 1"
7979 # \n @ref swig_MakeCommon "Example 2"
7980 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7982 Perform Section boolean operation on two given shapes.
7985 theShape1 First argument for boolean operation.
7986 theShape2 Second argument for boolean operation.
7987 checkSelfInte The flag that tells if the arguments should
7988 be checked for self-intersection prior to the operation.
7989 If a self-intersection detected the operation fails.
7990 theName Object name; when specified, this parameter is used
7991 for result publication in the study. Otherwise, if automatic
7992 publication is switched on, default value is used for result name.
7994 New GEOM.GEOM_Object, containing the result shape.
7997 # Example: see GEOM_TestOthers.py
7998 # note: auto-publishing is done in self.MakeBoolean()
7999 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
8001 ## Perform Fuse boolean operation on the list of shapes.
8002 # @param theShapesList Shapes to be fused.
8003 # @param checkSelfInte The flag that tells if the arguments should
8004 # be checked for self-intersection prior to the operation.
8005 # @param rmExtraEdges The flag that tells if Remove Extra Edges
8006 # operation should be performed during the operation.
8007 # @param theName Object name; when specified, this parameter is used
8008 # for result publication in the study. Otherwise, if automatic
8009 # publication is switched on, default value is used for result name.
8011 # @note This algorithm doesn't find all types of self-intersections.
8012 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8013 # vertex/face and edge/face intersections. Face/face
8014 # intersections detection is switched off as it is a
8015 # time-consuming operation that gives an impact on performance.
8016 # To find all self-intersections please use
8017 # CheckSelfIntersections() method.
8019 # @return New GEOM.GEOM_Object, containing the result shape.
8021 # @ref tui_fuse "Example 1"
8022 # \n @ref swig_MakeCommon "Example 2"
8023 @ManageTransactions("BoolOp")
8024 def MakeFuseList(self, theShapesList, checkSelfInte=False,
8025 rmExtraEdges=False, theName=None):
8027 Perform Fuse boolean operation on the list of shapes.
8030 theShapesList Shapes to be fused.
8031 checkSelfInte The flag that tells if the arguments should
8032 be checked for self-intersection prior to
8034 rmExtraEdges The flag that tells if Remove Extra Edges
8035 operation should be performed during the operation.
8036 theName Object name; when specified, this parameter is used
8037 for result publication in the study. Otherwise, if automatic
8038 publication is switched on, default value is used for result name.
8041 This algorithm doesn't find all types of self-intersections.
8042 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8043 vertex/face and edge/face intersections. Face/face
8044 intersections detection is switched off as it is a
8045 time-consuming operation that gives an impact on performance.
8046 To find all self-intersections please use
8047 CheckSelfIntersections() method.
8050 New GEOM.GEOM_Object, containing the result shape.
8053 # Example: see GEOM_TestOthers.py
8054 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8056 RaiseIfFailed("MakeFuseList", self.BoolOp)
8057 self._autoPublish(anObj, theName, "fuse")
8060 ## Perform Common boolean operation on the list of shapes.
8061 # @param theShapesList Shapes for Common operation.
8062 # @param checkSelfInte The flag that tells if the arguments should
8063 # be checked for self-intersection prior to the operation.
8064 # @param theName Object name; when specified, this parameter is used
8065 # for result publication in the study. Otherwise, if automatic
8066 # publication is switched on, default value is used for result name.
8068 # @note This algorithm doesn't find all types of self-intersections.
8069 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8070 # vertex/face and edge/face intersections. Face/face
8071 # intersections detection is switched off as it is a
8072 # time-consuming operation that gives an impact on performance.
8073 # To find all self-intersections please use
8074 # CheckSelfIntersections() method.
8076 # @return New GEOM.GEOM_Object, containing the result shape.
8078 # @ref tui_common "Example 1"
8079 # \n @ref swig_MakeCommon "Example 2"
8080 @ManageTransactions("BoolOp")
8081 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8083 Perform Common boolean operation on the list of shapes.
8086 theShapesList Shapes for Common operation.
8087 checkSelfInte The flag that tells if the arguments should
8088 be checked for self-intersection prior to
8090 theName Object name; when specified, this parameter is used
8091 for result publication in the study. Otherwise, if automatic
8092 publication is switched on, default value is used for result name.
8095 This algorithm doesn't find all types of self-intersections.
8096 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8097 vertex/face and edge/face intersections. Face/face
8098 intersections detection is switched off as it is a
8099 time-consuming operation that gives an impact on performance.
8100 To find all self-intersections please use
8101 CheckSelfIntersections() method.
8104 New GEOM.GEOM_Object, containing the result shape.
8107 # Example: see GEOM_TestOthers.py
8108 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8109 RaiseIfFailed("MakeCommonList", self.BoolOp)
8110 self._autoPublish(anObj, theName, "common")
8113 ## Perform Cut boolean operation on one object and the list of tools.
8114 # @param theMainShape The object of the operation.
8115 # @param theShapesList The list of tools of the operation.
8116 # @param checkSelfInte The flag that tells if the arguments should
8117 # be checked for self-intersection prior to the operation.
8118 # @param theName Object name; when specified, this parameter is used
8119 # for result publication in the study. Otherwise, if automatic
8120 # publication is switched on, default value is used for result name.
8122 # @note This algorithm doesn't find all types of self-intersections.
8123 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8124 # vertex/face and edge/face intersections. Face/face
8125 # intersections detection is switched off as it is a
8126 # time-consuming operation that gives an impact on performance.
8127 # To find all self-intersections please use
8128 # CheckSelfIntersections() method.
8130 # @return New GEOM.GEOM_Object, containing the result shape.
8132 # @ref tui_cut "Example 1"
8133 # \n @ref swig_MakeCommon "Example 2"
8134 @ManageTransactions("BoolOp")
8135 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8137 Perform Cut boolean operation on one object and the list of tools.
8140 theMainShape The object of the operation.
8141 theShapesList The list of tools of the operation.
8142 checkSelfInte The flag that tells if the arguments should
8143 be checked for self-intersection prior to
8145 theName Object name; when specified, this parameter is used
8146 for result publication in the study. Otherwise, if automatic
8147 publication is switched on, default value is used for result name.
8150 This algorithm doesn't find all types of self-intersections.
8151 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8152 vertex/face and edge/face intersections. Face/face
8153 intersections detection is switched off as it is a
8154 time-consuming operation that gives an impact on performance.
8155 To find all self-intersections please use
8156 CheckSelfIntersections() method.
8159 New GEOM.GEOM_Object, containing the result shape.
8162 # Example: see GEOM_TestOthers.py
8163 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8164 RaiseIfFailed("MakeCutList", self.BoolOp)
8165 self._autoPublish(anObj, theName, "cut")
8171 ## @addtogroup l3_basic_op
8174 ## Perform partition operation.
8175 # @param ListShapes Shapes to be intersected.
8176 # @param ListTools Shapes to intersect theShapes.
8177 # @param Limit Type of resulting shapes (see ShapeType()).\n
8178 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8179 # type will be detected automatically.
8180 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8181 # target type (equal to Limit) are kept in the result,
8182 # else standalone shapes of lower dimension
8183 # are kept also (if they exist).
8185 # @param theName Object name; when specified, this parameter is used
8186 # for result publication in the study. Otherwise, if automatic
8187 # publication is switched on, default value is used for result name.
8189 # @note Each compound from ListShapes and ListTools will be exploded
8190 # in order to avoid possible intersection between shapes from this compound.
8192 # After implementation new version of PartitionAlgo (October 2006)
8193 # other parameters are ignored by current functionality. They are kept
8194 # in this function only for support old versions.
8195 # @param ListKeepInside Shapes, outside which the results will be deleted.
8196 # Each shape from theKeepInside must belong to theShapes also.
8197 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8198 # Each shape from theRemoveInside must belong to theShapes also.
8199 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8200 # @param ListMaterials Material indices for each shape. Make sense,
8201 # only if theRemoveWebs is TRUE.
8203 # @return New GEOM.GEOM_Object, containing the result shapes.
8205 # @ref tui_partition "Example"
8206 @ManageTransactions("BoolOp")
8207 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8208 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8209 KeepNonlimitShapes=0, theName=None):
8211 Perform partition operation.
8214 ListShapes Shapes to be intersected.
8215 ListTools Shapes to intersect theShapes.
8216 Limit Type of resulting shapes (see geompy.ShapeType)
8217 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8218 type will be detected automatically.
8219 KeepNonlimitShapes if this parameter == 0, then only shapes of
8220 target type (equal to Limit) are kept in the result,
8221 else standalone shapes of lower dimension
8222 are kept also (if they exist).
8224 theName Object name; when specified, this parameter is used
8225 for result publication in the study. Otherwise, if automatic
8226 publication is switched on, default value is used for result name.
8228 Each compound from ListShapes and ListTools will be exploded
8229 in order to avoid possible intersection between shapes from
8232 After implementation new version of PartitionAlgo (October 2006) other
8233 parameters are ignored by current functionality. They are kept in this
8234 function only for support old versions.
8237 ListKeepInside Shapes, outside which the results will be deleted.
8238 Each shape from theKeepInside must belong to theShapes also.
8239 ListRemoveInside Shapes, inside which the results will be deleted.
8240 Each shape from theRemoveInside must belong to theShapes also.
8241 RemoveWebs If TRUE, perform Glue 3D algorithm.
8242 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8245 New GEOM.GEOM_Object, containing the result shapes.
8247 # Example: see GEOM_TestAll.py
8248 if Limit == self.ShapeType["AUTO"]:
8249 # automatic detection of the most appropriate shape limit type
8251 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8252 Limit = EnumToLong(lim)
8254 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8255 ListKeepInside, ListRemoveInside,
8256 Limit, RemoveWebs, ListMaterials,
8257 KeepNonlimitShapes);
8258 RaiseIfFailed("MakePartition", self.BoolOp)
8259 self._autoPublish(anObj, theName, "partition")
8262 ## Perform partition operation.
8263 # This method may be useful if it is needed to make a partition for
8264 # compound contains nonintersected shapes. Performance will be better
8265 # since intersection between shapes from compound is not performed.
8267 # Description of all parameters as in previous method MakePartition().
8268 # One additional parameter is provided:
8269 # @param checkSelfInte The flag that tells if the arguments should
8270 # be checked for self-intersection prior to the operation.
8272 # @note This algorithm doesn't find all types of self-intersections.
8273 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8274 # vertex/face and edge/face intersections. Face/face
8275 # intersections detection is switched off as it is a
8276 # time-consuming operation that gives an impact on performance.
8277 # To find all self-intersections please use
8278 # CheckSelfIntersections() method.
8280 # @note Passed compounds (via ListShapes or via ListTools)
8281 # have to consist of nonintersecting shapes.
8283 # @return New GEOM.GEOM_Object, containing the result shapes.
8285 # @ref swig_todo "Example"
8286 @ManageTransactions("BoolOp")
8287 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8288 ListKeepInside=[], ListRemoveInside=[],
8289 Limit=ShapeType["AUTO"], RemoveWebs=0,
8290 ListMaterials=[], KeepNonlimitShapes=0,
8291 checkSelfInte=False, theName=None):
8293 Perform partition operation.
8294 This method may be useful if it is needed to make a partition for
8295 compound contains nonintersected shapes. Performance will be better
8296 since intersection between shapes from compound is not performed.
8299 Description of all parameters as in method geompy.MakePartition.
8300 One additional parameter is provided:
8301 checkSelfInte The flag that tells if the arguments should
8302 be checked for self-intersection prior to
8306 This algorithm doesn't find all types of self-intersections.
8307 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8308 vertex/face and edge/face intersections. Face/face
8309 intersections detection is switched off as it is a
8310 time-consuming operation that gives an impact on performance.
8311 To find all self-intersections please use
8312 CheckSelfIntersections() method.
8315 Passed compounds (via ListShapes or via ListTools)
8316 have to consist of nonintersecting shapes.
8319 New GEOM.GEOM_Object, containing the result shapes.
8321 if Limit == self.ShapeType["AUTO"]:
8322 # automatic detection of the most appropriate shape limit type
8324 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8325 Limit = EnumToLong(lim)
8327 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8328 ListKeepInside, ListRemoveInside,
8329 Limit, RemoveWebs, ListMaterials,
8330 KeepNonlimitShapes, checkSelfInte);
8331 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8332 self._autoPublish(anObj, theName, "partition")
8335 ## See method MakePartition() for more information.
8337 # @ref tui_partition "Example 1"
8338 # \n @ref swig_Partition "Example 2"
8339 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8340 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8341 KeepNonlimitShapes=0, theName=None):
8343 See method geompy.MakePartition for more information.
8345 # Example: see GEOM_TestOthers.py
8346 # note: auto-publishing is done in self.MakePartition()
8347 anObj = self.MakePartition(ListShapes, ListTools,
8348 ListKeepInside, ListRemoveInside,
8349 Limit, RemoveWebs, ListMaterials,
8350 KeepNonlimitShapes, theName);
8353 ## Perform partition of the Shape with the Plane
8354 # @param theShape Shape to be intersected.
8355 # @param thePlane Tool shape, to intersect theShape.
8356 # @param theName Object name; when specified, this parameter is used
8357 # for result publication in the study. Otherwise, if automatic
8358 # publication is switched on, default value is used for result name.
8360 # @return New GEOM.GEOM_Object, containing the result shape.
8362 # @note This operation is a shortcut to the more general @ref MakePartition
8363 # operation, where @a theShape specifies single "object" (shape being partitioned)
8364 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8365 # @ref MakePartition operation have default values:
8366 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8367 # - @a KeepNonlimitShapes: 0
8368 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8369 # @a Materials (obsolete parameters): empty
8371 # @note I.e. the following two operations are equivalent:
8373 # Result = geompy.MakeHalfPartition(Object, Plane)
8374 # Result = geompy.MakePartition([Object], [Plane])
8377 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8379 # @ref tui_partition "Example"
8380 @ManageTransactions("BoolOp")
8381 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8383 Perform partition of the Shape with the Plane
8386 theShape Shape to be intersected.
8387 thePlane Tool shape, to intersect theShape.
8388 theName Object name; when specified, this parameter is used
8389 for result publication in the study. Otherwise, if automatic
8390 publication is switched on, default value is used for result name.
8393 New GEOM.GEOM_Object, containing the result shape.
8395 Note: This operation is a shortcut to the more general MakePartition
8396 operation, where theShape specifies single "object" (shape being partitioned)
8397 and thePlane specifies single "tool" (intersector shape). Other parameters of
8398 MakePartition operation have default values:
8399 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8400 - KeepNonlimitShapes: 0
8401 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8403 I.e. the following two operations are equivalent:
8404 Result = geompy.MakeHalfPartition(Object, Plane)
8405 Result = geompy.MakePartition([Object], [Plane])
8407 # Example: see GEOM_TestAll.py
8408 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8409 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8410 self._autoPublish(anObj, theName, "partition")
8413 # end of l3_basic_op
8416 ## @addtogroup l3_transform
8419 ## Translate the given object along the vector, specified
8420 # by its end points.
8421 # @param theObject The object to be translated.
8422 # @param thePoint1 Start point of translation vector.
8423 # @param thePoint2 End point of translation vector.
8424 # @param theCopy Flag used to translate object itself or create a copy.
8425 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8426 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8427 @ManageTransactions("TrsfOp")
8428 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8430 Translate the given object along the vector, specified by its end points.
8433 theObject The object to be translated.
8434 thePoint1 Start point of translation vector.
8435 thePoint2 End point of translation vector.
8436 theCopy Flag used to translate object itself or create a copy.
8439 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8440 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8443 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8445 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8446 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8449 ## Translate the given object along the vector, specified
8450 # by its end points, creating its copy before the translation.
8451 # @param theObject The object to be translated.
8452 # @param thePoint1 Start point of translation vector.
8453 # @param thePoint2 End point of translation vector.
8454 # @param theName Object name; when specified, this parameter is used
8455 # for result publication in the study. Otherwise, if automatic
8456 # publication is switched on, default value is used for result name.
8458 # @return New GEOM.GEOM_Object, containing the translated object.
8460 # @ref tui_translation "Example 1"
8461 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8462 @ManageTransactions("TrsfOp")
8463 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8465 Translate the given object along the vector, specified
8466 by its end points, creating its copy before the translation.
8469 theObject The object to be translated.
8470 thePoint1 Start point of translation vector.
8471 thePoint2 End point of translation vector.
8472 theName Object name; when specified, this parameter is used
8473 for result publication in the study. Otherwise, if automatic
8474 publication is switched on, default value is used for result name.
8477 New GEOM.GEOM_Object, containing the translated object.
8479 # Example: see GEOM_TestAll.py
8480 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8481 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8482 self._autoPublish(anObj, theName, "translated")
8485 ## Translate the given object along the vector, specified by its components.
8486 # @param theObject The object to be translated.
8487 # @param theDX,theDY,theDZ Components of translation vector.
8488 # @param theCopy Flag used to translate object itself or create a copy.
8489 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8490 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8492 # @ref tui_translation "Example"
8493 @ManageTransactions("TrsfOp")
8494 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8496 Translate the given object along the vector, specified by its components.
8499 theObject The object to be translated.
8500 theDX,theDY,theDZ Components of translation vector.
8501 theCopy Flag used to translate object itself or create a copy.
8504 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8505 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8507 # Example: see GEOM_TestAll.py
8508 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8510 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8512 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8513 anObj.SetParameters(Parameters)
8514 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8517 ## Translate the given object along the vector, specified
8518 # by its components, creating its copy before the translation.
8519 # @param theObject The object to be translated.
8520 # @param theDX,theDY,theDZ Components of translation vector.
8521 # @param theName Object name; when specified, this parameter is used
8522 # for result publication in the study. Otherwise, if automatic
8523 # publication is switched on, default value is used for result name.
8525 # @return New GEOM.GEOM_Object, containing the translated object.
8527 # @ref tui_translation "Example"
8528 @ManageTransactions("TrsfOp")
8529 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8531 Translate the given object along the vector, specified
8532 by its components, creating its copy before the translation.
8535 theObject The object to be translated.
8536 theDX,theDY,theDZ Components of translation vector.
8537 theName Object name; when specified, this parameter is used
8538 for result publication in the study. Otherwise, if automatic
8539 publication is switched on, default value is used for result name.
8542 New GEOM.GEOM_Object, containing the translated object.
8544 # Example: see GEOM_TestAll.py
8545 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8546 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8547 anObj.SetParameters(Parameters)
8548 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8549 self._autoPublish(anObj, theName, "translated")
8552 ## Translate the given object along the given vector.
8553 # @param theObject The object to be translated.
8554 # @param theVector The translation vector.
8555 # @param theCopy Flag used to translate object itself or create a copy.
8556 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8557 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8558 @ManageTransactions("TrsfOp")
8559 def TranslateVector(self, theObject, theVector, theCopy=False):
8561 Translate the given object along the given vector.
8564 theObject The object to be translated.
8565 theVector The translation vector.
8566 theCopy Flag used to translate object itself or create a copy.
8569 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8570 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8573 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8575 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8576 RaiseIfFailed("TranslateVector", self.TrsfOp)
8579 ## Translate the given object along the given vector,
8580 # creating its copy before the translation.
8581 # @param theObject The object to be translated.
8582 # @param theVector The translation vector.
8583 # @param theName Object name; when specified, this parameter is used
8584 # for result publication in the study. Otherwise, if automatic
8585 # publication is switched on, default value is used for result name.
8587 # @return New GEOM.GEOM_Object, containing the translated object.
8589 # @ref tui_translation "Example"
8590 @ManageTransactions("TrsfOp")
8591 def MakeTranslationVector(self, theObject, theVector, theName=None):
8593 Translate the given object along the given vector,
8594 creating its copy before the translation.
8597 theObject The object to be translated.
8598 theVector The translation vector.
8599 theName Object name; when specified, this parameter is used
8600 for result publication in the study. Otherwise, if automatic
8601 publication is switched on, default value is used for result name.
8604 New GEOM.GEOM_Object, containing the translated object.
8606 # Example: see GEOM_TestAll.py
8607 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8608 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8609 self._autoPublish(anObj, theName, "translated")
8612 ## Translate the given object along the given vector on given distance.
8613 # @param theObject The object to be translated.
8614 # @param theVector The translation vector.
8615 # @param theDistance The translation distance.
8616 # @param theCopy Flag used to translate object itself or create a copy.
8617 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8618 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8620 # @ref tui_translation "Example"
8621 @ManageTransactions("TrsfOp")
8622 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8624 Translate the given object along the given vector on given distance.
8627 theObject The object to be translated.
8628 theVector The translation vector.
8629 theDistance The translation distance.
8630 theCopy Flag used to translate object itself or create a copy.
8633 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8634 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8636 # Example: see GEOM_TestAll.py
8637 theDistance,Parameters = ParseParameters(theDistance)
8638 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8639 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8640 anObj.SetParameters(Parameters)
8643 ## Translate the given object along the given vector on given distance,
8644 # creating its copy before the translation.
8645 # @param theObject The object to be translated.
8646 # @param theVector The translation vector.
8647 # @param theDistance The translation distance.
8648 # @param theName Object name; when specified, this parameter is used
8649 # for result publication in the study. Otherwise, if automatic
8650 # publication is switched on, default value is used for result name.
8652 # @return New GEOM.GEOM_Object, containing the translated object.
8654 # @ref tui_translation "Example"
8655 @ManageTransactions("TrsfOp")
8656 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8658 Translate the given object along the given vector on given distance,
8659 creating its copy before the translation.
8662 theObject The object to be translated.
8663 theVector The translation vector.
8664 theDistance The translation distance.
8665 theName Object name; when specified, this parameter is used
8666 for result publication in the study. Otherwise, if automatic
8667 publication is switched on, default value is used for result name.
8670 New GEOM.GEOM_Object, containing the translated object.
8672 # Example: see GEOM_TestAll.py
8673 theDistance,Parameters = ParseParameters(theDistance)
8674 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8675 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8676 anObj.SetParameters(Parameters)
8677 self._autoPublish(anObj, theName, "translated")
8680 ## Rotate the given object around the given axis on the given angle.
8681 # @param theObject The object to be rotated.
8682 # @param theAxis Rotation axis.
8683 # @param theAngle Rotation angle in radians.
8684 # @param theCopy Flag used to rotate object itself or create a copy.
8686 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8687 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8689 # @ref tui_rotation "Example"
8690 @ManageTransactions("TrsfOp")
8691 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8693 Rotate the given object around the given axis on the given angle.
8696 theObject The object to be rotated.
8697 theAxis Rotation axis.
8698 theAngle Rotation angle in radians.
8699 theCopy Flag used to rotate object itself or create a copy.
8702 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8703 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8705 # Example: see GEOM_TestAll.py
8707 if isinstance(theAngle,str):
8709 theAngle, Parameters = ParseParameters(theAngle)
8711 theAngle = theAngle*math.pi/180.0
8713 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8715 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8716 RaiseIfFailed("Rotate", self.TrsfOp)
8717 anObj.SetParameters(Parameters)
8720 ## Rotate the given object around the given axis
8721 # on the given angle, creating its copy before the rotation.
8722 # @param theObject The object to be rotated.
8723 # @param theAxis Rotation axis.
8724 # @param theAngle Rotation angle in radians.
8725 # @param theName Object name; when specified, this parameter is used
8726 # for result publication in the study. Otherwise, if automatic
8727 # publication is switched on, default value is used for result name.
8729 # @return New GEOM.GEOM_Object, containing the rotated object.
8731 # @ref tui_rotation "Example"
8732 @ManageTransactions("TrsfOp")
8733 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8735 Rotate the given object around the given axis
8736 on the given angle, creating its copy before the rotatation.
8739 theObject The object to be rotated.
8740 theAxis Rotation axis.
8741 theAngle Rotation angle in radians.
8742 theName Object name; when specified, this parameter is used
8743 for result publication in the study. Otherwise, if automatic
8744 publication is switched on, default value is used for result name.
8747 New GEOM.GEOM_Object, containing the rotated object.
8749 # Example: see GEOM_TestAll.py
8751 if isinstance(theAngle,str):
8753 theAngle, Parameters = ParseParameters(theAngle)
8755 theAngle = theAngle*math.pi/180.0
8756 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8757 RaiseIfFailed("RotateCopy", self.TrsfOp)
8758 anObj.SetParameters(Parameters)
8759 self._autoPublish(anObj, theName, "rotated")
8762 ## Rotate given object around vector perpendicular to plane
8763 # containing three points.
8764 # @param theObject The object to be rotated.
8765 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8766 # containing the three points.
8767 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8768 # @param theCopy Flag used to rotate object itself or create a copy.
8769 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8770 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8771 @ManageTransactions("TrsfOp")
8772 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8774 Rotate given object around vector perpendicular to plane
8775 containing three points.
8778 theObject The object to be rotated.
8779 theCentPoint central point the axis is the vector perpendicular to the plane
8780 containing the three points.
8781 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8782 theCopy Flag used to rotate object itself or create a copy.
8785 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8786 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8789 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8791 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8792 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8795 ## Rotate given object around vector perpendicular to plane
8796 # containing three points, creating its copy before the rotatation.
8797 # @param theObject The object to be rotated.
8798 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8799 # containing the three points.
8800 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8801 # @param theName Object name; when specified, this parameter is used
8802 # for result publication in the study. Otherwise, if automatic
8803 # publication is switched on, default value is used for result name.
8805 # @return New GEOM.GEOM_Object, containing the rotated object.
8807 # @ref tui_rotation "Example"
8808 @ManageTransactions("TrsfOp")
8809 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8811 Rotate given object around vector perpendicular to plane
8812 containing three points, creating its copy before the rotatation.
8815 theObject The object to be rotated.
8816 theCentPoint central point the axis is the vector perpendicular to the plane
8817 containing the three points.
8818 thePoint1,thePoint2 in a perpendicular plane of the axis.
8819 theName Object name; when specified, this parameter is used
8820 for result publication in the study. Otherwise, if automatic
8821 publication is switched on, default value is used for result name.
8824 New GEOM.GEOM_Object, containing the rotated object.
8826 # Example: see GEOM_TestAll.py
8827 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8828 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8829 self._autoPublish(anObj, theName, "rotated")
8832 ## Scale the given object by the specified factor.
8833 # @param theObject The object to be scaled.
8834 # @param thePoint Center point for scaling.
8835 # Passing None for it means scaling relatively the origin of global CS.
8836 # @param theFactor Scaling factor value.
8837 # @param theCopy Flag used to scale object itself or create a copy.
8838 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8839 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8840 @ManageTransactions("TrsfOp")
8841 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8843 Scale the given object by the specified factor.
8846 theObject The object to be scaled.
8847 thePoint Center point for scaling.
8848 Passing None for it means scaling relatively the origin of global CS.
8849 theFactor Scaling factor value.
8850 theCopy Flag used to scale object itself or create a copy.
8853 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8854 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8856 # Example: see GEOM_TestAll.py
8857 theFactor, Parameters = ParseParameters(theFactor)
8859 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8861 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8862 RaiseIfFailed("Scale", self.TrsfOp)
8863 anObj.SetParameters(Parameters)
8866 ## Scale the given object by the factor, creating its copy before the scaling.
8867 # @param theObject The object to be scaled.
8868 # @param thePoint Center point for scaling.
8869 # Passing None for it means scaling relatively the origin of global CS.
8870 # @param theFactor Scaling factor value.
8871 # @param theName Object name; when specified, this parameter is used
8872 # for result publication in the study. Otherwise, if automatic
8873 # publication is switched on, default value is used for result name.
8875 # @return New GEOM.GEOM_Object, containing the scaled shape.
8877 # @ref tui_scale "Example"
8878 @ManageTransactions("TrsfOp")
8879 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8881 Scale the given object by the factor, creating its copy before the scaling.
8884 theObject The object to be scaled.
8885 thePoint Center point for scaling.
8886 Passing None for it means scaling relatively the origin of global CS.
8887 theFactor Scaling factor value.
8888 theName Object name; when specified, this parameter is used
8889 for result publication in the study. Otherwise, if automatic
8890 publication is switched on, default value is used for result name.
8893 New GEOM.GEOM_Object, containing the scaled shape.
8895 # Example: see GEOM_TestAll.py
8896 theFactor, Parameters = ParseParameters(theFactor)
8897 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8898 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8899 anObj.SetParameters(Parameters)
8900 self._autoPublish(anObj, theName, "scaled")
8903 ## Scale the given object by different factors along coordinate axes.
8904 # @param theObject The object to be scaled.
8905 # @param thePoint Center point for scaling.
8906 # Passing None for it means scaling relatively the origin of global CS.
8907 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8908 # @param theCopy Flag used to scale object itself or create a copy.
8909 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8910 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8911 @ManageTransactions("TrsfOp")
8912 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8914 Scale the given object by different factors along coordinate axes.
8917 theObject The object to be scaled.
8918 thePoint Center point for scaling.
8919 Passing None for it means scaling relatively the origin of global CS.
8920 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8921 theCopy Flag used to scale object itself or create a copy.
8924 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8925 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8927 # Example: see GEOM_TestAll.py
8928 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8930 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8931 theFactorX, theFactorY, theFactorZ)
8933 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8934 theFactorX, theFactorY, theFactorZ)
8935 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8936 anObj.SetParameters(Parameters)
8939 ## Scale the given object by different factors along coordinate axes,
8940 # creating its copy before the scaling.
8941 # @param theObject The object to be scaled.
8942 # @param thePoint Center point for scaling.
8943 # Passing None for it means scaling relatively the origin of global CS.
8944 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8945 # @param theName Object name; when specified, this parameter is used
8946 # for result publication in the study. Otherwise, if automatic
8947 # publication is switched on, default value is used for result name.
8949 # @return New GEOM.GEOM_Object, containing the scaled shape.
8951 # @ref swig_scale "Example"
8952 @ManageTransactions("TrsfOp")
8953 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8955 Scale the given object by different factors along coordinate axes,
8956 creating its copy before the scaling.
8959 theObject The object to be scaled.
8960 thePoint Center point for scaling.
8961 Passing None for it means scaling relatively the origin of global CS.
8962 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8963 theName Object name; when specified, this parameter is used
8964 for result publication in the study. Otherwise, if automatic
8965 publication is switched on, default value is used for result name.
8968 New GEOM.GEOM_Object, containing the scaled shape.
8970 # Example: see GEOM_TestAll.py
8971 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8972 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8973 theFactorX, theFactorY, theFactorZ)
8974 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8975 anObj.SetParameters(Parameters)
8976 self._autoPublish(anObj, theName, "scaled")
8979 ## Mirror an object relatively the given plane.
8980 # @param theObject The object to be mirrored.
8981 # @param thePlane Plane of symmetry.
8982 # @param theCopy Flag used to mirror object itself or create a copy.
8983 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8984 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8985 @ManageTransactions("TrsfOp")
8986 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8988 Mirror an object relatively the given plane.
8991 theObject The object to be mirrored.
8992 thePlane Plane of symmetry.
8993 theCopy Flag used to mirror object itself or create a copy.
8996 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8997 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9000 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9002 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
9003 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
9006 ## Create an object, symmetrical
9007 # to the given one relatively the given plane.
9008 # @param theObject The object to be mirrored.
9009 # @param thePlane Plane of symmetry.
9010 # @param theName Object name; when specified, this parameter is used
9011 # for result publication in the study. Otherwise, if automatic
9012 # publication is switched on, default value is used for result name.
9014 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9016 # @ref tui_mirror "Example"
9017 @ManageTransactions("TrsfOp")
9018 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9020 Create an object, symmetrical to the given one relatively the given plane.
9023 theObject The object to be mirrored.
9024 thePlane Plane of symmetry.
9025 theName Object name; when specified, this parameter is used
9026 for result publication in the study. Otherwise, if automatic
9027 publication is switched on, default value is used for result name.
9030 New GEOM.GEOM_Object, containing the mirrored shape.
9032 # Example: see GEOM_TestAll.py
9033 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9034 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9035 self._autoPublish(anObj, theName, "mirrored")
9038 ## Mirror an object relatively the given axis.
9039 # @param theObject The object to be mirrored.
9040 # @param theAxis Axis of symmetry.
9041 # @param theCopy Flag used to mirror object itself or create a copy.
9042 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9043 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9044 @ManageTransactions("TrsfOp")
9045 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9047 Mirror an object relatively the given axis.
9050 theObject The object to be mirrored.
9051 theAxis Axis of symmetry.
9052 theCopy Flag used to mirror object itself or create a copy.
9055 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9056 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9059 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9061 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9062 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9065 ## Create an object, symmetrical
9066 # to the given one relatively the given axis.
9067 # @param theObject The object to be mirrored.
9068 # @param theAxis Axis of symmetry.
9069 # @param theName Object name; when specified, this parameter is used
9070 # for result publication in the study. Otherwise, if automatic
9071 # publication is switched on, default value is used for result name.
9073 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9075 # @ref tui_mirror "Example"
9076 @ManageTransactions("TrsfOp")
9077 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9079 Create an object, symmetrical to the given one relatively the given axis.
9082 theObject The object to be mirrored.
9083 theAxis Axis of symmetry.
9084 theName Object name; when specified, this parameter is used
9085 for result publication in the study. Otherwise, if automatic
9086 publication is switched on, default value is used for result name.
9089 New GEOM.GEOM_Object, containing the mirrored shape.
9091 # Example: see GEOM_TestAll.py
9092 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9093 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9094 self._autoPublish(anObj, theName, "mirrored")
9097 ## Mirror an object relatively the given point.
9098 # @param theObject The object to be mirrored.
9099 # @param thePoint Point of symmetry.
9100 # @param theCopy Flag used to mirror object itself or create a copy.
9101 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9102 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9103 @ManageTransactions("TrsfOp")
9104 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9106 Mirror an object relatively the given point.
9109 theObject The object to be mirrored.
9110 thePoint Point of symmetry.
9111 theCopy Flag used to mirror object itself or create a copy.
9114 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9115 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9117 # Example: see GEOM_TestAll.py
9119 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9121 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9122 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9125 ## Create an object, symmetrical
9126 # to the given one relatively the given point.
9127 # @param theObject The object to be mirrored.
9128 # @param thePoint Point of symmetry.
9129 # @param theName Object name; when specified, this parameter is used
9130 # for result publication in the study. Otherwise, if automatic
9131 # publication is switched on, default value is used for result name.
9133 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9135 # @ref tui_mirror "Example"
9136 @ManageTransactions("TrsfOp")
9137 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9139 Create an object, symmetrical
9140 to the given one relatively the given point.
9143 theObject The object to be mirrored.
9144 thePoint Point of symmetry.
9145 theName Object name; when specified, this parameter is used
9146 for result publication in the study. Otherwise, if automatic
9147 publication is switched on, default value is used for result name.
9150 New GEOM.GEOM_Object, containing the mirrored shape.
9152 # Example: see GEOM_TestAll.py
9153 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9154 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9155 self._autoPublish(anObj, theName, "mirrored")
9158 ## Modify the location of the given object.
9159 # @param theObject The object to be displaced.
9160 # @param theStartLCS Coordinate system to perform displacement from it.\n
9161 # If \a theStartLCS is NULL, displacement
9162 # will be performed from global CS.\n
9163 # If \a theObject itself is used as \a theStartLCS,
9164 # its location will be changed to \a theEndLCS.
9165 # @param theEndLCS Coordinate system to perform displacement to it.
9166 # @param theCopy Flag used to displace object itself or create a copy.
9167 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9168 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9169 @ManageTransactions("TrsfOp")
9170 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9172 Modify the Location of the given object by LCS, creating its copy before the setting.
9175 theObject The object to be displaced.
9176 theStartLCS Coordinate system to perform displacement from it.
9177 If theStartLCS is NULL, displacement
9178 will be performed from global CS.
9179 If theObject itself is used as theStartLCS,
9180 its location will be changed to theEndLCS.
9181 theEndLCS Coordinate system to perform displacement to it.
9182 theCopy Flag used to displace object itself or create a copy.
9185 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9186 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9188 # Example: see GEOM_TestAll.py
9190 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9192 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9193 RaiseIfFailed("Displace", self.TrsfOp)
9196 ## Modify the Location of the given object by LCS,
9197 # creating its copy before the setting.
9198 # @param theObject The object to be displaced.
9199 # @param theStartLCS Coordinate system to perform displacement from it.\n
9200 # If \a theStartLCS is NULL, displacement
9201 # will be performed from global CS.\n
9202 # If \a theObject itself is used as \a theStartLCS,
9203 # its location will be changed to \a theEndLCS.
9204 # @param theEndLCS Coordinate system to perform displacement to it.
9205 # @param theName Object name; when specified, this parameter is used
9206 # for result publication in the study. Otherwise, if automatic
9207 # publication is switched on, default value is used for result name.
9209 # @return New GEOM.GEOM_Object, containing the displaced shape.
9211 # @ref tui_modify_location "Example"
9212 @ManageTransactions("TrsfOp")
9213 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9215 Modify the Location of the given object by LCS, creating its copy before the setting.
9218 theObject The object to be displaced.
9219 theStartLCS Coordinate system to perform displacement from it.
9220 If theStartLCS is NULL, displacement
9221 will be performed from global CS.
9222 If theObject itself is used as theStartLCS,
9223 its location will be changed to theEndLCS.
9224 theEndLCS Coordinate system to perform displacement to it.
9225 theName Object name; when specified, this parameter is used
9226 for result publication in the study. Otherwise, if automatic
9227 publication is switched on, default value is used for result name.
9230 New GEOM.GEOM_Object, containing the displaced shape.
9233 # create local coordinate systems
9234 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9235 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9236 # modify the location of the given object
9237 position = geompy.MakePosition(cylinder, cs1, cs2)
9239 # Example: see GEOM_TestAll.py
9240 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9241 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9242 self._autoPublish(anObj, theName, "displaced")
9245 ## Modify the Location of the given object by Path.
9246 # @param theObject The object to be displaced.
9247 # @param thePath Wire or Edge along that the object will be translated.
9248 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9249 # @param theCopy is to create a copy objects if true.
9250 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9251 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9252 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9254 # @ref tui_modify_location "Example"
9255 @ManageTransactions("TrsfOp")
9256 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9258 Modify the Location of the given object by Path.
9261 theObject The object to be displaced.
9262 thePath Wire or Edge along that the object will be translated.
9263 theDistance progress of Path (0 = start location, 1 = end of path location).
9264 theCopy is to create a copy objects if true.
9265 theReverse 0 - for usual direction, 1 - to reverse path direction.
9268 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9269 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9272 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9274 # Example: see GEOM_TestAll.py
9275 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9276 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9279 ## Modify the Location of the given object by Path, creating its copy before the operation.
9280 # @param theObject The object to be displaced.
9281 # @param thePath Wire or Edge along that the object will be translated.
9282 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9283 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9284 # @param theName Object name; when specified, this parameter is used
9285 # for result publication in the study. Otherwise, if automatic
9286 # publication is switched on, default value is used for result name.
9288 # @return New GEOM.GEOM_Object, containing the displaced shape.
9289 @ManageTransactions("TrsfOp")
9290 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9292 Modify the Location of the given object by Path, creating its copy before the operation.
9295 theObject The object to be displaced.
9296 thePath Wire or Edge along that the object will be translated.
9297 theDistance progress of Path (0 = start location, 1 = end of path location).
9298 theReverse 0 - for usual direction, 1 - to reverse path direction.
9299 theName Object name; when specified, this parameter is used
9300 for result publication in the study. Otherwise, if automatic
9301 publication is switched on, default value is used for result name.
9304 New GEOM.GEOM_Object, containing the displaced shape.
9306 # Example: see GEOM_TestAll.py
9307 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9308 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9309 self._autoPublish(anObj, theName, "displaced")
9312 ## Offset given shape.
9313 # @param theObject The base object for the offset.
9314 # @param theOffset Offset value.
9315 # @param theCopy Flag used to offset object itself or create a copy.
9316 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9317 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9318 @ManageTransactions("TrsfOp")
9319 def Offset(self, theObject, theOffset, theCopy=False):
9324 theObject The base object for the offset.
9325 theOffset Offset value.
9326 theCopy Flag used to offset object itself or create a copy.
9329 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9330 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9332 theOffset, Parameters = ParseParameters(theOffset)
9334 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9336 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9337 RaiseIfFailed("Offset", self.TrsfOp)
9338 anObj.SetParameters(Parameters)
9341 ## Create new object as offset of the given one. Gap between two adjacent
9342 # offset surfaces is filled by a pipe.
9343 # @param theObject The base object for the offset.
9344 # @param theOffset Offset value.
9345 # @param theName Object name; when specified, this parameter is used
9346 # for result publication in the study. Otherwise, if automatic
9347 # publication is switched on, default value is used for result name.
9349 # @return New GEOM.GEOM_Object, containing the offset object.
9351 # @sa MakeOffsetIntersectionJoin
9352 # @ref tui_offset "Example"
9353 @ManageTransactions("TrsfOp")
9354 def MakeOffset(self, theObject, theOffset, theName=None):
9356 Create new object as offset of the given one. Gap between adjacent
9357 offset surfaces is filled by a pipe.
9360 theObject The base object for the offset.
9361 theOffset Offset value.
9362 theName Object name; when specified, this parameter is used
9363 for result publication in the study. Otherwise, if automatic
9364 publication is switched on, default value is used for result name.
9367 New GEOM.GEOM_Object, containing the offset object.
9370 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9371 # create a new object as offset of the given object
9372 offset = geompy.MakeOffset(box, 70.)
9374 # Example: see GEOM_TestAll.py
9375 theOffset, Parameters = ParseParameters(theOffset)
9376 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9377 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9378 anObj.SetParameters(Parameters)
9379 self._autoPublish(anObj, theName, "offset")
9382 ## Create new object as offset of the given one. Gap between adjacent
9383 # offset surfaces is filled by extending and intersecting them.
9384 # @param theObject The base object for the offset.
9385 # @param theOffset Offset value.
9386 # @param theName Object name; when specified, this parameter is used
9387 # for result publication in the study. Otherwise, if automatic
9388 # publication is switched on, default value is used for result name.
9390 # @return New GEOM.GEOM_Object, containing the offset object.
9393 # @ref tui_offset "Example"
9394 @ManageTransactions("TrsfOp")
9395 def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9397 Create new object as offset of the given one. Gap between adjacent
9398 offset surfaces is filled by extending and intersecting them.
9401 theObject The base object for the offset.
9402 theOffset Offset value.
9403 theName Object name; when specified, this parameter is used
9404 for result publication in the study. Otherwise, if automatic
9405 publication is switched on, default value is used for result name.
9408 New GEOM.GEOM_Object, containing the offset object.
9411 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9412 # create a new box extended by 70
9413 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9415 # Example: see GEOM_TestAll.py
9416 theOffset, Parameters = ParseParameters( theOffset )
9417 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9418 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9419 anObj.SetParameters(Parameters)
9420 self._autoPublish(anObj, theName, "offset")
9423 ## Create new object as projection of the given one on another.
9424 # @param theSource The source object for the projection. It can be a point, edge or wire.
9425 # Edge and wire are acceptable if @a theTarget is a face.
9426 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9427 # @param theName Object name; when specified, this parameter is used
9428 # for result publication in the study. Otherwise, if automatic
9429 # publication is switched on, default value is used for result name.
9431 # @return New GEOM.GEOM_Object, containing the projection.
9433 # @ref tui_projection "Example"
9434 @ManageTransactions("TrsfOp")
9435 def MakeProjection(self, theSource, theTarget, theName=None):
9437 Create new object as projection of the given one on another.
9440 theSource The source object for the projection. It can be a point, edge or wire.
9441 Edge and wire are acceptable if theTarget is a face.
9442 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9443 theName Object name; when specified, this parameter is used
9444 for result publication in the study. Otherwise, if automatic
9445 publication is switched on, default value is used for result name.
9448 New GEOM.GEOM_Object, containing the projection.
9450 # Example: see GEOM_TestAll.py
9451 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9452 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9453 self._autoPublish(anObj, theName, "projection")
9456 ## Create a projection of the given point on a wire or an edge.
9457 # If there are no solutions or there are 2 or more solutions It throws an
9459 # @param thePoint the point to be projected.
9460 # @param theWire the wire. The edge is accepted as well.
9461 # @param theName Object name; when specified, this parameter is used
9462 # for result publication in the study. Otherwise, if automatic
9463 # publication is switched on, default value is used for result name.
9465 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9466 # \n \a u: The parameter of projection point on edge.
9467 # \n \a PointOnEdge: The projection point.
9468 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9470 # @ref tui_projection "Example"
9471 @ManageTransactions("TrsfOp")
9472 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9474 Create a projection of the given point on a wire or an edge.
9475 If there are no solutions or there are 2 or more solutions It throws an
9479 thePoint the point to be projected.
9480 theWire the wire. The edge is accepted as well.
9481 theName Object name; when specified, this parameter is used
9482 for result publication in the study. Otherwise, if automatic
9483 publication is switched on, default value is used for result name.
9486 [u, PointOnEdge, EdgeInWireIndex]
9487 u: The parameter of projection point on edge.
9488 PointOnEdge: The projection point.
9489 EdgeInWireIndex: The index of an edge in a wire.
9491 # Example: see GEOM_TestAll.py
9492 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9493 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9494 self._autoPublish(anObj[1], theName, "projection")
9497 # -----------------------------------------------------------------------------
9499 # -----------------------------------------------------------------------------
9501 ## Translate the given object along the given vector a given number times
9502 # @param theObject The object to be translated.
9503 # @param theVector Direction of the translation. DX if None.
9504 # @param theStep Distance to translate on.
9505 # @param theNbTimes Quantity of translations to be done.
9506 # @param theName Object name; when specified, this parameter is used
9507 # for result publication in the study. Otherwise, if automatic
9508 # publication is switched on, default value is used for result name.
9510 # @return New GEOM.GEOM_Object, containing compound of all
9511 # the shapes, obtained after each translation.
9513 # @ref tui_multi_translation "Example"
9514 @ManageTransactions("TrsfOp")
9515 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9517 Translate the given object along the given vector a given number times
9520 theObject The object to be translated.
9521 theVector Direction of the translation. DX if None.
9522 theStep Distance to translate on.
9523 theNbTimes Quantity of translations to be done.
9524 theName Object name; when specified, this parameter is used
9525 for result publication in the study. Otherwise, if automatic
9526 publication is switched on, default value is used for result name.
9529 New GEOM.GEOM_Object, containing compound of all
9530 the shapes, obtained after each translation.
9533 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9535 # Example: see GEOM_TestAll.py
9536 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9537 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9538 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9539 anObj.SetParameters(Parameters)
9540 self._autoPublish(anObj, theName, "multitranslation")
9543 ## Conseqently apply two specified translations to theObject specified number of times.
9544 # @param theObject The object to be translated.
9545 # @param theVector1 Direction of the first translation. DX if None.
9546 # @param theStep1 Step of the first translation.
9547 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9548 # @param theVector2 Direction of the second translation. DY if None.
9549 # @param theStep2 Step of the second translation.
9550 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9551 # @param theName Object name; when specified, this parameter is used
9552 # for result publication in the study. Otherwise, if automatic
9553 # publication is switched on, default value is used for result name.
9555 # @return New GEOM.GEOM_Object, containing compound of all
9556 # the shapes, obtained after each translation.
9558 # @ref tui_multi_translation "Example"
9559 @ManageTransactions("TrsfOp")
9560 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9561 theVector2, theStep2, theNbTimes2, theName=None):
9563 Conseqently apply two specified translations to theObject specified number of times.
9566 theObject The object to be translated.
9567 theVector1 Direction of the first translation. DX if None.
9568 theStep1 Step of the first translation.
9569 theNbTimes1 Quantity of translations to be done along theVector1.
9570 theVector2 Direction of the second translation. DY if None.
9571 theStep2 Step of the second translation.
9572 theNbTimes2 Quantity of translations to be done along theVector2.
9573 theName Object name; when specified, this parameter is used
9574 for result publication in the study. Otherwise, if automatic
9575 publication is switched on, default value is used for result name.
9578 New GEOM.GEOM_Object, containing compound of all
9579 the shapes, obtained after each translation.
9582 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9584 # Example: see GEOM_TestAll.py
9585 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9586 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9587 theVector2, theStep2, theNbTimes2)
9588 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9589 anObj.SetParameters(Parameters)
9590 self._autoPublish(anObj, theName, "multitranslation")
9593 ## Rotate the given object around the given axis a given number times.
9594 # Rotation angle will be 2*PI/theNbTimes.
9595 # @param theObject The object to be rotated.
9596 # @param theAxis The rotation axis. DZ if None.
9597 # @param theNbTimes Quantity of rotations to be done.
9598 # @param theName Object name; when specified, this parameter is used
9599 # for result publication in the study. Otherwise, if automatic
9600 # publication is switched on, default value is used for result name.
9602 # @return New GEOM.GEOM_Object, containing compound of all the
9603 # shapes, obtained after each rotation.
9605 # @ref tui_multi_rotation "Example"
9606 @ManageTransactions("TrsfOp")
9607 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9609 Rotate the given object around the given axis a given number times.
9610 Rotation angle will be 2*PI/theNbTimes.
9613 theObject The object to be rotated.
9614 theAxis The rotation axis. DZ if None.
9615 theNbTimes Quantity of rotations to be done.
9616 theName Object name; when specified, this parameter is used
9617 for result publication in the study. Otherwise, if automatic
9618 publication is switched on, default value is used for result name.
9621 New GEOM.GEOM_Object, containing compound of all the
9622 shapes, obtained after each rotation.
9625 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9627 # Example: see GEOM_TestAll.py
9628 theNbTimes, Parameters = ParseParameters(theNbTimes)
9629 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9630 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9631 anObj.SetParameters(Parameters)
9632 self._autoPublish(anObj, theName, "multirotation")
9635 ## Rotate the given object around the given axis
9636 # a given number times on the given angle.
9637 # @param theObject The object to be rotated.
9638 # @param theAxis The rotation axis. DZ if None.
9639 # @param theAngleStep Rotation angle in radians.
9640 # @param theNbTimes Quantity of rotations to be done.
9641 # @param theName Object name; when specified, this parameter is used
9642 # for result publication in the study. Otherwise, if automatic
9643 # publication is switched on, default value is used for result name.
9645 # @return New GEOM.GEOM_Object, containing compound of all the
9646 # shapes, obtained after each rotation.
9648 # @ref tui_multi_rotation "Example"
9649 @ManageTransactions("TrsfOp")
9650 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9652 Rotate the given object around the given axis
9653 a given number times on the given angle.
9656 theObject The object to be rotated.
9657 theAxis The rotation axis. DZ if None.
9658 theAngleStep Rotation angle in radians.
9659 theNbTimes Quantity of rotations to be done.
9660 theName Object name; when specified, this parameter is used
9661 for result publication in the study. Otherwise, if automatic
9662 publication is switched on, default value is used for result name.
9665 New GEOM.GEOM_Object, containing compound of all the
9666 shapes, obtained after each rotation.
9669 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9671 # Example: see GEOM_TestAll.py
9672 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9673 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9674 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9675 anObj.SetParameters(Parameters)
9676 self._autoPublish(anObj, theName, "multirotation")
9679 ## Rotate the given object around the given axis a given
9680 # number times and multi-translate each rotation result.
9681 # Rotation angle will be 2*PI/theNbTimes1.
9682 # Translation direction passes through center of gravity
9683 # of rotated shape and its projection on the rotation axis.
9684 # @param theObject The object to be rotated.
9685 # @param theAxis Rotation axis. DZ if None.
9686 # @param theNbTimes1 Quantity of rotations to be done.
9687 # @param theRadialStep Translation distance.
9688 # @param theNbTimes2 Quantity of translations to be done.
9689 # @param theName Object name; when specified, this parameter is used
9690 # for result publication in the study. Otherwise, if automatic
9691 # publication is switched on, default value is used for result name.
9693 # @return New GEOM.GEOM_Object, containing compound of all the
9694 # shapes, obtained after each transformation.
9696 # @ref tui_multi_rotation "Example"
9697 @ManageTransactions("TrsfOp")
9698 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9700 Rotate the given object around the
9701 given axis on the given angle a given number
9702 times and multi-translate each rotation result.
9703 Translation direction passes through center of gravity
9704 of rotated shape and its projection on the rotation axis.
9707 theObject The object to be rotated.
9708 theAxis Rotation axis. DZ if None.
9709 theNbTimes1 Quantity of rotations to be done.
9710 theRadialStep Translation distance.
9711 theNbTimes2 Quantity of translations to be done.
9712 theName Object name; when specified, this parameter is used
9713 for result publication in the study. Otherwise, if automatic
9714 publication is switched on, default value is used for result name.
9717 New GEOM.GEOM_Object, containing compound of all the
9718 shapes, obtained after each transformation.
9721 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9723 # Example: see GEOM_TestAll.py
9724 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9725 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9726 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9727 anObj.SetParameters(Parameters)
9728 self._autoPublish(anObj, theName, "multirotation")
9731 ## Rotate the given object around the
9732 # given axis on the given angle a given number
9733 # times and multi-translate each rotation result.
9734 # Translation direction passes through center of gravity
9735 # of rotated shape and its projection on the rotation axis.
9736 # @param theObject The object to be rotated.
9737 # @param theAxis Rotation axis. DZ if None.
9738 # @param theAngleStep Rotation angle in radians.
9739 # @param theNbTimes1 Quantity of rotations to be done.
9740 # @param theRadialStep Translation distance.
9741 # @param theNbTimes2 Quantity of translations to be done.
9742 # @param theName Object name; when specified, this parameter is used
9743 # for result publication in the study. Otherwise, if automatic
9744 # publication is switched on, default value is used for result name.
9746 # @return New GEOM.GEOM_Object, containing compound of all the
9747 # shapes, obtained after each transformation.
9749 # @ref tui_multi_rotation "Example"
9750 @ManageTransactions("TrsfOp")
9751 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9753 Rotate the given object around the
9754 given axis on the given angle a given number
9755 times and multi-translate each rotation result.
9756 Translation direction passes through center of gravity
9757 of rotated shape and its projection on the rotation axis.
9760 theObject The object to be rotated.
9761 theAxis Rotation axis. DZ if None.
9762 theAngleStep Rotation angle in radians.
9763 theNbTimes1 Quantity of rotations to be done.
9764 theRadialStep Translation distance.
9765 theNbTimes2 Quantity of translations to be done.
9766 theName Object name; when specified, this parameter is used
9767 for result publication in the study. Otherwise, if automatic
9768 publication is switched on, default value is used for result name.
9771 New GEOM.GEOM_Object, containing compound of all the
9772 shapes, obtained after each transformation.
9775 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9777 # Example: see GEOM_TestAll.py
9778 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9779 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9780 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9781 anObj.SetParameters(Parameters)
9782 self._autoPublish(anObj, theName, "multirotation")
9785 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9787 # @ref swig_MakeMultiRotation "Example"
9788 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9790 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9793 pz = geompy.MakeVertex(0, 0, 100)
9794 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9795 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9797 # Example: see GEOM_TestOthers.py
9798 aVec = self.MakeLine(aPoint,aDir)
9799 # note: auto-publishing is done in self.MultiRotate1D()
9800 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9803 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9805 # @ref swig_MakeMultiRotation "Example"
9806 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9808 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9811 pz = geompy.MakeVertex(0, 0, 100)
9812 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9813 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9815 # Example: see GEOM_TestOthers.py
9816 aVec = self.MakeLine(aPoint,aDir)
9817 # note: auto-publishing is done in self.MultiRotate1D()
9818 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9821 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9823 # @ref swig_MakeMultiRotation "Example"
9824 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9826 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9829 pz = geompy.MakeVertex(0, 0, 100)
9830 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9831 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9833 # Example: see GEOM_TestOthers.py
9834 aVec = self.MakeLine(aPoint,aDir)
9835 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9836 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9839 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9841 # @ref swig_MakeMultiRotation "Example"
9842 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9844 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9847 pz = geompy.MakeVertex(0, 0, 100)
9848 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9849 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9851 # Example: see GEOM_TestOthers.py
9852 aVec = self.MakeLine(aPoint,aDir)
9853 # note: auto-publishing is done in self.MultiRotate2D()
9854 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9858 # Compute a wire or a face that represents a projection of the source
9859 # shape onto cylinder. The cylinder's coordinate system is the same
9860 # as the global coordinate system.
9862 # @param theObject The object to be projected. It can be either
9863 # a planar wire or a face.
9864 # @param theRadius The radius of the cylinder.
9865 # @param theStartAngle The starting angle in radians from
9866 # the cylinder's X axis around Z axis. The angle from which
9867 # the projection is started.
9868 # @param theAngleLength The projection length angle in radians.
9869 # The angle in which to project the total length of the wire.
9870 # If it is negative the projection is not scaled and natural
9871 # wire length is kept for the projection.
9872 # @param theAngleRotation The desired angle in radians between
9873 # the tangent vector to the first curve at the first point of
9874 # the theObject's projection in 2D space and U-direction of
9875 # cylinder's 2D space.
9876 # @param theName Object name; when specified, this parameter is used
9877 # for result publication in the study. Otherwise, if automatic
9878 # publication is switched on, default value is used for result name.
9880 # @return New GEOM.GEOM_Object, containing the result shape. The result
9881 # represents a wire or a face that represents a projection of
9882 # the source shape onto a cylinder.
9884 # @ref tui_projection "Example"
9885 def MakeProjectionOnCylinder (self, theObject, theRadius,
9886 theStartAngle=0.0, theAngleLength=-1.0,
9887 theAngleRotation=0.0,
9890 Compute a wire or a face that represents a projection of the source
9891 shape onto cylinder. The cylinder's coordinate system is the same
9892 as the global coordinate system.
9895 theObject The object to be projected. It can be either
9896 a planar wire or a face.
9897 theRadius The radius of the cylinder.
9898 theStartAngle The starting angle in radians from the cylinder's X axis
9899 around Z axis. The angle from which the projection is started.
9900 theAngleLength The projection length angle in radians. The angle in which
9901 to project the total length of the wire. If it is negative the
9902 projection is not scaled and natural wire length is kept for
9904 theAngleRotation The desired angle in radians between
9905 the tangent vector to the first curve at the first
9906 point of the theObject's projection in 2D space and
9907 U-direction of cylinder's 2D space.
9908 theName Object name; when specified, this parameter is used
9909 for result publication in the study. Otherwise, if automatic
9910 publication is switched on, default value is used for result name.
9913 New GEOM.GEOM_Object, containing the result shape. The result
9914 represents a wire or a face that represents a projection of
9915 the source shape onto a cylinder.
9917 # Example: see GEOM_TestAll.py
9918 flagStartAngle = False
9919 if isinstance(theStartAngle,str):
9920 flagStartAngle = True
9921 flagAngleLength = False
9922 if isinstance(theAngleLength,str):
9923 flagAngleLength = True
9924 flagAngleRotation = False
9925 if isinstance(theAngleRotation,str):
9926 flagAngleRotation = True
9927 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9928 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9930 theStartAngle = theStartAngle*math.pi/180.
9932 theAngleLength = theAngleLength*math.pi/180.
9933 if flagAngleRotation:
9934 theAngleRotation = theAngleRotation*math.pi/180.
9935 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9936 theStartAngle, theAngleLength, theAngleRotation)
9937 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9938 anObj.SetParameters(Parameters)
9939 self._autoPublish(anObj, theName, "projection")
9942 # end of l3_transform
9945 ## @addtogroup l3_transform_d
9948 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9949 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9951 Deprecated method. Use MultiRotate1DNbTimes instead.
9953 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9954 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9956 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9957 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9958 @ManageTransactions("TrsfOp")
9959 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9961 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9962 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9965 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9967 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9968 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9969 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9970 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9971 anObj.SetParameters(Parameters)
9972 self._autoPublish(anObj, theName, "multirotation")
9975 ## The same, as MultiRotate1D(), but axis is given by direction and point
9976 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9977 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9979 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9980 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9983 pz = geompy.MakeVertex(0, 0, 100)
9984 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9985 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9987 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9988 aVec = self.MakeLine(aPoint,aDir)
9989 # note: auto-publishing is done in self.MultiRotate1D()
9990 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9993 ## The same, as MultiRotate2D(), but axis is given by direction and point
9994 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9995 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9997 The same, as MultiRotate2D(), but axis is given by direction and point
9998 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10001 pz = geompy.MakeVertex(0, 0, 100)
10002 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
10003 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
10005 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
10006 aVec = self.MakeLine(aPoint,aDir)
10007 # note: auto-publishing is done in self.MultiRotate2D()
10008 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10011 # end of l3_transform_d
10014 ## @addtogroup l3_local
10017 ## Perform a fillet on all edges of the given shape.
10018 # @param theShape Shape, to perform fillet on.
10019 # @param theR Fillet radius.
10020 # @param theName Object name; when specified, this parameter is used
10021 # for result publication in the study. Otherwise, if automatic
10022 # publication is switched on, default value is used for result name.
10024 # @return New GEOM.GEOM_Object, containing the result shape.
10026 # @ref tui_fillet "Example 1"
10027 # \n @ref swig_MakeFilletAll "Example 2"
10028 @ManageTransactions("LocalOp")
10029 def MakeFilletAll(self, theShape, theR, theName=None):
10031 Perform a fillet on all edges of the given shape.
10034 theShape Shape, to perform fillet on.
10035 theR Fillet radius.
10036 theName Object name; when specified, this parameter is used
10037 for result publication in the study. Otherwise, if automatic
10038 publication is switched on, default value is used for result name.
10041 New GEOM.GEOM_Object, containing the result shape.
10044 filletall = geompy.MakeFilletAll(prism, 10.)
10046 # Example: see GEOM_TestOthers.py
10047 theR,Parameters = ParseParameters(theR)
10048 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10049 RaiseIfFailed("MakeFilletAll", self.LocalOp)
10050 anObj.SetParameters(Parameters)
10051 self._autoPublish(anObj, theName, "fillet")
10054 ## Perform a fillet on the specified edges/faces of the given shape
10055 # @param theShape Shape, to perform fillet on.
10056 # @param theR Fillet radius.
10057 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10058 # @param theListShapes Global indices of edges/faces to perform fillet on.
10059 # @param theName Object name; when specified, this parameter is used
10060 # for result publication in the study. Otherwise, if automatic
10061 # publication is switched on, default value is used for result name.
10063 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10065 # @return New GEOM.GEOM_Object, containing the result shape.
10067 # @ref tui_fillet "Example"
10068 @ManageTransactions("LocalOp")
10069 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10071 Perform a fillet on the specified edges/faces of the given shape
10074 theShape Shape, to perform fillet on.
10075 theR Fillet radius.
10076 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10077 theListShapes Global indices of edges/faces to perform fillet on.
10078 theName Object name; when specified, this parameter is used
10079 for result publication in the study. Otherwise, if automatic
10080 publication is switched on, default value is used for result name.
10083 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10086 New GEOM.GEOM_Object, containing the result shape.
10089 # get the list of IDs (IDList) for the fillet
10090 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10092 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10093 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10094 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10095 # make a fillet on the specified edges of the given shape
10096 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10098 # Example: see GEOM_TestAll.py
10099 theR,Parameters = ParseParameters(theR)
10101 if theShapeType == self.ShapeType["EDGE"]:
10102 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10103 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10105 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10106 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10107 anObj.SetParameters(Parameters)
10108 self._autoPublish(anObj, theName, "fillet")
10111 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10112 @ManageTransactions("LocalOp")
10113 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10115 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10118 # get the list of IDs (IDList) for the fillet
10119 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10121 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10122 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10123 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10124 # make a fillet on the specified edges of the given shape
10125 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10127 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10129 if theShapeType == self.ShapeType["EDGE"]:
10130 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10131 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10133 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10134 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10135 anObj.SetParameters(Parameters)
10136 self._autoPublish(anObj, theName, "fillet")
10139 ## Perform a fillet on the specified edges of the given shape
10140 # @param theShape Wire Shape to perform fillet on.
10141 # @param theR Fillet radius.
10142 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10143 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10144 # \note The list of vertices could be empty,
10145 # in this case fillet will done done at all vertices in wire
10146 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10147 # by the length of the edges, nearest to the fillet vertex.
10148 # But sometimes the next edge is C1 continuous with the one, nearest to
10149 # the fillet point, and such two (or more) edges can be united to allow
10150 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10151 # thus ignoring the secant vertex (vertices).
10152 # @param theName Object name; when specified, this parameter is used
10153 # for result publication in the study. Otherwise, if automatic
10154 # publication is switched on, default value is used for result name.
10156 # @return New GEOM.GEOM_Object, containing the result shape.
10158 # @ref tui_fillet2d "Example"
10159 @ManageTransactions("LocalOp")
10160 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10162 Perform a fillet on the specified edges of the given shape
10165 theShape Wire Shape to perform fillet on.
10166 theR Fillet radius.
10167 theListOfVertexes Global indices of vertexes to perform fillet on.
10168 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10169 by the length of the edges, nearest to the fillet vertex.
10170 But sometimes the next edge is C1 continuous with the one, nearest to
10171 the fillet point, and such two (or more) edges can be united to allow
10172 bigger radius. Set this flag to TRUE to allow collinear edges union,
10173 thus ignoring the secant vertex (vertices).
10174 theName Object name; when specified, this parameter is used
10175 for result publication in the study. Otherwise, if automatic
10176 publication is switched on, default value is used for result name.
10178 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10180 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10183 New GEOM.GEOM_Object, containing the result shape.
10187 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10188 # make fillet at given wire vertices with giver radius
10189 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10191 # Example: see GEOM_TestAll.py
10192 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10193 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10194 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10195 anObj.SetParameters(Parameters)
10196 self._autoPublish(anObj, theName, "fillet")
10199 ## Perform a fillet at the specified vertices of the given face/shell.
10200 # @param theShape Face or Shell shape to perform fillet on.
10201 # @param theR Fillet radius.
10202 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10203 # @param theName Object name; when specified, this parameter is used
10204 # for result publication in the study. Otherwise, if automatic
10205 # publication is switched on, default value is used for result name.
10207 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10209 # @return New GEOM.GEOM_Object, containing the result shape.
10211 # @ref tui_fillet2d "Example"
10212 @ManageTransactions("LocalOp")
10213 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10215 Perform a fillet at the specified vertices of the given face/shell.
10218 theShape Face or Shell shape to perform fillet on.
10219 theR Fillet radius.
10220 theListOfVertexes Global indices of vertexes to perform fillet on.
10221 theName Object name; when specified, this parameter is used
10222 for result publication in the study. Otherwise, if automatic
10223 publication is switched on, default value is used for result name.
10225 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10228 New GEOM.GEOM_Object, containing the result shape.
10231 face = geompy.MakeFaceHW(100, 100, 1)
10232 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10234 # Example: see GEOM_TestAll.py
10235 theR,Parameters = ParseParameters(theR)
10236 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10237 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10238 anObj.SetParameters(Parameters)
10239 self._autoPublish(anObj, theName, "fillet")
10242 ## Perform a symmetric chamfer on all edges of the given shape.
10243 # @param theShape Shape, to perform chamfer on.
10244 # @param theD Chamfer size along each face.
10245 # @param theName Object name; when specified, this parameter is used
10246 # for result publication in the study. Otherwise, if automatic
10247 # publication is switched on, default value is used for result name.
10249 # @return New GEOM.GEOM_Object, containing the result shape.
10251 # @ref tui_chamfer "Example 1"
10252 # \n @ref swig_MakeChamferAll "Example 2"
10253 @ManageTransactions("LocalOp")
10254 def MakeChamferAll(self, theShape, theD, theName=None):
10256 Perform a symmetric chamfer on all edges of the given shape.
10259 theShape Shape, to perform chamfer on.
10260 theD Chamfer size along each face.
10261 theName Object name; when specified, this parameter is used
10262 for result publication in the study. Otherwise, if automatic
10263 publication is switched on, default value is used for result name.
10266 New GEOM.GEOM_Object, containing the result shape.
10269 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10271 # Example: see GEOM_TestOthers.py
10272 theD,Parameters = ParseParameters(theD)
10273 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10274 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10275 anObj.SetParameters(Parameters)
10276 self._autoPublish(anObj, theName, "chamfer")
10279 ## Perform a chamfer on edges, common to the specified faces,
10280 # with distance D1 on the Face1
10281 # @param theShape Shape, to perform chamfer on.
10282 # @param theD1 Chamfer size along \a theFace1.
10283 # @param theD2 Chamfer size along \a theFace2.
10284 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10285 # @param theName Object name; when specified, this parameter is used
10286 # for result publication in the study. Otherwise, if automatic
10287 # publication is switched on, default value is used for result name.
10289 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10291 # @return New GEOM.GEOM_Object, containing the result shape.
10293 # @ref tui_chamfer "Example"
10294 @ManageTransactions("LocalOp")
10295 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10297 Perform a chamfer on edges, common to the specified faces,
10298 with distance D1 on the Face1
10301 theShape Shape, to perform chamfer on.
10302 theD1 Chamfer size along theFace1.
10303 theD2 Chamfer size along theFace2.
10304 theFace1,theFace2 Global indices of two faces of theShape.
10305 theName Object name; when specified, this parameter is used
10306 for result publication in the study. Otherwise, if automatic
10307 publication is switched on, default value is used for result name.
10310 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10313 New GEOM.GEOM_Object, containing the result shape.
10316 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10317 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10318 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10319 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10321 # Example: see GEOM_TestAll.py
10322 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10323 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10324 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10325 anObj.SetParameters(Parameters)
10326 self._autoPublish(anObj, theName, "chamfer")
10329 ## Perform a chamfer on edges
10330 # @param theShape Shape, to perform chamfer on.
10331 # @param theD Chamfer length
10332 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10333 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10334 # @param theName Object name; when specified, this parameter is used
10335 # for result publication in the study. Otherwise, if automatic
10336 # publication is switched on, default value is used for result name.
10338 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10340 # @return New GEOM.GEOM_Object, containing the result shape.
10341 @ManageTransactions("LocalOp")
10342 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10344 Perform a chamfer on edges
10347 theShape Shape, to perform chamfer on.
10348 theD1 Chamfer size along theFace1.
10349 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10350 theFace1,theFace2 Global indices of two faces of theShape.
10351 theName Object name; when specified, this parameter is used
10352 for result publication in the study. Otherwise, if automatic
10353 publication is switched on, default value is used for result name.
10356 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10359 New GEOM.GEOM_Object, containing the result shape.
10362 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10363 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10364 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10366 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10369 if isinstance(theAngle,str):
10371 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10373 theAngle = theAngle*math.pi/180.0
10374 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10375 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10376 anObj.SetParameters(Parameters)
10377 self._autoPublish(anObj, theName, "chamfer")
10380 ## Perform a chamfer on all edges of the specified faces,
10381 # with distance D1 on the first specified face (if several for one edge)
10382 # @param theShape Shape, to perform chamfer on.
10383 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10384 # connected to the edge, are in \a theFaces, \a theD1
10385 # will be get along face, which is nearer to \a theFaces beginning.
10386 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10387 # @param theFaces Sequence of global indices of faces of \a theShape.
10388 # @param theName Object name; when specified, this parameter is used
10389 # for result publication in the study. Otherwise, if automatic
10390 # publication is switched on, default value is used for result name.
10392 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10394 # @return New GEOM.GEOM_Object, containing the result shape.
10396 # @ref tui_chamfer "Example"
10397 @ManageTransactions("LocalOp")
10398 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10400 Perform a chamfer on all edges of the specified faces,
10401 with distance D1 on the first specified face (if several for one edge)
10404 theShape Shape, to perform chamfer on.
10405 theD1 Chamfer size along face from theFaces. If both faces,
10406 connected to the edge, are in theFaces, theD1
10407 will be get along face, which is nearer to theFaces beginning.
10408 theD2 Chamfer size along another of two faces, connected to the edge.
10409 theFaces Sequence of global indices of faces of theShape.
10410 theName Object name; when specified, this parameter is used
10411 for result publication in the study. Otherwise, if automatic
10412 publication is switched on, default value is used for result name.
10414 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10417 New GEOM.GEOM_Object, containing the result shape.
10419 # Example: see GEOM_TestAll.py
10420 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10421 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10422 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10423 anObj.SetParameters(Parameters)
10424 self._autoPublish(anObj, theName, "chamfer")
10427 ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10428 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10430 # @ref swig_FilletChamfer "Example"
10431 @ManageTransactions("LocalOp")
10432 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10434 The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10435 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10438 if isinstance(theAngle,str):
10440 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10442 theAngle = theAngle*math.pi/180.0
10443 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10444 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10445 anObj.SetParameters(Parameters)
10446 self._autoPublish(anObj, theName, "chamfer")
10449 ## Perform a chamfer on edges,
10450 # with distance D1 on the first specified face (if several for one edge)
10451 # @param theShape Shape, to perform chamfer on.
10452 # @param theD1,theD2 Chamfer size
10453 # @param theEdges Sequence of edges of \a theShape.
10454 # @param theName Object name; when specified, this parameter is used
10455 # for result publication in the study. Otherwise, if automatic
10456 # publication is switched on, default value is used for result name.
10458 # @return New GEOM.GEOM_Object, containing the result shape.
10460 # @ref swig_FilletChamfer "Example"
10461 @ManageTransactions("LocalOp")
10462 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10464 Perform a chamfer on edges,
10465 with distance D1 on the first specified face (if several for one edge)
10468 theShape Shape, to perform chamfer on.
10469 theD1,theD2 Chamfer size
10470 theEdges Sequence of edges of theShape.
10471 theName Object name; when specified, this parameter is used
10472 for result publication in the study. Otherwise, if automatic
10473 publication is switched on, default value is used for result name.
10476 New GEOM.GEOM_Object, containing the result shape.
10478 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10479 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10480 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10481 anObj.SetParameters(Parameters)
10482 self._autoPublish(anObj, theName, "chamfer")
10485 ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10486 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10487 @ManageTransactions("LocalOp")
10488 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10490 The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10491 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10494 if isinstance(theAngle,str):
10496 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10498 theAngle = theAngle*math.pi/180.0
10499 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10500 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10501 anObj.SetParameters(Parameters)
10502 self._autoPublish(anObj, theName, "chamfer")
10505 ## @sa MakeChamferEdge(), MakeChamferFaces()
10507 # @ref swig_MakeChamfer "Example"
10508 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10510 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10512 # Example: see GEOM_TestOthers.py
10514 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10515 if aShapeType == self.ShapeType["EDGE"]:
10516 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10518 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10521 ## Remove material from a solid by extrusion of the base shape on the given distance.
10522 # @param theInit Shape to remove material from. It must be a solid or
10523 # a compound made of a single solid.
10524 # @param theBase Closed edge or wire defining the base shape to be extruded.
10525 # @param theH Prism dimension along the normal to theBase
10526 # @param theAngle Draft angle in degrees.
10527 # @param theInvert If true material changes the direction
10528 # @param theName Object name; when specified, this parameter is used
10529 # for result publication in the study. Otherwise, if automatic
10530 # publication is switched on, default value is used for result name.
10532 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10534 # @ref tui_creation_prism "Example"
10535 @ManageTransactions("PrimOp")
10536 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10538 Add material to a solid by extrusion of the base shape on the given distance.
10541 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10542 theBase Closed edge or wire defining the base shape to be extruded.
10543 theH Prism dimension along the normal to theBase
10544 theAngle Draft angle in degrees.
10545 theInvert If true material changes the direction.
10546 theName Object name; when specified, this parameter is used
10547 for result publication in the study. Otherwise, if automatic
10548 publication is switched on, default value is used for result name.
10551 New GEOM.GEOM_Object, containing the initial shape with removed material.
10553 # Example: see GEOM_TestAll.py
10554 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10555 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10556 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10557 anObj.SetParameters(Parameters)
10558 self._autoPublish(anObj, theName, "extrudedCut")
10561 ## Add material to a solid by extrusion of the base shape on the given distance.
10562 # @param theInit Shape to add material to. It must be a solid or
10563 # a compound made of a single solid.
10564 # @param theBase Closed edge or wire defining the base shape to be extruded.
10565 # @param theH Prism dimension along the normal to theBase
10566 # @param theAngle Draft angle in degrees.
10567 # @param theInvert If true material changes the direction
10568 # @param theName Object name; when specified, this parameter is used
10569 # for result publication in the study. Otherwise, if automatic
10570 # publication is switched on, default value is used for result name.
10572 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10574 # @ref tui_creation_prism "Example"
10575 @ManageTransactions("PrimOp")
10576 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10578 Add material to a solid by extrusion of the base shape on the given distance.
10581 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10582 theBase Closed edge or wire defining the base shape to be extruded.
10583 theH Prism dimension along the normal to theBase
10584 theAngle Draft angle in degrees.
10585 theInvert If true material changes the direction.
10586 theName Object name; when specified, this parameter is used
10587 for result publication in the study. Otherwise, if automatic
10588 publication is switched on, default value is used for result name.
10591 New GEOM.GEOM_Object, containing the initial shape with added material.
10593 # Example: see GEOM_TestAll.py
10594 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10595 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10596 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10597 anObj.SetParameters(Parameters)
10598 self._autoPublish(anObj, theName, "extrudedBoss")
10604 ## @addtogroup l3_basic_op
10607 ## Perform an Archimde operation on the given shape with given parameters.
10608 # The object presenting the resulting face is returned.
10609 # @param theShape Shape to be put in water.
10610 # @param theWeight Weight of the shape.
10611 # @param theWaterDensity Density of the water.
10612 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10613 # @param theName Object name; when specified, this parameter is used
10614 # for result publication in the study. Otherwise, if automatic
10615 # publication is switched on, default value is used for result name.
10617 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10618 # by a plane, corresponding to water level.
10620 # @ref tui_archimede "Example"
10621 @ManageTransactions("LocalOp")
10622 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10624 Perform an Archimde operation on the given shape with given parameters.
10625 The object presenting the resulting face is returned.
10628 theShape Shape to be put in water.
10629 theWeight Weight of the shape.
10630 theWaterDensity Density of the water.
10631 theMeshDeflection Deflection of the mesh, using to compute the section.
10632 theName Object name; when specified, this parameter is used
10633 for result publication in the study. Otherwise, if automatic
10634 publication is switched on, default value is used for result name.
10637 New GEOM.GEOM_Object, containing a section of theShape
10638 by a plane, corresponding to water level.
10640 # Example: see GEOM_TestAll.py
10641 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10642 theWeight,theWaterDensity,theMeshDeflection)
10643 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10644 RaiseIfFailed("MakeArchimede", self.LocalOp)
10645 anObj.SetParameters(Parameters)
10646 self._autoPublish(anObj, theName, "archimede")
10649 # end of l3_basic_op
10652 ## @addtogroup l2_measure
10655 ## Get point coordinates
10656 # @return [x, y, z]
10658 # @ref tui_point_coordinates_page "Example"
10659 @ManageTransactions("MeasuOp")
10660 def PointCoordinates(self,Point):
10662 Get point coordinates
10667 # Example: see GEOM_TestMeasures.py
10668 aTuple = self.MeasuOp.PointCoordinates(Point)
10669 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10672 ## Get vector coordinates
10673 # @return [x, y, z]
10675 # @ref tui_measurement_tools_page "Example"
10676 def VectorCoordinates(self,Vector):
10678 Get vector coordinates
10684 p1=self.GetFirstVertex(Vector)
10685 p2=self.GetLastVertex(Vector)
10687 X1=self.PointCoordinates(p1)
10688 X2=self.PointCoordinates(p2)
10690 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10693 ## Compute cross product
10694 # @return vector w=u^v
10696 # @ref tui_measurement_tools_page "Example"
10697 def CrossProduct(self, Vector1, Vector2):
10699 Compute cross product
10701 Returns: vector w=u^v
10703 u=self.VectorCoordinates(Vector1)
10704 v=self.VectorCoordinates(Vector2)
10705 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])
10709 ## Compute cross product
10710 # @return dot product p=u.v
10712 # @ref tui_measurement_tools_page "Example"
10713 def DotProduct(self, Vector1, Vector2):
10715 Compute cross product
10717 Returns: dot product p=u.v
10719 u=self.VectorCoordinates(Vector1)
10720 v=self.VectorCoordinates(Vector2)
10721 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10726 ## Get summarized length of all wires,
10727 # area of surface and volume of the given shape.
10728 # @param theShape Shape to define properties of.
10729 # @param theTolerance maximal relative error of area
10730 # and volume computation.
10731 # @return [theLength, theSurfArea, theVolume]\n
10732 # theLength: Summarized length of all wires of the given shape.\n
10733 # theSurfArea: Area of surface of the given shape.\n
10734 # theVolume: Volume of the given shape.
10736 # @ref tui_basic_properties_page "Example"
10737 @ManageTransactions("MeasuOp")
10738 def BasicProperties(self,theShape, theTolerance=1.e-6):
10740 Get summarized length of all wires,
10741 area of surface and volume of the given shape.
10744 theShape Shape to define properties of.
10745 theTolerance maximal relative error of area
10746 and volume computation.
10749 [theLength, theSurfArea, theVolume]
10750 theLength: Summarized length of all wires of the given shape.
10751 theSurfArea: Area of surface of the given shape.
10752 theVolume: Volume of the given shape.
10754 # Example: see GEOM_TestMeasures.py
10755 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10756 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10759 ## Get parameters of bounding box of the given shape
10760 # @param theShape Shape to obtain bounding box of.
10761 # @param precise TRUE for precise computation; FALSE for fast one.
10762 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10763 # Xmin,Xmax: Limits of shape along OX axis.
10764 # Ymin,Ymax: Limits of shape along OY axis.
10765 # Zmin,Zmax: Limits of shape along OZ axis.
10767 # @ref tui_bounding_box_page "Example"
10768 @ManageTransactions("MeasuOp")
10769 def BoundingBox (self, theShape, precise=False):
10771 Get parameters of bounding box of the given shape
10774 theShape Shape to obtain bounding box of.
10775 precise TRUE for precise computation; FALSE for fast one.
10778 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10779 Xmin,Xmax: Limits of shape along OX axis.
10780 Ymin,Ymax: Limits of shape along OY axis.
10781 Zmin,Zmax: Limits of shape along OZ axis.
10783 # Example: see GEOM_TestMeasures.py
10784 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10785 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10788 ## Get bounding box of the given shape
10789 # @param theShape Shape to obtain bounding box of.
10790 # @param precise TRUE for precise computation; FALSE for fast one.
10791 # @param theName Object name; when specified, this parameter is used
10792 # for result publication in the study. Otherwise, if automatic
10793 # publication is switched on, default value is used for result name.
10795 # @return New GEOM.GEOM_Object, containing the created box.
10797 # @ref tui_bounding_box_page "Example"
10798 @ManageTransactions("MeasuOp")
10799 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10801 Get bounding box of the given shape
10804 theShape Shape to obtain bounding box of.
10805 precise TRUE for precise computation; FALSE for fast one.
10806 theName Object name; when specified, this parameter is used
10807 for result publication in the study. Otherwise, if automatic
10808 publication is switched on, default value is used for result name.
10811 New GEOM.GEOM_Object, containing the created box.
10813 # Example: see GEOM_TestMeasures.py
10814 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10815 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10816 self._autoPublish(anObj, theName, "bndbox")
10819 ## Get inertia matrix and moments of inertia of theShape.
10820 # @param theShape Shape to calculate inertia of.
10821 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10822 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10823 # Ix,Iy,Iz: Moments of inertia of the given shape.
10825 # @ref tui_inertia_page "Example"
10826 @ManageTransactions("MeasuOp")
10827 def Inertia(self,theShape):
10829 Get inertia matrix and moments of inertia of theShape.
10832 theShape Shape to calculate inertia of.
10835 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10836 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10837 Ix,Iy,Iz: Moments of inertia of the given shape.
10839 # Example: see GEOM_TestMeasures.py
10840 aTuple = self.MeasuOp.GetInertia(theShape)
10841 RaiseIfFailed("GetInertia", self.MeasuOp)
10844 ## Get if coords are included in the shape (ST_IN or ST_ON)
10845 # @param theShape Shape
10846 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10847 # @param tolerance to be used (default is 1.0e-7)
10848 # @return list_of_boolean = [res1, res2, ...]
10849 @ManageTransactions("MeasuOp")
10850 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10852 Get if coords are included in the shape (ST_IN or ST_ON)
10856 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10857 tolerance to be used (default is 1.0e-7)
10860 list_of_boolean = [res1, res2, ...]
10862 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10864 ## Get minimal distance between the given shapes.
10865 # @param theShape1,theShape2 Shapes to find minimal distance between.
10866 # @return Value of the minimal distance between the given shapes.
10868 # @ref tui_min_distance_page "Example"
10869 @ManageTransactions("MeasuOp")
10870 def MinDistance(self, theShape1, theShape2):
10872 Get minimal distance between the given shapes.
10875 theShape1,theShape2 Shapes to find minimal distance between.
10878 Value of the minimal distance between the given shapes.
10880 # Example: see GEOM_TestMeasures.py
10881 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10882 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10885 ## Get minimal distance between the given shapes.
10886 # @param theShape1,theShape2 Shapes to find minimal distance between.
10887 # @return Value of the minimal distance between the given shapes, in form of list
10888 # [Distance, DX, DY, DZ].
10890 # @ref tui_min_distance_page "Example"
10891 @ManageTransactions("MeasuOp")
10892 def MinDistanceComponents(self, theShape1, theShape2):
10894 Get minimal distance between the given shapes.
10897 theShape1,theShape2 Shapes to find minimal distance between.
10900 Value of the minimal distance between the given shapes, in form of list
10901 [Distance, DX, DY, DZ]
10903 # Example: see GEOM_TestMeasures.py
10904 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10905 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10906 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10909 ## Get closest points of the given shapes.
10910 # @param theShape1,theShape2 Shapes to find closest points of.
10911 # @return The number of found solutions (-1 in case of infinite number of
10912 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10914 # @ref tui_min_distance_page "Example"
10915 @ManageTransactions("MeasuOp")
10916 def ClosestPoints (self, theShape1, theShape2):
10918 Get closest points of the given shapes.
10921 theShape1,theShape2 Shapes to find closest points of.
10924 The number of found solutions (-1 in case of infinite number of
10925 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10927 # Example: see GEOM_TestMeasures.py
10928 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10929 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10932 ## Get angle between the given shapes in degrees.
10933 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10934 # @note If both arguments are vectors, the angle is computed in accordance
10935 # with their orientations, otherwise the minimum angle is computed.
10936 # @return Value of the angle between the given shapes in degrees.
10938 # @ref tui_angle_page "Example"
10939 @ManageTransactions("MeasuOp")
10940 def GetAngle(self, theShape1, theShape2):
10942 Get angle between the given shapes in degrees.
10945 theShape1,theShape2 Lines or linear edges to find angle between.
10948 If both arguments are vectors, the angle is computed in accordance
10949 with their orientations, otherwise the minimum angle is computed.
10952 Value of the angle between the given shapes in degrees.
10954 # Example: see GEOM_TestMeasures.py
10955 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10956 RaiseIfFailed("GetAngle", self.MeasuOp)
10959 ## Get angle between the given shapes in radians.
10960 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10961 # @note If both arguments are vectors, the angle is computed in accordance
10962 # with their orientations, otherwise the minimum angle is computed.
10963 # @return Value of the angle between the given shapes in radians.
10965 # @ref tui_angle_page "Example"
10966 @ManageTransactions("MeasuOp")
10967 def GetAngleRadians(self, theShape1, theShape2):
10969 Get angle between the given shapes in radians.
10972 theShape1,theShape2 Lines or linear edges to find angle between.
10976 If both arguments are vectors, the angle is computed in accordance
10977 with their orientations, otherwise the minimum angle is computed.
10980 Value of the angle between the given shapes in radians.
10982 # Example: see GEOM_TestMeasures.py
10983 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10984 RaiseIfFailed("GetAngle", self.MeasuOp)
10987 ## Get angle between the given vectors in degrees.
10988 # @param theShape1,theShape2 Vectors to find angle between.
10989 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10990 # if False, the opposite vector to the normal vector is used.
10991 # @return Value of the angle between the given vectors in degrees.
10993 # @ref tui_angle_page "Example"
10994 @ManageTransactions("MeasuOp")
10995 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10997 Get angle between the given vectors in degrees.
11000 theShape1,theShape2 Vectors to find angle between.
11001 theFlag If True, the normal vector is defined by the two vectors cross,
11002 if False, the opposite vector to the normal vector is used.
11005 Value of the angle between the given vectors in degrees.
11007 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11009 anAngle = 360. - anAngle
11010 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11013 ## The same as GetAngleVectors, but the result is in radians.
11014 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11016 Get angle between the given vectors in radians.
11019 theShape1,theShape2 Vectors to find angle between.
11020 theFlag If True, the normal vector is defined by the two vectors cross,
11021 if False, the opposite vector to the normal vector is used.
11024 Value of the angle between the given vectors in radians.
11026 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11029 ## @name Curve Curvature Measurement
11030 # Methods for receiving radius of curvature of curves
11031 # in the given point
11034 ## Measure curvature of a curve at a point, set by parameter.
11035 # @param theCurve a curve.
11036 # @param theParam parameter.
11037 # @return radius of curvature of \a theCurve.
11039 # @ref swig_todo "Example"
11040 @ManageTransactions("MeasuOp")
11041 def CurveCurvatureByParam(self, theCurve, theParam):
11043 Measure curvature of a curve at a point, set by parameter.
11047 theParam parameter.
11050 radius of curvature of theCurve.
11052 # Example: see GEOM_TestMeasures.py
11053 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11054 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11057 ## Measure curvature of a curve at a point.
11058 # @param theCurve a curve.
11059 # @param thePoint given point.
11060 # @return radius of curvature of \a theCurve.
11062 # @ref swig_todo "Example"
11063 @ManageTransactions("MeasuOp")
11064 def CurveCurvatureByPoint(self, theCurve, thePoint):
11066 Measure curvature of a curve at a point.
11070 thePoint given point.
11073 radius of curvature of theCurve.
11075 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11076 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11080 ## @name Surface Curvature Measurement
11081 # Methods for receiving max and min radius of curvature of surfaces
11082 # in the given point
11085 ## Measure max radius of curvature of surface.
11086 # @param theSurf the given surface.
11087 # @param theUParam Value of U-parameter on the referenced surface.
11088 # @param theVParam Value of V-parameter on the referenced surface.
11089 # @return max radius of curvature of theSurf.
11091 ## @ref swig_todo "Example"
11092 @ManageTransactions("MeasuOp")
11093 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11095 Measure max radius of curvature of surface.
11098 theSurf the given surface.
11099 theUParam Value of U-parameter on the referenced surface.
11100 theVParam Value of V-parameter on the referenced surface.
11103 max radius of curvature of theSurf.
11105 # Example: see GEOM_TestMeasures.py
11106 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11107 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11110 ## Measure max radius of curvature of surface in the given point
11111 # @param theSurf the given surface.
11112 # @param thePoint given point.
11113 # @return max radius of curvature of theSurf.
11115 ## @ref swig_todo "Example"
11116 @ManageTransactions("MeasuOp")
11117 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11119 Measure max radius of curvature of surface in the given point.
11122 theSurf the given surface.
11123 thePoint given point.
11126 max radius of curvature of theSurf.
11128 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11129 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11132 ## Measure min radius of curvature of surface.
11133 # @param theSurf the given surface.
11134 # @param theUParam Value of U-parameter on the referenced surface.
11135 # @param theVParam Value of V-parameter on the referenced surface.
11136 # @return min radius of curvature of theSurf.
11138 ## @ref swig_todo "Example"
11139 @ManageTransactions("MeasuOp")
11140 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11142 Measure min radius of curvature of surface.
11145 theSurf the given surface.
11146 theUParam Value of U-parameter on the referenced surface.
11147 theVParam Value of V-parameter on the referenced surface.
11150 Min radius of curvature of theSurf.
11152 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11153 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11156 ## Measure min radius of curvature of surface in the given point
11157 # @param theSurf the given surface.
11158 # @param thePoint given point.
11159 # @return min radius of curvature of theSurf.
11161 ## @ref swig_todo "Example"
11162 @ManageTransactions("MeasuOp")
11163 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11165 Measure min radius of curvature of surface in the given point.
11168 theSurf the given surface.
11169 thePoint given point.
11172 Min radius of curvature of theSurf.
11174 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11175 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11179 ## Get min and max tolerances of sub-shapes of theShape
11180 # @param theShape Shape, to get tolerances of.
11181 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11182 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11183 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11184 # VertMin,VertMax: Min and max tolerances of the vertices.
11186 # @ref tui_tolerance_page "Example"
11187 @ManageTransactions("MeasuOp")
11188 def Tolerance(self,theShape):
11190 Get min and max tolerances of sub-shapes of theShape
11193 theShape Shape, to get tolerances of.
11196 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11197 FaceMin,FaceMax: Min and max tolerances of the faces.
11198 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11199 VertMin,VertMax: Min and max tolerances of the vertices.
11201 # Example: see GEOM_TestMeasures.py
11202 aTuple = self.MeasuOp.GetTolerance(theShape)
11203 RaiseIfFailed("GetTolerance", self.MeasuOp)
11206 ## Obtain description of the given shape (number of sub-shapes of each type)
11207 # @param theShape Shape to be described.
11208 # @return Description of the given shape.
11210 # @ref tui_whatis_page "Example"
11211 @ManageTransactions("MeasuOp")
11212 def WhatIs(self,theShape):
11214 Obtain description of the given shape (number of sub-shapes of each type)
11217 theShape Shape to be described.
11220 Description of the given shape.
11222 # Example: see GEOM_TestMeasures.py
11223 aDescr = self.MeasuOp.WhatIs(theShape)
11224 RaiseIfFailed("WhatIs", self.MeasuOp)
11227 ## Obtain quantity of shapes of the given type in \a theShape.
11228 # If \a theShape is of type \a theType, it is also counted.
11229 # @param theShape Shape to be described.
11230 # @param theType the given ShapeType().
11231 # @return Quantity of shapes of type \a theType in \a theShape.
11233 # @ref tui_measurement_tools_page "Example"
11234 def NbShapes (self, theShape, theType):
11236 Obtain quantity of shapes of the given type in theShape.
11237 If theShape is of type theType, it is also counted.
11240 theShape Shape to be described.
11241 theType the given geompy.ShapeType
11244 Quantity of shapes of type theType in theShape.
11246 # Example: see GEOM_TestMeasures.py
11247 listSh = self.SubShapeAllIDs(theShape, theType)
11251 ## Obtain quantity of shapes of each type in \a theShape.
11252 # The \a theShape is also counted.
11253 # @param theShape Shape to be described.
11254 # @return Dictionary of ShapeType() with bound quantities of shapes.
11256 # @ref tui_measurement_tools_page "Example"
11257 def ShapeInfo (self, theShape):
11259 Obtain quantity of shapes of each type in theShape.
11260 The theShape is also counted.
11263 theShape Shape to be described.
11266 Dictionary of geompy.ShapeType with bound quantities of shapes.
11268 # Example: see GEOM_TestMeasures.py
11270 for typeSh in self.ShapeType:
11271 if typeSh in ( "AUTO", "SHAPE" ): continue
11272 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11278 def GetCreationInformation(self, theShape):
11280 infos = theShape.GetCreationInformation()
11283 opName = info.operationName
11284 if not opName: opName = "no info available"
11285 if res: res += "\n"
11286 res += "Operation: " + opName
11288 for parVal in info.params:
11289 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11292 ## Get a point, situated at the centre of mass of theShape.
11293 # @param theShape Shape to define centre of mass of.
11294 # @param theName Object name; when specified, this parameter is used
11295 # for result publication in the study. Otherwise, if automatic
11296 # publication is switched on, default value is used for result name.
11298 # @return New GEOM.GEOM_Object, containing the created point.
11300 # @ref tui_center_of_mass_page "Example"
11301 @ManageTransactions("MeasuOp")
11302 def MakeCDG(self, theShape, theName=None):
11304 Get a point, situated at the centre of mass of theShape.
11307 theShape Shape to define centre of mass of.
11308 theName Object name; when specified, this parameter is used
11309 for result publication in the study. Otherwise, if automatic
11310 publication is switched on, default value is used for result name.
11313 New GEOM.GEOM_Object, containing the created point.
11315 # Example: see GEOM_TestMeasures.py
11316 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11317 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11318 self._autoPublish(anObj, theName, "centerOfMass")
11321 ## Get a vertex sub-shape by index.
11322 # @param theShape Shape to find sub-shape.
11323 # @param theIndex Index to find vertex by this index (starting from zero)
11324 # @param theUseOri To consider edge/wire orientation or not
11325 # @param theName Object name; when specified, this parameter is used
11326 # for result publication in the study. Otherwise, if automatic
11327 # publication is switched on, default value is used for result name.
11329 # @return New GEOM.GEOM_Object, containing the created vertex.
11331 # @ref tui_measurement_tools_page "Example"
11332 @ManageTransactions("MeasuOp")
11333 def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
11335 Get a vertex sub-shape by index.
11338 theShape Shape to find sub-shape.
11339 theIndex Index to find vertex by this index (starting from zero)
11340 theUseOri To consider edge/wire orientation or not
11341 theName Object name; when specified, this parameter is used
11342 for result publication in the study. Otherwise, if automatic
11343 publication is switched on, default value is used for result name.
11346 New GEOM.GEOM_Object, containing the created vertex.
11348 # Example: see GEOM_TestMeasures.py
11349 if isinstance( theUseOri, str ): # theUseOri was inserted before theName
11350 theUseOri, theName = True, theUseOri
11351 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
11352 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11353 self._autoPublish(anObj, theName, "vertex")
11356 ## Get the first vertex of wire/edge depended orientation.
11357 # @param theShape Shape to find first vertex.
11358 # @param theName Object name; when specified, this parameter is used
11359 # for result publication in the study. Otherwise, if automatic
11360 # publication is switched on, default value is used for result name.
11362 # @return New GEOM.GEOM_Object, containing the created vertex.
11364 # @ref tui_measurement_tools_page "Example"
11365 def GetFirstVertex(self, theShape, theName=None):
11367 Get the first vertex of wire/edge depended orientation.
11370 theShape Shape to find first vertex.
11371 theName Object name; when specified, this parameter is used
11372 for result publication in the study. Otherwise, if automatic
11373 publication is switched on, default value is used for result name.
11376 New GEOM.GEOM_Object, containing the created vertex.
11378 # Example: see GEOM_TestMeasures.py
11379 # note: auto-publishing is done in self.GetVertexByIndex()
11380 return self.GetVertexByIndex(theShape, 0, True, theName)
11382 ## Get the last vertex of wire/edge depended orientation.
11383 # @param theShape Shape to find last vertex.
11384 # @param theName Object name; when specified, this parameter is used
11385 # for result publication in the study. Otherwise, if automatic
11386 # publication is switched on, default value is used for result name.
11388 # @return New GEOM.GEOM_Object, containing the created vertex.
11390 # @ref tui_measurement_tools_page "Example"
11391 def GetLastVertex(self, theShape, theName=None):
11393 Get the last vertex of wire/edge depended orientation.
11396 theShape Shape to find last vertex.
11397 theName Object name; when specified, this parameter is used
11398 for result publication in the study. Otherwise, if automatic
11399 publication is switched on, default value is used for result name.
11402 New GEOM.GEOM_Object, containing the created vertex.
11404 # Example: see GEOM_TestMeasures.py
11405 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11406 # note: auto-publishing is done in self.GetVertexByIndex()
11407 return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
11409 ## Get a normale to the given face. If the point is not given,
11410 # the normale is calculated at the center of mass.
11411 # @param theFace Face to define normale of.
11412 # @param theOptionalPoint Point to compute the normale at.
11413 # @param theName Object name; when specified, this parameter is used
11414 # for result publication in the study. Otherwise, if automatic
11415 # publication is switched on, default value is used for result name.
11417 # @return New GEOM.GEOM_Object, containing the created vector.
11419 # @ref swig_todo "Example"
11420 @ManageTransactions("MeasuOp")
11421 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11423 Get a normale to the given face. If the point is not given,
11424 the normale is calculated at the center of mass.
11427 theFace Face to define normale of.
11428 theOptionalPoint Point to compute the normale at.
11429 theName Object name; when specified, this parameter is used
11430 for result publication in the study. Otherwise, if automatic
11431 publication is switched on, default value is used for result name.
11434 New GEOM.GEOM_Object, containing the created vector.
11436 # Example: see GEOM_TestMeasures.py
11437 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11438 RaiseIfFailed("GetNormal", self.MeasuOp)
11439 self._autoPublish(anObj, theName, "normal")
11442 ## Print shape errors obtained from CheckShape.
11443 # @param theShape Shape that was checked.
11444 # @param theShapeErrors the shape errors obtained by CheckShape.
11445 # @param theReturnStatus If 0 the description of problem is printed.
11446 # If 1 the description of problem is returned.
11447 # @return If theReturnStatus is equal to 1 the description is returned.
11448 # Otherwise doesn't return anything.
11450 # @ref tui_check_shape_page "Example"
11451 @ManageTransactions("MeasuOp")
11452 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11454 Print shape errors obtained from CheckShape.
11457 theShape Shape that was checked.
11458 theShapeErrors the shape errors obtained by CheckShape.
11459 theReturnStatus If 0 the description of problem is printed.
11460 If 1 the description of problem is returned.
11463 If theReturnStatus is equal to 1 the description is returned.
11464 Otherwise doesn't return anything.
11466 # Example: see GEOM_TestMeasures.py
11467 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11468 if theReturnStatus == 1:
11473 ## Check a topology of the given shape.
11474 # @param theShape Shape to check validity of.
11475 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11476 # if TRUE, the shape's geometry will be checked also.
11477 # @param theReturnStatus If 0 and if theShape is invalid, a description
11478 # of problem is printed.
11479 # If 1 isValid flag and the description of
11480 # problem is returned.
11481 # If 2 isValid flag and the list of error data
11483 # @return TRUE, if the shape "seems to be valid".
11484 # If theShape is invalid, prints a description of problem.
11485 # If theReturnStatus is equal to 1 the description is returned
11486 # along with IsValid flag.
11487 # If theReturnStatus is equal to 2 the list of error data is
11488 # returned along with IsValid flag.
11490 # @ref tui_check_shape_page "Example"
11491 @ManageTransactions("MeasuOp")
11492 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11494 Check a topology of the given shape.
11497 theShape Shape to check validity of.
11498 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11499 if TRUE, the shape's geometry will be checked also.
11500 theReturnStatus If 0 and if theShape is invalid, a description
11501 of problem is printed.
11502 If 1 IsValid flag and the description of
11503 problem is returned.
11504 If 2 IsValid flag and the list of error data
11508 TRUE, if the shape "seems to be valid".
11509 If theShape is invalid, prints a description of problem.
11510 If theReturnStatus is equal to 1 the description is returned
11511 along with IsValid flag.
11512 If theReturnStatus is equal to 2 the list of error data is
11513 returned along with IsValid flag.
11515 # Example: see GEOM_TestMeasures.py
11517 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11518 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11520 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11521 RaiseIfFailed("CheckShape", self.MeasuOp)
11523 if theReturnStatus == 0:
11524 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11526 if theReturnStatus == 1:
11527 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11528 return (IsValid, Descr)
11529 elif theReturnStatus == 2:
11530 return (IsValid, ShapeErrors)
11533 ## Detect self-intersections in the given shape.
11534 # @param theShape Shape to check.
11535 # @param theCheckLevel is the level of self-intersection check.
11536 # Possible input values are:
11537 # - GEOM.SI_V_V(0) - only V/V interferences
11538 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11539 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11540 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11541 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11542 # - GEOM.SI_ALL(5) - all interferences.
11543 # @return TRUE, if the shape contains no self-intersections.
11545 # @ref tui_check_self_intersections_page "Example"
11546 @ManageTransactions("MeasuOp")
11547 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11549 Detect self-intersections in the given shape.
11552 theShape Shape to check.
11553 theCheckLevel is the level of self-intersection check.
11554 Possible input values are:
11555 - GEOM.SI_V_V(0) - only V/V interferences
11556 - GEOM.SI_V_E(1) - V/V and V/E interferences
11557 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11558 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11559 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11560 - GEOM.SI_ALL(5) - all interferences.
11563 TRUE, if the shape contains no self-intersections.
11565 # Example: see GEOM_TestMeasures.py
11566 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11567 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11570 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11571 # @param theShape Shape to check.
11572 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11573 # - if \a theDeflection <= 0, default deflection 0.001 is used
11574 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11575 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11576 # - if \a theTolerance > 0, algorithm detects gaps
11577 # @return TRUE, if the shape contains no self-intersections.
11579 # @ref tui_check_self_intersections_fast_page "Example"
11580 @ManageTransactions("MeasuOp")
11581 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11583 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11586 theShape Shape to check.
11587 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11588 - if theDeflection <= 0, default deflection 0.001 is used
11589 theTolerance Specifies a distance between shapes used for detecting gaps:
11590 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11591 - if theTolerance > 0, algorithm detects gaps
11594 TRUE, if the shape contains no self-intersections.
11596 # Example: see GEOM_TestMeasures.py
11597 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11598 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11601 ## Check boolean and partition operations arguments.
11602 # @param theShape the argument of an operation to be checked
11603 # @return TRUE if the argument is valid for a boolean or partition
11604 # operation; FALSE otherwise.
11605 @ManageTransactions("MeasuOp")
11606 def CheckBOPArguments(self, theShape):
11608 Check boolean and partition operations arguments.
11611 theShape the argument of an operation to be checked
11614 TRUE if the argument is valid for a boolean or partition
11615 operation; FALSE otherwise.
11617 return self.MeasuOp.CheckBOPArguments(theShape)
11619 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11620 # @param theShape1 First source object
11621 # @param theShape2 Second source object
11622 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11623 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11624 # - if \a theTolerance > 0, algorithm detects gaps
11625 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11626 # - if \a theDeflection <= 0, default deflection 0.001 is used
11627 # @return TRUE, if there are intersections (gaps) between source shapes
11628 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11629 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11631 # @ref tui_fast_intersection_page "Example"
11632 @ManageTransactions("MeasuOp")
11633 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11635 Detect intersections of the given shapes with algorithm based on mesh intersections.
11638 theShape1 First source object
11639 theShape2 Second source object
11640 theTolerance Specifies a distance between shapes used for detecting gaps:
11641 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11642 - if theTolerance > 0, algorithm detects gaps
11643 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11644 - if theDeflection <= 0, default deflection 0.001 is used
11647 TRUE, if there are intersections (gaps) between source shapes
11648 List of sub-shapes IDs from 1st shape that localize intersection.
11649 List of sub-shapes IDs from 2nd shape that localize intersection.
11651 # Example: see GEOM_TestMeasures.py
11652 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11653 RaiseIfFailed("FastIntersect", self.MeasuOp)
11654 return IsOk, Res1, Res2
11656 ## Get position (LCS) of theShape.
11658 # Origin of the LCS is situated at the shape's center of mass.
11659 # Axes of the LCS are obtained from shape's location or,
11660 # if the shape is a planar face, from position of its plane.
11662 # @param theShape Shape to calculate position of.
11663 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11664 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11665 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11666 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11668 # @ref swig_todo "Example"
11669 @ManageTransactions("MeasuOp")
11670 def GetPosition(self,theShape):
11672 Get position (LCS) of theShape.
11673 Origin of the LCS is situated at the shape's center of mass.
11674 Axes of the LCS are obtained from shape's location or,
11675 if the shape is a planar face, from position of its plane.
11678 theShape Shape to calculate position of.
11681 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11682 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11683 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11684 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11686 # Example: see GEOM_TestMeasures.py
11687 aTuple = self.MeasuOp.GetPosition(theShape)
11688 RaiseIfFailed("GetPosition", self.MeasuOp)
11691 ## Get kind of theShape.
11693 # @param theShape Shape to get a kind of.
11694 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11695 # and a list of parameters, describing the shape.
11696 # @note Concrete meaning of each value, returned via \a theIntegers
11697 # or \a theDoubles list depends on the kind() of the shape.
11699 # @ref swig_todo "Example"
11700 @ManageTransactions("MeasuOp")
11701 def KindOfShape(self,theShape):
11703 Get kind of theShape.
11706 theShape Shape to get a kind of.
11709 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11710 and a list of parameters, describing the shape.
11712 Concrete meaning of each value, returned via theIntegers
11713 or theDoubles list depends on the geompy.kind of the shape
11715 # Example: see GEOM_TestMeasures.py
11716 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11717 RaiseIfFailed("KindOfShape", self.MeasuOp)
11719 aKind = aRoughTuple[0]
11720 anInts = aRoughTuple[1]
11721 aDbls = aRoughTuple[2]
11723 # Now there is no exception from this rule:
11724 aKindTuple = [aKind] + aDbls + anInts
11726 # If they are we will regroup parameters for such kind of shape.
11728 #if aKind == kind.SOME_KIND:
11729 # # SOME_KIND int int double int double double
11730 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11734 ## Returns the string that describes if the shell is good for solid.
11735 # This is a support method for MakeSolid.
11737 # @param theShell the shell to be checked.
11738 # @return Returns a string that describes the shell validity for
11739 # solid construction.
11740 @ManageTransactions("MeasuOp")
11741 def _IsGoodForSolid(self, theShell):
11743 Returns the string that describes if the shell is good for solid.
11744 This is a support method for MakeSolid.
11747 theShell the shell to be checked.
11750 Returns a string that describes the shell validity for
11751 solid construction.
11753 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11756 # end of l2_measure
11759 ## @addtogroup l2_import_export
11762 ## Import a shape from the BREP, IGES, STEP or other file
11763 # (depends on given format) with given name.
11765 # Note: this function is deprecated, it is kept for backward compatibility only
11766 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11768 # @param theFileName The file, containing the shape.
11769 # @param theFormatName Specify format for the file reading.
11770 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11771 # If format 'IGES_SCALE' is used instead of 'IGES' or
11772 # format 'STEP_SCALE' is used instead of 'STEP',
11773 # length unit will be set to 'meter' and result model will be scaled.
11774 # @param theName Object name; when specified, this parameter is used
11775 # for result publication in the study. Otherwise, if automatic
11776 # publication is switched on, default value is used for result name.
11778 # @return New GEOM.GEOM_Object, containing the imported shape.
11779 # If material names are imported it returns the list of
11780 # objects. The first one is the imported object followed by
11782 # @note Auto publishing is allowed for the shape itself. Imported
11783 # material groups are not automatically published.
11785 # @ref swig_Import_Export "Example"
11786 @ManageTransactions("InsertOp")
11787 def ImportFile(self, theFileName, theFormatName, theName=None):
11789 Import a shape from the BREP, IGES, STEP or other file
11790 (depends on given format) with given name.
11792 Note: this function is deprecated, it is kept for backward compatibility only
11793 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11796 theFileName The file, containing the shape.
11797 theFormatName Specify format for the file reading.
11798 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11799 If format 'IGES_SCALE' is used instead of 'IGES' or
11800 format 'STEP_SCALE' is used instead of 'STEP',
11801 length unit will be set to 'meter' and result model will be scaled.
11802 theName Object name; when specified, this parameter is used
11803 for result publication in the study. Otherwise, if automatic
11804 publication is switched on, default value is used for result name.
11807 New GEOM.GEOM_Object, containing the imported shape.
11808 If material names are imported it returns the list of
11809 objects. The first one is the imported object followed by
11812 Auto publishing is allowed for the shape itself. Imported
11813 material groups are not automatically published.
11815 # Example: see GEOM_TestOthers.py
11817 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11818 where <FormatName> is a name of desirable format for importing.
11820 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11821 RaiseIfFailed("ImportFile", self.InsertOp)
11822 aNbObj = len(aListObj)
11824 self._autoPublish(aListObj[0], theName, "imported")
11829 ## Deprecated analog of ImportFile()
11830 def Import(self, theFileName, theFormatName, theName=None):
11832 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11834 # note: auto-publishing is done in self.ImportFile()
11835 return self.ImportFile(theFileName, theFormatName, theName)
11837 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11839 # @note As the byte-stream representing the shape data can be quite large, this method
11840 # is not automatically dumped to the Python script with the DumpStudy functionality;
11841 # so please use this method carefully, only for strong reasons.
11843 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11846 # @param theStream The BRep binary stream.
11847 # @param theName Object name; when specified, this parameter is used
11848 # for result publication in the study. Otherwise, if automatic
11849 # publication is switched on, default value is used for result name.
11851 # @return New GEOM_Object, containing the shape, read from theStream.
11853 # @ref swig_Import_Export "Example"
11854 @ManageTransactions("InsertOp")
11855 def RestoreShape (self, theStream, theName=None):
11857 Read a shape from the binary stream, containing its bounding representation (BRep).
11860 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11863 theStream The BRep binary stream.
11864 theName Object name; when specified, this parameter is used
11865 for result publication in the study. Otherwise, if automatic
11866 publication is switched on, default value is used for result name.
11869 New GEOM_Object, containing the shape, read from theStream.
11871 # Example: see GEOM_TestOthers.py
11873 # this is the workaround to ignore invalid case when data stream is empty
11874 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11875 print("WARNING: Result of RestoreShape is a NULL shape!")
11877 anObj = self.InsertOp.RestoreShape(theStream)
11878 RaiseIfFailed("RestoreShape", self.InsertOp)
11879 self._autoPublish(anObj, theName, "restored")
11882 ## Export the given shape into a file with given name.
11884 # Note: this function is deprecated, it is kept for backward compatibility only
11885 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11887 # @param theObject Shape to be stored in the file.
11888 # @param theFileName Name of the file to store the given shape in.
11889 # @param theFormatName Specify format for the shape storage.
11890 # Available formats can be obtained with
11891 # geompy.InsertOp.ExportTranslators()[0] method.
11893 # @ref swig_Import_Export "Example"
11894 @ManageTransactions("InsertOp")
11895 def Export(self, theObject, theFileName, theFormatName):
11897 Export the given shape into a file with given name.
11899 Note: this function is deprecated, it is kept for backward compatibility only
11900 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11903 theObject Shape to be stored in the file.
11904 theFileName Name of the file to store the given shape in.
11905 theFormatName Specify format for the shape storage.
11906 Available formats can be obtained with
11907 geompy.InsertOp.ExportTranslators()[0] method.
11909 # Example: see GEOM_TestOthers.py
11911 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11912 where <FormatName> is a name of desirable format for exporting.
11914 self.InsertOp.Export(theObject, theFileName, theFormatName)
11915 if self.InsertOp.IsDone() == 0:
11916 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11920 # end of l2_import_export
11923 ## @addtogroup l3_blocks
11926 ## Create a quadrangle face from four edges. Order of Edges is not
11927 # important. It is not necessary that edges share the same vertex.
11928 # @param E1,E2,E3,E4 Edges for the face bound.
11929 # @param theName Object name; when specified, this parameter is used
11930 # for result publication in the study. Otherwise, if automatic
11931 # publication is switched on, default value is used for result name.
11933 # @return New GEOM.GEOM_Object, containing the created face.
11935 # @ref tui_building_by_blocks_page "Example"
11936 @ManageTransactions("BlocksOp")
11937 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11939 Create a quadrangle face from four edges. Order of Edges is not
11940 important. It is not necessary that edges share the same vertex.
11943 E1,E2,E3,E4 Edges for the face bound.
11944 theName Object name; when specified, this parameter is used
11945 for result publication in the study. Otherwise, if automatic
11946 publication is switched on, default value is used for result name.
11949 New GEOM.GEOM_Object, containing the created face.
11952 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11954 # Example: see GEOM_Spanner.py
11955 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11956 RaiseIfFailed("MakeQuad", self.BlocksOp)
11957 self._autoPublish(anObj, theName, "quad")
11960 ## Create a quadrangle face on two edges.
11961 # The missing edges will be built by creating the shortest ones.
11962 # @param E1,E2 Two opposite edges for the face.
11963 # @param theName Object name; when specified, this parameter is used
11964 # for result publication in the study. Otherwise, if automatic
11965 # publication is switched on, default value is used for result name.
11967 # @return New GEOM.GEOM_Object, containing the created face.
11969 # @ref tui_building_by_blocks_page "Example"
11970 @ManageTransactions("BlocksOp")
11971 def MakeQuad2Edges(self, E1, E2, theName=None):
11973 Create a quadrangle face on two edges.
11974 The missing edges will be built by creating the shortest ones.
11977 E1,E2 Two opposite edges for the face.
11978 theName Object name; when specified, this parameter is used
11979 for result publication in the study. Otherwise, if automatic
11980 publication is switched on, default value is used for result name.
11983 New GEOM.GEOM_Object, containing the created face.
11987 p1 = geompy.MakeVertex( 0., 0., 0.)
11988 p2 = geompy.MakeVertex(150., 30., 0.)
11989 p3 = geompy.MakeVertex( 0., 120., 50.)
11990 p4 = geompy.MakeVertex( 0., 40., 70.)
11992 edge1 = geompy.MakeEdge(p1, p2)
11993 edge2 = geompy.MakeEdge(p3, p4)
11994 # create a quadrangle face from two edges
11995 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11997 # Example: see GEOM_Spanner.py
11998 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
11999 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
12000 self._autoPublish(anObj, theName, "quad")
12003 ## Create a quadrangle face with specified corners.
12004 # The missing edges will be built by creating the shortest ones.
12005 # @param V1,V2,V3,V4 Corner vertices for the face.
12006 # @param theName Object name; when specified, this parameter is used
12007 # for result publication in the study. Otherwise, if automatic
12008 # publication is switched on, default value is used for result name.
12010 # @return New GEOM.GEOM_Object, containing the created face.
12012 # @ref tui_building_by_blocks_page "Example 1"
12013 # \n @ref swig_MakeQuad4Vertices "Example 2"
12014 @ManageTransactions("BlocksOp")
12015 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12017 Create a quadrangle face with specified corners.
12018 The missing edges will be built by creating the shortest ones.
12021 V1,V2,V3,V4 Corner vertices for the face.
12022 theName Object name; when specified, this parameter is used
12023 for result publication in the study. Otherwise, if automatic
12024 publication is switched on, default value is used for result name.
12027 New GEOM.GEOM_Object, containing the created face.
12031 p1 = geompy.MakeVertex( 0., 0., 0.)
12032 p2 = geompy.MakeVertex(150., 30., 0.)
12033 p3 = geompy.MakeVertex( 0., 120., 50.)
12034 p4 = geompy.MakeVertex( 0., 40., 70.)
12035 # create a quadrangle from four points in its corners
12036 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12038 # Example: see GEOM_Spanner.py
12039 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12040 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12041 self._autoPublish(anObj, theName, "quad")
12044 ## Create a hexahedral solid, bounded by the six given faces. Order of
12045 # faces is not important. It is not necessary that Faces share the same edge.
12046 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12047 # @param theName Object name; when specified, this parameter is used
12048 # for result publication in the study. Otherwise, if automatic
12049 # publication is switched on, default value is used for result name.
12051 # @return New GEOM.GEOM_Object, containing the created solid.
12053 # @ref tui_building_by_blocks_page "Example 1"
12054 # \n @ref swig_MakeHexa "Example 2"
12055 @ManageTransactions("BlocksOp")
12056 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12058 Create a hexahedral solid, bounded by the six given faces. Order of
12059 faces is not important. It is not necessary that Faces share the same edge.
12062 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12063 theName Object name; when specified, this parameter is used
12064 for result publication in the study. Otherwise, if automatic
12065 publication is switched on, default value is used for result name.
12068 New GEOM.GEOM_Object, containing the created solid.
12071 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12073 # Example: see GEOM_Spanner.py
12074 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12075 RaiseIfFailed("MakeHexa", self.BlocksOp)
12076 self._autoPublish(anObj, theName, "hexa")
12079 ## Create a hexahedral solid between two given faces.
12080 # The missing faces will be built by creating the smallest ones.
12081 # @param F1,F2 Two opposite faces for the hexahedral solid.
12082 # @param theName Object name; when specified, this parameter is used
12083 # for result publication in the study. Otherwise, if automatic
12084 # publication is switched on, default value is used for result name.
12086 # @return New GEOM.GEOM_Object, containing the created solid.
12088 # @ref tui_building_by_blocks_page "Example 1"
12089 # \n @ref swig_MakeHexa2Faces "Example 2"
12090 @ManageTransactions("BlocksOp")
12091 def MakeHexa2Faces(self, F1, F2, theName=None):
12093 Create a hexahedral solid between two given faces.
12094 The missing faces will be built by creating the smallest ones.
12097 F1,F2 Two opposite faces for the hexahedral solid.
12098 theName Object name; when specified, this parameter is used
12099 for result publication in the study. Otherwise, if automatic
12100 publication is switched on, default value is used for result name.
12103 New GEOM.GEOM_Object, containing the created solid.
12106 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12108 # Example: see GEOM_Spanner.py
12109 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12110 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12111 self._autoPublish(anObj, theName, "hexa")
12117 ## @addtogroup l3_blocks_op
12120 ## Get a vertex, found in the given shape by its coordinates.
12121 # @param theShape Block or a compound of blocks.
12122 # @param theX,theY,theZ Coordinates of the sought vertex.
12123 # @param theEpsilon Maximum allowed distance between the resulting
12124 # vertex and point with the given coordinates.
12125 # @param theName Object name; when specified, this parameter is used
12126 # for result publication in the study. Otherwise, if automatic
12127 # publication is switched on, default value is used for result name.
12129 # @return New GEOM.GEOM_Object, containing the found vertex.
12131 # @ref swig_GetPoint "Example"
12132 @ManageTransactions("BlocksOp")
12133 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12135 Get a vertex, found in the given shape by its coordinates.
12138 theShape Block or a compound of blocks.
12139 theX,theY,theZ Coordinates of the sought vertex.
12140 theEpsilon Maximum allowed distance between the resulting
12141 vertex and point with the given coordinates.
12142 theName Object name; when specified, this parameter is used
12143 for result publication in the study. Otherwise, if automatic
12144 publication is switched on, default value is used for result name.
12147 New GEOM.GEOM_Object, containing the found vertex.
12150 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12152 # Example: see GEOM_TestOthers.py
12153 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12154 RaiseIfFailed("GetPoint", self.BlocksOp)
12155 self._autoPublish(anObj, theName, "vertex")
12158 ## Find a vertex of the given shape, which has minimal distance to the given point.
12159 # @param theShape Any shape.
12160 # @param thePoint Point, close to the desired vertex.
12161 # @param theName Object name; when specified, this parameter is used
12162 # for result publication in the study. Otherwise, if automatic
12163 # publication is switched on, default value is used for result name.
12165 # @return New GEOM.GEOM_Object, containing the found vertex.
12167 # @ref swig_GetVertexNearPoint "Example"
12168 @ManageTransactions("BlocksOp")
12169 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12171 Find a vertex of the given shape, which has minimal distance to the given point.
12174 theShape Any shape.
12175 thePoint Point, close to the desired vertex.
12176 theName Object name; when specified, this parameter is used
12177 for result publication in the study. Otherwise, if automatic
12178 publication is switched on, default value is used for result name.
12181 New GEOM.GEOM_Object, containing the found vertex.
12184 pmidle = geompy.MakeVertex(50, 0, 50)
12185 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12187 # Example: see GEOM_TestOthers.py
12188 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12189 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12190 self._autoPublish(anObj, theName, "vertex")
12193 ## Get an edge, found in the given shape by two given vertices.
12194 # @param theShape Block or a compound of blocks.
12195 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12196 # @param theName Object name; when specified, this parameter is used
12197 # for result publication in the study. Otherwise, if automatic
12198 # publication is switched on, default value is used for result name.
12200 # @return New GEOM.GEOM_Object, containing the found edge.
12202 # @ref swig_GetEdge "Example"
12203 @ManageTransactions("BlocksOp")
12204 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12206 Get an edge, found in the given shape by two given vertices.
12209 theShape Block or a compound of blocks.
12210 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12211 theName Object name; when specified, this parameter is used
12212 for result publication in the study. Otherwise, if automatic
12213 publication is switched on, default value is used for result name.
12216 New GEOM.GEOM_Object, containing the found edge.
12218 # Example: see GEOM_Spanner.py
12219 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12220 RaiseIfFailed("GetEdge", self.BlocksOp)
12221 self._autoPublish(anObj, theName, "edge")
12224 ## Find an edge of the given shape, which has minimal distance to the given point.
12225 # @param theShape Block or a compound of blocks.
12226 # @param thePoint Point, close to the desired edge.
12227 # @param theName Object name; when specified, this parameter is used
12228 # for result publication in the study. Otherwise, if automatic
12229 # publication is switched on, default value is used for result name.
12231 # @return New GEOM.GEOM_Object, containing the found edge.
12233 # @ref swig_GetEdgeNearPoint "Example"
12234 @ManageTransactions("BlocksOp")
12235 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12237 Find an edge of the given shape, which has minimal distance to the given point.
12240 theShape Block or a compound of blocks.
12241 thePoint Point, close to the desired edge.
12242 theName Object name; when specified, this parameter is used
12243 for result publication in the study. Otherwise, if automatic
12244 publication is switched on, default value is used for result name.
12247 New GEOM.GEOM_Object, containing the found edge.
12249 # Example: see GEOM_TestOthers.py
12250 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12251 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12252 self._autoPublish(anObj, theName, "edge")
12255 ## Returns a face, found in the given shape by four given corner vertices.
12256 # @param theShape Block or a compound of blocks.
12257 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12258 # @param theName Object name; when specified, this parameter is used
12259 # for result publication in the study. Otherwise, if automatic
12260 # publication is switched on, default value is used for result name.
12262 # @return New GEOM.GEOM_Object, containing the found face.
12264 # @ref swig_todo "Example"
12265 @ManageTransactions("BlocksOp")
12266 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12268 Returns a face, found in the given shape by four given corner vertices.
12271 theShape Block or a compound of blocks.
12272 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12273 theName Object name; when specified, this parameter is used
12274 for result publication in the study. Otherwise, if automatic
12275 publication is switched on, default value is used for result name.
12278 New GEOM.GEOM_Object, containing the found face.
12280 # Example: see GEOM_Spanner.py
12281 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12282 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12283 self._autoPublish(anObj, theName, "face")
12286 ## Get a face of block, found in the given shape by two given edges.
12287 # @param theShape Block or a compound of blocks.
12288 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12289 # @param theName Object name; when specified, this parameter is used
12290 # for result publication in the study. Otherwise, if automatic
12291 # publication is switched on, default value is used for result name.
12293 # @return New GEOM.GEOM_Object, containing the found face.
12295 # @ref swig_todo "Example"
12296 @ManageTransactions("BlocksOp")
12297 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12299 Get a face of block, found in the given shape by two given edges.
12302 theShape Block or a compound of blocks.
12303 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12304 theName Object name; when specified, this parameter is used
12305 for result publication in the study. Otherwise, if automatic
12306 publication is switched on, default value is used for result name.
12309 New GEOM.GEOM_Object, containing the found face.
12311 # Example: see GEOM_Spanner.py
12312 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12313 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12314 self._autoPublish(anObj, theName, "face")
12317 ## Find a face, opposite to the given one in the given block.
12318 # @param theBlock Must be a hexahedral solid.
12319 # @param theFace Face of \a theBlock, opposite to the desired face.
12320 # @param theName Object name; when specified, this parameter is used
12321 # for result publication in the study. Otherwise, if automatic
12322 # publication is switched on, default value is used for result name.
12324 # @return New GEOM.GEOM_Object, containing the found face.
12326 # @ref swig_GetOppositeFace "Example"
12327 @ManageTransactions("BlocksOp")
12328 def GetOppositeFace(self, theBlock, theFace, theName=None):
12330 Find a face, opposite to the given one in the given block.
12333 theBlock Must be a hexahedral solid.
12334 theFace Face of theBlock, opposite to the desired face.
12335 theName Object name; when specified, this parameter is used
12336 for result publication in the study. Otherwise, if automatic
12337 publication is switched on, default value is used for result name.
12340 New GEOM.GEOM_Object, containing the found face.
12342 # Example: see GEOM_Spanner.py
12343 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12344 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12345 self._autoPublish(anObj, theName, "face")
12348 ## Find a face of the given shape, which has minimal distance to the given point.
12349 # @param theShape Block or a compound of blocks.
12350 # @param thePoint Point, close to the desired face.
12351 # @param theName Object name; when specified, this parameter is used
12352 # for result publication in the study. Otherwise, if automatic
12353 # publication is switched on, default value is used for result name.
12355 # @return New GEOM.GEOM_Object, containing the found face.
12357 # @ref swig_GetFaceNearPoint "Example"
12358 @ManageTransactions("BlocksOp")
12359 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12361 Find a face of the given shape, which has minimal distance to the given point.
12364 theShape Block or a compound of blocks.
12365 thePoint Point, close to the desired face.
12366 theName Object name; when specified, this parameter is used
12367 for result publication in the study. Otherwise, if automatic
12368 publication is switched on, default value is used for result name.
12371 New GEOM.GEOM_Object, containing the found face.
12373 # Example: see GEOM_Spanner.py
12374 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12375 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12376 self._autoPublish(anObj, theName, "face")
12379 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12380 # @param theBlock Block or a compound of blocks.
12381 # @param theVector Vector, close to the normale of the desired face.
12382 # @param theName Object name; when specified, this parameter is used
12383 # for result publication in the study. Otherwise, if automatic
12384 # publication is switched on, default value is used for result name.
12386 # @return New GEOM.GEOM_Object, containing the found face.
12388 # @ref swig_todo "Example"
12389 @ManageTransactions("BlocksOp")
12390 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12392 Find a face of block, whose outside normale has minimal angle with the given vector.
12395 theBlock Block or a compound of blocks.
12396 theVector Vector, close to the normale of the desired face.
12397 theName Object name; when specified, this parameter is used
12398 for result publication in the study. Otherwise, if automatic
12399 publication is switched on, default value is used for result name.
12402 New GEOM.GEOM_Object, containing the found face.
12404 # Example: see GEOM_Spanner.py
12405 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12406 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12407 self._autoPublish(anObj, theName, "face")
12410 ## Find all sub-shapes of type \a theShapeType of the given shape,
12411 # which have minimal distance to the given point.
12412 # @param theShape Any shape.
12413 # @param thePoint Point, close to the desired shape.
12414 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12415 # @param theTolerance The tolerance for distances comparison. All shapes
12416 # with distances to the given point in interval
12417 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12418 # @param theName Object name; when specified, this parameter is used
12419 # for result publication in the study. Otherwise, if automatic
12420 # publication is switched on, default value is used for result name.
12422 # @return New GEOM_Object, containing a group of all found shapes.
12424 # @ref swig_GetShapesNearPoint "Example"
12425 @ManageTransactions("BlocksOp")
12426 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12428 Find all sub-shapes of type theShapeType of the given shape,
12429 which have minimal distance to the given point.
12432 theShape Any shape.
12433 thePoint Point, close to the desired shape.
12434 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12435 theTolerance The tolerance for distances comparison. All shapes
12436 with distances to the given point in interval
12437 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12438 theName Object name; when specified, this parameter is used
12439 for result publication in the study. Otherwise, if automatic
12440 publication is switched on, default value is used for result name.
12443 New GEOM_Object, containing a group of all found shapes.
12445 # Example: see GEOM_TestOthers.py
12446 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12447 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12448 self._autoPublish(anObj, theName, "group")
12451 # end of l3_blocks_op
12454 ## @addtogroup l4_blocks_measure
12457 ## Check, if the compound of blocks is given.
12458 # To be considered as a compound of blocks, the
12459 # given shape must satisfy the following conditions:
12460 # - Each element of the compound should be a Block (6 faces).
12461 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12462 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12463 # there are more than 4 edges in the only wire of a face,
12464 # this face is considered to be quadrangle if it has 4 bounds
12465 # (1 or more edge) of C1 continuity.
12466 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12467 # - The compound should be connexe.
12468 # - The glue between two quadrangle faces should be applied.
12469 # @param theCompound The compound to check.
12470 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12471 # taking into account C1 continuity.
12472 # @param theAngTolerance the angular tolerance to check if two neighbor
12473 # edges are codirectional in the common vertex with this
12474 # tolerance. This parameter is used only if
12475 # <VAR>theIsUseC1</VAR> is set to True.
12476 # @return TRUE, if the given shape is a compound of blocks.
12477 # If theCompound is not valid, prints all discovered errors.
12479 # @ref tui_check_compound_of_blocks_page "Example 1"
12480 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12481 @ManageTransactions("BlocksOp")
12482 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12483 theAngTolerance = 1.e-12):
12485 Check, if the compound of blocks is given.
12486 To be considered as a compound of blocks, the
12487 given shape must satisfy the following conditions:
12488 - Each element of the compound should be a Block (6 faces).
12489 - Each face should be a quadrangle, i.e. it should have only 1 wire
12490 with 4 edges. If theIsUseC1 is set to True and
12491 there are more than 4 edges in the only wire of a face,
12492 this face is considered to be quadrangle if it has 4 bounds
12493 (1 or more edge) of C1 continuity.
12494 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12495 - The compound should be connexe.
12496 - The glue between two quadrangle faces should be applied.
12499 theCompound The compound to check.
12500 theIsUseC1 Flag to check if there are 4 bounds on a face
12501 taking into account C1 continuity.
12502 theAngTolerance the angular tolerance to check if two neighbor
12503 edges are codirectional in the common vertex with this
12504 tolerance. This parameter is used only if
12505 theIsUseC1 is set to True.
12508 TRUE, if the given shape is a compound of blocks.
12509 If theCompound is not valid, prints all discovered errors.
12511 # Example: see GEOM_Spanner.py
12514 aTolerance = theAngTolerance
12515 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12516 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12518 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12522 ## Retrieve all non blocks solids and faces from \a theShape.
12523 # @param theShape The shape to explore.
12524 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12525 # taking into account C1 continuity.
12526 # @param theAngTolerance the angular tolerance to check if two neighbor
12527 # edges are codirectional in the common vertex with this
12528 # tolerance. This parameter is used only if
12529 # <VAR>theIsUseC1</VAR> is set to True.
12530 # @param theName Object name; when specified, this parameter is used
12531 # for result publication in the study. Otherwise, if automatic
12532 # publication is switched on, default value is used for result name.
12534 # @return A tuple of two GEOM_Objects. The first object is a group of all
12535 # non block solids (= not 6 faces, or with 6 faces, but with the
12536 # presence of non-quadrangular faces). The second object is a
12537 # group of all non quadrangular faces (= faces with more then
12538 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12539 # with 1 wire with not 4 edges that do not form 4 bounds of
12542 # @ref tui_get_non_blocks_page "Example 1"
12543 # \n @ref swig_GetNonBlocks "Example 2"
12544 @ManageTransactions("BlocksOp")
12545 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12546 theAngTolerance = 1.e-12, theName=None):
12548 Retrieve all non blocks solids and faces from theShape.
12551 theShape The shape to explore.
12552 theIsUseC1 Flag to check if there are 4 bounds on a face
12553 taking into account C1 continuity.
12554 theAngTolerance the angular tolerance to check if two neighbor
12555 edges are codirectional in the common vertex with this
12556 tolerance. This parameter is used only if
12557 theIsUseC1 is set to True.
12558 theName Object name; when specified, this parameter is used
12559 for result publication in the study. Otherwise, if automatic
12560 publication is switched on, default value is used for result name.
12563 A tuple of two GEOM_Objects. The first object is a group of all
12564 non block solids (= not 6 faces, or with 6 faces, but with the
12565 presence of non-quadrangular faces). The second object is a
12566 group of all non quadrangular faces (= faces with more then
12567 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12568 with 1 wire with not 4 edges that do not form 4 bounds of
12572 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12574 # Example: see GEOM_Spanner.py
12577 aTolerance = theAngTolerance
12578 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12579 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12580 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12583 ## Remove all seam and degenerated edges from \a theShape.
12584 # Unite faces and edges, sharing one surface. It means that
12585 # this faces must have references to one C++ surface object (handle).
12586 # @param theShape The compound or single solid to remove irregular edges from.
12587 # @param doUnionFaces If True, then unite faces. If False (the default value),
12588 # do not unite faces.
12589 # @param theName Object name; when specified, this parameter is used
12590 # for result publication in the study. Otherwise, if automatic
12591 # publication is switched on, default value is used for result name.
12593 # @return Improved shape.
12595 # @ref swig_RemoveExtraEdges "Example"
12596 @ManageTransactions("BlocksOp")
12597 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12599 Remove all seam and degenerated edges from theShape.
12600 Unite faces and edges, sharing one surface. It means that
12601 this faces must have references to one C++ surface object (handle).
12604 theShape The compound or single solid to remove irregular edges from.
12605 doUnionFaces If True, then unite faces. If False (the default value),
12606 do not unite faces.
12607 theName Object name; when specified, this parameter is used
12608 for result publication in the study. Otherwise, if automatic
12609 publication is switched on, default value is used for result name.
12614 # Example: see GEOM_TestOthers.py
12615 nbFacesOptimum = -1 # -1 means do not unite faces
12616 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12617 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12618 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12619 self._autoPublish(anObj, theName, "removeExtraEdges")
12622 ## Performs union faces of \a theShape
12623 # Unite faces sharing one surface. It means that
12624 # these faces must have references to one C++ surface object (handle).
12625 # @param theShape The compound or single solid that contains faces
12626 # to perform union.
12627 # @param theName Object name; when specified, this parameter is used
12628 # for result publication in the study. Otherwise, if automatic
12629 # publication is switched on, default value is used for result name.
12631 # @return Improved shape.
12633 # @ref swig_UnionFaces "Example"
12634 @ManageTransactions("BlocksOp")
12635 def UnionFaces(self, theShape, theName=None):
12637 Performs union faces of theShape.
12638 Unite faces sharing one surface. It means that
12639 these faces must have references to one C++ surface object (handle).
12642 theShape The compound or single solid that contains faces
12644 theName Object name; when specified, this parameter is used
12645 for result publication in the study. Otherwise, if automatic
12646 publication is switched on, default value is used for result name.
12651 # Example: see GEOM_TestOthers.py
12652 anObj = self.BlocksOp.UnionFaces(theShape)
12653 RaiseIfFailed("UnionFaces", self.BlocksOp)
12654 self._autoPublish(anObj, theName, "unionFaces")
12657 ## Check, if the given shape is a blocks compound.
12658 # Fix all detected errors.
12659 # \note Single block can be also fixed by this method.
12660 # @param theShape The compound to check and improve.
12661 # @param theName Object name; when specified, this parameter is used
12662 # for result publication in the study. Otherwise, if automatic
12663 # publication is switched on, default value is used for result name.
12665 # @return Improved compound.
12667 # @ref swig_CheckAndImprove "Example"
12668 @ManageTransactions("BlocksOp")
12669 def CheckAndImprove(self, theShape, theName=None):
12671 Check, if the given shape is a blocks compound.
12672 Fix all detected errors.
12675 Single block can be also fixed by this method.
12678 theShape The compound to check and improve.
12679 theName Object name; when specified, this parameter is used
12680 for result publication in the study. Otherwise, if automatic
12681 publication is switched on, default value is used for result name.
12686 # Example: see GEOM_TestOthers.py
12687 anObj = self.BlocksOp.CheckAndImprove(theShape)
12688 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12689 self._autoPublish(anObj, theName, "improved")
12692 # end of l4_blocks_measure
12695 ## @addtogroup l3_blocks_op
12698 ## Get all the blocks, contained in the given compound.
12699 # @param theCompound The compound to explode.
12700 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12701 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12702 # @param theName Object name; when specified, this parameter is used
12703 # for result publication in the study. Otherwise, if automatic
12704 # publication is switched on, default value is used for result name.
12706 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12708 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12710 # @ref tui_explode_on_blocks "Example 1"
12711 # \n @ref swig_MakeBlockExplode "Example 2"
12712 @ManageTransactions("BlocksOp")
12713 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12715 Get all the blocks, contained in the given compound.
12718 theCompound The compound to explode.
12719 theMinNbFaces If solid has lower number of faces, it is not a block.
12720 theMaxNbFaces If solid has higher number of faces, it is not a block.
12721 theName Object name; when specified, this parameter is used
12722 for result publication in the study. Otherwise, if automatic
12723 publication is switched on, default value is used for result name.
12726 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12729 List of GEOM.GEOM_Object, containing the retrieved blocks.
12731 # Example: see GEOM_TestOthers.py
12732 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12733 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12734 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12735 for anObj in aList:
12736 anObj.SetParameters(Parameters)
12738 self._autoPublish(aList, theName, "block")
12741 ## Find block, containing the given point inside its volume or on boundary.
12742 # @param theCompound Compound, to find block in.
12743 # @param thePoint Point, close to the desired block. If the point lays on
12744 # boundary between some blocks, we return block with nearest center.
12745 # @param theName Object name; when specified, this parameter is used
12746 # for result publication in the study. Otherwise, if automatic
12747 # publication is switched on, default value is used for result name.
12749 # @return New GEOM.GEOM_Object, containing the found block.
12751 # @ref swig_todo "Example"
12752 @ManageTransactions("BlocksOp")
12753 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12755 Find block, containing the given point inside its volume or on boundary.
12758 theCompound Compound, to find block in.
12759 thePoint Point, close to the desired block. If the point lays on
12760 boundary between some blocks, we return block with nearest center.
12761 theName Object name; when specified, this parameter is used
12762 for result publication in the study. Otherwise, if automatic
12763 publication is switched on, default value is used for result name.
12766 New GEOM.GEOM_Object, containing the found block.
12768 # Example: see GEOM_Spanner.py
12769 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12770 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12771 self._autoPublish(anObj, theName, "block")
12774 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12775 # @param theCompound Compound, to find block in.
12776 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12777 # @param theName Object name; when specified, this parameter is used
12778 # for result publication in the study. Otherwise, if automatic
12779 # publication is switched on, default value is used for result name.
12781 # @return New GEOM.GEOM_Object, containing the found block.
12783 # @ref swig_GetBlockByParts "Example"
12784 @ManageTransactions("BlocksOp")
12785 def GetBlockByParts(self, theCompound, theParts, theName=None):
12787 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12790 theCompound Compound, to find block in.
12791 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12792 theName Object name; when specified, this parameter is used
12793 for result publication in the study. Otherwise, if automatic
12794 publication is switched on, default value is used for result name.
12797 New GEOM_Object, containing the found block.
12799 # Example: see GEOM_TestOthers.py
12800 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12801 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12802 self._autoPublish(anObj, theName, "block")
12805 ## Return all blocks, containing all the elements, passed as the parts.
12806 # @param theCompound Compound, to find blocks in.
12807 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12808 # @param theName Object name; when specified, this parameter is used
12809 # for result publication in the study. Otherwise, if automatic
12810 # publication is switched on, default value is used for result name.
12812 # @return List of GEOM.GEOM_Object, containing the found blocks.
12814 # @ref swig_todo "Example"
12815 @ManageTransactions("BlocksOp")
12816 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12818 Return all blocks, containing all the elements, passed as the parts.
12821 theCompound Compound, to find blocks in.
12822 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12823 theName Object name; when specified, this parameter is used
12824 for result publication in the study. Otherwise, if automatic
12825 publication is switched on, default value is used for result name.
12828 List of GEOM.GEOM_Object, containing the found blocks.
12830 # Example: see GEOM_Spanner.py
12831 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12832 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12833 self._autoPublish(aList, theName, "block")
12836 ## Multi-transformate block and glue the result.
12837 # Transformation is defined so, as to superpose direction faces.
12838 # @param Block Hexahedral solid to be multi-transformed.
12839 # @param DirFace1 ID of First direction face.
12840 # @param DirFace2 ID of Second direction face.
12841 # @param NbTimes Quantity of transformations to be done.
12842 # @param theName Object name; when specified, this parameter is used
12843 # for result publication in the study. Otherwise, if automatic
12844 # publication is switched on, default value is used for result name.
12846 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12848 # @return New GEOM.GEOM_Object, containing the result shape.
12850 # @ref tui_multi_transformation "Example"
12851 @ManageTransactions("BlocksOp")
12852 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12854 Multi-transformate block and glue the result.
12855 Transformation is defined so, as to superpose direction faces.
12858 Block Hexahedral solid to be multi-transformed.
12859 DirFace1 ID of First direction face.
12860 DirFace2 ID of Second direction face.
12861 NbTimes Quantity of transformations to be done.
12862 theName Object name; when specified, this parameter is used
12863 for result publication in the study. Otherwise, if automatic
12864 publication is switched on, default value is used for result name.
12867 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12870 New GEOM.GEOM_Object, containing the result shape.
12872 # Example: see GEOM_Spanner.py
12873 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12874 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12875 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12876 anObj.SetParameters(Parameters)
12877 self._autoPublish(anObj, theName, "transformed")
12880 ## Multi-transformate block and glue the result.
12881 # @param Block Hexahedral solid to be multi-transformed.
12882 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12883 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12884 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12885 # @param theName Object name; when specified, this parameter is used
12886 # for result publication in the study. Otherwise, if automatic
12887 # publication is switched on, default value is used for result name.
12889 # @return New GEOM.GEOM_Object, containing the result shape.
12891 # @ref tui_multi_transformation "Example"
12892 @ManageTransactions("BlocksOp")
12893 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12894 DirFace1V, DirFace2V, NbTimesV, theName=None):
12896 Multi-transformate block and glue the result.
12899 Block Hexahedral solid to be multi-transformed.
12900 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12901 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12902 NbTimesU,NbTimesV Quantity of transformations to be done.
12903 theName Object name; when specified, this parameter is used
12904 for result publication in the study. Otherwise, if automatic
12905 publication is switched on, default value is used for result name.
12908 New GEOM.GEOM_Object, containing the result shape.
12910 # Example: see GEOM_Spanner.py
12911 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12912 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12913 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12914 DirFace1V, DirFace2V, NbTimesV)
12915 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12916 anObj.SetParameters(Parameters)
12917 self._autoPublish(anObj, theName, "transformed")
12920 ## Build all possible propagation groups.
12921 # Propagation group is a set of all edges, opposite to one (main)
12922 # edge of this group directly or through other opposite edges.
12923 # Notion of Opposite Edge make sense only on quadrangle face.
12924 # @param theShape Shape to build propagation groups on.
12925 # @param theName Object name; when specified, this parameter is used
12926 # for result publication in the study. Otherwise, if automatic
12927 # publication is switched on, default value is used for result name.
12929 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12931 # @ref swig_Propagate "Example"
12932 @ManageTransactions("BlocksOp")
12933 def Propagate(self, theShape, theName=None):
12935 Build all possible propagation groups.
12936 Propagation group is a set of all edges, opposite to one (main)
12937 edge of this group directly or through other opposite edges.
12938 Notion of Opposite Edge make sense only on quadrangle face.
12941 theShape Shape to build propagation groups on.
12942 theName Object name; when specified, this parameter is used
12943 for result publication in the study. Otherwise, if automatic
12944 publication is switched on, default value is used for result name.
12947 List of GEOM.GEOM_Object, each of them is a propagation group.
12949 # Example: see GEOM_TestOthers.py
12950 listChains = self.BlocksOp.Propagate(theShape)
12951 RaiseIfFailed("Propagate", self.BlocksOp)
12952 self._autoPublish(listChains, theName, "propagate")
12955 # end of l3_blocks_op
12958 ## @addtogroup l3_groups
12961 ## Creates a new group which will store sub-shapes of theMainShape
12962 # @param theMainShape is a GEOM object on which the group is selected
12963 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12964 # @param theName Object name; when specified, this parameter is used
12965 # for result publication in the study. Otherwise, if automatic
12966 # publication is switched on, default value is used for result name.
12968 # @return a newly created GEOM group (GEOM.GEOM_Object)
12970 # @ref tui_working_with_groups_page "Example 1"
12971 # \n @ref swig_CreateGroup "Example 2"
12972 @ManageTransactions("GroupOp")
12973 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12975 Creates a new group which will store sub-shapes of theMainShape
12978 theMainShape is a GEOM object on which the group is selected
12979 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12980 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12981 theName Object name; when specified, this parameter is used
12982 for result publication in the study. Otherwise, if automatic
12983 publication is switched on, default value is used for result name.
12986 a newly created GEOM group
12989 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12992 # Example: see GEOM_TestOthers.py
12993 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12994 RaiseIfFailed("CreateGroup", self.GroupOp)
12995 self._autoPublish(anObj, theName, "group")
12998 ## Adds a sub-object with ID theSubShapeId to the group
12999 # @param theGroup is a GEOM group to which the new sub-shape is added
13000 # @param theSubShapeID is a sub-shape ID in the main object.
13001 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13003 # @ref tui_working_with_groups_page "Example"
13004 @ManageTransactions("GroupOp")
13005 def AddObject(self,theGroup, theSubShapeID):
13007 Adds a sub-object with ID theSubShapeId to the group
13010 theGroup is a GEOM group to which the new sub-shape is added
13011 theSubShapeID is a sub-shape ID in the main object.
13014 Use method GetSubShapeID() to get an unique ID of the sub-shape
13016 # Example: see GEOM_TestOthers.py
13017 self.GroupOp.AddObject(theGroup, theSubShapeID)
13018 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13019 RaiseIfFailed("AddObject", self.GroupOp)
13023 ## Removes a sub-object with ID \a theSubShapeId from the group
13024 # @param theGroup is a GEOM group from which the new sub-shape is removed
13025 # @param theSubShapeID is a sub-shape ID in the main object.
13026 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13028 # @ref tui_working_with_groups_page "Example"
13029 @ManageTransactions("GroupOp")
13030 def RemoveObject(self,theGroup, theSubShapeID):
13032 Removes a sub-object with ID theSubShapeId from the group
13035 theGroup is a GEOM group from which the new sub-shape is removed
13036 theSubShapeID is a sub-shape ID in the main object.
13039 Use method GetSubShapeID() to get an unique ID of the sub-shape
13041 # Example: see GEOM_TestOthers.py
13042 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13043 RaiseIfFailed("RemoveObject", self.GroupOp)
13046 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13047 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13048 # @param theSubShapes is a list of sub-shapes to be added.
13050 # @ref tui_working_with_groups_page "Example"
13051 @ManageTransactions("GroupOp")
13052 def UnionList (self,theGroup, theSubShapes):
13054 Adds to the group all the given shapes. No errors, if some shapes are already included.
13057 theGroup is a GEOM group to which the new sub-shapes are added.
13058 theSubShapes is a list of sub-shapes to be added.
13060 # Example: see GEOM_TestOthers.py
13061 self.GroupOp.UnionList(theGroup, theSubShapes)
13062 RaiseIfFailed("UnionList", self.GroupOp)
13065 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13066 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13067 # @param theSubShapes is a list of indices of sub-shapes to be added.
13069 # @ref swig_UnionIDs "Example"
13070 @ManageTransactions("GroupOp")
13071 def UnionIDs(self,theGroup, theSubShapes):
13073 Adds to the group all the given shapes. No errors, if some shapes are already included.
13076 theGroup is a GEOM group to which the new sub-shapes are added.
13077 theSubShapes is a list of indices of sub-shapes to be added.
13079 # Example: see GEOM_TestOthers.py
13080 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13081 RaiseIfFailed("UnionIDs", self.GroupOp)
13084 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13085 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13086 # @param theSubShapes is a list of sub-shapes to be removed.
13088 # @ref tui_working_with_groups_page "Example"
13089 @ManageTransactions("GroupOp")
13090 def DifferenceList (self,theGroup, theSubShapes):
13092 Removes from the group all the given shapes. No errors, if some shapes are not included.
13095 theGroup is a GEOM group from which the sub-shapes are removed.
13096 theSubShapes is a list of sub-shapes to be removed.
13098 # Example: see GEOM_TestOthers.py
13099 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13100 RaiseIfFailed("DifferenceList", self.GroupOp)
13103 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13104 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13105 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13107 # @ref swig_DifferenceIDs "Example"
13108 @ManageTransactions("GroupOp")
13109 def DifferenceIDs(self,theGroup, theSubShapes):
13111 Removes from the group all the given shapes. No errors, if some shapes are not included.
13114 theGroup is a GEOM group from which the sub-shapes are removed.
13115 theSubShapes is a list of indices of sub-shapes to be removed.
13117 # Example: see GEOM_TestOthers.py
13118 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13119 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13122 ## Union of two groups.
13123 # New group is created. It will contain all entities
13124 # which are present in groups theGroup1 and theGroup2.
13125 # @param theGroup1, theGroup2 are the initial GEOM groups
13126 # to create the united group from.
13127 # @param theName Object name; when specified, this parameter is used
13128 # for result publication in the study. Otherwise, if automatic
13129 # publication is switched on, default value is used for result name.
13131 # @return a newly created GEOM group.
13133 # @ref tui_union_groups_anchor "Example"
13134 @ManageTransactions("GroupOp")
13135 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13137 Union of two groups.
13138 New group is created. It will contain all entities
13139 which are present in groups theGroup1 and theGroup2.
13142 theGroup1, theGroup2 are the initial GEOM groups
13143 to create the united group from.
13144 theName Object name; when specified, this parameter is used
13145 for result publication in the study. Otherwise, if automatic
13146 publication is switched on, default value is used for result name.
13149 a newly created GEOM group.
13151 # Example: see GEOM_TestOthers.py
13152 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13153 RaiseIfFailed("UnionGroups", self.GroupOp)
13154 self._autoPublish(aGroup, theName, "group")
13157 ## Intersection of two groups.
13158 # New group is created. It will contain only those entities
13159 # which are present in both groups theGroup1 and theGroup2.
13160 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13161 # @param theName Object name; when specified, this parameter is used
13162 # for result publication in the study. Otherwise, if automatic
13163 # publication is switched on, default value is used for result name.
13165 # @return a newly created GEOM group.
13167 # @ref tui_intersect_groups_anchor "Example"
13168 @ManageTransactions("GroupOp")
13169 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13171 Intersection of two groups.
13172 New group is created. It will contain only those entities
13173 which are present in both groups theGroup1 and theGroup2.
13176 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13177 theName Object name; when specified, this parameter is used
13178 for result publication in the study. Otherwise, if automatic
13179 publication is switched on, default value is used for result name.
13182 a newly created GEOM group.
13184 # Example: see GEOM_TestOthers.py
13185 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13186 RaiseIfFailed("IntersectGroups", self.GroupOp)
13187 self._autoPublish(aGroup, theName, "group")
13190 ## Cut of two groups.
13191 # New group is created. It will contain entities which are
13192 # present in group theGroup1 but are not present in group theGroup2.
13193 # @param theGroup1 is a GEOM group to include elements of.
13194 # @param theGroup2 is a GEOM group to exclude elements of.
13195 # @param theName Object name; when specified, this parameter is used
13196 # for result publication in the study. Otherwise, if automatic
13197 # publication is switched on, default value is used for result name.
13199 # @return a newly created GEOM group.
13201 # @ref tui_cut_groups_anchor "Example"
13202 @ManageTransactions("GroupOp")
13203 def CutGroups (self, theGroup1, theGroup2, theName=None):
13206 New group is created. It will contain entities which are
13207 present in group theGroup1 but are not present in group theGroup2.
13210 theGroup1 is a GEOM group to include elements of.
13211 theGroup2 is a GEOM group to exclude elements of.
13212 theName Object name; when specified, this parameter is used
13213 for result publication in the study. Otherwise, if automatic
13214 publication is switched on, default value is used for result name.
13217 a newly created GEOM group.
13219 # Example: see GEOM_TestOthers.py
13220 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13221 RaiseIfFailed("CutGroups", self.GroupOp)
13222 self._autoPublish(aGroup, theName, "group")
13225 ## Union of list of groups.
13226 # New group is created. It will contain all entities that are
13227 # present in groups listed in theGList.
13228 # @param theGList is a list of GEOM groups to create the united group from.
13229 # @param theName Object name; when specified, this parameter is used
13230 # for result publication in the study. Otherwise, if automatic
13231 # publication is switched on, default value is used for result name.
13233 # @return a newly created GEOM group.
13235 # @ref tui_union_groups_anchor "Example"
13236 @ManageTransactions("GroupOp")
13237 def UnionListOfGroups (self, theGList, theName=None):
13239 Union of list of groups.
13240 New group is created. It will contain all entities that are
13241 present in groups listed in theGList.
13244 theGList is a list of GEOM groups to create the united group from.
13245 theName Object name; when specified, this parameter is used
13246 for result publication in the study. Otherwise, if automatic
13247 publication is switched on, default value is used for result name.
13250 a newly created GEOM group.
13252 # Example: see GEOM_TestOthers.py
13253 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13254 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13255 self._autoPublish(aGroup, theName, "group")
13258 ## Cut of lists of groups.
13259 # New group is created. It will contain only entities
13260 # which are present in groups listed in theGList.
13261 # @param theGList is a list of GEOM groups to include elements of.
13262 # @param theName Object name; when specified, this parameter is used
13263 # for result publication in the study. Otherwise, if automatic
13264 # publication is switched on, default value is used for result name.
13266 # @return a newly created GEOM group.
13268 # @ref tui_intersect_groups_anchor "Example"
13269 @ManageTransactions("GroupOp")
13270 def IntersectListOfGroups (self, theGList, theName=None):
13272 Cut of lists of groups.
13273 New group is created. It will contain only entities
13274 which are present in groups listed in theGList.
13277 theGList is a list of GEOM groups to include elements of.
13278 theName Object name; when specified, this parameter is used
13279 for result publication in the study. Otherwise, if automatic
13280 publication is switched on, default value is used for result name.
13283 a newly created GEOM group.
13285 # Example: see GEOM_TestOthers.py
13286 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13287 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13288 self._autoPublish(aGroup, theName, "group")
13291 ## Cut of lists of groups.
13292 # New group is created. It will contain only entities
13293 # which are present in groups listed in theGList1 but
13294 # are not present in groups from theGList2.
13295 # @param theGList1 is a list of GEOM groups to include elements of.
13296 # @param theGList2 is a list of GEOM groups to exclude elements of.
13297 # @param theName Object name; when specified, this parameter is used
13298 # for result publication in the study. Otherwise, if automatic
13299 # publication is switched on, default value is used for result name.
13301 # @return a newly created GEOM group.
13303 # @ref tui_cut_groups_anchor "Example"
13304 @ManageTransactions("GroupOp")
13305 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13307 Cut of lists of groups.
13308 New group is created. It will contain only entities
13309 which are present in groups listed in theGList1 but
13310 are not present in groups from theGList2.
13313 theGList1 is a list of GEOM groups to include elements of.
13314 theGList2 is a list of GEOM groups to exclude elements of.
13315 theName Object name; when specified, this parameter is used
13316 for result publication in the study. Otherwise, if automatic
13317 publication is switched on, default value is used for result name.
13320 a newly created GEOM group.
13322 # Example: see GEOM_TestOthers.py
13323 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13324 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13325 self._autoPublish(aGroup, theName, "group")
13328 ## Returns a list of sub-objects ID stored in the group
13329 # @param theGroup is a GEOM group for which a list of IDs is requested
13331 # @ref swig_GetObjectIDs "Example"
13332 @ManageTransactions("GroupOp")
13333 def GetObjectIDs(self,theGroup):
13335 Returns a list of sub-objects ID stored in the group
13338 theGroup is a GEOM group for which a list of IDs is requested
13340 # Example: see GEOM_TestOthers.py
13341 ListIDs = self.GroupOp.GetObjects(theGroup)
13342 RaiseIfFailed("GetObjects", self.GroupOp)
13345 ## Returns a type of sub-objects stored in the group
13346 # @param theGroup is a GEOM group which type is returned.
13348 # @ref swig_GetType "Example"
13349 @ManageTransactions("GroupOp")
13350 def GetType(self,theGroup):
13352 Returns a type of sub-objects stored in the group
13355 theGroup is a GEOM group which type is returned.
13357 # Example: see GEOM_TestOthers.py
13358 aType = self.GroupOp.GetType(theGroup)
13359 RaiseIfFailed("GetType", self.GroupOp)
13362 ## Convert a type of geom object from id to string value
13363 # @param theId is a GEOM object type id.
13364 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13365 # @ref swig_GetType "Example"
13366 def ShapeIdToType(self, theId):
13368 Convert a type of geom object from id to string value
13371 theId is a GEOM object type id.
13374 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13401 return "REVOLUTION"
13449 return "FREE_BOUNDS"
13457 return "THRUSECTIONS"
13459 return "COMPOUNDFILTER"
13461 return "SHAPES_ON_SHAPE"
13463 return "ELLIPSE_ARC"
13465 return "3DSKETCHER"
13471 return "PIPETSHAPE"
13472 return "Shape Id not exist."
13474 ## Returns a main shape associated with the group
13475 # @param theGroup is a GEOM group for which a main shape object is requested
13476 # @return a GEOM object which is a main shape for theGroup
13478 # @ref swig_GetMainShape "Example"
13479 @ManageTransactions("GroupOp")
13480 def GetMainShape(self,theGroup):
13482 Returns a main shape associated with the group
13485 theGroup is a GEOM group for which a main shape object is requested
13488 a GEOM object which is a main shape for theGroup
13490 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13492 # Example: see GEOM_TestOthers.py
13493 anObj = self.GroupOp.GetMainShape(theGroup)
13494 RaiseIfFailed("GetMainShape", self.GroupOp)
13497 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13498 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13499 # @param theShape given shape (see GEOM.GEOM_Object)
13500 # @param min_length minimum length of edges of theShape
13501 # @param max_length maximum length of edges of theShape
13502 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13503 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13504 # @param theName Object name; when specified, this parameter is used
13505 # for result publication in the study. Otherwise, if automatic
13506 # publication is switched on, default value is used for result name.
13508 # @return a newly created GEOM group of edges
13510 # @@ref swig_todo "Example"
13511 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13513 Create group of edges of theShape, whose length is in range [min_length, max_length].
13514 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13517 theShape given shape
13518 min_length minimum length of edges of theShape
13519 max_length maximum length of edges of theShape
13520 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13521 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13522 theName Object name; when specified, this parameter is used
13523 for result publication in the study. Otherwise, if automatic
13524 publication is switched on, default value is used for result name.
13527 a newly created GEOM group of edges.
13529 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13530 edges_in_range = []
13532 Props = self.BasicProperties(edge)
13533 if min_length <= Props[0] and Props[0] <= max_length:
13534 if (not include_min) and (min_length == Props[0]):
13537 if (not include_max) and (Props[0] == max_length):
13540 edges_in_range.append(edge)
13542 if len(edges_in_range) <= 0:
13543 print("No edges found by given criteria")
13546 # note: auto-publishing is done in self.CreateGroup()
13547 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13548 self.UnionList(group_edges, edges_in_range)
13552 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13553 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13554 # @param min_length minimum length of edges of selected shape
13555 # @param max_length maximum length of edges of selected shape
13556 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13557 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13558 # @return a newly created GEOM group of edges
13559 # @ref swig_todo "Example"
13560 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13562 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13563 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13566 min_length minimum length of edges of selected shape
13567 max_length maximum length of edges of selected shape
13568 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13569 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13572 a newly created GEOM group of edges.
13574 nb_selected = sg.SelectedCount()
13575 if nb_selected < 1:
13576 print("Select a shape before calling this function, please.")
13578 if nb_selected > 1:
13579 print("Only one shape must be selected")
13582 id_shape = sg.getSelected(0)
13583 shape = IDToObject( id_shape )
13585 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13589 if include_min: left_str = " <= "
13590 if include_max: right_str = " <= "
13592 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13593 + left_str + "length" + right_str + repr(max_length))
13595 sg.updateObjBrowser()
13602 #@@ insert new functions before this line @@ do not remove this line @@#
13604 ## Create a copy of the given object
13606 # @param theOriginal geometry object for copy
13607 # @param theName Object name; when specified, this parameter is used
13608 # for result publication in the study. Otherwise, if automatic
13609 # publication is switched on, default value is used for result name.
13611 # @return New GEOM_Object, containing the copied shape.
13613 # @ingroup l1_geomBuilder_auxiliary
13614 # @ref swig_MakeCopy "Example"
13615 @ManageTransactions("InsertOp")
13616 def MakeCopy(self, theOriginal, theName=None):
13618 Create a copy of the given object
13621 theOriginal geometry object for copy
13622 theName Object name; when specified, this parameter is used
13623 for result publication in the study. Otherwise, if automatic
13624 publication is switched on, default value is used for result name.
13627 New GEOM_Object, containing the copied shape.
13629 Example of usage: Copy = geompy.MakeCopy(Box)
13631 # Example: see GEOM_TestAll.py
13632 anObj = self.InsertOp.MakeCopy(theOriginal)
13633 RaiseIfFailed("MakeCopy", self.InsertOp)
13634 self._autoPublish(anObj, theName, "copy")
13637 ## Add Path to load python scripts from
13638 # @param Path a path to load python scripts from
13639 # @ingroup l1_geomBuilder_auxiliary
13640 def addPath(self,Path):
13642 Add Path to load python scripts from
13645 Path a path to load python scripts from
13647 if (sys.path.count(Path) < 1):
13648 sys.path.append(Path)
13652 ## Load marker texture from the file
13653 # @param Path a path to the texture file
13654 # @return unique texture identifier
13655 # @ingroup l1_geomBuilder_auxiliary
13656 @ManageTransactions("InsertOp")
13657 def LoadTexture(self, Path):
13659 Load marker texture from the file
13662 Path a path to the texture file
13665 unique texture identifier
13667 # Example: see GEOM_TestAll.py
13668 ID = self.InsertOp.LoadTexture(Path)
13669 RaiseIfFailed("LoadTexture", self.InsertOp)
13672 ## Get internal name of the object based on its study entry
13673 # @note This method does not provide an unique identifier of the geometry object.
13674 # @note This is internal function of GEOM component, though it can be used outside it for
13675 # appropriate reason (e.g. for identification of geometry object).
13676 # @param obj geometry object
13677 # @return unique object identifier
13678 # @ingroup l1_geomBuilder_auxiliary
13679 def getObjectID(self, obj):
13681 Get internal name of the object based on its study entry.
13682 Note: this method does not provide an unique identifier of the geometry object.
13683 It is an internal function of GEOM component, though it can be used outside GEOM for
13684 appropriate reason (e.g. for identification of geometry object).
13687 obj geometry object
13690 unique object identifier
13693 entry = salome.ObjectToID(obj)
13694 if entry is not None:
13695 lst = entry.split(":")
13697 ID = lst[-1] # -1 means last item in the list
13698 return "GEOM_" + ID
13703 ## Add marker texture. @a Width and @a Height parameters
13704 # specify width and height of the texture in pixels.
13705 # If @a RowData is @c True, @a Texture parameter should represent texture data
13706 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13707 # parameter should be unpacked string, in which '1' symbols represent opaque
13708 # pixels and '0' represent transparent pixels of the texture bitmap.
13710 # @param Width texture width in pixels
13711 # @param Height texture height in pixels
13712 # @param Texture texture data
13713 # @param RowData if @c True, @a Texture data are packed in the byte stream
13714 # @return unique texture identifier
13715 # @ingroup l1_geomBuilder_auxiliary
13716 @ManageTransactions("InsertOp")
13717 def AddTexture(self, Width, Height, Texture, RowData=False):
13719 Add marker texture. Width and Height parameters
13720 specify width and height of the texture in pixels.
13721 If RowData is True, Texture parameter should represent texture data
13722 packed into the byte array. If RowData is False (default), Texture
13723 parameter should be unpacked string, in which '1' symbols represent opaque
13724 pixels and '0' represent transparent pixels of the texture bitmap.
13727 Width texture width in pixels
13728 Height texture height in pixels
13729 Texture texture data
13730 RowData if True, Texture data are packed in the byte stream
13733 return unique texture identifier
13735 if not RowData: Texture = PackData(Texture)
13736 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13737 RaiseIfFailed("AddTexture", self.InsertOp)
13740 ## Transfer not topological data from one GEOM object to another.
13742 # @param theObjectFrom the source object of non-topological data
13743 # @param theObjectTo the destination object of non-topological data
13744 # @param theFindMethod method to search sub-shapes of theObjectFrom
13745 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13746 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13747 # Other values of GEOM.find_shape_method are not supported.
13749 # @return True in case of success; False otherwise.
13751 # @ingroup l1_geomBuilder_auxiliary
13753 # @ref swig_TransferData "Example"
13754 @ManageTransactions("InsertOp")
13755 def TransferData(self, theObjectFrom, theObjectTo,
13756 theFindMethod=GEOM.FSM_GetInPlace):
13758 Transfer not topological data from one GEOM object to another.
13761 theObjectFrom the source object of non-topological data
13762 theObjectTo the destination object of non-topological data
13763 theFindMethod method to search sub-shapes of theObjectFrom
13764 in shape theObjectTo. Possible values are:
13765 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13766 and GEOM.FSM_GetInPlace_Old. Other values of
13767 GEOM.find_shape_method are not supported.
13770 True in case of success; False otherwise.
13772 # Example: see GEOM_TestOthers.py
13774 # Example: see GEOM_TestAll.py
13775 isOk = self.InsertOp.TransferData(theObjectFrom,
13776 theObjectTo, theFindMethod)
13777 RaiseIfFailed("TransferData", self.InsertOp)
13780 ## Creates a new folder object. It is a container for any GEOM objects.
13781 # @param Name name of the container
13782 # @param Father parent object. If None,
13783 # folder under 'Geometry' root object will be created.
13784 # @return a new created folder
13785 # @ingroup l1_publish_data
13786 def NewFolder(self, Name, Father=None):
13788 Create a new folder object. It is an auxiliary container for any GEOM objects.
13791 Name name of the container
13792 Father parent object. If None,
13793 folder under 'Geometry' root object will be created.
13796 a new created folder
13798 if not Father: Father = self.father
13799 return self.CreateFolder(Name, Father)
13801 ## Move object to the specified folder
13802 # @param Object object to move
13803 # @param Folder target folder
13804 # @ingroup l1_publish_data
13805 def PutToFolder(self, Object, Folder):
13807 Move object to the specified folder
13810 Object object to move
13811 Folder target folder
13813 self.MoveToFolder(Object, Folder)
13816 ## Move list of objects to the specified folder
13817 # @param ListOfSO list of objects to move
13818 # @param Folder target folder
13819 # @ingroup l1_publish_data
13820 def PutListToFolder(self, ListOfSO, Folder):
13822 Move list of objects to the specified folder
13825 ListOfSO list of objects to move
13826 Folder target folder
13828 self.MoveListToFolder(ListOfSO, Folder)
13831 ## @addtogroup l2_field
13835 # @param shape the shape the field lies on
13836 # @param name the field name
13837 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13838 # @param dimension dimension of the shape the field lies on
13839 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13840 # @param componentNames names of components
13841 # @return a created field
13842 @ManageTransactions("FieldOp")
13843 def CreateField(self, shape, name, type, dimension, componentNames):
13848 shape the shape the field lies on
13849 name the field name
13850 type type of field data
13851 dimension dimension of the shape the field lies on
13852 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13853 componentNames names of components
13858 if isinstance( type, int ):
13859 if type < 0 or type > 3:
13860 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13861 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13863 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13864 RaiseIfFailed("CreateField", self.FieldOp)
13866 geom._autoPublish( f, "", name)
13869 ## Removes a field from the GEOM component
13870 # @param field the field to remove
13871 def RemoveField(self, field):
13872 "Removes a field from the GEOM component"
13874 if isinstance( field, GEOM._objref_GEOM_Field ):
13875 geom.RemoveObject( field )
13876 elif isinstance( field, geomField ):
13877 geom.RemoveObject( field.field )
13879 raise RuntimeError("RemoveField() : the object is not a field")
13882 ## Returns number of fields on a shape
13883 @ManageTransactions("FieldOp")
13884 def CountFields(self, shape):
13885 "Returns number of fields on a shape"
13886 nb = self.FieldOp.CountFields( shape )
13887 RaiseIfFailed("CountFields", self.FieldOp)
13890 ## Returns all fields on a shape
13891 @ManageTransactions("FieldOp")
13892 def GetFields(self, shape):
13893 "Returns all fields on a shape"
13894 ff = self.FieldOp.GetFields( shape )
13895 RaiseIfFailed("GetFields", self.FieldOp)
13898 ## Returns a field on a shape by its name
13899 @ManageTransactions("FieldOp")
13900 def GetField(self, shape, name):
13901 "Returns a field on a shape by its name"
13902 f = self.FieldOp.GetField( shape, name )
13903 RaiseIfFailed("GetField", self.FieldOp)
13910 # Register the new proxy for GEOM_Gen
13911 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13914 ## Field on Geometry
13915 # @ingroup l2_field
13916 class geomField( GEOM._objref_GEOM_Field ):
13918 def __init__(self, *args):
13919 GEOM._objref_GEOM_Field.__init__(self, *args)
13920 self.field = GEOM._objref_GEOM_Field
13923 ## Returns the shape the field lies on
13924 def getShape(self):
13925 "Returns the shape the field lies on"
13926 return self.field.GetShape(self)
13928 ## Returns the field name
13930 "Returns the field name"
13931 return self.field.GetName(self)
13933 ## Returns type of field data as integer [0-3]
13935 "Returns type of field data"
13936 return EnumToLong(self.field.GetDataType(self))
13938 ## Returns type of field data:
13939 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13940 def getTypeEnum(self):
13941 "Returns type of field data"
13942 return self.field.GetDataType(self)
13944 ## Returns dimension of the shape the field lies on:
13945 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13946 def getDimension(self):
13947 """Returns dimension of the shape the field lies on:
13948 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13949 return self.field.GetDimension(self)
13951 ## Returns names of components
13952 def getComponents(self):
13953 "Returns names of components"
13954 return self.field.GetComponents(self)
13956 ## Adds a time step to the field
13957 # @param step the time step number further used as the step identifier
13958 # @param stamp the time step time
13959 # @param values the values of the time step
13960 def addStep(self, step, stamp, values):
13961 "Adds a time step to the field"
13962 stp = self.field.AddStep( self, step, stamp )
13964 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
13966 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13967 self.setValues( step, values )
13970 ## Remove a time step from the field
13971 def removeStep(self,step):
13972 "Remove a time step from the field"
13975 stepObj = self.field.GetStep( self, step )
13977 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13980 #traceback.print_exc()
13982 self.field.RemoveStep( self, step )
13984 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13987 ## Returns number of time steps in the field
13988 def countSteps(self):
13989 "Returns number of time steps in the field"
13990 return self.field.CountSteps(self)
13992 ## Returns a list of time step IDs in the field
13993 def getSteps(self):
13994 "Returns a list of time step IDs in the field"
13995 return self.field.GetSteps(self)
13997 ## Returns a time step by its ID
13998 def getStep(self,step):
13999 "Returns a time step by its ID"
14000 stp = self.field.GetStep(self, step)
14002 raise RuntimeError("Step %s is missing from this field"%step)
14005 ## Returns the time of the field step
14006 def getStamp(self,step):
14007 "Returns the time of the field step"
14008 return self.getStep(step).GetStamp()
14010 ## Changes the time of the field step
14011 def setStamp(self, step, stamp):
14012 "Changes the time of the field step"
14013 return self.getStep(step).SetStamp(stamp)
14015 ## Returns values of the field step
14016 def getValues(self, step):
14017 "Returns values of the field step"
14018 return self.getStep(step).GetValues()
14020 ## Changes values of the field step
14021 def setValues(self, step, values):
14022 "Changes values of the field step"
14023 stp = self.getStep(step)
14024 errBeg = "Field.setValues(values) : Error: "
14026 ok = stp.SetValues( values )
14027 except Exception as e:
14029 if excStr.find("WrongPythonType") > 0:
14030 raise RuntimeError(errBeg +\
14031 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14032 raise RuntimeError(errBeg + str(e))
14034 nbOK = self.field.GetArraySize(self)
14037 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14039 raise RuntimeError(errBeg + "failed")
14042 pass # end of class geomField
14044 # Register the new proxy for GEOM_Field
14045 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14048 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14049 # interface to GEOM operations.
14054 # salome.salome_init()
14055 # from salome.geom import geomBuilder
14056 # geompy = geomBuilder.New()
14058 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14059 # @return geomBuilder instance
14060 def New( instance=None):
14062 Create a new geomBuilder instance.The geomBuilder class provides the Python
14063 interface to GEOM operations.
14067 salome.salome_init()
14068 from salome.geom import geomBuilder
14069 geompy = geomBuilder.New()
14072 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14074 geomBuilder instance
14076 #print "New geomBuilder ", study, instance
14080 if instance and isinstance( instance, SALOMEDS._objref_Study ):
14082 sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14087 geom = geomBuilder()
14088 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14093 # Register methods from the plug-ins in the geomBuilder class
14094 plugins_var = os.environ.get( "GEOM_PluginsList" )
14097 if plugins_var is not None:
14098 plugins = plugins_var.split( ":" )
14099 plugins=[x for x in plugins if len(x)>0]
14100 if plugins is not None:
14101 for pluginName in plugins:
14102 pluginBuilderName = pluginName + "Builder"
14104 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14105 except Exception as e:
14106 from salome_utils import verbose
14107 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14109 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14110 plugin = eval( pluginBuilderName )
14112 # add methods from plugin module to the geomBuilder class
14113 for k in dir( plugin ):
14114 if k[0] == '_': continue
14115 method = getattr( plugin, k )
14116 if type( method ).__name__ == 'function':
14117 if not hasattr( geomBuilder, k ):
14118 setattr( geomBuilder, k, method )