1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New()
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New()
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still contains all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New()
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
240 ## @defgroup l2_testing Testing
246 # initialize SALOME session in try/except block
247 # to avoid problems in some cases, e.g. when generating documentation
255 from salome_notebook import *
262 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
264 # In case the omniORBpy EnumItem class does not fully support Python 3
265 # (for instance in version 4.2.1-2), the comparison ordering methods must be
269 GEOM.COMPOUND < GEOM.SOLID
271 def enumitem_eq(self, other):
273 if isinstance(other, omniORB.EnumItem):
274 if other._parent_id == self._parent_id:
275 return self._v == other._v
277 return self._parent_id == other._parent_id
279 return id(self) == id(other)
281 return id(self) == id(other)
283 def enumitem_lt(self, other):
285 if isinstance(other, omniORB.EnumItem):
286 if other._parent_id == self._parent_id:
287 return self._v < other._v
289 return self._parent_id < other._parent_id
291 return id(self) < id(other)
293 return id(self) < id(other)
295 def enumitem_le(self, other):
297 if isinstance(other, omniORB.EnumItem):
298 if other._parent_id == self._parent_id:
299 return self._v <= other._v
301 return self._parent_id <= other._parent_id
303 return id(self) <= id(other)
305 return id(self) <= id(other)
307 def enumitem_gt(self, other):
309 if isinstance(other, omniORB.EnumItem):
310 if other._parent_id == self._parent_id:
311 return self._v > other._v
313 return self._parent_id > other._parent_id
315 return id(self) > id(other)
317 return id(self) > id(other)
319 def enumitem_ge(self, other):
321 if isinstance(other, omniORB.EnumItem):
322 if other._parent_id == self._parent_id:
323 return self._v >= other._v
325 return self._parent_id >= other._parent_id
327 return id(self) >= id(other)
329 return id(self) >= id(other)
331 GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
332 GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
333 GEOM.omniORB.EnumItem.__le__ = enumitem_le
334 GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
335 GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
336 omniORB.EnumItem.__eq__ = enumitem_eq
337 omniORB.EnumItem.__lt__ = enumitem_lt
338 omniORB.EnumItem.__le__ = enumitem_le
339 omniORB.EnumItem.__gt__ = enumitem_gt
340 omniORB.EnumItem.__ge__ = enumitem_ge
343 def _toListOfNames(_names, _size=-1):
346 if type(_names) in [list, tuple]:
347 for i in _names: l.append(i)
350 if l and len(l) < _size:
351 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
354 # Decorator function to manage transactions for all geometric operations.
355 def ManageTransactions(theOpeName):
356 def MTDecorator(theFunction):
357 # To keep the original function name an documentation.
358 @functools.wraps(theFunction)
359 def OpenCallClose(self, *args, **kwargs):
361 anOperation = getattr(self, theOpeName)
362 anOperation.StartOperation()
365 res = theFunction(self, *args, **kwargs)
367 anOperation.FinishOperation()
371 anOperation.AbortOperation()
376 ## Raise an Error, containing the Method_name, if Operation is Failed
377 ## @ingroup l1_geomBuilder_auxiliary
378 def RaiseIfFailed (Method_name, Operation):
379 if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
380 raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
382 def PrintOrRaise(message, raiseException=False):
384 raise RuntimeError(message)
388 ## Return list of variables value from salome notebook
389 ## @ingroup l1_geomBuilder_auxiliary
390 def ParseParameters(*parameters):
393 for parameter in parameters:
394 if isinstance(parameter, list):
395 lResults = ParseParameters(*parameter)
396 if len(lResults) > 0:
397 Result.append(lResults[:-1])
398 StringResult += lResults[-1].split(":")
402 if isinstance(parameter,str):
403 if notebook.isVariable(parameter):
404 Result.append(notebook.get(parameter))
406 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
409 Result.append(parameter)
411 StringResult.append(str(parameter))
415 Result.append(":".join(StringResult))
417 Result = ":".join(StringResult)
420 ## Return list of variables value from salome notebook
421 ## @ingroup l1_geomBuilder_auxiliary
425 for parameter in list:
426 if isinstance(parameter,str) and notebook.isVariable(parameter):
427 Result.append(str(notebook.get(parameter)))
430 Result.append(str(parameter))
433 StringResult = StringResult + str(parameter)
434 StringResult = StringResult + ":"
436 StringResult = StringResult[:len(StringResult)-1]
437 return Result, StringResult
439 ## Return list of variables value from salome notebook
440 ## @ingroup l1_geomBuilder_auxiliary
441 def ParseSketcherCommand(command):
444 sections = command.split(":")
445 for section in sections:
446 parameters = section.split(" ")
448 for parameter in parameters:
449 if paramIndex > 1 and parameter.find("'") != -1:
450 parameter = parameter.replace("'","")
451 if notebook.isVariable(parameter):
452 Result = Result + str(notebook.get(parameter)) + " "
455 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
459 Result = Result + str(parameter) + " "
462 StringResult = StringResult + parameter
463 StringResult = StringResult + ":"
465 paramIndex = paramIndex + 1
467 Result = Result[:len(Result)-1] + ":"
469 Result = Result[:len(Result)-1]
470 return Result, StringResult
472 ## Helper function which can be used to pack the passed string to the byte data.
473 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
474 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
477 ## val = PackData("10001110") # val = 0xAE
478 ## val = PackData("1") # val = 0x80
480 ## @param data unpacked data - a string containing '1' and '0' symbols
481 ## @return data packed to the byte stream
482 ## @ingroup l1_geomBuilder_auxiliary
485 Helper function which can be used to pack the passed string to the byte data.
486 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
487 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
490 data unpacked data - a string containing '1' and '0' symbols
493 data packed to the byte stream
496 val = PackData("10001110") # val = 0xAE
497 val = PackData("1") # val = 0x80
500 if len(data)%8: bytes += 1
502 for b in range(bytes):
503 d = data[b*8:(b+1)*8]
508 if d[i] == "1": val += 1
510 raise "Invalid symbol %s" % d[i]
517 ## Read bitmap texture from the text file.
518 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
519 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
520 ## The function returns width and height of the pixmap in pixels and byte stream representing
521 ## texture bitmap itself.
523 ## This function can be used to read the texture to the byte stream in order to pass it to
524 ## the AddTexture() function of geomBuilder class.
527 ## from salome.geom import geomBuilder
528 ## geompy = geomBuilder.New()
529 ## texture = geompy.readtexture('mytexture.dat')
530 ## texture = geompy.AddTexture(*texture)
531 ## obj.SetMarkerTexture(texture)
533 ## @param fname texture file name
534 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
535 ## @ingroup l1_geomBuilder_auxiliary
536 def ReadTexture(fname):
538 Read bitmap texture from the text file.
539 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
540 A zero symbol ('0') represents transparent pixel of the texture bitmap.
541 The function returns width and height of the pixmap in pixels and byte stream representing
542 texture bitmap itself.
543 This function can be used to read the texture to the byte stream in order to pass it to
544 the AddTexture() function of geomBuilder class.
547 fname texture file name
550 sequence of tree values: texture's width, height in pixels and its byte stream
553 from salome.geom import geomBuilder
554 geompy = geomBuilder.New()
555 texture = geompy.readtexture('mytexture.dat')
556 texture = geompy.AddTexture(*texture)
557 obj.SetMarkerTexture(texture)
561 lines = [ l.strip() for l in f.readlines()]
564 if lines: maxlen = max([len(x) for x in lines])
566 if maxlen%8: lenbytes += 1
570 lenline = (len(line)/8+1)*8
573 lenline = (len(line)/8)*8
575 for i in range(lenline/8):
578 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
581 bytedata += PackData(byte)
583 for i in range(lenline/8, lenbytes):
584 bytedata += PackData("0")
586 return lenbytes*8, len(lines), bytedata
591 ## Returns a long value from enumeration type
592 # Can be used for CORBA enumerator types like GEOM.shape_type
593 # @param theItem enumeration type
594 # @ingroup l1_geomBuilder_auxiliary
595 def EnumToLong(theItem):
597 Returns a long value from enumeration type
598 Can be used for CORBA enumerator types like geomBuilder.ShapeType
601 theItem enumeration type
604 if hasattr(theItem, "_v"): ret = theItem._v
607 ## Pack an argument into a list
609 if isinstance( arg, list ):
611 if hasattr( arg, "__getitem__" ):
615 ## Information about closed/unclosed state of shell or wire
616 # @ingroup l1_geomBuilder_auxiliary
619 Information about closed/unclosed state of shell or wire
625 ## Private class used to bind calls of plugin operations to geomBuilder
626 class PluginOperation:
627 def __init__(self, operation, function):
628 self.operation = operation
629 self.function = function
632 @ManageTransactions("operation")
633 def __call__(self, *args):
634 res = self.function(self.operation, *args)
635 RaiseIfFailed(self.function.__name__, self.operation)
638 # Warning: geom is a singleton
644 class geomBuilder(GEOM._objref_GEOM_Gen):
646 ## Enumeration ShapeType as a dictionary. \n
647 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
648 # @ingroup l1_geomBuilder_auxiliary
649 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
651 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
652 # and a list of parameters, describing the shape.
653 # List of parameters, describing the shape:
654 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
655 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
657 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
659 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
661 # - SPHERE: [xc yc zc R]
662 # - CYLINDER: [xb yb zb dx dy dz R H]
663 # - BOX: [xc yc zc ax ay az]
664 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
665 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
666 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
667 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
668 # - SOLID: [nb_faces nb_edges nb_vertices]
670 # - SPHERE2D: [xc yc zc R]
671 # - CYLINDER2D: [xb yb zb dx dy dz R H]
672 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
673 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
674 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
675 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
676 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
677 # - PLANE: [xo yo zo dx dy dz]
678 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
679 # - FACE: [nb_edges nb_vertices]
681 # - CIRCLE: [xc yc zc dx dy dz R]
682 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
683 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
684 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
685 # - LINE: [xo yo zo dx dy dz]
686 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
687 # - EDGE: [nb_vertices]
691 # - LCS: [x y z xx xy xz yx yy yz zx zy zz]
692 # @ingroup l1_geomBuilder_auxiliary
693 kind = GEOM.GEOM_IKindOfShape
695 def __new__(cls, *args):
700 #print "==== __new__ ", engine, geom, doLcc, created
702 # geom engine is either retrieved from engine, or created
704 # Following test avoids a recursive loop
707 # geom engine not created: existing engine found
709 if doLcc and not created:
711 # FindOrLoadComponent called:
712 # 1. CORBA resolution of server
713 # 2. the __new__ method is called again
714 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
715 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
718 # FindOrLoadComponent not called
720 # geomBuilder instance is created from lcc.FindOrLoadComponent
721 #print "==== super ", engine, geom, doLcc, created
722 geom = super(geomBuilder,cls).__new__(cls)
725 # geom engine not created: existing engine found
726 #print "==== existing ", engine, geom, doLcc, created
728 #print "return geom 1 ", geom
731 #print "return geom 2 ", geom
734 def __init__(self, *args):
736 #print "-------- geomBuilder __init__ --- ", created, self
739 GEOM._objref_GEOM_Gen.__init__(self, *args)
740 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
741 self.myBuilder = None
758 ## Process object publication in the study, as follows:
759 # - if @a theName is specified (not None), the object is published in the study
760 # with this name, not taking into account "auto-publishing" option;
761 # - if @a theName is NOT specified, the object is published in the study
762 # (using default name, which can be customized using @a theDefaultName parameter)
763 # only if auto-publishing is switched on.
765 # @param theObj object, a subject for publishing
766 # @param theName object name for study
767 # @param theDefaultName default name for the auto-publishing
769 # @sa addToStudyAuto()
770 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
772 def _item_name(_names, _defname, _idx=-1):
773 if not _names: _names = _defname
774 if type(_names) in [list, tuple]:
776 if _idx >= len(_names) or not _names[_idx]:
777 if type(_defname) not in [list, tuple]:
778 _name = "%s_%d"%(_defname, _idx+1)
779 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
780 _name = _defname[_idx]
782 _name = "%noname_%d"%(dn, _idx+1)
788 # must be wrong usage
793 _name = "%s_%d"%(_names, _idx+1)
799 def _publish( _name, _obj ):
801 if isinstance( _obj, GEOM._objref_GEOM_Field ):
802 fatherObj = _obj.GetShape()
803 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
804 fatherObj = _obj.GetField()
805 elif not _obj.IsMainShape():
806 fatherObj = _obj.GetMainShape()
808 if fatherObj and fatherObj.GetStudyEntry():
809 self.addToStudyInFather(fatherObj, _obj, _name)
811 self.addToStudy(_obj, _name)
817 if not theName and not self.myMaxNbSubShapesAllowed:
818 return # nothing to do: auto-publishing is disabled
819 if not theName and not theDefaultName:
820 return # neither theName nor theDefaultName is given
822 if type(theObj) in [list, tuple]:
823 # list of objects is being published
826 if not obj: continue # bad object
827 name = _item_name(theName, theDefaultName, idx)
828 _publish( name, obj )
830 if not theName and idx == self.myMaxNbSubShapesAllowed: break
834 # single object is published
835 name = _item_name(theName, theDefaultName)
836 _publish( name, theObj )
839 ## @addtogroup l1_geomBuilder_auxiliary
842 self.myStudy = salome.myStudy
843 self.myBuilder = self.myStudy.NewBuilder()
845 # load data from the study file, if necessary
846 component = self.myStudy.FindComponent("GEOM")
848 self.myBuilder.LoadWith(component, self)
850 self.BasicOp = self.GetIBasicOperations ()
851 self.CurvesOp = self.GetICurvesOperations ()
852 self.PrimOp = self.GetI3DPrimOperations ()
853 self.ShapesOp = self.GetIShapesOperations ()
854 self.HealOp = self.GetIHealingOperations ()
855 self.InsertOp = self.GetIInsertOperations ()
856 self.BoolOp = self.GetIBooleanOperations ()
857 self.TrsfOp = self.GetITransformOperations()
858 self.LocalOp = self.GetILocalOperations ()
859 self.MeasuOp = self.GetIMeasureOperations ()
860 self.BlocksOp = self.GetIBlocksOperations ()
861 self.GroupOp = self.GetIGroupOperations ()
862 self.FieldOp = self.GetIFieldOperations ()
863 self.TestOp = self.GetITestOperations ()
865 notebook.myStudy = self.myStudy
868 def GetPluginOperations(self, libraryName):
869 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
872 ## Enable / disable results auto-publishing
874 # The automatic publishing is managed in the following way:
875 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
876 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
877 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
878 # value passed as parameter has the same effect.
879 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
880 # maximum number of sub-shapes allowed for publishing is set to specified value.
882 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
883 # @ingroup l1_publish_data
884 def addToStudyAuto(self, maxNbSubShapes=-1):
886 Enable / disable results auto-publishing
888 The automatic publishing is managed in the following way:
889 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
890 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
891 maximum number of sub-shapes allowed for publishing is unlimited; any negative
892 value passed as parameter has the same effect.
893 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
894 maximum number of sub-shapes allowed for publishing is set to this value.
897 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
900 geompy.addToStudyAuto() # enable auto-publishing
901 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
902 geompy.addToStudyAuto(0) # disable auto-publishing
904 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
907 ## Dump component to the Python script
908 # This method overrides IDL function to allow default values for the parameters.
909 def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
911 Dump component to the Python script
912 This method overrides IDL function to allow default values for the parameters.
914 return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
916 ## Get name for sub-shape aSubObj of shape aMainObj
918 # @ref swig_SubShapeName "Example"
919 @ManageTransactions("ShapesOp")
920 def SubShapeName(self,aSubObj, aMainObj):
922 Get name for sub-shape aSubObj of shape aMainObj
924 # Example: see GEOM_TestAll.py
926 #aSubId = orb.object_to_string(aSubObj)
927 #aMainId = orb.object_to_string(aMainObj)
928 #index = gg.getIndexTopology(aSubId, aMainId)
929 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
930 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
931 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
934 ## Publish in study aShape with name aName
936 # \param aShape the shape to be published
937 # \param aName the name for the shape
938 # \param doRestoreSubShapes if True, finds and publishes also
939 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
940 # and published sub-shapes of arguments
941 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
942 # these arguments description
943 # \return study entry of the published shape in form of string
945 # @ingroup l1_publish_data
946 # @ref swig_all_addtostudy "Example"
947 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
948 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
950 Publish in study aShape with name aName
953 aShape the shape to be published
954 aName the name for the shape
955 doRestoreSubShapes if True, finds and publishes also
956 sub-shapes of aShape, corresponding to its arguments
957 and published sub-shapes of arguments
958 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
959 these arguments description
962 study entry of the published shape in form of string
965 id_block1 = geompy.addToStudy(Block1, "Block 1")
967 # Example: see GEOM_TestAll.py
969 aSObject = self.AddInStudy(aShape, aName, None)
970 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
971 if doRestoreSubShapes:
972 self.RestoreSubShapesSO(aSObject, theArgs,
973 theFindMethod, theInheritFirstArg, True )
975 print("addToStudy() failed")
977 return aShape.GetStudyEntry()
979 ## Publish in study aShape with name aName as sub-object of previously published aFather
980 # \param aFather previously published object
981 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
982 # \param aName the name for the shape
984 # \return study entry of the published shape in form of string
986 # @ingroup l1_publish_data
987 # @ref swig_all_addtostudyInFather "Example"
988 def addToStudyInFather(self, aFather, aShape, aName):
990 Publish in study aShape with name aName as sub-object of previously published aFather
993 aFather previously published object
994 aShape the shape to be published as sub-object of aFather
995 aName the name for the shape
998 study entry of the published shape in form of string
1000 # Example: see GEOM_TestAll.py
1002 aSObject = self.AddInStudy(aShape, aName, aFather)
1003 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
1005 print("addToStudyInFather() failed")
1007 return aShape.GetStudyEntry()
1009 ## Unpublish object in study
1011 # \param obj the object to be unpublished
1012 def hideInStudy(self, obj):
1014 Unpublish object in study
1017 obj the object to be unpublished
1019 ior = salome.orb.object_to_string(obj)
1020 aSObject = self.myStudy.FindObjectIOR(ior)
1021 if aSObject is not None:
1022 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1023 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1024 drwAttribute.SetDrawable(False)
1025 # hide references if any
1026 vso = self.myStudy.FindDependances(aSObject);
1028 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1029 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1030 drwAttribute.SetDrawable(False)
1034 # end of l1_geomBuilder_auxiliary
1037 ## @addtogroup l3_restore_ss
1040 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1041 # To be used from python scripts out of addToStudy() (non-default usage)
1042 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1043 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1044 # If this list is empty, all operation arguments will be published
1045 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1046 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
1047 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1048 # Do not publish sub-shapes in place of arguments, but only
1049 # in place of sub-shapes of the first argument,
1050 # because the whole shape corresponds to the first argument.
1051 # Mainly to be used after transformations, but it also can be
1052 # useful after partition with one object shape, and some other
1053 # operations, where only the first argument has to be considered.
1054 # If theObject has only one argument shape, this flag is automatically
1055 # considered as True, not regarding really passed value.
1056 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1057 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1058 # \return list of published sub-shapes
1060 # @ref tui_restore_prs_params "Example"
1061 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1062 theInheritFirstArg=False, theAddPrefix=True):
1064 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1065 To be used from python scripts out of geompy.addToStudy (non-default usage)
1068 theObject published GEOM.GEOM_Object, arguments of which will be published
1069 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1070 If this list is empty, all operation arguments will be published
1071 theFindMethod method to search sub-shapes, corresponding to arguments and
1072 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1073 theInheritFirstArg set properties of the first argument for theObject.
1074 Do not publish sub-shapes in place of arguments, but only
1075 in place of sub-shapes of the first argument,
1076 because the whole shape corresponds to the first argument.
1077 Mainly to be used after transformations, but it also can be
1078 useful after partition with one object shape, and some other
1079 operations, where only the first argument has to be considered.
1080 If theObject has only one argument shape, this flag is automatically
1081 considered as True, not regarding really passed value.
1082 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1083 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1085 list of published sub-shapes
1087 # Example: see GEOM_TestAll.py
1088 return self.RestoreSubShapesO(theObject, theArgs,
1089 theFindMethod, theInheritFirstArg, theAddPrefix)
1091 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1092 # To be used from python scripts out of addToStudy() (non-default usage)
1093 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1094 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1095 # If this list is empty, all operation arguments will be published
1096 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1097 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1098 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1099 # Do not publish sub-shapes in place of arguments, but only
1100 # in place of sub-shapes of the first argument,
1101 # because the whole shape corresponds to the first argument.
1102 # Mainly to be used after transformations, but it also can be
1103 # useful after partition with one object shape, and some other
1104 # operations, where only the first argument has to be considered.
1105 # If theObject has only one argument shape, this flag is automatically
1106 # considered as True, not regarding really passed value.
1107 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1108 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1109 # \return list of published sub-shapes
1111 # @ref tui_restore_prs_params "Example"
1112 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1113 theInheritFirstArg=False, theAddPrefix=True):
1115 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1116 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1119 theObject published GEOM.GEOM_Object, arguments of which will be published
1120 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1121 If this list is empty, all operation arguments will be published
1122 theFindMethod method to search sub-shapes, corresponding to arguments and
1123 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1124 theInheritFirstArg set properties of the first argument for theObject.
1125 Do not publish sub-shapes in place of arguments, but only
1126 in place of sub-shapes of the first argument,
1127 because the whole shape corresponds to the first argument.
1128 Mainly to be used after transformations, but it also can be
1129 useful after partition with one object shape, and some other
1130 operations, where only the first argument has to be considered.
1131 If theObject has only one argument shape, this flag is automatically
1132 considered as True, not regarding really passed value.
1133 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1134 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1137 list of published sub-shapes
1139 # Example: see GEOM_TestAll.py
1140 return self.RestoreGivenSubShapesO(theObject, theArgs,
1141 theFindMethod, theInheritFirstArg, theAddPrefix)
1143 # end of l3_restore_ss
1146 ## @addtogroup l3_basic_go
1149 ## Create point by three coordinates.
1150 # @param theX The X coordinate of the point.
1151 # @param theY The Y coordinate of the point.
1152 # @param theZ The Z coordinate of the point.
1153 # @param theName Object name; when specified, this parameter is used
1154 # for result publication in the study. Otherwise, if automatic
1155 # publication is switched on, default value is used for result name.
1157 # @return New GEOM.GEOM_Object, containing the created point.
1159 # @ref tui_creation_point "Example"
1160 @ManageTransactions("BasicOp")
1161 def MakeVertex(self, theX, theY, theZ, theName=None):
1163 Create point by three coordinates.
1166 theX The X coordinate of the point.
1167 theY The Y coordinate of the point.
1168 theZ The Z coordinate of the point.
1169 theName Object name; when specified, this parameter is used
1170 for result publication in the study. Otherwise, if automatic
1171 publication is switched on, default value is used for result name.
1174 New GEOM.GEOM_Object, containing the created point.
1176 # Example: see GEOM_TestAll.py
1177 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1178 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1179 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1180 anObj.SetParameters(Parameters)
1181 self._autoPublish(anObj, theName, "vertex")
1184 ## Create a point, distant from the referenced point
1185 # on the given distances along the coordinate axes.
1186 # @param theReference The referenced point.
1187 # @param theX Displacement from the referenced point along OX axis.
1188 # @param theY Displacement from the referenced point along OY axis.
1189 # @param theZ Displacement from the referenced point along OZ axis.
1190 # @param theName Object name; when specified, this parameter is used
1191 # for result publication in the study. Otherwise, if automatic
1192 # publication is switched on, default value is used for result name.
1194 # @return New GEOM.GEOM_Object, containing the created point.
1196 # @ref tui_creation_point "Example"
1197 @ManageTransactions("BasicOp")
1198 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1200 Create a point, distant from the referenced point
1201 on the given distances along the coordinate axes.
1204 theReference The referenced point.
1205 theX Displacement from the referenced point along OX axis.
1206 theY Displacement from the referenced point along OY axis.
1207 theZ Displacement from the referenced point along OZ axis.
1208 theName Object name; when specified, this parameter is used
1209 for result publication in the study. Otherwise, if automatic
1210 publication is switched on, default value is used for result name.
1213 New GEOM.GEOM_Object, containing the created point.
1215 # Example: see GEOM_TestAll.py
1216 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1217 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1218 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1219 anObj.SetParameters(Parameters)
1220 self._autoPublish(anObj, theName, "vertex")
1223 ## Create a point, corresponding to the given parameter on the given curve.
1224 # @param theRefCurve The referenced curve.
1225 # @param theParameter Value of parameter on the referenced curve.
1226 # @param takeOrientationIntoAccount flag that tells if it is necessary
1227 # to take the curve's orientation into account for the
1228 # operation. I.e. if this flag is set, the results for the same
1229 # parameters (except the value 0.5) is different for forward
1230 # and reversed curves. If it is not set the result is the same.
1231 # @param theName Object name; when specified, this parameter is used
1232 # for result publication in the study. Otherwise, if automatic
1233 # publication is switched on, default value is used for result name.
1235 # @return New GEOM.GEOM_Object, containing the created point.
1237 # @ref tui_creation_point "Example"
1238 @ManageTransactions("BasicOp")
1239 def MakeVertexOnCurve(self, theRefCurve, theParameter,
1240 takeOrientationIntoAccount=False, theName=None):
1242 Create a point, corresponding to the given parameter on the given curve.
1245 theRefCurve The referenced curve.
1246 theParameter Value of parameter on the referenced curve.
1247 takeOrientationIntoAccount flag that tells if it is necessary
1248 to take the curve's orientation into account for the
1249 operation. I.e. if this flag is set, the results for
1250 the same parameters (except the value 0.5) is different
1251 for forward and reversed curves. If it is not set
1252 the result is the same.
1253 theName Object name; when specified, this parameter is used
1254 for result publication in the study. Otherwise, if automatic
1255 publication is switched on, default value is used for result name.
1258 New GEOM.GEOM_Object, containing the created point.
1261 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1263 # Example: see GEOM_TestAll.py
1264 theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1265 theParameter, takeOrientationIntoAccount)
1266 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1267 takeOrientationIntoAccount)
1268 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1269 anObj.SetParameters(Parameters)
1270 self._autoPublish(anObj, theName, "vertex")
1273 ## Create a point by projection give coordinates on the given curve
1274 # @param theRefCurve The referenced curve.
1275 # @param theX X-coordinate in 3D space
1276 # @param theY Y-coordinate in 3D space
1277 # @param theZ Z-coordinate in 3D space
1278 # @param theName Object name; when specified, this parameter is used
1279 # for result publication in the study. Otherwise, if automatic
1280 # publication is switched on, default value is used for result name.
1282 # @return New GEOM.GEOM_Object, containing the created point.
1284 # @ref tui_creation_point "Example"
1285 @ManageTransactions("BasicOp")
1286 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1288 Create a point by projection give coordinates on the given curve
1291 theRefCurve The referenced curve.
1292 theX X-coordinate in 3D space
1293 theY Y-coordinate in 3D space
1294 theZ Z-coordinate in 3D space
1295 theName Object name; when specified, this parameter is used
1296 for result publication in the study. Otherwise, if automatic
1297 publication is switched on, default value is used for result name.
1300 New GEOM.GEOM_Object, containing the created point.
1303 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1305 # Example: see GEOM_TestAll.py
1306 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1307 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1308 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1309 anObj.SetParameters(Parameters)
1310 self._autoPublish(anObj, theName, "vertex")
1313 ## Create a point, corresponding to the given length on the given curve.
1314 # @param theRefCurve The referenced curve.
1315 # @param theLength Length on the referenced curve. It can be negative.
1316 # @param theStartPoint Point allowing to choose the direction for the calculation
1317 # of the length. If None, start from the first point of theRefCurve.
1318 # @param theName Object name; when specified, this parameter is used
1319 # for result publication in the study. Otherwise, if automatic
1320 # publication is switched on, default value is used for result name.
1322 # @return New GEOM.GEOM_Object, containing the created point.
1324 # @ref tui_creation_point "Example"
1325 @ManageTransactions("BasicOp")
1326 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1328 Create a point, corresponding to the given length on the given curve.
1331 theRefCurve The referenced curve.
1332 theLength Length on the referenced curve. It can be negative.
1333 theStartPoint Point allowing to choose the direction for the calculation
1334 of the length. If None, start from the first point of theRefCurve.
1335 theName Object name; when specified, this parameter is used
1336 for result publication in the study. Otherwise, if automatic
1337 publication is switched on, default value is used for result name.
1340 New GEOM.GEOM_Object, containing the created point.
1342 # Example: see GEOM_TestAll.py
1343 theLength, Parameters = ParseParameters(theLength)
1344 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1345 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1346 anObj.SetParameters(Parameters)
1347 self._autoPublish(anObj, theName, "vertex")
1350 ## Create a point, corresponding to the given parameters on the
1352 # @param theRefSurf The referenced surface.
1353 # @param theUParameter Value of U-parameter on the referenced surface.
1354 # @param theVParameter Value of V-parameter on the referenced surface.
1355 # @param theName Object name; when specified, this parameter is used
1356 # for result publication in the study. Otherwise, if automatic
1357 # publication is switched on, default value is used for result name.
1359 # @return New GEOM.GEOM_Object, containing the created point.
1361 # @ref swig_MakeVertexOnSurface "Example"
1362 @ManageTransactions("BasicOp")
1363 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1365 Create a point, corresponding to the given parameters on the
1369 theRefSurf The referenced surface.
1370 theUParameter Value of U-parameter on the referenced surface.
1371 theVParameter Value of V-parameter on the referenced surface.
1372 theName Object name; when specified, this parameter is used
1373 for result publication in the study. Otherwise, if automatic
1374 publication is switched on, default value is used for result name.
1377 New GEOM.GEOM_Object, containing the created point.
1380 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1382 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1383 # Example: see GEOM_TestAll.py
1384 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1385 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1386 anObj.SetParameters(Parameters);
1387 self._autoPublish(anObj, theName, "vertex")
1390 ## Create a point by projection give coordinates on the given surface
1391 # @param theRefSurf The referenced surface.
1392 # @param theX X-coordinate in 3D space
1393 # @param theY Y-coordinate in 3D space
1394 # @param theZ Z-coordinate in 3D space
1395 # @param theName Object name; when specified, this parameter is used
1396 # for result publication in the study. Otherwise, if automatic
1397 # publication is switched on, default value is used for result name.
1399 # @return New GEOM.GEOM_Object, containing the created point.
1401 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1402 @ManageTransactions("BasicOp")
1403 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1405 Create a point by projection give coordinates on the given surface
1408 theRefSurf The referenced surface.
1409 theX X-coordinate in 3D space
1410 theY Y-coordinate in 3D space
1411 theZ Z-coordinate in 3D space
1412 theName Object name; when specified, this parameter is used
1413 for result publication in the study. Otherwise, if automatic
1414 publication is switched on, default value is used for result name.
1417 New GEOM.GEOM_Object, containing the created point.
1420 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1422 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1423 # Example: see GEOM_TestAll.py
1424 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1425 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1426 anObj.SetParameters(Parameters);
1427 self._autoPublish(anObj, theName, "vertex")
1430 ## Create a point, which lays on the given face.
1431 # The point will lay in arbitrary place of the face.
1432 # The only condition on it is a non-zero distance to the face boundary.
1433 # Such point can be used to uniquely identify the face inside any
1434 # shape in case, when the shape does not contain overlapped faces.
1435 # @param theFace The referenced face.
1436 # @param theName Object name; when specified, this parameter is used
1437 # for result publication in the study. Otherwise, if automatic
1438 # publication is switched on, default value is used for result name.
1440 # @return New GEOM.GEOM_Object, containing the created point.
1442 # @ref swig_MakeVertexInsideFace "Example"
1443 @ManageTransactions("BasicOp")
1444 def MakeVertexInsideFace (self, theFace, theName=None):
1446 Create a point, which lays on the given face.
1447 The point will lay in arbitrary place of the face.
1448 The only condition on it is a non-zero distance to the face boundary.
1449 Such point can be used to uniquely identify the face inside any
1450 shape in case, when the shape does not contain overlapped faces.
1453 theFace The referenced face.
1454 theName Object name; when specified, this parameter is used
1455 for result publication in the study. Otherwise, if automatic
1456 publication is switched on, default value is used for result name.
1459 New GEOM.GEOM_Object, containing the created point.
1462 p_on_face = geompy.MakeVertexInsideFace(Face)
1464 # Example: see GEOM_TestAll.py
1465 anObj = self.BasicOp.MakePointOnFace(theFace)
1466 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1467 self._autoPublish(anObj, theName, "vertex")
1470 ## Create a point on intersection of two lines.
1471 # @param theRefLine1, theRefLine2 The referenced lines.
1472 # @param theName Object name; when specified, this parameter is used
1473 # for result publication in the study. Otherwise, if automatic
1474 # publication is switched on, default value is used for result name.
1476 # @return New GEOM.GEOM_Object, containing the created point.
1478 # @ref swig_MakeVertexOnLinesIntersection "Example"
1479 @ManageTransactions("BasicOp")
1480 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1482 Create a point on intersection of two lines.
1485 theRefLine1, theRefLine2 The referenced lines.
1486 theName Object name; when specified, this parameter is used
1487 for result publication in the study. Otherwise, if automatic
1488 publication is switched on, default value is used for result name.
1491 New GEOM.GEOM_Object, containing the created point.
1493 # Example: see GEOM_TestAll.py
1494 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1495 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1496 self._autoPublish(anObj, theName, "vertex")
1499 ## Create a tangent, corresponding to the given parameter on the given curve.
1500 # @param theRefCurve The referenced curve.
1501 # @param theParameter Value of parameter on the referenced curve.
1502 # @param theName Object name; when specified, this parameter is used
1503 # for result publication in the study. Otherwise, if automatic
1504 # publication is switched on, default value is used for result name.
1506 # @return New GEOM.GEOM_Object, containing the created tangent.
1508 # @ref swig_MakeTangentOnCurve "Example"
1509 @ManageTransactions("BasicOp")
1510 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1512 Create a tangent, corresponding to the given parameter on the given curve.
1515 theRefCurve The referenced curve.
1516 theParameter Value of parameter on the referenced curve.
1517 theName Object name; when specified, this parameter is used
1518 for result publication in the study. Otherwise, if automatic
1519 publication is switched on, default value is used for result name.
1522 New GEOM.GEOM_Object, containing the created tangent.
1525 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1527 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1528 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1529 self._autoPublish(anObj, theName, "tangent")
1532 ## Create a tangent plane, corresponding to the given parameter on the given face.
1533 # @param theFace The face for which tangent plane should be built.
1534 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1535 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1536 # @param theTrimSize the size of plane.
1537 # @param theName Object name; when specified, this parameter is used
1538 # for result publication in the study. Otherwise, if automatic
1539 # publication is switched on, default value is used for result name.
1541 # @return New GEOM.GEOM_Object, containing the created tangent.
1543 # @ref swig_MakeTangentPlaneOnFace "Example"
1544 @ManageTransactions("BasicOp")
1545 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1547 Create a tangent plane, corresponding to the given parameter on the given face.
1550 theFace The face for which tangent plane should be built.
1551 theParameterV vertical value of the center point (0.0 - 1.0).
1552 theParameterU horisontal value of the center point (0.0 - 1.0).
1553 theTrimSize the size of plane.
1554 theName Object name; when specified, this parameter is used
1555 for result publication in the study. Otherwise, if automatic
1556 publication is switched on, default value is used for result name.
1559 New GEOM.GEOM_Object, containing the created tangent.
1562 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1564 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1565 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1566 self._autoPublish(anObj, theName, "tangent")
1569 ## Create a vector with the given components.
1570 # @param theDX X component of the vector.
1571 # @param theDY Y component of the vector.
1572 # @param theDZ Z component of the vector.
1573 # @param theName Object name; when specified, this parameter is used
1574 # for result publication in the study. Otherwise, if automatic
1575 # publication is switched on, default value is used for result name.
1577 # @return New GEOM.GEOM_Object, containing the created vector.
1579 # @ref tui_creation_vector "Example"
1580 @ManageTransactions("BasicOp")
1581 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1583 Create a vector with the given components.
1586 theDX X component of the vector.
1587 theDY Y component of the vector.
1588 theDZ Z component of the vector.
1589 theName Object name; when specified, this parameter is used
1590 for result publication in the study. Otherwise, if automatic
1591 publication is switched on, default value is used for result name.
1594 New GEOM.GEOM_Object, containing the created vector.
1596 # Example: see GEOM_TestAll.py
1597 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1598 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1599 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1600 anObj.SetParameters(Parameters)
1601 self._autoPublish(anObj, theName, "vector")
1604 ## Create a vector between two points.
1605 # @param thePnt1 Start point for the vector.
1606 # @param thePnt2 End point for the vector.
1607 # @param theName Object name; when specified, this parameter is used
1608 # for result publication in the study. Otherwise, if automatic
1609 # publication is switched on, default value is used for result name.
1611 # @return New GEOM.GEOM_Object, containing the created vector.
1613 # @ref tui_creation_vector "Example"
1614 @ManageTransactions("BasicOp")
1615 def MakeVector(self, thePnt1, thePnt2, theName=None):
1617 Create a vector between two points.
1620 thePnt1 Start point for the vector.
1621 thePnt2 End point for the vector.
1622 theName Object name; when specified, this parameter is used
1623 for result publication in the study. Otherwise, if automatic
1624 publication is switched on, default value is used for result name.
1627 New GEOM.GEOM_Object, containing the created vector.
1629 # Example: see GEOM_TestAll.py
1630 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1631 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1632 self._autoPublish(anObj, theName, "vector")
1635 ## Create a line, passing through the given point
1636 # and parallel to the given direction
1637 # @param thePnt Point. The resulting line will pass through it.
1638 # @param theDir Direction. The resulting line will be parallel to it.
1639 # @param theName Object name; when specified, this parameter is used
1640 # for result publication in the study. Otherwise, if automatic
1641 # publication is switched on, default value is used for result name.
1643 # @return New GEOM.GEOM_Object, containing the created line.
1645 # @ref tui_creation_line "Example"
1646 @ManageTransactions("BasicOp")
1647 def MakeLine(self, thePnt, theDir, theName=None):
1649 Create a line, passing through the given point
1650 and parallel to the given direction
1653 thePnt Point. The resulting line will pass through it.
1654 theDir Direction. The resulting line will be parallel to it.
1655 theName Object name; when specified, this parameter is used
1656 for result publication in the study. Otherwise, if automatic
1657 publication is switched on, default value is used for result name.
1660 New GEOM.GEOM_Object, containing the created line.
1662 # Example: see GEOM_TestAll.py
1663 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1664 RaiseIfFailed("MakeLine", self.BasicOp)
1665 self._autoPublish(anObj, theName, "line")
1668 ## Create a line, passing through the given points
1669 # @param thePnt1 First of two points, defining the line.
1670 # @param thePnt2 Second of two points, defining the line.
1671 # @param theName Object name; when specified, this parameter is used
1672 # for result publication in the study. Otherwise, if automatic
1673 # publication is switched on, default value is used for result name.
1675 # @return New GEOM.GEOM_Object, containing the created line.
1677 # @ref tui_creation_line "Example"
1678 @ManageTransactions("BasicOp")
1679 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1681 Create a line, passing through the given points
1684 thePnt1 First of two points, defining the line.
1685 thePnt2 Second of two points, defining the line.
1686 theName Object name; when specified, this parameter is used
1687 for result publication in the study. Otherwise, if automatic
1688 publication is switched on, default value is used for result name.
1691 New GEOM.GEOM_Object, containing the created line.
1693 # Example: see GEOM_TestAll.py
1694 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1695 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1696 self._autoPublish(anObj, theName, "line")
1699 ## Create a line on two faces intersection.
1700 # @param theFace1 First of two faces, defining the line.
1701 # @param theFace2 Second of two faces, defining the line.
1702 # @param theName Object name; when specified, this parameter is used
1703 # for result publication in the study. Otherwise, if automatic
1704 # publication is switched on, default value is used for result name.
1706 # @return New GEOM.GEOM_Object, containing the created line.
1708 # @ref swig_MakeLineTwoFaces "Example"
1709 @ManageTransactions("BasicOp")
1710 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1712 Create a line on two faces intersection.
1715 theFace1 First of two faces, defining the line.
1716 theFace2 Second of two faces, defining the line.
1717 theName Object name; when specified, this parameter is used
1718 for result publication in the study. Otherwise, if automatic
1719 publication is switched on, default value is used for result name.
1722 New GEOM.GEOM_Object, containing the created line.
1724 # Example: see GEOM_TestAll.py
1725 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1726 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1727 self._autoPublish(anObj, theName, "line")
1730 ## Create a plane, passing through the given point
1731 # and normal to the given vector.
1732 # @param thePnt Point, the plane has to pass through.
1733 # @param theVec Vector, defining the plane normal direction.
1734 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1735 # @param theName Object name; when specified, this parameter is used
1736 # for result publication in the study. Otherwise, if automatic
1737 # publication is switched on, default value is used for result name.
1739 # @return New GEOM.GEOM_Object, containing the created plane.
1741 # @ref tui_creation_plane "Example"
1742 @ManageTransactions("BasicOp")
1743 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1745 Create a plane, passing through the given point
1746 and normal to the given vector.
1749 thePnt Point, the plane has to pass through.
1750 theVec Vector, defining the plane normal direction.
1751 theTrimSize Half size of a side of quadrangle face, representing the plane.
1752 theName Object name; when specified, this parameter is used
1753 for result publication in the study. Otherwise, if automatic
1754 publication is switched on, default value is used for result name.
1757 New GEOM.GEOM_Object, containing the created plane.
1759 # Example: see GEOM_TestAll.py
1760 theTrimSize, Parameters = ParseParameters(theTrimSize);
1761 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1762 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1763 anObj.SetParameters(Parameters)
1764 self._autoPublish(anObj, theName, "plane")
1767 ## Create a plane, passing through the three given points
1768 # @param thePnt1 First of three points, defining the plane.
1769 # @param thePnt2 Second of three points, defining the plane.
1770 # @param thePnt3 Third of three points, defining the plane.
1771 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1772 # @param theName Object name; when specified, this parameter is used
1773 # for result publication in the study. Otherwise, if automatic
1774 # publication is switched on, default value is used for result name.
1776 # @return New GEOM.GEOM_Object, containing the created plane.
1778 # @ref tui_creation_plane "Example"
1779 @ManageTransactions("BasicOp")
1780 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1782 Create a plane, passing through the three given points
1785 thePnt1 First of three points, defining the plane.
1786 thePnt2 Second of three points, defining the plane.
1787 thePnt3 Third of three points, defining the plane.
1788 theTrimSize Half size of a side of quadrangle face, representing the plane.
1789 theName Object name; when specified, this parameter is used
1790 for result publication in the study. Otherwise, if automatic
1791 publication is switched on, default value is used for result name.
1794 New GEOM.GEOM_Object, containing the created plane.
1796 # Example: see GEOM_TestAll.py
1797 theTrimSize, Parameters = ParseParameters(theTrimSize);
1798 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1799 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1800 anObj.SetParameters(Parameters)
1801 self._autoPublish(anObj, theName, "plane")
1804 ## Create a plane, similar to the existing one, but with another size of representing face.
1805 # @param theFace Referenced plane or LCS(Marker).
1806 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1807 # @param theName Object name; when specified, this parameter is used
1808 # for result publication in the study. Otherwise, if automatic
1809 # publication is switched on, default value is used for result name.
1811 # @return New GEOM.GEOM_Object, containing the created plane.
1813 # @ref tui_creation_plane "Example"
1814 @ManageTransactions("BasicOp")
1815 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1817 Create a plane, similar to the existing one, but with another size of representing face.
1820 theFace Referenced plane or LCS(Marker).
1821 theTrimSize New half size of a side of quadrangle face, representing the plane.
1822 theName Object name; when specified, this parameter is used
1823 for result publication in the study. Otherwise, if automatic
1824 publication is switched on, default value is used for result name.
1827 New GEOM.GEOM_Object, containing the created plane.
1829 # Example: see GEOM_TestAll.py
1830 theTrimSize, Parameters = ParseParameters(theTrimSize);
1831 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1832 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1833 anObj.SetParameters(Parameters)
1834 self._autoPublish(anObj, theName, "plane")
1837 ## Create a plane, passing through the 2 vectors
1838 # with center in a start point of the first vector.
1839 # @param theVec1 Vector, defining center point and plane direction.
1840 # @param theVec2 Vector, defining the plane normal direction.
1841 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1842 # @param theName Object name; when specified, this parameter is used
1843 # for result publication in the study. Otherwise, if automatic
1844 # publication is switched on, default value is used for result name.
1846 # @return New GEOM.GEOM_Object, containing the created plane.
1848 # @ref tui_creation_plane "Example"
1849 @ManageTransactions("BasicOp")
1850 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1852 Create a plane, passing through the 2 vectors
1853 with center in a start point of the first vector.
1856 theVec1 Vector, defining center point and plane direction.
1857 theVec2 Vector, defining the plane normal direction.
1858 theTrimSize Half size of a side of quadrangle face, representing the plane.
1859 theName Object name; when specified, this parameter is used
1860 for result publication in the study. Otherwise, if automatic
1861 publication is switched on, default value is used for result name.
1864 New GEOM.GEOM_Object, containing the created plane.
1866 # Example: see GEOM_TestAll.py
1867 theTrimSize, Parameters = ParseParameters(theTrimSize);
1868 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1869 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1870 anObj.SetParameters(Parameters)
1871 self._autoPublish(anObj, theName, "plane")
1874 ## Create a plane, based on a Local coordinate system.
1875 # @param theLCS coordinate system, defining plane.
1876 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1877 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1878 # @param theName Object name; when specified, this parameter is used
1879 # for result publication in the study. Otherwise, if automatic
1880 # publication is switched on, default value is used for result name.
1882 # @return New GEOM.GEOM_Object, containing the created plane.
1884 # @ref tui_creation_plane "Example"
1885 @ManageTransactions("BasicOp")
1886 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1888 Create a plane, based on a Local coordinate system.
1891 theLCS coordinate system, defining plane.
1892 theTrimSize Half size of a side of quadrangle face, representing the plane.
1893 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1894 theName Object name; when specified, this parameter is used
1895 for result publication in the study. Otherwise, if automatic
1896 publication is switched on, default value is used for result name.
1899 New GEOM.GEOM_Object, containing the created plane.
1901 # Example: see GEOM_TestAll.py
1902 theTrimSize, Parameters = ParseParameters(theTrimSize);
1903 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1904 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1905 anObj.SetParameters(Parameters)
1906 self._autoPublish(anObj, theName, "plane")
1909 ## Create a local coordinate system.
1910 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1911 # @param XDX,XDY,XDZ Three components of OX direction
1912 # @param YDX,YDY,YDZ Three components of OY direction
1913 # @param theName Object name; when specified, this parameter is used
1914 # for result publication in the study. Otherwise, if automatic
1915 # publication is switched on, default value is used for result name.
1917 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1919 # @ref swig_MakeMarker "Example"
1920 @ManageTransactions("BasicOp")
1921 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1923 Create a local coordinate system.
1926 OX,OY,OZ Three coordinates of coordinate system origin.
1927 XDX,XDY,XDZ Three components of OX direction
1928 YDX,YDY,YDZ Three components of OY direction
1929 theName Object name; when specified, this parameter is used
1930 for result publication in the study. Otherwise, if automatic
1931 publication is switched on, default value is used for result name.
1934 New GEOM.GEOM_Object, containing the created coordinate system.
1936 # Example: see GEOM_TestAll.py
1937 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1938 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1939 RaiseIfFailed("MakeMarker", self.BasicOp)
1940 anObj.SetParameters(Parameters)
1941 self._autoPublish(anObj, theName, "lcs")
1944 ## Create a local coordinate system from shape.
1945 # @param theShape The initial shape to detect the coordinate system.
1946 # @param theName Object name; when specified, this parameter is used
1947 # for result publication in the study. Otherwise, if automatic
1948 # publication is switched on, default value is used for result name.
1950 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1952 # @ref tui_creation_lcs "Example"
1953 @ManageTransactions("BasicOp")
1954 def MakeMarkerFromShape(self, theShape, theName=None):
1956 Create a local coordinate system from shape.
1959 theShape The initial shape to detect the coordinate system.
1960 theName Object name; when specified, this parameter is used
1961 for result publication in the study. Otherwise, if automatic
1962 publication is switched on, default value is used for result name.
1965 New GEOM.GEOM_Object, containing the created coordinate system.
1967 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1968 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1969 self._autoPublish(anObj, theName, "lcs")
1972 ## Create a local coordinate system from point and two vectors.
1973 # @param theOrigin Point of coordinate system origin.
1974 # @param theXVec Vector of X direction
1975 # @param theYVec Vector of Y direction
1976 # @param theName Object name; when specified, this parameter is used
1977 # for result publication in the study. Otherwise, if automatic
1978 # publication is switched on, default value is used for result name.
1980 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1982 # @ref tui_creation_lcs "Example"
1983 @ManageTransactions("BasicOp")
1984 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1986 Create a local coordinate system from point and two vectors.
1989 theOrigin Point of coordinate system origin.
1990 theXVec Vector of X direction
1991 theYVec Vector of Y direction
1992 theName Object name; when specified, this parameter is used
1993 for result publication in the study. Otherwise, if automatic
1994 publication is switched on, default value is used for result name.
1997 New GEOM.GEOM_Object, containing the created coordinate system.
2000 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
2001 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
2002 self._autoPublish(anObj, theName, "lcs")
2005 # end of l3_basic_go
2008 ## @addtogroup l4_curves
2011 ## Create an arc of circle, passing through three given points.
2012 # @param thePnt1 Start point of the arc.
2013 # @param thePnt2 Middle point of the arc.
2014 # @param thePnt3 End point of the arc.
2015 # @param theName Object name; when specified, this parameter is used
2016 # for result publication in the study. Otherwise, if automatic
2017 # publication is switched on, default value is used for result name.
2019 # @return New GEOM.GEOM_Object, containing the created arc.
2021 # @ref swig_MakeArc "Example"
2022 @ManageTransactions("CurvesOp")
2023 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2025 Create an arc of circle, passing through three given points.
2028 thePnt1 Start point of the arc.
2029 thePnt2 Middle point of the arc.
2030 thePnt3 End point of the arc.
2031 theName Object name; when specified, this parameter is used
2032 for result publication in the study. Otherwise, if automatic
2033 publication is switched on, default value is used for result name.
2036 New GEOM.GEOM_Object, containing the created arc.
2038 # Example: see GEOM_TestAll.py
2039 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2040 RaiseIfFailed("MakeArc", self.CurvesOp)
2041 self._autoPublish(anObj, theName, "arc")
2044 ## Create an arc of circle from a center and 2 points.
2045 # @param thePnt1 Center of the arc
2046 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2047 # @param thePnt3 End point of the arc (Gives also a direction)
2048 # @param theSense Orientation of the arc
2049 # @param theName Object name; when specified, this parameter is used
2050 # for result publication in the study. Otherwise, if automatic
2051 # publication is switched on, default value is used for result name.
2053 # @return New GEOM.GEOM_Object, containing the created arc.
2055 # @ref swig_MakeArc "Example"
2056 @ManageTransactions("CurvesOp")
2057 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2059 Create an arc of circle from a center and 2 points.
2062 thePnt1 Center of the arc
2063 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2064 thePnt3 End point of the arc (Gives also a direction)
2065 theSense Orientation of the arc
2066 theName Object name; when specified, this parameter is used
2067 for result publication in the study. Otherwise, if automatic
2068 publication is switched on, default value is used for result name.
2071 New GEOM.GEOM_Object, containing the created arc.
2073 # Example: see GEOM_TestAll.py
2074 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2075 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2076 self._autoPublish(anObj, theName, "arc")
2079 ## Create an arc of ellipse, of center and two points.
2080 # @param theCenter Center of the arc.
2081 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2082 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2083 # @param theName Object name; when specified, this parameter is used
2084 # for result publication in the study. Otherwise, if automatic
2085 # publication is switched on, default value is used for result name.
2087 # @return New GEOM.GEOM_Object, containing the created arc.
2089 # @ref swig_MakeArc "Example"
2090 @ManageTransactions("CurvesOp")
2091 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2093 Create an arc of ellipse, of center and two points.
2096 theCenter Center of the arc.
2097 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2098 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2099 theName Object name; when specified, this parameter is used
2100 for result publication in the study. Otherwise, if automatic
2101 publication is switched on, default value is used for result name.
2104 New GEOM.GEOM_Object, containing the created arc.
2106 # Example: see GEOM_TestAll.py
2107 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2108 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2109 self._autoPublish(anObj, theName, "arc")
2112 ## Create a circle with given center, normal vector and radius.
2113 # @param thePnt Circle center.
2114 # @param theVec Vector, normal to the plane of the circle.
2115 # @param theR Circle radius.
2116 # @param theName Object name; when specified, this parameter is used
2117 # for result publication in the study. Otherwise, if automatic
2118 # publication is switched on, default value is used for result name.
2120 # @return New GEOM.GEOM_Object, containing the created circle.
2122 # @ref tui_creation_circle "Example"
2123 @ManageTransactions("CurvesOp")
2124 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2126 Create a circle with given center, normal vector and radius.
2129 thePnt Circle center.
2130 theVec Vector, normal to the plane of the circle.
2132 theName Object name; when specified, this parameter is used
2133 for result publication in the study. Otherwise, if automatic
2134 publication is switched on, default value is used for result name.
2137 New GEOM.GEOM_Object, containing the created circle.
2139 # Example: see GEOM_TestAll.py
2140 theR, Parameters = ParseParameters(theR)
2141 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2142 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2143 anObj.SetParameters(Parameters)
2144 self._autoPublish(anObj, theName, "circle")
2147 ## Create a circle with given radius.
2148 # Center of the circle will be in the origin of global
2149 # coordinate system and normal vector will be codirected with Z axis
2150 # @param theR Circle radius.
2151 # @param theName Object name; when specified, this parameter is used
2152 # for result publication in the study. Otherwise, if automatic
2153 # publication is switched on, default value is used for result name.
2155 # @return New GEOM.GEOM_Object, containing the created circle.
2156 @ManageTransactions("CurvesOp")
2157 def MakeCircleR(self, theR, theName=None):
2159 Create a circle with given radius.
2160 Center of the circle will be in the origin of global
2161 coordinate system and normal vector will be codirected with Z axis
2165 theName Object name; when specified, this parameter is used
2166 for result publication in the study. Otherwise, if automatic
2167 publication is switched on, default value is used for result name.
2170 New GEOM.GEOM_Object, containing the created circle.
2172 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2173 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2174 self._autoPublish(anObj, theName, "circle")
2177 ## Create a circle, passing through three given points
2178 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2179 # @param theName Object name; when specified, this parameter is used
2180 # for result publication in the study. Otherwise, if automatic
2181 # publication is switched on, default value is used for result name.
2183 # @return New GEOM.GEOM_Object, containing the created circle.
2185 # @ref tui_creation_circle "Example"
2186 @ManageTransactions("CurvesOp")
2187 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2189 Create a circle, passing through three given points
2192 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2193 theName Object name; when specified, this parameter is used
2194 for result publication in the study. Otherwise, if automatic
2195 publication is switched on, default value is used for result name.
2198 New GEOM.GEOM_Object, containing the created circle.
2200 # Example: see GEOM_TestAll.py
2201 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2202 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2203 self._autoPublish(anObj, theName, "circle")
2206 ## Create a circle, with given point1 as center,
2207 # passing through the point2 as radius and laying in the plane,
2208 # defined by all three given points.
2209 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2210 # @param theName Object name; when specified, this parameter is used
2211 # for result publication in the study. Otherwise, if automatic
2212 # publication is switched on, default value is used for result name.
2214 # @return New GEOM.GEOM_Object, containing the created circle.
2216 # @ref swig_MakeCircle "Example"
2217 @ManageTransactions("CurvesOp")
2218 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2220 Create a circle, with given point1 as center,
2221 passing through the point2 as radius and laying in the plane,
2222 defined by all three given points.
2225 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2226 theName Object name; when specified, this parameter is used
2227 for result publication in the study. Otherwise, if automatic
2228 publication is switched on, default value is used for result name.
2231 New GEOM.GEOM_Object, containing the created circle.
2233 # Example: see GEOM_example6.py
2234 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2235 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2236 self._autoPublish(anObj, theName, "circle")
2239 ## Create an ellipse with given center, normal vector and radiuses.
2240 # @param thePnt Ellipse center.
2241 # @param theVec Vector, normal to the plane of the ellipse.
2242 # @param theRMajor Major ellipse radius.
2243 # @param theRMinor Minor ellipse radius.
2244 # @param theVecMaj Vector, direction of the ellipse's main axis.
2245 # @param theName Object name; when specified, this parameter is used
2246 # for result publication in the study. Otherwise, if automatic
2247 # publication is switched on, default value is used for result name.
2249 # @return New GEOM.GEOM_Object, containing the created ellipse.
2251 # @ref tui_creation_ellipse "Example"
2252 @ManageTransactions("CurvesOp")
2253 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2255 Create an ellipse with given center, normal vector and radiuses.
2258 thePnt Ellipse center.
2259 theVec Vector, normal to the plane of the ellipse.
2260 theRMajor Major ellipse radius.
2261 theRMinor Minor ellipse radius.
2262 theVecMaj Vector, direction of the ellipse's main axis.
2263 theName Object name; when specified, this parameter is used
2264 for result publication in the study. Otherwise, if automatic
2265 publication is switched on, default value is used for result name.
2268 New GEOM.GEOM_Object, containing the created ellipse.
2270 # Example: see GEOM_TestAll.py
2271 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2272 if theVecMaj is not None:
2273 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2275 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2277 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2278 anObj.SetParameters(Parameters)
2279 self._autoPublish(anObj, theName, "ellipse")
2282 ## Create an ellipse with given radiuses.
2283 # Center of the ellipse will be in the origin of global
2284 # coordinate system and normal vector will be codirected with Z axis
2285 # @param theRMajor Major ellipse radius.
2286 # @param theRMinor Minor ellipse radius.
2287 # @param theName Object name; when specified, this parameter is used
2288 # for result publication in the study. Otherwise, if automatic
2289 # publication is switched on, default value is used for result name.
2291 # @return New GEOM.GEOM_Object, containing the created ellipse.
2292 @ManageTransactions("CurvesOp")
2293 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2295 Create an ellipse with given radiuses.
2296 Center of the ellipse will be in the origin of global
2297 coordinate system and normal vector will be codirected with Z axis
2300 theRMajor Major ellipse radius.
2301 theRMinor Minor ellipse radius.
2302 theName Object name; when specified, this parameter is used
2303 for result publication in the study. Otherwise, if automatic
2304 publication is switched on, default value is used for result name.
2307 New GEOM.GEOM_Object, containing the created ellipse.
2309 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2310 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2311 self._autoPublish(anObj, theName, "ellipse")
2314 ## Create a polyline on the set of points.
2315 # @param thePoints Sequence of points for the polyline.
2316 # @param theIsClosed If True, build a closed wire.
2317 # @param theName Object name; when specified, this parameter is used
2318 # for result publication in the study. Otherwise, if automatic
2319 # publication is switched on, default value is used for result name.
2321 # @return New GEOM.GEOM_Object, containing the created polyline.
2323 # @ref tui_creation_curve "Example"
2324 @ManageTransactions("CurvesOp")
2325 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2327 Create a polyline on the set of points.
2330 thePoints Sequence of points for the polyline.
2331 theIsClosed If True, build a closed wire.
2332 theName Object name; when specified, this parameter is used
2333 for result publication in the study. Otherwise, if automatic
2334 publication is switched on, default value is used for result name.
2337 New GEOM.GEOM_Object, containing the created polyline.
2339 # Example: see GEOM_TestAll.py
2340 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2341 RaiseIfFailed("MakePolyline", self.CurvesOp)
2342 self._autoPublish(anObj, theName, "polyline")
2345 ## Create bezier curve on the set of points.
2346 # @param thePoints Sequence of points for the bezier curve.
2347 # @param theIsClosed If True, build a closed curve.
2348 # @param theName Object name; when specified, this parameter is used
2349 # for result publication in the study. Otherwise, if automatic
2350 # publication is switched on, default value is used for result name.
2352 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2354 # @ref tui_creation_curve "Example"
2355 @ManageTransactions("CurvesOp")
2356 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2358 Create bezier curve on the set of points.
2361 thePoints Sequence of points for the bezier curve.
2362 theIsClosed If True, build a closed curve.
2363 theName Object name; when specified, this parameter is used
2364 for result publication in the study. Otherwise, if automatic
2365 publication is switched on, default value is used for result name.
2368 New GEOM.GEOM_Object, containing the created bezier curve.
2370 # Example: see GEOM_TestAll.py
2371 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2372 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2373 self._autoPublish(anObj, theName, "bezier")
2376 ## Create B-Spline curve on the set of points.
2377 # @param thePoints Sequence of points for the B-Spline curve.
2378 # @param theIsClosed If True, build a closed curve.
2379 # @param theDoReordering If TRUE, the algo does not follow the order of
2380 # \a thePoints but searches for the closest vertex.
2381 # @param theName Object name; when specified, this parameter is used
2382 # for result publication in the study. Otherwise, if automatic
2383 # publication is switched on, default value is used for result name.
2385 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2387 # @ref tui_creation_curve "Example"
2388 @ManageTransactions("CurvesOp")
2389 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2391 Create B-Spline curve on the set of points.
2394 thePoints Sequence of points for the B-Spline curve.
2395 theIsClosed If True, build a closed curve.
2396 theDoReordering If True, the algo does not follow the order of
2397 thePoints but searches for the closest vertex.
2398 theName Object name; when specified, this parameter is used
2399 for result publication in the study. Otherwise, if automatic
2400 publication is switched on, default value is used for result name.
2403 New GEOM.GEOM_Object, containing the created B-Spline curve.
2405 # Example: see GEOM_TestAll.py
2406 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2407 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2408 self._autoPublish(anObj, theName, "bspline")
2411 ## Create B-Spline curve on the set of points.
2412 # @param thePoints Sequence of points for the B-Spline curve.
2413 # @param theFirstVec Vector object, defining the curve direction at its first point.
2414 # @param theLastVec Vector object, defining the curve direction at its last point.
2415 # @param theName Object name; when specified, this parameter is used
2416 # for result publication in the study. Otherwise, if automatic
2417 # publication is switched on, default value is used for result name.
2419 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2421 # @ref tui_creation_curve "Example"
2422 @ManageTransactions("CurvesOp")
2423 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2425 Create B-Spline curve on the set of points.
2428 thePoints Sequence of points for the B-Spline curve.
2429 theFirstVec Vector object, defining the curve direction at its first point.
2430 theLastVec Vector object, defining the curve direction at its last point.
2431 theName Object name; when specified, this parameter is used
2432 for result publication in the study. Otherwise, if automatic
2433 publication is switched on, default value is used for result name.
2436 New GEOM.GEOM_Object, containing the created B-Spline curve.
2438 # Example: see GEOM_TestAll.py
2439 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2440 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2441 self._autoPublish(anObj, theName, "bspline")
2444 ## Creates a curve using the parametric definition of the basic points.
2445 # @param thexExpr parametric equation of the coordinates X.
2446 # @param theyExpr parametric equation of the coordinates Y.
2447 # @param thezExpr parametric equation of the coordinates Z.
2448 # @param theParamMin the minimal value of the parameter.
2449 # @param theParamMax the maximum value of the parameter.
2450 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2451 # @param theCurveType the type of the curve,
2452 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2453 # @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.
2454 # @param theName Object name; when specified, this parameter is used
2455 # for result publication in the study. Otherwise, if automatic
2456 # publication is switched on, default value is used for result name.
2458 # @return New GEOM.GEOM_Object, containing the created curve.
2460 # @ref tui_creation_curve "Example"
2461 @ManageTransactions("CurvesOp")
2462 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2463 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2465 Creates a curve using the parametric definition of the basic points.
2468 thexExpr parametric equation of the coordinates X.
2469 theyExpr parametric equation of the coordinates Y.
2470 thezExpr parametric equation of the coordinates Z.
2471 theParamMin the minimal value of the parameter.
2472 theParamMax the maximum value of the parameter.
2473 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2474 theCurveType the type of the curve,
2475 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2476 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2477 method is used which can lead to a bug.
2478 theName Object name; when specified, this parameter is used
2479 for result publication in the study. Otherwise, if automatic
2480 publication is switched on, default value is used for result name.
2483 New GEOM.GEOM_Object, containing the created curve.
2485 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2487 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2489 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2490 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2491 anObj.SetParameters(Parameters)
2492 self._autoPublish(anObj, theName, "curve")
2495 ## Create an isoline curve on a face.
2496 # @param theFace the face for which an isoline is created.
2497 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2499 # @param theParameter the U parameter for U-isoline or V parameter
2501 # @param theName Object name; when specified, this parameter is used
2502 # for result publication in the study. Otherwise, if automatic
2503 # publication is switched on, default value is used for result name.
2505 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2506 # a compound of edges.
2508 # @ref tui_creation_curve "Example"
2509 @ManageTransactions("CurvesOp")
2510 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2512 Create an isoline curve on a face.
2515 theFace the face for which an isoline is created.
2516 IsUIsoline True for U-isoline creation; False for V-isoline
2518 theParameter the U parameter for U-isoline or V parameter
2520 theName Object name; when specified, this parameter is used
2521 for result publication in the study. Otherwise, if automatic
2522 publication is switched on, default value is used for result name.
2525 New GEOM.GEOM_Object, containing the created isoline edge or a
2528 # Example: see GEOM_TestAll.py
2529 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2530 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2532 self._autoPublish(anObj, theName, "U-Isoline")
2534 self._autoPublish(anObj, theName, "V-Isoline")
2540 ## @addtogroup l3_sketcher
2543 ## Create a sketcher (wire or face), following the textual description,
2544 # passed through <VAR>theCommand</VAR> argument. \n
2545 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2546 # Format of the description string have to be the following:
2548 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2551 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2553 # - "R angle" : Set the direction by angle
2554 # - "D dx dy" : Set the direction by DX & DY
2557 # - "TT x y" : Create segment by point at X & Y
2558 # - "T dx dy" : Create segment by point with DX & DY
2559 # - "L length" : Create segment by direction & Length
2560 # - "IX x" : Create segment by direction & Intersect. X
2561 # - "IY y" : Create segment by direction & Intersect. Y
2564 # - "C radius length" : Create arc by direction, radius and length(in degree)
2565 # - "AA x y": Create arc by point at X & Y
2566 # - "A dx dy" : Create arc by point with DX & DY
2567 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2568 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2569 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2570 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2573 # - "WW" : Close Wire (to finish)
2574 # - "WF" : Close Wire and build face (to finish)
2577 # - Flag1 (= reverse) is 0 or 2 ...
2578 # - if 0 the drawn arc is the one of lower angle (< Pi)
2579 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2582 # - Flag2 (= control tolerance) is 0 or 1 ...
2583 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2584 # - if 1 the wire is built only if the end point is on the arc
2585 # with a tolerance of 10^-7 on the distance else the creation fails
2587 # @param theCommand String, defining the sketcher in local
2588 # coordinates of the working plane.
2589 # @param theWorkingPlane Nine double values, defining origin,
2590 # OZ and OX directions of the working plane.
2591 # @param theName Object name; when specified, this parameter is used
2592 # for result publication in the study. Otherwise, if automatic
2593 # publication is switched on, default value is used for result name.
2595 # @return New GEOM.GEOM_Object, containing the created wire.
2597 # @ref tui_sketcher_page "Example"
2598 @ManageTransactions("CurvesOp")
2599 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2601 Create a sketcher (wire or face), following the textual description, passed
2602 through theCommand argument.
2603 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2604 Format of the description string have to be the following:
2605 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2607 - x1, y1 are coordinates of the first sketcher point (zero by default),
2609 - "R angle" : Set the direction by angle
2610 - "D dx dy" : Set the direction by DX & DY
2612 - "TT x y" : Create segment by point at X & Y
2613 - "T dx dy" : Create segment by point with DX & DY
2614 - "L length" : Create segment by direction & Length
2615 - "IX x" : Create segment by direction & Intersect. X
2616 - "IY y" : Create segment by direction & Intersect. Y
2618 - "C radius length" : Create arc by direction, radius and length(in degree)
2619 - "AA x y": Create arc by point at X & Y
2620 - "A dx dy" : Create arc by point with DX & DY
2621 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2622 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2623 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2624 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2626 - "WW" : Close Wire (to finish)
2627 - "WF" : Close Wire and build face (to finish)
2629 - Flag1 (= reverse) is 0 or 2 ...
2630 - if 0 the drawn arc is the one of lower angle (< Pi)
2631 - if 2 the drawn arc ius the one of greater angle (> Pi)
2633 - Flag2 (= control tolerance) is 0 or 1 ...
2634 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2635 - if 1 the wire is built only if the end point is on the arc
2636 with a tolerance of 10^-7 on the distance else the creation fails
2639 theCommand String, defining the sketcher in local
2640 coordinates of the working plane.
2641 theWorkingPlane Nine double values, defining origin,
2642 OZ and OX directions of the working plane.
2643 theName Object name; when specified, this parameter is used
2644 for result publication in the study. Otherwise, if automatic
2645 publication is switched on, default value is used for result name.
2648 New GEOM.GEOM_Object, containing the created wire.
2650 # Example: see GEOM_TestAll.py
2651 theCommand,Parameters = ParseSketcherCommand(theCommand)
2652 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2653 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2654 anObj.SetParameters(Parameters)
2655 self._autoPublish(anObj, theName, "wire")
2658 ## Create a sketcher (wire or face), following the textual description,
2659 # passed through <VAR>theCommand</VAR> argument. \n
2660 # For format of the description string see MakeSketcher() method.\n
2661 # @param theCommand String, defining the sketcher in local
2662 # coordinates of the working plane.
2663 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2664 # @param theName Object name; when specified, this parameter is used
2665 # for result publication in the study. Otherwise, if automatic
2666 # publication is switched on, default value is used for result name.
2668 # @return New GEOM.GEOM_Object, containing the created wire.
2670 # @ref tui_sketcher_page "Example"
2671 @ManageTransactions("CurvesOp")
2672 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2674 Create a sketcher (wire or face), following the textual description,
2675 passed through theCommand argument.
2676 For format of the description string see geompy.MakeSketcher() method.
2679 theCommand String, defining the sketcher in local
2680 coordinates of the working plane.
2681 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2682 theName Object name; when specified, this parameter is used
2683 for result publication in the study. Otherwise, if automatic
2684 publication is switched on, default value is used for result name.
2687 New GEOM.GEOM_Object, containing the created wire.
2689 theCommand,Parameters = ParseSketcherCommand(theCommand)
2690 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2691 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2692 anObj.SetParameters(Parameters)
2693 self._autoPublish(anObj, theName, "wire")
2696 ## Obtain a 2D sketcher interface
2697 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2698 def Sketcher2D (self):
2700 Obtain a 2D sketcher interface.
2703 sk = geompy.Sketcher2D()
2705 sk.addSegmentRelative(15, 70)
2706 sk.addSegmentPerpY(50)
2707 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2708 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2709 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2711 Sketch_1 = sk.wire(geomObj_1)
2713 sk = Sketcher2D (self)
2716 ## Create a sketcher wire, following the numerical description,
2717 # passed through <VAR>theCoordinates</VAR> argument. \n
2718 # @param theCoordinates double values, defining points to create a wire,
2720 # @param theName Object name; when specified, this parameter is used
2721 # for result publication in the study. Otherwise, if automatic
2722 # publication is switched on, default value is used for result name.
2724 # @return New GEOM.GEOM_Object, containing the created wire.
2726 # @ref tui_3dsketcher_page "Example"
2727 @ManageTransactions("CurvesOp")
2728 def Make3DSketcher(self, theCoordinates, theName=None):
2730 Create a sketcher wire, following the numerical description,
2731 passed through theCoordinates argument.
2734 theCoordinates double values, defining points to create a wire,
2736 theName Object name; when specified, this parameter is used
2737 for result publication in the study. Otherwise, if automatic
2738 publication is switched on, default value is used for result name.
2741 New GEOM_Object, containing the created wire.
2743 theCoordinates,Parameters = ParseParameters(theCoordinates)
2744 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2745 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2746 anObj.SetParameters(Parameters)
2747 self._autoPublish(anObj, theName, "wire")
2750 ## Obtain a 3D sketcher interface
2751 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2753 # @ref tui_3dsketcher_page "Example"
2754 def Sketcher3D (self):
2756 Obtain a 3D sketcher interface.
2759 sk = geompy.Sketcher3D()
2760 sk.addPointsAbsolute(0,0,0, 70,0,0)
2761 sk.addPointsRelative(0, 0, 130)
2762 sk.addPointAnglesLength("OXY", 50, 0, 100)
2763 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2765 a3D_Sketcher_1 = sk.wire()
2767 sk = Sketcher3D (self)
2770 ## Obtain a 2D polyline creation interface
2771 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2773 # @ref tui_3dsketcher_page "Example"
2774 def Polyline2D (self):
2776 Obtain a 2D polyline creation interface.
2779 pl = geompy.Polyline2D()
2780 pl.addSection("section 1", GEOM.Polyline, True)
2781 pl.addPoints(0, 0, 10, 0, 10, 10)
2782 pl.addSection("section 2", GEOM.Interpolation, False)
2783 pl.addPoints(20, 0, 30, 0, 30, 10)
2784 resultObj = pl.result(WorkingPlane)
2786 pl = Polyline2D (self)
2789 # end of l3_sketcher
2792 ## @addtogroup l3_3d_primitives
2795 ## Create a box by coordinates of two opposite vertices.
2797 # @param x1,y1,z1 double values, defining first point it.
2798 # @param x2,y2,z2 double values, defining first point it.
2799 # @param theName Object name; when specified, this parameter is used
2800 # for result publication in the study. Otherwise, if automatic
2801 # publication is switched on, default value is used for result name.
2803 # @return New GEOM.GEOM_Object, containing the created box.
2805 # @ref tui_creation_box "Example"
2806 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2808 Create a box by coordinates of two opposite vertices.
2811 x1,y1,z1 double values, defining first point.
2812 x2,y2,z2 double values, defining second point.
2813 theName Object name; when specified, this parameter is used
2814 for result publication in the study. Otherwise, if automatic
2815 publication is switched on, default value is used for result name.
2818 New GEOM.GEOM_Object, containing the created box.
2820 # Example: see GEOM_TestAll.py
2821 pnt1 = self.MakeVertex(x1,y1,z1)
2822 pnt2 = self.MakeVertex(x2,y2,z2)
2823 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2824 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2826 ## Create a box with specified dimensions along the coordinate axes
2827 # and with edges, parallel to the coordinate axes.
2828 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2829 # @param theDX Length of Box edges, parallel to OX axis.
2830 # @param theDY Length of Box edges, parallel to OY axis.
2831 # @param theDZ Length of Box edges, parallel to OZ axis.
2832 # @param theName Object name; when specified, this parameter is used
2833 # for result publication in the study. Otherwise, if automatic
2834 # publication is switched on, default value is used for result name.
2836 # @return New GEOM.GEOM_Object, containing the created box.
2838 # @ref tui_creation_box "Example"
2839 @ManageTransactions("PrimOp")
2840 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2842 Create a box with specified dimensions along the coordinate axes
2843 and with edges, parallel to the coordinate axes.
2844 Center of the box will be at point (DX/2, DY/2, DZ/2).
2847 theDX Length of Box edges, parallel to OX axis.
2848 theDY Length of Box edges, parallel to OY axis.
2849 theDZ Length of Box edges, parallel to OZ axis.
2850 theName Object name; when specified, this parameter is used
2851 for result publication in the study. Otherwise, if automatic
2852 publication is switched on, default value is used for result name.
2855 New GEOM.GEOM_Object, containing the created box.
2857 # Example: see GEOM_TestAll.py
2858 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2859 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2860 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2861 anObj.SetParameters(Parameters)
2862 self._autoPublish(anObj, theName, "box")
2865 ## Create a box with two specified opposite vertices,
2866 # and with edges, parallel to the coordinate axes
2867 # @param thePnt1 First of two opposite vertices.
2868 # @param thePnt2 Second of two opposite vertices.
2869 # @param theName Object name; when specified, this parameter is used
2870 # for result publication in the study. Otherwise, if automatic
2871 # publication is switched on, default value is used for result name.
2873 # @return New GEOM.GEOM_Object, containing the created box.
2875 # @ref tui_creation_box "Example"
2876 @ManageTransactions("PrimOp")
2877 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2879 Create a box with two specified opposite vertices,
2880 and with edges, parallel to the coordinate axes
2883 thePnt1 First of two opposite vertices.
2884 thePnt2 Second of two opposite vertices.
2885 theName Object name; when specified, this parameter is used
2886 for result publication in the study. Otherwise, if automatic
2887 publication is switched on, default value is used for result name.
2890 New GEOM.GEOM_Object, containing the created box.
2892 # Example: see GEOM_TestAll.py
2893 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2894 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2895 self._autoPublish(anObj, theName, "box")
2898 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2899 # @param theH height of Face.
2900 # @param theW width of Face.
2901 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2902 # @param theName Object name; when specified, this parameter is used
2903 # for result publication in the study. Otherwise, if automatic
2904 # publication is switched on, default value is used for result name.
2906 # @return New GEOM.GEOM_Object, containing the created face.
2908 # @ref tui_creation_face "Example"
2909 @ManageTransactions("PrimOp")
2910 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2912 Create a face with specified dimensions with edges parallel to coordinate axes.
2915 theH height of Face.
2917 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2918 theName Object name; when specified, this parameter is used
2919 for result publication in the study. Otherwise, if automatic
2920 publication is switched on, default value is used for result name.
2923 New GEOM.GEOM_Object, containing the created face.
2925 # Example: see GEOM_TestAll.py
2926 theH,theW,Parameters = ParseParameters(theH, theW)
2927 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2928 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2929 anObj.SetParameters(Parameters)
2930 self._autoPublish(anObj, theName, "rectangle")
2933 ## Create a face from another plane and two sizes,
2934 # vertical size and horisontal size.
2935 # @param theObj Normale vector to the creating face or
2937 # @param theH Height (vertical size).
2938 # @param theW Width (horisontal size).
2939 # @param theName Object name; when specified, this parameter is used
2940 # for result publication in the study. Otherwise, if automatic
2941 # publication is switched on, default value is used for result name.
2943 # @return New GEOM.GEOM_Object, containing the created face.
2945 # @ref tui_creation_face "Example"
2946 @ManageTransactions("PrimOp")
2947 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2949 Create a face from another plane and two sizes,
2950 vertical size and horisontal size.
2953 theObj Normale vector to the creating face or
2955 theH Height (vertical size).
2956 theW Width (horisontal size).
2957 theName Object name; when specified, this parameter is used
2958 for result publication in the study. Otherwise, if automatic
2959 publication is switched on, default value is used for result name.
2962 New GEOM_Object, containing the created face.
2964 # Example: see GEOM_TestAll.py
2965 theH,theW,Parameters = ParseParameters(theH, theW)
2966 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2967 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2968 anObj.SetParameters(Parameters)
2969 self._autoPublish(anObj, theName, "rectangle")
2972 ## Create a disk with given center, normal vector and radius.
2973 # @param thePnt Disk center.
2974 # @param theVec Vector, normal to the plane of the disk.
2975 # @param theR Disk radius.
2976 # @param theName Object name; when specified, this parameter is used
2977 # for result publication in the study. Otherwise, if automatic
2978 # publication is switched on, default value is used for result name.
2980 # @return New GEOM.GEOM_Object, containing the created disk.
2982 # @ref tui_creation_disk "Example"
2983 @ManageTransactions("PrimOp")
2984 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2986 Create a disk with given center, normal vector and radius.
2990 theVec Vector, normal to the plane of the disk.
2992 theName Object name; when specified, this parameter is used
2993 for result publication in the study. Otherwise, if automatic
2994 publication is switched on, default value is used for result name.
2997 New GEOM.GEOM_Object, containing the created disk.
2999 # Example: see GEOM_TestAll.py
3000 theR,Parameters = ParseParameters(theR)
3001 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
3002 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
3003 anObj.SetParameters(Parameters)
3004 self._autoPublish(anObj, theName, "disk")
3007 ## Create a disk, passing through three given points
3008 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3009 # @param theName Object name; when specified, this parameter is used
3010 # for result publication in the study. Otherwise, if automatic
3011 # publication is switched on, default value is used for result name.
3013 # @return New GEOM.GEOM_Object, containing the created disk.
3015 # @ref tui_creation_disk "Example"
3016 @ManageTransactions("PrimOp")
3017 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3019 Create a disk, passing through three given points
3022 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3023 theName Object name; when specified, this parameter is used
3024 for result publication in the study. Otherwise, if automatic
3025 publication is switched on, default value is used for result name.
3028 New GEOM.GEOM_Object, containing the created disk.
3030 # Example: see GEOM_TestAll.py
3031 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3032 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3033 self._autoPublish(anObj, theName, "disk")
3036 ## Create a disk with specified dimensions along OX-OY coordinate axes.
3037 # @param theR Radius of Face.
3038 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3039 # @param theName Object name; when specified, this parameter is used
3040 # for result publication in the study. Otherwise, if automatic
3041 # publication is switched on, default value is used for result name.
3043 # @return New GEOM.GEOM_Object, containing the created disk.
3045 # @ref tui_creation_face "Example"
3046 @ManageTransactions("PrimOp")
3047 def MakeDiskR(self, theR, theOrientation, theName=None):
3049 Create a disk with specified dimensions along OX-OY coordinate axes.
3052 theR Radius of Face.
3053 theOrientation set the orientation belong axis OXY or OYZ or OZX
3054 theName Object name; when specified, this parameter is used
3055 for result publication in the study. Otherwise, if automatic
3056 publication is switched on, default value is used for result name.
3059 New GEOM.GEOM_Object, containing the created disk.
3062 Disk3 = geompy.MakeDiskR(100., 1)
3064 # Example: see GEOM_TestAll.py
3065 theR,Parameters = ParseParameters(theR)
3066 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3067 RaiseIfFailed("MakeDiskR", self.PrimOp)
3068 anObj.SetParameters(Parameters)
3069 self._autoPublish(anObj, theName, "disk")
3072 ## Create a cylinder with given base point, axis, radius and height.
3073 # @param thePnt Central point of cylinder base.
3074 # @param theAxis Cylinder axis.
3075 # @param theR Cylinder radius.
3076 # @param theH Cylinder height.
3077 # @param theName Object name; when specified, this parameter is used
3078 # for result publication in the study. Otherwise, if automatic
3079 # publication is switched on, default value is used for result name.
3081 # @return New GEOM.GEOM_Object, containing the created cylinder.
3083 # @ref tui_creation_cylinder "Example"
3084 @ManageTransactions("PrimOp")
3085 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3087 Create a cylinder with given base point, axis, radius and height.
3090 thePnt Central point of cylinder base.
3091 theAxis Cylinder axis.
3092 theR Cylinder radius.
3093 theH Cylinder height.
3094 theName Object name; when specified, this parameter is used
3095 for result publication in the study. Otherwise, if automatic
3096 publication is switched on, default value is used for result name.
3099 New GEOM.GEOM_Object, containing the created cylinder.
3101 # Example: see GEOM_TestAll.py
3102 theR,theH,Parameters = ParseParameters(theR, theH)
3103 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3104 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3105 anObj.SetParameters(Parameters)
3106 self._autoPublish(anObj, theName, "cylinder")
3109 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3110 # @param thePnt Central point of cylinder base.
3111 # @param theAxis Cylinder axis.
3112 # @param theR Cylinder radius.
3113 # @param theH Cylinder height.
3114 # @param theA Cylinder angle in radians.
3115 # @param theName Object name; when specified, this parameter is used
3116 # for result publication in the study. Otherwise, if automatic
3117 # publication is switched on, default value is used for result name.
3119 # @return New GEOM.GEOM_Object, containing the created cylinder.
3121 # @ref tui_creation_cylinder "Example"
3122 @ManageTransactions("PrimOp")
3123 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3125 Create a portion of cylinder with given base point, axis, radius, height and angle.
3128 thePnt Central point of cylinder base.
3129 theAxis Cylinder axis.
3130 theR Cylinder radius.
3131 theH Cylinder height.
3132 theA Cylinder angle in radians.
3133 theName Object name; when specified, this parameter is used
3134 for result publication in the study. Otherwise, if automatic
3135 publication is switched on, default value is used for result name.
3138 New GEOM.GEOM_Object, containing the created cylinder.
3140 # Example: see GEOM_TestAll.py
3142 if isinstance(theA,str):
3144 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3146 theA = theA*math.pi/180.
3147 if theA<=0. or theA>=2*math.pi:
3148 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3149 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3150 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3151 anObj.SetParameters(Parameters)
3152 self._autoPublish(anObj, theName, "cylinder")
3155 ## Create a cylinder with given radius and height at
3156 # the origin of coordinate system. Axis of the cylinder
3157 # will be collinear to the OZ axis of the coordinate system.
3158 # @param theR Cylinder radius.
3159 # @param theH Cylinder height.
3160 # @param theName Object name; when specified, this parameter is used
3161 # for result publication in the study. Otherwise, if automatic
3162 # publication is switched on, default value is used for result name.
3164 # @return New GEOM.GEOM_Object, containing the created cylinder.
3166 # @ref tui_creation_cylinder "Example"
3167 @ManageTransactions("PrimOp")
3168 def MakeCylinderRH(self, theR, theH, theName=None):
3170 Create a cylinder with given radius and height at
3171 the origin of coordinate system. Axis of the cylinder
3172 will be collinear to the OZ axis of the coordinate system.
3175 theR Cylinder radius.
3176 theH Cylinder height.
3177 theName Object name; when specified, this parameter is used
3178 for result publication in the study. Otherwise, if automatic
3179 publication is switched on, default value is used for result name.
3182 New GEOM.GEOM_Object, containing the created cylinder.
3184 # Example: see GEOM_TestAll.py
3185 theR,theH,Parameters = ParseParameters(theR, theH)
3186 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3187 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3188 anObj.SetParameters(Parameters)
3189 self._autoPublish(anObj, theName, "cylinder")
3192 ## Create a portion of cylinder with given radius, height and angle at
3193 # the origin of coordinate system. Axis of the cylinder
3194 # will be collinear to the OZ axis of the coordinate system.
3195 # @param theR Cylinder radius.
3196 # @param theH Cylinder height.
3197 # @param theA Cylinder angle in radians.
3198 # @param theName Object name; when specified, this parameter is used
3199 # for result publication in the study. Otherwise, if automatic
3200 # publication is switched on, default value is used for result name.
3202 # @return New GEOM.GEOM_Object, containing the created cylinder.
3204 # @ref tui_creation_cylinder "Example"
3205 @ManageTransactions("PrimOp")
3206 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3208 Create a portion of cylinder with given radius, height and angle at
3209 the origin of coordinate system. Axis of the cylinder
3210 will be collinear to the OZ axis of the coordinate system.
3213 theR Cylinder radius.
3214 theH Cylinder height.
3215 theA Cylinder angle in radians.
3216 theName Object name; when specified, this parameter is used
3217 for result publication in the study. Otherwise, if automatic
3218 publication is switched on, default value is used for result name.
3221 New GEOM.GEOM_Object, containing the created cylinder.
3223 # Example: see GEOM_TestAll.py
3225 if isinstance(theA,str):
3227 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3229 theA = theA*math.pi/180.
3230 if theA<=0. or theA>=2*math.pi:
3231 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3232 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3233 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3234 anObj.SetParameters(Parameters)
3235 self._autoPublish(anObj, theName, "cylinder")
3238 ## Create a sphere with given center and radius.
3239 # @param thePnt Sphere center.
3240 # @param theR Sphere radius.
3241 # @param theName Object name; when specified, this parameter is used
3242 # for result publication in the study. Otherwise, if automatic
3243 # publication is switched on, default value is used for result name.
3245 # @return New GEOM.GEOM_Object, containing the created sphere.
3247 # @ref tui_creation_sphere "Example"
3248 @ManageTransactions("PrimOp")
3249 def MakeSpherePntR(self, thePnt, theR, theName=None):
3251 Create a sphere with given center and radius.
3254 thePnt Sphere center.
3256 theName Object name; when specified, this parameter is used
3257 for result publication in the study. Otherwise, if automatic
3258 publication is switched on, default value is used for result name.
3261 New GEOM.GEOM_Object, containing the created sphere.
3263 # Example: see GEOM_TestAll.py
3264 theR,Parameters = ParseParameters(theR)
3265 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3266 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3267 anObj.SetParameters(Parameters)
3268 self._autoPublish(anObj, theName, "sphere")
3271 ## Create a sphere with given center and radius.
3272 # @param x,y,z Coordinates of sphere center.
3273 # @param theR Sphere radius.
3274 # @param theName Object name; when specified, this parameter is used
3275 # for result publication in the study. Otherwise, if automatic
3276 # publication is switched on, default value is used for result name.
3278 # @return New GEOM.GEOM_Object, containing the created sphere.
3280 # @ref tui_creation_sphere "Example"
3281 def MakeSphere(self, x, y, z, theR, theName=None):
3283 Create a sphere with given center and radius.
3286 x,y,z Coordinates of sphere center.
3288 theName Object name; when specified, this parameter is used
3289 for result publication in the study. Otherwise, if automatic
3290 publication is switched on, default value is used for result name.
3293 New GEOM.GEOM_Object, containing the created sphere.
3295 # Example: see GEOM_TestAll.py
3296 point = self.MakeVertex(x, y, z)
3297 # note: auto-publishing is done in self.MakeSpherePntR()
3298 anObj = self.MakeSpherePntR(point, theR, theName)
3301 ## Create a sphere with given radius at the origin of coordinate system.
3302 # @param theR Sphere radius.
3303 # @param theName Object name; when specified, this parameter is used
3304 # for result publication in the study. Otherwise, if automatic
3305 # publication is switched on, default value is used for result name.
3307 # @return New GEOM.GEOM_Object, containing the created sphere.
3309 # @ref tui_creation_sphere "Example"
3310 @ManageTransactions("PrimOp")
3311 def MakeSphereR(self, theR, theName=None):
3313 Create a sphere with given radius at the origin of coordinate system.
3317 theName Object name; when specified, this parameter is used
3318 for result publication in the study. Otherwise, if automatic
3319 publication is switched on, default value is used for result name.
3322 New GEOM.GEOM_Object, containing the created sphere.
3324 # Example: see GEOM_TestAll.py
3325 theR,Parameters = ParseParameters(theR)
3326 anObj = self.PrimOp.MakeSphereR(theR)
3327 RaiseIfFailed("MakeSphereR", self.PrimOp)
3328 anObj.SetParameters(Parameters)
3329 self._autoPublish(anObj, theName, "sphere")
3332 ## Create a cone with given base point, axis, height and radiuses.
3333 # @param thePnt Central point of the first cone base.
3334 # @param theAxis Cone axis.
3335 # @param theR1 Radius of the first cone base.
3336 # @param theR2 Radius of the second cone base.
3337 # \note If both radiuses are non-zero, the cone will be truncated.
3338 # \note If the radiuses are equal, a cylinder will be created instead.
3339 # @param theH Cone height.
3340 # @param theName Object name; when specified, this parameter is used
3341 # for result publication in the study. Otherwise, if automatic
3342 # publication is switched on, default value is used for result name.
3344 # @return New GEOM.GEOM_Object, containing the created cone.
3346 # @ref tui_creation_cone "Example"
3347 @ManageTransactions("PrimOp")
3348 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3350 Create a cone with given base point, axis, height and radiuses.
3353 thePnt Central point of the first cone base.
3355 theR1 Radius of the first cone base.
3356 theR2 Radius of the second cone base.
3358 theName Object name; when specified, this parameter is used
3359 for result publication in the study. Otherwise, if automatic
3360 publication is switched on, default value is used for result name.
3363 If both radiuses are non-zero, the cone will be truncated.
3364 If the radiuses are equal, a cylinder will be created instead.
3367 New GEOM.GEOM_Object, containing the created cone.
3369 # Example: see GEOM_TestAll.py
3370 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3371 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3372 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3373 anObj.SetParameters(Parameters)
3374 self._autoPublish(anObj, theName, "cone")
3377 ## Create a cone with given height and radiuses at
3378 # the origin of coordinate system. Axis of the cone will
3379 # be collinear to the OZ axis of the coordinate system.
3380 # @param theR1 Radius of the first cone base.
3381 # @param theR2 Radius of the second cone base.
3382 # \note If both radiuses are non-zero, the cone will be truncated.
3383 # \note If the radiuses are equal, a cylinder will be created instead.
3384 # @param theH Cone height.
3385 # @param theName Object name; when specified, this parameter is used
3386 # for result publication in the study. Otherwise, if automatic
3387 # publication is switched on, default value is used for result name.
3389 # @return New GEOM.GEOM_Object, containing the created cone.
3391 # @ref tui_creation_cone "Example"
3392 @ManageTransactions("PrimOp")
3393 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3395 Create a cone with given height and radiuses at
3396 the origin of coordinate system. Axis of the cone will
3397 be collinear to the OZ axis of the coordinate system.
3400 theR1 Radius of the first cone base.
3401 theR2 Radius of the second cone base.
3403 theName Object name; when specified, this parameter is used
3404 for result publication in the study. Otherwise, if automatic
3405 publication is switched on, default value is used for result name.
3408 If both radiuses are non-zero, the cone will be truncated.
3409 If the radiuses are equal, a cylinder will be created instead.
3412 New GEOM.GEOM_Object, containing the created cone.
3414 # Example: see GEOM_TestAll.py
3415 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3416 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3417 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3418 anObj.SetParameters(Parameters)
3419 self._autoPublish(anObj, theName, "cone")
3422 ## Create a torus with given center, normal vector and radiuses.
3423 # @param thePnt Torus central point.
3424 # @param theVec Torus axis of symmetry.
3425 # @param theRMajor Torus major radius.
3426 # @param theRMinor Torus minor radius.
3427 # @param theName Object name; when specified, this parameter is used
3428 # for result publication in the study. Otherwise, if automatic
3429 # publication is switched on, default value is used for result name.
3431 # @return New GEOM.GEOM_Object, containing the created torus.
3433 # @ref tui_creation_torus "Example"
3434 @ManageTransactions("PrimOp")
3435 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3437 Create a torus with given center, normal vector and radiuses.
3440 thePnt Torus central point.
3441 theVec Torus axis of symmetry.
3442 theRMajor Torus major radius.
3443 theRMinor Torus minor radius.
3444 theName Object name; when specified, this parameter is used
3445 for result publication in the study. Otherwise, if automatic
3446 publication is switched on, default value is used for result name.
3449 New GEOM.GEOM_Object, containing the created torus.
3451 # Example: see GEOM_TestAll.py
3452 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3453 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3454 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3455 anObj.SetParameters(Parameters)
3456 self._autoPublish(anObj, theName, "torus")
3459 ## Create a torus with given radiuses at the origin of coordinate system.
3460 # @param theRMajor Torus major radius.
3461 # @param theRMinor Torus minor radius.
3462 # @param theName Object name; when specified, this parameter is used
3463 # for result publication in the study. Otherwise, if automatic
3464 # publication is switched on, default value is used for result name.
3466 # @return New GEOM.GEOM_Object, containing the created torus.
3468 # @ref tui_creation_torus "Example"
3469 @ManageTransactions("PrimOp")
3470 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3472 Create a torus with given radiuses at the origin of coordinate system.
3475 theRMajor Torus major radius.
3476 theRMinor Torus minor radius.
3477 theName Object name; when specified, this parameter is used
3478 for result publication in the study. Otherwise, if automatic
3479 publication is switched on, default value is used for result name.
3482 New GEOM.GEOM_Object, containing the created torus.
3484 # Example: see GEOM_TestAll.py
3485 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3486 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3487 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3488 anObj.SetParameters(Parameters)
3489 self._autoPublish(anObj, theName, "torus")
3492 # end of l3_3d_primitives
3495 ## @addtogroup l3_complex
3498 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3499 # @param theBase Base shape to be extruded.
3500 # @param thePoint1 First end of extrusion vector.
3501 # @param thePoint2 Second end of extrusion vector.
3502 # @param theScaleFactor Use it to make prism with scaled second base.
3503 # Nagative value means not scaled second base.
3504 # @param theName Object name; when specified, this parameter is used
3505 # for result publication in the study. Otherwise, if automatic
3506 # publication is switched on, default value is used for result name.
3508 # @return New GEOM.GEOM_Object, containing the created prism.
3510 # @ref tui_creation_prism "Example"
3511 @ManageTransactions("PrimOp")
3512 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3514 Create a shape by extrusion of the base shape along a vector, defined by two points.
3517 theBase Base shape to be extruded.
3518 thePoint1 First end of extrusion vector.
3519 thePoint2 Second end of extrusion vector.
3520 theScaleFactor Use it to make prism with scaled second base.
3521 Nagative value means not scaled second base.
3522 theName Object name; when specified, this parameter is used
3523 for result publication in the study. Otherwise, if automatic
3524 publication is switched on, default value is used for result name.
3527 New GEOM.GEOM_Object, containing the created prism.
3529 # Example: see GEOM_TestAll.py
3532 if theScaleFactor > 0:
3533 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3534 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3536 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3537 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3538 anObj.SetParameters(Parameters)
3539 self._autoPublish(anObj, theName, "prism")
3542 ## Create a shape by extrusion of the base shape along a
3543 # vector, defined by two points, in 2 Ways (forward/backward).
3544 # @param theBase Base shape to be extruded.
3545 # @param thePoint1 First end of extrusion vector.
3546 # @param thePoint2 Second end of extrusion vector.
3547 # @param theName Object name; when specified, this parameter is used
3548 # for result publication in the study. Otherwise, if automatic
3549 # publication is switched on, default value is used for result name.
3551 # @return New GEOM.GEOM_Object, containing the created prism.
3553 # @ref tui_creation_prism "Example"
3554 @ManageTransactions("PrimOp")
3555 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3557 Create a shape by extrusion of the base shape along a
3558 vector, defined by two points, in 2 Ways (forward/backward).
3561 theBase Base shape to be extruded.
3562 thePoint1 First end of extrusion vector.
3563 thePoint2 Second end of extrusion vector.
3564 theName Object name; when specified, this parameter is used
3565 for result publication in the study. Otherwise, if automatic
3566 publication is switched on, default value is used for result name.
3569 New GEOM.GEOM_Object, containing the created prism.
3571 # Example: see GEOM_TestAll.py
3572 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3573 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3574 self._autoPublish(anObj, theName, "prism")
3577 ## Create a shape by extrusion of the base shape along the vector,
3578 # i.e. all the space, transfixed by the base shape during its translation
3579 # along the vector on the given distance.
3580 # @param theBase Base shape to be extruded.
3581 # @param theVec Direction of extrusion.
3582 # @param theH Prism dimension along theVec.
3583 # @param theScaleFactor Use it to make prism with scaled second base.
3584 # Negative value means not scaled second base.
3585 # @param theName Object name; when specified, this parameter is used
3586 # for result publication in the study. Otherwise, if automatic
3587 # publication is switched on, default value is used for result name.
3589 # @return New GEOM.GEOM_Object, containing the created prism.
3591 # @ref tui_creation_prism "Example"
3592 @ManageTransactions("PrimOp")
3593 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3595 Create a shape by extrusion of the base shape along the vector,
3596 i.e. all the space, transfixed by the base shape during its translation
3597 along the vector on the given distance.
3600 theBase Base shape to be extruded.
3601 theVec Direction of extrusion.
3602 theH Prism dimension along theVec.
3603 theScaleFactor Use it to make prism with scaled second base.
3604 Negative value means not scaled second base.
3605 theName Object name; when specified, this parameter is used
3606 for result publication in the study. Otherwise, if automatic
3607 publication is switched on, default value is used for result name.
3610 New GEOM.GEOM_Object, containing the created prism.
3612 # Example: see GEOM_TestAll.py
3615 if theScaleFactor > 0:
3616 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3617 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3619 theH,Parameters = ParseParameters(theH)
3620 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3621 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3622 anObj.SetParameters(Parameters)
3623 self._autoPublish(anObj, theName, "prism")
3626 ## Create a shape by extrusion of the base shape along the vector,
3627 # i.e. all the space, transfixed by the base shape during its translation
3628 # along the vector on the given distance in 2 Ways (forward/backward).
3629 # @param theBase Base shape to be extruded.
3630 # @param theVec Direction of extrusion.
3631 # @param theH Prism dimension along theVec in forward direction.
3632 # @param theName Object name; when specified, this parameter is used
3633 # for result publication in the study. Otherwise, if automatic
3634 # publication is switched on, default value is used for result name.
3636 # @return New GEOM.GEOM_Object, containing the created prism.
3638 # @ref tui_creation_prism "Example"
3639 @ManageTransactions("PrimOp")
3640 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3642 Create a shape by extrusion of the base shape along the vector,
3643 i.e. all the space, transfixed by the base shape during its translation
3644 along the vector on the given distance in 2 Ways (forward/backward).
3647 theBase Base shape to be extruded.
3648 theVec Direction of extrusion.
3649 theH Prism dimension along theVec in forward direction.
3650 theName Object name; when specified, this parameter is used
3651 for result publication in the study. Otherwise, if automatic
3652 publication is switched on, default value is used for result name.
3655 New GEOM.GEOM_Object, containing the created prism.
3657 # Example: see GEOM_TestAll.py
3658 theH,Parameters = ParseParameters(theH)
3659 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3660 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3661 anObj.SetParameters(Parameters)
3662 self._autoPublish(anObj, theName, "prism")
3665 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3666 # @param theBase Base shape to be extruded.
3667 # @param theDX, theDY, theDZ Directions of extrusion.
3668 # @param theScaleFactor Use it to make prism with scaled second base.
3669 # Nagative value means not scaled second base.
3670 # @param theName Object name; when specified, this parameter is used
3671 # for result publication in the study. Otherwise, if automatic
3672 # publication is switched on, default value is used for result name.
3674 # @return New GEOM.GEOM_Object, containing the created prism.
3676 # @ref tui_creation_prism "Example"
3677 @ManageTransactions("PrimOp")
3678 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3680 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3683 theBase Base shape to be extruded.
3684 theDX, theDY, theDZ Directions of extrusion.
3685 theScaleFactor Use it to make prism with scaled second base.
3686 Nagative value means not scaled second base.
3687 theName Object name; when specified, this parameter is used
3688 for result publication in the study. Otherwise, if automatic
3689 publication is switched on, default value is used for result name.
3692 New GEOM.GEOM_Object, containing the created prism.
3694 # Example: see GEOM_TestAll.py
3697 if theScaleFactor > 0:
3698 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3699 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3701 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3702 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3703 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3704 anObj.SetParameters(Parameters)
3705 self._autoPublish(anObj, theName, "prism")
3708 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3709 # i.e. all the space, transfixed by the base shape during its translation
3710 # along the vector on the given distance in 2 Ways (forward/backward).
3711 # @param theBase Base shape to be extruded.
3712 # @param theDX, theDY, theDZ Directions of extrusion.
3713 # @param theName Object name; when specified, this parameter is used
3714 # for result publication in the study. Otherwise, if automatic
3715 # publication is switched on, default value is used for result name.
3717 # @return New GEOM.GEOM_Object, containing the created prism.
3719 # @ref tui_creation_prism "Example"
3720 @ManageTransactions("PrimOp")
3721 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3723 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3724 i.e. all the space, transfixed by the base shape during its translation
3725 along the vector on the given distance in 2 Ways (forward/backward).
3728 theBase Base shape to be extruded.
3729 theDX, theDY, theDZ Directions of extrusion.
3730 theName Object name; when specified, this parameter is used
3731 for result publication in the study. Otherwise, if automatic
3732 publication is switched on, default value is used for result name.
3735 New GEOM.GEOM_Object, containing the created prism.
3737 # Example: see GEOM_TestAll.py
3738 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3739 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3740 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3741 anObj.SetParameters(Parameters)
3742 self._autoPublish(anObj, theName, "prism")
3745 ## Create a shape by revolution of the base shape around the axis
3746 # on the given angle, i.e. all the space, transfixed by the base
3747 # shape during its rotation around the axis on the given angle.
3748 # @param theBase Base shape to be rotated.
3749 # @param theAxis Rotation axis.
3750 # @param theAngle Rotation angle in radians.
3751 # @param theName Object name; when specified, this parameter is used
3752 # for result publication in the study. Otherwise, if automatic
3753 # publication is switched on, default value is used for result name.
3755 # @return New GEOM.GEOM_Object, containing the created revolution.
3757 # @ref tui_creation_revolution "Example"
3758 @ManageTransactions("PrimOp")
3759 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3761 Create a shape by revolution of the base shape around the axis
3762 on the given angle, i.e. all the space, transfixed by the base
3763 shape during its rotation around the axis on the given angle.
3766 theBase Base shape to be rotated.
3767 theAxis Rotation axis.
3768 theAngle Rotation angle in radians.
3769 theName Object name; when specified, this parameter is used
3770 for result publication in the study. Otherwise, if automatic
3771 publication is switched on, default value is used for result name.
3774 New GEOM.GEOM_Object, containing the created revolution.
3776 # Example: see GEOM_TestAll.py
3777 theAngle,Parameters = ParseParameters(theAngle)
3778 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3779 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3780 anObj.SetParameters(Parameters)
3781 self._autoPublish(anObj, theName, "revolution")
3784 ## Create a shape by revolution of the base shape around the axis
3785 # on the given angle, i.e. all the space, transfixed by the base
3786 # shape during its rotation around the axis on the given angle in
3787 # both directions (forward/backward)
3788 # @param theBase Base shape to be rotated.
3789 # @param theAxis Rotation axis.
3790 # @param theAngle Rotation angle in radians.
3791 # @param theName Object name; when specified, this parameter is used
3792 # for result publication in the study. Otherwise, if automatic
3793 # publication is switched on, default value is used for result name.
3795 # @return New GEOM.GEOM_Object, containing the created revolution.
3797 # @ref tui_creation_revolution "Example"
3798 @ManageTransactions("PrimOp")
3799 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3801 Create a shape by revolution of the base shape around the axis
3802 on the given angle, i.e. all the space, transfixed by the base
3803 shape during its rotation around the axis on the given angle in
3804 both directions (forward/backward).
3807 theBase Base shape to be rotated.
3808 theAxis Rotation axis.
3809 theAngle Rotation angle in radians.
3810 theName Object name; when specified, this parameter is used
3811 for result publication in the study. Otherwise, if automatic
3812 publication is switched on, default value is used for result name.
3815 New GEOM.GEOM_Object, containing the created revolution.
3817 theAngle,Parameters = ParseParameters(theAngle)
3818 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3819 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3820 anObj.SetParameters(Parameters)
3821 self._autoPublish(anObj, theName, "revolution")
3824 ## Create a face from a given set of contours.
3825 # @param theContours either a list or a compound of edges/wires.
3826 # @param theMinDeg a minimal degree of BSpline surface to create.
3827 # @param theMaxDeg a maximal degree of BSpline surface to create.
3828 # @param theTol2D a 2d tolerance to be reached.
3829 # @param theTol3D a 3d tolerance to be reached.
3830 # @param theNbIter a number of iteration of approximation algorithm.
3831 # @param theMethod Kind of method to perform filling operation
3832 # (see GEOM.filling_oper_method enum).
3833 # @param isApprox if True, BSpline curves are generated in the process
3834 # of surface construction. By default it is False, that means
3835 # the surface is created using given curves. The usage of
3836 # Approximation makes the algorithm work slower, but allows
3837 # building the surface for rather complex cases.
3838 # @param theName Object name; when specified, this parameter is used
3839 # for result publication in the study. Otherwise, if automatic
3840 # publication is switched on, default value is used for result name.
3842 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3844 # @ref tui_creation_filling "Example"
3845 @ManageTransactions("PrimOp")
3846 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3847 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3849 Create a face from a given set of contours.
3852 theContours either a list or a compound of edges/wires.
3853 theMinDeg a minimal degree of BSpline surface to create.
3854 theMaxDeg a maximal degree of BSpline surface to create.
3855 theTol2D a 2d tolerance to be reached.
3856 theTol3D a 3d tolerance to be reached.
3857 theNbIter a number of iteration of approximation algorithm.
3858 theMethod Kind of method to perform filling operation
3859 (see GEOM.filling_oper_method enum).
3860 isApprox if True, BSpline curves are generated in the process
3861 of surface construction. By default it is False, that means
3862 the surface is created using given curves. The usage of
3863 Approximation makes the algorithm work slower, but allows
3864 building the surface for rather complex cases.
3865 theName Object name; when specified, this parameter is used
3866 for result publication in the study. Otherwise, if automatic
3867 publication is switched on, default value is used for result name.
3870 New GEOM.GEOM_Object (face), containing the created filling surface.
3873 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3875 # Example: see GEOM_TestAll.py
3876 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3877 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3878 theTol2D, theTol3D, theNbIter,
3879 theMethod, isApprox)
3880 RaiseIfFailed("MakeFilling", self.PrimOp)
3881 anObj.SetParameters(Parameters)
3882 self._autoPublish(anObj, theName, "filling")
3886 ## Create a face from a given set of contours.
3887 # This method corresponds to MakeFilling() with isApprox=True.
3888 # @param theContours either a list or a compound of edges/wires.
3889 # @param theMinDeg a minimal degree of BSpline surface to create.
3890 # @param theMaxDeg a maximal degree of BSpline surface to create.
3891 # @param theTol3D a 3d tolerance to be reached.
3892 # @param theName Object name; when specified, this parameter is used
3893 # for result publication in the study. Otherwise, if automatic
3894 # publication is switched on, default value is used for result name.
3896 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3898 # @ref tui_creation_filling "Example"
3899 @ManageTransactions("PrimOp")
3900 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3902 Create a filling from the given compound of contours.
3903 This method corresponds to MakeFilling() with isApprox=True.
3906 theContours either a list or a compound of edges/wires.
3907 theMinDeg a minimal degree of BSpline surface to create.
3908 theMaxDeg a maximal degree of BSpline surface to create.
3909 theTol3D a 3d tolerance to be reached.
3910 theName Object name; when specified, this parameter is used
3911 for result publication in the study. Otherwise, if automatic
3912 publication is switched on, default value is used for result name.
3915 New GEOM.GEOM_Object (face), containing the created filling surface.
3918 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3920 # Example: see GEOM_TestAll.py
3921 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3922 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3923 0, theTol3D, 0, GEOM.FOM_Default, True)
3924 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3925 anObj.SetParameters(Parameters)
3926 self._autoPublish(anObj, theName, "filling")
3929 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3930 # @param theSeqSections - set of specified sections.
3931 # @param theModeSolid - mode defining building solid or shell
3932 # @param thePreci - precision 3D used for smoothing
3933 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3934 # @param theName Object name; when specified, this parameter is used
3935 # for result publication in the study. Otherwise, if automatic
3936 # publication is switched on, default value is used for result name.
3938 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3940 # @ref swig_todo "Example"
3941 @ManageTransactions("PrimOp")
3942 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3944 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3947 theSeqSections - set of specified sections.
3948 theModeSolid - mode defining building solid or shell
3949 thePreci - precision 3D used for smoothing
3950 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3951 theName Object name; when specified, this parameter is used
3952 for result publication in the study. Otherwise, if automatic
3953 publication is switched on, default value is used for result name.
3956 New GEOM.GEOM_Object, containing the created shell or solid.
3958 # Example: see GEOM_TestAll.py
3959 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3960 RaiseIfFailed("MakeThruSections", self.PrimOp)
3961 self._autoPublish(anObj, theName, "filling")
3964 ## Create a shape by extrusion of the base shape along
3965 # the path shape. The path shape can be a wire or an edge. It is
3966 # possible to generate groups along with the result by means of
3967 # setting the flag \a IsGenerateGroups.<BR>
3968 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3969 # set, an error is occurred. If \a thePath is not closed edge/wire,
3970 # the following groups are returned:
3971 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3973 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3976 # "Down" and "Up" groups contain:
3977 # - Edges if \a theBase is edge or wire;
3978 # - Faces if \a theBase is face or shell.<BR>
3980 # "Side1" and "Side2" groups contain edges generated from the first
3981 # and last vertices of \a theBase. The first and last vertices are
3982 # determined taking into account edge/wire orientation.<BR>
3983 # "Other" group represents faces generated from the bounding edges of
3986 # @param theBase Base shape to be extruded.
3987 # @param thePath Path shape to extrude the base shape along it.
3988 # @param IsGenerateGroups flag that tells if it is necessary to
3989 # create groups. It is equal to False by default.
3990 # @param theName Object name; when specified, this parameter is used
3991 # for result publication in the study. Otherwise, if automatic
3992 # publication is switched on, default value is used for result name.
3994 # @return New GEOM.GEOM_Object, containing the created pipe if
3995 # \a IsGenerateGroups is not set. Otherwise it returns a
3996 # list of GEOM.GEOM_Object. Its first element is the created pipe, the
3997 # remaining ones are created groups.
3999 # @ref tui_creation_pipe "Example"
4000 @ManageTransactions("PrimOp")
4001 def MakePipe(self, theBase, thePath,
4002 IsGenerateGroups=False, theName=None):
4004 Create a shape by extrusion of the base shape along
4005 the path shape. The path shape can be a wire or an edge. It is
4006 possible to generate groups along with the result by means of
4007 setting the flag IsGenerateGroups.
4008 If thePath is a closed edge or wire and IsGenerateGroups is
4009 set, an error is occurred. If thePath is not closed edge/wire,
4010 the following groups are returned:
4011 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4013 - If theBase is closed edge or wire, face or shell: "Down", "Up",
4015 "Down" and "Up" groups contain:
4016 - Edges if theBase is edge or wire;
4017 - Faces if theBase is face or shell.
4018 "Side1" and "Side2" groups contain edges generated from the first
4019 and last vertices of theBase. The first and last vertices are
4020 determined taking into account edge/wire orientation.
4021 "Other" group represents faces generated from the bounding edges of
4025 theBase Base shape to be extruded.
4026 thePath Path shape to extrude the base shape along it.
4027 IsGenerateGroups flag that tells if it is necessary to
4028 create groups. It is equal to False by default.
4029 theName Object name; when specified, this parameter is used
4030 for result publication in the study. Otherwise, if automatic
4031 publication is switched on, default value is used for result name.
4034 New GEOM.GEOM_Object, containing the created pipe if
4035 IsGenerateGroups is not set. Otherwise it returns a
4036 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4037 remaining ones are created groups.
4039 # Example: see GEOM_TestAll.py
4040 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4041 RaiseIfFailed("MakePipe", self.PrimOp)
4043 if IsGenerateGroups:
4044 self._autoPublish(aList, theName, "pipe")
4047 self._autoPublish(aList[0], theName, "pipe")
4050 ## Create a shape by extrusion of the profile shape along
4051 # the path shape. The path shape can be a wire or an edge.
4052 # the several profiles can be specified in the several locations of path.
4053 # It is possible to generate groups along with the result by means of
4054 # setting the flag \a IsGenerateGroups. For detailed information on
4055 # groups that can be created please see the method MakePipe().
4056 # @param theSeqBases - list of Bases shape to be extruded.
4057 # @param theLocations - list of locations on the path corresponding
4058 # specified list of the Bases shapes. Number of locations
4059 # should be equal to number of bases or list of locations can be empty.
4060 # @param thePath - Path shape to extrude the base shape along it.
4061 # @param theWithContact - the mode defining that the section is translated to be in
4062 # contact with the spine.
4063 # @param theWithCorrection - defining that the section is rotated to be
4064 # orthogonal to the spine tangent in the correspondent point
4065 # @param IsGenerateGroups - flag that tells if it is necessary to
4066 # create groups. It is equal to False by default.
4067 # @param theName Object name; when specified, this parameter is used
4068 # for result publication in the study. Otherwise, if automatic
4069 # publication is switched on, default value is used for result name.
4071 # @return New GEOM.GEOM_Object, containing the created pipe if
4072 # \a IsGenerateGroups is not set. Otherwise it returns new
4073 # GEOM.ListOfGO. Its first element is the created pipe, the
4074 # remaining ones are created groups.
4076 # @ref tui_creation_pipe_with_diff_sec "Example"
4077 @ManageTransactions("PrimOp")
4078 def MakePipeWithDifferentSections(self, theSeqBases,
4079 theLocations, thePath,
4080 theWithContact, theWithCorrection,
4081 IsGenerateGroups=False, theName=None):
4083 Create a shape by extrusion of the profile shape along
4084 the path shape. The path shape can be a wire or an edge.
4085 the several profiles can be specified in the several locations of path.
4086 It is possible to generate groups along with the result by means of
4087 setting the flag IsGenerateGroups. For detailed information on
4088 groups that can be created please see the method geompy.MakePipe().
4091 theSeqBases - list of Bases shape to be extruded.
4092 theLocations - list of locations on the path corresponding
4093 specified list of the Bases shapes. Number of locations
4094 should be equal to number of bases or list of locations can be empty.
4095 thePath - Path shape to extrude the base shape along it.
4096 theWithContact - the mode defining that the section is translated to be in
4097 contact with the spine(0/1)
4098 theWithCorrection - defining that the section is rotated to be
4099 orthogonal to the spine tangent in the correspondent point (0/1)
4100 IsGenerateGroups - flag that tells if it is necessary to
4101 create groups. It is equal to False by default.
4102 theName Object name; when specified, this parameter is used
4103 for result publication in the study. Otherwise, if automatic
4104 publication is switched on, default value is used for result name.
4107 New GEOM.GEOM_Object, containing the created pipe if
4108 IsGenerateGroups is not set. Otherwise it returns new
4109 GEOM.ListOfGO. Its first element is the created pipe, the
4110 remaining ones are created groups.
4112 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4113 theLocations, thePath,
4114 theWithContact, theWithCorrection,
4115 False, IsGenerateGroups)
4116 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4118 if IsGenerateGroups:
4119 self._autoPublish(aList, theName, "pipe")
4122 self._autoPublish(aList[0], theName, "pipe")
4125 ## Create a shape by extrusion of the profile shape along
4126 # the path shape. This function is a version of
4127 # MakePipeWithDifferentSections() with the same parameters, except
4128 # eliminated theWithContact and theWithCorrection. So it is
4129 # possible to find the description of all parameters is in this
4130 # method. The difference is that this method performs the operation
4131 # step by step, i.e. it creates pipes between each pair of neighbor
4132 # sections and fuses them into a single shape.
4134 # @ref tui_creation_pipe_with_diff_sec "Example"
4135 @ManageTransactions("PrimOp")
4136 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4137 theLocations, thePath,
4138 IsGenerateGroups=False, theName=None):
4140 Create a shape by extrusion of the profile shape along
4141 the path shape. This function is a version of
4142 MakePipeWithDifferentSections() with the same parameters, except
4143 eliminated theWithContact and theWithCorrection. So it is
4144 possible to find the description of all parameters is in this
4145 method. The difference is that this method performs the operation
4146 step by step, i.e. it creates pipes between each pair of neighbor
4147 sections and fuses them into a single shape.
4149 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4150 theLocations, thePath,
4152 True, IsGenerateGroups)
4153 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4155 if IsGenerateGroups:
4156 self._autoPublish(aList, theName, "pipe")
4159 self._autoPublish(aList[0], theName, "pipe")
4162 ## Create a shape by extrusion of the profile shape along
4163 # the path shape. The path shape can be a wire or an edge.
4164 # the several profiles can be specified in the several locations of path.
4165 # It is possible to generate groups along with the result by means of
4166 # setting the flag \a IsGenerateGroups. For detailed information on
4167 # groups that can be created please see the method MakePipe().
4168 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4169 # shell or face. If number of faces in neighbour sections
4170 # aren't coincided result solid between such sections will
4171 # be created using external boundaries of this shells.
4172 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4173 # This list is used for searching correspondences between
4174 # faces in the sections. Size of this list must be equal
4175 # to size of list of base shapes.
4176 # @param theLocations - list of locations on the path corresponding
4177 # specified list of the Bases shapes. Number of locations
4178 # should be equal to number of bases. First and last
4179 # locations must be coincided with first and last vertexes
4180 # of path correspondingly.
4181 # @param thePath - Path shape to extrude the base shape along it.
4182 # @param theWithContact - the mode defining that the section is translated to be in
4183 # contact with the spine.
4184 # @param theWithCorrection - defining that the section is rotated to be
4185 # orthogonal to the spine tangent in the correspondent point
4186 # @param IsGenerateGroups - flag that tells if it is necessary to
4187 # create groups. It is equal to False by default.
4188 # @param theName Object name; when specified, this parameter is used
4189 # for result publication in the study. Otherwise, if automatic
4190 # publication is switched on, default value is used for result name.
4192 # @return New GEOM.GEOM_Object, containing the created solids if
4193 # \a IsGenerateGroups is not set. Otherwise it returns new
4194 # GEOM.ListOfGO. Its first element is the created solids, the
4195 # remaining ones are created groups.
4197 # @ref tui_creation_pipe_with_shell_sec "Example"
4198 @ManageTransactions("PrimOp")
4199 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4200 theLocations, thePath,
4201 theWithContact, theWithCorrection,
4202 IsGenerateGroups=False, theName=None):
4204 Create a shape by extrusion of the profile shape along
4205 the path shape. The path shape can be a wire or an edge.
4206 the several profiles can be specified in the several locations of path.
4207 It is possible to generate groups along with the result by means of
4208 setting the flag IsGenerateGroups. For detailed information on
4209 groups that can be created please see the method geompy.MakePipe().
4212 theSeqBases - list of Bases shape to be extruded. Base shape must be
4213 shell or face. If number of faces in neighbour sections
4214 aren't coincided result solid between such sections will
4215 be created using external boundaries of this shells.
4216 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4217 This list is used for searching correspondences between
4218 faces in the sections. Size of this list must be equal
4219 to size of list of base shapes.
4220 theLocations - list of locations on the path corresponding
4221 specified list of the Bases shapes. Number of locations
4222 should be equal to number of bases. First and last
4223 locations must be coincided with first and last vertexes
4224 of path correspondingly.
4225 thePath - Path shape to extrude the base shape along it.
4226 theWithContact - the mode defining that the section is translated to be in
4227 contact with the spine (0/1)
4228 theWithCorrection - defining that the section is rotated to be
4229 orthogonal to the spine tangent in the correspondent point (0/1)
4230 IsGenerateGroups - flag that tells if it is necessary to
4231 create groups. It is equal to False by default.
4232 theName Object name; when specified, this parameter is used
4233 for result publication in the study. Otherwise, if automatic
4234 publication is switched on, default value is used for result name.
4237 New GEOM.GEOM_Object, containing the created solids if
4238 IsGenerateGroups is not set. Otherwise it returns new
4239 GEOM.ListOfGO. Its first element is the created solids, the
4240 remaining ones are created groups.
4242 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4243 theLocations, thePath,
4244 theWithContact, theWithCorrection,
4246 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4248 if IsGenerateGroups:
4249 self._autoPublish(aList, theName, "pipe")
4252 self._autoPublish(aList[0], theName, "pipe")
4255 ## Create a shape by extrusion of the profile shape along
4256 # the path shape. This function is used only for debug pipe
4257 # functionality - it is a version of function MakePipeWithShellSections()
4258 # which give a possibility to receive information about
4259 # creating pipe between each pair of sections step by step.
4260 @ManageTransactions("PrimOp")
4261 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4262 theLocations, thePath,
4263 theWithContact, theWithCorrection,
4264 IsGenerateGroups=False, theName=None):
4266 Create a shape by extrusion of the profile shape along
4267 the path shape. This function is used only for debug pipe
4268 functionality - it is a version of previous function
4269 geompy.MakePipeWithShellSections() which give a possibility to
4270 receive information about creating pipe between each pair of
4271 sections step by step.
4274 nbsect = len(theSeqBases)
4275 nbsubsect = len(theSeqSubBases)
4276 #print "nbsect = ",nbsect
4277 for i in range(1,nbsect):
4279 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4280 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4282 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4283 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4284 tmpLocations, thePath,
4285 theWithContact, theWithCorrection,
4287 if self.PrimOp.IsDone() == 0:
4288 print("Problems with pipe creation between ",i," and ",i+1," sections")
4289 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4292 print("Pipe between ",i," and ",i+1," sections is OK")
4293 res.append(aList[0])
4297 resc = self.MakeCompound(res)
4298 #resc = self.MakeSewing(res, 0.001)
4299 #print "resc: ",resc
4300 self._autoPublish(resc, theName, "pipe")
4303 ## Create solids between given sections.
4304 # It is possible to generate groups along with the result by means of
4305 # setting the flag \a IsGenerateGroups. For detailed information on
4306 # groups that can be created please see the method MakePipe().
4307 # @param theSeqBases - list of sections (shell or face).
4308 # @param theLocations - list of corresponding vertexes
4309 # @param IsGenerateGroups - flag that tells if it is necessary to
4310 # create groups. It is equal to False by default.
4311 # @param theName Object name; when specified, this parameter is used
4312 # for result publication in the study. Otherwise, if automatic
4313 # publication is switched on, default value is used for result name.
4315 # @return New GEOM.GEOM_Object, containing the created solids if
4316 # \a IsGenerateGroups is not set. Otherwise it returns new
4317 # GEOM.ListOfGO. Its first element is the created solids, the
4318 # remaining ones are created groups.
4320 # @ref tui_creation_pipe_without_path "Example"
4321 @ManageTransactions("PrimOp")
4322 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4323 IsGenerateGroups=False, theName=None):
4325 Create solids between given sections.
4326 It is possible to generate groups along with the result by means of
4327 setting the flag IsGenerateGroups. For detailed information on
4328 groups that can be created please see the method geompy.MakePipe().
4331 theSeqBases - list of sections (shell or face).
4332 theLocations - list of corresponding vertexes
4333 IsGenerateGroups - flag that tells if it is necessary to
4334 create groups. It is equal to False by default.
4335 theName Object name; when specified, this parameter is used
4336 for result publication in the study. Otherwise, if automatic
4337 publication is switched on, default value is used for result name.
4340 New GEOM.GEOM_Object, containing the created solids if
4341 IsGenerateGroups is not set. Otherwise it returns new
4342 GEOM.ListOfGO. Its first element is the created solids, the
4343 remaining ones are created groups.
4345 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4347 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4349 if IsGenerateGroups:
4350 self._autoPublish(aList, theName, "pipe")
4353 self._autoPublish(aList[0], theName, "pipe")
4356 ## Create a shape by extrusion of the base shape along
4357 # the path shape with constant bi-normal direction along the given vector.
4358 # The path shape can be a wire or an edge.
4359 # It is possible to generate groups along with the result by means of
4360 # setting the flag \a IsGenerateGroups. For detailed information on
4361 # groups that can be created please see the method MakePipe().
4362 # @param theBase Base shape to be extruded.
4363 # @param thePath Path shape to extrude the base shape along it.
4364 # @param theVec Vector defines a constant binormal direction to keep the
4365 # same angle between the direction and the sections
4366 # along the sweep surface.
4367 # @param IsGenerateGroups flag that tells if it is necessary to
4368 # create groups. It is equal to False by default.
4369 # @param theName Object name; when specified, this parameter is used
4370 # for result publication in the study. Otherwise, if automatic
4371 # publication is switched on, default value is used for result name.
4373 # @return New GEOM.GEOM_Object, containing the created pipe if
4374 # \a IsGenerateGroups is not set. Otherwise it returns new
4375 # GEOM.ListOfGO. Its first element is the created pipe, the
4376 # remaining ones are created groups.
4378 # @ref tui_creation_pipe "Example"
4379 @ManageTransactions("PrimOp")
4380 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4381 IsGenerateGroups=False, theName=None):
4383 Create a shape by extrusion of the base shape along
4384 the path shape with constant bi-normal direction along the given vector.
4385 The path shape can be a wire or an edge.
4386 It is possible to generate groups along with the result by means of
4387 setting the flag IsGenerateGroups. For detailed information on
4388 groups that can be created please see the method geompy.MakePipe().
4391 theBase Base shape to be extruded.
4392 thePath Path shape to extrude the base shape along it.
4393 theVec Vector defines a constant binormal direction to keep the
4394 same angle between the direction and the sections
4395 along the sweep surface.
4396 IsGenerateGroups flag that tells if it is necessary to
4397 create groups. It is equal to False by default.
4398 theName Object name; when specified, this parameter is used
4399 for result publication in the study. Otherwise, if automatic
4400 publication is switched on, default value is used for result name.
4403 New GEOM.GEOM_Object, containing the created pipe if
4404 IsGenerateGroups is not set. Otherwise it returns new
4405 GEOM.ListOfGO. Its first element is the created pipe, the
4406 remaining ones are created groups.
4408 # Example: see GEOM_TestAll.py
4409 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4410 theVec, IsGenerateGroups)
4411 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4413 if IsGenerateGroups:
4414 self._autoPublish(aList, theName, "pipe")
4417 self._autoPublish(aList[0], theName, "pipe")
4420 ## Makes a thick solid from a shape. If the input is a surface shape
4421 # (face or shell) the result is a thick solid. If an input shape is
4422 # a solid the result is a hollowed solid with removed faces.
4423 # @param theShape Face or Shell to get thick solid or solid to get
4425 # @param theThickness Thickness of the resulting solid
4426 # @param theFacesIDs the list of face IDs to be removed from the
4427 # result. It is ignored if \a theShape is a face or a shell.
4428 # It is empty by default.
4429 # @param theInside If true the thickness is applied towards inside
4430 # @param theName Object name; when specified, this parameter is used
4431 # for result publication in the study. Otherwise, if automatic
4432 # publication is switched on, default value is used for result name.
4434 # @return New GEOM.GEOM_Object, containing the created solid
4436 # @ref tui_creation_thickness "Example"
4437 @ManageTransactions("PrimOp")
4438 def MakeThickSolid(self, theShape, theThickness,
4439 theFacesIDs=[], theInside=False, theName=None):
4441 Make a thick solid from a shape. If the input is a surface shape
4442 (face or shell) the result is a thick solid. If an input shape is
4443 a solid the result is a hollowed solid with removed faces.
4446 theShape Face or Shell to get thick solid or solid to get
4448 theThickness Thickness of the resulting solid
4449 theFacesIDs the list of face IDs to be removed from the
4450 result. It is ignored if theShape is a face or a
4451 shell. It is empty by default.
4452 theInside If true the thickness is applied towards inside
4453 theName Object name; when specified, this parameter is used
4454 for result publication in the study. Otherwise, if automatic
4455 publication is switched on, default value is used for result name.
4458 New GEOM.GEOM_Object, containing the created solid
4460 # Example: see GEOM_TestAll.py
4461 theThickness,Parameters = ParseParameters(theThickness)
4462 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4463 theThickness, True, theInside)
4464 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4465 anObj.SetParameters(Parameters)
4466 self._autoPublish(anObj, theName, "thickSolid")
4470 ## Modifies a shape to make it a thick solid. If the input is a surface
4471 # shape (face or shell) the result is a thick solid. If an input shape
4472 # is a solid the result is a hollowed solid with removed faces.
4473 # @param theShape Face or Shell to get thick solid or solid to get
4475 # @param theThickness Thickness of the resulting solid
4476 # @param theFacesIDs the list of face IDs to be removed from the
4477 # result. It is ignored if \a theShape is a face or a shell.
4478 # It is empty by default.
4479 # @param theInside If true the thickness is applied towards inside
4481 # @return The modified shape
4483 # @ref tui_creation_thickness "Example"
4484 @ManageTransactions("PrimOp")
4485 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4487 Modifies a shape to make it a thick solid. If the input is a
4488 surface shape (face or shell) the result is a thick solid. If
4489 an input shape is a solid the result is a hollowed solid with
4493 theShape Face or Shell to get thick solid or solid to get
4495 theThickness Thickness of the resulting solid
4496 theFacesIDs the list of face IDs to be removed from the
4497 result. It is ignored if \a theShape is a face or
4498 a shell. It is empty by default.
4499 theInside If true the thickness is applied towards inside
4504 # Example: see GEOM_TestAll.py
4505 theThickness,Parameters = ParseParameters(theThickness)
4506 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4507 theThickness, False, theInside)
4508 RaiseIfFailed("Thicken", self.PrimOp)
4509 anObj.SetParameters(Parameters)
4512 ## Build a middle path of a pipe-like shape.
4513 # The path shape can be a wire or an edge.
4514 # @param theShape It can be closed or unclosed pipe-like shell
4515 # or a pipe-like solid.
4516 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4517 # should be wires or faces of theShape.
4518 # @param theName Object name; when specified, this parameter is used
4519 # for result publication in the study. Otherwise, if automatic
4520 # publication is switched on, default value is used for result name.
4522 # @note It is not assumed that exact or approximate copy of theShape
4523 # can be obtained by applying existing Pipe operation on the
4524 # resulting "Path" wire taking theBase1 as the base - it is not
4525 # always possible; though in some particular cases it might work
4526 # it is not guaranteed. Thus, RestorePath function should not be
4527 # considered as an exact reverse operation of the Pipe.
4529 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4530 # source pipe's "path".
4532 # @ref tui_creation_pipe_path "Example"
4533 @ManageTransactions("PrimOp")
4534 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4536 Build a middle path of a pipe-like shape.
4537 The path shape can be a wire or an edge.
4540 theShape It can be closed or unclosed pipe-like shell
4541 or a pipe-like solid.
4542 theBase1, theBase2 Two bases of the supposed pipe. This
4543 should be wires or faces of theShape.
4544 theName Object name; when specified, this parameter is used
4545 for result publication in the study. Otherwise, if automatic
4546 publication is switched on, default value is used for result name.
4549 New GEOM_Object, containing an edge or wire that represent
4552 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4553 RaiseIfFailed("RestorePath", self.PrimOp)
4554 self._autoPublish(anObj, theName, "path")
4557 ## Build a middle path of a pipe-like shape.
4558 # The path shape can be a wire or an edge.
4559 # @param theShape It can be closed or unclosed pipe-like shell
4560 # or a pipe-like solid.
4561 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4562 # should be lists of edges of theShape.
4563 # @param theName Object name; when specified, this parameter is used
4564 # for result publication in the study. Otherwise, if automatic
4565 # publication is switched on, default value is used for result name.
4567 # @note It is not assumed that exact or approximate copy of theShape
4568 # can be obtained by applying existing Pipe operation on the
4569 # resulting "Path" wire taking theBase1 as the base - it is not
4570 # always possible; though in some particular cases it might work
4571 # it is not guaranteed. Thus, RestorePath function should not be
4572 # considered as an exact reverse operation of the Pipe.
4574 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4575 # source pipe's "path".
4577 # @ref tui_creation_pipe_path "Example"
4578 @ManageTransactions("PrimOp")
4579 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4581 Build a middle path of a pipe-like shape.
4582 The path shape can be a wire or an edge.
4585 theShape It can be closed or unclosed pipe-like shell
4586 or a pipe-like solid.
4587 listEdges1, listEdges2 Two bases of the supposed pipe. This
4588 should be lists of edges of theShape.
4589 theName Object name; when specified, this parameter is used
4590 for result publication in the study. Otherwise, if automatic
4591 publication is switched on, default value is used for result name.
4594 New GEOM_Object, containing an edge or wire that represent
4597 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4598 RaiseIfFailed("RestorePath", self.PrimOp)
4599 self._autoPublish(anObj, theName, "path")
4605 ## @addtogroup l3_basic_go
4608 ## Create a linear edge with specified ends.
4609 # @param thePnt1 Point for the first end of edge.
4610 # @param thePnt2 Point for the second end of edge.
4611 # @param theName Object name; when specified, this parameter is used
4612 # for result publication in the study. Otherwise, if automatic
4613 # publication is switched on, default value is used for result name.
4615 # @return New GEOM.GEOM_Object, containing the created edge.
4617 # @ref tui_creation_edge "Example"
4618 @ManageTransactions("ShapesOp")
4619 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4621 Create a linear edge with specified ends.
4624 thePnt1 Point for the first end of edge.
4625 thePnt2 Point for the second end of edge.
4626 theName Object name; when specified, this parameter is used
4627 for result publication in the study. Otherwise, if automatic
4628 publication is switched on, default value is used for result name.
4631 New GEOM.GEOM_Object, containing the created edge.
4633 # Example: see GEOM_TestAll.py
4634 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4635 RaiseIfFailed("MakeEdge", self.ShapesOp)
4636 self._autoPublish(anObj, theName, "edge")
4639 ## Create a new edge, corresponding to the given length on the given curve.
4640 # @param theRefCurve The referenced curve (edge).
4641 # @param theLength Length on the referenced curve. It can be negative.
4642 # @param theStartPoint Any point can be selected for it, the new edge will begin
4643 # at the end of \a theRefCurve, close to the selected point.
4644 # If None, start from the first point of \a theRefCurve.
4645 # @param theName Object name; when specified, this parameter is used
4646 # for result publication in the study. Otherwise, if automatic
4647 # publication is switched on, default value is used for result name.
4649 # @return New GEOM.GEOM_Object, containing the created edge.
4651 # @ref tui_creation_edge "Example"
4652 @ManageTransactions("ShapesOp")
4653 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4655 Create a new edge, corresponding to the given length on the given curve.
4658 theRefCurve The referenced curve (edge).
4659 theLength Length on the referenced curve. It can be negative.
4660 theStartPoint Any point can be selected for it, the new edge will begin
4661 at the end of theRefCurve, close to the selected point.
4662 If None, start from the first point of theRefCurve.
4663 theName Object name; when specified, this parameter is used
4664 for result publication in the study. Otherwise, if automatic
4665 publication is switched on, default value is used for result name.
4668 New GEOM.GEOM_Object, containing the created edge.
4670 # Example: see GEOM_TestAll.py
4671 theLength, Parameters = ParseParameters(theLength)
4672 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4673 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4674 anObj.SetParameters(Parameters)
4675 self._autoPublish(anObj, theName, "edge")
4678 ## Create an edge from specified wire.
4679 # @param theWire source Wire
4680 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4681 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4682 # @param theName Object name; when specified, this parameter is used
4683 # for result publication in the study. Otherwise, if automatic
4684 # publication is switched on, default value is used for result name.
4686 # @return New GEOM.GEOM_Object, containing the created edge.
4688 # @ref tui_creation_edge "Example"
4689 @ManageTransactions("ShapesOp")
4690 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4692 Create an edge from specified wire.
4696 theLinearTolerance linear tolerance value (default = 1e-07)
4697 theAngularTolerance angular tolerance value (default = 1e-12)
4698 theName Object name; when specified, this parameter is used
4699 for result publication in the study. Otherwise, if automatic
4700 publication is switched on, default value is used for result name.
4703 New GEOM.GEOM_Object, containing the created edge.
4705 # Example: see GEOM_TestAll.py
4706 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4707 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4708 self._autoPublish(anObj, theName, "edge")
4711 ## Create a wire from the set of edges and wires.
4712 # @param theEdgesAndWires List of edges and/or wires.
4713 # @param theTolerance Maximum distance between vertices, that will be merged.
4714 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4715 # @param theName Object name; when specified, this parameter is used
4716 # for result publication in the study. Otherwise, if automatic
4717 # publication is switched on, default value is used for result name.
4719 # @return New GEOM.GEOM_Object, containing the created wire.
4721 # @ref tui_creation_wire "Example"
4722 @ManageTransactions("ShapesOp")
4723 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4725 Create a wire from the set of edges and wires.
4728 theEdgesAndWires List of edges and/or wires.
4729 theTolerance Maximum distance between vertices, that will be merged.
4730 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4731 theName Object name; when specified, this parameter is used
4732 for result publication in the study. Otherwise, if automatic
4733 publication is switched on, default value is used for result name.
4736 New GEOM.GEOM_Object, containing the created wire.
4738 # Example: see GEOM_TestAll.py
4739 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4740 RaiseIfFailed("MakeWire", self.ShapesOp)
4741 self._autoPublish(anObj, theName, "wire")
4744 ## Create a face on the given wire.
4745 # @param theWire closed Wire or Edge to build the face on.
4746 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4747 # If the tolerance of the obtained planar face is less
4748 # than 1e-06, this face will be returned, otherwise the
4749 # algorithm tries to build any suitable face on the given
4750 # wire and prints a warning message.
4751 # @param theName Object name; when specified, this parameter is used
4752 # for result publication in the study. Otherwise, if automatic
4753 # publication is switched on, default value is used for result name.
4755 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4757 # @ref tui_creation_face "Example"
4758 @ManageTransactions("ShapesOp")
4759 def MakeFace(self, theWire, isPlanarWanted, theName=None, raiseException=False):
4761 Create a face on the given wire.
4764 theWire closed Wire or Edge to build the face on.
4765 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4766 If the tolerance of the obtained planar face is less
4767 than 1e-06, this face will be returned, otherwise the
4768 algorithm tries to build any suitable face on the given
4769 wire and prints a warning message.
4770 theName Object name; when specified, this parameter is used
4771 for result publication in the study. Otherwise, if automatic
4772 publication is switched on, default value is used for result name.
4775 New GEOM.GEOM_Object, containing the created face (compound of faces).
4777 # Example: see GEOM_TestAll.py
4778 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4779 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4780 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4782 RaiseIfFailed("MakeFace", self.ShapesOp)
4783 self._autoPublish(anObj, theName, "face")
4786 ## Create a face on the given wires set.
4787 # @param theWires List of closed wires or edges to build the face on.
4788 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4789 # If the tolerance of the obtained planar face is less
4790 # than 1e-06, this face will be returned, otherwise the
4791 # algorithm tries to build any suitable face on the given
4792 # wire and prints a warning message.
4793 # @param theName Object name; when specified, this parameter is used
4794 # for result publication in the study. Otherwise, if automatic
4795 # publication is switched on, default value is used for result name.
4797 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4799 # @ref tui_creation_face "Example"
4800 @ManageTransactions("ShapesOp")
4801 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None, raiseException=False):
4803 Create a face on the given wires set.
4806 theWires List of closed wires or edges to build the face on.
4807 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4808 If the tolerance of the obtained planar face is less
4809 than 1e-06, this face will be returned, otherwise the
4810 algorithm tries to build any suitable face on the given
4811 wire and prints a warning message.
4812 theName Object name; when specified, this parameter is used
4813 for result publication in the study. Otherwise, if automatic
4814 publication is switched on, default value is used for result name.
4817 New GEOM.GEOM_Object, containing the created face (compound of faces).
4819 # Example: see GEOM_TestAll.py
4820 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4821 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4822 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4824 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4825 self._autoPublish(anObj, theName, "face")
4828 ## See MakeFaceWires() method for details.
4830 # @ref tui_creation_face "Example 1"
4831 # \n @ref swig_MakeFaces "Example 2"
4832 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4834 See geompy.MakeFaceWires() method for details.
4836 # Example: see GEOM_TestOthers.py
4837 # note: auto-publishing is done in self.MakeFaceWires()
4838 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4841 ## Create a face based on a surface from given face bounded
4843 # @param theFace the face whose surface is used to create a new face.
4844 # @param theWire the wire that will bound a new face.
4845 # @param theName Object name; when specified, this parameter is used
4846 # for result publication in the study. Otherwise, if automatic
4847 # publication is switched on, default value is used for result name.
4849 # @return New GEOM.GEOM_Object, containing the created face.
4851 # @ref tui_creation_face "Example"
4852 @ManageTransactions("ShapesOp")
4853 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4855 Create a face based on a surface from given face bounded
4859 theFace the face whose surface is used to create a new face.
4860 theWire the wire that will bound a new face.
4861 theName Object name; when specified, this parameter is used
4862 for result publication in the study. Otherwise, if automatic
4863 publication is switched on, default value is used for result name.
4866 New GEOM.GEOM_Object, containing the created face.
4868 # Example: see GEOM_TestAll.py
4869 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4870 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4871 self._autoPublish(anObj, theName, "face")
4874 ## Create a face from a set of edges with the given constraints.
4875 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4876 # - edges should form a closed wire;
4877 # - for each edge, constraint face is optional: if a constraint face is missing
4878 # for some edge, this means that there no constraint associated with this edge.
4879 # @param theName Object name; when specified, this parameter is used
4880 # for result publication in the study. Otherwise, if automatic
4881 # publication is switched on, default value is used for result name.
4883 # @return New GEOM.GEOM_Object, containing the created face.
4885 # @ref tui_creation_face "Example"
4886 @ManageTransactions("ShapesOp")
4887 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4889 Create a face from a set of edges with the given constraints.
4892 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4893 - edges should form a closed wire;
4894 - for each edge, constraint face is optional: if a constraint face is missing
4895 for some edge, this means that there no constraint associated with this edge.
4896 theName Object name; when specified, this parameter is used
4897 for result publication in the study. Otherwise, if automatic
4898 publication is switched on, default value is used for result name.
4901 New GEOM.GEOM_Object, containing the created face.
4903 # Example: see GEOM_TestAll.py
4904 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4906 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4907 self._autoPublish(anObj, theName, "face")
4910 ## Create a shell from the set of faces, shells and/or compounds of faces.
4911 # @param theFacesAndShells List of faces, shells and/or compounds of faces.
4912 # @param theName Object name; when specified, this parameter is used
4913 # for result publication in the study. Otherwise, if automatic
4914 # publication is switched on, default value is used for result name.
4916 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4918 # @ref tui_creation_shell "Example"
4919 @ManageTransactions("ShapesOp")
4920 def MakeShell(self, theFacesAndShells, theName=None):
4922 Create a shell from the set of faces and shells.
4925 theFacesAndShells List of faces and/or shells.
4926 theName Object name; when specified, this parameter is used
4927 for result publication in the study. Otherwise, if automatic
4928 publication is switched on, default value is used for result name.
4931 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4933 # Example: see GEOM_TestAll.py
4934 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4935 RaiseIfFailed("MakeShell", self.ShapesOp)
4936 self._autoPublish(anObj, theName, "shell")
4939 ## Create a solid, bounded by the given shells.
4940 # @param theShells Sequence of bounding shells.
4941 # @param theName Object name; when specified, this parameter is used
4942 # for result publication in the study. Otherwise, if automatic
4943 # publication is switched on, default value is used for result name.
4945 # @return New GEOM.GEOM_Object, containing the created solid.
4947 # @ref tui_creation_solid "Example"
4948 @ManageTransactions("ShapesOp")
4949 def MakeSolid(self, theShells, theName=None):
4951 Create a solid, bounded by the given shells.
4954 theShells Sequence of bounding shells.
4955 theName Object name; when specified, this parameter is used
4956 for result publication in the study. Otherwise, if automatic
4957 publication is switched on, default value is used for result name.
4960 New GEOM.GEOM_Object, containing the created solid.
4962 # Example: see GEOM_TestAll.py
4963 theShells = ToList(theShells)
4964 if len(theShells) == 1:
4965 descr = self._IsGoodForSolid(theShells[0])
4967 # raise RuntimeError, "MakeSolidShells : " + descr
4968 if descr == "WRN_SHAPE_UNCLOSED":
4969 raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4970 anObj = self.ShapesOp.MakeSolidShells(theShells)
4971 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4972 self._autoPublish(anObj, theName, "solid")
4975 ## Create a compound of the given shapes.
4976 # @param theShapes List of shapes to put in compound.
4977 # @param theName Object name; when specified, this parameter is used
4978 # for result publication in the study. Otherwise, if automatic
4979 # publication is switched on, default value is used for result name.
4981 # @return New GEOM.GEOM_Object, containing the created compound.
4983 # @ref tui_creation_compound "Example"
4984 @ManageTransactions("ShapesOp")
4985 def MakeCompound(self, theShapes, theName=None):
4987 Create a compound of the given shapes.
4990 theShapes List of shapes to put in compound.
4991 theName Object name; when specified, this parameter is used
4992 for result publication in the study. Otherwise, if automatic
4993 publication is switched on, default value is used for result name.
4996 New GEOM.GEOM_Object, containing the created compound.
4998 # Example: see GEOM_TestAll.py
4999 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
5000 RaiseIfFailed("MakeCompound", self.ShapesOp)
5001 self._autoPublish(anObj, theName, "compound")
5004 ## Create a solid (or solids) from the set of faces and/or shells.
5005 # @param theFacesOrShells List of faces and/or shells.
5006 # @param isIntersect If TRUE, forces performing intersections
5007 # between arguments; otherwise (default) intersection is not performed.
5008 # @param theName Object name; when specified, this parameter is used
5009 # for result publication in the study. Otherwise, if automatic
5010 # publication is switched on, default value is used for result name.
5012 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5014 # @ref tui_creation_solid_from_faces "Example"
5015 @ManageTransactions("ShapesOp")
5016 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5018 Create a solid (or solids) from the set of connected faces and/or shells.
5021 theFacesOrShells List of faces and/or shells.
5022 isIntersect If TRUE, forces performing intersections
5023 between arguments; otherwise (default) intersection is not performed
5024 theName Object name; when specified, this parameter is used.
5025 for result publication in the study. Otherwise, if automatic
5026 publication is switched on, default value is used for result name.
5029 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5031 # Example: see GEOM_TestAll.py
5032 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5033 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5034 self._autoPublish(anObj, theName, "solid")
5037 # end of l3_basic_go
5040 ## @addtogroup l2_measure
5043 ## Gives quantity of faces in the given shape.
5044 # @param theShape Shape to count faces of.
5045 # @return Quantity of faces.
5047 # @ref swig_NumberOf "Example"
5048 @ManageTransactions("ShapesOp")
5049 def NumberOfFaces(self, theShape):
5051 Gives quantity of faces in the given shape.
5054 theShape Shape to count faces of.
5059 # Example: see GEOM_TestOthers.py
5060 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5061 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5064 ## Gives quantity of edges in the given shape.
5065 # @param theShape Shape to count edges of.
5066 # @return Quantity of edges.
5068 # @ref swig_NumberOf "Example"
5069 @ManageTransactions("ShapesOp")
5070 def NumberOfEdges(self, theShape):
5072 Gives quantity of edges in the given shape.
5075 theShape Shape to count edges of.
5080 # Example: see GEOM_TestOthers.py
5081 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5082 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5085 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5086 # @param theShape Shape to count sub-shapes of.
5087 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5088 # @return Quantity of sub-shapes of given type.
5090 # @ref swig_NumberOf "Example"
5091 @ManageTransactions("ShapesOp")
5092 def NumberOfSubShapes(self, theShape, theShapeType):
5094 Gives quantity of sub-shapes of type theShapeType in the given shape.
5097 theShape Shape to count sub-shapes of.
5098 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5101 Quantity of sub-shapes of given type.
5103 # Example: see GEOM_TestOthers.py
5104 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5105 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5108 ## Gives quantity of solids in the given shape.
5109 # @param theShape Shape to count solids in.
5110 # @return Quantity of solids.
5112 # @ref swig_NumberOf "Example"
5113 @ManageTransactions("ShapesOp")
5114 def NumberOfSolids(self, theShape):
5116 Gives quantity of solids in the given shape.
5119 theShape Shape to count solids in.
5124 # Example: see GEOM_TestOthers.py
5125 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5126 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5132 ## @addtogroup l3_healing
5135 ## Reverses an orientation the given shape.
5136 # @param theShape Shape to be reversed.
5137 # @param theName Object name; when specified, this parameter is used
5138 # for result publication in the study. Otherwise, if automatic
5139 # publication is switched on, default value is used for result name.
5141 # @return The reversed copy of theShape.
5143 # @ref swig_ChangeOrientation "Example"
5144 @ManageTransactions("ShapesOp")
5145 def ChangeOrientation(self, theShape, theName=None):
5147 Reverses an orientation the given shape.
5150 theShape Shape to be reversed.
5151 theName Object name; when specified, this parameter is used
5152 for result publication in the study. Otherwise, if automatic
5153 publication is switched on, default value is used for result name.
5156 The reversed copy of theShape.
5158 # Example: see GEOM_TestAll.py
5159 anObj = self.ShapesOp.ChangeOrientation(theShape)
5160 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5161 self._autoPublish(anObj, theName, "reversed")
5164 ## See ChangeOrientation() method for details.
5166 # @ref swig_OrientationChange "Example"
5167 def OrientationChange(self, theShape, theName=None):
5169 See geompy.ChangeOrientation method for details.
5171 # Example: see GEOM_TestOthers.py
5172 # note: auto-publishing is done in self.ChangeOrientation()
5173 anObj = self.ChangeOrientation(theShape, theName)
5179 ## @addtogroup l4_obtain
5182 ## Retrieve all free faces from the given shape.
5183 # Free face is a face, which is not shared between two shells of the shape.
5184 # @param theShape Shape to find free faces in.
5185 # @return List of IDs of all free faces, contained in theShape.
5187 # @ref tui_free_faces_page "Example"
5188 @ManageTransactions("ShapesOp")
5189 def GetFreeFacesIDs(self,theShape):
5191 Retrieve all free faces from the given shape.
5192 Free face is a face, which is not shared between two shells of the shape.
5195 theShape Shape to find free faces in.
5198 List of IDs of all free faces, contained in theShape.
5200 # Example: see GEOM_TestOthers.py
5201 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5202 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5205 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5206 # @param theShape1 Shape to find sub-shapes in.
5207 # @param theShape2 Shape to find shared sub-shapes with.
5208 # @param theShapeType Type of sub-shapes to be retrieved.
5209 # @param theName Object name; when specified, this parameter is used
5210 # for result publication in the study. Otherwise, if automatic
5211 # publication is switched on, default value is used for result name.
5213 # @return List of sub-shapes of theShape1, shared with theShape2.
5215 # @ref swig_GetSharedShapes "Example"
5216 @ManageTransactions("ShapesOp")
5217 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5219 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5222 theShape1 Shape to find sub-shapes in.
5223 theShape2 Shape to find shared sub-shapes with.
5224 theShapeType Type of sub-shapes to be retrieved.
5225 theName Object name; when specified, this parameter is used
5226 for result publication in the study. Otherwise, if automatic
5227 publication is switched on, default value is used for result name.
5230 List of sub-shapes of theShape1, shared with theShape2.
5232 # Example: see GEOM_TestOthers.py
5233 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5234 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5235 self._autoPublish(aList, theName, "shared")
5238 ## Get sub-shapes, shared by input shapes.
5239 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5240 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5241 # @param theMultiShare Specifies what type of shares should be checked:
5242 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5243 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5244 # @param theName Object name; when specified, this parameter is used
5245 # for result publication in the study. Otherwise, if automatic
5246 # publication is switched on, default value is used for result name.
5248 # @note If @a theShapes contains single compound, the shares between all possible couples of
5249 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5250 # and all rest input shapes are returned.
5252 # @return List of all found sub-shapes.
5255 # - @ref tui_shared_shapes "Example 1"
5256 # - @ref swig_GetSharedShapes "Example 2"
5257 @ManageTransactions("ShapesOp")
5258 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5260 Get sub-shapes, shared by input shapes.
5263 theShapes Either a list or compound of shapes to find common sub-shapes of.
5264 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5265 theMultiShare Specifies what type of shares should be checked:
5266 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5267 - False: causes to search sub-shapes shared between couples of input shapes.
5268 theName Object name; when specified, this parameter is used
5269 for result publication in the study. Otherwise, if automatic
5270 publication is switched on, default value is used for result name.
5272 Note: if theShapes contains single compound, the shares between all possible couples of
5273 its top-level shapes are returned; otherwise, only shares between 1st input shape
5274 and all rest input shapes are returned.
5277 List of all found sub-shapes.
5279 # Example: see GEOM_TestOthers.py
5280 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5281 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5282 self._autoPublish(aList, theName, "shared")
5285 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5286 # situated relatively the specified plane by the certain way,
5287 # defined through <VAR>theState</VAR> parameter.
5288 # @param theShape Shape to find sub-shapes of.
5289 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5290 # @param theAx1 Vector (or line, or linear edge), specifying normal
5291 # direction and location of the plane to find shapes on.
5292 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5293 # @param theName Object name; when specified, this parameter is used
5294 # for result publication in the study. Otherwise, if automatic
5295 # publication is switched on, default value is used for result name.
5297 # @return List of all found sub-shapes.
5299 # @ref swig_GetShapesOnPlane "Example"
5300 @ManageTransactions("ShapesOp")
5301 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5303 Find in theShape all sub-shapes of type theShapeType,
5304 situated relatively the specified plane by the certain way,
5305 defined through theState parameter.
5308 theShape Shape to find sub-shapes of.
5309 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5310 theAx1 Vector (or line, or linear edge), specifying normal
5311 direction and location of the plane to find shapes on.
5312 theState The state of the sub-shapes to find (see GEOM::shape_state)
5313 theName Object name; when specified, this parameter is used
5314 for result publication in the study. Otherwise, if automatic
5315 publication is switched on, default value is used for result name.
5318 List of all found sub-shapes.
5320 # Example: see GEOM_TestOthers.py
5321 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5322 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5323 self._autoPublish(aList, theName, "shapeOnPlane")
5326 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5327 # situated relatively the specified plane by the certain way,
5328 # defined through <VAR>theState</VAR> parameter.
5329 # @param theShape Shape to find sub-shapes of.
5330 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5331 # @param theAx1 Vector (or line, or linear edge), specifying normal
5332 # direction and location of the plane to find shapes on.
5333 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5335 # @return List of all found sub-shapes indices.
5337 # @ref swig_GetShapesOnPlaneIDs "Example"
5338 @ManageTransactions("ShapesOp")
5339 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5341 Find in theShape all sub-shapes of type theShapeType,
5342 situated relatively the specified plane by the certain way,
5343 defined through theState parameter.
5346 theShape Shape to find sub-shapes of.
5347 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5348 theAx1 Vector (or line, or linear edge), specifying normal
5349 direction and location of the plane to find shapes on.
5350 theState The state of the sub-shapes to find (see GEOM::shape_state)
5353 List of all found sub-shapes indices.
5355 # Example: see GEOM_TestOthers.py
5356 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5357 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5360 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5361 # situated relatively the specified plane by the certain way,
5362 # defined through <VAR>theState</VAR> parameter.
5363 # @param theShape Shape to find sub-shapes of.
5364 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5365 # @param theAx1 Vector (or line, or linear edge), specifying normal
5366 # direction of the plane to find shapes on.
5367 # @param thePnt Point specifying location of the plane to find shapes on.
5368 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5369 # @param theName Object name; when specified, this parameter is used
5370 # for result publication in the study. Otherwise, if automatic
5371 # publication is switched on, default value is used for result name.
5373 # @return List of all found sub-shapes.
5375 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5376 @ManageTransactions("ShapesOp")
5377 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5379 Find in theShape all sub-shapes of type theShapeType,
5380 situated relatively the specified plane by the certain way,
5381 defined through theState parameter.
5384 theShape Shape to find sub-shapes of.
5385 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5386 theAx1 Vector (or line, or linear edge), specifying normal
5387 direction and location of the plane to find shapes on.
5388 thePnt Point specifying location of the plane to find shapes on.
5389 theState The state of the sub-shapes to find (see GEOM::shape_state)
5390 theName Object name; when specified, this parameter is used
5391 for result publication in the study. Otherwise, if automatic
5392 publication is switched on, default value is used for result name.
5395 List of all found sub-shapes.
5397 # Example: see GEOM_TestOthers.py
5398 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5399 theAx1, thePnt, theState)
5400 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5401 self._autoPublish(aList, theName, "shapeOnPlane")
5404 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5405 # situated relatively the specified plane by the certain way,
5406 # defined through <VAR>theState</VAR> parameter.
5407 # @param theShape Shape to find sub-shapes of.
5408 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5409 # @param theAx1 Vector (or line, or linear edge), specifying normal
5410 # direction of the plane to find shapes on.
5411 # @param thePnt Point specifying location of the plane to find shapes on.
5412 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5414 # @return List of all found sub-shapes indices.
5416 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5417 @ManageTransactions("ShapesOp")
5418 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5420 Find in theShape all sub-shapes of type theShapeType,
5421 situated relatively the specified plane by the certain way,
5422 defined through theState parameter.
5425 theShape Shape to find sub-shapes of.
5426 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5427 theAx1 Vector (or line, or linear edge), specifying normal
5428 direction and location of the plane to find shapes on.
5429 thePnt Point specifying location of the plane to find shapes on.
5430 theState The state of the sub-shapes to find (see GEOM::shape_state)
5433 List of all found sub-shapes indices.
5435 # Example: see GEOM_TestOthers.py
5436 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5437 theAx1, thePnt, theState)
5438 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5441 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5442 # the specified cylinder by the certain way, defined through \a theState parameter.
5443 # @param theShape Shape to find sub-shapes of.
5444 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5445 # @param theAxis Vector (or line, or linear edge), specifying
5446 # axis of the cylinder to find shapes on.
5447 # @param theRadius Radius of the cylinder to find shapes on.
5448 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5449 # @param theName Object name; when specified, this parameter is used
5450 # for result publication in the study. Otherwise, if automatic
5451 # publication is switched on, default value is used for result name.
5453 # @return List of all found sub-shapes.
5455 # @ref swig_GetShapesOnCylinder "Example"
5456 @ManageTransactions("ShapesOp")
5457 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5459 Find in theShape all sub-shapes of type theShapeType, situated relatively
5460 the specified cylinder by the certain way, defined through theState parameter.
5463 theShape Shape to find sub-shapes of.
5464 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5465 theAxis Vector (or line, or linear edge), specifying
5466 axis of the cylinder to find shapes on.
5467 theRadius Radius of the cylinder to find shapes on.
5468 theState The state of the sub-shapes to find (see GEOM::shape_state)
5469 theName Object name; when specified, this parameter is used
5470 for result publication in the study. Otherwise, if automatic
5471 publication is switched on, default value is used for result name.
5474 List of all found sub-shapes.
5476 # Example: see GEOM_TestOthers.py
5477 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5478 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5479 self._autoPublish(aList, theName, "shapeOnCylinder")
5482 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5483 # the specified cylinder by the certain way, defined through \a theState parameter.
5484 # @param theShape Shape to find sub-shapes of.
5485 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5486 # @param theAxis Vector (or line, or linear edge), specifying
5487 # axis of the cylinder to find shapes on.
5488 # @param theRadius Radius of the cylinder to find shapes on.
5489 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5491 # @return List of all found sub-shapes indices.
5493 # @ref swig_GetShapesOnCylinderIDs "Example"
5494 @ManageTransactions("ShapesOp")
5495 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5497 Find in theShape all sub-shapes of type theShapeType, situated relatively
5498 the specified cylinder by the certain way, defined through theState parameter.
5501 theShape Shape to find sub-shapes of.
5502 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5503 theAxis Vector (or line, or linear edge), specifying
5504 axis of the cylinder to find shapes on.
5505 theRadius Radius of the cylinder to find shapes on.
5506 theState The state of the sub-shapes to find (see GEOM::shape_state)
5509 List of all found sub-shapes indices.
5511 # Example: see GEOM_TestOthers.py
5512 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5513 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5516 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5517 # the specified cylinder by the certain way, defined through \a theState parameter.
5518 # @param theShape Shape to find sub-shapes of.
5519 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5520 # @param theAxis Vector (or line, or linear edge), specifying
5521 # axis of the cylinder to find shapes on.
5522 # @param thePnt Point specifying location of the bottom of the cylinder.
5523 # @param theRadius Radius of the cylinder to find shapes on.
5524 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5525 # @param theName Object name; when specified, this parameter is used
5526 # for result publication in the study. Otherwise, if automatic
5527 # publication is switched on, default value is used for result name.
5529 # @return List of all found sub-shapes.
5531 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5532 @ManageTransactions("ShapesOp")
5533 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5535 Find in theShape all sub-shapes of type theShapeType, situated relatively
5536 the specified cylinder by the certain way, defined through theState parameter.
5539 theShape Shape to find sub-shapes of.
5540 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5541 theAxis Vector (or line, or linear edge), specifying
5542 axis of the cylinder to find shapes on.
5543 theRadius Radius of the cylinder to find shapes on.
5544 theState The state of the sub-shapes to find (see GEOM::shape_state)
5545 theName Object name; when specified, this parameter is used
5546 for result publication in the study. Otherwise, if automatic
5547 publication is switched on, default value is used for result name.
5550 List of all found sub-shapes.
5552 # Example: see GEOM_TestOthers.py
5553 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5554 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5555 self._autoPublish(aList, theName, "shapeOnCylinder")
5558 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5559 # the specified cylinder by the certain way, defined through \a theState parameter.
5560 # @param theShape Shape to find sub-shapes of.
5561 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5562 # @param theAxis Vector (or line, or linear edge), specifying
5563 # axis of the cylinder to find shapes on.
5564 # @param thePnt Point specifying location of the bottom of the cylinder.
5565 # @param theRadius Radius of the cylinder to find shapes on.
5566 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5568 # @return List of all found sub-shapes indices
5570 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5571 @ManageTransactions("ShapesOp")
5572 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5574 Find in theShape all sub-shapes of type theShapeType, situated relatively
5575 the specified cylinder by the certain way, defined through theState parameter.
5578 theShape Shape to find sub-shapes of.
5579 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5580 theAxis Vector (or line, or linear edge), specifying
5581 axis of the cylinder to find shapes on.
5582 theRadius Radius of the cylinder to find shapes on.
5583 theState The state of the sub-shapes to find (see GEOM::shape_state)
5586 List of all found sub-shapes indices.
5588 # Example: see GEOM_TestOthers.py
5589 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5590 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5593 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5594 # the specified sphere by the certain way, defined through \a theState parameter.
5595 # @param theShape Shape to find sub-shapes of.
5596 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5597 # @param theCenter Point, specifying center of the sphere to find shapes on.
5598 # @param theRadius Radius of the sphere to find shapes on.
5599 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5600 # @param theName Object name; when specified, this parameter is used
5601 # for result publication in the study. Otherwise, if automatic
5602 # publication is switched on, default value is used for result name.
5604 # @return List of all found sub-shapes.
5606 # @ref swig_GetShapesOnSphere "Example"
5607 @ManageTransactions("ShapesOp")
5608 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5610 Find in theShape all sub-shapes of type theShapeType, situated relatively
5611 the specified sphere by the certain way, defined through theState parameter.
5614 theShape Shape to find sub-shapes of.
5615 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5616 theCenter Point, specifying center of the sphere to find shapes on.
5617 theRadius Radius of the sphere to find shapes on.
5618 theState The state of the sub-shapes to find (see GEOM::shape_state)
5619 theName Object name; when specified, this parameter is used
5620 for result publication in the study. Otherwise, if automatic
5621 publication is switched on, default value is used for result name.
5624 List of all found sub-shapes.
5626 # Example: see GEOM_TestOthers.py
5627 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5628 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5629 self._autoPublish(aList, theName, "shapeOnSphere")
5632 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5633 # the specified sphere by the certain way, defined through \a theState parameter.
5634 # @param theShape Shape to find sub-shapes of.
5635 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5636 # @param theCenter Point, specifying center of the sphere to find shapes on.
5637 # @param theRadius Radius of the sphere to find shapes on.
5638 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5640 # @return List of all found sub-shapes indices.
5642 # @ref swig_GetShapesOnSphereIDs "Example"
5643 @ManageTransactions("ShapesOp")
5644 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5646 Find in theShape all sub-shapes of type theShapeType, situated relatively
5647 the specified sphere by the certain way, defined through theState parameter.
5650 theShape Shape to find sub-shapes of.
5651 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5652 theCenter Point, specifying center of the sphere to find shapes on.
5653 theRadius Radius of the sphere to find shapes on.
5654 theState The state of the sub-shapes to find (see GEOM::shape_state)
5657 List of all found sub-shapes indices.
5659 # Example: see GEOM_TestOthers.py
5660 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5661 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5664 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5665 # the specified quadrangle by the certain way, defined through \a theState parameter.
5666 # @param theShape Shape to find sub-shapes of.
5667 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5668 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5669 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5670 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5671 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5672 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5673 # @param theName Object name; when specified, this parameter is used
5674 # for result publication in the study. Otherwise, if automatic
5675 # publication is switched on, default value is used for result name.
5677 # @return List of all found sub-shapes.
5679 # @ref swig_GetShapesOnQuadrangle "Example"
5680 @ManageTransactions("ShapesOp")
5681 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5682 theTopLeftPoint, theTopRightPoint,
5683 theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5685 Find in theShape all sub-shapes of type theShapeType, situated relatively
5686 the specified quadrangle by the certain way, defined through theState parameter.
5689 theShape Shape to find sub-shapes of.
5690 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5691 theTopLeftPoint Point, specifying top left corner of a quadrangle
5692 theTopRightPoint Point, specifying top right corner of a quadrangle
5693 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5694 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5695 theState The state of the sub-shapes to find (see GEOM::shape_state)
5696 theName Object name; when specified, this parameter is used
5697 for result publication in the study. Otherwise, if automatic
5698 publication is switched on, default value is used for result name.
5701 List of all found sub-shapes.
5703 # Example: see GEOM_TestOthers.py
5704 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5705 theTopLeftPoint, theTopRightPoint,
5706 theBottomLeftPoint, theBottomRightPoint, theState)
5707 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5708 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5711 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5712 # the specified quadrangle by the certain way, defined through \a theState parameter.
5713 # @param theShape Shape to find sub-shapes of.
5714 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5715 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5716 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5717 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5718 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5719 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5721 # @return List of all found sub-shapes indices.
5723 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5724 @ManageTransactions("ShapesOp")
5725 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5726 theTopLeftPoint, theTopRightPoint,
5727 theBottomLeftPoint, theBottomRightPoint, theState):
5729 Find in theShape all sub-shapes of type theShapeType, situated relatively
5730 the specified quadrangle by the certain way, defined through theState parameter.
5733 theShape Shape to find sub-shapes of.
5734 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5735 theTopLeftPoint Point, specifying top left corner of a quadrangle
5736 theTopRightPoint Point, specifying top right corner of a quadrangle
5737 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5738 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5739 theState The state of the sub-shapes to find (see GEOM::shape_state)
5742 List of all found sub-shapes indices.
5745 # Example: see GEOM_TestOthers.py
5746 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5747 theTopLeftPoint, theTopRightPoint,
5748 theBottomLeftPoint, theBottomRightPoint, theState)
5749 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5752 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5753 # the specified \a theBox by the certain way, defined through \a theState parameter.
5754 # @param theBox Shape for relative comparing.
5755 # @param theShape Shape to find sub-shapes of.
5756 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5757 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5758 # @param theName Object name; when specified, this parameter is used
5759 # for result publication in the study. Otherwise, if automatic
5760 # publication is switched on, default value is used for result name.
5762 # @return List of all found sub-shapes.
5764 # @ref swig_GetShapesOnBox "Example"
5765 @ManageTransactions("ShapesOp")
5766 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5768 Find in theShape all sub-shapes of type theShapeType, situated relatively
5769 the specified theBox by the certain way, defined through theState parameter.
5772 theBox Shape for relative comparing.
5773 theShape Shape to find sub-shapes of.
5774 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5775 theState The state of the sub-shapes to find (see GEOM::shape_state)
5776 theName Object name; when specified, this parameter is used
5777 for result publication in the study. Otherwise, if automatic
5778 publication is switched on, default value is used for result name.
5781 List of all found sub-shapes.
5783 # Example: see GEOM_TestOthers.py
5784 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5785 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5786 self._autoPublish(aList, theName, "shapeOnBox")
5789 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5790 # the specified \a theBox by the certain way, defined through \a theState parameter.
5791 # @param theBox Shape for relative comparing.
5792 # @param theShape Shape to find sub-shapes of.
5793 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5794 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5796 # @return List of all found sub-shapes indices.
5798 # @ref swig_GetShapesOnBoxIDs "Example"
5799 @ManageTransactions("ShapesOp")
5800 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5802 Find in theShape all sub-shapes of type theShapeType, situated relatively
5803 the specified theBox by the certain way, defined through theState parameter.
5806 theBox Shape for relative comparing.
5807 theShape Shape to find sub-shapes of.
5808 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5809 theState The state of the sub-shapes to find (see GEOM::shape_state)
5812 List of all found sub-shapes indices.
5814 # Example: see GEOM_TestOthers.py
5815 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5816 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5819 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5820 # situated relatively the specified \a theCheckShape by the
5821 # certain way, defined through \a theState parameter.
5822 # @param theCheckShape Shape for relative comparing. It must be a solid.
5823 # @param theShape Shape to find sub-shapes of.
5824 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5825 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5826 # @param theName Object name; when specified, this parameter is used
5827 # for result publication in the study. Otherwise, if automatic
5828 # publication is switched on, default value is used for result name.
5830 # @return List of all found sub-shapes.
5832 # @ref swig_GetShapesOnShape "Example"
5833 @ManageTransactions("ShapesOp")
5834 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5836 Find in theShape all sub-shapes of type theShapeType,
5837 situated relatively the specified theCheckShape by the
5838 certain way, defined through theState parameter.
5841 theCheckShape Shape for relative comparing. It must be a solid.
5842 theShape Shape to find sub-shapes of.
5843 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5844 theState The state of the sub-shapes to find (see GEOM::shape_state)
5845 theName Object name; when specified, this parameter is used
5846 for result publication in the study. Otherwise, if automatic
5847 publication is switched on, default value is used for result name.
5850 List of all found sub-shapes.
5852 # Example: see GEOM_TestOthers.py
5853 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5854 theShapeType, theState)
5855 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5856 self._autoPublish(aList, theName, "shapeOnShape")
5859 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5860 # situated relatively the specified \a theCheckShape by the
5861 # certain way, defined through \a theState parameter.
5862 # @param theCheckShape Shape for relative comparing. It must be a solid.
5863 # @param theShape Shape to find sub-shapes of.
5864 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5865 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5866 # @param theName Object name; when specified, this parameter is used
5867 # for result publication in the study. Otherwise, if automatic
5868 # publication is switched on, default value is used for result name.
5870 # @return All found sub-shapes as compound.
5872 # @ref swig_GetShapesOnShapeAsCompound "Example"
5873 @ManageTransactions("ShapesOp")
5874 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5876 Find in theShape all sub-shapes of type theShapeType,
5877 situated relatively the specified theCheckShape by the
5878 certain way, defined through theState parameter.
5881 theCheckShape Shape for relative comparing. It must be a solid.
5882 theShape Shape to find sub-shapes of.
5883 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5884 theState The state of the sub-shapes to find (see GEOM::shape_state)
5885 theName Object name; when specified, this parameter is used
5886 for result publication in the study. Otherwise, if automatic
5887 publication is switched on, default value is used for result name.
5890 All found sub-shapes as compound.
5892 # Example: see GEOM_TestOthers.py
5893 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5894 theShapeType, theState)
5895 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5896 self._autoPublish(anObj, theName, "shapeOnShape")
5899 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5900 # situated relatively the specified \a theCheckShape by the
5901 # certain way, defined through \a theState parameter.
5902 # @param theCheckShape Shape for relative comparing. It must be a solid.
5903 # @param theShape Shape to find sub-shapes of.
5904 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5905 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5907 # @return List of all found sub-shapes indices.
5909 # @ref swig_GetShapesOnShapeIDs "Example"
5910 @ManageTransactions("ShapesOp")
5911 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5913 Find in theShape all sub-shapes of type theShapeType,
5914 situated relatively the specified theCheckShape by the
5915 certain way, defined through theState parameter.
5918 theCheckShape Shape for relative comparing. It must be a solid.
5919 theShape Shape to find sub-shapes of.
5920 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5921 theState The state of the sub-shapes to find (see GEOM::shape_state)
5924 List of all found sub-shapes indices.
5926 # Example: see GEOM_TestOthers.py
5927 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5928 theShapeType, theState)
5929 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5932 ## Get sub-shape(s) of theShapeWhere, which are
5933 # coincident with \a theShapeWhat or could be a part of it.
5934 # @param theShapeWhere Shape to find sub-shapes of.
5935 # @param theShapeWhat Shape, specifying what to find.
5936 # @param isNewImplementation implementation of GetInPlace functionality
5937 # (default = False, old alghorithm based on shape properties)
5938 # @param theName Object name; when specified, this parameter is used
5939 # for result publication in the study. Otherwise, if automatic
5940 # publication is switched on, default value is used for result name.
5942 # @return Compound which includes all found sub-shapes if they have different types;
5943 # or group of all found shapes of the equal type; or a single found sub-shape.
5945 # @note This function has a restriction on argument shapes.
5946 # If \a theShapeWhere has curved parts with significantly
5947 # outstanding centres (i.e. the mass centre of a part is closer to
5948 # \a theShapeWhat than to the part), such parts will not be found.
5949 # @image html get_in_place_lost_part.png
5951 # @ref swig_GetInPlace "Example"
5952 @ManageTransactions("ShapesOp")
5953 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5955 Get sub-shape(s) of theShapeWhere, which are
5956 coincident with theShapeWhat or could be a part of it.
5959 theShapeWhere Shape to find sub-shapes of.
5960 theShapeWhat Shape, specifying what to find.
5961 isNewImplementation Implementation of GetInPlace functionality
5962 (default = False, old alghorithm based on shape properties)
5963 theName Object name; when specified, this parameter is used
5964 for result publication in the study. Otherwise, if automatic
5965 publication is switched on, default value is used for result name.
5968 Compound which includes all found sub-shapes if they have different types;
5969 or group of all found shapes of the equal type; or a single found sub-shape.
5973 This function has a restriction on argument shapes.
5974 If theShapeWhere has curved parts with significantly
5975 outstanding centres (i.e. the mass centre of a part is closer to
5976 theShapeWhat than to the part), such parts will not be found.
5978 # Example: see GEOM_TestOthers.py
5980 if isNewImplementation:
5981 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5983 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5985 RaiseIfFailed("GetInPlace", self.ShapesOp)
5986 self._autoPublish(anObj, theName, "inplace")
5989 ## Get sub-shape(s) of \a theShapeWhere, which are
5990 # coincident with \a theShapeWhat or could be a part of it.
5992 # Implementation of this method is based on a saved history of an operation,
5993 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5994 # arguments (an argument shape or a sub-shape of an argument shape).
5995 # The operation could be the Partition or one of boolean operations,
5996 # performed on simple shapes (not on compounds).
5998 # @param theShapeWhere Shape to find sub-shapes of.
5999 # @param theShapeWhat Shape, specifying what to find (must be in the
6000 # building history of the ShapeWhere).
6001 # @param theName Object name; when specified, this parameter is used
6002 # for result publication in the study. Otherwise, if automatic
6003 # publication is switched on, default value is used for result name.
6005 # @return Compound which includes all found sub-shapes if they have different types;
6006 # or group of all found shapes of the equal type; or a single found sub-shape.
6008 # @ref swig_GetInPlace "Example"
6009 @ManageTransactions("ShapesOp")
6010 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6012 Implementation of this method is based on a saved history of an operation,
6013 produced theShapeWhere. The theShapeWhat must be among this operation's
6014 arguments (an argument shape or a sub-shape of an argument shape).
6015 The operation could be the Partition or one of boolean operations,
6016 performed on simple shapes (not on compounds).
6019 theShapeWhere Shape to find sub-shapes of.
6020 theShapeWhat Shape, specifying what to find (must be in the
6021 building history of the ShapeWhere).
6022 theName Object name; when specified, this parameter is used
6023 for result publication in the study. Otherwise, if automatic
6024 publication is switched on, default value is used for result name.
6027 Compound which includes all found sub-shapes if they have different types;
6028 or group of all found shapes of the equal type; or a single found sub-shape.
6030 # Example: see GEOM_TestOthers.py
6031 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6032 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6033 self._autoPublish(anObj, theName, "inplace")
6036 ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6037 # For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6038 # IDs of @a theShapeWhere.
6039 # For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6040 # two parts by a plane, then the result can be as this:
6041 # len( result_list ) = 35,
6042 # result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6043 # solids with IDs 2 and 36 within theShapeWhere
6045 # @param theShapeWhere Shape to find sub-shapes of.
6046 # @param theShapeWhat Shape, specifying what to find.
6047 # @return List of lists of sub-shape IDS of theShapeWhere.
6048 def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6050 A sort of GetInPlace functionality, returning IDs of sub-shapes.
6051 For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6052 IDs of @a theShapeWhere.
6053 For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6054 two parts by a plane, then the result can be as this:
6055 len( result_list ) = 35,
6056 result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6057 solids with IDs 2 and 36 within theShapeWhere
6060 theShapeWhere Shape to find sub-shapes of.
6061 theShapeWhat Shape, specifying what to find.
6064 List of lists of sub-shape IDS of theShapeWhere.
6066 return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6068 ## Get sub-shape of theShapeWhere, which is
6069 # equal to \a theShapeWhat.
6070 # @param theShapeWhere Shape to find sub-shape of.
6071 # @param theShapeWhat Shape, specifying what to find.
6072 # @param theName Object name; when specified, this parameter is used
6073 # for result publication in the study. Otherwise, if automatic
6074 # publication is switched on, default value is used for result name.
6076 # @return New GEOM.GEOM_Object for found sub-shape.
6078 # @ref swig_GetSame "Example"
6079 @ManageTransactions("ShapesOp")
6080 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6082 Get sub-shape of theShapeWhere, which is
6083 equal to theShapeWhat.
6086 theShapeWhere Shape to find sub-shape of.
6087 theShapeWhat Shape, specifying what to find.
6088 theName Object name; when specified, this parameter is used
6089 for result publication in the study. Otherwise, if automatic
6090 publication is switched on, default value is used for result name.
6093 New GEOM.GEOM_Object for found sub-shape.
6095 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6096 RaiseIfFailed("GetSame", self.ShapesOp)
6097 self._autoPublish(anObj, theName, "sameShape")
6101 ## Get sub-shape indices of theShapeWhere, which is
6102 # equal to \a theShapeWhat.
6103 # @param theShapeWhere Shape to find sub-shape of.
6104 # @param theShapeWhat Shape, specifying what to find.
6105 # @return List of all found sub-shapes indices.
6107 # @ref swig_GetSame "Example"
6108 @ManageTransactions("ShapesOp")
6109 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6111 Get sub-shape indices of theShapeWhere, which is
6112 equal to theShapeWhat.
6115 theShapeWhere Shape to find sub-shape of.
6116 theShapeWhat Shape, specifying what to find.
6119 List of all found sub-shapes indices.
6121 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6122 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6125 ## Resize the input edge with the new Min and Max parameters.
6126 # The input edge parameters range is [0, 1]. If theMin parameter is
6127 # negative, the input edge is extended, otherwise it is shrinked by
6128 # theMin parameter. If theMax is greater than 1, the edge is extended,
6129 # otherwise it is shrinked by theMax parameter.
6130 # @param theEdge the input edge to be resized.
6131 # @param theMin the minimal parameter value.
6132 # @param theMax the maximal parameter value.
6133 # @param theName Object name; when specified, this parameter is used
6134 # for result publication in the study. Otherwise, if automatic
6135 # publication is switched on, default value is used for result name.
6136 # @return New GEOM.GEOM_Object, containing the created edge.
6138 # @ref tui_extend "Example"
6139 @ManageTransactions("ShapesOp")
6140 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6142 Resize the input edge with the new Min and Max parameters.
6143 The input edge parameters range is [0, 1]. If theMin parameter is
6144 negative, the input edge is extended, otherwise it is shrinked by
6145 theMin parameter. If theMax is greater than 1, the edge is extended,
6146 otherwise it is shrinked by theMax parameter.
6149 theEdge the input edge to be resized.
6150 theMin the minimal parameter value.
6151 theMax the maximal parameter value.
6152 theName Object name; when specified, this parameter is used
6153 for result publication in the study. Otherwise, if automatic
6154 publication is switched on, default value is used for result name.
6157 New GEOM.GEOM_Object, containing the created edge.
6159 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6160 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6161 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6162 anObj.SetParameters(Parameters)
6163 self._autoPublish(anObj, theName, "edge")
6166 ## Resize the input face with the new UMin, UMax, VMin and VMax
6167 # parameters. The input face U and V parameters range is [0, 1]. If
6168 # theUMin parameter is negative, the input face is extended, otherwise
6169 # it is shrinked along U direction by theUMin parameter. If theUMax is
6170 # greater than 1, the face is extended, otherwise it is shrinked along
6171 # U direction by theUMax parameter. So as for theVMin, theVMax and
6172 # V direction of the input face.
6173 # @param theFace the input face to be resized.
6174 # @param theUMin the minimal U parameter value.
6175 # @param theUMax the maximal U parameter value.
6176 # @param theVMin the minimal V parameter value.
6177 # @param theVMax the maximal V parameter value.
6178 # @param theName Object name; when specified, this parameter is used
6179 # for result publication in the study. Otherwise, if automatic
6180 # publication is switched on, default value is used for result name.
6181 # @return New GEOM.GEOM_Object, containing the created face.
6183 # @ref tui_extend "Example"
6184 @ManageTransactions("ShapesOp")
6185 def ExtendFace(self, theFace, theUMin, theUMax,
6186 theVMin, theVMax, theName=None):
6188 Resize the input face with the new UMin, UMax, VMin and VMax
6189 parameters. The input face U and V parameters range is [0, 1]. If
6190 theUMin parameter is negative, the input face is extended, otherwise
6191 it is shrinked along U direction by theUMin parameter. If theUMax is
6192 greater than 1, the face is extended, otherwise it is shrinked along
6193 U direction by theUMax parameter. So as for theVMin, theVMax and
6194 V direction of the input face.
6197 theFace the input face to be resized.
6198 theUMin the minimal U parameter value.
6199 theUMax the maximal U parameter value.
6200 theVMin the minimal V parameter value.
6201 theVMax the maximal V parameter value.
6202 theName Object name; when specified, this parameter is used
6203 for result publication in the study. Otherwise, if automatic
6204 publication is switched on, default value is used for result name.
6207 New GEOM.GEOM_Object, containing the created face.
6209 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6210 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6212 RaiseIfFailed("ExtendFace", self.ShapesOp)
6213 anObj.SetParameters(Parameters)
6214 self._autoPublish(anObj, theName, "face")
6217 ## This function takes some face as input parameter and creates new
6218 # GEOM_Object, i.e. topological shape by extracting underlying surface
6219 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6220 # parameters of the source face (in the parametrical space).
6221 # @param theFace the input face.
6222 # @param theName Object name; when specified, this parameter is used
6223 # for result publication in the study. Otherwise, if automatic
6224 # publication is switched on, default value is used for result name.
6225 # @return New GEOM.GEOM_Object, containing the created face.
6227 # @ref tui_creation_surface "Example"
6228 @ManageTransactions("ShapesOp")
6229 def MakeSurfaceFromFace(self, theFace, theName=None):
6231 This function takes some face as input parameter and creates new
6232 GEOM_Object, i.e. topological shape by extracting underlying surface
6233 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6234 parameters of the source face (in the parametrical space).
6237 theFace the input face.
6238 theName Object name; when specified, this parameter is used
6239 for result publication in the study. Otherwise, if automatic
6240 publication is switched on, default value is used for result name.
6243 New GEOM.GEOM_Object, containing the created face.
6245 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6246 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6247 self._autoPublish(anObj, theName, "surface")
6253 ## @addtogroup l4_access
6256 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6257 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6258 # @param aShape Shape to get sub-shape of.
6259 # @param ListOfID List of sub-shapes indices.
6260 # @param theName Object name; when specified, this parameter is used
6261 # for result publication in the study. Otherwise, if automatic
6262 # publication is switched on, default value is used for result name.
6264 # @return Found sub-shape.
6266 # @ref swig_all_decompose "Example"
6267 def GetSubShape(self, aShape, ListOfID, theName=None):
6269 Obtain a composite sub-shape of aShape, composed from sub-shapes
6270 of aShape, selected by their unique IDs inside aShape
6273 aShape Shape to get sub-shape of.
6274 ListOfID List of sub-shapes indices.
6275 theName Object name; when specified, this parameter is used
6276 for result publication in the study. Otherwise, if automatic
6277 publication is switched on, default value is used for result name.
6282 # Example: see GEOM_TestAll.py
6283 anObj = self.AddSubShape(aShape,ListOfID)
6284 self._autoPublish(anObj, theName, "subshape")
6287 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6288 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6289 # @param aShape Shape to get sub-shape of.
6290 # @param aSubShape Sub-shapes of aShape.
6291 # @return ID of found sub-shape.
6293 # @ref swig_all_decompose "Example"
6294 @ManageTransactions("LocalOp")
6295 def GetSubShapeID(self, aShape, aSubShape):
6297 Obtain unique ID of sub-shape aSubShape inside aShape
6298 of aShape, selected by their unique IDs inside aShape
6301 aShape Shape to get sub-shape of.
6302 aSubShape Sub-shapes of aShape.
6305 ID of found sub-shape.
6307 # Example: see GEOM_TestAll.py
6308 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6309 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6312 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6313 # This function is provided for performance purpose. The complexity is O(n) with n
6314 # the number of subobjects of aShape
6315 # @param aShape Shape to get sub-shape of.
6316 # @param aSubShapes Sub-shapes of aShape.
6317 # @return list of IDs of found sub-shapes.
6319 # @ref swig_all_decompose "Example"
6320 @ManageTransactions("ShapesOp")
6321 def GetSubShapesIDs(self, aShape, aSubShapes):
6323 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6324 This function is provided for performance purpose. The complexity is O(n) with n
6325 the number of subobjects of aShape
6328 aShape Shape to get sub-shape of.
6329 aSubShapes Sub-shapes of aShape.
6332 List of IDs of found sub-shape.
6334 # Example: see GEOM_TestAll.py
6335 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6336 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6342 ## @addtogroup l4_decompose
6345 ## Get all sub-shapes and groups of \a theShape,
6346 # that were created already by any other methods.
6347 # @param theShape Any shape.
6348 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6349 # returned, else all found sub-shapes and groups.
6350 # @return List of existing sub-objects of \a theShape.
6352 # @ref swig_all_decompose "Example"
6353 @ManageTransactions("ShapesOp")
6354 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6356 Get all sub-shapes and groups of theShape,
6357 that were created already by any other methods.
6361 theGroupsOnly If this parameter is TRUE, only groups will be
6362 returned, else all found sub-shapes and groups.
6365 List of existing sub-objects of theShape.
6367 # Example: see GEOM_TestAll.py
6368 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6369 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6372 ## Get all groups of \a theShape,
6373 # that were created already by any other methods.
6374 # @param theShape Any shape.
6375 # @return List of existing groups of \a theShape.
6377 # @ref swig_all_decompose "Example"
6378 @ManageTransactions("ShapesOp")
6379 def GetGroups(self, theShape):
6381 Get all groups of theShape,
6382 that were created already by any other methods.
6388 List of existing groups of theShape.
6390 # Example: see GEOM_TestAll.py
6391 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6392 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6395 ## Explode a shape on sub-shapes of a given type.
6396 # If the shape itself matches the type, it is also returned.
6397 # @param aShape Shape to be exploded.
6398 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6399 # @param theName Object name; when specified, this parameter is used
6400 # for result publication in the study. Otherwise, if automatic
6401 # publication is switched on, default value is used for result name.
6403 # @return List of sub-shapes of type theShapeType, contained in theShape.
6405 # @ref swig_all_decompose "Example"
6406 @ManageTransactions("ShapesOp")
6407 def SubShapeAll(self, aShape, aType, theName=None):
6409 Explode a shape on sub-shapes of a given type.
6410 If the shape itself matches the type, it is also returned.
6413 aShape Shape to be exploded.
6414 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6415 theName Object name; when specified, this parameter is used
6416 for result publication in the study. Otherwise, if automatic
6417 publication is switched on, default value is used for result name.
6420 List of sub-shapes of type theShapeType, contained in theShape.
6422 # Example: see GEOM_TestAll.py
6423 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6424 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6425 self._autoPublish(ListObj, theName, "subshape")
6428 ## Explode a shape on sub-shapes of a given type.
6429 # @param aShape Shape to be exploded.
6430 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6431 # @return List of IDs of sub-shapes.
6433 # @ref swig_all_decompose "Example"
6434 @ManageTransactions("ShapesOp")
6435 def SubShapeAllIDs(self, aShape, aType):
6437 Explode a shape on sub-shapes of a given type.
6440 aShape Shape to be exploded (see geompy.ShapeType)
6441 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6444 List of IDs of sub-shapes.
6446 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6447 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6450 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6451 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6452 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6453 # @param aShape Shape to get sub-shape of.
6454 # @param ListOfInd List of sub-shapes indices.
6455 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6456 # @param theName Object name; when specified, this parameter is used
6457 # for result publication in the study. Otherwise, if automatic
6458 # publication is switched on, default value is used for result name.
6460 # @return A compound of sub-shapes of aShape.
6462 # @ref swig_all_decompose "Example"
6463 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6465 Obtain a compound of sub-shapes of aShape,
6466 selected by their indices in list of all sub-shapes of type aType.
6467 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6470 aShape Shape to get sub-shape of.
6471 ListOfID List of sub-shapes indices.
6472 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6473 theName Object name; when specified, this parameter is used
6474 for result publication in the study. Otherwise, if automatic
6475 publication is switched on, default value is used for result name.
6478 A compound of sub-shapes of aShape.
6480 # Example: see GEOM_TestAll.py
6482 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6483 for ind in ListOfInd:
6484 ListOfIDs.append(AllShapeIDsList[ind - 1])
6485 # note: auto-publishing is done in self.GetSubShape()
6486 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6489 ## Explode a shape on sub-shapes of a given type.
6490 # Sub-shapes will be sorted taking into account their gravity centers,
6491 # to provide stable order of sub-shapes. Please see
6492 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6493 # If the shape itself matches the type, it is also returned.
6494 # @param aShape Shape to be exploded.
6495 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6496 # @param theName Object name; when specified, this parameter is used
6497 # for result publication in the study. Otherwise, if automatic
6498 # publication is switched on, default value is used for result name.
6500 # @return List of sub-shapes of type theShapeType, contained in theShape.
6502 # @ref swig_SubShapeAllSorted "Example"
6503 @ManageTransactions("ShapesOp")
6504 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6506 Explode a shape on sub-shapes of a given type.
6507 Sub-shapes will be sorted taking into account their gravity centers,
6508 to provide stable order of sub-shapes.
6509 If the shape itself matches the type, it is also returned.
6512 aShape Shape to be exploded.
6513 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6514 theName Object name; when specified, this parameter is used
6515 for result publication in the study. Otherwise, if automatic
6516 publication is switched on, default value is used for result name.
6519 List of sub-shapes of type theShapeType, contained in theShape.
6521 # Example: see GEOM_TestAll.py
6522 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6523 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6524 self._autoPublish(ListObj, theName, "subshape")
6527 ## Explode a shape on sub-shapes of a given type.
6528 # Sub-shapes will be sorted taking into account their gravity centers,
6529 # to provide stable order of sub-shapes. Please see
6530 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6531 # @param aShape Shape to be exploded.
6532 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6533 # @return List of IDs of sub-shapes.
6535 # @ref swig_all_decompose "Example"
6536 @ManageTransactions("ShapesOp")
6537 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6539 Explode a shape on sub-shapes of a given type.
6540 Sub-shapes will be sorted taking into account their gravity centers,
6541 to provide stable order of sub-shapes.
6544 aShape Shape to be exploded.
6545 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6548 List of IDs of sub-shapes.
6550 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6551 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6554 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6555 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6556 # Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6557 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6558 # @param aShape Shape to get sub-shape of.
6559 # @param ListOfInd List of sub-shapes indices.
6560 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6561 # @param theName Object name; when specified, this parameter is used
6562 # for result publication in the study. Otherwise, if automatic
6563 # publication is switched on, default value is used for result name.
6565 # @return A compound of sub-shapes of aShape.
6567 # @ref swig_all_decompose "Example"
6568 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6570 Obtain a compound of sub-shapes of aShape,
6571 selected by they indices in sorted list of all sub-shapes of type aType.
6572 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6575 aShape Shape to get sub-shape of.
6576 ListOfID List of sub-shapes indices.
6577 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6578 theName Object name; when specified, this parameter is used
6579 for result publication in the study. Otherwise, if automatic
6580 publication is switched on, default value is used for result name.
6583 A compound of sub-shapes of aShape.
6585 # Example: see GEOM_TestAll.py
6587 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6588 for ind in ListOfInd:
6589 ListOfIDs.append(AllShapeIDsList[ind - 1])
6590 # note: auto-publishing is done in self.GetSubShape()
6591 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6594 ## Extract shapes (excluding the main shape) of given type.
6595 # @param aShape The shape.
6596 # @param aType The shape type (see ShapeType())
6597 # @param isSorted Boolean flag to switch sorting on/off. Please see
6598 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6599 # @param theName Object name; when specified, this parameter is used
6600 # for result publication in the study. Otherwise, if automatic
6601 # publication is switched on, default value is used for result name.
6603 # @return List of sub-shapes of type aType, contained in aShape.
6605 # @ref swig_FilletChamfer "Example"
6606 @ManageTransactions("ShapesOp")
6607 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6609 Extract shapes (excluding the main shape) of given type.
6613 aType The shape type (see geompy.ShapeType)
6614 isSorted Boolean flag to switch sorting on/off.
6615 theName Object name; when specified, this parameter is used
6616 for result publication in the study. Otherwise, if automatic
6617 publication is switched on, default value is used for result name.
6620 List of sub-shapes of type aType, contained in aShape.
6622 # Example: see GEOM_TestAll.py
6623 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6624 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6625 self._autoPublish(ListObj, theName, "subshape")
6628 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6629 # @param aShape Main shape.
6630 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6631 # @param theName Object name; when specified, this parameter is used
6632 # for result publication in the study. Otherwise, if automatic
6633 # publication is switched on, default value is used for result name.
6634 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6636 # @ref swig_all_decompose "Example"
6637 @ManageTransactions("ShapesOp")
6638 def SubShapes(self, aShape, anIDs, theName=None):
6640 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6644 anIDs List of unique IDs of sub-shapes inside theMainShape.
6645 theName Object name; when specified, this parameter is used
6646 for result publication in the study. Otherwise, if automatic
6647 publication is switched on, default value is used for result name.
6650 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6652 # Example: see GEOM_TestAll.py
6653 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6654 RaiseIfFailed("SubShapes", self.ShapesOp)
6655 self._autoPublish(ListObj, theName, "subshape")
6658 ## Explode a shape into edges sorted in a row from a starting point.
6659 # @param theShape the shape to be exploded on edges.
6660 # @param theStartPoint the starting point.
6661 # @param theName Object name; when specified, this parameter is used
6662 # for result publication in the study. Otherwise, if automatic
6663 # publication is switched on, default value is used for result name.
6664 # @return List of GEOM.GEOM_Object that is actually an ordered list
6665 # of edges sorted in a row from a starting point.
6667 # @ref swig_GetSubShapeEdgeSorted "Example"
6668 @ManageTransactions("ShapesOp")
6669 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6671 Explode a shape into edges sorted in a row from a starting point.
6674 theShape the shape to be exploded on edges.
6675 theStartPoint the starting point.
6676 theName Object name; when specified, this parameter is used
6677 for result publication in the study. Otherwise, if automatic
6678 publication is switched on, default value is used for result name.
6681 List of GEOM.GEOM_Object that is actually an ordered list
6682 of edges sorted in a row from a starting point.
6684 # Example: see GEOM_TestAll.py
6685 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6686 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6687 self._autoPublish(ListObj, theName, "SortedEdges")
6691 # Return the list of subshapes that satisfies a certain tolerance
6692 # criterion. The user defines the type of shapes to be returned, the
6693 # condition and the tolerance value. The operation is defined for
6694 # faces, edges and vertices only. E.g. for theShapeType FACE,
6695 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6696 # all faces of theShape that have tolerances greater then 1.e7.
6698 # @param theShape the shape to be exploded
6699 # @param theShapeType the type of sub-shapes to be returned (see
6700 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6701 # @param theCondition the condition type (see GEOM::comparison_condition).
6702 # @param theTolerance the tolerance filter.
6703 # @param theName Object name; when specified, this parameter is used
6704 # for result publication in the study. Otherwise, if automatic
6705 # publication is switched on, default value is used for result name.
6706 # @return the list of shapes that satisfy the conditions.
6708 # @ref swig_GetSubShapesWithTolerance "Example"
6709 @ManageTransactions("ShapesOp")
6710 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6711 theCondition, theTolerance, theName=None):
6713 Return the list of subshapes that satisfies a certain tolerance
6714 criterion. The user defines the type of shapes to be returned, the
6715 condition and the tolerance value. The operation is defined for
6716 faces, edges and vertices only. E.g. for theShapeType FACE,
6717 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6718 all faces of theShape that have tolerances greater then 1.e7.
6721 theShape the shape to be exploded
6722 theShapeType the type of sub-shapes to be returned (see
6723 ShapeType()). Can have the values FACE,
6724 EDGE and VERTEX only.
6725 theCondition the condition type (see GEOM::comparison_condition).
6726 theTolerance the tolerance filter.
6727 theName Object name; when specified, this parameter is used
6728 for result publication in the study. Otherwise, if automatic
6729 publication is switched on, default value is used for result name.
6732 The list of shapes that satisfy the conditions.
6734 # Example: see GEOM_TestAll.py
6735 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6736 theCondition, theTolerance)
6737 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6738 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6741 ## Check if the object is a sub-object of another GEOM object.
6742 # @param aSubObject Checked sub-object (or its parent object, in case if
6743 # \a theSubObjectIndex is non-zero).
6744 # @param anObject An object that is checked for ownership (or its parent object,
6745 # in case if \a theObjectIndex is non-zero).
6746 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6747 # identifies a sub-object within its parent specified via \a theSubObject.
6748 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6749 # identifies an object within its parent specified via \a theObject.
6750 # @return TRUE, if the given object contains sub-object.
6751 @ManageTransactions("ShapesOp")
6752 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6754 Check if the object is a sub-object of another GEOM object.
6757 aSubObject Checked sub-object (or its parent object, in case if
6758 \a theSubObjectIndex is non-zero).
6759 anObject An object that is checked for ownership (or its parent object,
6760 in case if \a theObjectIndex is non-zero).
6761 aSubObjectIndex When non-zero, specifies a sub-shape index that
6762 identifies a sub-object within its parent specified via \a theSubObject.
6763 anObjectIndex When non-zero, specifies a sub-shape index that
6764 identifies an object within its parent specified via \a theObject.
6767 TRUE, if the given object contains sub-object.
6769 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6770 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6773 ## Perform extraction of sub-shapes from the main shape.
6775 # @param theShape the main shape
6776 # @param theListOfID the list of sub-shape IDs to be extracted from
6778 # @return New GEOM.GEOM_Object, containing the shape without
6779 # extracted sub-shapes.
6781 # @ref swig_MakeExtraction "Example"
6782 @ManageTransactions("ShapesOp")
6783 def MakeExtraction(self, theShape, theListOfID, theName=None):
6785 Perform extraction of sub-shapes from the main shape.
6788 theShape the main shape
6789 theListOfID the list of sub-shape IDs to be extracted from
6793 New GEOM.GEOM_Object, containing the shape without
6794 extracted sub-shapes.
6796 # Example: see GEOM_TestAll.py
6797 (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6798 RaiseIfFailed("MakeExtraction", self.ShapesOp)
6799 self._autoPublish(anObj, theName, "Extraction")
6802 # end of l4_decompose
6805 ## @addtogroup l4_decompose_d
6808 ## Deprecated method
6809 # It works like SubShapeAllSortedCentres(), but wrongly
6810 # defines centres of faces, shells and solids.
6811 @ManageTransactions("ShapesOp")
6812 def SubShapeAllSorted(self, aShape, aType, theName=None):
6815 It works like geompy.SubShapeAllSortedCentres, but wrongly
6816 defines centres of faces, shells and solids.
6818 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6819 RaiseIfFailed("MakeExplode", self.ShapesOp)
6820 self._autoPublish(ListObj, theName, "subshape")
6823 ## Deprecated method
6824 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6825 # defines centres of faces, shells and solids.
6826 @ManageTransactions("ShapesOp")
6827 def SubShapeAllSortedIDs(self, aShape, aType):
6830 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6831 defines centres of faces, shells and solids.
6833 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6834 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6837 ## Deprecated method
6838 # It works like SubShapeSortedCentres(), but has a bug
6839 # (wrongly defines centres of faces, shells and solids).
6840 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6843 It works like geompy.SubShapeSortedCentres, but has a bug
6844 (wrongly defines centres of faces, shells and solids).
6847 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6848 for ind in ListOfInd:
6849 ListOfIDs.append(AllShapeIDsList[ind - 1])
6850 # note: auto-publishing is done in self.GetSubShape()
6851 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6854 # end of l4_decompose_d
6857 ## @addtogroup l3_healing
6860 ## Apply a sequence of Shape Healing operators to the given object.
6861 # @param theShape Shape to be processed.
6862 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6863 # @param theParameters List of names of parameters
6864 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6865 # @param theValues List of values of parameters, in the same order
6866 # as parameters are listed in <VAR>theParameters</VAR> list.
6867 # @param theName Object name; when specified, this parameter is used
6868 # for result publication in the study. Otherwise, if automatic
6869 # publication is switched on, default value is used for result name.
6871 # <b> Operators and Parameters: </b> \n
6873 # * \b FixShape - corrects invalid shapes. \n
6874 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6875 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6877 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6878 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6879 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6880 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6881 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6882 # - \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
6883 # - \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
6884 # - \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
6886 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6887 # surfaces in segments using a certain angle. \n
6888 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6889 # if Angle=180, four if Angle=90, etc). \n
6890 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6892 # * \b SplitClosedFaces - splits closed faces in segments.
6893 # The number of segments depends on the number of splitting points.\n
6894 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6896 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6897 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6898 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6899 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6900 # This and the previous parameters can take the following values:\n
6901 # \b Parametric \b Continuity \n
6902 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6903 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6904 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6905 # ruling out sharp edges).\n
6906 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6907 # are of the same magnitude).\n
6908 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6909 # or surfaces (d/du C(u)) are the same at junction. \n
6910 # \b Geometric \b Continuity \n
6911 # \b G1: first derivatives are proportional at junction.\n
6912 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6913 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6914 # \b G2: first and second derivatives are proportional at junction.
6915 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6916 # continuity requires that the underlying parameterization was continuous as well.
6917 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6919 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6920 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6921 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6922 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6923 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6924 # with the specified parameters.\n
6925 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6926 # with the specified parameters.\n
6927 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6928 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6929 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6930 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6932 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6933 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6934 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6935 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6936 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6938 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6939 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6942 # @return New GEOM.GEOM_Object, containing processed shape.
6944 # \n @ref tui_shape_processing "Example"
6945 @ManageTransactions("HealOp")
6946 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6948 Apply a sequence of Shape Healing operators to the given object.
6951 theShape Shape to be processed.
6952 theValues List of values of parameters, in the same order
6953 as parameters are listed in theParameters list.
6954 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6955 theParameters List of names of parameters
6956 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6957 theName Object name; when specified, this parameter is used
6958 for result publication in the study. Otherwise, if automatic
6959 publication is switched on, default value is used for result name.
6961 Operators and Parameters:
6963 * FixShape - corrects invalid shapes.
6964 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6965 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6966 * FixFaceSize - removes small faces, such as spots and strips.
6967 * FixFaceSize.Tolerance - defines minimum possible face size.
6968 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6969 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6970 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6971 * 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.
6972 * 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.
6973 * 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.
6975 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6976 in segments using a certain angle.
6977 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6978 if Angle=180, four if Angle=90, etc).
6979 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6980 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6982 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6983 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6984 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6985 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6986 * SplitContinuity.CurveContinuity - required continuity for curves.
6987 This and the previous parameters can take the following values:
6989 Parametric Continuity:
6990 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6991 coincidental. The curves or surfaces may still meet at an angle,
6992 giving rise to a sharp corner or edge).
6993 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6994 are parallel, ruling out sharp edges).
6995 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6996 or surfaces are of the same magnitude).
6997 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6998 curves or surfaces (d/du C(u)) are the same at junction.
7000 Geometric Continuity:
7001 G1: first derivatives are proportional at junction.
7002 The curve tangents thus have the same direction, but not necessarily the same magnitude.
7003 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
7004 G2: first and second derivatives are proportional at junction. As the names imply,
7005 geometric continuity requires the geometry to be continuous, while parametric continuity requires
7006 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
7007 geometric continuity of order n, but not vice-versa.
7008 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7009 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7010 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7011 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7012 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7013 the specified parameters.
7014 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7015 the specified parameters.
7016 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7017 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7018 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7019 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7020 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7021 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7022 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7023 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7024 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7025 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7026 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7029 New GEOM.GEOM_Object, containing processed shape.
7031 Note: For more information look through SALOME Geometry User's Guide->
7032 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7034 # Example: see GEOM_TestHealing.py
7035 theValues,Parameters = ParseList(theValues)
7036 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7037 # To avoid script failure in case of good argument shape
7038 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7040 RaiseIfFailed("ProcessShape", self.HealOp)
7041 for string in (theOperators + theParameters):
7042 Parameters = ":" + Parameters
7044 anObj.SetParameters(Parameters)
7045 self._autoPublish(anObj, theName, "healed")
7048 ## Remove faces from the given object (shape).
7049 # @param theObject Shape to be processed.
7050 # @param theFaces Indices of faces to be removed, if EMPTY then the method
7051 # removes ALL faces of the given object.
7052 # @param theName Object name; when specified, this parameter is used
7053 # for result publication in the study. Otherwise, if automatic
7054 # publication is switched on, default value is used for result name.
7056 # @return New GEOM.GEOM_Object, containing processed shape.
7058 # @ref tui_suppress_faces "Example"
7059 @ManageTransactions("HealOp")
7060 def SuppressFaces(self, theObject, theFaces, theName=None):
7062 Remove faces from the given object (shape).
7065 theObject Shape to be processed.
7066 theFaces Indices of faces to be removed, if EMPTY then the method
7067 removes ALL faces of the given object.
7068 theName Object name; when specified, this parameter is used
7069 for result publication in the study. Otherwise, if automatic
7070 publication is switched on, default value is used for result name.
7073 New GEOM.GEOM_Object, containing processed shape.
7075 # Example: see GEOM_TestHealing.py
7076 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7077 RaiseIfFailed("SuppressFaces", self.HealOp)
7078 self._autoPublish(anObj, theName, "suppressFaces")
7081 ## Sewing of faces into a single shell.
7082 # @param ListShape Shapes to be processed.
7083 # @param theTolerance Required tolerance value.
7084 # @param AllowNonManifold Flag that allows non-manifold sewing.
7085 # @param theName Object name; when specified, this parameter is used
7086 # for result publication in the study. Otherwise, if automatic
7087 # publication is switched on, default value is used for result name.
7089 # @return New GEOM.GEOM_Object, containing a result shell.
7091 # @ref tui_sewing "Example"
7092 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7094 Sewing of faces into a single shell.
7097 ListShape Shapes to be processed.
7098 theTolerance Required tolerance value.
7099 AllowNonManifold Flag that allows non-manifold sewing.
7100 theName Object name; when specified, this parameter is used
7101 for result publication in the study. Otherwise, if automatic
7102 publication is switched on, default value is used for result name.
7105 New GEOM.GEOM_Object, containing containing a result shell.
7107 # Example: see GEOM_TestHealing.py
7108 # note: auto-publishing is done in self.Sew()
7109 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7112 ## Sewing of faces into a single shell.
7113 # @param ListShape Shapes to be processed.
7114 # @param theTolerance Required tolerance value.
7115 # @param AllowNonManifold Flag that allows non-manifold sewing.
7116 # @param theName Object name; when specified, this parameter is used
7117 # for result publication in the study. Otherwise, if automatic
7118 # publication is switched on, default value is used for result name.
7120 # @return New GEOM.GEOM_Object, containing a result shell.
7121 @ManageTransactions("HealOp")
7122 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7124 Sewing of faces into a single shell.
7127 ListShape Shapes to be processed.
7128 theTolerance Required tolerance value.
7129 AllowNonManifold Flag that allows non-manifold sewing.
7130 theName Object name; when specified, this parameter is used
7131 for result publication in the study. Otherwise, if automatic
7132 publication is switched on, default value is used for result name.
7135 New GEOM.GEOM_Object, containing a result shell.
7137 # Example: see MakeSewing() above
7138 theTolerance,Parameters = ParseParameters(theTolerance)
7139 if AllowNonManifold:
7140 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7142 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7143 # To avoid script failure in case of good argument shape
7144 # (Fix of test cases geom/bugs11/L7,L8)
7145 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7147 RaiseIfFailed("Sew", self.HealOp)
7148 anObj.SetParameters(Parameters)
7149 self._autoPublish(anObj, theName, "sewed")
7152 ## Rebuild the topology of theSolids by removing
7153 # the faces that are shared by several solids.
7154 # @param theSolids A compound or a list of solids to be processed.
7155 # @param theName Object name; when specified, this parameter is used
7156 # for result publication in the study. Otherwise, if automatic
7157 # publication is switched on, default value is used for result name.
7159 # @return New GEOM.GEOM_Object, containing processed shape.
7161 # @ref tui_remove_webs "Example"
7162 @ManageTransactions("HealOp")
7163 def RemoveInternalFaces (self, theSolids, theName=None):
7165 Rebuild the topology of theSolids by removing
7166 the faces that are shared by several solids.
7169 theSolids A compound or a list of solids to be processed.
7170 theName Object name; when specified, this parameter is used
7171 for result publication in the study. Otherwise, if automatic
7172 publication is switched on, default value is used for result name.
7175 New GEOM.GEOM_Object, containing processed shape.
7177 # Example: see GEOM_TestHealing.py
7178 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7179 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7180 self._autoPublish(anObj, theName, "removeWebs")
7183 ## Remove internal wires and edges from the given object (face).
7184 # @param theObject Shape to be processed.
7185 # @param theWires Indices of wires to be removed, if EMPTY then the method
7186 # removes ALL internal wires of the given object.
7187 # @param theName Object name; when specified, this parameter is used
7188 # for result publication in the study. Otherwise, if automatic
7189 # publication is switched on, default value is used for result name.
7191 # @return New GEOM.GEOM_Object, containing processed shape.
7193 # @ref tui_suppress_internal_wires "Example"
7194 @ManageTransactions("HealOp")
7195 def SuppressInternalWires(self, theObject, theWires, theName=None):
7197 Remove internal wires and edges from the given object (face).
7200 theObject Shape to be processed.
7201 theWires Indices of wires to be removed, if EMPTY then the method
7202 removes ALL internal wires of the given object.
7203 theName Object name; when specified, this parameter is used
7204 for result publication in the study. Otherwise, if automatic
7205 publication is switched on, default value is used for result name.
7208 New GEOM.GEOM_Object, containing processed shape.
7210 # Example: see GEOM_TestHealing.py
7211 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7212 RaiseIfFailed("RemoveIntWires", self.HealOp)
7213 self._autoPublish(anObj, theName, "suppressWires")
7216 ## Remove internal closed contours (holes) from the given object.
7217 # @param theObject Shape to be processed.
7218 # @param theWires Indices of wires to be removed, if EMPTY then the method
7219 # removes ALL internal holes of the given object
7220 # @param theName Object name; when specified, this parameter is used
7221 # for result publication in the study. Otherwise, if automatic
7222 # publication is switched on, default value is used for result name.
7224 # @return New GEOM.GEOM_Object, containing processed shape.
7226 # @ref tui_suppress_holes "Example"
7227 @ManageTransactions("HealOp")
7228 def SuppressHoles(self, theObject, theWires, theName=None):
7230 Remove internal closed contours (holes) from the given object.
7233 theObject Shape to be processed.
7234 theWires Indices of wires to be removed, if EMPTY then the method
7235 removes ALL internal holes of the given object
7236 theName Object name; when specified, this parameter is used
7237 for result publication in the study. Otherwise, if automatic
7238 publication is switched on, default value is used for result name.
7241 New GEOM.GEOM_Object, containing processed shape.
7243 # Example: see GEOM_TestHealing.py
7244 anObj = self.HealOp.FillHoles(theObject, theWires)
7245 RaiseIfFailed("FillHoles", self.HealOp)
7246 self._autoPublish(anObj, theName, "suppressHoles")
7249 ## Close an open wire.
7250 # @param theObject Shape to be processed.
7251 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7252 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7253 # @param isCommonVertex If True : closure by creation of a common vertex,
7254 # If False : closure by creation of an edge between ends.
7255 # @param theName Object name; when specified, this parameter is used
7256 # for result publication in the study. Otherwise, if automatic
7257 # publication is switched on, default value is used for result name.
7259 # @return New GEOM.GEOM_Object, containing processed shape.
7261 # @ref tui_close_contour "Example"
7262 @ManageTransactions("HealOp")
7263 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7268 theObject Shape to be processed.
7269 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7270 if [ ], then theObject itself is a wire.
7271 isCommonVertex If True : closure by creation of a common vertex,
7272 If False : closure by creation of an edge between ends.
7273 theName Object name; when specified, this parameter is used
7274 for result publication in the study. Otherwise, if automatic
7275 publication is switched on, default value is used for result name.
7278 New GEOM.GEOM_Object, containing processed shape.
7280 # Example: see GEOM_TestHealing.py
7281 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7282 RaiseIfFailed("CloseContour", self.HealOp)
7283 self._autoPublish(anObj, theName, "closeContour")
7286 ## Addition of a point to a given edge object.
7287 # @param theObject Shape to be processed.
7288 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7289 # if -1, then theObject itself is the edge.
7290 # @param theValue Value of parameter on edge or length parameter,
7291 # depending on \a isByParameter.
7292 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7293 # if FALSE : \a theValue is treated as a length parameter [0..1]
7294 # @param theName Object name; when specified, this parameter is used
7295 # for result publication in the study. Otherwise, if automatic
7296 # publication is switched on, default value is used for result name.
7298 # @return New GEOM.GEOM_Object, containing processed shape.
7300 # @ref tui_add_point_on_edge "Example"
7301 @ManageTransactions("HealOp")
7302 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7304 Addition of a point to a given edge object.
7307 theObject Shape to be processed.
7308 theEdgeIndex Index of edge to be divided within theObject's shape,
7309 if -1, then theObject itself is the edge.
7310 theValue Value of parameter on edge or length parameter,
7311 depending on isByParameter.
7312 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7313 if FALSE : theValue is treated as a length parameter [0..1]
7314 theName Object name; when specified, this parameter is used
7315 for result publication in the study. Otherwise, if automatic
7316 publication is switched on, default value is used for result name.
7319 New GEOM.GEOM_Object, containing processed shape.
7321 # Example: see GEOM_TestHealing.py
7322 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7323 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7324 RaiseIfFailed("DivideEdge", self.HealOp)
7325 anObj.SetParameters(Parameters)
7326 self._autoPublish(anObj, theName, "divideEdge")
7329 ## Addition of points to a given edge of \a theObject by projecting
7330 # other points to the given edge.
7331 # @param theObject Shape to be processed.
7332 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7333 # if -1, then theObject itself is the edge.
7334 # @param thePoints List of points to project to theEdgeIndex-th edge.
7335 # @param theName Object name; when specified, this parameter is used
7336 # for result publication in the study. Otherwise, if automatic
7337 # publication is switched on, default value is used for result name.
7339 # @return New GEOM.GEOM_Object, containing processed shape.
7341 # @ref tui_add_point_on_edge "Example"
7342 @ManageTransactions("HealOp")
7343 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7345 Addition of points to a given edge of \a theObject by projecting
7346 other points to the given edge.
7349 theObject Shape to be processed.
7350 theEdgeIndex The edge or its index to be divided within theObject's shape,
7351 if -1, then theObject itself is the edge.
7352 thePoints List of points to project to theEdgeIndex-th edge.
7353 theName Object name; when specified, this parameter is used
7354 for result publication in the study. Otherwise, if automatic
7355 publication is switched on, default value is used for result name.
7358 New GEOM.GEOM_Object, containing processed shape.
7360 # Example: see GEOM_TestHealing.py
7361 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7362 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7363 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7364 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7365 self._autoPublish(anObj, theName, "divideEdge")
7368 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7369 # @param theWire Wire to minimize the number of C1 continuous edges in.
7370 # @param theVertices A list of vertices to suppress. If the list
7371 # is empty, all vertices in a wire will be assumed.
7372 # @param theName Object name; when specified, this parameter is used
7373 # for result publication in the study. Otherwise, if automatic
7374 # publication is switched on, default value is used for result name.
7376 # @return New GEOM.GEOM_Object with modified wire.
7378 # @ref tui_fuse_collinear_edges "Example"
7379 @ManageTransactions("HealOp")
7380 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7382 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7385 theWire Wire to minimize the number of C1 continuous edges in.
7386 theVertices A list of vertices to suppress. If the list
7387 is empty, all vertices in a wire will be assumed.
7388 theName Object name; when specified, this parameter is used
7389 for result publication in the study. Otherwise, if automatic
7390 publication is switched on, default value is used for result name.
7393 New GEOM.GEOM_Object with modified wire.
7395 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7396 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7397 self._autoPublish(anObj, theName, "fuseEdges")
7400 ## Change orientation of the given object. Updates given shape.
7401 # @param theObject Shape to be processed.
7402 # @return Updated <var>theObject</var>
7404 # @ref swig_todo "Example"
7405 @ManageTransactions("HealOp")
7406 def ChangeOrientationShell(self,theObject):
7408 Change orientation of the given object. Updates given shape.
7411 theObject Shape to be processed.
7416 theObject = self.HealOp.ChangeOrientation(theObject)
7417 RaiseIfFailed("ChangeOrientation", self.HealOp)
7420 ## Change orientation of the given object.
7421 # @param theObject Shape to be processed.
7422 # @param theName Object name; when specified, this parameter is used
7423 # for result publication in the study. Otherwise, if automatic
7424 # publication is switched on, default value is used for result name.
7426 # @return New GEOM.GEOM_Object, containing processed shape.
7428 # @ref swig_todo "Example"
7429 @ManageTransactions("HealOp")
7430 def ChangeOrientationShellCopy(self, theObject, theName=None):
7432 Change orientation of the given object.
7435 theObject Shape to be processed.
7436 theName Object name; when specified, this parameter is used
7437 for result publication in the study. Otherwise, if automatic
7438 publication is switched on, default value is used for result name.
7441 New GEOM.GEOM_Object, containing processed shape.
7443 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7444 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7445 self._autoPublish(anObj, theName, "reversed")
7448 ## Try to limit tolerance of the given object by value \a theTolerance.
7449 # @param theObject Shape to be processed.
7450 # @param theTolerance Required tolerance value.
7451 # @param theName Object name; when specified, this parameter is used
7452 # for result publication in the study. Otherwise, if automatic
7453 # publication is switched on, default value is used for result name.
7455 # @return New GEOM.GEOM_Object, containing processed shape.
7457 # @ref tui_limit_tolerance "Example"
7458 @ManageTransactions("HealOp")
7459 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7461 Try to limit tolerance of the given object by value theTolerance.
7464 theObject Shape to be processed.
7465 theTolerance Required tolerance value.
7466 theName Object name; when specified, this parameter is used
7467 for result publication in the study. Otherwise, if automatic
7468 publication is switched on, default value is used for result name.
7471 New GEOM.GEOM_Object, containing processed shape.
7473 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7474 RaiseIfFailed("LimitTolerance", self.HealOp)
7475 self._autoPublish(anObj, theName, "limitTolerance")
7478 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7479 # that constitute a free boundary of the given shape.
7480 # @param theObject Shape to get free boundary of.
7481 # @param theName Object name; when specified, this parameter is used
7482 # for result publication in the study. Otherwise, if automatic
7483 # publication is switched on, default value is used for result name.
7485 # @return [\a status, \a theClosedWires, \a theOpenWires]
7486 # \n \a status: FALSE, if an error(s) occurred during the method execution.
7487 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7488 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7490 # @ref tui_free_boundaries_page "Example"
7491 @ManageTransactions("HealOp")
7492 def GetFreeBoundary(self, theObject, theName=None):
7494 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7495 that constitute a free boundary of the given shape.
7498 theObject Shape to get free boundary of.
7499 theName Object name; when specified, this parameter is used
7500 for result publication in the study. Otherwise, if automatic
7501 publication is switched on, default value is used for result name.
7504 [status, theClosedWires, theOpenWires]
7505 status: FALSE, if an error(s) occurred during the method execution.
7506 theClosedWires: Closed wires on the free boundary of the given shape.
7507 theOpenWires: Open wires on the free boundary of the given shape.
7509 # Example: see GEOM_TestHealing.py
7510 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7511 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7512 self._autoPublish(anObj[1], theName, "closedWire")
7513 self._autoPublish(anObj[2], theName, "openWire")
7516 ## Replace coincident faces in \a theShapes by one face.
7517 # @param theShapes Initial shapes, either a list or compound of shapes.
7518 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7519 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7520 # otherwise all initial shapes.
7521 # @param theName Object name; when specified, this parameter is used
7522 # for result publication in the study. Otherwise, if automatic
7523 # publication is switched on, default value is used for result name.
7525 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7527 # @ref tui_glue_faces "Example"
7528 @ManageTransactions("ShapesOp")
7529 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7531 Replace coincident faces in theShapes by one face.
7534 theShapes Initial shapes, either a list or compound of shapes.
7535 theTolerance Maximum distance between faces, which can be considered as coincident.
7536 doKeepNonSolids If FALSE, only solids will present in the result,
7537 otherwise all initial shapes.
7538 theName Object name; when specified, this parameter is used
7539 for result publication in the study. Otherwise, if automatic
7540 publication is switched on, default value is used for result name.
7543 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7545 # Example: see GEOM_Spanner.py
7546 theTolerance,Parameters = ParseParameters(theTolerance)
7547 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7549 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7550 anObj.SetParameters(Parameters)
7551 self._autoPublish(anObj, theName, "glueFaces")
7554 ## Find coincident faces in \a theShapes for possible gluing.
7555 # @param theShapes Initial shapes, either a list or compound of shapes.
7556 # @param theTolerance Maximum distance between faces,
7557 # which can be considered as coincident.
7558 # @param theName Object name; when specified, this parameter is used
7559 # for result publication in the study. Otherwise, if automatic
7560 # publication is switched on, default value is used for result name.
7562 # @return GEOM.ListOfGO
7564 # @ref tui_glue_faces "Example"
7565 @ManageTransactions("ShapesOp")
7566 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7568 Find coincident faces in theShapes for possible gluing.
7571 theShapes Initial shapes, either a list or compound of shapes.
7572 theTolerance Maximum distance between faces,
7573 which can be considered as coincident.
7574 theName Object name; when specified, this parameter is used
7575 for result publication in the study. Otherwise, if automatic
7576 publication is switched on, default value is used for result name.
7581 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7582 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7583 self._autoPublish(anObj, theName, "facesToGlue")
7586 ## Replace coincident faces in \a theShapes by one face
7587 # in compliance with given list of faces
7588 # @param theShapes Initial shapes, either a list or compound of shapes.
7589 # @param theTolerance Maximum distance between faces,
7590 # which can be considered as coincident.
7591 # @param theFaces List of faces for gluing.
7592 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7593 # otherwise all initial shapes.
7594 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7595 # will be glued, otherwise only the edges,
7596 # belonging to <VAR>theFaces</VAR>.
7597 # @param theName Object name; when specified, this parameter is used
7598 # for result publication in the study. Otherwise, if automatic
7599 # publication is switched on, default value is used for result name.
7601 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7603 # @ref tui_glue_faces "Example"
7604 @ManageTransactions("ShapesOp")
7605 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7606 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7608 Replace coincident faces in theShapes by one face
7609 in compliance with given list of faces
7612 theShapes theShapes Initial shapes, either a list or compound of shapes.
7613 theTolerance Maximum distance between faces,
7614 which can be considered as coincident.
7615 theFaces List of faces for gluing.
7616 doKeepNonSolids If FALSE, only solids will present in the result,
7617 otherwise all initial shapes.
7618 doGlueAllEdges If TRUE, all coincident edges of theShape
7619 will be glued, otherwise only the edges,
7620 belonging to theFaces.
7621 theName Object name; when specified, this parameter is used
7622 for result publication in the study. Otherwise, if automatic
7623 publication is switched on, default value is used for result name.
7626 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7628 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7629 doKeepNonSolids, doGlueAllEdges)
7631 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7632 self._autoPublish(anObj, theName, "glueFaces")
7635 ## Replace coincident edges in \a theShapes by one edge.
7636 # @param theShapes Initial shapes, either a list or compound of shapes.
7637 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7638 # @param theName Object name; when specified, this parameter is used
7639 # for result publication in the study. Otherwise, if automatic
7640 # publication is switched on, default value is used for result name.
7642 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7644 # @ref tui_glue_edges "Example"
7645 @ManageTransactions("ShapesOp")
7646 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7648 Replace coincident edges in theShapes by one edge.
7651 theShapes Initial shapes, either a list or compound of shapes.
7652 theTolerance Maximum distance between edges, which can be considered as coincident.
7653 theName Object name; when specified, this parameter is used
7654 for result publication in the study. Otherwise, if automatic
7655 publication is switched on, default value is used for result name.
7658 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7660 theTolerance,Parameters = ParseParameters(theTolerance)
7661 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7663 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7664 anObj.SetParameters(Parameters)
7665 self._autoPublish(anObj, theName, "glueEdges")
7668 ## Find coincident edges in \a theShapes for possible gluing.
7669 # @param theShapes Initial shapes, either a list or compound of shapes.
7670 # @param theTolerance Maximum distance between edges,
7671 # which can be considered as coincident.
7672 # @param theName Object name; when specified, this parameter is used
7673 # for result publication in the study. Otherwise, if automatic
7674 # publication is switched on, default value is used for result name.
7676 # @return GEOM.ListOfGO
7678 # @ref tui_glue_edges "Example"
7679 @ManageTransactions("ShapesOp")
7680 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7682 Find coincident edges in theShapes for possible gluing.
7685 theShapes Initial shapes, either a list or compound of shapes.
7686 theTolerance Maximum distance between edges,
7687 which can be considered as coincident.
7688 theName Object name; when specified, this parameter is used
7689 for result publication in the study. Otherwise, if automatic
7690 publication is switched on, default value is used for result name.
7695 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7696 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7697 self._autoPublish(anObj, theName, "edgesToGlue")
7700 ## Replace coincident edges in theShapes by one edge
7701 # in compliance with given list of edges.
7702 # @param theShapes Initial shapes, either a list or compound of shapes.
7703 # @param theTolerance Maximum distance between edges,
7704 # which can be considered as coincident.
7705 # @param theEdges List of edges for gluing.
7706 # @param theName Object name; when specified, this parameter is used
7707 # for result publication in the study. Otherwise, if automatic
7708 # publication is switched on, default value is used for result name.
7710 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7712 # @ref tui_glue_edges "Example"
7713 @ManageTransactions("ShapesOp")
7714 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7716 Replace coincident edges in theShapes by one edge
7717 in compliance with given list of edges.
7720 theShapes Initial shapes, either a list or compound of shapes.
7721 theTolerance Maximum distance between edges,
7722 which can be considered as coincident.
7723 theEdges List of edges for gluing.
7724 theName Object name; when specified, this parameter is used
7725 for result publication in the study. Otherwise, if automatic
7726 publication is switched on, default value is used for result name.
7729 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7731 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7733 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7734 self._autoPublish(anObj, theName, "glueEdges")
7740 ## @addtogroup l3_boolean Boolean Operations
7743 # -----------------------------------------------------------------------------
7744 # Boolean (Common, Cut, Fuse, Section)
7745 # -----------------------------------------------------------------------------
7747 ## Perform one of boolean operations on two given shapes.
7748 # @param theShape1 First argument for boolean operation.
7749 # @param theShape2 Second argument for boolean operation.
7750 # @param theOperation Indicates the operation to be done:\n
7751 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7752 # @param checkSelfInte The flag that tells if the arguments should
7753 # be checked for self-intersection prior to the operation.
7754 # @param theName Object name; when specified, this parameter is used
7755 # for result publication in the study. Otherwise, if automatic
7756 # publication is switched on, default value is used for result name.
7758 # @note This algorithm doesn't find all types of self-intersections.
7759 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7760 # vertex/face and edge/face intersections. Face/face
7761 # intersections detection is switched off as it is a
7762 # time-consuming operation that gives an impact on performance.
7763 # To find all self-intersections please use
7764 # CheckSelfIntersections() method.
7766 # @return New GEOM.GEOM_Object, containing the result shape.
7768 # @ref tui_fuse "Example"
7769 @ManageTransactions("BoolOp")
7770 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7772 Perform one of boolean operations on two given shapes.
7775 theShape1 First argument for boolean operation.
7776 theShape2 Second argument for boolean operation.
7777 theOperation Indicates the operation to be done:
7778 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7779 checkSelfInte The flag that tells if the arguments should
7780 be checked for self-intersection prior to
7782 theName Object name; when specified, this parameter is used
7783 for result publication in the study. Otherwise, if automatic
7784 publication is switched on, default value is used for result name.
7787 This algorithm doesn't find all types of self-intersections.
7788 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7789 vertex/face and edge/face intersections. Face/face
7790 intersections detection is switched off as it is a
7791 time-consuming operation that gives an impact on performance.
7792 To find all self-intersections please use
7793 CheckSelfIntersections() method.
7796 New GEOM.GEOM_Object, containing the result shape.
7798 # Example: see GEOM_TestAll.py
7799 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7800 RaiseIfFailed("MakeBoolean", self.BoolOp)
7801 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7802 self._autoPublish(anObj, theName, def_names[theOperation])
7805 ## Perform Common boolean operation on two given shapes.
7806 # @param theShape1 First argument for boolean operation.
7807 # @param theShape2 Second argument for boolean operation.
7808 # @param checkSelfInte The flag that tells if the arguments should
7809 # be checked for self-intersection prior to the operation.
7810 # @param theName Object name; when specified, this parameter is used
7811 # for result publication in the study. Otherwise, if automatic
7812 # publication is switched on, default value is used for result name.
7814 # @note This algorithm doesn't find all types of self-intersections.
7815 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7816 # vertex/face and edge/face intersections. Face/face
7817 # intersections detection is switched off as it is a
7818 # time-consuming operation that gives an impact on performance.
7819 # To find all self-intersections please use
7820 # CheckSelfIntersections() method.
7822 # @return New GEOM.GEOM_Object, containing the result shape.
7824 # @ref tui_common "Example 1"
7825 # \n @ref swig_MakeCommon "Example 2"
7826 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7828 Perform Common boolean operation on two given shapes.
7831 theShape1 First argument for boolean operation.
7832 theShape2 Second argument for boolean operation.
7833 checkSelfInte The flag that tells if the arguments should
7834 be checked for self-intersection prior to
7836 theName Object name; when specified, this parameter is used
7837 for result publication in the study. Otherwise, if automatic
7838 publication is switched on, default value is used for result name.
7841 This algorithm doesn't find all types of self-intersections.
7842 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7843 vertex/face and edge/face intersections. Face/face
7844 intersections detection is switched off as it is a
7845 time-consuming operation that gives an impact on performance.
7846 To find all self-intersections please use
7847 CheckSelfIntersections() method.
7850 New GEOM.GEOM_Object, containing the result shape.
7852 # Example: see GEOM_TestOthers.py
7853 # note: auto-publishing is done in self.MakeBoolean()
7854 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7856 ## Perform Cut boolean operation on two given shapes.
7857 # @param theShape1 First argument for boolean operation.
7858 # @param theShape2 Second argument for boolean operation.
7859 # @param checkSelfInte The flag that tells if the arguments should
7860 # be checked for self-intersection prior to the operation.
7861 # @param theName Object name; when specified, this parameter is used
7862 # for result publication in the study. Otherwise, if automatic
7863 # publication is switched on, default value is used for result name.
7865 # @note This algorithm doesn't find all types of self-intersections.
7866 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7867 # vertex/face and edge/face intersections. Face/face
7868 # intersections detection is switched off as it is a
7869 # time-consuming operation that gives an impact on performance.
7870 # To find all self-intersections please use
7871 # CheckSelfIntersections() method.
7873 # @return New GEOM.GEOM_Object, containing the result shape.
7875 # @ref tui_cut "Example 1"
7876 # \n @ref swig_MakeCommon "Example 2"
7877 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7879 Perform Cut boolean operation on two given shapes.
7882 theShape1 First argument for boolean operation.
7883 theShape2 Second argument for boolean operation.
7884 checkSelfInte The flag that tells if the arguments should
7885 be checked for self-intersection prior to
7887 theName Object name; when specified, this parameter is used
7888 for result publication in the study. Otherwise, if automatic
7889 publication is switched on, default value is used for result name.
7892 This algorithm doesn't find all types of self-intersections.
7893 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7894 vertex/face and edge/face intersections. Face/face
7895 intersections detection is switched off as it is a
7896 time-consuming operation that gives an impact on performance.
7897 To find all self-intersections please use
7898 CheckSelfIntersections() method.
7901 New GEOM.GEOM_Object, containing the result shape.
7904 # Example: see GEOM_TestOthers.py
7905 # note: auto-publishing is done in self.MakeBoolean()
7906 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7908 ## Perform Fuse boolean operation on two given shapes.
7909 # @param theShape1 First argument for boolean operation.
7910 # @param theShape2 Second argument for boolean operation.
7911 # @param checkSelfInte The flag that tells if the arguments should
7912 # be checked for self-intersection prior to the operation.
7913 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7914 # operation should be performed during the operation.
7915 # @param theName Object name; when specified, this parameter is used
7916 # for result publication in the study. Otherwise, if automatic
7917 # publication is switched on, default value is used for result name.
7919 # @note This algorithm doesn't find all types of self-intersections.
7920 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7921 # vertex/face and edge/face intersections. Face/face
7922 # intersections detection is switched off as it is a
7923 # time-consuming operation that gives an impact on performance.
7924 # To find all self-intersections please use
7925 # CheckSelfIntersections() method.
7927 # @return New GEOM.GEOM_Object, containing the result shape.
7929 # @ref tui_fuse "Example 1"
7930 # \n @ref swig_MakeCommon "Example 2"
7931 @ManageTransactions("BoolOp")
7932 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7933 rmExtraEdges=False, theName=None):
7935 Perform Fuse boolean operation on two given shapes.
7938 theShape1 First argument for boolean operation.
7939 theShape2 Second argument for boolean operation.
7940 checkSelfInte The flag that tells if the arguments should
7941 be checked for self-intersection prior to
7943 rmExtraEdges The flag that tells if Remove Extra Edges
7944 operation should be performed during the operation.
7945 theName Object name; when specified, this parameter is used
7946 for result publication in the study. Otherwise, if automatic
7947 publication is switched on, default value is used for result name.
7950 This algorithm doesn't find all types of self-intersections.
7951 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7952 vertex/face and edge/face intersections. Face/face
7953 intersections detection is switched off as it is a
7954 time-consuming operation that gives an impact on performance.
7955 To find all self-intersections please use
7956 CheckSelfIntersections() method.
7959 New GEOM.GEOM_Object, containing the result shape.
7962 # Example: see GEOM_TestOthers.py
7963 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7964 checkSelfInte, rmExtraEdges)
7965 RaiseIfFailed("MakeFuse", self.BoolOp)
7966 self._autoPublish(anObj, theName, "fuse")
7969 ## Perform Section boolean operation on two given shapes.
7970 # @param theShape1 First argument for boolean operation.
7971 # @param theShape2 Second argument for boolean operation.
7972 # @param checkSelfInte The flag that tells if the arguments should
7973 # be checked for self-intersection prior to the operation.
7974 # If a self-intersection detected the operation fails.
7975 # @param theName Object name; when specified, this parameter is used
7976 # for result publication in the study. Otherwise, if automatic
7977 # publication is switched on, default value is used for result name.
7978 # @return New GEOM.GEOM_Object, containing the result shape.
7980 # @ref tui_section "Example 1"
7981 # \n @ref swig_MakeCommon "Example 2"
7982 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7984 Perform Section boolean operation on two given shapes.
7987 theShape1 First argument for boolean operation.
7988 theShape2 Second argument for boolean operation.
7989 checkSelfInte The flag that tells if the arguments should
7990 be checked for self-intersection prior to the operation.
7991 If a self-intersection detected the operation fails.
7992 theName Object name; when specified, this parameter is used
7993 for result publication in the study. Otherwise, if automatic
7994 publication is switched on, default value is used for result name.
7996 New GEOM.GEOM_Object, containing the result shape.
7999 # Example: see GEOM_TestOthers.py
8000 # note: auto-publishing is done in self.MakeBoolean()
8001 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
8003 ## Perform Fuse boolean operation on the list of shapes.
8004 # @param theShapesList Shapes to be fused.
8005 # @param checkSelfInte The flag that tells if the arguments should
8006 # be checked for self-intersection prior to the operation.
8007 # @param rmExtraEdges The flag that tells if Remove Extra Edges
8008 # operation should be performed during the operation.
8009 # @param theName Object name; when specified, this parameter is used
8010 # for result publication in the study. Otherwise, if automatic
8011 # publication is switched on, default value is used for result name.
8013 # @note This algorithm doesn't find all types of self-intersections.
8014 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8015 # vertex/face and edge/face intersections. Face/face
8016 # intersections detection is switched off as it is a
8017 # time-consuming operation that gives an impact on performance.
8018 # To find all self-intersections please use
8019 # CheckSelfIntersections() method.
8021 # @return New GEOM.GEOM_Object, containing the result shape.
8023 # @ref tui_fuse "Example 1"
8024 # \n @ref swig_MakeCommon "Example 2"
8025 @ManageTransactions("BoolOp")
8026 def MakeFuseList(self, theShapesList, checkSelfInte=False,
8027 rmExtraEdges=False, theName=None):
8029 Perform Fuse boolean operation on the list of shapes.
8032 theShapesList Shapes to be fused.
8033 checkSelfInte The flag that tells if the arguments should
8034 be checked for self-intersection prior to
8036 rmExtraEdges The flag that tells if Remove Extra Edges
8037 operation should be performed during the operation.
8038 theName Object name; when specified, this parameter is used
8039 for result publication in the study. Otherwise, if automatic
8040 publication is switched on, default value is used for result name.
8043 This algorithm doesn't find all types of self-intersections.
8044 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8045 vertex/face and edge/face intersections. Face/face
8046 intersections detection is switched off as it is a
8047 time-consuming operation that gives an impact on performance.
8048 To find all self-intersections please use
8049 CheckSelfIntersections() method.
8052 New GEOM.GEOM_Object, containing the result shape.
8055 # Example: see GEOM_TestOthers.py
8056 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8058 RaiseIfFailed("MakeFuseList", self.BoolOp)
8059 self._autoPublish(anObj, theName, "fuse")
8062 ## Perform Common boolean operation on the list of shapes.
8063 # @param theShapesList Shapes for Common operation.
8064 # @param checkSelfInte The flag that tells if the arguments should
8065 # be checked for self-intersection prior to the operation.
8066 # @param theName Object name; when specified, this parameter is used
8067 # for result publication in the study. Otherwise, if automatic
8068 # publication is switched on, default value is used for result name.
8070 # @note This algorithm doesn't find all types of self-intersections.
8071 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8072 # vertex/face and edge/face intersections. Face/face
8073 # intersections detection is switched off as it is a
8074 # time-consuming operation that gives an impact on performance.
8075 # To find all self-intersections please use
8076 # CheckSelfIntersections() method.
8078 # @return New GEOM.GEOM_Object, containing the result shape.
8080 # @ref tui_common "Example 1"
8081 # \n @ref swig_MakeCommon "Example 2"
8082 @ManageTransactions("BoolOp")
8083 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8085 Perform Common boolean operation on the list of shapes.
8088 theShapesList Shapes for Common operation.
8089 checkSelfInte The flag that tells if the arguments should
8090 be checked for self-intersection prior to
8092 theName Object name; when specified, this parameter is used
8093 for result publication in the study. Otherwise, if automatic
8094 publication is switched on, default value is used for result name.
8097 This algorithm doesn't find all types of self-intersections.
8098 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8099 vertex/face and edge/face intersections. Face/face
8100 intersections detection is switched off as it is a
8101 time-consuming operation that gives an impact on performance.
8102 To find all self-intersections please use
8103 CheckSelfIntersections() method.
8106 New GEOM.GEOM_Object, containing the result shape.
8109 # Example: see GEOM_TestOthers.py
8110 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8111 RaiseIfFailed("MakeCommonList", self.BoolOp)
8112 self._autoPublish(anObj, theName, "common")
8115 ## Perform Cut boolean operation on one object and the list of tools.
8116 # @param theMainShape The object of the operation.
8117 # @param theShapesList The list of tools of the operation.
8118 # @param checkSelfInte The flag that tells if the arguments should
8119 # be checked for self-intersection prior to the operation.
8120 # @param theName Object name; when specified, this parameter is used
8121 # for result publication in the study. Otherwise, if automatic
8122 # publication is switched on, default value is used for result name.
8124 # @note This algorithm doesn't find all types of self-intersections.
8125 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8126 # vertex/face and edge/face intersections. Face/face
8127 # intersections detection is switched off as it is a
8128 # time-consuming operation that gives an impact on performance.
8129 # To find all self-intersections please use
8130 # CheckSelfIntersections() method.
8132 # @return New GEOM.GEOM_Object, containing the result shape.
8134 # @ref tui_cut "Example 1"
8135 # \n @ref swig_MakeCommon "Example 2"
8136 @ManageTransactions("BoolOp")
8137 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8139 Perform Cut boolean operation on one object and the list of tools.
8142 theMainShape The object of the operation.
8143 theShapesList The list of tools of the operation.
8144 checkSelfInte The flag that tells if the arguments should
8145 be checked for self-intersection prior to
8147 theName Object name; when specified, this parameter is used
8148 for result publication in the study. Otherwise, if automatic
8149 publication is switched on, default value is used for result name.
8152 This algorithm doesn't find all types of self-intersections.
8153 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8154 vertex/face and edge/face intersections. Face/face
8155 intersections detection is switched off as it is a
8156 time-consuming operation that gives an impact on performance.
8157 To find all self-intersections please use
8158 CheckSelfIntersections() method.
8161 New GEOM.GEOM_Object, containing the result shape.
8164 # Example: see GEOM_TestOthers.py
8165 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8166 RaiseIfFailed("MakeCutList", self.BoolOp)
8167 self._autoPublish(anObj, theName, "cut")
8173 ## @addtogroup l3_basic_op
8176 ## Perform partition operation.
8177 # @param ListShapes Shapes to be intersected.
8178 # @param ListTools Shapes to intersect theShapes.
8179 # @param Limit Type of resulting shapes (see ShapeType()).\n
8180 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8181 # type will be detected automatically.
8182 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8183 # target type (equal to Limit) are kept in the result,
8184 # else standalone shapes of lower dimension
8185 # are kept also (if they exist).
8187 # @param theName Object name; when specified, this parameter is used
8188 # for result publication in the study. Otherwise, if automatic
8189 # publication is switched on, default value is used for result name.
8191 # @note Each compound from ListShapes and ListTools will be exploded
8192 # in order to avoid possible intersection between shapes from this compound.
8194 # After implementation new version of PartitionAlgo (October 2006)
8195 # other parameters are ignored by current functionality. They are kept
8196 # in this function only for support old versions.
8197 # @param ListKeepInside Shapes, outside which the results will be deleted.
8198 # Each shape from theKeepInside must belong to theShapes also.
8199 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8200 # Each shape from theRemoveInside must belong to theShapes also.
8201 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8202 # @param ListMaterials Material indices for each shape. Make sense,
8203 # only if theRemoveWebs is TRUE.
8205 # @return New GEOM.GEOM_Object, containing the result shapes.
8207 # @ref tui_partition "Example"
8208 @ManageTransactions("BoolOp")
8209 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8210 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8211 KeepNonlimitShapes=0, theName=None):
8213 Perform partition operation.
8216 ListShapes Shapes to be intersected.
8217 ListTools Shapes to intersect theShapes.
8218 Limit Type of resulting shapes (see geompy.ShapeType)
8219 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8220 type will be detected automatically.
8221 KeepNonlimitShapes if this parameter == 0, then only shapes of
8222 target type (equal to Limit) are kept in the result,
8223 else standalone shapes of lower dimension
8224 are kept also (if they exist).
8226 theName Object name; when specified, this parameter is used
8227 for result publication in the study. Otherwise, if automatic
8228 publication is switched on, default value is used for result name.
8230 Each compound from ListShapes and ListTools will be exploded
8231 in order to avoid possible intersection between shapes from
8234 After implementation new version of PartitionAlgo (October 2006) other
8235 parameters are ignored by current functionality. They are kept in this
8236 function only for support old versions.
8239 ListKeepInside Shapes, outside which the results will be deleted.
8240 Each shape from theKeepInside must belong to theShapes also.
8241 ListRemoveInside Shapes, inside which the results will be deleted.
8242 Each shape from theRemoveInside must belong to theShapes also.
8243 RemoveWebs If TRUE, perform Glue 3D algorithm.
8244 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8247 New GEOM.GEOM_Object, containing the result shapes.
8249 # Example: see GEOM_TestAll.py
8250 if Limit == self.ShapeType["AUTO"]:
8251 # automatic detection of the most appropriate shape limit type
8253 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8254 Limit = EnumToLong(lim)
8256 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8257 ListKeepInside, ListRemoveInside,
8258 Limit, RemoveWebs, ListMaterials,
8259 KeepNonlimitShapes);
8260 RaiseIfFailed("MakePartition", self.BoolOp)
8261 self._autoPublish(anObj, theName, "partition")
8264 ## Perform partition operation.
8265 # This method may be useful if it is needed to make a partition for
8266 # compound contains nonintersected shapes. Performance will be better
8267 # since intersection between shapes from compound is not performed.
8269 # Description of all parameters as in previous method MakePartition().
8270 # One additional parameter is provided:
8271 # @param checkSelfInte The flag that tells if the arguments should
8272 # be checked for self-intersection prior to the operation.
8274 # @note This algorithm doesn't find all types of self-intersections.
8275 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8276 # vertex/face and edge/face intersections. Face/face
8277 # intersections detection is switched off as it is a
8278 # time-consuming operation that gives an impact on performance.
8279 # To find all self-intersections please use
8280 # CheckSelfIntersections() method.
8282 # @note Passed compounds (via ListShapes or via ListTools)
8283 # have to consist of nonintersecting shapes.
8285 # @return New GEOM.GEOM_Object, containing the result shapes.
8287 # @ref swig_todo "Example"
8288 @ManageTransactions("BoolOp")
8289 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8290 ListKeepInside=[], ListRemoveInside=[],
8291 Limit=ShapeType["AUTO"], RemoveWebs=0,
8292 ListMaterials=[], KeepNonlimitShapes=0,
8293 checkSelfInte=False, theName=None):
8295 Perform partition operation.
8296 This method may be useful if it is needed to make a partition for
8297 compound contains nonintersected shapes. Performance will be better
8298 since intersection between shapes from compound is not performed.
8301 Description of all parameters as in method geompy.MakePartition.
8302 One additional parameter is provided:
8303 checkSelfInte The flag that tells if the arguments should
8304 be checked for self-intersection prior to
8308 This algorithm doesn't find all types of self-intersections.
8309 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8310 vertex/face and edge/face intersections. Face/face
8311 intersections detection is switched off as it is a
8312 time-consuming operation that gives an impact on performance.
8313 To find all self-intersections please use
8314 CheckSelfIntersections() method.
8317 Passed compounds (via ListShapes or via ListTools)
8318 have to consist of nonintersecting shapes.
8321 New GEOM.GEOM_Object, containing the result shapes.
8323 if Limit == self.ShapeType["AUTO"]:
8324 # automatic detection of the most appropriate shape limit type
8326 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8327 Limit = EnumToLong(lim)
8329 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8330 ListKeepInside, ListRemoveInside,
8331 Limit, RemoveWebs, ListMaterials,
8332 KeepNonlimitShapes, checkSelfInte);
8333 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8334 self._autoPublish(anObj, theName, "partition")
8337 ## See method MakePartition() for more information.
8339 # @ref tui_partition "Example 1"
8340 # \n @ref swig_Partition "Example 2"
8341 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8342 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8343 KeepNonlimitShapes=0, theName=None):
8345 See method geompy.MakePartition for more information.
8347 # Example: see GEOM_TestOthers.py
8348 # note: auto-publishing is done in self.MakePartition()
8349 anObj = self.MakePartition(ListShapes, ListTools,
8350 ListKeepInside, ListRemoveInside,
8351 Limit, RemoveWebs, ListMaterials,
8352 KeepNonlimitShapes, theName);
8355 ## Perform partition of the Shape with the Plane
8356 # @param theShape Shape to be intersected.
8357 # @param thePlane Tool shape, to intersect theShape.
8358 # @param theName Object name; when specified, this parameter is used
8359 # for result publication in the study. Otherwise, if automatic
8360 # publication is switched on, default value is used for result name.
8362 # @return New GEOM.GEOM_Object, containing the result shape.
8364 # @note This operation is a shortcut to the more general @ref MakePartition
8365 # operation, where @a theShape specifies single "object" (shape being partitioned)
8366 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8367 # @ref MakePartition operation have default values:
8368 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8369 # - @a KeepNonlimitShapes: 0
8370 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8371 # @a Materials (obsolete parameters): empty
8373 # @note I.e. the following two operations are equivalent:
8375 # Result = geompy.MakeHalfPartition(Object, Plane)
8376 # Result = geompy.MakePartition([Object], [Plane])
8379 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8381 # @ref tui_partition "Example"
8382 @ManageTransactions("BoolOp")
8383 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8385 Perform partition of the Shape with the Plane
8388 theShape Shape to be intersected.
8389 thePlane Tool shape, to intersect theShape.
8390 theName Object name; when specified, this parameter is used
8391 for result publication in the study. Otherwise, if automatic
8392 publication is switched on, default value is used for result name.
8395 New GEOM.GEOM_Object, containing the result shape.
8397 Note: This operation is a shortcut to the more general MakePartition
8398 operation, where theShape specifies single "object" (shape being partitioned)
8399 and thePlane specifies single "tool" (intersector shape). Other parameters of
8400 MakePartition operation have default values:
8401 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8402 - KeepNonlimitShapes: 0
8403 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8405 I.e. the following two operations are equivalent:
8406 Result = geompy.MakeHalfPartition(Object, Plane)
8407 Result = geompy.MakePartition([Object], [Plane])
8409 # Example: see GEOM_TestAll.py
8410 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8411 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8412 self._autoPublish(anObj, theName, "partition")
8415 # end of l3_basic_op
8418 ## @addtogroup l3_transform
8421 ## Translate the given object along the vector, specified
8422 # by its end points.
8423 # @param theObject The object to be translated.
8424 # @param thePoint1 Start point of translation vector.
8425 # @param thePoint2 End point of translation vector.
8426 # @param theCopy Flag used to translate object itself or create a copy.
8427 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8428 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8429 @ManageTransactions("TrsfOp")
8430 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8432 Translate the given object along the vector, specified by its end points.
8435 theObject The object to be translated.
8436 thePoint1 Start point of translation vector.
8437 thePoint2 End point of translation vector.
8438 theCopy Flag used to translate object itself or create a copy.
8441 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8442 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8445 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8447 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8448 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8451 ## Translate the given object along the vector, specified
8452 # by its end points, creating its copy before the translation.
8453 # @param theObject The object to be translated.
8454 # @param thePoint1 Start point of translation vector.
8455 # @param thePoint2 End point of translation vector.
8456 # @param theName Object name; when specified, this parameter is used
8457 # for result publication in the study. Otherwise, if automatic
8458 # publication is switched on, default value is used for result name.
8460 # @return New GEOM.GEOM_Object, containing the translated object.
8462 # @ref tui_translation "Example 1"
8463 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8464 @ManageTransactions("TrsfOp")
8465 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8467 Translate the given object along the vector, specified
8468 by its end points, creating its copy before the translation.
8471 theObject The object to be translated.
8472 thePoint1 Start point of translation vector.
8473 thePoint2 End point of translation vector.
8474 theName Object name; when specified, this parameter is used
8475 for result publication in the study. Otherwise, if automatic
8476 publication is switched on, default value is used for result name.
8479 New GEOM.GEOM_Object, containing the translated object.
8481 # Example: see GEOM_TestAll.py
8482 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8483 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8484 self._autoPublish(anObj, theName, "translated")
8487 ## Translate the given object along the vector, specified by its components.
8488 # @param theObject The object to be translated.
8489 # @param theDX,theDY,theDZ Components of translation vector.
8490 # @param theCopy Flag used to translate object itself or create a copy.
8491 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8492 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8494 # @ref tui_translation "Example"
8495 @ManageTransactions("TrsfOp")
8496 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8498 Translate the given object along the vector, specified by its components.
8501 theObject The object to be translated.
8502 theDX,theDY,theDZ Components of translation vector.
8503 theCopy Flag used to translate object itself or create a copy.
8506 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8507 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8509 # Example: see GEOM_TestAll.py
8510 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8512 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8514 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8515 anObj.SetParameters(Parameters)
8516 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8519 ## Translate the given object along the vector, specified
8520 # by its components, creating its copy before the translation.
8521 # @param theObject The object to be translated.
8522 # @param theDX,theDY,theDZ Components of translation vector.
8523 # @param theName Object name; when specified, this parameter is used
8524 # for result publication in the study. Otherwise, if automatic
8525 # publication is switched on, default value is used for result name.
8527 # @return New GEOM.GEOM_Object, containing the translated object.
8529 # @ref tui_translation "Example"
8530 @ManageTransactions("TrsfOp")
8531 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8533 Translate the given object along the vector, specified
8534 by its components, creating its copy before the translation.
8537 theObject The object to be translated.
8538 theDX,theDY,theDZ Components of translation vector.
8539 theName Object name; when specified, this parameter is used
8540 for result publication in the study. Otherwise, if automatic
8541 publication is switched on, default value is used for result name.
8544 New GEOM.GEOM_Object, containing the translated object.
8546 # Example: see GEOM_TestAll.py
8547 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8548 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8549 anObj.SetParameters(Parameters)
8550 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8551 self._autoPublish(anObj, theName, "translated")
8554 ## Translate the given object along the given vector.
8555 # @param theObject The object to be translated.
8556 # @param theVector The translation vector.
8557 # @param theCopy Flag used to translate object itself or create a copy.
8558 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8559 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8560 @ManageTransactions("TrsfOp")
8561 def TranslateVector(self, theObject, theVector, theCopy=False):
8563 Translate the given object along the given vector.
8566 theObject The object to be translated.
8567 theVector The translation vector.
8568 theCopy Flag used to translate object itself or create a copy.
8571 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8572 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8575 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8577 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8578 RaiseIfFailed("TranslateVector", self.TrsfOp)
8581 ## Translate the given object along the given vector,
8582 # creating its copy before the translation.
8583 # @param theObject The object to be translated.
8584 # @param theVector The translation vector.
8585 # @param theName Object name; when specified, this parameter is used
8586 # for result publication in the study. Otherwise, if automatic
8587 # publication is switched on, default value is used for result name.
8589 # @return New GEOM.GEOM_Object, containing the translated object.
8591 # @ref tui_translation "Example"
8592 @ManageTransactions("TrsfOp")
8593 def MakeTranslationVector(self, theObject, theVector, theName=None):
8595 Translate the given object along the given vector,
8596 creating its copy before the translation.
8599 theObject The object to be translated.
8600 theVector The translation vector.
8601 theName Object name; when specified, this parameter is used
8602 for result publication in the study. Otherwise, if automatic
8603 publication is switched on, default value is used for result name.
8606 New GEOM.GEOM_Object, containing the translated object.
8608 # Example: see GEOM_TestAll.py
8609 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8610 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8611 self._autoPublish(anObj, theName, "translated")
8614 ## Translate the given object along the given vector on given distance.
8615 # @param theObject The object to be translated.
8616 # @param theVector The translation vector.
8617 # @param theDistance The translation distance.
8618 # @param theCopy Flag used to translate object itself or create a copy.
8619 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8620 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8622 # @ref tui_translation "Example"
8623 @ManageTransactions("TrsfOp")
8624 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8626 Translate the given object along the given vector on given distance.
8629 theObject The object to be translated.
8630 theVector The translation vector.
8631 theDistance The translation distance.
8632 theCopy Flag used to translate object itself or create a copy.
8635 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8636 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8638 # Example: see GEOM_TestAll.py
8639 theDistance,Parameters = ParseParameters(theDistance)
8640 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8641 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8642 anObj.SetParameters(Parameters)
8645 ## Translate the given object along the given vector on given distance,
8646 # creating its copy before the translation.
8647 # @param theObject The object to be translated.
8648 # @param theVector The translation vector.
8649 # @param theDistance The translation distance.
8650 # @param theName Object name; when specified, this parameter is used
8651 # for result publication in the study. Otherwise, if automatic
8652 # publication is switched on, default value is used for result name.
8654 # @return New GEOM.GEOM_Object, containing the translated object.
8656 # @ref tui_translation "Example"
8657 @ManageTransactions("TrsfOp")
8658 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8660 Translate the given object along the given vector on given distance,
8661 creating its copy before the translation.
8664 theObject The object to be translated.
8665 theVector The translation vector.
8666 theDistance The translation distance.
8667 theName Object name; when specified, this parameter is used
8668 for result publication in the study. Otherwise, if automatic
8669 publication is switched on, default value is used for result name.
8672 New GEOM.GEOM_Object, containing the translated object.
8674 # Example: see GEOM_TestAll.py
8675 theDistance,Parameters = ParseParameters(theDistance)
8676 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8677 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8678 anObj.SetParameters(Parameters)
8679 self._autoPublish(anObj, theName, "translated")
8682 ## Rotate the given object around the given axis on the given angle.
8683 # @param theObject The object to be rotated.
8684 # @param theAxis Rotation axis.
8685 # @param theAngle Rotation angle in radians.
8686 # @param theCopy Flag used to rotate object itself or create a copy.
8688 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8689 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8691 # @ref tui_rotation "Example"
8692 @ManageTransactions("TrsfOp")
8693 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8695 Rotate the given object around the given axis on the given angle.
8698 theObject The object to be rotated.
8699 theAxis Rotation axis.
8700 theAngle Rotation angle in radians.
8701 theCopy Flag used to rotate object itself or create a copy.
8704 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8705 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8707 # Example: see GEOM_TestAll.py
8709 if isinstance(theAngle,str):
8711 theAngle, Parameters = ParseParameters(theAngle)
8713 theAngle = theAngle*math.pi/180.0
8715 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8717 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8718 RaiseIfFailed("Rotate", self.TrsfOp)
8719 anObj.SetParameters(Parameters)
8722 ## Rotate the given object around the given axis
8723 # on the given angle, creating its copy before the rotation.
8724 # @param theObject The object to be rotated.
8725 # @param theAxis Rotation axis.
8726 # @param theAngle Rotation angle in radians.
8727 # @param theName Object name; when specified, this parameter is used
8728 # for result publication in the study. Otherwise, if automatic
8729 # publication is switched on, default value is used for result name.
8731 # @return New GEOM.GEOM_Object, containing the rotated object.
8733 # @ref tui_rotation "Example"
8734 @ManageTransactions("TrsfOp")
8735 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8737 Rotate the given object around the given axis
8738 on the given angle, creating its copy before the rotatation.
8741 theObject The object to be rotated.
8742 theAxis Rotation axis.
8743 theAngle Rotation angle in radians.
8744 theName Object name; when specified, this parameter is used
8745 for result publication in the study. Otherwise, if automatic
8746 publication is switched on, default value is used for result name.
8749 New GEOM.GEOM_Object, containing the rotated object.
8751 # Example: see GEOM_TestAll.py
8753 if isinstance(theAngle,str):
8755 theAngle, Parameters = ParseParameters(theAngle)
8757 theAngle = theAngle*math.pi/180.0
8758 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8759 RaiseIfFailed("RotateCopy", self.TrsfOp)
8760 anObj.SetParameters(Parameters)
8761 self._autoPublish(anObj, theName, "rotated")
8764 ## Rotate given object around vector perpendicular to plane
8765 # containing three points.
8766 # @param theObject The object to be rotated.
8767 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8768 # containing the three points.
8769 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8770 # @param theCopy Flag used to rotate object itself or create a copy.
8771 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8772 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8773 @ManageTransactions("TrsfOp")
8774 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8776 Rotate given object around vector perpendicular to plane
8777 containing three points.
8780 theObject The object to be rotated.
8781 theCentPoint central point the axis is the vector perpendicular to the plane
8782 containing the three points.
8783 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8784 theCopy Flag used to rotate object itself or create a copy.
8787 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8788 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8791 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8793 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8794 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8797 ## Rotate given object around vector perpendicular to plane
8798 # containing three points, creating its copy before the rotatation.
8799 # @param theObject The object to be rotated.
8800 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8801 # containing the three points.
8802 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8803 # @param theName Object name; when specified, this parameter is used
8804 # for result publication in the study. Otherwise, if automatic
8805 # publication is switched on, default value is used for result name.
8807 # @return New GEOM.GEOM_Object, containing the rotated object.
8809 # @ref tui_rotation "Example"
8810 @ManageTransactions("TrsfOp")
8811 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8813 Rotate given object around vector perpendicular to plane
8814 containing three points, creating its copy before the rotatation.
8817 theObject The object to be rotated.
8818 theCentPoint central point the axis is the vector perpendicular to the plane
8819 containing the three points.
8820 thePoint1,thePoint2 in a perpendicular plane of the axis.
8821 theName Object name; when specified, this parameter is used
8822 for result publication in the study. Otherwise, if automatic
8823 publication is switched on, default value is used for result name.
8826 New GEOM.GEOM_Object, containing the rotated object.
8828 # Example: see GEOM_TestAll.py
8829 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8830 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8831 self._autoPublish(anObj, theName, "rotated")
8834 ## Scale the given object by the specified factor.
8835 # @param theObject The object to be scaled.
8836 # @param thePoint Center point for scaling.
8837 # Passing None for it means scaling relatively the origin of global CS.
8838 # @param theFactor Scaling factor value.
8839 # @param theCopy Flag used to scale object itself or create a copy.
8840 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8841 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8842 @ManageTransactions("TrsfOp")
8843 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8845 Scale the given object by the specified factor.
8848 theObject The object to be scaled.
8849 thePoint Center point for scaling.
8850 Passing None for it means scaling relatively the origin of global CS.
8851 theFactor Scaling factor value.
8852 theCopy Flag used to scale object itself or create a copy.
8855 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8856 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8858 # Example: see GEOM_TestAll.py
8859 theFactor, Parameters = ParseParameters(theFactor)
8861 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8863 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8864 RaiseIfFailed("Scale", self.TrsfOp)
8865 anObj.SetParameters(Parameters)
8868 ## Scale the given object by the factor, creating its copy before the scaling.
8869 # @param theObject The object to be scaled.
8870 # @param thePoint Center point for scaling.
8871 # Passing None for it means scaling relatively the origin of global CS.
8872 # @param theFactor Scaling factor value.
8873 # @param theName Object name; when specified, this parameter is used
8874 # for result publication in the study. Otherwise, if automatic
8875 # publication is switched on, default value is used for result name.
8877 # @return New GEOM.GEOM_Object, containing the scaled shape.
8879 # @ref tui_scale "Example"
8880 @ManageTransactions("TrsfOp")
8881 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8883 Scale the given object by the factor, creating its copy before the scaling.
8886 theObject The object to be scaled.
8887 thePoint Center point for scaling.
8888 Passing None for it means scaling relatively the origin of global CS.
8889 theFactor Scaling factor value.
8890 theName Object name; when specified, this parameter is used
8891 for result publication in the study. Otherwise, if automatic
8892 publication is switched on, default value is used for result name.
8895 New GEOM.GEOM_Object, containing the scaled shape.
8897 # Example: see GEOM_TestAll.py
8898 theFactor, Parameters = ParseParameters(theFactor)
8899 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8900 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8901 anObj.SetParameters(Parameters)
8902 self._autoPublish(anObj, theName, "scaled")
8905 ## Scale the given object by different factors along coordinate axes.
8906 # @param theObject The object to be scaled.
8907 # @param thePoint Center point for scaling.
8908 # Passing None for it means scaling relatively the origin of global CS.
8909 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8910 # @param theCopy Flag used to scale object itself or create a copy.
8911 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8912 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8913 @ManageTransactions("TrsfOp")
8914 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8916 Scale the given object by different factors along coordinate axes.
8919 theObject The object to be scaled.
8920 thePoint Center point for scaling.
8921 Passing None for it means scaling relatively the origin of global CS.
8922 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8923 theCopy Flag used to scale object itself or create a copy.
8926 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8927 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8929 # Example: see GEOM_TestAll.py
8930 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8932 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8933 theFactorX, theFactorY, theFactorZ)
8935 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8936 theFactorX, theFactorY, theFactorZ)
8937 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8938 anObj.SetParameters(Parameters)
8941 ## Scale the given object by different factors along coordinate axes,
8942 # creating its copy before the scaling.
8943 # @param theObject The object to be scaled.
8944 # @param thePoint Center point for scaling.
8945 # Passing None for it means scaling relatively the origin of global CS.
8946 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8947 # @param theName Object name; when specified, this parameter is used
8948 # for result publication in the study. Otherwise, if automatic
8949 # publication is switched on, default value is used for result name.
8951 # @return New GEOM.GEOM_Object, containing the scaled shape.
8953 # @ref swig_scale "Example"
8954 @ManageTransactions("TrsfOp")
8955 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8957 Scale the given object by different factors along coordinate axes,
8958 creating its copy before the scaling.
8961 theObject The object to be scaled.
8962 thePoint Center point for scaling.
8963 Passing None for it means scaling relatively the origin of global CS.
8964 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8965 theName Object name; when specified, this parameter is used
8966 for result publication in the study. Otherwise, if automatic
8967 publication is switched on, default value is used for result name.
8970 New GEOM.GEOM_Object, containing the scaled shape.
8972 # Example: see GEOM_TestAll.py
8973 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8974 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8975 theFactorX, theFactorY, theFactorZ)
8976 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8977 anObj.SetParameters(Parameters)
8978 self._autoPublish(anObj, theName, "scaled")
8981 ## Mirror an object relatively the given plane.
8982 # @param theObject The object to be mirrored.
8983 # @param thePlane Plane of symmetry.
8984 # @param theCopy Flag used to mirror object itself or create a copy.
8985 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8986 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8987 @ManageTransactions("TrsfOp")
8988 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8990 Mirror an object relatively the given plane.
8993 theObject The object to be mirrored.
8994 thePlane Plane of symmetry.
8995 theCopy Flag used to mirror object itself or create a copy.
8998 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8999 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9002 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9004 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
9005 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
9008 ## Create an object, symmetrical
9009 # to the given one relatively the given plane.
9010 # @param theObject The object to be mirrored.
9011 # @param thePlane Plane of symmetry.
9012 # @param theName Object name; when specified, this parameter is used
9013 # for result publication in the study. Otherwise, if automatic
9014 # publication is switched on, default value is used for result name.
9016 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9018 # @ref tui_mirror "Example"
9019 @ManageTransactions("TrsfOp")
9020 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9022 Create an object, symmetrical to the given one relatively the given plane.
9025 theObject The object to be mirrored.
9026 thePlane Plane of symmetry.
9027 theName Object name; when specified, this parameter is used
9028 for result publication in the study. Otherwise, if automatic
9029 publication is switched on, default value is used for result name.
9032 New GEOM.GEOM_Object, containing the mirrored shape.
9034 # Example: see GEOM_TestAll.py
9035 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9036 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9037 self._autoPublish(anObj, theName, "mirrored")
9040 ## Mirror an object relatively the given axis.
9041 # @param theObject The object to be mirrored.
9042 # @param theAxis Axis of symmetry.
9043 # @param theCopy Flag used to mirror object itself or create a copy.
9044 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9045 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9046 @ManageTransactions("TrsfOp")
9047 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9049 Mirror an object relatively the given axis.
9052 theObject The object to be mirrored.
9053 theAxis Axis of symmetry.
9054 theCopy Flag used to mirror object itself or create a copy.
9057 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9058 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9061 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9063 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9064 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9067 ## Create an object, symmetrical
9068 # to the given one relatively the given axis.
9069 # @param theObject The object to be mirrored.
9070 # @param theAxis Axis of symmetry.
9071 # @param theName Object name; when specified, this parameter is used
9072 # for result publication in the study. Otherwise, if automatic
9073 # publication is switched on, default value is used for result name.
9075 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9077 # @ref tui_mirror "Example"
9078 @ManageTransactions("TrsfOp")
9079 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9081 Create an object, symmetrical to the given one relatively the given axis.
9084 theObject The object to be mirrored.
9085 theAxis Axis of symmetry.
9086 theName Object name; when specified, this parameter is used
9087 for result publication in the study. Otherwise, if automatic
9088 publication is switched on, default value is used for result name.
9091 New GEOM.GEOM_Object, containing the mirrored shape.
9093 # Example: see GEOM_TestAll.py
9094 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9095 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9096 self._autoPublish(anObj, theName, "mirrored")
9099 ## Mirror an object relatively the given point.
9100 # @param theObject The object to be mirrored.
9101 # @param thePoint Point of symmetry.
9102 # @param theCopy Flag used to mirror object itself or create a copy.
9103 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9104 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9105 @ManageTransactions("TrsfOp")
9106 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9108 Mirror an object relatively the given point.
9111 theObject The object to be mirrored.
9112 thePoint Point of symmetry.
9113 theCopy Flag used to mirror object itself or create a copy.
9116 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9117 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9119 # Example: see GEOM_TestAll.py
9121 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9123 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9124 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9127 ## Create an object, symmetrical
9128 # to the given one relatively the given point.
9129 # @param theObject The object to be mirrored.
9130 # @param thePoint Point of symmetry.
9131 # @param theName Object name; when specified, this parameter is used
9132 # for result publication in the study. Otherwise, if automatic
9133 # publication is switched on, default value is used for result name.
9135 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9137 # @ref tui_mirror "Example"
9138 @ManageTransactions("TrsfOp")
9139 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9141 Create an object, symmetrical
9142 to the given one relatively the given point.
9145 theObject The object to be mirrored.
9146 thePoint Point of symmetry.
9147 theName Object name; when specified, this parameter is used
9148 for result publication in the study. Otherwise, if automatic
9149 publication is switched on, default value is used for result name.
9152 New GEOM.GEOM_Object, containing the mirrored shape.
9154 # Example: see GEOM_TestAll.py
9155 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9156 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9157 self._autoPublish(anObj, theName, "mirrored")
9160 ## Modify the location of the given object.
9161 # @param theObject The object to be displaced.
9162 # @param theStartLCS Coordinate system to perform displacement from it.\n
9163 # If \a theStartLCS is NULL, displacement
9164 # will be performed from global CS.\n
9165 # If \a theObject itself is used as \a theStartLCS,
9166 # its location will be changed to \a theEndLCS.
9167 # @param theEndLCS Coordinate system to perform displacement to it.
9168 # @param theCopy Flag used to displace object itself or create a copy.
9169 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9170 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9171 @ManageTransactions("TrsfOp")
9172 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9174 Modify the Location of the given object by LCS, creating its copy before the setting.
9177 theObject The object to be displaced.
9178 theStartLCS Coordinate system to perform displacement from it.
9179 If theStartLCS is NULL, displacement
9180 will be performed from global CS.
9181 If theObject itself is used as theStartLCS,
9182 its location will be changed to theEndLCS.
9183 theEndLCS Coordinate system to perform displacement to it.
9184 theCopy Flag used to displace object itself or create a copy.
9187 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9188 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9190 # Example: see GEOM_TestAll.py
9192 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9194 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9195 RaiseIfFailed("Displace", self.TrsfOp)
9198 ## Modify the Location of the given object by LCS,
9199 # creating its copy before the setting.
9200 # @param theObject The object to be displaced.
9201 # @param theStartLCS Coordinate system to perform displacement from it.\n
9202 # If \a theStartLCS is NULL, displacement
9203 # will be performed from global CS.\n
9204 # If \a theObject itself is used as \a theStartLCS,
9205 # its location will be changed to \a theEndLCS.
9206 # @param theEndLCS Coordinate system to perform displacement to it.
9207 # @param theName Object name; when specified, this parameter is used
9208 # for result publication in the study. Otherwise, if automatic
9209 # publication is switched on, default value is used for result name.
9211 # @return New GEOM.GEOM_Object, containing the displaced shape.
9213 # @ref tui_modify_location "Example"
9214 @ManageTransactions("TrsfOp")
9215 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9217 Modify the Location of the given object by LCS, creating its copy before the setting.
9220 theObject The object to be displaced.
9221 theStartLCS Coordinate system to perform displacement from it.
9222 If theStartLCS is NULL, displacement
9223 will be performed from global CS.
9224 If theObject itself is used as theStartLCS,
9225 its location will be changed to theEndLCS.
9226 theEndLCS Coordinate system to perform displacement to it.
9227 theName Object name; when specified, this parameter is used
9228 for result publication in the study. Otherwise, if automatic
9229 publication is switched on, default value is used for result name.
9232 New GEOM.GEOM_Object, containing the displaced shape.
9235 # create local coordinate systems
9236 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9237 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9238 # modify the location of the given object
9239 position = geompy.MakePosition(cylinder, cs1, cs2)
9241 # Example: see GEOM_TestAll.py
9242 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9243 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9244 self._autoPublish(anObj, theName, "displaced")
9247 ## Modify the Location of the given object by Path.
9248 # @param theObject The object to be displaced.
9249 # @param thePath Wire or Edge along that the object will be translated.
9250 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9251 # @param theCopy is to create a copy objects if true.
9252 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9253 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9254 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9256 # @ref tui_modify_location "Example"
9257 @ManageTransactions("TrsfOp")
9258 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9260 Modify the Location of the given object by Path.
9263 theObject The object to be displaced.
9264 thePath Wire or Edge along that the object will be translated.
9265 theDistance progress of Path (0 = start location, 1 = end of path location).
9266 theCopy is to create a copy objects if true.
9267 theReverse 0 - for usual direction, 1 - to reverse path direction.
9270 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9271 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9274 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9276 # Example: see GEOM_TestAll.py
9277 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9278 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9281 ## Modify the Location of the given object by Path, creating its copy before the operation.
9282 # @param theObject The object to be displaced.
9283 # @param thePath Wire or Edge along that the object will be translated.
9284 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9285 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9286 # @param theName Object name; when specified, this parameter is used
9287 # for result publication in the study. Otherwise, if automatic
9288 # publication is switched on, default value is used for result name.
9290 # @return New GEOM.GEOM_Object, containing the displaced shape.
9291 @ManageTransactions("TrsfOp")
9292 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9294 Modify the Location of the given object by Path, creating its copy before the operation.
9297 theObject The object to be displaced.
9298 thePath Wire or Edge along that the object will be translated.
9299 theDistance progress of Path (0 = start location, 1 = end of path location).
9300 theReverse 0 - for usual direction, 1 - to reverse path direction.
9301 theName Object name; when specified, this parameter is used
9302 for result publication in the study. Otherwise, if automatic
9303 publication is switched on, default value is used for result name.
9306 New GEOM.GEOM_Object, containing the displaced shape.
9308 # Example: see GEOM_TestAll.py
9309 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9310 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9311 self._autoPublish(anObj, theName, "displaced")
9314 ## Offset given shape.
9315 # @param theObject The base object for the offset.
9316 # @param theOffset Offset value.
9317 # @param theCopy Flag used to offset object itself or create a copy.
9318 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9319 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9320 @ManageTransactions("TrsfOp")
9321 def Offset(self, theObject, theOffset, theCopy=False):
9326 theObject The base object for the offset.
9327 theOffset Offset value.
9328 theCopy Flag used to offset object itself or create a copy.
9331 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9332 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9334 theOffset, Parameters = ParseParameters(theOffset)
9336 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9338 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9339 RaiseIfFailed("Offset", self.TrsfOp)
9340 anObj.SetParameters(Parameters)
9343 ## Create new object as offset of the given one. Gap between two adjacent
9344 # offset surfaces is filled by a pipe.
9345 # @param theObject The base object for the offset.
9346 # @param theOffset Offset value.
9347 # @param theName Object name; when specified, this parameter is used
9348 # for result publication in the study. Otherwise, if automatic
9349 # publication is switched on, default value is used for result name.
9351 # @return New GEOM.GEOM_Object, containing the offset object.
9353 # @sa MakeOffsetIntersectionJoin
9354 # @ref tui_offset "Example"
9355 @ManageTransactions("TrsfOp")
9356 def MakeOffset(self, theObject, theOffset, theName=None):
9358 Create new object as offset of the given one. Gap between adjacent
9359 offset surfaces is filled by a pipe.
9362 theObject The base object for the offset.
9363 theOffset Offset value.
9364 theName Object name; when specified, this parameter is used
9365 for result publication in the study. Otherwise, if automatic
9366 publication is switched on, default value is used for result name.
9369 New GEOM.GEOM_Object, containing the offset object.
9372 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9373 # create a new object as offset of the given object
9374 offset = geompy.MakeOffset(box, 70.)
9376 # Example: see GEOM_TestAll.py
9377 theOffset, Parameters = ParseParameters(theOffset)
9378 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9379 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9380 anObj.SetParameters(Parameters)
9381 self._autoPublish(anObj, theName, "offset")
9384 ## Create new object as offset of the given one. Gap between adjacent
9385 # offset surfaces is filled by extending and intersecting them.
9386 # @param theObject The base object for the offset.
9387 # @param theOffset Offset value.
9388 # @param theName Object name; when specified, this parameter is used
9389 # for result publication in the study. Otherwise, if automatic
9390 # publication is switched on, default value is used for result name.
9392 # @return New GEOM.GEOM_Object, containing the offset object.
9395 # @ref tui_offset "Example"
9396 @ManageTransactions("TrsfOp")
9397 def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9399 Create new object as offset of the given one. Gap between adjacent
9400 offset surfaces is filled by extending and intersecting them.
9403 theObject The base object for the offset.
9404 theOffset Offset value.
9405 theName Object name; when specified, this parameter is used
9406 for result publication in the study. Otherwise, if automatic
9407 publication is switched on, default value is used for result name.
9410 New GEOM.GEOM_Object, containing the offset object.
9413 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9414 # create a new box extended by 70
9415 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9417 # Example: see GEOM_TestAll.py
9418 theOffset, Parameters = ParseParameters( theOffset )
9419 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9420 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9421 anObj.SetParameters(Parameters)
9422 self._autoPublish(anObj, theName, "offset")
9425 ## Create new object as projection of the given one on another.
9426 # @param theSource The source object for the projection. It can be a point, edge or wire.
9427 # Edge and wire are acceptable if @a theTarget is a face.
9428 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9429 # @param theName Object name; when specified, this parameter is used
9430 # for result publication in the study. Otherwise, if automatic
9431 # publication is switched on, default value is used for result name.
9433 # @return New GEOM.GEOM_Object, containing the projection.
9435 # @ref tui_projection "Example"
9436 @ManageTransactions("TrsfOp")
9437 def MakeProjection(self, theSource, theTarget, theName=None):
9439 Create new object as projection of the given one on another.
9442 theSource The source object for the projection. It can be a point, edge or wire.
9443 Edge and wire are acceptable if theTarget is a face.
9444 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9445 theName Object name; when specified, this parameter is used
9446 for result publication in the study. Otherwise, if automatic
9447 publication is switched on, default value is used for result name.
9450 New GEOM.GEOM_Object, containing the projection.
9452 # Example: see GEOM_TestAll.py
9453 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9454 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9455 self._autoPublish(anObj, theName, "projection")
9458 ## Create a projection of the given point on a wire or an edge.
9459 # If there are no solutions or there are 2 or more solutions It throws an
9461 # @param thePoint the point to be projected.
9462 # @param theWire the wire. The edge is accepted as well.
9463 # @param theName Object name; when specified, this parameter is used
9464 # for result publication in the study. Otherwise, if automatic
9465 # publication is switched on, default value is used for result name.
9467 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9468 # \n \a u: The parameter of projection point on edge.
9469 # \n \a PointOnEdge: The projection point.
9470 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9472 # @ref tui_projection "Example"
9473 @ManageTransactions("TrsfOp")
9474 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9476 Create a projection of the given point on a wire or an edge.
9477 If there are no solutions or there are 2 or more solutions It throws an
9481 thePoint the point to be projected.
9482 theWire the wire. The edge is accepted as well.
9483 theName Object name; when specified, this parameter is used
9484 for result publication in the study. Otherwise, if automatic
9485 publication is switched on, default value is used for result name.
9488 [u, PointOnEdge, EdgeInWireIndex]
9489 u: The parameter of projection point on edge.
9490 PointOnEdge: The projection point.
9491 EdgeInWireIndex: The index of an edge in a wire.
9493 # Example: see GEOM_TestAll.py
9494 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9495 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9496 self._autoPublish(anObj[1], theName, "projection")
9499 # -----------------------------------------------------------------------------
9501 # -----------------------------------------------------------------------------
9503 ## Translate the given object along the given vector a given number times
9504 # @param theObject The object to be translated.
9505 # @param theVector Direction of the translation. DX if None.
9506 # @param theStep Distance to translate on.
9507 # @param theNbTimes Quantity of translations to be done.
9508 # @param theName Object name; when specified, this parameter is used
9509 # for result publication in the study. Otherwise, if automatic
9510 # publication is switched on, default value is used for result name.
9512 # @return New GEOM.GEOM_Object, containing compound of all
9513 # the shapes, obtained after each translation.
9515 # @ref tui_multi_translation "Example"
9516 @ManageTransactions("TrsfOp")
9517 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9519 Translate the given object along the given vector a given number times
9522 theObject The object to be translated.
9523 theVector Direction of the translation. DX if None.
9524 theStep Distance to translate on.
9525 theNbTimes Quantity of translations to be done.
9526 theName Object name; when specified, this parameter is used
9527 for result publication in the study. Otherwise, if automatic
9528 publication is switched on, default value is used for result name.
9531 New GEOM.GEOM_Object, containing compound of all
9532 the shapes, obtained after each translation.
9535 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9537 # Example: see GEOM_TestAll.py
9538 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9539 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9540 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9541 anObj.SetParameters(Parameters)
9542 self._autoPublish(anObj, theName, "multitranslation")
9545 ## Conseqently apply two specified translations to theObject specified number of times.
9546 # @param theObject The object to be translated.
9547 # @param theVector1 Direction of the first translation. DX if None.
9548 # @param theStep1 Step of the first translation.
9549 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9550 # @param theVector2 Direction of the second translation. DY if None.
9551 # @param theStep2 Step of the second translation.
9552 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9553 # @param theName Object name; when specified, this parameter is used
9554 # for result publication in the study. Otherwise, if automatic
9555 # publication is switched on, default value is used for result name.
9557 # @return New GEOM.GEOM_Object, containing compound of all
9558 # the shapes, obtained after each translation.
9560 # @ref tui_multi_translation "Example"
9561 @ManageTransactions("TrsfOp")
9562 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9563 theVector2, theStep2, theNbTimes2, theName=None):
9565 Conseqently apply two specified translations to theObject specified number of times.
9568 theObject The object to be translated.
9569 theVector1 Direction of the first translation. DX if None.
9570 theStep1 Step of the first translation.
9571 theNbTimes1 Quantity of translations to be done along theVector1.
9572 theVector2 Direction of the second translation. DY if None.
9573 theStep2 Step of the second translation.
9574 theNbTimes2 Quantity of translations to be done along theVector2.
9575 theName Object name; when specified, this parameter is used
9576 for result publication in the study. Otherwise, if automatic
9577 publication is switched on, default value is used for result name.
9580 New GEOM.GEOM_Object, containing compound of all
9581 the shapes, obtained after each translation.
9584 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9586 # Example: see GEOM_TestAll.py
9587 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9588 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9589 theVector2, theStep2, theNbTimes2)
9590 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9591 anObj.SetParameters(Parameters)
9592 self._autoPublish(anObj, theName, "multitranslation")
9595 ## Rotate the given object around the given axis a given number times.
9596 # Rotation angle will be 2*PI/theNbTimes.
9597 # @param theObject The object to be rotated.
9598 # @param theAxis The rotation axis. DZ if None.
9599 # @param theNbTimes Quantity of rotations to be done.
9600 # @param theName Object name; when specified, this parameter is used
9601 # for result publication in the study. Otherwise, if automatic
9602 # publication is switched on, default value is used for result name.
9604 # @return New GEOM.GEOM_Object, containing compound of all the
9605 # shapes, obtained after each rotation.
9607 # @ref tui_multi_rotation "Example"
9608 @ManageTransactions("TrsfOp")
9609 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9611 Rotate the given object around the given axis a given number times.
9612 Rotation angle will be 2*PI/theNbTimes.
9615 theObject The object to be rotated.
9616 theAxis The rotation axis. DZ if None.
9617 theNbTimes Quantity of rotations to be done.
9618 theName Object name; when specified, this parameter is used
9619 for result publication in the study. Otherwise, if automatic
9620 publication is switched on, default value is used for result name.
9623 New GEOM.GEOM_Object, containing compound of all the
9624 shapes, obtained after each rotation.
9627 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9629 # Example: see GEOM_TestAll.py
9630 theNbTimes, Parameters = ParseParameters(theNbTimes)
9631 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9632 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9633 anObj.SetParameters(Parameters)
9634 self._autoPublish(anObj, theName, "multirotation")
9637 ## Rotate the given object around the given axis
9638 # a given number times on the given angle.
9639 # @param theObject The object to be rotated.
9640 # @param theAxis The rotation axis. DZ if None.
9641 # @param theAngleStep Rotation angle in radians.
9642 # @param theNbTimes Quantity of rotations to be done.
9643 # @param theName Object name; when specified, this parameter is used
9644 # for result publication in the study. Otherwise, if automatic
9645 # publication is switched on, default value is used for result name.
9647 # @return New GEOM.GEOM_Object, containing compound of all the
9648 # shapes, obtained after each rotation.
9650 # @ref tui_multi_rotation "Example"
9651 @ManageTransactions("TrsfOp")
9652 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9654 Rotate the given object around the given axis
9655 a given number times on the given angle.
9658 theObject The object to be rotated.
9659 theAxis The rotation axis. DZ if None.
9660 theAngleStep Rotation angle in radians.
9661 theNbTimes Quantity of rotations to be done.
9662 theName Object name; when specified, this parameter is used
9663 for result publication in the study. Otherwise, if automatic
9664 publication is switched on, default value is used for result name.
9667 New GEOM.GEOM_Object, containing compound of all the
9668 shapes, obtained after each rotation.
9671 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9673 # Example: see GEOM_TestAll.py
9674 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9675 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9676 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9677 anObj.SetParameters(Parameters)
9678 self._autoPublish(anObj, theName, "multirotation")
9681 ## Rotate the given object around the given axis a given
9682 # number times and multi-translate each rotation result.
9683 # Rotation angle will be 2*PI/theNbTimes1.
9684 # Translation direction passes through center of gravity
9685 # of rotated shape and its projection on the rotation axis.
9686 # @param theObject The object to be rotated.
9687 # @param theAxis Rotation axis. DZ if None.
9688 # @param theNbTimes1 Quantity of rotations to be done.
9689 # @param theRadialStep Translation distance.
9690 # @param theNbTimes2 Quantity of translations to be done.
9691 # @param theName Object name; when specified, this parameter is used
9692 # for result publication in the study. Otherwise, if automatic
9693 # publication is switched on, default value is used for result name.
9695 # @return New GEOM.GEOM_Object, containing compound of all the
9696 # shapes, obtained after each transformation.
9698 # @ref tui_multi_rotation "Example"
9699 @ManageTransactions("TrsfOp")
9700 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9702 Rotate the given object around the
9703 given axis on the given angle a given number
9704 times and multi-translate each rotation result.
9705 Translation direction passes through center of gravity
9706 of rotated shape and its projection on the rotation axis.
9709 theObject The object to be rotated.
9710 theAxis Rotation axis. DZ if None.
9711 theNbTimes1 Quantity of rotations to be done.
9712 theRadialStep Translation distance.
9713 theNbTimes2 Quantity of translations to be done.
9714 theName Object name; when specified, this parameter is used
9715 for result publication in the study. Otherwise, if automatic
9716 publication is switched on, default value is used for result name.
9719 New GEOM.GEOM_Object, containing compound of all the
9720 shapes, obtained after each transformation.
9723 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9725 # Example: see GEOM_TestAll.py
9726 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9727 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9728 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9729 anObj.SetParameters(Parameters)
9730 self._autoPublish(anObj, theName, "multirotation")
9733 ## Rotate the given object around the
9734 # given axis on the given angle a given number
9735 # times and multi-translate each rotation result.
9736 # Translation direction passes through center of gravity
9737 # of rotated shape and its projection on the rotation axis.
9738 # @param theObject The object to be rotated.
9739 # @param theAxis Rotation axis. DZ if None.
9740 # @param theAngleStep Rotation angle in radians.
9741 # @param theNbTimes1 Quantity of rotations to be done.
9742 # @param theRadialStep Translation distance.
9743 # @param theNbTimes2 Quantity of translations to be done.
9744 # @param theName Object name; when specified, this parameter is used
9745 # for result publication in the study. Otherwise, if automatic
9746 # publication is switched on, default value is used for result name.
9748 # @return New GEOM.GEOM_Object, containing compound of all the
9749 # shapes, obtained after each transformation.
9751 # @ref tui_multi_rotation "Example"
9752 @ManageTransactions("TrsfOp")
9753 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9755 Rotate the given object around the
9756 given axis on the given angle a given number
9757 times and multi-translate each rotation result.
9758 Translation direction passes through center of gravity
9759 of rotated shape and its projection on the rotation axis.
9762 theObject The object to be rotated.
9763 theAxis Rotation axis. DZ if None.
9764 theAngleStep Rotation angle in radians.
9765 theNbTimes1 Quantity of rotations to be done.
9766 theRadialStep Translation distance.
9767 theNbTimes2 Quantity of translations to be done.
9768 theName Object name; when specified, this parameter is used
9769 for result publication in the study. Otherwise, if automatic
9770 publication is switched on, default value is used for result name.
9773 New GEOM.GEOM_Object, containing compound of all the
9774 shapes, obtained after each transformation.
9777 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9779 # Example: see GEOM_TestAll.py
9780 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9781 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9782 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9783 anObj.SetParameters(Parameters)
9784 self._autoPublish(anObj, theName, "multirotation")
9787 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9789 # @ref swig_MakeMultiRotation "Example"
9790 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9792 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9795 pz = geompy.MakeVertex(0, 0, 100)
9796 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9797 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9799 # Example: see GEOM_TestOthers.py
9800 aVec = self.MakeLine(aPoint,aDir)
9801 # note: auto-publishing is done in self.MultiRotate1D()
9802 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9805 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9807 # @ref swig_MakeMultiRotation "Example"
9808 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9810 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9813 pz = geompy.MakeVertex(0, 0, 100)
9814 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9815 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9817 # Example: see GEOM_TestOthers.py
9818 aVec = self.MakeLine(aPoint,aDir)
9819 # note: auto-publishing is done in self.MultiRotate1D()
9820 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9823 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9825 # @ref swig_MakeMultiRotation "Example"
9826 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9828 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9831 pz = geompy.MakeVertex(0, 0, 100)
9832 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9833 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9835 # Example: see GEOM_TestOthers.py
9836 aVec = self.MakeLine(aPoint,aDir)
9837 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9838 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9841 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9843 # @ref swig_MakeMultiRotation "Example"
9844 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9846 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9849 pz = geompy.MakeVertex(0, 0, 100)
9850 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9851 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9853 # Example: see GEOM_TestOthers.py
9854 aVec = self.MakeLine(aPoint,aDir)
9855 # note: auto-publishing is done in self.MultiRotate2D()
9856 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9860 # Compute a wire or a face that represents a projection of the source
9861 # shape onto cylinder. The cylinder's coordinate system is the same
9862 # as the global coordinate system.
9864 # @param theObject The object to be projected. It can be either
9865 # a planar wire or a face.
9866 # @param theRadius The radius of the cylinder.
9867 # @param theStartAngle The starting angle in radians from
9868 # the cylinder's X axis around Z axis. The angle from which
9869 # the projection is started.
9870 # @param theAngleLength The projection length angle in radians.
9871 # The angle in which to project the total length of the wire.
9872 # If it is negative the projection is not scaled and natural
9873 # wire length is kept for the projection.
9874 # @param theAngleRotation The desired angle in radians between
9875 # the tangent vector to the first curve at the first point of
9876 # the theObject's projection in 2D space and U-direction of
9877 # cylinder's 2D space.
9878 # @param theName Object name; when specified, this parameter is used
9879 # for result publication in the study. Otherwise, if automatic
9880 # publication is switched on, default value is used for result name.
9882 # @return New GEOM.GEOM_Object, containing the result shape. The result
9883 # represents a wire or a face that represents a projection of
9884 # the source shape onto a cylinder.
9886 # @ref tui_projection "Example"
9887 def MakeProjectionOnCylinder (self, theObject, theRadius,
9888 theStartAngle=0.0, theAngleLength=-1.0,
9889 theAngleRotation=0.0,
9892 Compute a wire or a face that represents a projection of the source
9893 shape onto cylinder. The cylinder's coordinate system is the same
9894 as the global coordinate system.
9897 theObject The object to be projected. It can be either
9898 a planar wire or a face.
9899 theRadius The radius of the cylinder.
9900 theStartAngle The starting angle in radians from the cylinder's X axis
9901 around Z axis. The angle from which the projection is started.
9902 theAngleLength The projection length angle in radians. The angle in which
9903 to project the total length of the wire. If it is negative the
9904 projection is not scaled and natural wire length is kept for
9906 theAngleRotation The desired angle in radians between
9907 the tangent vector to the first curve at the first
9908 point of the theObject's projection in 2D space and
9909 U-direction of cylinder's 2D space.
9910 theName Object name; when specified, this parameter is used
9911 for result publication in the study. Otherwise, if automatic
9912 publication is switched on, default value is used for result name.
9915 New GEOM.GEOM_Object, containing the result shape. The result
9916 represents a wire or a face that represents a projection of
9917 the source shape onto a cylinder.
9919 # Example: see GEOM_TestAll.py
9920 flagStartAngle = False
9921 if isinstance(theStartAngle,str):
9922 flagStartAngle = True
9923 flagAngleLength = False
9924 if isinstance(theAngleLength,str):
9925 flagAngleLength = True
9926 flagAngleRotation = False
9927 if isinstance(theAngleRotation,str):
9928 flagAngleRotation = True
9929 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9930 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9932 theStartAngle = theStartAngle*math.pi/180.
9934 theAngleLength = theAngleLength*math.pi/180.
9935 if flagAngleRotation:
9936 theAngleRotation = theAngleRotation*math.pi/180.
9937 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9938 theStartAngle, theAngleLength, theAngleRotation)
9939 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9940 anObj.SetParameters(Parameters)
9941 self._autoPublish(anObj, theName, "projection")
9944 # end of l3_transform
9947 ## @addtogroup l3_transform_d
9950 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9951 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9953 Deprecated method. Use MultiRotate1DNbTimes instead.
9955 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9956 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9958 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9959 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9960 @ManageTransactions("TrsfOp")
9961 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9963 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9964 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9967 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9969 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9970 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9971 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9972 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9973 anObj.SetParameters(Parameters)
9974 self._autoPublish(anObj, theName, "multirotation")
9977 ## The same, as MultiRotate1D(), but axis is given by direction and point
9978 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9979 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9981 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9982 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9985 pz = geompy.MakeVertex(0, 0, 100)
9986 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9987 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9989 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9990 aVec = self.MakeLine(aPoint,aDir)
9991 # note: auto-publishing is done in self.MultiRotate1D()
9992 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9995 ## The same, as MultiRotate2D(), but axis is given by direction and point
9996 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9997 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9999 The same, as MultiRotate2D(), but axis is given by direction and point
10000 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10003 pz = geompy.MakeVertex(0, 0, 100)
10004 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
10005 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
10007 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
10008 aVec = self.MakeLine(aPoint,aDir)
10009 # note: auto-publishing is done in self.MultiRotate2D()
10010 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10013 # end of l3_transform_d
10016 ## @addtogroup l3_local
10019 ## Perform a fillet on all edges of the given shape.
10020 # @param theShape Shape, to perform fillet on.
10021 # @param theR Fillet radius.
10022 # @param theName Object name; when specified, this parameter is used
10023 # for result publication in the study. Otherwise, if automatic
10024 # publication is switched on, default value is used for result name.
10026 # @return New GEOM.GEOM_Object, containing the result shape.
10028 # @ref tui_fillet "Example 1"
10029 # \n @ref swig_MakeFilletAll "Example 2"
10030 @ManageTransactions("LocalOp")
10031 def MakeFilletAll(self, theShape, theR, theName=None):
10033 Perform a fillet on all edges of the given shape.
10036 theShape Shape, to perform fillet on.
10037 theR Fillet radius.
10038 theName Object name; when specified, this parameter is used
10039 for result publication in the study. Otherwise, if automatic
10040 publication is switched on, default value is used for result name.
10043 New GEOM.GEOM_Object, containing the result shape.
10046 filletall = geompy.MakeFilletAll(prism, 10.)
10048 # Example: see GEOM_TestOthers.py
10049 theR,Parameters = ParseParameters(theR)
10050 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10051 RaiseIfFailed("MakeFilletAll", self.LocalOp)
10052 anObj.SetParameters(Parameters)
10053 self._autoPublish(anObj, theName, "fillet")
10056 ## Perform a fillet on the specified edges/faces of the given shape
10057 # @param theShape Shape, to perform fillet on.
10058 # @param theR Fillet radius.
10059 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10060 # @param theListShapes Global indices of edges/faces to perform fillet on.
10061 # @param theName Object name; when specified, this parameter is used
10062 # for result publication in the study. Otherwise, if automatic
10063 # publication is switched on, default value is used for result name.
10065 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10067 # @return New GEOM.GEOM_Object, containing the result shape.
10069 # @ref tui_fillet "Example"
10070 @ManageTransactions("LocalOp")
10071 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10073 Perform a fillet on the specified edges/faces of the given shape
10076 theShape Shape, to perform fillet on.
10077 theR Fillet radius.
10078 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10079 theListShapes Global indices of edges/faces to perform fillet on.
10080 theName Object name; when specified, this parameter is used
10081 for result publication in the study. Otherwise, if automatic
10082 publication is switched on, default value is used for result name.
10085 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10088 New GEOM.GEOM_Object, containing the result shape.
10091 # get the list of IDs (IDList) for the fillet
10092 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10094 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10095 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10096 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10097 # make a fillet on the specified edges of the given shape
10098 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10100 # Example: see GEOM_TestAll.py
10101 theR,Parameters = ParseParameters(theR)
10103 if theShapeType == self.ShapeType["EDGE"]:
10104 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10105 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10107 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10108 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10109 anObj.SetParameters(Parameters)
10110 self._autoPublish(anObj, theName, "fillet")
10113 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10114 @ManageTransactions("LocalOp")
10115 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10117 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10120 # get the list of IDs (IDList) for the fillet
10121 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10123 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10124 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10125 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10126 # make a fillet on the specified edges of the given shape
10127 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10129 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10131 if theShapeType == self.ShapeType["EDGE"]:
10132 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10133 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10135 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10136 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10137 anObj.SetParameters(Parameters)
10138 self._autoPublish(anObj, theName, "fillet")
10141 ## Perform a fillet on the specified edges of the given shape
10142 # @param theShape Wire Shape to perform fillet on.
10143 # @param theR Fillet radius.
10144 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10145 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10146 # \note The list of vertices could be empty,
10147 # in this case fillet will done done at all vertices in wire
10148 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10149 # by the length of the edges, nearest to the fillet vertex.
10150 # But sometimes the next edge is C1 continuous with the one, nearest to
10151 # the fillet point, and such two (or more) edges can be united to allow
10152 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10153 # thus ignoring the secant vertex (vertices).
10154 # @param theName Object name; when specified, this parameter is used
10155 # for result publication in the study. Otherwise, if automatic
10156 # publication is switched on, default value is used for result name.
10158 # @return New GEOM.GEOM_Object, containing the result shape.
10160 # @ref tui_fillet2d "Example"
10161 @ManageTransactions("LocalOp")
10162 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10164 Perform a fillet on the specified edges of the given shape
10167 theShape Wire Shape to perform fillet on.
10168 theR Fillet radius.
10169 theListOfVertexes Global indices of vertexes to perform fillet on.
10170 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10171 by the length of the edges, nearest to the fillet vertex.
10172 But sometimes the next edge is C1 continuous with the one, nearest to
10173 the fillet point, and such two (or more) edges can be united to allow
10174 bigger radius. Set this flag to TRUE to allow collinear edges union,
10175 thus ignoring the secant vertex (vertices).
10176 theName Object name; when specified, this parameter is used
10177 for result publication in the study. Otherwise, if automatic
10178 publication is switched on, default value is used for result name.
10180 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10182 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10185 New GEOM.GEOM_Object, containing the result shape.
10189 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10190 # make fillet at given wire vertices with giver radius
10191 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10193 # Example: see GEOM_TestAll.py
10194 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10195 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10196 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10197 anObj.SetParameters(Parameters)
10198 self._autoPublish(anObj, theName, "fillet")
10201 ## Perform a fillet at the specified vertices of the given face/shell.
10202 # @param theShape Face or Shell shape to perform fillet on.
10203 # @param theR Fillet radius.
10204 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10205 # @param theName Object name; when specified, this parameter is used
10206 # for result publication in the study. Otherwise, if automatic
10207 # publication is switched on, default value is used for result name.
10209 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10211 # @return New GEOM.GEOM_Object, containing the result shape.
10213 # @ref tui_fillet2d "Example"
10214 @ManageTransactions("LocalOp")
10215 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10217 Perform a fillet at the specified vertices of the given face/shell.
10220 theShape Face or Shell shape to perform fillet on.
10221 theR Fillet radius.
10222 theListOfVertexes Global indices of vertexes to perform fillet on.
10223 theName Object name; when specified, this parameter is used
10224 for result publication in the study. Otherwise, if automatic
10225 publication is switched on, default value is used for result name.
10227 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10230 New GEOM.GEOM_Object, containing the result shape.
10233 face = geompy.MakeFaceHW(100, 100, 1)
10234 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10236 # Example: see GEOM_TestAll.py
10237 theR,Parameters = ParseParameters(theR)
10238 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10239 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10240 anObj.SetParameters(Parameters)
10241 self._autoPublish(anObj, theName, "fillet")
10244 ## Perform a symmetric chamfer on all edges of the given shape.
10245 # @param theShape Shape, to perform chamfer on.
10246 # @param theD Chamfer size along each face.
10247 # @param theName Object name; when specified, this parameter is used
10248 # for result publication in the study. Otherwise, if automatic
10249 # publication is switched on, default value is used for result name.
10251 # @return New GEOM.GEOM_Object, containing the result shape.
10253 # @ref tui_chamfer "Example 1"
10254 # \n @ref swig_MakeChamferAll "Example 2"
10255 @ManageTransactions("LocalOp")
10256 def MakeChamferAll(self, theShape, theD, theName=None):
10258 Perform a symmetric chamfer on all edges of the given shape.
10261 theShape Shape, to perform chamfer on.
10262 theD Chamfer size along each face.
10263 theName Object name; when specified, this parameter is used
10264 for result publication in the study. Otherwise, if automatic
10265 publication is switched on, default value is used for result name.
10268 New GEOM.GEOM_Object, containing the result shape.
10271 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10273 # Example: see GEOM_TestOthers.py
10274 theD,Parameters = ParseParameters(theD)
10275 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10276 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10277 anObj.SetParameters(Parameters)
10278 self._autoPublish(anObj, theName, "chamfer")
10281 ## Perform a chamfer on edges, common to the specified faces,
10282 # with distance D1 on the Face1
10283 # @param theShape Shape, to perform chamfer on.
10284 # @param theD1 Chamfer size along \a theFace1.
10285 # @param theD2 Chamfer size along \a theFace2.
10286 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10287 # @param theName Object name; when specified, this parameter is used
10288 # for result publication in the study. Otherwise, if automatic
10289 # publication is switched on, default value is used for result name.
10291 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10293 # @return New GEOM.GEOM_Object, containing the result shape.
10295 # @ref tui_chamfer "Example"
10296 @ManageTransactions("LocalOp")
10297 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10299 Perform a chamfer on edges, common to the specified faces,
10300 with distance D1 on the Face1
10303 theShape Shape, to perform chamfer on.
10304 theD1 Chamfer size along theFace1.
10305 theD2 Chamfer size along theFace2.
10306 theFace1,theFace2 Global indices of two faces of theShape.
10307 theName Object name; when specified, this parameter is used
10308 for result publication in the study. Otherwise, if automatic
10309 publication is switched on, default value is used for result name.
10312 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10315 New GEOM.GEOM_Object, containing the result shape.
10318 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10319 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10320 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10321 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10323 # Example: see GEOM_TestAll.py
10324 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10325 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10326 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10327 anObj.SetParameters(Parameters)
10328 self._autoPublish(anObj, theName, "chamfer")
10331 ## Perform a chamfer on edges
10332 # @param theShape Shape, to perform chamfer on.
10333 # @param theD Chamfer length
10334 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10335 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10336 # @param theName Object name; when specified, this parameter is used
10337 # for result publication in the study. Otherwise, if automatic
10338 # publication is switched on, default value is used for result name.
10340 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10342 # @return New GEOM.GEOM_Object, containing the result shape.
10343 @ManageTransactions("LocalOp")
10344 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10346 Perform a chamfer on edges
10349 theShape Shape, to perform chamfer on.
10350 theD1 Chamfer size along theFace1.
10351 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10352 theFace1,theFace2 Global indices of two faces of theShape.
10353 theName Object name; when specified, this parameter is used
10354 for result publication in the study. Otherwise, if automatic
10355 publication is switched on, default value is used for result name.
10358 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10361 New GEOM.GEOM_Object, containing the result shape.
10364 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10365 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10366 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10368 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10371 if isinstance(theAngle,str):
10373 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10375 theAngle = theAngle*math.pi/180.0
10376 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10377 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10378 anObj.SetParameters(Parameters)
10379 self._autoPublish(anObj, theName, "chamfer")
10382 ## Perform a chamfer on all edges of the specified faces,
10383 # with distance D1 on the first specified face (if several for one edge)
10384 # @param theShape Shape, to perform chamfer on.
10385 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10386 # connected to the edge, are in \a theFaces, \a theD1
10387 # will be get along face, which is nearer to \a theFaces beginning.
10388 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10389 # @param theFaces Sequence of global indices of faces of \a theShape.
10390 # @param theName Object name; when specified, this parameter is used
10391 # for result publication in the study. Otherwise, if automatic
10392 # publication is switched on, default value is used for result name.
10394 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10396 # @return New GEOM.GEOM_Object, containing the result shape.
10398 # @ref tui_chamfer "Example"
10399 @ManageTransactions("LocalOp")
10400 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10402 Perform a chamfer on all edges of the specified faces,
10403 with distance D1 on the first specified face (if several for one edge)
10406 theShape Shape, to perform chamfer on.
10407 theD1 Chamfer size along face from theFaces. If both faces,
10408 connected to the edge, are in theFaces, theD1
10409 will be get along face, which is nearer to theFaces beginning.
10410 theD2 Chamfer size along another of two faces, connected to the edge.
10411 theFaces Sequence of global indices of faces of theShape.
10412 theName Object name; when specified, this parameter is used
10413 for result publication in the study. Otherwise, if automatic
10414 publication is switched on, default value is used for result name.
10416 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10419 New GEOM.GEOM_Object, containing the result shape.
10421 # Example: see GEOM_TestAll.py
10422 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10423 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10424 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10425 anObj.SetParameters(Parameters)
10426 self._autoPublish(anObj, theName, "chamfer")
10429 ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10430 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10432 # @ref swig_FilletChamfer "Example"
10433 @ManageTransactions("LocalOp")
10434 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10436 The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10437 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10440 if isinstance(theAngle,str):
10442 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10444 theAngle = theAngle*math.pi/180.0
10445 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10446 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10447 anObj.SetParameters(Parameters)
10448 self._autoPublish(anObj, theName, "chamfer")
10451 ## Perform a chamfer on edges,
10452 # with distance D1 on the first specified face (if several for one edge)
10453 # @param theShape Shape, to perform chamfer on.
10454 # @param theD1,theD2 Chamfer size
10455 # @param theEdges Sequence of edges of \a theShape.
10456 # @param theName Object name; when specified, this parameter is used
10457 # for result publication in the study. Otherwise, if automatic
10458 # publication is switched on, default value is used for result name.
10460 # @return New GEOM.GEOM_Object, containing the result shape.
10462 # @ref swig_FilletChamfer "Example"
10463 @ManageTransactions("LocalOp")
10464 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10466 Perform a chamfer on edges,
10467 with distance D1 on the first specified face (if several for one edge)
10470 theShape Shape, to perform chamfer on.
10471 theD1,theD2 Chamfer size
10472 theEdges Sequence of edges of theShape.
10473 theName Object name; when specified, this parameter is used
10474 for result publication in the study. Otherwise, if automatic
10475 publication is switched on, default value is used for result name.
10478 New GEOM.GEOM_Object, containing the result shape.
10480 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10481 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10482 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10483 anObj.SetParameters(Parameters)
10484 self._autoPublish(anObj, theName, "chamfer")
10487 ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10488 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10489 @ManageTransactions("LocalOp")
10490 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10492 The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10493 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10496 if isinstance(theAngle,str):
10498 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10500 theAngle = theAngle*math.pi/180.0
10501 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10502 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10503 anObj.SetParameters(Parameters)
10504 self._autoPublish(anObj, theName, "chamfer")
10507 ## @sa MakeChamferEdge(), MakeChamferFaces()
10509 # @ref swig_MakeChamfer "Example"
10510 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10512 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10514 # Example: see GEOM_TestOthers.py
10516 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10517 if aShapeType == self.ShapeType["EDGE"]:
10518 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10520 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10523 ## Remove material from a solid by extrusion of the base shape on the given distance.
10524 # @param theInit Shape to remove material from. It must be a solid or
10525 # a compound made of a single solid.
10526 # @param theBase Closed edge or wire defining the base shape to be extruded.
10527 # @param theH Prism dimension along the normal to theBase
10528 # @param theAngle Draft angle in degrees.
10529 # @param theInvert If true material changes the direction
10530 # @param theName Object name; when specified, this parameter is used
10531 # for result publication in the study. Otherwise, if automatic
10532 # publication is switched on, default value is used for result name.
10534 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10536 # @ref tui_creation_prism "Example"
10537 @ManageTransactions("PrimOp")
10538 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10540 Add material to a solid by extrusion of the base shape on the given distance.
10543 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10544 theBase Closed edge or wire defining the base shape to be extruded.
10545 theH Prism dimension along the normal to theBase
10546 theAngle Draft angle in degrees.
10547 theInvert If true material changes the direction.
10548 theName Object name; when specified, this parameter is used
10549 for result publication in the study. Otherwise, if automatic
10550 publication is switched on, default value is used for result name.
10553 New GEOM.GEOM_Object, containing the initial shape with removed material.
10555 # Example: see GEOM_TestAll.py
10556 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10557 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10558 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10559 anObj.SetParameters(Parameters)
10560 self._autoPublish(anObj, theName, "extrudedCut")
10563 ## Add material to a solid by extrusion of the base shape on the given distance.
10564 # @param theInit Shape to add material to. It must be a solid or
10565 # a compound made of a single solid.
10566 # @param theBase Closed edge or wire defining the base shape to be extruded.
10567 # @param theH Prism dimension along the normal to theBase
10568 # @param theAngle Draft angle in degrees.
10569 # @param theInvert If true material changes the direction
10570 # @param theName Object name; when specified, this parameter is used
10571 # for result publication in the study. Otherwise, if automatic
10572 # publication is switched on, default value is used for result name.
10574 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10576 # @ref tui_creation_prism "Example"
10577 @ManageTransactions("PrimOp")
10578 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10580 Add material to a solid by extrusion of the base shape on the given distance.
10583 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10584 theBase Closed edge or wire defining the base shape to be extruded.
10585 theH Prism dimension along the normal to theBase
10586 theAngle Draft angle in degrees.
10587 theInvert If true material changes the direction.
10588 theName Object name; when specified, this parameter is used
10589 for result publication in the study. Otherwise, if automatic
10590 publication is switched on, default value is used for result name.
10593 New GEOM.GEOM_Object, containing the initial shape with added material.
10595 # Example: see GEOM_TestAll.py
10596 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10597 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10598 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10599 anObj.SetParameters(Parameters)
10600 self._autoPublish(anObj, theName, "extrudedBoss")
10606 ## @addtogroup l3_basic_op
10609 ## Perform an Archimde operation on the given shape with given parameters.
10610 # The object presenting the resulting face is returned.
10611 # @param theShape Shape to be put in water.
10612 # @param theWeight Weight of the shape.
10613 # @param theWaterDensity Density of the water.
10614 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10615 # @param theName Object name; when specified, this parameter is used
10616 # for result publication in the study. Otherwise, if automatic
10617 # publication is switched on, default value is used for result name.
10619 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10620 # by a plane, corresponding to water level.
10622 # @ref tui_archimede "Example"
10623 @ManageTransactions("LocalOp")
10624 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10626 Perform an Archimde operation on the given shape with given parameters.
10627 The object presenting the resulting face is returned.
10630 theShape Shape to be put in water.
10631 theWeight Weight of the shape.
10632 theWaterDensity Density of the water.
10633 theMeshDeflection Deflection of the mesh, using to compute the section.
10634 theName Object name; when specified, this parameter is used
10635 for result publication in the study. Otherwise, if automatic
10636 publication is switched on, default value is used for result name.
10639 New GEOM.GEOM_Object, containing a section of theShape
10640 by a plane, corresponding to water level.
10642 # Example: see GEOM_TestAll.py
10643 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10644 theWeight,theWaterDensity,theMeshDeflection)
10645 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10646 RaiseIfFailed("MakeArchimede", self.LocalOp)
10647 anObj.SetParameters(Parameters)
10648 self._autoPublish(anObj, theName, "archimede")
10651 # end of l3_basic_op
10654 ## @addtogroup l2_measure
10657 ## Get point coordinates
10658 # @return [x, y, z]
10660 # @ref tui_point_coordinates_page "Example"
10661 @ManageTransactions("MeasuOp")
10662 def PointCoordinates(self,Point):
10664 Get point coordinates
10669 # Example: see GEOM_TestMeasures.py
10670 aTuple = self.MeasuOp.PointCoordinates(Point)
10671 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10674 ## Get vector coordinates
10675 # @return [x, y, z]
10677 # @ref tui_measurement_tools_page "Example"
10678 def VectorCoordinates(self,Vector):
10680 Get vector coordinates
10686 p1=self.GetFirstVertex(Vector)
10687 p2=self.GetLastVertex(Vector)
10689 X1=self.PointCoordinates(p1)
10690 X2=self.PointCoordinates(p2)
10692 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10695 ## Compute cross product
10696 # @return vector w=u^v
10698 # @ref tui_measurement_tools_page "Example"
10699 def CrossProduct(self, Vector1, Vector2):
10701 Compute cross product
10703 Returns: vector w=u^v
10705 u=self.VectorCoordinates(Vector1)
10706 v=self.VectorCoordinates(Vector2)
10707 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])
10711 ## Compute cross product
10712 # @return dot product p=u.v
10714 # @ref tui_measurement_tools_page "Example"
10715 def DotProduct(self, Vector1, Vector2):
10717 Compute cross product
10719 Returns: dot product p=u.v
10721 u=self.VectorCoordinates(Vector1)
10722 v=self.VectorCoordinates(Vector2)
10723 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10728 ## Get summarized length of all wires,
10729 # area of surface and volume of the given shape.
10730 # @param theShape Shape to define properties of.
10731 # @param theTolerance maximal relative error of area
10732 # and volume computation.
10733 # @return [theLength, theSurfArea, theVolume]\n
10734 # theLength: Summarized length of all wires of the given shape.\n
10735 # theSurfArea: Area of surface of the given shape.\n
10736 # theVolume: Volume of the given shape.
10738 # @ref tui_basic_properties_page "Example"
10739 @ManageTransactions("MeasuOp")
10740 def BasicProperties(self,theShape, theTolerance=1.e-6):
10742 Get summarized length of all wires,
10743 area of surface and volume of the given shape.
10746 theShape Shape to define properties of.
10747 theTolerance maximal relative error of area
10748 and volume computation.
10751 [theLength, theSurfArea, theVolume]
10752 theLength: Summarized length of all wires of the given shape.
10753 theSurfArea: Area of surface of the given shape.
10754 theVolume: Volume of the given shape.
10756 # Example: see GEOM_TestMeasures.py
10757 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10758 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10761 ## Get parameters of bounding box of the given shape
10762 # @param theShape Shape to obtain bounding box of.
10763 # @param precise TRUE for precise computation; FALSE for fast one.
10764 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10765 # Xmin,Xmax: Limits of shape along OX axis.
10766 # Ymin,Ymax: Limits of shape along OY axis.
10767 # Zmin,Zmax: Limits of shape along OZ axis.
10769 # @ref tui_bounding_box_page "Example"
10770 @ManageTransactions("MeasuOp")
10771 def BoundingBox (self, theShape, precise=False):
10773 Get parameters of bounding box of the given shape
10776 theShape Shape to obtain bounding box of.
10777 precise TRUE for precise computation; FALSE for fast one.
10780 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10781 Xmin,Xmax: Limits of shape along OX axis.
10782 Ymin,Ymax: Limits of shape along OY axis.
10783 Zmin,Zmax: Limits of shape along OZ axis.
10785 # Example: see GEOM_TestMeasures.py
10786 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10787 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10790 ## Get bounding box of the given shape
10791 # @param theShape Shape to obtain bounding box of.
10792 # @param precise TRUE for precise computation; FALSE for fast one.
10793 # @param theName Object name; when specified, this parameter is used
10794 # for result publication in the study. Otherwise, if automatic
10795 # publication is switched on, default value is used for result name.
10797 # @return New GEOM.GEOM_Object, containing the created box.
10799 # @ref tui_bounding_box_page "Example"
10800 @ManageTransactions("MeasuOp")
10801 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10803 Get bounding box of the given shape
10806 theShape Shape to obtain bounding box of.
10807 precise TRUE for precise computation; FALSE for fast one.
10808 theName Object name; when specified, this parameter is used
10809 for result publication in the study. Otherwise, if automatic
10810 publication is switched on, default value is used for result name.
10813 New GEOM.GEOM_Object, containing the created box.
10815 # Example: see GEOM_TestMeasures.py
10816 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10817 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10818 self._autoPublish(anObj, theName, "bndbox")
10821 ## Get inertia matrix and moments of inertia of theShape.
10822 # @param theShape Shape to calculate inertia of.
10823 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10824 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10825 # Ix,Iy,Iz: Moments of inertia of the given shape.
10827 # @ref tui_inertia_page "Example"
10828 @ManageTransactions("MeasuOp")
10829 def Inertia(self,theShape):
10831 Get inertia matrix and moments of inertia of theShape.
10834 theShape Shape to calculate inertia of.
10837 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10838 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10839 Ix,Iy,Iz: Moments of inertia of the given shape.
10841 # Example: see GEOM_TestMeasures.py
10842 aTuple = self.MeasuOp.GetInertia(theShape)
10843 RaiseIfFailed("GetInertia", self.MeasuOp)
10846 ## Get if coords are included in the shape (ST_IN or ST_ON)
10847 # @param theShape Shape
10848 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10849 # @param tolerance to be used (default is 1.0e-7)
10850 # @return list_of_boolean = [res1, res2, ...]
10851 @ManageTransactions("MeasuOp")
10852 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10854 Get if coords are included in the shape (ST_IN or ST_ON)
10858 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10859 tolerance to be used (default is 1.0e-7)
10862 list_of_boolean = [res1, res2, ...]
10864 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10866 ## Get minimal distance between the given shapes.
10867 # @param theShape1,theShape2 Shapes to find minimal distance between.
10868 # @return Value of the minimal distance between the given shapes.
10870 # @ref tui_min_distance_page "Example"
10871 @ManageTransactions("MeasuOp")
10872 def MinDistance(self, theShape1, theShape2):
10874 Get minimal distance between the given shapes.
10877 theShape1,theShape2 Shapes to find minimal distance between.
10880 Value of the minimal distance between the given shapes.
10882 # Example: see GEOM_TestMeasures.py
10883 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10884 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10887 ## Get minimal distance between the given shapes.
10888 # @param theShape1,theShape2 Shapes to find minimal distance between.
10889 # @return Value of the minimal distance between the given shapes, in form of list
10890 # [Distance, DX, DY, DZ].
10892 # @ref tui_min_distance_page "Example"
10893 @ManageTransactions("MeasuOp")
10894 def MinDistanceComponents(self, theShape1, theShape2):
10896 Get minimal distance between the given shapes.
10899 theShape1,theShape2 Shapes to find minimal distance between.
10902 Value of the minimal distance between the given shapes, in form of list
10903 [Distance, DX, DY, DZ]
10905 # Example: see GEOM_TestMeasures.py
10906 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10907 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10908 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10911 ## Get closest points of the given shapes.
10912 # @param theShape1,theShape2 Shapes to find closest points of.
10913 # @return The number of found solutions (-1 in case of infinite number of
10914 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10916 # @ref tui_min_distance_page "Example"
10917 @ManageTransactions("MeasuOp")
10918 def ClosestPoints (self, theShape1, theShape2):
10920 Get closest points of the given shapes.
10923 theShape1,theShape2 Shapes to find closest points of.
10926 The number of found solutions (-1 in case of infinite number of
10927 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10929 # Example: see GEOM_TestMeasures.py
10930 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10931 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10934 ## Get angle between the given shapes in degrees.
10935 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10936 # @note If both arguments are vectors, the angle is computed in accordance
10937 # with their orientations, otherwise the minimum angle is computed.
10938 # @return Value of the angle between the given shapes in degrees.
10940 # @ref tui_angle_page "Example"
10941 @ManageTransactions("MeasuOp")
10942 def GetAngle(self, theShape1, theShape2):
10944 Get angle between the given shapes in degrees.
10947 theShape1,theShape2 Lines or linear edges to find angle between.
10950 If both arguments are vectors, the angle is computed in accordance
10951 with their orientations, otherwise the minimum angle is computed.
10954 Value of the angle between the given shapes in degrees.
10956 # Example: see GEOM_TestMeasures.py
10957 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10958 RaiseIfFailed("GetAngle", self.MeasuOp)
10961 ## Get angle between the given shapes in radians.
10962 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10963 # @note If both arguments are vectors, the angle is computed in accordance
10964 # with their orientations, otherwise the minimum angle is computed.
10965 # @return Value of the angle between the given shapes in radians.
10967 # @ref tui_angle_page "Example"
10968 @ManageTransactions("MeasuOp")
10969 def GetAngleRadians(self, theShape1, theShape2):
10971 Get angle between the given shapes in radians.
10974 theShape1,theShape2 Lines or linear edges to find angle between.
10978 If both arguments are vectors, the angle is computed in accordance
10979 with their orientations, otherwise the minimum angle is computed.
10982 Value of the angle between the given shapes in radians.
10984 # Example: see GEOM_TestMeasures.py
10985 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10986 RaiseIfFailed("GetAngle", self.MeasuOp)
10989 ## Get angle between the given vectors in degrees.
10990 # @param theShape1,theShape2 Vectors to find angle between.
10991 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10992 # if False, the opposite vector to the normal vector is used.
10993 # @return Value of the angle between the given vectors in degrees.
10995 # @ref tui_angle_page "Example"
10996 @ManageTransactions("MeasuOp")
10997 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
10999 Get angle between the given vectors in degrees.
11002 theShape1,theShape2 Vectors to find angle between.
11003 theFlag If True, the normal vector is defined by the two vectors cross,
11004 if False, the opposite vector to the normal vector is used.
11007 Value of the angle between the given vectors in degrees.
11009 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11011 anAngle = 360. - anAngle
11012 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11015 ## The same as GetAngleVectors, but the result is in radians.
11016 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11018 Get angle between the given vectors in radians.
11021 theShape1,theShape2 Vectors to find angle between.
11022 theFlag If True, the normal vector is defined by the two vectors cross,
11023 if False, the opposite vector to the normal vector is used.
11026 Value of the angle between the given vectors in radians.
11028 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11031 ## @name Curve Curvature Measurement
11032 # Methods for receiving radius of curvature of curves
11033 # in the given point
11036 ## Measure curvature of a curve at a point, set by parameter.
11037 # @param theCurve a curve.
11038 # @param theParam parameter.
11039 # @return radius of curvature of \a theCurve.
11041 # @ref swig_todo "Example"
11042 @ManageTransactions("MeasuOp")
11043 def CurveCurvatureByParam(self, theCurve, theParam):
11045 Measure curvature of a curve at a point, set by parameter.
11049 theParam parameter.
11052 radius of curvature of theCurve.
11054 # Example: see GEOM_TestMeasures.py
11055 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11056 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11059 ## Measure curvature of a curve at a point.
11060 # @param theCurve a curve.
11061 # @param thePoint given point.
11062 # @return radius of curvature of \a theCurve.
11064 # @ref swig_todo "Example"
11065 @ManageTransactions("MeasuOp")
11066 def CurveCurvatureByPoint(self, theCurve, thePoint):
11068 Measure curvature of a curve at a point.
11072 thePoint given point.
11075 radius of curvature of theCurve.
11077 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11078 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11082 ## @name Surface Curvature Measurement
11083 # Methods for receiving max and min radius of curvature of surfaces
11084 # in the given point
11087 ## Measure max radius of curvature of surface.
11088 # @param theSurf the given surface.
11089 # @param theUParam Value of U-parameter on the referenced surface.
11090 # @param theVParam Value of V-parameter on the referenced surface.
11091 # @return max radius of curvature of theSurf.
11093 ## @ref swig_todo "Example"
11094 @ManageTransactions("MeasuOp")
11095 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11097 Measure max radius of curvature of surface.
11100 theSurf the given surface.
11101 theUParam Value of U-parameter on the referenced surface.
11102 theVParam Value of V-parameter on the referenced surface.
11105 max radius of curvature of theSurf.
11107 # Example: see GEOM_TestMeasures.py
11108 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11109 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11112 ## Measure max radius of curvature of surface in the given point
11113 # @param theSurf the given surface.
11114 # @param thePoint given point.
11115 # @return max radius of curvature of theSurf.
11117 ## @ref swig_todo "Example"
11118 @ManageTransactions("MeasuOp")
11119 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11121 Measure max radius of curvature of surface in the given point.
11124 theSurf the given surface.
11125 thePoint given point.
11128 max radius of curvature of theSurf.
11130 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11131 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11134 ## Measure min radius of curvature of surface.
11135 # @param theSurf the given surface.
11136 # @param theUParam Value of U-parameter on the referenced surface.
11137 # @param theVParam Value of V-parameter on the referenced surface.
11138 # @return min radius of curvature of theSurf.
11140 ## @ref swig_todo "Example"
11141 @ManageTransactions("MeasuOp")
11142 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11144 Measure min radius of curvature of surface.
11147 theSurf the given surface.
11148 theUParam Value of U-parameter on the referenced surface.
11149 theVParam Value of V-parameter on the referenced surface.
11152 Min radius of curvature of theSurf.
11154 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11155 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11158 ## Measure min radius of curvature of surface in the given point
11159 # @param theSurf the given surface.
11160 # @param thePoint given point.
11161 # @return min radius of curvature of theSurf.
11163 ## @ref swig_todo "Example"
11164 @ManageTransactions("MeasuOp")
11165 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11167 Measure min radius of curvature of surface in the given point.
11170 theSurf the given surface.
11171 thePoint given point.
11174 Min radius of curvature of theSurf.
11176 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11177 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11181 ## Get min and max tolerances of sub-shapes of theShape
11182 # @param theShape Shape, to get tolerances of.
11183 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11184 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11185 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11186 # VertMin,VertMax: Min and max tolerances of the vertices.
11188 # @ref tui_tolerance_page "Example"
11189 @ManageTransactions("MeasuOp")
11190 def Tolerance(self,theShape):
11192 Get min and max tolerances of sub-shapes of theShape
11195 theShape Shape, to get tolerances of.
11198 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11199 FaceMin,FaceMax: Min and max tolerances of the faces.
11200 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11201 VertMin,VertMax: Min and max tolerances of the vertices.
11203 # Example: see GEOM_TestMeasures.py
11204 aTuple = self.MeasuOp.GetTolerance(theShape)
11205 RaiseIfFailed("GetTolerance", self.MeasuOp)
11208 ## Obtain description of the given shape (number of sub-shapes of each type)
11209 # @param theShape Shape to be described.
11210 # @return Description of the given shape.
11212 # @ref tui_whatis_page "Example"
11213 @ManageTransactions("MeasuOp")
11214 def WhatIs(self,theShape):
11216 Obtain description of the given shape (number of sub-shapes of each type)
11219 theShape Shape to be described.
11222 Description of the given shape.
11224 # Example: see GEOM_TestMeasures.py
11225 aDescr = self.MeasuOp.WhatIs(theShape)
11226 RaiseIfFailed("WhatIs", self.MeasuOp)
11229 ## Obtain quantity of shapes of the given type in \a theShape.
11230 # If \a theShape is of type \a theType, it is also counted.
11231 # @param theShape Shape to be described.
11232 # @param theType the given ShapeType().
11233 # @return Quantity of shapes of type \a theType in \a theShape.
11235 # @ref tui_measurement_tools_page "Example"
11236 def NbShapes (self, theShape, theType):
11238 Obtain quantity of shapes of the given type in theShape.
11239 If theShape is of type theType, it is also counted.
11242 theShape Shape to be described.
11243 theType the given geompy.ShapeType
11246 Quantity of shapes of type theType in theShape.
11248 # Example: see GEOM_TestMeasures.py
11249 listSh = self.SubShapeAllIDs(theShape, theType)
11253 ## Obtain quantity of shapes of each type in \a theShape.
11254 # The \a theShape is also counted.
11255 # @param theShape Shape to be described.
11256 # @return Dictionary of ShapeType() with bound quantities of shapes.
11258 # @ref tui_measurement_tools_page "Example"
11259 def ShapeInfo (self, theShape):
11261 Obtain quantity of shapes of each type in theShape.
11262 The theShape is also counted.
11265 theShape Shape to be described.
11268 Dictionary of geompy.ShapeType with bound quantities of shapes.
11270 # Example: see GEOM_TestMeasures.py
11272 for typeSh in self.ShapeType:
11273 if typeSh in ( "AUTO", "SHAPE" ): continue
11274 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11280 def GetCreationInformation(self, theShape):
11282 infos = theShape.GetCreationInformation()
11285 opName = info.operationName
11286 if not opName: opName = "no info available"
11287 if res: res += "\n"
11288 res += "Operation: " + opName
11290 for parVal in info.params:
11291 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11294 ## Get a point, situated at the centre of mass of theShape.
11295 # @param theShape Shape to define centre of mass of.
11296 # @param theName Object name; when specified, this parameter is used
11297 # for result publication in the study. Otherwise, if automatic
11298 # publication is switched on, default value is used for result name.
11300 # @return New GEOM.GEOM_Object, containing the created point.
11302 # @ref tui_center_of_mass_page "Example"
11303 @ManageTransactions("MeasuOp")
11304 def MakeCDG(self, theShape, theName=None):
11306 Get a point, situated at the centre of mass of theShape.
11309 theShape Shape to define centre of mass of.
11310 theName Object name; when specified, this parameter is used
11311 for result publication in the study. Otherwise, if automatic
11312 publication is switched on, default value is used for result name.
11315 New GEOM.GEOM_Object, containing the created point.
11317 # Example: see GEOM_TestMeasures.py
11318 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11319 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11320 self._autoPublish(anObj, theName, "centerOfMass")
11323 ## Get a vertex sub-shape by index.
11324 # @param theShape Shape to find sub-shape.
11325 # @param theIndex Index to find vertex by this index (starting from zero)
11326 # @param theUseOri To consider edge/wire orientation or not
11327 # @param theName Object name; when specified, this parameter is used
11328 # for result publication in the study. Otherwise, if automatic
11329 # publication is switched on, default value is used for result name.
11331 # @return New GEOM.GEOM_Object, containing the created vertex.
11333 # @ref tui_measurement_tools_page "Example"
11334 @ManageTransactions("MeasuOp")
11335 def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
11337 Get a vertex sub-shape by index.
11340 theShape Shape to find sub-shape.
11341 theIndex Index to find vertex by this index (starting from zero)
11342 theUseOri To consider edge/wire orientation or not
11343 theName Object name; when specified, this parameter is used
11344 for result publication in the study. Otherwise, if automatic
11345 publication is switched on, default value is used for result name.
11348 New GEOM.GEOM_Object, containing the created vertex.
11350 # Example: see GEOM_TestMeasures.py
11351 if isinstance( theUseOri, str ): # theUseOri was inserted before theName
11352 theUseOri, theName = True, theUseOri
11353 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
11354 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11355 self._autoPublish(anObj, theName, "vertex")
11358 ## Get the first vertex of wire/edge depended orientation.
11359 # @param theShape Shape to find first vertex.
11360 # @param theName Object name; when specified, this parameter is used
11361 # for result publication in the study. Otherwise, if automatic
11362 # publication is switched on, default value is used for result name.
11364 # @return New GEOM.GEOM_Object, containing the created vertex.
11366 # @ref tui_measurement_tools_page "Example"
11367 def GetFirstVertex(self, theShape, theName=None):
11369 Get the first vertex of wire/edge depended orientation.
11372 theShape Shape to find first vertex.
11373 theName Object name; when specified, this parameter is used
11374 for result publication in the study. Otherwise, if automatic
11375 publication is switched on, default value is used for result name.
11378 New GEOM.GEOM_Object, containing the created vertex.
11380 # Example: see GEOM_TestMeasures.py
11381 # note: auto-publishing is done in self.GetVertexByIndex()
11382 return self.GetVertexByIndex(theShape, 0, True, theName)
11384 ## Get the last vertex of wire/edge depended orientation.
11385 # @param theShape Shape to find last vertex.
11386 # @param theName Object name; when specified, this parameter is used
11387 # for result publication in the study. Otherwise, if automatic
11388 # publication is switched on, default value is used for result name.
11390 # @return New GEOM.GEOM_Object, containing the created vertex.
11392 # @ref tui_measurement_tools_page "Example"
11393 def GetLastVertex(self, theShape, theName=None):
11395 Get the last vertex of wire/edge depended orientation.
11398 theShape Shape to find last vertex.
11399 theName Object name; when specified, this parameter is used
11400 for result publication in the study. Otherwise, if automatic
11401 publication is switched on, default value is used for result name.
11404 New GEOM.GEOM_Object, containing the created vertex.
11406 # Example: see GEOM_TestMeasures.py
11407 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11408 # note: auto-publishing is done in self.GetVertexByIndex()
11409 return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
11411 ## Get a normale to the given face. If the point is not given,
11412 # the normale is calculated at the center of mass.
11413 # @param theFace Face to define normale of.
11414 # @param theOptionalPoint Point to compute the normale at.
11415 # @param theName Object name; when specified, this parameter is used
11416 # for result publication in the study. Otherwise, if automatic
11417 # publication is switched on, default value is used for result name.
11419 # @return New GEOM.GEOM_Object, containing the created vector.
11421 # @ref swig_todo "Example"
11422 @ManageTransactions("MeasuOp")
11423 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11425 Get a normale to the given face. If the point is not given,
11426 the normale is calculated at the center of mass.
11429 theFace Face to define normale of.
11430 theOptionalPoint Point to compute the normale at.
11431 theName Object name; when specified, this parameter is used
11432 for result publication in the study. Otherwise, if automatic
11433 publication is switched on, default value is used for result name.
11436 New GEOM.GEOM_Object, containing the created vector.
11438 # Example: see GEOM_TestMeasures.py
11439 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11440 RaiseIfFailed("GetNormal", self.MeasuOp)
11441 self._autoPublish(anObj, theName, "normal")
11444 ## Print shape errors obtained from CheckShape.
11445 # @param theShape Shape that was checked.
11446 # @param theShapeErrors the shape errors obtained by CheckShape.
11447 # @param theReturnStatus If 0 the description of problem is printed.
11448 # If 1 the description of problem is returned.
11449 # @return If theReturnStatus is equal to 1 the description is returned.
11450 # Otherwise doesn't return anything.
11452 # @ref tui_check_shape_page "Example"
11453 @ManageTransactions("MeasuOp")
11454 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11456 Print shape errors obtained from CheckShape.
11459 theShape Shape that was checked.
11460 theShapeErrors the shape errors obtained by CheckShape.
11461 theReturnStatus If 0 the description of problem is printed.
11462 If 1 the description of problem is returned.
11465 If theReturnStatus is equal to 1 the description is returned.
11466 Otherwise doesn't return anything.
11468 # Example: see GEOM_TestMeasures.py
11469 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11470 if theReturnStatus == 1:
11475 ## Check a topology of the given shape.
11476 # @param theShape Shape to check validity of.
11477 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11478 # if TRUE, the shape's geometry will be checked also.
11479 # @param theReturnStatus If 0 and if theShape is invalid, a description
11480 # of problem is printed.
11481 # If 1 isValid flag and the description of
11482 # problem is returned.
11483 # If 2 isValid flag and the list of error data
11485 # @return TRUE, if the shape "seems to be valid".
11486 # If theShape is invalid, prints a description of problem.
11487 # If theReturnStatus is equal to 1 the description is returned
11488 # along with IsValid flag.
11489 # If theReturnStatus is equal to 2 the list of error data is
11490 # returned along with IsValid flag.
11492 # @ref tui_check_shape_page "Example"
11493 @ManageTransactions("MeasuOp")
11494 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11496 Check a topology of the given shape.
11499 theShape Shape to check validity of.
11500 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11501 if TRUE, the shape's geometry will be checked also.
11502 theReturnStatus If 0 and if theShape is invalid, a description
11503 of problem is printed.
11504 If 1 IsValid flag and the description of
11505 problem is returned.
11506 If 2 IsValid flag and the list of error data
11510 TRUE, if the shape "seems to be valid".
11511 If theShape is invalid, prints a description of problem.
11512 If theReturnStatus is equal to 1 the description is returned
11513 along with IsValid flag.
11514 If theReturnStatus is equal to 2 the list of error data is
11515 returned along with IsValid flag.
11517 # Example: see GEOM_TestMeasures.py
11519 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11520 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11522 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11523 RaiseIfFailed("CheckShape", self.MeasuOp)
11525 if theReturnStatus == 0:
11526 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11528 if theReturnStatus == 1:
11529 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11530 return (IsValid, Descr)
11531 elif theReturnStatus == 2:
11532 return (IsValid, ShapeErrors)
11535 ## Detect self-intersections in the given shape.
11536 # @param theShape Shape to check.
11537 # @param theCheckLevel is the level of self-intersection check.
11538 # Possible input values are:
11539 # - GEOM.SI_V_V(0) - only V/V interferences
11540 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11541 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11542 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11543 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11544 # - GEOM.SI_ALL(5) - all interferences.
11545 # @return TRUE, if the shape contains no self-intersections.
11547 # @ref tui_check_self_intersections_page "Example"
11548 @ManageTransactions("MeasuOp")
11549 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11551 Detect self-intersections in the given shape.
11554 theShape Shape to check.
11555 theCheckLevel is the level of self-intersection check.
11556 Possible input values are:
11557 - GEOM.SI_V_V(0) - only V/V interferences
11558 - GEOM.SI_V_E(1) - V/V and V/E interferences
11559 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11560 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11561 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11562 - GEOM.SI_ALL(5) - all interferences.
11565 TRUE, if the shape contains no self-intersections.
11567 # Example: see GEOM_TestMeasures.py
11568 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11569 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11572 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11573 # @param theShape Shape to check.
11574 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11575 # - if \a theDeflection <= 0, default deflection 0.001 is used
11576 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11577 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11578 # - if \a theTolerance > 0, algorithm detects gaps
11579 # @return TRUE, if the shape contains no self-intersections.
11581 # @ref tui_check_self_intersections_fast_page "Example"
11582 @ManageTransactions("MeasuOp")
11583 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11585 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11588 theShape Shape to check.
11589 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11590 - if theDeflection <= 0, default deflection 0.001 is used
11591 theTolerance Specifies a distance between shapes used for detecting gaps:
11592 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11593 - if theTolerance > 0, algorithm detects gaps
11596 TRUE, if the shape contains no self-intersections.
11598 # Example: see GEOM_TestMeasures.py
11599 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11600 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11603 ## Check boolean and partition operations arguments.
11604 # @param theShape the argument of an operation to be checked
11605 # @return TRUE if the argument is valid for a boolean or partition
11606 # operation; FALSE otherwise.
11607 @ManageTransactions("MeasuOp")
11608 def CheckBOPArguments(self, theShape):
11610 Check boolean and partition operations arguments.
11613 theShape the argument of an operation to be checked
11616 TRUE if the argument is valid for a boolean or partition
11617 operation; FALSE otherwise.
11619 return self.MeasuOp.CheckBOPArguments(theShape)
11621 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11622 # @param theShape1 First source object
11623 # @param theShape2 Second source object
11624 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11625 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11626 # - if \a theTolerance > 0, algorithm detects gaps
11627 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11628 # - if \a theDeflection <= 0, default deflection 0.001 is used
11629 # @return TRUE, if there are intersections (gaps) between source shapes
11630 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11631 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11633 # @ref tui_fast_intersection_page "Example"
11634 @ManageTransactions("MeasuOp")
11635 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11637 Detect intersections of the given shapes with algorithm based on mesh intersections.
11640 theShape1 First source object
11641 theShape2 Second source object
11642 theTolerance Specifies a distance between shapes used for detecting gaps:
11643 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11644 - if theTolerance > 0, algorithm detects gaps
11645 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11646 - if theDeflection <= 0, default deflection 0.001 is used
11649 TRUE, if there are intersections (gaps) between source shapes
11650 List of sub-shapes IDs from 1st shape that localize intersection.
11651 List of sub-shapes IDs from 2nd shape that localize intersection.
11653 # Example: see GEOM_TestMeasures.py
11654 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11655 RaiseIfFailed("FastIntersect", self.MeasuOp)
11656 return IsOk, Res1, Res2
11658 ## Get position (LCS) of theShape.
11660 # Origin of the LCS is situated at the shape's center of mass.
11661 # Axes of the LCS are obtained from shape's location or,
11662 # if the shape is a planar face, from position of its plane.
11664 # @param theShape Shape to calculate position of.
11665 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11666 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11667 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11668 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11670 # @ref swig_todo "Example"
11671 @ManageTransactions("MeasuOp")
11672 def GetPosition(self,theShape):
11674 Get position (LCS) of theShape.
11675 Origin of the LCS is situated at the shape's center of mass.
11676 Axes of the LCS are obtained from shape's location or,
11677 if the shape is a planar face, from position of its plane.
11680 theShape Shape to calculate position of.
11683 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11684 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11685 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11686 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11688 # Example: see GEOM_TestMeasures.py
11689 aTuple = self.MeasuOp.GetPosition(theShape)
11690 RaiseIfFailed("GetPosition", self.MeasuOp)
11693 ## Get kind of theShape.
11695 # @param theShape Shape to get a kind of.
11696 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11697 # and a list of parameters, describing the shape.
11698 # @note Concrete meaning of each value, returned via \a theIntegers
11699 # or \a theDoubles list depends on the kind() of the shape.
11701 # @ref swig_todo "Example"
11702 @ManageTransactions("MeasuOp")
11703 def KindOfShape(self,theShape):
11705 Get kind of theShape.
11708 theShape Shape to get a kind of.
11711 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11712 and a list of parameters, describing the shape.
11714 Concrete meaning of each value, returned via theIntegers
11715 or theDoubles list depends on the geompy.kind of the shape
11717 # Example: see GEOM_TestMeasures.py
11718 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11719 RaiseIfFailed("KindOfShape", self.MeasuOp)
11721 aKind = aRoughTuple[0]
11722 anInts = aRoughTuple[1]
11723 aDbls = aRoughTuple[2]
11725 # Now there is no exception from this rule:
11726 aKindTuple = [aKind] + aDbls + anInts
11728 # If they are we will regroup parameters for such kind of shape.
11730 #if aKind == kind.SOME_KIND:
11731 # # SOME_KIND int int double int double double
11732 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11736 ## Returns the string that describes if the shell is good for solid.
11737 # This is a support method for MakeSolid.
11739 # @param theShell the shell to be checked.
11740 # @return Returns a string that describes the shell validity for
11741 # solid construction.
11742 @ManageTransactions("MeasuOp")
11743 def _IsGoodForSolid(self, theShell):
11745 Returns the string that describes if the shell is good for solid.
11746 This is a support method for MakeSolid.
11749 theShell the shell to be checked.
11752 Returns a string that describes the shell validity for
11753 solid construction.
11755 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11758 # end of l2_measure
11761 ## @addtogroup l2_import_export
11764 ## Import a shape from the BREP, IGES, STEP or other file
11765 # (depends on given format) with given name.
11767 # Note: this function is deprecated, it is kept for backward compatibility only
11768 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11770 # @param theFileName The file, containing the shape.
11771 # @param theFormatName Specify format for the file reading.
11772 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11773 # If format 'IGES_SCALE' is used instead of 'IGES' or
11774 # format 'STEP_SCALE' is used instead of 'STEP',
11775 # length unit will be set to 'meter' and result model will be scaled.
11776 # @param theName Object name; when specified, this parameter is used
11777 # for result publication in the study. Otherwise, if automatic
11778 # publication is switched on, default value is used for result name.
11780 # @return New GEOM.GEOM_Object, containing the imported shape.
11781 # If material names are imported it returns the list of
11782 # objects. The first one is the imported object followed by
11784 # @note Auto publishing is allowed for the shape itself. Imported
11785 # material groups are not automatically published.
11787 # @ref swig_Import_Export "Example"
11788 @ManageTransactions("InsertOp")
11789 def ImportFile(self, theFileName, theFormatName, theName=None):
11791 Import a shape from the BREP, IGES, STEP or other file
11792 (depends on given format) with given name.
11794 Note: this function is deprecated, it is kept for backward compatibility only
11795 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11798 theFileName The file, containing the shape.
11799 theFormatName Specify format for the file reading.
11800 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11801 If format 'IGES_SCALE' is used instead of 'IGES' or
11802 format 'STEP_SCALE' is used instead of 'STEP',
11803 length unit will be set to 'meter' and result model will be scaled.
11804 theName Object name; when specified, this parameter is used
11805 for result publication in the study. Otherwise, if automatic
11806 publication is switched on, default value is used for result name.
11809 New GEOM.GEOM_Object, containing the imported shape.
11810 If material names are imported it returns the list of
11811 objects. The first one is the imported object followed by
11814 Auto publishing is allowed for the shape itself. Imported
11815 material groups are not automatically published.
11817 # Example: see GEOM_TestOthers.py
11819 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11820 where <FormatName> is a name of desirable format for importing.
11822 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11823 RaiseIfFailed("ImportFile", self.InsertOp)
11824 aNbObj = len(aListObj)
11826 self._autoPublish(aListObj[0], theName, "imported")
11831 ## Deprecated analog of ImportFile()
11832 def Import(self, theFileName, theFormatName, theName=None):
11834 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11836 # note: auto-publishing is done in self.ImportFile()
11837 return self.ImportFile(theFileName, theFormatName, theName)
11839 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11841 # @note As the byte-stream representing the shape data can be quite large, this method
11842 # is not automatically dumped to the Python script with the DumpStudy functionality;
11843 # so please use this method carefully, only for strong reasons.
11845 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11848 # @param theStream The BRep binary stream.
11849 # @param theName Object name; when specified, this parameter is used
11850 # for result publication in the study. Otherwise, if automatic
11851 # publication is switched on, default value is used for result name.
11853 # @return New GEOM_Object, containing the shape, read from theStream.
11855 # @ref swig_Import_Export "Example"
11856 @ManageTransactions("InsertOp")
11857 def RestoreShape (self, theStream, theName=None):
11859 Read a shape from the binary stream, containing its bounding representation (BRep).
11862 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11865 theStream The BRep binary stream.
11866 theName Object name; when specified, this parameter is used
11867 for result publication in the study. Otherwise, if automatic
11868 publication is switched on, default value is used for result name.
11871 New GEOM_Object, containing the shape, read from theStream.
11873 # Example: see GEOM_TestOthers.py
11875 # this is the workaround to ignore invalid case when data stream is empty
11876 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11877 print("WARNING: Result of RestoreShape is a NULL shape!")
11879 anObj = self.InsertOp.RestoreShape(theStream)
11880 RaiseIfFailed("RestoreShape", self.InsertOp)
11881 self._autoPublish(anObj, theName, "restored")
11884 ## Export the given shape into a file with given name.
11886 # Note: this function is deprecated, it is kept for backward compatibility only
11887 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11889 # @param theObject Shape to be stored in the file.
11890 # @param theFileName Name of the file to store the given shape in.
11891 # @param theFormatName Specify format for the shape storage.
11892 # Available formats can be obtained with
11893 # geompy.InsertOp.ExportTranslators()[0] method.
11895 # @ref swig_Import_Export "Example"
11896 @ManageTransactions("InsertOp")
11897 def Export(self, theObject, theFileName, theFormatName):
11899 Export the given shape into a file with given name.
11901 Note: this function is deprecated, it is kept for backward compatibility only
11902 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11905 theObject Shape to be stored in the file.
11906 theFileName Name of the file to store the given shape in.
11907 theFormatName Specify format for the shape storage.
11908 Available formats can be obtained with
11909 geompy.InsertOp.ExportTranslators()[0] method.
11911 # Example: see GEOM_TestOthers.py
11913 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11914 where <FormatName> is a name of desirable format for exporting.
11916 self.InsertOp.Export(theObject, theFileName, theFormatName)
11917 if self.InsertOp.IsDone() == 0:
11918 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11922 # end of l2_import_export
11925 ## @addtogroup l3_blocks
11928 ## Create a quadrangle face from four edges. Order of Edges is not
11929 # important. It is not necessary that edges share the same vertex.
11930 # @param E1,E2,E3,E4 Edges for the face bound.
11931 # @param theName Object name; when specified, this parameter is used
11932 # for result publication in the study. Otherwise, if automatic
11933 # publication is switched on, default value is used for result name.
11935 # @return New GEOM.GEOM_Object, containing the created face.
11937 # @ref tui_building_by_blocks_page "Example"
11938 @ManageTransactions("BlocksOp")
11939 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11941 Create a quadrangle face from four edges. Order of Edges is not
11942 important. It is not necessary that edges share the same vertex.
11945 E1,E2,E3,E4 Edges for the face bound.
11946 theName Object name; when specified, this parameter is used
11947 for result publication in the study. Otherwise, if automatic
11948 publication is switched on, default value is used for result name.
11951 New GEOM.GEOM_Object, containing the created face.
11954 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11956 # Example: see GEOM_Spanner.py
11957 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11958 RaiseIfFailed("MakeQuad", self.BlocksOp)
11959 self._autoPublish(anObj, theName, "quad")
11962 ## Create a quadrangle face on two edges.
11963 # The missing edges will be built by creating the shortest ones.
11964 # @param E1,E2 Two opposite edges for the face.
11965 # @param theName Object name; when specified, this parameter is used
11966 # for result publication in the study. Otherwise, if automatic
11967 # publication is switched on, default value is used for result name.
11969 # @return New GEOM.GEOM_Object, containing the created face.
11971 # @ref tui_building_by_blocks_page "Example"
11972 @ManageTransactions("BlocksOp")
11973 def MakeQuad2Edges(self, E1, E2, theName=None):
11975 Create a quadrangle face on two edges.
11976 The missing edges will be built by creating the shortest ones.
11979 E1,E2 Two opposite edges for the face.
11980 theName Object name; when specified, this parameter is used
11981 for result publication in the study. Otherwise, if automatic
11982 publication is switched on, default value is used for result name.
11985 New GEOM.GEOM_Object, containing the created face.
11989 p1 = geompy.MakeVertex( 0., 0., 0.)
11990 p2 = geompy.MakeVertex(150., 30., 0.)
11991 p3 = geompy.MakeVertex( 0., 120., 50.)
11992 p4 = geompy.MakeVertex( 0., 40., 70.)
11994 edge1 = geompy.MakeEdge(p1, p2)
11995 edge2 = geompy.MakeEdge(p3, p4)
11996 # create a quadrangle face from two edges
11997 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
11999 # Example: see GEOM_Spanner.py
12000 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
12001 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
12002 self._autoPublish(anObj, theName, "quad")
12005 ## Create a quadrangle face with specified corners.
12006 # The missing edges will be built by creating the shortest ones.
12007 # @param V1,V2,V3,V4 Corner vertices for the face.
12008 # @param theName Object name; when specified, this parameter is used
12009 # for result publication in the study. Otherwise, if automatic
12010 # publication is switched on, default value is used for result name.
12012 # @return New GEOM.GEOM_Object, containing the created face.
12014 # @ref tui_building_by_blocks_page "Example 1"
12015 # \n @ref swig_MakeQuad4Vertices "Example 2"
12016 @ManageTransactions("BlocksOp")
12017 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12019 Create a quadrangle face with specified corners.
12020 The missing edges will be built by creating the shortest ones.
12023 V1,V2,V3,V4 Corner vertices for the face.
12024 theName Object name; when specified, this parameter is used
12025 for result publication in the study. Otherwise, if automatic
12026 publication is switched on, default value is used for result name.
12029 New GEOM.GEOM_Object, containing the created face.
12033 p1 = geompy.MakeVertex( 0., 0., 0.)
12034 p2 = geompy.MakeVertex(150., 30., 0.)
12035 p3 = geompy.MakeVertex( 0., 120., 50.)
12036 p4 = geompy.MakeVertex( 0., 40., 70.)
12037 # create a quadrangle from four points in its corners
12038 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12040 # Example: see GEOM_Spanner.py
12041 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12042 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12043 self._autoPublish(anObj, theName, "quad")
12046 ## Create a hexahedral solid, bounded by the six given faces. Order of
12047 # faces is not important. It is not necessary that Faces share the same edge.
12048 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12049 # @param theName Object name; when specified, this parameter is used
12050 # for result publication in the study. Otherwise, if automatic
12051 # publication is switched on, default value is used for result name.
12053 # @return New GEOM.GEOM_Object, containing the created solid.
12055 # @ref tui_building_by_blocks_page "Example 1"
12056 # \n @ref swig_MakeHexa "Example 2"
12057 @ManageTransactions("BlocksOp")
12058 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12060 Create a hexahedral solid, bounded by the six given faces. Order of
12061 faces is not important. It is not necessary that Faces share the same edge.
12064 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12065 theName Object name; when specified, this parameter is used
12066 for result publication in the study. Otherwise, if automatic
12067 publication is switched on, default value is used for result name.
12070 New GEOM.GEOM_Object, containing the created solid.
12073 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12075 # Example: see GEOM_Spanner.py
12076 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12077 RaiseIfFailed("MakeHexa", self.BlocksOp)
12078 self._autoPublish(anObj, theName, "hexa")
12081 ## Create a hexahedral solid between two given faces.
12082 # The missing faces will be built by creating the smallest ones.
12083 # @param F1,F2 Two opposite faces for the hexahedral solid.
12084 # @param theName Object name; when specified, this parameter is used
12085 # for result publication in the study. Otherwise, if automatic
12086 # publication is switched on, default value is used for result name.
12088 # @return New GEOM.GEOM_Object, containing the created solid.
12090 # @ref tui_building_by_blocks_page "Example 1"
12091 # \n @ref swig_MakeHexa2Faces "Example 2"
12092 @ManageTransactions("BlocksOp")
12093 def MakeHexa2Faces(self, F1, F2, theName=None):
12095 Create a hexahedral solid between two given faces.
12096 The missing faces will be built by creating the smallest ones.
12099 F1,F2 Two opposite faces for the hexahedral solid.
12100 theName Object name; when specified, this parameter is used
12101 for result publication in the study. Otherwise, if automatic
12102 publication is switched on, default value is used for result name.
12105 New GEOM.GEOM_Object, containing the created solid.
12108 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12110 # Example: see GEOM_Spanner.py
12111 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12112 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12113 self._autoPublish(anObj, theName, "hexa")
12119 ## @addtogroup l3_blocks_op
12122 ## Get a vertex, found in the given shape by its coordinates.
12123 # @param theShape Block or a compound of blocks.
12124 # @param theX,theY,theZ Coordinates of the sought vertex.
12125 # @param theEpsilon Maximum allowed distance between the resulting
12126 # vertex and point with the given coordinates.
12127 # @param theName Object name; when specified, this parameter is used
12128 # for result publication in the study. Otherwise, if automatic
12129 # publication is switched on, default value is used for result name.
12131 # @return New GEOM.GEOM_Object, containing the found vertex.
12133 # @ref swig_GetPoint "Example"
12134 @ManageTransactions("BlocksOp")
12135 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12137 Get a vertex, found in the given shape by its coordinates.
12140 theShape Block or a compound of blocks.
12141 theX,theY,theZ Coordinates of the sought vertex.
12142 theEpsilon Maximum allowed distance between the resulting
12143 vertex and point with the given coordinates.
12144 theName Object name; when specified, this parameter is used
12145 for result publication in the study. Otherwise, if automatic
12146 publication is switched on, default value is used for result name.
12149 New GEOM.GEOM_Object, containing the found vertex.
12152 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12154 # Example: see GEOM_TestOthers.py
12155 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12156 RaiseIfFailed("GetPoint", self.BlocksOp)
12157 self._autoPublish(anObj, theName, "vertex")
12160 ## Find a vertex of the given shape, which has minimal distance to the given point.
12161 # @param theShape Any shape.
12162 # @param thePoint Point, close to the desired vertex.
12163 # @param theName Object name; when specified, this parameter is used
12164 # for result publication in the study. Otherwise, if automatic
12165 # publication is switched on, default value is used for result name.
12167 # @return New GEOM.GEOM_Object, containing the found vertex.
12169 # @ref swig_GetVertexNearPoint "Example"
12170 @ManageTransactions("BlocksOp")
12171 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12173 Find a vertex of the given shape, which has minimal distance to the given point.
12176 theShape Any shape.
12177 thePoint Point, close to the desired vertex.
12178 theName Object name; when specified, this parameter is used
12179 for result publication in the study. Otherwise, if automatic
12180 publication is switched on, default value is used for result name.
12183 New GEOM.GEOM_Object, containing the found vertex.
12186 pmidle = geompy.MakeVertex(50, 0, 50)
12187 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12189 # Example: see GEOM_TestOthers.py
12190 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12191 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12192 self._autoPublish(anObj, theName, "vertex")
12195 ## Get an edge, found in the given shape by two given vertices.
12196 # @param theShape Block or a compound of blocks.
12197 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12198 # @param theName Object name; when specified, this parameter is used
12199 # for result publication in the study. Otherwise, if automatic
12200 # publication is switched on, default value is used for result name.
12202 # @return New GEOM.GEOM_Object, containing the found edge.
12204 # @ref swig_GetEdge "Example"
12205 @ManageTransactions("BlocksOp")
12206 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12208 Get an edge, found in the given shape by two given vertices.
12211 theShape Block or a compound of blocks.
12212 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12213 theName Object name; when specified, this parameter is used
12214 for result publication in the study. Otherwise, if automatic
12215 publication is switched on, default value is used for result name.
12218 New GEOM.GEOM_Object, containing the found edge.
12220 # Example: see GEOM_Spanner.py
12221 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12222 RaiseIfFailed("GetEdge", self.BlocksOp)
12223 self._autoPublish(anObj, theName, "edge")
12226 ## Find an edge of the given shape, which has minimal distance to the given point.
12227 # @param theShape Block or a compound of blocks.
12228 # @param thePoint Point, close to the desired edge.
12229 # @param theName Object name; when specified, this parameter is used
12230 # for result publication in the study. Otherwise, if automatic
12231 # publication is switched on, default value is used for result name.
12233 # @return New GEOM.GEOM_Object, containing the found edge.
12235 # @ref swig_GetEdgeNearPoint "Example"
12236 @ManageTransactions("BlocksOp")
12237 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12239 Find an edge of the given shape, which has minimal distance to the given point.
12242 theShape Block or a compound of blocks.
12243 thePoint Point, close to the desired edge.
12244 theName Object name; when specified, this parameter is used
12245 for result publication in the study. Otherwise, if automatic
12246 publication is switched on, default value is used for result name.
12249 New GEOM.GEOM_Object, containing the found edge.
12251 # Example: see GEOM_TestOthers.py
12252 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12253 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12254 self._autoPublish(anObj, theName, "edge")
12257 ## Returns a face, found in the given shape by four given corner vertices.
12258 # @param theShape Block or a compound of blocks.
12259 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12260 # @param theName Object name; when specified, this parameter is used
12261 # for result publication in the study. Otherwise, if automatic
12262 # publication is switched on, default value is used for result name.
12264 # @return New GEOM.GEOM_Object, containing the found face.
12266 # @ref swig_todo "Example"
12267 @ManageTransactions("BlocksOp")
12268 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12270 Returns a face, found in the given shape by four given corner vertices.
12273 theShape Block or a compound of blocks.
12274 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12275 theName Object name; when specified, this parameter is used
12276 for result publication in the study. Otherwise, if automatic
12277 publication is switched on, default value is used for result name.
12280 New GEOM.GEOM_Object, containing the found face.
12282 # Example: see GEOM_Spanner.py
12283 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12284 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12285 self._autoPublish(anObj, theName, "face")
12288 ## Get a face of block, found in the given shape by two given edges.
12289 # @param theShape Block or a compound of blocks.
12290 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12291 # @param theName Object name; when specified, this parameter is used
12292 # for result publication in the study. Otherwise, if automatic
12293 # publication is switched on, default value is used for result name.
12295 # @return New GEOM.GEOM_Object, containing the found face.
12297 # @ref swig_todo "Example"
12298 @ManageTransactions("BlocksOp")
12299 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12301 Get a face of block, found in the given shape by two given edges.
12304 theShape Block or a compound of blocks.
12305 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12306 theName Object name; when specified, this parameter is used
12307 for result publication in the study. Otherwise, if automatic
12308 publication is switched on, default value is used for result name.
12311 New GEOM.GEOM_Object, containing the found face.
12313 # Example: see GEOM_Spanner.py
12314 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12315 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12316 self._autoPublish(anObj, theName, "face")
12319 ## Find a face, opposite to the given one in the given block.
12320 # @param theBlock Must be a hexahedral solid.
12321 # @param theFace Face of \a theBlock, opposite to the desired face.
12322 # @param theName Object name; when specified, this parameter is used
12323 # for result publication in the study. Otherwise, if automatic
12324 # publication is switched on, default value is used for result name.
12326 # @return New GEOM.GEOM_Object, containing the found face.
12328 # @ref swig_GetOppositeFace "Example"
12329 @ManageTransactions("BlocksOp")
12330 def GetOppositeFace(self, theBlock, theFace, theName=None):
12332 Find a face, opposite to the given one in the given block.
12335 theBlock Must be a hexahedral solid.
12336 theFace Face of theBlock, opposite to the desired face.
12337 theName Object name; when specified, this parameter is used
12338 for result publication in the study. Otherwise, if automatic
12339 publication is switched on, default value is used for result name.
12342 New GEOM.GEOM_Object, containing the found face.
12344 # Example: see GEOM_Spanner.py
12345 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12346 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12347 self._autoPublish(anObj, theName, "face")
12350 ## Find a face of the given shape, which has minimal distance to the given point.
12351 # @param theShape Block or a compound of blocks.
12352 # @param thePoint Point, close to the desired face.
12353 # @param theName Object name; when specified, this parameter is used
12354 # for result publication in the study. Otherwise, if automatic
12355 # publication is switched on, default value is used for result name.
12357 # @return New GEOM.GEOM_Object, containing the found face.
12359 # @ref swig_GetFaceNearPoint "Example"
12360 @ManageTransactions("BlocksOp")
12361 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12363 Find a face of the given shape, which has minimal distance to the given point.
12366 theShape Block or a compound of blocks.
12367 thePoint Point, close to the desired face.
12368 theName Object name; when specified, this parameter is used
12369 for result publication in the study. Otherwise, if automatic
12370 publication is switched on, default value is used for result name.
12373 New GEOM.GEOM_Object, containing the found face.
12375 # Example: see GEOM_Spanner.py
12376 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12377 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12378 self._autoPublish(anObj, theName, "face")
12381 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12382 # @param theBlock Block or a compound of blocks.
12383 # @param theVector Vector, close to the normale of the desired face.
12384 # @param theName Object name; when specified, this parameter is used
12385 # for result publication in the study. Otherwise, if automatic
12386 # publication is switched on, default value is used for result name.
12388 # @return New GEOM.GEOM_Object, containing the found face.
12390 # @ref swig_todo "Example"
12391 @ManageTransactions("BlocksOp")
12392 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12394 Find a face of block, whose outside normale has minimal angle with the given vector.
12397 theBlock Block or a compound of blocks.
12398 theVector Vector, close to the normale of the desired face.
12399 theName Object name; when specified, this parameter is used
12400 for result publication in the study. Otherwise, if automatic
12401 publication is switched on, default value is used for result name.
12404 New GEOM.GEOM_Object, containing the found face.
12406 # Example: see GEOM_Spanner.py
12407 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12408 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12409 self._autoPublish(anObj, theName, "face")
12412 ## Find all sub-shapes of type \a theShapeType of the given shape,
12413 # which have minimal distance to the given point.
12414 # @param theShape Any shape.
12415 # @param thePoint Point, close to the desired shape.
12416 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12417 # @param theTolerance The tolerance for distances comparison. All shapes
12418 # with distances to the given point in interval
12419 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12420 # @param theName Object name; when specified, this parameter is used
12421 # for result publication in the study. Otherwise, if automatic
12422 # publication is switched on, default value is used for result name.
12424 # @return New GEOM_Object, containing a group of all found shapes.
12426 # @ref swig_GetShapesNearPoint "Example"
12427 @ManageTransactions("BlocksOp")
12428 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12430 Find all sub-shapes of type theShapeType of the given shape,
12431 which have minimal distance to the given point.
12434 theShape Any shape.
12435 thePoint Point, close to the desired shape.
12436 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12437 theTolerance The tolerance for distances comparison. All shapes
12438 with distances to the given point in interval
12439 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12440 theName Object name; when specified, this parameter is used
12441 for result publication in the study. Otherwise, if automatic
12442 publication is switched on, default value is used for result name.
12445 New GEOM_Object, containing a group of all found shapes.
12447 # Example: see GEOM_TestOthers.py
12448 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12449 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12450 self._autoPublish(anObj, theName, "group")
12453 # end of l3_blocks_op
12456 ## @addtogroup l4_blocks_measure
12459 ## Check, if the compound of blocks is given.
12460 # To be considered as a compound of blocks, the
12461 # given shape must satisfy the following conditions:
12462 # - Each element of the compound should be a Block (6 faces).
12463 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12464 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12465 # there are more than 4 edges in the only wire of a face,
12466 # this face is considered to be quadrangle if it has 4 bounds
12467 # (1 or more edge) of C1 continuity.
12468 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12469 # - The compound should be connexe.
12470 # - The glue between two quadrangle faces should be applied.
12471 # @param theCompound The compound to check.
12472 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12473 # taking into account C1 continuity.
12474 # @param theAngTolerance the angular tolerance to check if two neighbor
12475 # edges are codirectional in the common vertex with this
12476 # tolerance. This parameter is used only if
12477 # <VAR>theIsUseC1</VAR> is set to True.
12478 # @return TRUE, if the given shape is a compound of blocks.
12479 # If theCompound is not valid, prints all discovered errors.
12481 # @ref tui_check_compound_of_blocks_page "Example 1"
12482 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12483 @ManageTransactions("BlocksOp")
12484 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12485 theAngTolerance = 1.e-12):
12487 Check, if the compound of blocks is given.
12488 To be considered as a compound of blocks, the
12489 given shape must satisfy the following conditions:
12490 - Each element of the compound should be a Block (6 faces).
12491 - Each face should be a quadrangle, i.e. it should have only 1 wire
12492 with 4 edges. If theIsUseC1 is set to True and
12493 there are more than 4 edges in the only wire of a face,
12494 this face is considered to be quadrangle if it has 4 bounds
12495 (1 or more edge) of C1 continuity.
12496 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12497 - The compound should be connexe.
12498 - The glue between two quadrangle faces should be applied.
12501 theCompound The compound to check.
12502 theIsUseC1 Flag to check if there are 4 bounds on a face
12503 taking into account C1 continuity.
12504 theAngTolerance the angular tolerance to check if two neighbor
12505 edges are codirectional in the common vertex with this
12506 tolerance. This parameter is used only if
12507 theIsUseC1 is set to True.
12510 TRUE, if the given shape is a compound of blocks.
12511 If theCompound is not valid, prints all discovered errors.
12513 # Example: see GEOM_Spanner.py
12516 aTolerance = theAngTolerance
12517 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12518 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12520 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12524 ## Retrieve all non blocks solids and faces from \a theShape.
12525 # @param theShape The shape to explore.
12526 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12527 # taking into account C1 continuity.
12528 # @param theAngTolerance the angular tolerance to check if two neighbor
12529 # edges are codirectional in the common vertex with this
12530 # tolerance. This parameter is used only if
12531 # <VAR>theIsUseC1</VAR> is set to True.
12532 # @param theName Object name; when specified, this parameter is used
12533 # for result publication in the study. Otherwise, if automatic
12534 # publication is switched on, default value is used for result name.
12536 # @return A tuple of two GEOM_Objects. The first object is a group of all
12537 # non block solids (= not 6 faces, or with 6 faces, but with the
12538 # presence of non-quadrangular faces). The second object is a
12539 # group of all non quadrangular faces (= faces with more then
12540 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12541 # with 1 wire with not 4 edges that do not form 4 bounds of
12544 # @ref tui_get_non_blocks_page "Example 1"
12545 # \n @ref swig_GetNonBlocks "Example 2"
12546 @ManageTransactions("BlocksOp")
12547 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12548 theAngTolerance = 1.e-12, theName=None):
12550 Retrieve all non blocks solids and faces from theShape.
12553 theShape The shape to explore.
12554 theIsUseC1 Flag to check if there are 4 bounds on a face
12555 taking into account C1 continuity.
12556 theAngTolerance the angular tolerance to check if two neighbor
12557 edges are codirectional in the common vertex with this
12558 tolerance. This parameter is used only if
12559 theIsUseC1 is set to True.
12560 theName Object name; when specified, this parameter is used
12561 for result publication in the study. Otherwise, if automatic
12562 publication is switched on, default value is used for result name.
12565 A tuple of two GEOM_Objects. The first object is a group of all
12566 non block solids (= not 6 faces, or with 6 faces, but with the
12567 presence of non-quadrangular faces). The second object is a
12568 group of all non quadrangular faces (= faces with more then
12569 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12570 with 1 wire with not 4 edges that do not form 4 bounds of
12574 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12576 # Example: see GEOM_Spanner.py
12579 aTolerance = theAngTolerance
12580 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12581 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12582 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12585 ## Remove all seam and degenerated edges from \a theShape.
12586 # Unite faces and edges, sharing one surface. It means that
12587 # this faces must have references to one C++ surface object (handle).
12588 # @param theShape The compound or single solid to remove irregular edges from.
12589 # @param doUnionFaces If True, then unite faces. If False (the default value),
12590 # do not unite faces.
12591 # @param theName Object name; when specified, this parameter is used
12592 # for result publication in the study. Otherwise, if automatic
12593 # publication is switched on, default value is used for result name.
12595 # @return Improved shape.
12597 # @ref swig_RemoveExtraEdges "Example"
12598 @ManageTransactions("BlocksOp")
12599 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12601 Remove all seam and degenerated edges from theShape.
12602 Unite faces and edges, sharing one surface. It means that
12603 this faces must have references to one C++ surface object (handle).
12606 theShape The compound or single solid to remove irregular edges from.
12607 doUnionFaces If True, then unite faces. If False (the default value),
12608 do not unite faces.
12609 theName Object name; when specified, this parameter is used
12610 for result publication in the study. Otherwise, if automatic
12611 publication is switched on, default value is used for result name.
12616 # Example: see GEOM_TestOthers.py
12617 nbFacesOptimum = -1 # -1 means do not unite faces
12618 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12619 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12620 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12621 self._autoPublish(anObj, theName, "removeExtraEdges")
12624 ## Performs union faces of \a theShape
12625 # Unite faces sharing one surface. It means that
12626 # these faces must have references to one C++ surface object (handle).
12627 # @param theShape The compound or single solid that contains faces
12628 # to perform union.
12629 # @param theName Object name; when specified, this parameter is used
12630 # for result publication in the study. Otherwise, if automatic
12631 # publication is switched on, default value is used for result name.
12633 # @return Improved shape.
12635 # @ref swig_UnionFaces "Example"
12636 @ManageTransactions("BlocksOp")
12637 def UnionFaces(self, theShape, theName=None):
12639 Performs union faces of theShape.
12640 Unite faces sharing one surface. It means that
12641 these faces must have references to one C++ surface object (handle).
12644 theShape The compound or single solid that contains faces
12646 theName Object name; when specified, this parameter is used
12647 for result publication in the study. Otherwise, if automatic
12648 publication is switched on, default value is used for result name.
12653 # Example: see GEOM_TestOthers.py
12654 anObj = self.BlocksOp.UnionFaces(theShape)
12655 RaiseIfFailed("UnionFaces", self.BlocksOp)
12656 self._autoPublish(anObj, theName, "unionFaces")
12659 ## Check, if the given shape is a blocks compound.
12660 # Fix all detected errors.
12661 # \note Single block can be also fixed by this method.
12662 # @param theShape The compound to check and improve.
12663 # @param theName Object name; when specified, this parameter is used
12664 # for result publication in the study. Otherwise, if automatic
12665 # publication is switched on, default value is used for result name.
12667 # @return Improved compound.
12669 # @ref swig_CheckAndImprove "Example"
12670 @ManageTransactions("BlocksOp")
12671 def CheckAndImprove(self, theShape, theName=None):
12673 Check, if the given shape is a blocks compound.
12674 Fix all detected errors.
12677 Single block can be also fixed by this method.
12680 theShape The compound to check and improve.
12681 theName Object name; when specified, this parameter is used
12682 for result publication in the study. Otherwise, if automatic
12683 publication is switched on, default value is used for result name.
12688 # Example: see GEOM_TestOthers.py
12689 anObj = self.BlocksOp.CheckAndImprove(theShape)
12690 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12691 self._autoPublish(anObj, theName, "improved")
12694 # end of l4_blocks_measure
12697 ## @addtogroup l3_blocks_op
12700 ## Get all the blocks, contained in the given compound.
12701 # @param theCompound The compound to explode.
12702 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12703 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12704 # @param theName Object name; when specified, this parameter is used
12705 # for result publication in the study. Otherwise, if automatic
12706 # publication is switched on, default value is used for result name.
12708 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12710 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12712 # @ref tui_explode_on_blocks "Example 1"
12713 # \n @ref swig_MakeBlockExplode "Example 2"
12714 @ManageTransactions("BlocksOp")
12715 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12717 Get all the blocks, contained in the given compound.
12720 theCompound The compound to explode.
12721 theMinNbFaces If solid has lower number of faces, it is not a block.
12722 theMaxNbFaces If solid has higher number of faces, it is not a block.
12723 theName Object name; when specified, this parameter is used
12724 for result publication in the study. Otherwise, if automatic
12725 publication is switched on, default value is used for result name.
12728 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12731 List of GEOM.GEOM_Object, containing the retrieved blocks.
12733 # Example: see GEOM_TestOthers.py
12734 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12735 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12736 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12737 for anObj in aList:
12738 anObj.SetParameters(Parameters)
12740 self._autoPublish(aList, theName, "block")
12743 ## Find block, containing the given point inside its volume or on boundary.
12744 # @param theCompound Compound, to find block in.
12745 # @param thePoint Point, close to the desired block. If the point lays on
12746 # boundary between some blocks, we return block with nearest center.
12747 # @param theName Object name; when specified, this parameter is used
12748 # for result publication in the study. Otherwise, if automatic
12749 # publication is switched on, default value is used for result name.
12751 # @return New GEOM.GEOM_Object, containing the found block.
12753 # @ref swig_todo "Example"
12754 @ManageTransactions("BlocksOp")
12755 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12757 Find block, containing the given point inside its volume or on boundary.
12760 theCompound Compound, to find block in.
12761 thePoint Point, close to the desired block. If the point lays on
12762 boundary between some blocks, we return block with nearest center.
12763 theName Object name; when specified, this parameter is used
12764 for result publication in the study. Otherwise, if automatic
12765 publication is switched on, default value is used for result name.
12768 New GEOM.GEOM_Object, containing the found block.
12770 # Example: see GEOM_Spanner.py
12771 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12772 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12773 self._autoPublish(anObj, theName, "block")
12776 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12777 # @param theCompound Compound, to find block in.
12778 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12779 # @param theName Object name; when specified, this parameter is used
12780 # for result publication in the study. Otherwise, if automatic
12781 # publication is switched on, default value is used for result name.
12783 # @return New GEOM.GEOM_Object, containing the found block.
12785 # @ref swig_GetBlockByParts "Example"
12786 @ManageTransactions("BlocksOp")
12787 def GetBlockByParts(self, theCompound, theParts, theName=None):
12789 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12792 theCompound Compound, to find block in.
12793 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12794 theName Object name; when specified, this parameter is used
12795 for result publication in the study. Otherwise, if automatic
12796 publication is switched on, default value is used for result name.
12799 New GEOM_Object, containing the found block.
12801 # Example: see GEOM_TestOthers.py
12802 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12803 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12804 self._autoPublish(anObj, theName, "block")
12807 ## Return all blocks, containing all the elements, passed as the parts.
12808 # @param theCompound Compound, to find blocks in.
12809 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12810 # @param theName Object name; when specified, this parameter is used
12811 # for result publication in the study. Otherwise, if automatic
12812 # publication is switched on, default value is used for result name.
12814 # @return List of GEOM.GEOM_Object, containing the found blocks.
12816 # @ref swig_todo "Example"
12817 @ManageTransactions("BlocksOp")
12818 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12820 Return all blocks, containing all the elements, passed as the parts.
12823 theCompound Compound, to find blocks in.
12824 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12825 theName Object name; when specified, this parameter is used
12826 for result publication in the study. Otherwise, if automatic
12827 publication is switched on, default value is used for result name.
12830 List of GEOM.GEOM_Object, containing the found blocks.
12832 # Example: see GEOM_Spanner.py
12833 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12834 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12835 self._autoPublish(aList, theName, "block")
12838 ## Multi-transformate block and glue the result.
12839 # Transformation is defined so, as to superpose direction faces.
12840 # @param Block Hexahedral solid to be multi-transformed.
12841 # @param DirFace1 ID of First direction face.
12842 # @param DirFace2 ID of Second direction face.
12843 # @param NbTimes Quantity of transformations to be done.
12844 # @param theName Object name; when specified, this parameter is used
12845 # for result publication in the study. Otherwise, if automatic
12846 # publication is switched on, default value is used for result name.
12848 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12850 # @return New GEOM.GEOM_Object, containing the result shape.
12852 # @ref tui_multi_transformation "Example"
12853 @ManageTransactions("BlocksOp")
12854 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12856 Multi-transformate block and glue the result.
12857 Transformation is defined so, as to superpose direction faces.
12860 Block Hexahedral solid to be multi-transformed.
12861 DirFace1 ID of First direction face.
12862 DirFace2 ID of Second direction face.
12863 NbTimes Quantity of transformations to be done.
12864 theName Object name; when specified, this parameter is used
12865 for result publication in the study. Otherwise, if automatic
12866 publication is switched on, default value is used for result name.
12869 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12872 New GEOM.GEOM_Object, containing the result shape.
12874 # Example: see GEOM_Spanner.py
12875 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12876 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12877 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12878 anObj.SetParameters(Parameters)
12879 self._autoPublish(anObj, theName, "transformed")
12882 ## Multi-transformate block and glue the result.
12883 # @param Block Hexahedral solid to be multi-transformed.
12884 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12885 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12886 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12887 # @param theName Object name; when specified, this parameter is used
12888 # for result publication in the study. Otherwise, if automatic
12889 # publication is switched on, default value is used for result name.
12891 # @return New GEOM.GEOM_Object, containing the result shape.
12893 # @ref tui_multi_transformation "Example"
12894 @ManageTransactions("BlocksOp")
12895 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12896 DirFace1V, DirFace2V, NbTimesV, theName=None):
12898 Multi-transformate block and glue the result.
12901 Block Hexahedral solid to be multi-transformed.
12902 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12903 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12904 NbTimesU,NbTimesV Quantity of transformations to be done.
12905 theName Object name; when specified, this parameter is used
12906 for result publication in the study. Otherwise, if automatic
12907 publication is switched on, default value is used for result name.
12910 New GEOM.GEOM_Object, containing the result shape.
12912 # Example: see GEOM_Spanner.py
12913 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12914 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12915 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12916 DirFace1V, DirFace2V, NbTimesV)
12917 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12918 anObj.SetParameters(Parameters)
12919 self._autoPublish(anObj, theName, "transformed")
12922 ## Build all possible propagation groups.
12923 # Propagation group is a set of all edges, opposite to one (main)
12924 # edge of this group directly or through other opposite edges.
12925 # Notion of Opposite Edge make sense only on quadrangle face.
12926 # @param theShape Shape to build propagation groups on.
12927 # @param theName Object name; when specified, this parameter is used
12928 # for result publication in the study. Otherwise, if automatic
12929 # publication is switched on, default value is used for result name.
12931 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12933 # @ref swig_Propagate "Example"
12934 @ManageTransactions("BlocksOp")
12935 def Propagate(self, theShape, theName=None):
12937 Build all possible propagation groups.
12938 Propagation group is a set of all edges, opposite to one (main)
12939 edge of this group directly or through other opposite edges.
12940 Notion of Opposite Edge make sense only on quadrangle face.
12943 theShape Shape to build propagation groups on.
12944 theName Object name; when specified, this parameter is used
12945 for result publication in the study. Otherwise, if automatic
12946 publication is switched on, default value is used for result name.
12949 List of GEOM.GEOM_Object, each of them is a propagation group.
12951 # Example: see GEOM_TestOthers.py
12952 listChains = self.BlocksOp.Propagate(theShape)
12953 RaiseIfFailed("Propagate", self.BlocksOp)
12954 self._autoPublish(listChains, theName, "propagate")
12957 # end of l3_blocks_op
12960 ## @addtogroup l3_groups
12963 ## Creates a new group which will store sub-shapes of theMainShape
12964 # @param theMainShape is a GEOM object on which the group is selected
12965 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12966 # @param theName Object name; when specified, this parameter is used
12967 # for result publication in the study. Otherwise, if automatic
12968 # publication is switched on, default value is used for result name.
12970 # @return a newly created GEOM group (GEOM.GEOM_Object)
12972 # @ref tui_working_with_groups_page "Example 1"
12973 # \n @ref swig_CreateGroup "Example 2"
12974 @ManageTransactions("GroupOp")
12975 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12977 Creates a new group which will store sub-shapes of theMainShape
12980 theMainShape is a GEOM object on which the group is selected
12981 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12982 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12983 theName Object name; when specified, this parameter is used
12984 for result publication in the study. Otherwise, if automatic
12985 publication is switched on, default value is used for result name.
12988 a newly created GEOM group
12991 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12994 # Example: see GEOM_TestOthers.py
12995 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12996 RaiseIfFailed("CreateGroup", self.GroupOp)
12997 self._autoPublish(anObj, theName, "group")
13000 ## Adds a sub-object with ID theSubShapeId to the group
13001 # @param theGroup is a GEOM group to which the new sub-shape is added
13002 # @param theSubShapeID is a sub-shape ID in the main object.
13003 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13005 # @ref tui_working_with_groups_page "Example"
13006 @ManageTransactions("GroupOp")
13007 def AddObject(self,theGroup, theSubShapeID):
13009 Adds a sub-object with ID theSubShapeId to the group
13012 theGroup is a GEOM group to which the new sub-shape is added
13013 theSubShapeID is a sub-shape ID in the main object.
13016 Use method GetSubShapeID() to get an unique ID of the sub-shape
13018 # Example: see GEOM_TestOthers.py
13019 self.GroupOp.AddObject(theGroup, theSubShapeID)
13020 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13021 RaiseIfFailed("AddObject", self.GroupOp)
13025 ## Removes a sub-object with ID \a theSubShapeId from the group
13026 # @param theGroup is a GEOM group from which the new sub-shape is removed
13027 # @param theSubShapeID is a sub-shape ID in the main object.
13028 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13030 # @ref tui_working_with_groups_page "Example"
13031 @ManageTransactions("GroupOp")
13032 def RemoveObject(self,theGroup, theSubShapeID):
13034 Removes a sub-object with ID theSubShapeId from the group
13037 theGroup is a GEOM group from which the new sub-shape is removed
13038 theSubShapeID is a sub-shape ID in the main object.
13041 Use method GetSubShapeID() to get an unique ID of the sub-shape
13043 # Example: see GEOM_TestOthers.py
13044 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13045 RaiseIfFailed("RemoveObject", self.GroupOp)
13048 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13049 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13050 # @param theSubShapes is a list of sub-shapes to be added.
13052 # @ref tui_working_with_groups_page "Example"
13053 @ManageTransactions("GroupOp")
13054 def UnionList (self,theGroup, theSubShapes):
13056 Adds to the group all the given shapes. No errors, if some shapes are already included.
13059 theGroup is a GEOM group to which the new sub-shapes are added.
13060 theSubShapes is a list of sub-shapes to be added.
13062 # Example: see GEOM_TestOthers.py
13063 self.GroupOp.UnionList(theGroup, theSubShapes)
13064 RaiseIfFailed("UnionList", self.GroupOp)
13067 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13068 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13069 # @param theSubShapes is a list of indices of sub-shapes to be added.
13071 # @ref swig_UnionIDs "Example"
13072 @ManageTransactions("GroupOp")
13073 def UnionIDs(self,theGroup, theSubShapes):
13075 Adds to the group all the given shapes. No errors, if some shapes are already included.
13078 theGroup is a GEOM group to which the new sub-shapes are added.
13079 theSubShapes is a list of indices of sub-shapes to be added.
13081 # Example: see GEOM_TestOthers.py
13082 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13083 RaiseIfFailed("UnionIDs", self.GroupOp)
13086 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13087 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13088 # @param theSubShapes is a list of sub-shapes to be removed.
13090 # @ref tui_working_with_groups_page "Example"
13091 @ManageTransactions("GroupOp")
13092 def DifferenceList (self,theGroup, theSubShapes):
13094 Removes from the group all the given shapes. No errors, if some shapes are not included.
13097 theGroup is a GEOM group from which the sub-shapes are removed.
13098 theSubShapes is a list of sub-shapes to be removed.
13100 # Example: see GEOM_TestOthers.py
13101 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13102 RaiseIfFailed("DifferenceList", self.GroupOp)
13105 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13106 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13107 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13109 # @ref swig_DifferenceIDs "Example"
13110 @ManageTransactions("GroupOp")
13111 def DifferenceIDs(self,theGroup, theSubShapes):
13113 Removes from the group all the given shapes. No errors, if some shapes are not included.
13116 theGroup is a GEOM group from which the sub-shapes are removed.
13117 theSubShapes is a list of indices of sub-shapes to be removed.
13119 # Example: see GEOM_TestOthers.py
13120 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13121 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13124 ## Union of two groups.
13125 # New group is created. It will contain all entities
13126 # which are present in groups theGroup1 and theGroup2.
13127 # @param theGroup1, theGroup2 are the initial GEOM groups
13128 # to create the united group from.
13129 # @param theName Object name; when specified, this parameter is used
13130 # for result publication in the study. Otherwise, if automatic
13131 # publication is switched on, default value is used for result name.
13133 # @return a newly created GEOM group.
13135 # @ref tui_union_groups_anchor "Example"
13136 @ManageTransactions("GroupOp")
13137 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13139 Union of two groups.
13140 New group is created. It will contain all entities
13141 which are present in groups theGroup1 and theGroup2.
13144 theGroup1, theGroup2 are the initial GEOM groups
13145 to create the united group from.
13146 theName Object name; when specified, this parameter is used
13147 for result publication in the study. Otherwise, if automatic
13148 publication is switched on, default value is used for result name.
13151 a newly created GEOM group.
13153 # Example: see GEOM_TestOthers.py
13154 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13155 RaiseIfFailed("UnionGroups", self.GroupOp)
13156 self._autoPublish(aGroup, theName, "group")
13159 ## Intersection of two groups.
13160 # New group is created. It will contain only those entities
13161 # which are present in both groups theGroup1 and theGroup2.
13162 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13163 # @param theName Object name; when specified, this parameter is used
13164 # for result publication in the study. Otherwise, if automatic
13165 # publication is switched on, default value is used for result name.
13167 # @return a newly created GEOM group.
13169 # @ref tui_intersect_groups_anchor "Example"
13170 @ManageTransactions("GroupOp")
13171 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13173 Intersection of two groups.
13174 New group is created. It will contain only those entities
13175 which are present in both groups theGroup1 and theGroup2.
13178 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13179 theName Object name; when specified, this parameter is used
13180 for result publication in the study. Otherwise, if automatic
13181 publication is switched on, default value is used for result name.
13184 a newly created GEOM group.
13186 # Example: see GEOM_TestOthers.py
13187 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13188 RaiseIfFailed("IntersectGroups", self.GroupOp)
13189 self._autoPublish(aGroup, theName, "group")
13192 ## Cut of two groups.
13193 # New group is created. It will contain entities which are
13194 # present in group theGroup1 but are not present in group theGroup2.
13195 # @param theGroup1 is a GEOM group to include elements of.
13196 # @param theGroup2 is a GEOM group to exclude elements of.
13197 # @param theName Object name; when specified, this parameter is used
13198 # for result publication in the study. Otherwise, if automatic
13199 # publication is switched on, default value is used for result name.
13201 # @return a newly created GEOM group.
13203 # @ref tui_cut_groups_anchor "Example"
13204 @ManageTransactions("GroupOp")
13205 def CutGroups (self, theGroup1, theGroup2, theName=None):
13208 New group is created. It will contain entities which are
13209 present in group theGroup1 but are not present in group theGroup2.
13212 theGroup1 is a GEOM group to include elements of.
13213 theGroup2 is a GEOM group to exclude elements of.
13214 theName Object name; when specified, this parameter is used
13215 for result publication in the study. Otherwise, if automatic
13216 publication is switched on, default value is used for result name.
13219 a newly created GEOM group.
13221 # Example: see GEOM_TestOthers.py
13222 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13223 RaiseIfFailed("CutGroups", self.GroupOp)
13224 self._autoPublish(aGroup, theName, "group")
13227 ## Union of list of groups.
13228 # New group is created. It will contain all entities that are
13229 # present in groups listed in theGList.
13230 # @param theGList is a list of GEOM groups to create the united group from.
13231 # @param theName Object name; when specified, this parameter is used
13232 # for result publication in the study. Otherwise, if automatic
13233 # publication is switched on, default value is used for result name.
13235 # @return a newly created GEOM group.
13237 # @ref tui_union_groups_anchor "Example"
13238 @ManageTransactions("GroupOp")
13239 def UnionListOfGroups (self, theGList, theName=None):
13241 Union of list of groups.
13242 New group is created. It will contain all entities that are
13243 present in groups listed in theGList.
13246 theGList is a list of GEOM groups to create the united group from.
13247 theName Object name; when specified, this parameter is used
13248 for result publication in the study. Otherwise, if automatic
13249 publication is switched on, default value is used for result name.
13252 a newly created GEOM group.
13254 # Example: see GEOM_TestOthers.py
13255 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13256 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13257 self._autoPublish(aGroup, theName, "group")
13260 ## Cut of lists of groups.
13261 # New group is created. It will contain only entities
13262 # which are present in groups listed in theGList.
13263 # @param theGList is a list of GEOM groups to include elements of.
13264 # @param theName Object name; when specified, this parameter is used
13265 # for result publication in the study. Otherwise, if automatic
13266 # publication is switched on, default value is used for result name.
13268 # @return a newly created GEOM group.
13270 # @ref tui_intersect_groups_anchor "Example"
13271 @ManageTransactions("GroupOp")
13272 def IntersectListOfGroups (self, theGList, theName=None):
13274 Cut of lists of groups.
13275 New group is created. It will contain only entities
13276 which are present in groups listed in theGList.
13279 theGList is a list of GEOM groups to include elements of.
13280 theName Object name; when specified, this parameter is used
13281 for result publication in the study. Otherwise, if automatic
13282 publication is switched on, default value is used for result name.
13285 a newly created GEOM group.
13287 # Example: see GEOM_TestOthers.py
13288 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13289 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13290 self._autoPublish(aGroup, theName, "group")
13293 ## Cut of lists of groups.
13294 # New group is created. It will contain only entities
13295 # which are present in groups listed in theGList1 but
13296 # are not present in groups from theGList2.
13297 # @param theGList1 is a list of GEOM groups to include elements of.
13298 # @param theGList2 is a list of GEOM groups to exclude elements of.
13299 # @param theName Object name; when specified, this parameter is used
13300 # for result publication in the study. Otherwise, if automatic
13301 # publication is switched on, default value is used for result name.
13303 # @return a newly created GEOM group.
13305 # @ref tui_cut_groups_anchor "Example"
13306 @ManageTransactions("GroupOp")
13307 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13309 Cut of lists of groups.
13310 New group is created. It will contain only entities
13311 which are present in groups listed in theGList1 but
13312 are not present in groups from theGList2.
13315 theGList1 is a list of GEOM groups to include elements of.
13316 theGList2 is a list of GEOM groups to exclude elements of.
13317 theName Object name; when specified, this parameter is used
13318 for result publication in the study. Otherwise, if automatic
13319 publication is switched on, default value is used for result name.
13322 a newly created GEOM group.
13324 # Example: see GEOM_TestOthers.py
13325 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13326 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13327 self._autoPublish(aGroup, theName, "group")
13330 ## Returns a list of sub-objects ID stored in the group
13331 # @param theGroup is a GEOM group for which a list of IDs is requested
13333 # @ref swig_GetObjectIDs "Example"
13334 @ManageTransactions("GroupOp")
13335 def GetObjectIDs(self,theGroup):
13337 Returns a list of sub-objects ID stored in the group
13340 theGroup is a GEOM group for which a list of IDs is requested
13342 # Example: see GEOM_TestOthers.py
13343 ListIDs = self.GroupOp.GetObjects(theGroup)
13344 RaiseIfFailed("GetObjects", self.GroupOp)
13347 ## Returns a type of sub-objects stored in the group
13348 # @param theGroup is a GEOM group which type is returned.
13350 # @ref swig_GetType "Example"
13351 @ManageTransactions("GroupOp")
13352 def GetType(self,theGroup):
13354 Returns a type of sub-objects stored in the group
13357 theGroup is a GEOM group which type is returned.
13359 # Example: see GEOM_TestOthers.py
13360 aType = self.GroupOp.GetType(theGroup)
13361 RaiseIfFailed("GetType", self.GroupOp)
13364 ## Convert a type of geom object from id to string value
13365 # @param theId is a GEOM object type id.
13366 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13367 # @ref swig_GetType "Example"
13368 def ShapeIdToType(self, theId):
13370 Convert a type of geom object from id to string value
13373 theId is a GEOM object type id.
13376 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13403 return "REVOLUTION"
13451 return "FREE_BOUNDS"
13459 return "THRUSECTIONS"
13461 return "COMPOUNDFILTER"
13463 return "SHAPES_ON_SHAPE"
13465 return "ELLIPSE_ARC"
13467 return "3DSKETCHER"
13473 return "PIPETSHAPE"
13474 return "Shape Id not exist."
13476 ## Returns a main shape associated with the group
13477 # @param theGroup is a GEOM group for which a main shape object is requested
13478 # @return a GEOM object which is a main shape for theGroup
13480 # @ref swig_GetMainShape "Example"
13481 @ManageTransactions("GroupOp")
13482 def GetMainShape(self,theGroup):
13484 Returns a main shape associated with the group
13487 theGroup is a GEOM group for which a main shape object is requested
13490 a GEOM object which is a main shape for theGroup
13492 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13494 # Example: see GEOM_TestOthers.py
13495 anObj = self.GroupOp.GetMainShape(theGroup)
13496 RaiseIfFailed("GetMainShape", self.GroupOp)
13499 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13500 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13501 # @param theShape given shape (see GEOM.GEOM_Object)
13502 # @param min_length minimum length of edges of theShape
13503 # @param max_length maximum length of edges of theShape
13504 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13505 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13506 # @param theName Object name; when specified, this parameter is used
13507 # for result publication in the study. Otherwise, if automatic
13508 # publication is switched on, default value is used for result name.
13510 # @return a newly created GEOM group of edges
13512 # @@ref swig_todo "Example"
13513 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13515 Create group of edges of theShape, whose length is in range [min_length, max_length].
13516 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13519 theShape given shape
13520 min_length minimum length of edges of theShape
13521 max_length maximum length of edges of theShape
13522 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13523 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13524 theName Object name; when specified, this parameter is used
13525 for result publication in the study. Otherwise, if automatic
13526 publication is switched on, default value is used for result name.
13529 a newly created GEOM group of edges.
13531 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13532 edges_in_range = []
13534 Props = self.BasicProperties(edge)
13535 if min_length <= Props[0] and Props[0] <= max_length:
13536 if (not include_min) and (min_length == Props[0]):
13539 if (not include_max) and (Props[0] == max_length):
13542 edges_in_range.append(edge)
13544 if len(edges_in_range) <= 0:
13545 print("No edges found by given criteria")
13548 # note: auto-publishing is done in self.CreateGroup()
13549 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13550 self.UnionList(group_edges, edges_in_range)
13554 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13555 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13556 # @param min_length minimum length of edges of selected shape
13557 # @param max_length maximum length of edges of selected shape
13558 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13559 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13560 # @return a newly created GEOM group of edges
13561 # @ref swig_todo "Example"
13562 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13564 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13565 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13568 min_length minimum length of edges of selected shape
13569 max_length maximum length of edges of selected shape
13570 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13571 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13574 a newly created GEOM group of edges.
13576 nb_selected = sg.SelectedCount()
13577 if nb_selected < 1:
13578 print("Select a shape before calling this function, please.")
13580 if nb_selected > 1:
13581 print("Only one shape must be selected")
13584 id_shape = sg.getSelected(0)
13585 shape = IDToObject( id_shape )
13587 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13591 if include_min: left_str = " <= "
13592 if include_max: right_str = " <= "
13594 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13595 + left_str + "length" + right_str + repr(max_length))
13597 sg.updateObjBrowser()
13604 #@@ insert new functions before this line @@ do not remove this line @@#
13606 ## Create a copy of the given object
13608 # @param theOriginal geometry object for copy
13609 # @param theName Object name; when specified, this parameter is used
13610 # for result publication in the study. Otherwise, if automatic
13611 # publication is switched on, default value is used for result name.
13613 # @return New GEOM_Object, containing the copied shape.
13615 # @ingroup l1_geomBuilder_auxiliary
13616 # @ref swig_MakeCopy "Example"
13617 @ManageTransactions("InsertOp")
13618 def MakeCopy(self, theOriginal, theName=None):
13620 Create a copy of the given object
13623 theOriginal geometry object for copy
13624 theName Object name; when specified, this parameter is used
13625 for result publication in the study. Otherwise, if automatic
13626 publication is switched on, default value is used for result name.
13629 New GEOM_Object, containing the copied shape.
13631 Example of usage: Copy = geompy.MakeCopy(Box)
13633 # Example: see GEOM_TestAll.py
13634 anObj = self.InsertOp.MakeCopy(theOriginal)
13635 RaiseIfFailed("MakeCopy", self.InsertOp)
13636 self._autoPublish(anObj, theName, "copy")
13639 ## Add Path to load python scripts from
13640 # @param Path a path to load python scripts from
13641 # @ingroup l1_geomBuilder_auxiliary
13642 def addPath(self,Path):
13644 Add Path to load python scripts from
13647 Path a path to load python scripts from
13649 if (sys.path.count(Path) < 1):
13650 sys.path.append(Path)
13654 ## Load marker texture from the file
13655 # @param Path a path to the texture file
13656 # @return unique texture identifier
13657 # @ingroup l1_geomBuilder_auxiliary
13658 @ManageTransactions("InsertOp")
13659 def LoadTexture(self, Path):
13661 Load marker texture from the file
13664 Path a path to the texture file
13667 unique texture identifier
13669 # Example: see GEOM_TestAll.py
13670 ID = self.InsertOp.LoadTexture(Path)
13671 RaiseIfFailed("LoadTexture", self.InsertOp)
13674 ## Get internal name of the object based on its study entry
13675 # @note This method does not provide an unique identifier of the geometry object.
13676 # @note This is internal function of GEOM component, though it can be used outside it for
13677 # appropriate reason (e.g. for identification of geometry object).
13678 # @param obj geometry object
13679 # @return unique object identifier
13680 # @ingroup l1_geomBuilder_auxiliary
13681 def getObjectID(self, obj):
13683 Get internal name of the object based on its study entry.
13684 Note: this method does not provide an unique identifier of the geometry object.
13685 It is an internal function of GEOM component, though it can be used outside GEOM for
13686 appropriate reason (e.g. for identification of geometry object).
13689 obj geometry object
13692 unique object identifier
13695 entry = salome.ObjectToID(obj)
13696 if entry is not None:
13697 lst = entry.split(":")
13699 ID = lst[-1] # -1 means last item in the list
13700 return "GEOM_" + ID
13705 ## Add marker texture. @a Width and @a Height parameters
13706 # specify width and height of the texture in pixels.
13707 # If @a RowData is @c True, @a Texture parameter should represent texture data
13708 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13709 # parameter should be unpacked string, in which '1' symbols represent opaque
13710 # pixels and '0' represent transparent pixels of the texture bitmap.
13712 # @param Width texture width in pixels
13713 # @param Height texture height in pixels
13714 # @param Texture texture data
13715 # @param RowData if @c True, @a Texture data are packed in the byte stream
13716 # @return unique texture identifier
13717 # @ingroup l1_geomBuilder_auxiliary
13718 @ManageTransactions("InsertOp")
13719 def AddTexture(self, Width, Height, Texture, RowData=False):
13721 Add marker texture. Width and Height parameters
13722 specify width and height of the texture in pixels.
13723 If RowData is True, Texture parameter should represent texture data
13724 packed into the byte array. If RowData is False (default), Texture
13725 parameter should be unpacked string, in which '1' symbols represent opaque
13726 pixels and '0' represent transparent pixels of the texture bitmap.
13729 Width texture width in pixels
13730 Height texture height in pixels
13731 Texture texture data
13732 RowData if True, Texture data are packed in the byte stream
13735 return unique texture identifier
13737 if not RowData: Texture = PackData(Texture)
13738 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13739 RaiseIfFailed("AddTexture", self.InsertOp)
13742 ## Transfer not topological data from one GEOM object to another.
13744 # @param theObjectFrom the source object of non-topological data
13745 # @param theObjectTo the destination object of non-topological data
13746 # @param theFindMethod method to search sub-shapes of theObjectFrom
13747 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13748 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13749 # Other values of GEOM.find_shape_method are not supported.
13751 # @return True in case of success; False otherwise.
13753 # @ingroup l1_geomBuilder_auxiliary
13755 # @ref swig_TransferData "Example"
13756 @ManageTransactions("InsertOp")
13757 def TransferData(self, theObjectFrom, theObjectTo,
13758 theFindMethod=GEOM.FSM_GetInPlace):
13760 Transfer not topological data from one GEOM object to another.
13763 theObjectFrom the source object of non-topological data
13764 theObjectTo the destination object of non-topological data
13765 theFindMethod method to search sub-shapes of theObjectFrom
13766 in shape theObjectTo. Possible values are:
13767 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13768 and GEOM.FSM_GetInPlace_Old. Other values of
13769 GEOM.find_shape_method are not supported.
13772 True in case of success; False otherwise.
13774 # Example: see GEOM_TestOthers.py
13776 # Example: see GEOM_TestAll.py
13777 isOk = self.InsertOp.TransferData(theObjectFrom,
13778 theObjectTo, theFindMethod)
13779 RaiseIfFailed("TransferData", self.InsertOp)
13782 ## Creates a new folder object. It is a container for any GEOM objects.
13783 # @param Name name of the container
13784 # @param Father parent object. If None,
13785 # folder under 'Geometry' root object will be created.
13786 # @return a new created folder
13787 # @ingroup l1_publish_data
13788 def NewFolder(self, Name, Father=None):
13790 Create a new folder object. It is an auxiliary container for any GEOM objects.
13793 Name name of the container
13794 Father parent object. If None,
13795 folder under 'Geometry' root object will be created.
13798 a new created folder
13800 return self.CreateFolder(Name, Father)
13802 ## Move object to the specified folder
13803 # @param Object object to move
13804 # @param Folder target folder
13805 # @ingroup l1_publish_data
13806 def PutToFolder(self, Object, Folder):
13808 Move object to the specified folder
13811 Object object to move
13812 Folder target folder
13814 self.MoveToFolder(Object, Folder)
13817 ## Move list of objects to the specified folder
13818 # @param ListOfSO list of objects to move
13819 # @param Folder target folder
13820 # @ingroup l1_publish_data
13821 def PutListToFolder(self, ListOfSO, Folder):
13823 Move list of objects to the specified folder
13826 ListOfSO list of objects to move
13827 Folder target folder
13829 self.MoveListToFolder(ListOfSO, Folder)
13832 ## @addtogroup l2_field
13836 # @param shape the shape the field lies on
13837 # @param name the field name
13838 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13839 # @param dimension dimension of the shape the field lies on
13840 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13841 # @param componentNames names of components
13842 # @return a created field
13843 @ManageTransactions("FieldOp")
13844 def CreateField(self, shape, name, type, dimension, componentNames):
13849 shape the shape the field lies on
13850 name the field name
13851 type type of field data
13852 dimension dimension of the shape the field lies on
13853 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13854 componentNames names of components
13859 if isinstance( type, int ):
13860 if type < 0 or type > 3:
13861 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13862 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13864 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13865 RaiseIfFailed("CreateField", self.FieldOp)
13867 geom._autoPublish( f, "", name)
13870 ## Removes a field from the GEOM component
13871 # @param field the field to remove
13872 def RemoveField(self, field):
13873 "Removes a field from the GEOM component"
13875 if isinstance( field, GEOM._objref_GEOM_Field ):
13876 geom.RemoveObject( field )
13877 elif isinstance( field, geomField ):
13878 geom.RemoveObject( field.field )
13880 raise RuntimeError("RemoveField() : the object is not a field")
13883 ## Returns number of fields on a shape
13884 @ManageTransactions("FieldOp")
13885 def CountFields(self, shape):
13886 "Returns number of fields on a shape"
13887 nb = self.FieldOp.CountFields( shape )
13888 RaiseIfFailed("CountFields", self.FieldOp)
13891 ## Returns all fields on a shape
13892 @ManageTransactions("FieldOp")
13893 def GetFields(self, shape):
13894 "Returns all fields on a shape"
13895 ff = self.FieldOp.GetFields( shape )
13896 RaiseIfFailed("GetFields", self.FieldOp)
13899 ## Returns a field on a shape by its name
13900 @ManageTransactions("FieldOp")
13901 def GetField(self, shape, name):
13902 "Returns a field on a shape by its name"
13903 f = self.FieldOp.GetField( shape, name )
13904 RaiseIfFailed("GetField", self.FieldOp)
13910 ## @addtogroup l2_testing
13913 ## Build a mesh on the given shape.
13914 # @param shape the source shape
13915 # @param linear_deflection linear deflection coefficient
13916 # @param is_relative says if given value of deflection is relative to shape's bounding box
13917 # @param angular_deflection angular deflection for edges in degrees
13918 # @return True in case of success; otherwise False.
13919 @ManageTransactions("TestOp")
13920 def Tesselate(self, shape, linear_deflection=0, is_relative=True, angular_deflection=0):
13921 """Build a mesh on the given shape.
13924 shape the source shape
13925 linear_deflection linear deflection coefficient
13926 is_relative says if given value of deflection is relative to shape's bounding box
13927 angular_deflection angular deflection for edges in degrees
13930 True in case of success; otherwise False.
13932 if angular_deflection > 0:
13933 angular_deflection = angular_deflection * math.pi / 180.
13934 r = self.TestOp.Tesselate(shape, linear_deflection, is_relative, angular_deflection)
13935 RaiseIfFailed("Tesselate", self.TestOp)
13938 # end of l2_testing
13942 # Register the new proxy for GEOM_Gen
13943 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13946 ## Field on Geometry
13947 # @ingroup l2_field
13948 class geomField( GEOM._objref_GEOM_Field ):
13950 def __init__(self, *args):
13951 GEOM._objref_GEOM_Field.__init__(self, *args)
13952 self.field = GEOM._objref_GEOM_Field
13955 ## Returns the shape the field lies on
13956 def getShape(self):
13957 "Returns the shape the field lies on"
13958 return self.field.GetShape(self)
13960 ## Returns the field name
13962 "Returns the field name"
13963 return self.field.GetName(self)
13965 ## Returns type of field data as integer [0-3]
13967 "Returns type of field data"
13968 return EnumToLong(self.field.GetDataType(self))
13970 ## Returns type of field data:
13971 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13972 def getTypeEnum(self):
13973 "Returns type of field data"
13974 return self.field.GetDataType(self)
13976 ## Returns dimension of the shape the field lies on:
13977 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13978 def getDimension(self):
13979 """Returns dimension of the shape the field lies on:
13980 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13981 return self.field.GetDimension(self)
13983 ## Returns names of components
13984 def getComponents(self):
13985 "Returns names of components"
13986 return self.field.GetComponents(self)
13988 ## Adds a time step to the field
13989 # @param step the time step number further used as the step identifier
13990 # @param stamp the time step time
13991 # @param values the values of the time step
13992 def addStep(self, step, stamp, values):
13993 "Adds a time step to the field"
13994 stp = self.field.AddStep( self, step, stamp )
13996 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
13998 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13999 self.setValues( step, values )
14002 ## Remove a time step from the field
14003 def removeStep(self,step):
14004 "Remove a time step from the field"
14007 stepObj = self.field.GetStep( self, step )
14009 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
14012 #traceback.print_exc()
14014 self.field.RemoveStep( self, step )
14016 geom.myBuilder.RemoveObjectWithChildren( stepSO )
14019 ## Returns number of time steps in the field
14020 def countSteps(self):
14021 "Returns number of time steps in the field"
14022 return self.field.CountSteps(self)
14024 ## Returns a list of time step IDs in the field
14025 def getSteps(self):
14026 "Returns a list of time step IDs in the field"
14027 return self.field.GetSteps(self)
14029 ## Returns a time step by its ID
14030 def getStep(self,step):
14031 "Returns a time step by its ID"
14032 stp = self.field.GetStep(self, step)
14034 raise RuntimeError("Step %s is missing from this field"%step)
14037 ## Returns the time of the field step
14038 def getStamp(self,step):
14039 "Returns the time of the field step"
14040 return self.getStep(step).GetStamp()
14042 ## Changes the time of the field step
14043 def setStamp(self, step, stamp):
14044 "Changes the time of the field step"
14045 return self.getStep(step).SetStamp(stamp)
14047 ## Returns values of the field step
14048 def getValues(self, step):
14049 "Returns values of the field step"
14050 return self.getStep(step).GetValues()
14052 ## Changes values of the field step
14053 def setValues(self, step, values):
14054 "Changes values of the field step"
14055 stp = self.getStep(step)
14056 errBeg = "Field.setValues(values) : Error: "
14058 ok = stp.SetValues( values )
14059 except Exception as e:
14061 if excStr.find("WrongPythonType") > 0:
14062 raise RuntimeError(errBeg +\
14063 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14064 raise RuntimeError(errBeg + str(e))
14066 nbOK = self.field.GetArraySize(self)
14069 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14071 raise RuntimeError(errBeg + "failed")
14074 pass # end of class geomField
14076 # Register the new proxy for GEOM_Field
14077 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14080 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14081 # interface to GEOM operations.
14086 # salome.salome_init()
14087 # from salome.geom import geomBuilder
14088 # geompy = geomBuilder.New()
14090 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14091 # @return geomBuilder instance
14092 def New( instance=None):
14094 Create a new geomBuilder instance.The geomBuilder class provides the Python
14095 interface to GEOM operations.
14099 salome.salome_init()
14100 from salome.geom import geomBuilder
14101 geompy = geomBuilder.New()
14104 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14106 geomBuilder instance
14108 #print "New geomBuilder ", study, instance
14112 if instance and isinstance( instance, SALOMEDS._objref_Study ):
14114 sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14119 geom = geomBuilder()
14120 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14125 # Register methods from the plug-ins in the geomBuilder class
14126 plugins_var = os.environ.get( "GEOM_PluginsList" )
14129 if plugins_var is not None:
14130 plugins = plugins_var.split( ":" )
14131 plugins=[x for x in plugins if len(x)>0]
14132 if plugins is not None:
14133 for pluginName in plugins:
14134 pluginBuilderName = pluginName + "Builder"
14136 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14137 except Exception as e:
14138 from salome_utils import verbose
14139 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14141 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14142 plugin = eval( pluginBuilderName )
14144 # add methods from plugin module to the geomBuilder class
14145 for k in dir( plugin ):
14146 if k[0] == '_': continue
14147 method = getattr( plugin, k )
14148 if type( method ).__name__ == 'function':
14149 if not hasattr( geomBuilder, k ):
14150 setattr( geomBuilder, k, method )