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, theNumberOfPnts=1, 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 theNumberOfPnts The number of points we want to get, 1 by default.
1455 theName Object name; when specified, this parameter is used
1456 for result publication in the study. Otherwise, if automatic
1457 publication is switched on, default value is used for result name.
1460 New GEOM.GEOM_Object, containing the created point.
1463 p_on_face = geompy.MakeVertexInsideFace(Face)
1465 # Example: see GEOM_TestAll.py
1466 anObj = self.BasicOp.MakePointOnFace(theFace, theNumberOfPnts)
1467 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1468 self._autoPublish(anObj, theName, "vertex")
1471 ## Create a point on intersection of two lines.
1472 # @param theRefLine1, theRefLine2 The referenced lines.
1473 # @param theName Object name; when specified, this parameter is used
1474 # for result publication in the study. Otherwise, if automatic
1475 # publication is switched on, default value is used for result name.
1477 # @return New GEOM.GEOM_Object, containing the created point.
1479 # @ref swig_MakeVertexOnLinesIntersection "Example"
1480 @ManageTransactions("BasicOp")
1481 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1483 Create a point on intersection of two lines.
1486 theRefLine1, theRefLine2 The referenced lines.
1487 theName Object name; when specified, this parameter is used
1488 for result publication in the study. Otherwise, if automatic
1489 publication is switched on, default value is used for result name.
1492 New GEOM.GEOM_Object, containing the created point.
1494 # Example: see GEOM_TestAll.py
1495 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1496 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1497 self._autoPublish(anObj, theName, "vertex")
1500 ## Create a tangent, corresponding to the given parameter on the given curve.
1501 # @param theRefCurve The referenced curve.
1502 # @param theParameter Value of parameter on the referenced curve.
1503 # @param theName Object name; when specified, this parameter is used
1504 # for result publication in the study. Otherwise, if automatic
1505 # publication is switched on, default value is used for result name.
1507 # @return New GEOM.GEOM_Object, containing the created tangent.
1509 # @ref swig_MakeTangentOnCurve "Example"
1510 @ManageTransactions("BasicOp")
1511 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1513 Create a tangent, corresponding to the given parameter on the given curve.
1516 theRefCurve The referenced curve.
1517 theParameter Value of parameter on the referenced curve.
1518 theName Object name; when specified, this parameter is used
1519 for result publication in the study. Otherwise, if automatic
1520 publication is switched on, default value is used for result name.
1523 New GEOM.GEOM_Object, containing the created tangent.
1526 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1528 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1529 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1530 self._autoPublish(anObj, theName, "tangent")
1533 ## Create a tangent plane, corresponding to the given parameter on the given face.
1534 # @param theFace The face for which tangent plane should be built.
1535 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1536 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1537 # @param theTrimSize the size of plane.
1538 # @param theName Object name; when specified, this parameter is used
1539 # for result publication in the study. Otherwise, if automatic
1540 # publication is switched on, default value is used for result name.
1542 # @return New GEOM.GEOM_Object, containing the created tangent.
1544 # @ref swig_MakeTangentPlaneOnFace "Example"
1545 @ManageTransactions("BasicOp")
1546 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1548 Create a tangent plane, corresponding to the given parameter on the given face.
1551 theFace The face for which tangent plane should be built.
1552 theParameterV vertical value of the center point (0.0 - 1.0).
1553 theParameterU horisontal value of the center point (0.0 - 1.0).
1554 theTrimSize the size of plane.
1555 theName Object name; when specified, this parameter is used
1556 for result publication in the study. Otherwise, if automatic
1557 publication is switched on, default value is used for result name.
1560 New GEOM.GEOM_Object, containing the created tangent.
1563 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1565 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1566 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1567 self._autoPublish(anObj, theName, "tangent")
1570 ## Create a vector with the given components.
1571 # @param theDX X component of the vector.
1572 # @param theDY Y component of the vector.
1573 # @param theDZ Z component of the vector.
1574 # @param theName Object name; when specified, this parameter is used
1575 # for result publication in the study. Otherwise, if automatic
1576 # publication is switched on, default value is used for result name.
1578 # @return New GEOM.GEOM_Object, containing the created vector.
1580 # @ref tui_creation_vector "Example"
1581 @ManageTransactions("BasicOp")
1582 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1584 Create a vector with the given components.
1587 theDX X component of the vector.
1588 theDY Y component of the vector.
1589 theDZ Z component of the vector.
1590 theName Object name; when specified, this parameter is used
1591 for result publication in the study. Otherwise, if automatic
1592 publication is switched on, default value is used for result name.
1595 New GEOM.GEOM_Object, containing the created vector.
1597 # Example: see GEOM_TestAll.py
1598 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1599 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1600 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1601 anObj.SetParameters(Parameters)
1602 self._autoPublish(anObj, theName, "vector")
1605 ## Create a vector between two points.
1606 # @param thePnt1 Start point for the vector.
1607 # @param thePnt2 End point for the vector.
1608 # @param theName Object name; when specified, this parameter is used
1609 # for result publication in the study. Otherwise, if automatic
1610 # publication is switched on, default value is used for result name.
1612 # @return New GEOM.GEOM_Object, containing the created vector.
1614 # @ref tui_creation_vector "Example"
1615 @ManageTransactions("BasicOp")
1616 def MakeVector(self, thePnt1, thePnt2, theName=None):
1618 Create a vector between two points.
1621 thePnt1 Start point for the vector.
1622 thePnt2 End point for the vector.
1623 theName Object name; when specified, this parameter is used
1624 for result publication in the study. Otherwise, if automatic
1625 publication is switched on, default value is used for result name.
1628 New GEOM.GEOM_Object, containing the created vector.
1630 # Example: see GEOM_TestAll.py
1631 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1632 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1633 self._autoPublish(anObj, theName, "vector")
1636 ## Create a line, passing through the given point
1637 # and parallel to the given direction
1638 # @param thePnt Point. The resulting line will pass through it.
1639 # @param theDir Direction. The resulting line will be parallel to it.
1640 # @param theName Object name; when specified, this parameter is used
1641 # for result publication in the study. Otherwise, if automatic
1642 # publication is switched on, default value is used for result name.
1644 # @return New GEOM.GEOM_Object, containing the created line.
1646 # @ref tui_creation_line "Example"
1647 @ManageTransactions("BasicOp")
1648 def MakeLine(self, thePnt, theDir, theName=None):
1650 Create a line, passing through the given point
1651 and parallel to the given direction
1654 thePnt Point. The resulting line will pass through it.
1655 theDir Direction. The resulting line will be parallel to it.
1656 theName Object name; when specified, this parameter is used
1657 for result publication in the study. Otherwise, if automatic
1658 publication is switched on, default value is used for result name.
1661 New GEOM.GEOM_Object, containing the created line.
1663 # Example: see GEOM_TestAll.py
1664 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1665 RaiseIfFailed("MakeLine", self.BasicOp)
1666 self._autoPublish(anObj, theName, "line")
1669 ## Create a line, passing through the given points
1670 # @param thePnt1 First of two points, defining the line.
1671 # @param thePnt2 Second of two points, defining the line.
1672 # @param theName Object name; when specified, this parameter is used
1673 # for result publication in the study. Otherwise, if automatic
1674 # publication is switched on, default value is used for result name.
1676 # @return New GEOM.GEOM_Object, containing the created line.
1678 # @ref tui_creation_line "Example"
1679 @ManageTransactions("BasicOp")
1680 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1682 Create a line, passing through the given points
1685 thePnt1 First of two points, defining the line.
1686 thePnt2 Second of two points, defining the line.
1687 theName Object name; when specified, this parameter is used
1688 for result publication in the study. Otherwise, if automatic
1689 publication is switched on, default value is used for result name.
1692 New GEOM.GEOM_Object, containing the created line.
1694 # Example: see GEOM_TestAll.py
1695 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1696 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1697 self._autoPublish(anObj, theName, "line")
1700 ## Create a line on two faces intersection.
1701 # @param theFace1 First of two faces, defining the line.
1702 # @param theFace2 Second of two faces, defining the line.
1703 # @param theName Object name; when specified, this parameter is used
1704 # for result publication in the study. Otherwise, if automatic
1705 # publication is switched on, default value is used for result name.
1707 # @return New GEOM.GEOM_Object, containing the created line.
1709 # @ref swig_MakeLineTwoFaces "Example"
1710 @ManageTransactions("BasicOp")
1711 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1713 Create a line on two faces intersection.
1716 theFace1 First of two faces, defining the line.
1717 theFace2 Second of two faces, defining the line.
1718 theName Object name; when specified, this parameter is used
1719 for result publication in the study. Otherwise, if automatic
1720 publication is switched on, default value is used for result name.
1723 New GEOM.GEOM_Object, containing the created line.
1725 # Example: see GEOM_TestAll.py
1726 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1727 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1728 self._autoPublish(anObj, theName, "line")
1731 ## Create a plane, passing through the given point
1732 # and normal to the given vector.
1733 # @param thePnt Point, the plane has to pass through.
1734 # @param theVec Vector, defining the plane normal direction.
1735 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1736 # @param theName Object name; when specified, this parameter is used
1737 # for result publication in the study. Otherwise, if automatic
1738 # publication is switched on, default value is used for result name.
1740 # @return New GEOM.GEOM_Object, containing the created plane.
1742 # @ref tui_creation_plane "Example"
1743 @ManageTransactions("BasicOp")
1744 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1746 Create a plane, passing through the given point
1747 and normal to the given vector.
1750 thePnt Point, the plane has to pass through.
1751 theVec Vector, defining the plane normal direction.
1752 theTrimSize Half size of a side of quadrangle face, representing the plane.
1753 theName Object name; when specified, this parameter is used
1754 for result publication in the study. Otherwise, if automatic
1755 publication is switched on, default value is used for result name.
1758 New GEOM.GEOM_Object, containing the created plane.
1760 # Example: see GEOM_TestAll.py
1761 theTrimSize, Parameters = ParseParameters(theTrimSize);
1762 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1763 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1764 anObj.SetParameters(Parameters)
1765 self._autoPublish(anObj, theName, "plane")
1768 ## Create a plane, passing through the three given points
1769 # @param thePnt1 First of three points, defining the plane.
1770 # @param thePnt2 Second of three points, defining the plane.
1771 # @param thePnt3 Third of three points, defining the plane.
1772 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1773 # @param theName Object name; when specified, this parameter is used
1774 # for result publication in the study. Otherwise, if automatic
1775 # publication is switched on, default value is used for result name.
1777 # @return New GEOM.GEOM_Object, containing the created plane.
1779 # @ref tui_creation_plane "Example"
1780 @ManageTransactions("BasicOp")
1781 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1783 Create a plane, passing through the three given points
1786 thePnt1 First of three points, defining the plane.
1787 thePnt2 Second of three points, defining the plane.
1788 thePnt3 Third of three points, defining the plane.
1789 theTrimSize Half size of a side of quadrangle face, representing the plane.
1790 theName Object name; when specified, this parameter is used
1791 for result publication in the study. Otherwise, if automatic
1792 publication is switched on, default value is used for result name.
1795 New GEOM.GEOM_Object, containing the created plane.
1797 # Example: see GEOM_TestAll.py
1798 theTrimSize, Parameters = ParseParameters(theTrimSize);
1799 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1800 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1801 anObj.SetParameters(Parameters)
1802 self._autoPublish(anObj, theName, "plane")
1805 ## Create a plane, similar to the existing one, but with another size of representing face.
1806 # @param theFace Referenced plane or LCS(Marker).
1807 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1808 # @param theName Object name; when specified, this parameter is used
1809 # for result publication in the study. Otherwise, if automatic
1810 # publication is switched on, default value is used for result name.
1812 # @return New GEOM.GEOM_Object, containing the created plane.
1814 # @ref tui_creation_plane "Example"
1815 @ManageTransactions("BasicOp")
1816 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1818 Create a plane, similar to the existing one, but with another size of representing face.
1821 theFace Referenced plane or LCS(Marker).
1822 theTrimSize New half size of a side of quadrangle face, representing the plane.
1823 theName Object name; when specified, this parameter is used
1824 for result publication in the study. Otherwise, if automatic
1825 publication is switched on, default value is used for result name.
1828 New GEOM.GEOM_Object, containing the created plane.
1830 # Example: see GEOM_TestAll.py
1831 theTrimSize, Parameters = ParseParameters(theTrimSize);
1832 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1833 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1834 anObj.SetParameters(Parameters)
1835 self._autoPublish(anObj, theName, "plane")
1838 ## Create a plane, passing through the 2 vectors
1839 # with center in a start point of the first vector.
1840 # @param theVec1 Vector, defining center point and plane direction.
1841 # @param theVec2 Vector, defining the plane normal direction.
1842 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1843 # @param theName Object name; when specified, this parameter is used
1844 # for result publication in the study. Otherwise, if automatic
1845 # publication is switched on, default value is used for result name.
1847 # @return New GEOM.GEOM_Object, containing the created plane.
1849 # @ref tui_creation_plane "Example"
1850 @ManageTransactions("BasicOp")
1851 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1853 Create a plane, passing through the 2 vectors
1854 with center in a start point of the first vector.
1857 theVec1 Vector, defining center point and plane direction.
1858 theVec2 Vector, defining the plane normal direction.
1859 theTrimSize Half size of a side of quadrangle face, representing the plane.
1860 theName Object name; when specified, this parameter is used
1861 for result publication in the study. Otherwise, if automatic
1862 publication is switched on, default value is used for result name.
1865 New GEOM.GEOM_Object, containing the created plane.
1867 # Example: see GEOM_TestAll.py
1868 theTrimSize, Parameters = ParseParameters(theTrimSize);
1869 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1870 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1871 anObj.SetParameters(Parameters)
1872 self._autoPublish(anObj, theName, "plane")
1875 ## Create a plane, based on a Local coordinate system.
1876 # @param theLCS coordinate system, defining plane.
1877 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1878 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1879 # @param theName Object name; when specified, this parameter is used
1880 # for result publication in the study. Otherwise, if automatic
1881 # publication is switched on, default value is used for result name.
1883 # @return New GEOM.GEOM_Object, containing the created plane.
1885 # @ref tui_creation_plane "Example"
1886 @ManageTransactions("BasicOp")
1887 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1889 Create a plane, based on a Local coordinate system.
1892 theLCS coordinate system, defining plane.
1893 theTrimSize Half size of a side of quadrangle face, representing the plane.
1894 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1895 theName Object name; when specified, this parameter is used
1896 for result publication in the study. Otherwise, if automatic
1897 publication is switched on, default value is used for result name.
1900 New GEOM.GEOM_Object, containing the created plane.
1902 # Example: see GEOM_TestAll.py
1903 theTrimSize, Parameters = ParseParameters(theTrimSize);
1904 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1905 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1906 anObj.SetParameters(Parameters)
1907 self._autoPublish(anObj, theName, "plane")
1910 ## Create a local coordinate system.
1911 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1912 # @param XDX,XDY,XDZ Three components of OX direction
1913 # @param YDX,YDY,YDZ Three components of OY direction
1914 # @param theName Object name; when specified, this parameter is used
1915 # for result publication in the study. Otherwise, if automatic
1916 # publication is switched on, default value is used for result name.
1918 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1920 # @ref swig_MakeMarker "Example"
1921 @ManageTransactions("BasicOp")
1922 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1924 Create a local coordinate system.
1927 OX,OY,OZ Three coordinates of coordinate system origin.
1928 XDX,XDY,XDZ Three components of OX direction
1929 YDX,YDY,YDZ Three components of OY direction
1930 theName Object name; when specified, this parameter is used
1931 for result publication in the study. Otherwise, if automatic
1932 publication is switched on, default value is used for result name.
1935 New GEOM.GEOM_Object, containing the created coordinate system.
1937 # Example: see GEOM_TestAll.py
1938 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1939 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1940 RaiseIfFailed("MakeMarker", self.BasicOp)
1941 anObj.SetParameters(Parameters)
1942 self._autoPublish(anObj, theName, "lcs")
1945 ## Create a local coordinate system from shape.
1946 # @param theShape The initial shape to detect the coordinate system.
1947 # @param theName Object name; when specified, this parameter is used
1948 # for result publication in the study. Otherwise, if automatic
1949 # publication is switched on, default value is used for result name.
1951 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1953 # @ref tui_creation_lcs "Example"
1954 @ManageTransactions("BasicOp")
1955 def MakeMarkerFromShape(self, theShape, theName=None):
1957 Create a local coordinate system from shape.
1960 theShape The initial shape to detect the coordinate system.
1961 theName Object name; when specified, this parameter is used
1962 for result publication in the study. Otherwise, if automatic
1963 publication is switched on, default value is used for result name.
1966 New GEOM.GEOM_Object, containing the created coordinate system.
1968 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1969 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1970 self._autoPublish(anObj, theName, "lcs")
1973 ## Create a local coordinate system from point and two vectors.
1974 # @param theOrigin Point of coordinate system origin.
1975 # @param theXVec Vector of X direction
1976 # @param theYVec Vector of Y direction
1977 # @param theName Object name; when specified, this parameter is used
1978 # for result publication in the study. Otherwise, if automatic
1979 # publication is switched on, default value is used for result name.
1981 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1983 # @ref tui_creation_lcs "Example"
1984 @ManageTransactions("BasicOp")
1985 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1987 Create a local coordinate system from point and two vectors.
1990 theOrigin Point of coordinate system origin.
1991 theXVec Vector of X direction
1992 theYVec Vector of Y direction
1993 theName Object name; when specified, this parameter is used
1994 for result publication in the study. Otherwise, if automatic
1995 publication is switched on, default value is used for result name.
1998 New GEOM.GEOM_Object, containing the created coordinate system.
2001 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
2002 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
2003 self._autoPublish(anObj, theName, "lcs")
2006 # end of l3_basic_go
2009 ## @addtogroup l4_curves
2012 ## Create an arc of circle, passing through three given points.
2013 # @param thePnt1 Start point of the arc.
2014 # @param thePnt2 Middle point of the arc.
2015 # @param thePnt3 End point of the arc.
2016 # @param theName Object name; when specified, this parameter is used
2017 # for result publication in the study. Otherwise, if automatic
2018 # publication is switched on, default value is used for result name.
2020 # @return New GEOM.GEOM_Object, containing the created arc.
2022 # @ref swig_MakeArc "Example"
2023 @ManageTransactions("CurvesOp")
2024 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2026 Create an arc of circle, passing through three given points.
2029 thePnt1 Start point of the arc.
2030 thePnt2 Middle point of the arc.
2031 thePnt3 End point of the arc.
2032 theName Object name; when specified, this parameter is used
2033 for result publication in the study. Otherwise, if automatic
2034 publication is switched on, default value is used for result name.
2037 New GEOM.GEOM_Object, containing the created arc.
2039 # Example: see GEOM_TestAll.py
2040 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2041 RaiseIfFailed("MakeArc", self.CurvesOp)
2042 self._autoPublish(anObj, theName, "arc")
2045 ## Create an arc of circle from a center and 2 points.
2046 # @param thePnt1 Center of the arc
2047 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2048 # @param thePnt3 End point of the arc (Gives also a direction)
2049 # @param theSense Orientation of the arc
2050 # @param theName Object name; when specified, this parameter is used
2051 # for result publication in the study. Otherwise, if automatic
2052 # publication is switched on, default value is used for result name.
2054 # @return New GEOM.GEOM_Object, containing the created arc.
2056 # @ref swig_MakeArc "Example"
2057 @ManageTransactions("CurvesOp")
2058 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2060 Create an arc of circle from a center and 2 points.
2063 thePnt1 Center of the arc
2064 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2065 thePnt3 End point of the arc (Gives also a direction)
2066 theSense Orientation of the arc
2067 theName Object name; when specified, this parameter is used
2068 for result publication in the study. Otherwise, if automatic
2069 publication is switched on, default value is used for result name.
2072 New GEOM.GEOM_Object, containing the created arc.
2074 # Example: see GEOM_TestAll.py
2075 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2076 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2077 self._autoPublish(anObj, theName, "arc")
2080 ## Create an arc of ellipse, of center and two points.
2081 # @param theCenter Center of the arc.
2082 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2083 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2084 # @param theName Object name; when specified, this parameter is used
2085 # for result publication in the study. Otherwise, if automatic
2086 # publication is switched on, default value is used for result name.
2088 # @return New GEOM.GEOM_Object, containing the created arc.
2090 # @ref swig_MakeArc "Example"
2091 @ManageTransactions("CurvesOp")
2092 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2094 Create an arc of ellipse, of center and two points.
2097 theCenter Center of the arc.
2098 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2099 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2100 theName Object name; when specified, this parameter is used
2101 for result publication in the study. Otherwise, if automatic
2102 publication is switched on, default value is used for result name.
2105 New GEOM.GEOM_Object, containing the created arc.
2107 # Example: see GEOM_TestAll.py
2108 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2109 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2110 self._autoPublish(anObj, theName, "arc")
2113 ## Create a circle with given center, normal vector and radius.
2114 # @param thePnt Circle center.
2115 # @param theVec Vector, normal to the plane of the circle.
2116 # @param theR Circle radius.
2117 # @param theName Object name; when specified, this parameter is used
2118 # for result publication in the study. Otherwise, if automatic
2119 # publication is switched on, default value is used for result name.
2121 # @return New GEOM.GEOM_Object, containing the created circle.
2123 # @ref tui_creation_circle "Example"
2124 @ManageTransactions("CurvesOp")
2125 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2127 Create a circle with given center, normal vector and radius.
2130 thePnt Circle center.
2131 theVec Vector, normal to the plane of the circle.
2133 theName Object name; when specified, this parameter is used
2134 for result publication in the study. Otherwise, if automatic
2135 publication is switched on, default value is used for result name.
2138 New GEOM.GEOM_Object, containing the created circle.
2140 # Example: see GEOM_TestAll.py
2141 theR, Parameters = ParseParameters(theR)
2142 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2143 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2144 anObj.SetParameters(Parameters)
2145 self._autoPublish(anObj, theName, "circle")
2148 ## Create a circle with given radius.
2149 # Center of the circle will be in the origin of global
2150 # coordinate system and normal vector will be codirected with Z axis
2151 # @param theR Circle radius.
2152 # @param theName Object name; when specified, this parameter is used
2153 # for result publication in the study. Otherwise, if automatic
2154 # publication is switched on, default value is used for result name.
2156 # @return New GEOM.GEOM_Object, containing the created circle.
2157 @ManageTransactions("CurvesOp")
2158 def MakeCircleR(self, theR, theName=None):
2160 Create a circle with given radius.
2161 Center of the circle will be in the origin of global
2162 coordinate system and normal vector will be codirected with Z axis
2166 theName Object name; when specified, this parameter is used
2167 for result publication in the study. Otherwise, if automatic
2168 publication is switched on, default value is used for result name.
2171 New GEOM.GEOM_Object, containing the created circle.
2173 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2174 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2175 self._autoPublish(anObj, theName, "circle")
2178 ## Create a circle, passing through three given points
2179 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2180 # @param theName Object name; when specified, this parameter is used
2181 # for result publication in the study. Otherwise, if automatic
2182 # publication is switched on, default value is used for result name.
2184 # @return New GEOM.GEOM_Object, containing the created circle.
2186 # @ref tui_creation_circle "Example"
2187 @ManageTransactions("CurvesOp")
2188 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2190 Create a circle, passing through three given points
2193 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2194 theName Object name; when specified, this parameter is used
2195 for result publication in the study. Otherwise, if automatic
2196 publication is switched on, default value is used for result name.
2199 New GEOM.GEOM_Object, containing the created circle.
2201 # Example: see GEOM_TestAll.py
2202 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2203 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2204 self._autoPublish(anObj, theName, "circle")
2207 ## Create a circle, with given point1 as center,
2208 # passing through the point2 as radius and laying in the plane,
2209 # defined by all three given points.
2210 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2211 # @param theName Object name; when specified, this parameter is used
2212 # for result publication in the study. Otherwise, if automatic
2213 # publication is switched on, default value is used for result name.
2215 # @return New GEOM.GEOM_Object, containing the created circle.
2217 # @ref swig_MakeCircle "Example"
2218 @ManageTransactions("CurvesOp")
2219 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2221 Create a circle, with given point1 as center,
2222 passing through the point2 as radius and laying in the plane,
2223 defined by all three given points.
2226 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2227 theName Object name; when specified, this parameter is used
2228 for result publication in the study. Otherwise, if automatic
2229 publication is switched on, default value is used for result name.
2232 New GEOM.GEOM_Object, containing the created circle.
2234 # Example: see GEOM_example6.py
2235 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2236 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2237 self._autoPublish(anObj, theName, "circle")
2240 ## Create an ellipse with given center, normal vector and radiuses.
2241 # @param thePnt Ellipse center.
2242 # @param theVec Vector, normal to the plane of the ellipse.
2243 # @param theRMajor Major ellipse radius.
2244 # @param theRMinor Minor ellipse radius.
2245 # @param theVecMaj Vector, direction of the ellipse's main axis.
2246 # @param theName Object name; when specified, this parameter is used
2247 # for result publication in the study. Otherwise, if automatic
2248 # publication is switched on, default value is used for result name.
2250 # @return New GEOM.GEOM_Object, containing the created ellipse.
2252 # @ref tui_creation_ellipse "Example"
2253 @ManageTransactions("CurvesOp")
2254 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2256 Create an ellipse with given center, normal vector and radiuses.
2259 thePnt Ellipse center.
2260 theVec Vector, normal to the plane of the ellipse.
2261 theRMajor Major ellipse radius.
2262 theRMinor Minor ellipse radius.
2263 theVecMaj Vector, direction of the ellipse's main axis.
2264 theName Object name; when specified, this parameter is used
2265 for result publication in the study. Otherwise, if automatic
2266 publication is switched on, default value is used for result name.
2269 New GEOM.GEOM_Object, containing the created ellipse.
2271 # Example: see GEOM_TestAll.py
2272 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2273 if theVecMaj is not None:
2274 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2276 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2278 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2279 anObj.SetParameters(Parameters)
2280 self._autoPublish(anObj, theName, "ellipse")
2283 ## Create an ellipse with given radiuses.
2284 # Center of the ellipse will be in the origin of global
2285 # coordinate system and normal vector will be codirected with Z axis
2286 # @param theRMajor Major ellipse radius.
2287 # @param theRMinor Minor ellipse radius.
2288 # @param theName Object name; when specified, this parameter is used
2289 # for result publication in the study. Otherwise, if automatic
2290 # publication is switched on, default value is used for result name.
2292 # @return New GEOM.GEOM_Object, containing the created ellipse.
2293 @ManageTransactions("CurvesOp")
2294 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2296 Create an ellipse with given radiuses.
2297 Center of the ellipse will be in the origin of global
2298 coordinate system and normal vector will be codirected with Z axis
2301 theRMajor Major ellipse radius.
2302 theRMinor Minor ellipse radius.
2303 theName Object name; when specified, this parameter is used
2304 for result publication in the study. Otherwise, if automatic
2305 publication is switched on, default value is used for result name.
2308 New GEOM.GEOM_Object, containing the created ellipse.
2310 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2311 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2312 self._autoPublish(anObj, theName, "ellipse")
2315 ## Create a polyline on the set of points.
2316 # @param thePoints Sequence of points for the polyline.
2317 # @param theIsClosed If True, build a closed wire.
2318 # @param theName Object name; when specified, this parameter is used
2319 # for result publication in the study. Otherwise, if automatic
2320 # publication is switched on, default value is used for result name.
2322 # @return New GEOM.GEOM_Object, containing the created polyline.
2324 # @ref tui_creation_curve "Example"
2325 @ManageTransactions("CurvesOp")
2326 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2328 Create a polyline on the set of points.
2331 thePoints Sequence of points for the polyline.
2332 theIsClosed If True, build a closed wire.
2333 theName Object name; when specified, this parameter is used
2334 for result publication in the study. Otherwise, if automatic
2335 publication is switched on, default value is used for result name.
2338 New GEOM.GEOM_Object, containing the created polyline.
2340 # Example: see GEOM_TestAll.py
2341 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2342 RaiseIfFailed("MakePolyline", self.CurvesOp)
2343 self._autoPublish(anObj, theName, "polyline")
2346 ## Create bezier curve on the set of points.
2347 # @param thePoints Sequence of points for the bezier curve.
2348 # @param theIsClosed If True, build a closed curve.
2349 # @param theName Object name; when specified, this parameter is used
2350 # for result publication in the study. Otherwise, if automatic
2351 # publication is switched on, default value is used for result name.
2353 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2355 # @ref tui_creation_curve "Example"
2356 @ManageTransactions("CurvesOp")
2357 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2359 Create bezier curve on the set of points.
2362 thePoints Sequence of points for the bezier curve.
2363 theIsClosed If True, build a closed curve.
2364 theName Object name; when specified, this parameter is used
2365 for result publication in the study. Otherwise, if automatic
2366 publication is switched on, default value is used for result name.
2369 New GEOM.GEOM_Object, containing the created bezier curve.
2371 # Example: see GEOM_TestAll.py
2372 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2373 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2374 self._autoPublish(anObj, theName, "bezier")
2377 ## Create B-Spline curve on the set of points.
2378 # @param thePoints Sequence of points for the B-Spline curve.
2379 # @param theIsClosed If True, build a closed curve.
2380 # @param theDoReordering If TRUE, the algo does not follow the order of
2381 # \a thePoints but searches for the closest vertex.
2382 # @param theName Object name; when specified, this parameter is used
2383 # for result publication in the study. Otherwise, if automatic
2384 # publication is switched on, default value is used for result name.
2386 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2388 # @ref tui_creation_curve "Example"
2389 @ManageTransactions("CurvesOp")
2390 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2392 Create B-Spline curve on the set of points.
2395 thePoints Sequence of points for the B-Spline curve.
2396 theIsClosed If True, build a closed curve.
2397 theDoReordering If True, the algo does not follow the order of
2398 thePoints but searches for the closest vertex.
2399 theName Object name; when specified, this parameter is used
2400 for result publication in the study. Otherwise, if automatic
2401 publication is switched on, default value is used for result name.
2404 New GEOM.GEOM_Object, containing the created B-Spline curve.
2406 # Example: see GEOM_TestAll.py
2407 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2408 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2409 self._autoPublish(anObj, theName, "bspline")
2412 ## Create B-Spline curve on the set of points.
2413 # @param thePoints Sequence of points for the B-Spline curve.
2414 # @param theFirstVec Vector object, defining the curve direction at its first point.
2415 # @param theLastVec Vector object, defining the curve direction at its last point.
2416 # @param theName Object name; when specified, this parameter is used
2417 # for result publication in the study. Otherwise, if automatic
2418 # publication is switched on, default value is used for result name.
2420 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2422 # @ref tui_creation_curve "Example"
2423 @ManageTransactions("CurvesOp")
2424 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2426 Create B-Spline curve on the set of points.
2429 thePoints Sequence of points for the B-Spline curve.
2430 theFirstVec Vector object, defining the curve direction at its first point.
2431 theLastVec Vector object, defining the curve direction at its last point.
2432 theName Object name; when specified, this parameter is used
2433 for result publication in the study. Otherwise, if automatic
2434 publication is switched on, default value is used for result name.
2437 New GEOM.GEOM_Object, containing the created B-Spline curve.
2439 # Example: see GEOM_TestAll.py
2440 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2441 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2442 self._autoPublish(anObj, theName, "bspline")
2445 ## Creates a curve using the parametric definition of the basic points.
2446 # @param thexExpr parametric equation of the coordinates X.
2447 # @param theyExpr parametric equation of the coordinates Y.
2448 # @param thezExpr parametric equation of the coordinates Z.
2449 # @param theParamMin the minimal value of the parameter.
2450 # @param theParamMax the maximum value of the parameter.
2451 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2452 # @param theCurveType the type of the curve,
2453 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2454 # @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.
2455 # @param theName Object name; when specified, this parameter is used
2456 # for result publication in the study. Otherwise, if automatic
2457 # publication is switched on, default value is used for result name.
2459 # @return New GEOM.GEOM_Object, containing the created curve.
2461 # @ref tui_creation_curve "Example"
2462 @ManageTransactions("CurvesOp")
2463 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2464 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2466 Creates a curve using the parametric definition of the basic points.
2469 thexExpr parametric equation of the coordinates X.
2470 theyExpr parametric equation of the coordinates Y.
2471 thezExpr parametric equation of the coordinates Z.
2472 theParamMin the minimal value of the parameter.
2473 theParamMax the maximum value of the parameter.
2474 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2475 theCurveType the type of the curve,
2476 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2477 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2478 method is used which can lead to a bug.
2479 theName Object name; when specified, this parameter is used
2480 for result publication in the study. Otherwise, if automatic
2481 publication is switched on, default value is used for result name.
2484 New GEOM.GEOM_Object, containing the created curve.
2486 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2488 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2490 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2491 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2492 anObj.SetParameters(Parameters)
2493 self._autoPublish(anObj, theName, "curve")
2496 ## Create an isoline curve on a face.
2497 # @param theFace the face for which an isoline is created.
2498 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2500 # @param theParameter the U parameter for U-isoline or V parameter
2502 # @param theName Object name; when specified, this parameter is used
2503 # for result publication in the study. Otherwise, if automatic
2504 # publication is switched on, default value is used for result name.
2506 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2507 # a compound of edges.
2509 # @ref tui_creation_curve "Example"
2510 @ManageTransactions("CurvesOp")
2511 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2513 Create an isoline curve on a face.
2516 theFace the face for which an isoline is created.
2517 IsUIsoline True for U-isoline creation; False for V-isoline
2519 theParameter the U parameter for U-isoline or V parameter
2521 theName Object name; when specified, this parameter is used
2522 for result publication in the study. Otherwise, if automatic
2523 publication is switched on, default value is used for result name.
2526 New GEOM.GEOM_Object, containing the created isoline edge or a
2529 # Example: see GEOM_TestAll.py
2530 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2531 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2533 self._autoPublish(anObj, theName, "U-Isoline")
2535 self._autoPublish(anObj, theName, "V-Isoline")
2541 ## @addtogroup l3_sketcher
2544 ## Create a sketcher (wire or face), following the textual description,
2545 # passed through <VAR>theCommand</VAR> argument. \n
2546 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2547 # Format of the description string have to be the following:
2549 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2552 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2554 # - "R angle" : Set the direction by angle
2555 # - "D dx dy" : Set the direction by DX & DY
2558 # - "TT x y" : Create segment by point at X & Y
2559 # - "T dx dy" : Create segment by point with DX & DY
2560 # - "L length" : Create segment by direction & Length
2561 # - "IX x" : Create segment by direction & Intersect. X
2562 # - "IY y" : Create segment by direction & Intersect. Y
2565 # - "C radius length" : Create arc by direction, radius and length(in degree)
2566 # - "AA x y": Create arc by point at X & Y
2567 # - "A dx dy" : Create arc by point with DX & DY
2568 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2569 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2570 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2571 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2574 # - "WW" : Close Wire (to finish)
2575 # - "WF" : Close Wire and build face (to finish)
2578 # - Flag1 (= reverse) is 0 or 2 ...
2579 # - if 0 the drawn arc is the one of lower angle (< Pi)
2580 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2583 # - Flag2 (= control tolerance) is 0 or 1 ...
2584 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2585 # - if 1 the wire is built only if the end point is on the arc
2586 # with a tolerance of 10^-7 on the distance else the creation fails
2588 # @param theCommand String, defining the sketcher in local
2589 # coordinates of the working plane.
2590 # @param theWorkingPlane Nine double values, defining origin,
2591 # OZ and OX directions of the working plane.
2592 # @param theName Object name; when specified, this parameter is used
2593 # for result publication in the study. Otherwise, if automatic
2594 # publication is switched on, default value is used for result name.
2596 # @return New GEOM.GEOM_Object, containing the created wire.
2598 # @ref tui_sketcher_page "Example"
2599 @ManageTransactions("CurvesOp")
2600 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2602 Create a sketcher (wire or face), following the textual description, passed
2603 through theCommand argument.
2604 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2605 Format of the description string have to be the following:
2606 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2608 - x1, y1 are coordinates of the first sketcher point (zero by default),
2610 - "R angle" : Set the direction by angle
2611 - "D dx dy" : Set the direction by DX & DY
2613 - "TT x y" : Create segment by point at X & Y
2614 - "T dx dy" : Create segment by point with DX & DY
2615 - "L length" : Create segment by direction & Length
2616 - "IX x" : Create segment by direction & Intersect. X
2617 - "IY y" : Create segment by direction & Intersect. Y
2619 - "C radius length" : Create arc by direction, radius and length(in degree)
2620 - "AA x y": Create arc by point at X & Y
2621 - "A dx dy" : Create arc by point with DX & DY
2622 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2623 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2624 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2625 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2627 - "WW" : Close Wire (to finish)
2628 - "WF" : Close Wire and build face (to finish)
2630 - Flag1 (= reverse) is 0 or 2 ...
2631 - if 0 the drawn arc is the one of lower angle (< Pi)
2632 - if 2 the drawn arc ius the one of greater angle (> Pi)
2634 - Flag2 (= control tolerance) is 0 or 1 ...
2635 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2636 - if 1 the wire is built only if the end point is on the arc
2637 with a tolerance of 10^-7 on the distance else the creation fails
2640 theCommand String, defining the sketcher in local
2641 coordinates of the working plane.
2642 theWorkingPlane Nine double values, defining origin,
2643 OZ and OX directions of the working plane.
2644 theName Object name; when specified, this parameter is used
2645 for result publication in the study. Otherwise, if automatic
2646 publication is switched on, default value is used for result name.
2649 New GEOM.GEOM_Object, containing the created wire.
2651 # Example: see GEOM_TestAll.py
2652 theCommand,Parameters = ParseSketcherCommand(theCommand)
2653 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2654 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2655 anObj.SetParameters(Parameters)
2656 self._autoPublish(anObj, theName, "wire")
2659 ## Create a sketcher (wire or face), following the textual description,
2660 # passed through <VAR>theCommand</VAR> argument. \n
2661 # For format of the description string see MakeSketcher() method.\n
2662 # @param theCommand String, defining the sketcher in local
2663 # coordinates of the working plane.
2664 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2665 # @param theName Object name; when specified, this parameter is used
2666 # for result publication in the study. Otherwise, if automatic
2667 # publication is switched on, default value is used for result name.
2669 # @return New GEOM.GEOM_Object, containing the created wire.
2671 # @ref tui_sketcher_page "Example"
2672 @ManageTransactions("CurvesOp")
2673 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2675 Create a sketcher (wire or face), following the textual description,
2676 passed through theCommand argument.
2677 For format of the description string see geompy.MakeSketcher() method.
2680 theCommand String, defining the sketcher in local
2681 coordinates of the working plane.
2682 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2683 theName Object name; when specified, this parameter is used
2684 for result publication in the study. Otherwise, if automatic
2685 publication is switched on, default value is used for result name.
2688 New GEOM.GEOM_Object, containing the created wire.
2690 theCommand,Parameters = ParseSketcherCommand(theCommand)
2691 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2692 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2693 anObj.SetParameters(Parameters)
2694 self._autoPublish(anObj, theName, "wire")
2697 ## Obtain a 2D sketcher interface
2698 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2699 def Sketcher2D (self):
2701 Obtain a 2D sketcher interface.
2704 sk = geompy.Sketcher2D()
2706 sk.addSegmentRelative(15, 70)
2707 sk.addSegmentPerpY(50)
2708 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2709 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2710 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2712 Sketch_1 = sk.wire(geomObj_1)
2714 sk = Sketcher2D (self)
2717 ## Create a sketcher wire, following the numerical description,
2718 # passed through <VAR>theCoordinates</VAR> argument. \n
2719 # @param theCoordinates double values, defining points to create a wire,
2721 # @param theName Object name; when specified, this parameter is used
2722 # for result publication in the study. Otherwise, if automatic
2723 # publication is switched on, default value is used for result name.
2725 # @return New GEOM.GEOM_Object, containing the created wire.
2727 # @ref tui_3dsketcher_page "Example"
2728 @ManageTransactions("CurvesOp")
2729 def Make3DSketcher(self, theCoordinates, theName=None):
2731 Create a sketcher wire, following the numerical description,
2732 passed through theCoordinates argument.
2735 theCoordinates double values, defining points to create a wire,
2737 theName Object name; when specified, this parameter is used
2738 for result publication in the study. Otherwise, if automatic
2739 publication is switched on, default value is used for result name.
2742 New GEOM_Object, containing the created wire.
2744 theCoordinates,Parameters = ParseParameters(theCoordinates)
2745 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2746 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2747 anObj.SetParameters(Parameters)
2748 self._autoPublish(anObj, theName, "wire")
2751 ## Obtain a 3D sketcher interface
2752 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2754 # @ref tui_3dsketcher_page "Example"
2755 def Sketcher3D (self):
2757 Obtain a 3D sketcher interface.
2760 sk = geompy.Sketcher3D()
2761 sk.addPointsAbsolute(0,0,0, 70,0,0)
2762 sk.addPointsRelative(0, 0, 130)
2763 sk.addPointAnglesLength("OXY", 50, 0, 100)
2764 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2766 a3D_Sketcher_1 = sk.wire()
2768 sk = Sketcher3D (self)
2771 ## Obtain a 2D polyline creation interface
2772 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2774 # @ref tui_3dsketcher_page "Example"
2775 def Polyline2D (self):
2777 Obtain a 2D polyline creation interface.
2780 pl = geompy.Polyline2D()
2781 pl.addSection("section 1", GEOM.Polyline, True)
2782 pl.addPoints(0, 0, 10, 0, 10, 10)
2783 pl.addSection("section 2", GEOM.Interpolation, False)
2784 pl.addPoints(20, 0, 30, 0, 30, 10)
2785 resultObj = pl.result(WorkingPlane)
2787 pl = Polyline2D (self)
2790 # end of l3_sketcher
2793 ## @addtogroup l3_3d_primitives
2796 ## Create a box by coordinates of two opposite vertices.
2798 # @param x1,y1,z1 double values, defining first point it.
2799 # @param x2,y2,z2 double values, defining first point it.
2800 # @param theName Object name; when specified, this parameter is used
2801 # for result publication in the study. Otherwise, if automatic
2802 # publication is switched on, default value is used for result name.
2804 # @return New GEOM.GEOM_Object, containing the created box.
2806 # @ref tui_creation_box "Example"
2807 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2809 Create a box by coordinates of two opposite vertices.
2812 x1,y1,z1 double values, defining first point.
2813 x2,y2,z2 double values, defining second point.
2814 theName Object name; when specified, this parameter is used
2815 for result publication in the study. Otherwise, if automatic
2816 publication is switched on, default value is used for result name.
2819 New GEOM.GEOM_Object, containing the created box.
2821 # Example: see GEOM_TestAll.py
2822 pnt1 = self.MakeVertex(x1,y1,z1)
2823 pnt2 = self.MakeVertex(x2,y2,z2)
2824 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2825 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2827 ## Create a box with specified dimensions along the coordinate axes
2828 # and with edges, parallel to the coordinate axes.
2829 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2830 # @param theDX Length of Box edges, parallel to OX axis.
2831 # @param theDY Length of Box edges, parallel to OY axis.
2832 # @param theDZ Length of Box edges, parallel to OZ axis.
2833 # @param theName Object name; when specified, this parameter is used
2834 # for result publication in the study. Otherwise, if automatic
2835 # publication is switched on, default value is used for result name.
2837 # @return New GEOM.GEOM_Object, containing the created box.
2839 # @ref tui_creation_box "Example"
2840 @ManageTransactions("PrimOp")
2841 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2843 Create a box with specified dimensions along the coordinate axes
2844 and with edges, parallel to the coordinate axes.
2845 Center of the box will be at point (DX/2, DY/2, DZ/2).
2848 theDX Length of Box edges, parallel to OX axis.
2849 theDY Length of Box edges, parallel to OY axis.
2850 theDZ Length of Box edges, parallel to OZ axis.
2851 theName Object name; when specified, this parameter is used
2852 for result publication in the study. Otherwise, if automatic
2853 publication is switched on, default value is used for result name.
2856 New GEOM.GEOM_Object, containing the created box.
2858 # Example: see GEOM_TestAll.py
2859 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2860 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2861 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2862 anObj.SetParameters(Parameters)
2863 self._autoPublish(anObj, theName, "box")
2866 ## Create a box with two specified opposite vertices,
2867 # and with edges, parallel to the coordinate axes
2868 # @param thePnt1 First of two opposite vertices.
2869 # @param thePnt2 Second of two opposite vertices.
2870 # @param theName Object name; when specified, this parameter is used
2871 # for result publication in the study. Otherwise, if automatic
2872 # publication is switched on, default value is used for result name.
2874 # @return New GEOM.GEOM_Object, containing the created box.
2876 # @ref tui_creation_box "Example"
2877 @ManageTransactions("PrimOp")
2878 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2880 Create a box with two specified opposite vertices,
2881 and with edges, parallel to the coordinate axes
2884 thePnt1 First of two opposite vertices.
2885 thePnt2 Second of two opposite vertices.
2886 theName Object name; when specified, this parameter is used
2887 for result publication in the study. Otherwise, if automatic
2888 publication is switched on, default value is used for result name.
2891 New GEOM.GEOM_Object, containing the created box.
2893 # Example: see GEOM_TestAll.py
2894 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2895 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2896 self._autoPublish(anObj, theName, "box")
2899 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2900 # @param theH height of Face.
2901 # @param theW width of Face.
2902 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2903 # @param theName Object name; when specified, this parameter is used
2904 # for result publication in the study. Otherwise, if automatic
2905 # publication is switched on, default value is used for result name.
2907 # @return New GEOM.GEOM_Object, containing the created face.
2909 # @ref tui_creation_face "Example"
2910 @ManageTransactions("PrimOp")
2911 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2913 Create a face with specified dimensions with edges parallel to coordinate axes.
2916 theH height of Face.
2918 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2919 theName Object name; when specified, this parameter is used
2920 for result publication in the study. Otherwise, if automatic
2921 publication is switched on, default value is used for result name.
2924 New GEOM.GEOM_Object, containing the created face.
2926 # Example: see GEOM_TestAll.py
2927 theH,theW,Parameters = ParseParameters(theH, theW)
2928 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2929 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2930 anObj.SetParameters(Parameters)
2931 self._autoPublish(anObj, theName, "rectangle")
2934 ## Create a face from another plane and two sizes,
2935 # vertical size and horisontal size.
2936 # @param theObj Normale vector to the creating face or
2938 # @param theH Height (vertical size).
2939 # @param theW Width (horisontal size).
2940 # @param theName Object name; when specified, this parameter is used
2941 # for result publication in the study. Otherwise, if automatic
2942 # publication is switched on, default value is used for result name.
2944 # @return New GEOM.GEOM_Object, containing the created face.
2946 # @ref tui_creation_face "Example"
2947 @ManageTransactions("PrimOp")
2948 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2950 Create a face from another plane and two sizes,
2951 vertical size and horisontal size.
2954 theObj Normale vector to the creating face or
2956 theH Height (vertical size).
2957 theW Width (horisontal size).
2958 theName Object name; when specified, this parameter is used
2959 for result publication in the study. Otherwise, if automatic
2960 publication is switched on, default value is used for result name.
2963 New GEOM_Object, containing the created face.
2965 # Example: see GEOM_TestAll.py
2966 theH,theW,Parameters = ParseParameters(theH, theW)
2967 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2968 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2969 anObj.SetParameters(Parameters)
2970 self._autoPublish(anObj, theName, "rectangle")
2973 ## Create a disk with given center, normal vector and radius.
2974 # @param thePnt Disk center.
2975 # @param theVec Vector, normal to the plane of the disk.
2976 # @param theR Disk radius.
2977 # @param theName Object name; when specified, this parameter is used
2978 # for result publication in the study. Otherwise, if automatic
2979 # publication is switched on, default value is used for result name.
2981 # @return New GEOM.GEOM_Object, containing the created disk.
2983 # @ref tui_creation_disk "Example"
2984 @ManageTransactions("PrimOp")
2985 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2987 Create a disk with given center, normal vector and radius.
2991 theVec Vector, normal to the plane of the disk.
2993 theName Object name; when specified, this parameter is used
2994 for result publication in the study. Otherwise, if automatic
2995 publication is switched on, default value is used for result name.
2998 New GEOM.GEOM_Object, containing the created disk.
3000 # Example: see GEOM_TestAll.py
3001 theR,Parameters = ParseParameters(theR)
3002 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
3003 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
3004 anObj.SetParameters(Parameters)
3005 self._autoPublish(anObj, theName, "disk")
3008 ## Create a disk, passing through three given points
3009 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3010 # @param theName Object name; when specified, this parameter is used
3011 # for result publication in the study. Otherwise, if automatic
3012 # publication is switched on, default value is used for result name.
3014 # @return New GEOM.GEOM_Object, containing the created disk.
3016 # @ref tui_creation_disk "Example"
3017 @ManageTransactions("PrimOp")
3018 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3020 Create a disk, passing through three given points
3023 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3024 theName Object name; when specified, this parameter is used
3025 for result publication in the study. Otherwise, if automatic
3026 publication is switched on, default value is used for result name.
3029 New GEOM.GEOM_Object, containing the created disk.
3031 # Example: see GEOM_TestAll.py
3032 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3033 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3034 self._autoPublish(anObj, theName, "disk")
3037 ## Create a disk with specified dimensions along OX-OY coordinate axes.
3038 # @param theR Radius of Face.
3039 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3040 # @param theName Object name; when specified, this parameter is used
3041 # for result publication in the study. Otherwise, if automatic
3042 # publication is switched on, default value is used for result name.
3044 # @return New GEOM.GEOM_Object, containing the created disk.
3046 # @ref tui_creation_face "Example"
3047 @ManageTransactions("PrimOp")
3048 def MakeDiskR(self, theR, theOrientation, theName=None):
3050 Create a disk with specified dimensions along OX-OY coordinate axes.
3053 theR Radius of Face.
3054 theOrientation set the orientation belong axis OXY or OYZ or OZX
3055 theName Object name; when specified, this parameter is used
3056 for result publication in the study. Otherwise, if automatic
3057 publication is switched on, default value is used for result name.
3060 New GEOM.GEOM_Object, containing the created disk.
3063 Disk3 = geompy.MakeDiskR(100., 1)
3065 # Example: see GEOM_TestAll.py
3066 theR,Parameters = ParseParameters(theR)
3067 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3068 RaiseIfFailed("MakeDiskR", self.PrimOp)
3069 anObj.SetParameters(Parameters)
3070 self._autoPublish(anObj, theName, "disk")
3073 ## Create a cylinder with given base point, axis, radius and height.
3074 # @param thePnt Central point of cylinder base.
3075 # @param theAxis Cylinder axis.
3076 # @param theR Cylinder radius.
3077 # @param theH Cylinder height.
3078 # @param theName Object name; when specified, this parameter is used
3079 # for result publication in the study. Otherwise, if automatic
3080 # publication is switched on, default value is used for result name.
3082 # @return New GEOM.GEOM_Object, containing the created cylinder.
3084 # @ref tui_creation_cylinder "Example"
3085 @ManageTransactions("PrimOp")
3086 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3088 Create a cylinder with given base point, axis, radius and height.
3091 thePnt Central point of cylinder base.
3092 theAxis Cylinder axis.
3093 theR Cylinder radius.
3094 theH Cylinder height.
3095 theName Object name; when specified, this parameter is used
3096 for result publication in the study. Otherwise, if automatic
3097 publication is switched on, default value is used for result name.
3100 New GEOM.GEOM_Object, containing the created cylinder.
3102 # Example: see GEOM_TestAll.py
3103 theR,theH,Parameters = ParseParameters(theR, theH)
3104 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3105 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3106 anObj.SetParameters(Parameters)
3107 self._autoPublish(anObj, theName, "cylinder")
3110 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3111 # @param thePnt Central point of cylinder base.
3112 # @param theAxis Cylinder axis.
3113 # @param theR Cylinder radius.
3114 # @param theH Cylinder height.
3115 # @param theA Cylinder angle in radians.
3116 # @param theName Object name; when specified, this parameter is used
3117 # for result publication in the study. Otherwise, if automatic
3118 # publication is switched on, default value is used for result name.
3120 # @return New GEOM.GEOM_Object, containing the created cylinder.
3122 # @ref tui_creation_cylinder "Example"
3123 @ManageTransactions("PrimOp")
3124 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3126 Create a portion of cylinder with given base point, axis, radius, height and angle.
3129 thePnt Central point of cylinder base.
3130 theAxis Cylinder axis.
3131 theR Cylinder radius.
3132 theH Cylinder height.
3133 theA Cylinder angle in radians.
3134 theName Object name; when specified, this parameter is used
3135 for result publication in the study. Otherwise, if automatic
3136 publication is switched on, default value is used for result name.
3139 New GEOM.GEOM_Object, containing the created cylinder.
3141 # Example: see GEOM_TestAll.py
3143 if isinstance(theA,str):
3145 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3147 theA = theA*math.pi/180.
3148 if theA<=0. or theA>=2*math.pi:
3149 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3150 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3151 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3152 anObj.SetParameters(Parameters)
3153 self._autoPublish(anObj, theName, "cylinder")
3156 ## Create a cylinder with given radius and height at
3157 # the origin of coordinate system. Axis of the cylinder
3158 # will be collinear to the OZ axis of the coordinate system.
3159 # @param theR Cylinder radius.
3160 # @param theH Cylinder height.
3161 # @param theName Object name; when specified, this parameter is used
3162 # for result publication in the study. Otherwise, if automatic
3163 # publication is switched on, default value is used for result name.
3165 # @return New GEOM.GEOM_Object, containing the created cylinder.
3167 # @ref tui_creation_cylinder "Example"
3168 @ManageTransactions("PrimOp")
3169 def MakeCylinderRH(self, theR, theH, theName=None):
3171 Create a cylinder with given radius and height at
3172 the origin of coordinate system. Axis of the cylinder
3173 will be collinear to the OZ axis of the coordinate system.
3176 theR Cylinder radius.
3177 theH Cylinder height.
3178 theName Object name; when specified, this parameter is used
3179 for result publication in the study. Otherwise, if automatic
3180 publication is switched on, default value is used for result name.
3183 New GEOM.GEOM_Object, containing the created cylinder.
3185 # Example: see GEOM_TestAll.py
3186 theR,theH,Parameters = ParseParameters(theR, theH)
3187 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3188 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3189 anObj.SetParameters(Parameters)
3190 self._autoPublish(anObj, theName, "cylinder")
3193 ## Create a portion of cylinder with given radius, height and angle at
3194 # the origin of coordinate system. Axis of the cylinder
3195 # will be collinear to the OZ axis of the coordinate system.
3196 # @param theR Cylinder radius.
3197 # @param theH Cylinder height.
3198 # @param theA Cylinder angle in radians.
3199 # @param theName Object name; when specified, this parameter is used
3200 # for result publication in the study. Otherwise, if automatic
3201 # publication is switched on, default value is used for result name.
3203 # @return New GEOM.GEOM_Object, containing the created cylinder.
3205 # @ref tui_creation_cylinder "Example"
3206 @ManageTransactions("PrimOp")
3207 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3209 Create a portion of cylinder with given radius, height and angle at
3210 the origin of coordinate system. Axis of the cylinder
3211 will be collinear to the OZ axis of the coordinate system.
3214 theR Cylinder radius.
3215 theH Cylinder height.
3216 theA Cylinder angle in radians.
3217 theName Object name; when specified, this parameter is used
3218 for result publication in the study. Otherwise, if automatic
3219 publication is switched on, default value is used for result name.
3222 New GEOM.GEOM_Object, containing the created cylinder.
3224 # Example: see GEOM_TestAll.py
3226 if isinstance(theA,str):
3228 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3230 theA = theA*math.pi/180.
3231 if theA<=0. or theA>=2*math.pi:
3232 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3233 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3234 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3235 anObj.SetParameters(Parameters)
3236 self._autoPublish(anObj, theName, "cylinder")
3239 ## Create a sphere with given center and radius.
3240 # @param thePnt Sphere center.
3241 # @param theR Sphere radius.
3242 # @param theName Object name; when specified, this parameter is used
3243 # for result publication in the study. Otherwise, if automatic
3244 # publication is switched on, default value is used for result name.
3246 # @return New GEOM.GEOM_Object, containing the created sphere.
3248 # @ref tui_creation_sphere "Example"
3249 @ManageTransactions("PrimOp")
3250 def MakeSpherePntR(self, thePnt, theR, theName=None):
3252 Create a sphere with given center and radius.
3255 thePnt Sphere center.
3257 theName Object name; when specified, this parameter is used
3258 for result publication in the study. Otherwise, if automatic
3259 publication is switched on, default value is used for result name.
3262 New GEOM.GEOM_Object, containing the created sphere.
3264 # Example: see GEOM_TestAll.py
3265 theR,Parameters = ParseParameters(theR)
3266 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3267 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3268 anObj.SetParameters(Parameters)
3269 self._autoPublish(anObj, theName, "sphere")
3272 ## Create a sphere with given center and radius.
3273 # @param x,y,z Coordinates of sphere center.
3274 # @param theR Sphere radius.
3275 # @param theName Object name; when specified, this parameter is used
3276 # for result publication in the study. Otherwise, if automatic
3277 # publication is switched on, default value is used for result name.
3279 # @return New GEOM.GEOM_Object, containing the created sphere.
3281 # @ref tui_creation_sphere "Example"
3282 def MakeSphere(self, x, y, z, theR, theName=None):
3284 Create a sphere with given center and radius.
3287 x,y,z Coordinates of sphere center.
3289 theName Object name; when specified, this parameter is used
3290 for result publication in the study. Otherwise, if automatic
3291 publication is switched on, default value is used for result name.
3294 New GEOM.GEOM_Object, containing the created sphere.
3296 # Example: see GEOM_TestAll.py
3297 point = self.MakeVertex(x, y, z)
3298 # note: auto-publishing is done in self.MakeSpherePntR()
3299 anObj = self.MakeSpherePntR(point, theR, theName)
3302 ## Create a sphere with given radius at the origin of coordinate system.
3303 # @param theR Sphere radius.
3304 # @param theName Object name; when specified, this parameter is used
3305 # for result publication in the study. Otherwise, if automatic
3306 # publication is switched on, default value is used for result name.
3308 # @return New GEOM.GEOM_Object, containing the created sphere.
3310 # @ref tui_creation_sphere "Example"
3311 @ManageTransactions("PrimOp")
3312 def MakeSphereR(self, theR, theName=None):
3314 Create a sphere with given radius at the origin of coordinate system.
3318 theName Object name; when specified, this parameter is used
3319 for result publication in the study. Otherwise, if automatic
3320 publication is switched on, default value is used for result name.
3323 New GEOM.GEOM_Object, containing the created sphere.
3325 # Example: see GEOM_TestAll.py
3326 theR,Parameters = ParseParameters(theR)
3327 anObj = self.PrimOp.MakeSphereR(theR)
3328 RaiseIfFailed("MakeSphereR", self.PrimOp)
3329 anObj.SetParameters(Parameters)
3330 self._autoPublish(anObj, theName, "sphere")
3333 ## Create a cone with given base point, axis, height and radiuses.
3334 # @param thePnt Central point of the first cone base.
3335 # @param theAxis Cone axis.
3336 # @param theR1 Radius of the first cone base.
3337 # @param theR2 Radius of the second cone base.
3338 # \note If both radiuses are non-zero, the cone will be truncated.
3339 # \note If the radiuses are equal, a cylinder will be created instead.
3340 # @param theH Cone height.
3341 # @param theName Object name; when specified, this parameter is used
3342 # for result publication in the study. Otherwise, if automatic
3343 # publication is switched on, default value is used for result name.
3345 # @return New GEOM.GEOM_Object, containing the created cone.
3347 # @ref tui_creation_cone "Example"
3348 @ManageTransactions("PrimOp")
3349 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3351 Create a cone with given base point, axis, height and radiuses.
3354 thePnt Central point of the first cone base.
3356 theR1 Radius of the first cone base.
3357 theR2 Radius of the second cone base.
3359 theName Object name; when specified, this parameter is used
3360 for result publication in the study. Otherwise, if automatic
3361 publication is switched on, default value is used for result name.
3364 If both radiuses are non-zero, the cone will be truncated.
3365 If the radiuses are equal, a cylinder will be created instead.
3368 New GEOM.GEOM_Object, containing the created cone.
3370 # Example: see GEOM_TestAll.py
3371 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3372 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3373 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3374 anObj.SetParameters(Parameters)
3375 self._autoPublish(anObj, theName, "cone")
3378 ## Create a cone with given height and radiuses at
3379 # the origin of coordinate system. Axis of the cone will
3380 # be collinear to the OZ axis of the coordinate system.
3381 # @param theR1 Radius of the first cone base.
3382 # @param theR2 Radius of the second cone base.
3383 # \note If both radiuses are non-zero, the cone will be truncated.
3384 # \note If the radiuses are equal, a cylinder will be created instead.
3385 # @param theH Cone height.
3386 # @param theName Object name; when specified, this parameter is used
3387 # for result publication in the study. Otherwise, if automatic
3388 # publication is switched on, default value is used for result name.
3390 # @return New GEOM.GEOM_Object, containing the created cone.
3392 # @ref tui_creation_cone "Example"
3393 @ManageTransactions("PrimOp")
3394 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3396 Create a cone with given height and radiuses at
3397 the origin of coordinate system. Axis of the cone will
3398 be collinear to the OZ axis of the coordinate system.
3401 theR1 Radius of the first cone base.
3402 theR2 Radius of the second cone base.
3404 theName Object name; when specified, this parameter is used
3405 for result publication in the study. Otherwise, if automatic
3406 publication is switched on, default value is used for result name.
3409 If both radiuses are non-zero, the cone will be truncated.
3410 If the radiuses are equal, a cylinder will be created instead.
3413 New GEOM.GEOM_Object, containing the created cone.
3415 # Example: see GEOM_TestAll.py
3416 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3417 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3418 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3419 anObj.SetParameters(Parameters)
3420 self._autoPublish(anObj, theName, "cone")
3423 ## Create a torus with given center, normal vector and radiuses.
3424 # @param thePnt Torus central point.
3425 # @param theVec Torus axis of symmetry.
3426 # @param theRMajor Torus major radius.
3427 # @param theRMinor Torus minor radius.
3428 # @param theName Object name; when specified, this parameter is used
3429 # for result publication in the study. Otherwise, if automatic
3430 # publication is switched on, default value is used for result name.
3432 # @return New GEOM.GEOM_Object, containing the created torus.
3434 # @ref tui_creation_torus "Example"
3435 @ManageTransactions("PrimOp")
3436 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3438 Create a torus with given center, normal vector and radiuses.
3441 thePnt Torus central point.
3442 theVec Torus axis of symmetry.
3443 theRMajor Torus major radius.
3444 theRMinor Torus minor radius.
3445 theName Object name; when specified, this parameter is used
3446 for result publication in the study. Otherwise, if automatic
3447 publication is switched on, default value is used for result name.
3450 New GEOM.GEOM_Object, containing the created torus.
3452 # Example: see GEOM_TestAll.py
3453 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3454 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3455 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3456 anObj.SetParameters(Parameters)
3457 self._autoPublish(anObj, theName, "torus")
3460 ## Create a torus with given radiuses at the origin of coordinate system.
3461 # @param theRMajor Torus major radius.
3462 # @param theRMinor Torus minor radius.
3463 # @param theName Object name; when specified, this parameter is used
3464 # for result publication in the study. Otherwise, if automatic
3465 # publication is switched on, default value is used for result name.
3467 # @return New GEOM.GEOM_Object, containing the created torus.
3469 # @ref tui_creation_torus "Example"
3470 @ManageTransactions("PrimOp")
3471 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3473 Create a torus with given radiuses at the origin of coordinate system.
3476 theRMajor Torus major radius.
3477 theRMinor Torus minor radius.
3478 theName Object name; when specified, this parameter is used
3479 for result publication in the study. Otherwise, if automatic
3480 publication is switched on, default value is used for result name.
3483 New GEOM.GEOM_Object, containing the created torus.
3485 # Example: see GEOM_TestAll.py
3486 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3487 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3488 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3489 anObj.SetParameters(Parameters)
3490 self._autoPublish(anObj, theName, "torus")
3493 # end of l3_3d_primitives
3496 ## @addtogroup l3_complex
3499 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3500 # @param theBase Base shape to be extruded.
3501 # @param thePoint1 First end of extrusion vector.
3502 # @param thePoint2 Second end of extrusion vector.
3503 # @param theScaleFactor Use it to make prism with scaled second base.
3504 # Nagative value means not scaled second base.
3505 # @param theName Object name; when specified, this parameter is used
3506 # for result publication in the study. Otherwise, if automatic
3507 # publication is switched on, default value is used for result name.
3509 # @return New GEOM.GEOM_Object, containing the created prism.
3511 # @ref tui_creation_prism "Example"
3512 @ManageTransactions("PrimOp")
3513 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3515 Create a shape by extrusion of the base shape along a vector, defined by two points.
3518 theBase Base shape to be extruded.
3519 thePoint1 First end of extrusion vector.
3520 thePoint2 Second end of extrusion vector.
3521 theScaleFactor Use it to make prism with scaled second base.
3522 Nagative value means not scaled second base.
3523 theName Object name; when specified, this parameter is used
3524 for result publication in the study. Otherwise, if automatic
3525 publication is switched on, default value is used for result name.
3528 New GEOM.GEOM_Object, containing the created prism.
3530 # Example: see GEOM_TestAll.py
3533 if theScaleFactor > 0:
3534 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3535 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3537 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3538 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3539 anObj.SetParameters(Parameters)
3540 self._autoPublish(anObj, theName, "prism")
3543 ## Create a shape by extrusion of the base shape along a
3544 # vector, defined by two points, in 2 Ways (forward/backward).
3545 # @param theBase Base shape to be extruded.
3546 # @param thePoint1 First end of extrusion vector.
3547 # @param thePoint2 Second end of extrusion vector.
3548 # @param theName Object name; when specified, this parameter is used
3549 # for result publication in the study. Otherwise, if automatic
3550 # publication is switched on, default value is used for result name.
3552 # @return New GEOM.GEOM_Object, containing the created prism.
3554 # @ref tui_creation_prism "Example"
3555 @ManageTransactions("PrimOp")
3556 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3558 Create a shape by extrusion of the base shape along a
3559 vector, defined by two points, in 2 Ways (forward/backward).
3562 theBase Base shape to be extruded.
3563 thePoint1 First end of extrusion vector.
3564 thePoint2 Second end of extrusion vector.
3565 theName Object name; when specified, this parameter is used
3566 for result publication in the study. Otherwise, if automatic
3567 publication is switched on, default value is used for result name.
3570 New GEOM.GEOM_Object, containing the created prism.
3572 # Example: see GEOM_TestAll.py
3573 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3574 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3575 self._autoPublish(anObj, theName, "prism")
3578 ## Create a shape by extrusion of the base shape along the vector,
3579 # i.e. all the space, transfixed by the base shape during its translation
3580 # along the vector on the given distance.
3581 # @param theBase Base shape to be extruded.
3582 # @param theVec Direction of extrusion.
3583 # @param theH Prism dimension along theVec.
3584 # @param theScaleFactor Use it to make prism with scaled second base.
3585 # Negative value means not scaled second base.
3586 # @param theName Object name; when specified, this parameter is used
3587 # for result publication in the study. Otherwise, if automatic
3588 # publication is switched on, default value is used for result name.
3590 # @return New GEOM.GEOM_Object, containing the created prism.
3592 # @ref tui_creation_prism "Example"
3593 @ManageTransactions("PrimOp")
3594 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3596 Create a shape by extrusion of the base shape along the vector,
3597 i.e. all the space, transfixed by the base shape during its translation
3598 along the vector on the given distance.
3601 theBase Base shape to be extruded.
3602 theVec Direction of extrusion.
3603 theH Prism dimension along theVec.
3604 theScaleFactor Use it to make prism with scaled second base.
3605 Negative value means not scaled second base.
3606 theName Object name; when specified, this parameter is used
3607 for result publication in the study. Otherwise, if automatic
3608 publication is switched on, default value is used for result name.
3611 New GEOM.GEOM_Object, containing the created prism.
3613 # Example: see GEOM_TestAll.py
3616 if theScaleFactor > 0:
3617 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3618 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3620 theH,Parameters = ParseParameters(theH)
3621 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3622 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3623 anObj.SetParameters(Parameters)
3624 self._autoPublish(anObj, theName, "prism")
3627 ## Create a shape by extrusion of the base shape along the vector,
3628 # i.e. all the space, transfixed by the base shape during its translation
3629 # along the vector on the given distance in 2 Ways (forward/backward).
3630 # @param theBase Base shape to be extruded.
3631 # @param theVec Direction of extrusion.
3632 # @param theH Prism dimension along theVec in forward direction.
3633 # @param theName Object name; when specified, this parameter is used
3634 # for result publication in the study. Otherwise, if automatic
3635 # publication is switched on, default value is used for result name.
3637 # @return New GEOM.GEOM_Object, containing the created prism.
3639 # @ref tui_creation_prism "Example"
3640 @ManageTransactions("PrimOp")
3641 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3643 Create a shape by extrusion of the base shape along the vector,
3644 i.e. all the space, transfixed by the base shape during its translation
3645 along the vector on the given distance in 2 Ways (forward/backward).
3648 theBase Base shape to be extruded.
3649 theVec Direction of extrusion.
3650 theH Prism dimension along theVec in forward direction.
3651 theName Object name; when specified, this parameter is used
3652 for result publication in the study. Otherwise, if automatic
3653 publication is switched on, default value is used for result name.
3656 New GEOM.GEOM_Object, containing the created prism.
3658 # Example: see GEOM_TestAll.py
3659 theH,Parameters = ParseParameters(theH)
3660 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3661 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3662 anObj.SetParameters(Parameters)
3663 self._autoPublish(anObj, theName, "prism")
3666 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3667 # @param theBase Base shape to be extruded.
3668 # @param theDX, theDY, theDZ Directions of extrusion.
3669 # @param theScaleFactor Use it to make prism with scaled second base.
3670 # Nagative value means not scaled second base.
3671 # @param theName Object name; when specified, this parameter is used
3672 # for result publication in the study. Otherwise, if automatic
3673 # publication is switched on, default value is used for result name.
3675 # @return New GEOM.GEOM_Object, containing the created prism.
3677 # @ref tui_creation_prism "Example"
3678 @ManageTransactions("PrimOp")
3679 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3681 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3684 theBase Base shape to be extruded.
3685 theDX, theDY, theDZ Directions of extrusion.
3686 theScaleFactor Use it to make prism with scaled second base.
3687 Nagative value means not scaled second base.
3688 theName Object name; when specified, this parameter is used
3689 for result publication in the study. Otherwise, if automatic
3690 publication is switched on, default value is used for result name.
3693 New GEOM.GEOM_Object, containing the created prism.
3695 # Example: see GEOM_TestAll.py
3698 if theScaleFactor > 0:
3699 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3700 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3702 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3703 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3704 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3705 anObj.SetParameters(Parameters)
3706 self._autoPublish(anObj, theName, "prism")
3709 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3710 # i.e. all the space, transfixed by the base shape during its translation
3711 # along the vector on the given distance in 2 Ways (forward/backward).
3712 # @param theBase Base shape to be extruded.
3713 # @param theDX, theDY, theDZ Directions of extrusion.
3714 # @param theName Object name; when specified, this parameter is used
3715 # for result publication in the study. Otherwise, if automatic
3716 # publication is switched on, default value is used for result name.
3718 # @return New GEOM.GEOM_Object, containing the created prism.
3720 # @ref tui_creation_prism "Example"
3721 @ManageTransactions("PrimOp")
3722 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3724 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3725 i.e. all the space, transfixed by the base shape during its translation
3726 along the vector on the given distance in 2 Ways (forward/backward).
3729 theBase Base shape to be extruded.
3730 theDX, theDY, theDZ Directions of extrusion.
3731 theName Object name; when specified, this parameter is used
3732 for result publication in the study. Otherwise, if automatic
3733 publication is switched on, default value is used for result name.
3736 New GEOM.GEOM_Object, containing the created prism.
3738 # Example: see GEOM_TestAll.py
3739 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3740 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3741 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3742 anObj.SetParameters(Parameters)
3743 self._autoPublish(anObj, theName, "prism")
3746 ## Create a shape by revolution of the base shape around the axis
3747 # on the given angle, i.e. all the space, transfixed by the base
3748 # shape during its rotation around the axis on the given angle.
3749 # @param theBase Base shape to be rotated.
3750 # @param theAxis Rotation axis.
3751 # @param theAngle Rotation angle in radians.
3752 # @param theName Object name; when specified, this parameter is used
3753 # for result publication in the study. Otherwise, if automatic
3754 # publication is switched on, default value is used for result name.
3756 # @return New GEOM.GEOM_Object, containing the created revolution.
3758 # @ref tui_creation_revolution "Example"
3759 @ManageTransactions("PrimOp")
3760 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3762 Create a shape by revolution of the base shape around the axis
3763 on the given angle, i.e. all the space, transfixed by the base
3764 shape during its rotation around the axis on the given angle.
3767 theBase Base shape to be rotated.
3768 theAxis Rotation axis.
3769 theAngle Rotation angle in radians.
3770 theName Object name; when specified, this parameter is used
3771 for result publication in the study. Otherwise, if automatic
3772 publication is switched on, default value is used for result name.
3775 New GEOM.GEOM_Object, containing the created revolution.
3777 # Example: see GEOM_TestAll.py
3778 theAngle,Parameters = ParseParameters(theAngle)
3779 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3780 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3781 anObj.SetParameters(Parameters)
3782 self._autoPublish(anObj, theName, "revolution")
3785 ## Create a shape by revolution of the base shape around the axis
3786 # on the given angle, i.e. all the space, transfixed by the base
3787 # shape during its rotation around the axis on the given angle in
3788 # both directions (forward/backward)
3789 # @param theBase Base shape to be rotated.
3790 # @param theAxis Rotation axis.
3791 # @param theAngle Rotation angle in radians.
3792 # @param theName Object name; when specified, this parameter is used
3793 # for result publication in the study. Otherwise, if automatic
3794 # publication is switched on, default value is used for result name.
3796 # @return New GEOM.GEOM_Object, containing the created revolution.
3798 # @ref tui_creation_revolution "Example"
3799 @ManageTransactions("PrimOp")
3800 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3802 Create a shape by revolution of the base shape around the axis
3803 on the given angle, i.e. all the space, transfixed by the base
3804 shape during its rotation around the axis on the given angle in
3805 both directions (forward/backward).
3808 theBase Base shape to be rotated.
3809 theAxis Rotation axis.
3810 theAngle Rotation angle in radians.
3811 theName Object name; when specified, this parameter is used
3812 for result publication in the study. Otherwise, if automatic
3813 publication is switched on, default value is used for result name.
3816 New GEOM.GEOM_Object, containing the created revolution.
3818 theAngle,Parameters = ParseParameters(theAngle)
3819 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3820 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3821 anObj.SetParameters(Parameters)
3822 self._autoPublish(anObj, theName, "revolution")
3825 ## Create a face from a given set of contours.
3826 # @param theContours either a list or a compound of edges/wires.
3827 # @param theMinDeg a minimal degree of BSpline surface to create.
3828 # @param theMaxDeg a maximal degree of BSpline surface to create.
3829 # @param theTol2D a 2d tolerance to be reached.
3830 # @param theTol3D a 3d tolerance to be reached.
3831 # @param theNbIter a number of iteration of approximation algorithm.
3832 # @param theMethod Kind of method to perform filling operation
3833 # (see GEOM.filling_oper_method enum).
3834 # @param isApprox if True, BSpline curves are generated in the process
3835 # of surface construction. By default it is False, that means
3836 # the surface is created using given curves. The usage of
3837 # Approximation makes the algorithm work slower, but allows
3838 # building the surface for rather complex cases.
3839 # @param theName Object name; when specified, this parameter is used
3840 # for result publication in the study. Otherwise, if automatic
3841 # publication is switched on, default value is used for result name.
3843 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3845 # @ref tui_creation_filling "Example"
3846 @ManageTransactions("PrimOp")
3847 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3848 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3850 Create a face from a given set of contours.
3853 theContours either a list or a compound of edges/wires.
3854 theMinDeg a minimal degree of BSpline surface to create.
3855 theMaxDeg a maximal degree of BSpline surface to create.
3856 theTol2D a 2d tolerance to be reached.
3857 theTol3D a 3d tolerance to be reached.
3858 theNbIter a number of iteration of approximation algorithm.
3859 theMethod Kind of method to perform filling operation
3860 (see GEOM.filling_oper_method enum).
3861 isApprox if True, BSpline curves are generated in the process
3862 of surface construction. By default it is False, that means
3863 the surface is created using given curves. The usage of
3864 Approximation makes the algorithm work slower, but allows
3865 building the surface for rather complex cases.
3866 theName Object name; when specified, this parameter is used
3867 for result publication in the study. Otherwise, if automatic
3868 publication is switched on, default value is used for result name.
3871 New GEOM.GEOM_Object (face), containing the created filling surface.
3874 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3876 # Example: see GEOM_TestAll.py
3877 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3878 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3879 theTol2D, theTol3D, theNbIter,
3880 theMethod, isApprox)
3881 RaiseIfFailed("MakeFilling", self.PrimOp)
3882 anObj.SetParameters(Parameters)
3883 self._autoPublish(anObj, theName, "filling")
3887 ## Create a face from a given set of contours.
3888 # This method corresponds to MakeFilling() with isApprox=True.
3889 # @param theContours either a list or a compound of edges/wires.
3890 # @param theMinDeg a minimal degree of BSpline surface to create.
3891 # @param theMaxDeg a maximal degree of BSpline surface to create.
3892 # @param theTol3D a 3d tolerance to be reached.
3893 # @param theName Object name; when specified, this parameter is used
3894 # for result publication in the study. Otherwise, if automatic
3895 # publication is switched on, default value is used for result name.
3897 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3899 # @ref tui_creation_filling "Example"
3900 @ManageTransactions("PrimOp")
3901 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3903 Create a filling from the given compound of contours.
3904 This method corresponds to MakeFilling() with isApprox=True.
3907 theContours either a list or a compound of edges/wires.
3908 theMinDeg a minimal degree of BSpline surface to create.
3909 theMaxDeg a maximal degree of BSpline surface to create.
3910 theTol3D a 3d tolerance to be reached.
3911 theName Object name; when specified, this parameter is used
3912 for result publication in the study. Otherwise, if automatic
3913 publication is switched on, default value is used for result name.
3916 New GEOM.GEOM_Object (face), containing the created filling surface.
3919 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3921 # Example: see GEOM_TestAll.py
3922 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3923 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3924 0, theTol3D, 0, GEOM.FOM_Default, True)
3925 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3926 anObj.SetParameters(Parameters)
3927 self._autoPublish(anObj, theName, "filling")
3930 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3931 # @param theSeqSections - set of specified sections.
3932 # @param theModeSolid - mode defining building solid or shell
3933 # @param thePreci - precision 3D used for smoothing
3934 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3935 # @param theName Object name; when specified, this parameter is used
3936 # for result publication in the study. Otherwise, if automatic
3937 # publication is switched on, default value is used for result name.
3939 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3941 # @ref swig_todo "Example"
3942 @ManageTransactions("PrimOp")
3943 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3945 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3948 theSeqSections - set of specified sections.
3949 theModeSolid - mode defining building solid or shell
3950 thePreci - precision 3D used for smoothing
3951 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3952 theName Object name; when specified, this parameter is used
3953 for result publication in the study. Otherwise, if automatic
3954 publication is switched on, default value is used for result name.
3957 New GEOM.GEOM_Object, containing the created shell or solid.
3959 # Example: see GEOM_TestAll.py
3960 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3961 RaiseIfFailed("MakeThruSections", self.PrimOp)
3962 self._autoPublish(anObj, theName, "filling")
3965 ## Create a shape by extrusion of the base shape along
3966 # the path shape. The path shape can be a wire or an edge. It is
3967 # possible to generate groups along with the result by means of
3968 # setting the flag \a IsGenerateGroups.<BR>
3969 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3970 # set, an error is occurred. If \a thePath is not closed edge/wire,
3971 # the following groups are returned:
3972 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3974 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3977 # "Down" and "Up" groups contain:
3978 # - Edges if \a theBase is edge or wire;
3979 # - Faces if \a theBase is face or shell.<BR>
3981 # "Side1" and "Side2" groups contain edges generated from the first
3982 # and last vertices of \a theBase. The first and last vertices are
3983 # determined taking into account edge/wire orientation.<BR>
3984 # "Other" group represents faces generated from the bounding edges of
3987 # @param theBase Base shape to be extruded.
3988 # @param thePath Path shape to extrude the base shape along it.
3989 # @param IsGenerateGroups flag that tells if it is necessary to
3990 # create groups. It is equal to False by default.
3991 # @param theName Object name; when specified, this parameter is used
3992 # for result publication in the study. Otherwise, if automatic
3993 # publication is switched on, default value is used for result name.
3995 # @return New GEOM.GEOM_Object, containing the created pipe if
3996 # \a IsGenerateGroups is not set. Otherwise it returns a
3997 # list of GEOM.GEOM_Object. Its first element is the created pipe, the
3998 # remaining ones are created groups.
4000 # @ref tui_creation_pipe "Example"
4001 @ManageTransactions("PrimOp")
4002 def MakePipe(self, theBase, thePath,
4003 IsGenerateGroups=False, theName=None):
4005 Create a shape by extrusion of the base shape along
4006 the path shape. The path shape can be a wire or an edge. It is
4007 possible to generate groups along with the result by means of
4008 setting the flag IsGenerateGroups.
4009 If thePath is a closed edge or wire and IsGenerateGroups is
4010 set, an error is occurred. If thePath is not closed edge/wire,
4011 the following groups are returned:
4012 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4014 - If theBase is closed edge or wire, face or shell: "Down", "Up",
4016 "Down" and "Up" groups contain:
4017 - Edges if theBase is edge or wire;
4018 - Faces if theBase is face or shell.
4019 "Side1" and "Side2" groups contain edges generated from the first
4020 and last vertices of theBase. The first and last vertices are
4021 determined taking into account edge/wire orientation.
4022 "Other" group represents faces generated from the bounding edges of
4026 theBase Base shape to be extruded.
4027 thePath Path shape to extrude the base shape along it.
4028 IsGenerateGroups flag that tells if it is necessary to
4029 create groups. It is equal to False by default.
4030 theName Object name; when specified, this parameter is used
4031 for result publication in the study. Otherwise, if automatic
4032 publication is switched on, default value is used for result name.
4035 New GEOM.GEOM_Object, containing the created pipe if
4036 IsGenerateGroups is not set. Otherwise it returns a
4037 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4038 remaining ones are created groups.
4040 # Example: see GEOM_TestAll.py
4041 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4042 RaiseIfFailed("MakePipe", self.PrimOp)
4044 if IsGenerateGroups:
4045 self._autoPublish(aList, theName, "pipe")
4048 self._autoPublish(aList[0], theName, "pipe")
4051 ## Create a shape by extrusion of the profile shape along
4052 # the path shape. The path shape can be a wire or an edge.
4053 # the several profiles can be specified in the several locations of path.
4054 # It is possible to generate groups along with the result by means of
4055 # setting the flag \a IsGenerateGroups. For detailed information on
4056 # groups that can be created please see the method MakePipe().
4057 # @param theSeqBases - list of Bases shape to be extruded.
4058 # @param theLocations - list of locations on the path corresponding
4059 # specified list of the Bases shapes. Number of locations
4060 # should be equal to number of bases or list of locations can be empty.
4061 # @param thePath - Path shape to extrude the base shape along it.
4062 # @param theWithContact - the mode defining that the section is translated to be in
4063 # contact with the spine.
4064 # @param theWithCorrection - defining that the section is rotated to be
4065 # orthogonal to the spine tangent in the correspondent point
4066 # @param IsGenerateGroups - flag that tells if it is necessary to
4067 # create groups. It is equal to False by default.
4068 # @param theName Object name; when specified, this parameter is used
4069 # for result publication in the study. Otherwise, if automatic
4070 # publication is switched on, default value is used for result name.
4072 # @return New GEOM.GEOM_Object, containing the created pipe if
4073 # \a IsGenerateGroups is not set. Otherwise it returns new
4074 # GEOM.ListOfGO. Its first element is the created pipe, the
4075 # remaining ones are created groups.
4077 # @ref tui_creation_pipe_with_diff_sec "Example"
4078 @ManageTransactions("PrimOp")
4079 def MakePipeWithDifferentSections(self, theSeqBases,
4080 theLocations, thePath,
4081 theWithContact, theWithCorrection,
4082 IsGenerateGroups=False, theName=None):
4084 Create a shape by extrusion of the profile shape along
4085 the path shape. The path shape can be a wire or an edge.
4086 the several profiles can be specified in the several locations of path.
4087 It is possible to generate groups along with the result by means of
4088 setting the flag IsGenerateGroups. For detailed information on
4089 groups that can be created please see the method geompy.MakePipe().
4092 theSeqBases - list of Bases shape to be extruded.
4093 theLocations - list of locations on the path corresponding
4094 specified list of the Bases shapes. Number of locations
4095 should be equal to number of bases or list of locations can be empty.
4096 thePath - Path shape to extrude the base shape along it.
4097 theWithContact - the mode defining that the section is translated to be in
4098 contact with the spine(0/1)
4099 theWithCorrection - defining that the section is rotated to be
4100 orthogonal to the spine tangent in the correspondent point (0/1)
4101 IsGenerateGroups - flag that tells if it is necessary to
4102 create groups. It is equal to False by default.
4103 theName Object name; when specified, this parameter is used
4104 for result publication in the study. Otherwise, if automatic
4105 publication is switched on, default value is used for result name.
4108 New GEOM.GEOM_Object, containing the created pipe if
4109 IsGenerateGroups is not set. Otherwise it returns new
4110 GEOM.ListOfGO. Its first element is the created pipe, the
4111 remaining ones are created groups.
4113 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4114 theLocations, thePath,
4115 theWithContact, theWithCorrection,
4116 False, IsGenerateGroups)
4117 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4119 if IsGenerateGroups:
4120 self._autoPublish(aList, theName, "pipe")
4123 self._autoPublish(aList[0], theName, "pipe")
4126 ## Create a shape by extrusion of the profile shape along
4127 # the path shape. This function is a version of
4128 # MakePipeWithDifferentSections() with the same parameters, except
4129 # eliminated theWithContact and theWithCorrection. So it is
4130 # possible to find the description of all parameters is in this
4131 # method. The difference is that this method performs the operation
4132 # step by step, i.e. it creates pipes between each pair of neighbor
4133 # sections and fuses them into a single shape.
4135 # @ref tui_creation_pipe_with_diff_sec "Example"
4136 @ManageTransactions("PrimOp")
4137 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4138 theLocations, thePath,
4139 IsGenerateGroups=False, theName=None):
4141 Create a shape by extrusion of the profile shape along
4142 the path shape. This function is a version of
4143 MakePipeWithDifferentSections() with the same parameters, except
4144 eliminated theWithContact and theWithCorrection. So it is
4145 possible to find the description of all parameters is in this
4146 method. The difference is that this method performs the operation
4147 step by step, i.e. it creates pipes between each pair of neighbor
4148 sections and fuses them into a single shape.
4150 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4151 theLocations, thePath,
4153 True, IsGenerateGroups)
4154 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4156 if IsGenerateGroups:
4157 self._autoPublish(aList, theName, "pipe")
4160 self._autoPublish(aList[0], theName, "pipe")
4163 ## Create a shape by extrusion of the profile shape along
4164 # the path shape. The path shape can be a wire or an edge.
4165 # the several profiles can be specified in the several locations of path.
4166 # It is possible to generate groups along with the result by means of
4167 # setting the flag \a IsGenerateGroups. For detailed information on
4168 # groups that can be created please see the method MakePipe().
4169 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4170 # shell or face. If number of faces in neighbour sections
4171 # aren't coincided result solid between such sections will
4172 # be created using external boundaries of this shells.
4173 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4174 # This list is used for searching correspondences between
4175 # faces in the sections. Size of this list must be equal
4176 # to size of list of base shapes.
4177 # @param theLocations - list of locations on the path corresponding
4178 # specified list of the Bases shapes. Number of locations
4179 # should be equal to number of bases. First and last
4180 # locations must be coincided with first and last vertexes
4181 # of path correspondingly.
4182 # @param thePath - Path shape to extrude the base shape along it.
4183 # @param theWithContact - the mode defining that the section is translated to be in
4184 # contact with the spine.
4185 # @param theWithCorrection - defining that the section is rotated to be
4186 # orthogonal to the spine tangent in the correspondent point
4187 # @param IsGenerateGroups - flag that tells if it is necessary to
4188 # create groups. It is equal to False by default.
4189 # @param theName Object name; when specified, this parameter is used
4190 # for result publication in the study. Otherwise, if automatic
4191 # publication is switched on, default value is used for result name.
4193 # @return New GEOM.GEOM_Object, containing the created solids if
4194 # \a IsGenerateGroups is not set. Otherwise it returns new
4195 # GEOM.ListOfGO. Its first element is the created solids, the
4196 # remaining ones are created groups.
4198 # @ref tui_creation_pipe_with_shell_sec "Example"
4199 @ManageTransactions("PrimOp")
4200 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4201 theLocations, thePath,
4202 theWithContact, theWithCorrection,
4203 IsGenerateGroups=False, theName=None):
4205 Create a shape by extrusion of the profile shape along
4206 the path shape. The path shape can be a wire or an edge.
4207 the several profiles can be specified in the several locations of path.
4208 It is possible to generate groups along with the result by means of
4209 setting the flag IsGenerateGroups. For detailed information on
4210 groups that can be created please see the method geompy.MakePipe().
4213 theSeqBases - list of Bases shape to be extruded. Base shape must be
4214 shell or face. If number of faces in neighbour sections
4215 aren't coincided result solid between such sections will
4216 be created using external boundaries of this shells.
4217 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4218 This list is used for searching correspondences between
4219 faces in the sections. Size of this list must be equal
4220 to size of list of base shapes.
4221 theLocations - list of locations on the path corresponding
4222 specified list of the Bases shapes. Number of locations
4223 should be equal to number of bases. First and last
4224 locations must be coincided with first and last vertexes
4225 of path correspondingly.
4226 thePath - Path shape to extrude the base shape along it.
4227 theWithContact - the mode defining that the section is translated to be in
4228 contact with the spine (0/1)
4229 theWithCorrection - defining that the section is rotated to be
4230 orthogonal to the spine tangent in the correspondent point (0/1)
4231 IsGenerateGroups - flag that tells if it is necessary to
4232 create groups. It is equal to False by default.
4233 theName Object name; when specified, this parameter is used
4234 for result publication in the study. Otherwise, if automatic
4235 publication is switched on, default value is used for result name.
4238 New GEOM.GEOM_Object, containing the created solids if
4239 IsGenerateGroups is not set. Otherwise it returns new
4240 GEOM.ListOfGO. Its first element is the created solids, the
4241 remaining ones are created groups.
4243 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4244 theLocations, thePath,
4245 theWithContact, theWithCorrection,
4247 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4249 if IsGenerateGroups:
4250 self._autoPublish(aList, theName, "pipe")
4253 self._autoPublish(aList[0], theName, "pipe")
4256 ## Create a shape by extrusion of the profile shape along
4257 # the path shape. This function is used only for debug pipe
4258 # functionality - it is a version of function MakePipeWithShellSections()
4259 # which give a possibility to receive information about
4260 # creating pipe between each pair of sections step by step.
4261 @ManageTransactions("PrimOp")
4262 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4263 theLocations, thePath,
4264 theWithContact, theWithCorrection,
4265 IsGenerateGroups=False, theName=None):
4267 Create a shape by extrusion of the profile shape along
4268 the path shape. This function is used only for debug pipe
4269 functionality - it is a version of previous function
4270 geompy.MakePipeWithShellSections() which give a possibility to
4271 receive information about creating pipe between each pair of
4272 sections step by step.
4275 nbsect = len(theSeqBases)
4276 nbsubsect = len(theSeqSubBases)
4277 #print "nbsect = ",nbsect
4278 for i in range(1,nbsect):
4280 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4281 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4283 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4284 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4285 tmpLocations, thePath,
4286 theWithContact, theWithCorrection,
4288 if self.PrimOp.IsDone() == 0:
4289 print("Problems with pipe creation between ",i," and ",i+1," sections")
4290 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4293 print("Pipe between ",i," and ",i+1," sections is OK")
4294 res.append(aList[0])
4298 resc = self.MakeCompound(res)
4299 #resc = self.MakeSewing(res, 0.001)
4300 #print "resc: ",resc
4301 self._autoPublish(resc, theName, "pipe")
4304 ## Create solids between given sections.
4305 # It is possible to generate groups along with the result by means of
4306 # setting the flag \a IsGenerateGroups. For detailed information on
4307 # groups that can be created please see the method MakePipe().
4308 # @param theSeqBases - list of sections (shell or face).
4309 # @param theLocations - list of corresponding vertexes
4310 # @param IsGenerateGroups - flag that tells if it is necessary to
4311 # create groups. It is equal to False by default.
4312 # @param theName Object name; when specified, this parameter is used
4313 # for result publication in the study. Otherwise, if automatic
4314 # publication is switched on, default value is used for result name.
4316 # @return New GEOM.GEOM_Object, containing the created solids if
4317 # \a IsGenerateGroups is not set. Otherwise it returns new
4318 # GEOM.ListOfGO. Its first element is the created solids, the
4319 # remaining ones are created groups.
4321 # @ref tui_creation_pipe_without_path "Example"
4322 @ManageTransactions("PrimOp")
4323 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4324 IsGenerateGroups=False, theName=None):
4326 Create solids between given sections.
4327 It is possible to generate groups along with the result by means of
4328 setting the flag IsGenerateGroups. For detailed information on
4329 groups that can be created please see the method geompy.MakePipe().
4332 theSeqBases - list of sections (shell or face).
4333 theLocations - list of corresponding vertexes
4334 IsGenerateGroups - flag that tells if it is necessary to
4335 create groups. It is equal to False by default.
4336 theName Object name; when specified, this parameter is used
4337 for result publication in the study. Otherwise, if automatic
4338 publication is switched on, default value is used for result name.
4341 New GEOM.GEOM_Object, containing the created solids if
4342 IsGenerateGroups is not set. Otherwise it returns new
4343 GEOM.ListOfGO. Its first element is the created solids, the
4344 remaining ones are created groups.
4346 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4348 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4350 if IsGenerateGroups:
4351 self._autoPublish(aList, theName, "pipe")
4354 self._autoPublish(aList[0], theName, "pipe")
4357 ## Create a shape by extrusion of the base shape along
4358 # the path shape with constant bi-normal direction along the given vector.
4359 # The path shape can be a wire or an edge.
4360 # It is possible to generate groups along with the result by means of
4361 # setting the flag \a IsGenerateGroups. For detailed information on
4362 # groups that can be created please see the method MakePipe().
4363 # @param theBase Base shape to be extruded.
4364 # @param thePath Path shape to extrude the base shape along it.
4365 # @param theVec Vector defines a constant binormal direction to keep the
4366 # same angle between the direction and the sections
4367 # along the sweep surface.
4368 # @param IsGenerateGroups flag that tells if it is necessary to
4369 # create groups. It is equal to False by default.
4370 # @param theName Object name; when specified, this parameter is used
4371 # for result publication in the study. Otherwise, if automatic
4372 # publication is switched on, default value is used for result name.
4374 # @return New GEOM.GEOM_Object, containing the created pipe if
4375 # \a IsGenerateGroups is not set. Otherwise it returns new
4376 # GEOM.ListOfGO. Its first element is the created pipe, the
4377 # remaining ones are created groups.
4379 # @ref tui_creation_pipe "Example"
4380 @ManageTransactions("PrimOp")
4381 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4382 IsGenerateGroups=False, theName=None):
4384 Create a shape by extrusion of the base shape along
4385 the path shape with constant bi-normal direction along the given vector.
4386 The path shape can be a wire or an edge.
4387 It is possible to generate groups along with the result by means of
4388 setting the flag IsGenerateGroups. For detailed information on
4389 groups that can be created please see the method geompy.MakePipe().
4392 theBase Base shape to be extruded.
4393 thePath Path shape to extrude the base shape along it.
4394 theVec Vector defines a constant binormal direction to keep the
4395 same angle between the direction and the sections
4396 along the sweep surface.
4397 IsGenerateGroups flag that tells if it is necessary to
4398 create groups. It is equal to False by default.
4399 theName Object name; when specified, this parameter is used
4400 for result publication in the study. Otherwise, if automatic
4401 publication is switched on, default value is used for result name.
4404 New GEOM.GEOM_Object, containing the created pipe if
4405 IsGenerateGroups is not set. Otherwise it returns new
4406 GEOM.ListOfGO. Its first element is the created pipe, the
4407 remaining ones are created groups.
4409 # Example: see GEOM_TestAll.py
4410 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4411 theVec, IsGenerateGroups)
4412 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4414 if IsGenerateGroups:
4415 self._autoPublish(aList, theName, "pipe")
4418 self._autoPublish(aList[0], theName, "pipe")
4421 ## Makes a thick solid from a shape. If the input is a surface shape
4422 # (face or shell) the result is a thick solid. If an input shape is
4423 # a solid the result is a hollowed solid with removed faces.
4424 # @param theShape Face or Shell to get thick solid or solid to get
4426 # @param theThickness Thickness of the resulting solid
4427 # @param theFacesIDs the list of face IDs to be removed from the
4428 # result. It is ignored if \a theShape is a face or a shell.
4429 # It is empty by default.
4430 # @param theInside If true the thickness is applied towards inside
4431 # @param theName Object name; when specified, this parameter is used
4432 # for result publication in the study. Otherwise, if automatic
4433 # publication is switched on, default value is used for result name.
4435 # @return New GEOM.GEOM_Object, containing the created solid
4437 # @ref tui_creation_thickness "Example"
4438 @ManageTransactions("PrimOp")
4439 def MakeThickSolid(self, theShape, theThickness,
4440 theFacesIDs=[], theInside=False, theName=None):
4442 Make a thick solid from a shape. If the input is a surface shape
4443 (face or shell) the result is a thick solid. If an input shape is
4444 a solid the result is a hollowed solid with removed faces.
4447 theShape Face or Shell to get thick solid or solid to get
4449 theThickness Thickness of the resulting solid
4450 theFacesIDs the list of face IDs to be removed from the
4451 result. It is ignored if theShape is a face or a
4452 shell. It is empty by default.
4453 theInside If true the thickness is applied towards inside
4454 theName Object name; when specified, this parameter is used
4455 for result publication in the study. Otherwise, if automatic
4456 publication is switched on, default value is used for result name.
4459 New GEOM.GEOM_Object, containing the created solid
4461 # Example: see GEOM_TestAll.py
4462 theThickness,Parameters = ParseParameters(theThickness)
4463 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4464 theThickness, True, theInside)
4465 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4466 anObj.SetParameters(Parameters)
4467 self._autoPublish(anObj, theName, "thickSolid")
4471 ## Modifies a shape to make it a thick solid. If the input is a surface
4472 # shape (face or shell) the result is a thick solid. If an input shape
4473 # is a solid the result is a hollowed solid with removed faces.
4474 # @param theShape Face or Shell to get thick solid or solid to get
4476 # @param theThickness Thickness of the resulting solid
4477 # @param theFacesIDs the list of face IDs to be removed from the
4478 # result. It is ignored if \a theShape is a face or a shell.
4479 # It is empty by default.
4480 # @param theInside If true the thickness is applied towards inside
4482 # @return The modified shape
4484 # @ref tui_creation_thickness "Example"
4485 @ManageTransactions("PrimOp")
4486 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4488 Modifies a shape to make it a thick solid. If the input is a
4489 surface shape (face or shell) the result is a thick solid. If
4490 an input shape is a solid the result is a hollowed solid with
4494 theShape Face or Shell to get thick solid or solid to get
4496 theThickness Thickness of the resulting solid
4497 theFacesIDs the list of face IDs to be removed from the
4498 result. It is ignored if \a theShape is a face or
4499 a shell. It is empty by default.
4500 theInside If true the thickness is applied towards inside
4505 # Example: see GEOM_TestAll.py
4506 theThickness,Parameters = ParseParameters(theThickness)
4507 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4508 theThickness, False, theInside)
4509 RaiseIfFailed("Thicken", self.PrimOp)
4510 anObj.SetParameters(Parameters)
4513 ## Build a middle path of a pipe-like shape.
4514 # The path shape can be a wire or an edge.
4515 # @param theShape It can be closed or unclosed pipe-like shell
4516 # or a pipe-like solid.
4517 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4518 # should be wires or faces of theShape.
4519 # @param theName Object name; when specified, this parameter is used
4520 # for result publication in the study. Otherwise, if automatic
4521 # publication is switched on, default value is used for result name.
4523 # @note It is not assumed that exact or approximate copy of theShape
4524 # can be obtained by applying existing Pipe operation on the
4525 # resulting "Path" wire taking theBase1 as the base - it is not
4526 # always possible; though in some particular cases it might work
4527 # it is not guaranteed. Thus, RestorePath function should not be
4528 # considered as an exact reverse operation of the Pipe.
4530 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4531 # source pipe's "path".
4533 # @ref tui_creation_pipe_path "Example"
4534 @ManageTransactions("PrimOp")
4535 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4537 Build a middle path of a pipe-like shape.
4538 The path shape can be a wire or an edge.
4541 theShape It can be closed or unclosed pipe-like shell
4542 or a pipe-like solid.
4543 theBase1, theBase2 Two bases of the supposed pipe. This
4544 should be wires or faces of theShape.
4545 theName Object name; when specified, this parameter is used
4546 for result publication in the study. Otherwise, if automatic
4547 publication is switched on, default value is used for result name.
4550 New GEOM_Object, containing an edge or wire that represent
4553 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4554 RaiseIfFailed("RestorePath", self.PrimOp)
4555 self._autoPublish(anObj, theName, "path")
4558 ## Build a middle path of a pipe-like shape.
4559 # The path shape can be a wire or an edge.
4560 # @param theShape It can be closed or unclosed pipe-like shell
4561 # or a pipe-like solid.
4562 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4563 # should be lists of edges of theShape.
4564 # @param theName Object name; when specified, this parameter is used
4565 # for result publication in the study. Otherwise, if automatic
4566 # publication is switched on, default value is used for result name.
4568 # @note It is not assumed that exact or approximate copy of theShape
4569 # can be obtained by applying existing Pipe operation on the
4570 # resulting "Path" wire taking theBase1 as the base - it is not
4571 # always possible; though in some particular cases it might work
4572 # it is not guaranteed. Thus, RestorePath function should not be
4573 # considered as an exact reverse operation of the Pipe.
4575 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4576 # source pipe's "path".
4578 # @ref tui_creation_pipe_path "Example"
4579 @ManageTransactions("PrimOp")
4580 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4582 Build a middle path of a pipe-like shape.
4583 The path shape can be a wire or an edge.
4586 theShape It can be closed or unclosed pipe-like shell
4587 or a pipe-like solid.
4588 listEdges1, listEdges2 Two bases of the supposed pipe. This
4589 should be lists of edges of theShape.
4590 theName Object name; when specified, this parameter is used
4591 for result publication in the study. Otherwise, if automatic
4592 publication is switched on, default value is used for result name.
4595 New GEOM_Object, containing an edge or wire that represent
4598 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4599 RaiseIfFailed("RestorePath", self.PrimOp)
4600 self._autoPublish(anObj, theName, "path")
4606 ## @addtogroup l3_basic_go
4609 ## Create a linear edge with specified ends.
4610 # @param thePnt1 Point for the first end of edge.
4611 # @param thePnt2 Point for the second end of edge.
4612 # @param theName Object name; when specified, this parameter is used
4613 # for result publication in the study. Otherwise, if automatic
4614 # publication is switched on, default value is used for result name.
4616 # @return New GEOM.GEOM_Object, containing the created edge.
4618 # @ref tui_creation_edge "Example"
4619 @ManageTransactions("ShapesOp")
4620 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4622 Create a linear edge with specified ends.
4625 thePnt1 Point for the first end of edge.
4626 thePnt2 Point for the second end of edge.
4627 theName Object name; when specified, this parameter is used
4628 for result publication in the study. Otherwise, if automatic
4629 publication is switched on, default value is used for result name.
4632 New GEOM.GEOM_Object, containing the created edge.
4634 # Example: see GEOM_TestAll.py
4635 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4636 RaiseIfFailed("MakeEdge", self.ShapesOp)
4637 self._autoPublish(anObj, theName, "edge")
4640 ## Create a new edge, corresponding to the given length on the given curve.
4641 # @param theRefCurve The referenced curve (edge).
4642 # @param theLength Length on the referenced curve. It can be negative.
4643 # @param theStartPoint Any point can be selected for it, the new edge will begin
4644 # at the end of \a theRefCurve, close to the selected point.
4645 # If None, start from the first point of \a theRefCurve.
4646 # @param theName Object name; when specified, this parameter is used
4647 # for result publication in the study. Otherwise, if automatic
4648 # publication is switched on, default value is used for result name.
4650 # @return New GEOM.GEOM_Object, containing the created edge.
4652 # @ref tui_creation_edge "Example"
4653 @ManageTransactions("ShapesOp")
4654 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4656 Create a new edge, corresponding to the given length on the given curve.
4659 theRefCurve The referenced curve (edge).
4660 theLength Length on the referenced curve. It can be negative.
4661 theStartPoint Any point can be selected for it, the new edge will begin
4662 at the end of theRefCurve, close to the selected point.
4663 If None, start from the first point of theRefCurve.
4664 theName Object name; when specified, this parameter is used
4665 for result publication in the study. Otherwise, if automatic
4666 publication is switched on, default value is used for result name.
4669 New GEOM.GEOM_Object, containing the created edge.
4671 # Example: see GEOM_TestAll.py
4672 theLength, Parameters = ParseParameters(theLength)
4673 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4674 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4675 anObj.SetParameters(Parameters)
4676 self._autoPublish(anObj, theName, "edge")
4679 ## Create an edge from specified wire.
4680 # @param theWire source Wire
4681 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4682 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4683 # @param theName Object name; when specified, this parameter is used
4684 # for result publication in the study. Otherwise, if automatic
4685 # publication is switched on, default value is used for result name.
4687 # @return New GEOM.GEOM_Object, containing the created edge.
4689 # @ref tui_creation_edge "Example"
4690 @ManageTransactions("ShapesOp")
4691 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4693 Create an edge from specified wire.
4697 theLinearTolerance linear tolerance value (default = 1e-07)
4698 theAngularTolerance angular tolerance value (default = 1e-12)
4699 theName Object name; when specified, this parameter is used
4700 for result publication in the study. Otherwise, if automatic
4701 publication is switched on, default value is used for result name.
4704 New GEOM.GEOM_Object, containing the created edge.
4706 # Example: see GEOM_TestAll.py
4707 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4708 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4709 self._autoPublish(anObj, theName, "edge")
4712 ## Create a wire from the set of edges and wires.
4713 # @param theEdgesAndWires List of edges and/or wires.
4714 # @param theTolerance Maximum distance between vertices, that will be merged.
4715 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4716 # @param theName Object name; when specified, this parameter is used
4717 # for result publication in the study. Otherwise, if automatic
4718 # publication is switched on, default value is used for result name.
4720 # @return New GEOM.GEOM_Object, containing the created wire.
4722 # @ref tui_creation_wire "Example"
4723 @ManageTransactions("ShapesOp")
4724 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4726 Create a wire from the set of edges and wires.
4729 theEdgesAndWires List of edges and/or wires.
4730 theTolerance Maximum distance between vertices, that will be merged.
4731 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4732 theName Object name; when specified, this parameter is used
4733 for result publication in the study. Otherwise, if automatic
4734 publication is switched on, default value is used for result name.
4737 New GEOM.GEOM_Object, containing the created wire.
4739 # Example: see GEOM_TestAll.py
4740 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4741 RaiseIfFailed("MakeWire", self.ShapesOp)
4742 self._autoPublish(anObj, theName, "wire")
4745 ## Create a face on the given wire.
4746 # @param theWire closed Wire or Edge to build the face on.
4747 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4748 # If the tolerance of the obtained planar face is less
4749 # than 1e-06, this face will be returned, otherwise the
4750 # algorithm tries to build any suitable face on the given
4751 # wire and prints a warning message.
4752 # @param theName Object name; when specified, this parameter is used
4753 # for result publication in the study. Otherwise, if automatic
4754 # publication is switched on, default value is used for result name.
4756 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4758 # @ref tui_creation_face "Example"
4759 @ManageTransactions("ShapesOp")
4760 def MakeFace(self, theWire, isPlanarWanted, theName=None, raiseException=False):
4762 Create a face on the given wire.
4765 theWire closed Wire or Edge to build the face on.
4766 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4767 If the tolerance of the obtained planar face is less
4768 than 1e-06, this face will be returned, otherwise the
4769 algorithm tries to build any suitable face on the given
4770 wire and prints a warning message.
4771 theName Object name; when specified, this parameter is used
4772 for result publication in the study. Otherwise, if automatic
4773 publication is switched on, default value is used for result name.
4776 New GEOM.GEOM_Object, containing the created face (compound of faces).
4778 # Example: see GEOM_TestAll.py
4779 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4780 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4781 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4783 RaiseIfFailed("MakeFace", self.ShapesOp)
4784 self._autoPublish(anObj, theName, "face")
4787 ## Create a face on the given wires set.
4788 # @param theWires List of closed wires or edges to build the face on.
4789 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4790 # If the tolerance of the obtained planar face is less
4791 # than 1e-06, this face will be returned, otherwise the
4792 # algorithm tries to build any suitable face on the given
4793 # wire and prints a warning message.
4794 # @param theName Object name; when specified, this parameter is used
4795 # for result publication in the study. Otherwise, if automatic
4796 # publication is switched on, default value is used for result name.
4798 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4800 # @ref tui_creation_face "Example"
4801 @ManageTransactions("ShapesOp")
4802 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None, raiseException=False):
4804 Create a face on the given wires set.
4807 theWires List of closed wires or edges to build the face on.
4808 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4809 If the tolerance of the obtained planar face is less
4810 than 1e-06, this face will be returned, otherwise the
4811 algorithm tries to build any suitable face on the given
4812 wire and prints a warning message.
4813 theName Object name; when specified, this parameter is used
4814 for result publication in the study. Otherwise, if automatic
4815 publication is switched on, default value is used for result name.
4818 New GEOM.GEOM_Object, containing the created face (compound of faces).
4820 # Example: see GEOM_TestAll.py
4821 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4822 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4823 PrintOrRaise("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.",raiseException)
4825 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4826 self._autoPublish(anObj, theName, "face")
4829 ## See MakeFaceWires() method for details.
4831 # @ref tui_creation_face "Example 1"
4832 # \n @ref swig_MakeFaces "Example 2"
4833 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4835 See geompy.MakeFaceWires() method for details.
4837 # Example: see GEOM_TestOthers.py
4838 # note: auto-publishing is done in self.MakeFaceWires()
4839 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4842 ## Create a face based on a surface from given face bounded
4844 # @param theFace the face whose surface is used to create a new face.
4845 # @param theWire the wire that will bound a new face.
4846 # @param theName Object name; when specified, this parameter is used
4847 # for result publication in the study. Otherwise, if automatic
4848 # publication is switched on, default value is used for result name.
4850 # @return New GEOM.GEOM_Object, containing the created face.
4852 # @ref tui_creation_face "Example"
4853 @ManageTransactions("ShapesOp")
4854 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4856 Create a face based on a surface from given face bounded
4860 theFace the face whose surface is used to create a new face.
4861 theWire the wire that will bound a new face.
4862 theName Object name; when specified, this parameter is used
4863 for result publication in the study. Otherwise, if automatic
4864 publication is switched on, default value is used for result name.
4867 New GEOM.GEOM_Object, containing the created face.
4869 # Example: see GEOM_TestAll.py
4870 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4871 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4872 self._autoPublish(anObj, theName, "face")
4875 ## Create a face from a set of edges with the given constraints.
4876 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4877 # - edges should form a closed wire;
4878 # - for each edge, constraint face is optional: if a constraint face is missing
4879 # for some edge, this means that there no constraint associated with this edge.
4880 # @param theName Object name; when specified, this parameter is used
4881 # for result publication in the study. Otherwise, if automatic
4882 # publication is switched on, default value is used for result name.
4884 # @return New GEOM.GEOM_Object, containing the created face.
4886 # @ref tui_creation_face "Example"
4887 @ManageTransactions("ShapesOp")
4888 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4890 Create a face from a set of edges with the given constraints.
4893 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4894 - edges should form a closed wire;
4895 - for each edge, constraint face is optional: if a constraint face is missing
4896 for some edge, this means that there no constraint associated with this edge.
4897 theName Object name; when specified, this parameter is used
4898 for result publication in the study. Otherwise, if automatic
4899 publication is switched on, default value is used for result name.
4902 New GEOM.GEOM_Object, containing the created face.
4904 # Example: see GEOM_TestAll.py
4905 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4907 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4908 self._autoPublish(anObj, theName, "face")
4911 ## Create a shell from the set of faces, shells and/or compounds of faces.
4912 # @param theFacesAndShells List of faces, shells and/or compounds of faces.
4913 # @param theName Object name; when specified, this parameter is used
4914 # for result publication in the study. Otherwise, if automatic
4915 # publication is switched on, default value is used for result name.
4917 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4919 # @ref tui_creation_shell "Example"
4920 @ManageTransactions("ShapesOp")
4921 def MakeShell(self, theFacesAndShells, theName=None):
4923 Create a shell from the set of faces and shells.
4926 theFacesAndShells List of faces and/or shells.
4927 theName Object name; when specified, this parameter is used
4928 for result publication in the study. Otherwise, if automatic
4929 publication is switched on, default value is used for result name.
4932 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4934 # Example: see GEOM_TestAll.py
4935 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4936 RaiseIfFailed("MakeShell", self.ShapesOp)
4937 self._autoPublish(anObj, theName, "shell")
4940 ## Create a solid, bounded by the given shells.
4941 # @param theShells Sequence of bounding shells.
4942 # @param theName Object name; when specified, this parameter is used
4943 # for result publication in the study. Otherwise, if automatic
4944 # publication is switched on, default value is used for result name.
4946 # @return New GEOM.GEOM_Object, containing the created solid.
4948 # @ref tui_creation_solid "Example"
4949 @ManageTransactions("ShapesOp")
4950 def MakeSolid(self, theShells, theName=None):
4952 Create a solid, bounded by the given shells.
4955 theShells Sequence of bounding shells.
4956 theName Object name; when specified, this parameter is used
4957 for result publication in the study. Otherwise, if automatic
4958 publication is switched on, default value is used for result name.
4961 New GEOM.GEOM_Object, containing the created solid.
4963 # Example: see GEOM_TestAll.py
4964 theShells = ToList(theShells)
4965 if len(theShells) == 1:
4966 descr = self._IsGoodForSolid(theShells[0])
4968 # raise RuntimeError, "MakeSolidShells : " + descr
4969 if descr == "WRN_SHAPE_UNCLOSED":
4970 raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4971 anObj = self.ShapesOp.MakeSolidShells(theShells)
4972 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4973 self._autoPublish(anObj, theName, "solid")
4976 ## Create a compound of the given shapes.
4977 # @param theShapes List of shapes to put in compound.
4978 # @param theName Object name; when specified, this parameter is used
4979 # for result publication in the study. Otherwise, if automatic
4980 # publication is switched on, default value is used for result name.
4982 # @return New GEOM.GEOM_Object, containing the created compound.
4984 # @ref tui_creation_compound "Example"
4985 @ManageTransactions("ShapesOp")
4986 def MakeCompound(self, theShapes, theName=None):
4988 Create a compound of the given shapes.
4991 theShapes List of shapes to put in compound.
4992 theName Object name; when specified, this parameter is used
4993 for result publication in the study. Otherwise, if automatic
4994 publication is switched on, default value is used for result name.
4997 New GEOM.GEOM_Object, containing the created compound.
4999 # Example: see GEOM_TestAll.py
5000 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
5001 RaiseIfFailed("MakeCompound", self.ShapesOp)
5002 self._autoPublish(anObj, theName, "compound")
5005 ## Create a solid (or solids) from the set of faces and/or shells.
5006 # @param theFacesOrShells List of faces and/or shells.
5007 # @param isIntersect If TRUE, forces performing intersections
5008 # between arguments; otherwise (default) intersection is not performed.
5009 # @param theName Object name; when specified, this parameter is used
5010 # for result publication in the study. Otherwise, if automatic
5011 # publication is switched on, default value is used for result name.
5013 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5015 # @ref tui_creation_solid_from_faces "Example"
5016 @ManageTransactions("ShapesOp")
5017 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5019 Create a solid (or solids) from the set of connected faces and/or shells.
5022 theFacesOrShells List of faces and/or shells.
5023 isIntersect If TRUE, forces performing intersections
5024 between arguments; otherwise (default) intersection is not performed
5025 theName Object name; when specified, this parameter is used.
5026 for result publication in the study. Otherwise, if automatic
5027 publication is switched on, default value is used for result name.
5030 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5032 # Example: see GEOM_TestAll.py
5033 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5034 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5035 self._autoPublish(anObj, theName, "solid")
5038 # end of l3_basic_go
5041 ## @addtogroup l2_measure
5044 ## Gives quantity of faces in the given shape.
5045 # @param theShape Shape to count faces of.
5046 # @return Quantity of faces.
5048 # @ref swig_NumberOf "Example"
5049 @ManageTransactions("ShapesOp")
5050 def NumberOfFaces(self, theShape):
5052 Gives quantity of faces in the given shape.
5055 theShape Shape to count faces of.
5060 # Example: see GEOM_TestOthers.py
5061 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5062 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5065 ## Gives quantity of edges in the given shape.
5066 # @param theShape Shape to count edges of.
5067 # @return Quantity of edges.
5069 # @ref swig_NumberOf "Example"
5070 @ManageTransactions("ShapesOp")
5071 def NumberOfEdges(self, theShape):
5073 Gives quantity of edges in the given shape.
5076 theShape Shape to count edges of.
5081 # Example: see GEOM_TestOthers.py
5082 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5083 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5086 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5087 # @param theShape Shape to count sub-shapes of.
5088 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5089 # @return Quantity of sub-shapes of given type.
5091 # @ref swig_NumberOf "Example"
5092 @ManageTransactions("ShapesOp")
5093 def NumberOfSubShapes(self, theShape, theShapeType):
5095 Gives quantity of sub-shapes of type theShapeType in the given shape.
5098 theShape Shape to count sub-shapes of.
5099 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5102 Quantity of sub-shapes of given type.
5104 # Example: see GEOM_TestOthers.py
5105 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5106 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5109 ## Gives quantity of solids in the given shape.
5110 # @param theShape Shape to count solids in.
5111 # @return Quantity of solids.
5113 # @ref swig_NumberOf "Example"
5114 @ManageTransactions("ShapesOp")
5115 def NumberOfSolids(self, theShape):
5117 Gives quantity of solids in the given shape.
5120 theShape Shape to count solids in.
5125 # Example: see GEOM_TestOthers.py
5126 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5127 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5133 ## @addtogroup l3_healing
5136 ## Reverses an orientation the given shape.
5137 # @param theShape Shape to be reversed.
5138 # @param theName Object name; when specified, this parameter is used
5139 # for result publication in the study. Otherwise, if automatic
5140 # publication is switched on, default value is used for result name.
5142 # @return The reversed copy of theShape.
5144 # @ref swig_ChangeOrientation "Example"
5145 @ManageTransactions("ShapesOp")
5146 def ChangeOrientation(self, theShape, theName=None):
5148 Reverses an orientation the given shape.
5151 theShape Shape to be reversed.
5152 theName Object name; when specified, this parameter is used
5153 for result publication in the study. Otherwise, if automatic
5154 publication is switched on, default value is used for result name.
5157 The reversed copy of theShape.
5159 # Example: see GEOM_TestAll.py
5160 anObj = self.ShapesOp.ChangeOrientation(theShape)
5161 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5162 self._autoPublish(anObj, theName, "reversed")
5165 ## See ChangeOrientation() method for details.
5167 # @ref swig_OrientationChange "Example"
5168 def OrientationChange(self, theShape, theName=None):
5170 See geompy.ChangeOrientation method for details.
5172 # Example: see GEOM_TestOthers.py
5173 # note: auto-publishing is done in self.ChangeOrientation()
5174 anObj = self.ChangeOrientation(theShape, theName)
5180 ## @addtogroup l4_obtain
5183 ## Retrieve all free faces from the given shape.
5184 # Free face is a face, which is not shared between two shells of the shape.
5185 # @param theShape Shape to find free faces in.
5186 # @return List of IDs of all free faces, contained in theShape.
5188 # @ref tui_free_faces_page "Example"
5189 @ManageTransactions("ShapesOp")
5190 def GetFreeFacesIDs(self,theShape):
5192 Retrieve all free faces from the given shape.
5193 Free face is a face, which is not shared between two shells of the shape.
5196 theShape Shape to find free faces in.
5199 List of IDs of all free faces, contained in theShape.
5201 # Example: see GEOM_TestOthers.py
5202 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5203 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5206 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5207 # @param theShape1 Shape to find sub-shapes in.
5208 # @param theShape2 Shape to find shared sub-shapes with.
5209 # @param theShapeType Type of sub-shapes to be retrieved.
5210 # @param theName Object name; when specified, this parameter is used
5211 # for result publication in the study. Otherwise, if automatic
5212 # publication is switched on, default value is used for result name.
5214 # @return List of sub-shapes of theShape1, shared with theShape2.
5216 # @ref swig_GetSharedShapes "Example"
5217 @ManageTransactions("ShapesOp")
5218 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5220 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5223 theShape1 Shape to find sub-shapes in.
5224 theShape2 Shape to find shared sub-shapes with.
5225 theShapeType Type of sub-shapes to be retrieved.
5226 theName Object name; when specified, this parameter is used
5227 for result publication in the study. Otherwise, if automatic
5228 publication is switched on, default value is used for result name.
5231 List of sub-shapes of theShape1, shared with theShape2.
5233 # Example: see GEOM_TestOthers.py
5234 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5235 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5236 self._autoPublish(aList, theName, "shared")
5239 ## Get sub-shapes, shared by input shapes.
5240 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5241 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5242 # @param theMultiShare Specifies what type of shares should be checked:
5243 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5244 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5245 # @param theName Object name; when specified, this parameter is used
5246 # for result publication in the study. Otherwise, if automatic
5247 # publication is switched on, default value is used for result name.
5249 # @note If @a theShapes contains single compound, the shares between all possible couples of
5250 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5251 # and all rest input shapes are returned.
5253 # @return List of all found sub-shapes.
5256 # - @ref tui_shared_shapes "Example 1"
5257 # - @ref swig_GetSharedShapes "Example 2"
5258 @ManageTransactions("ShapesOp")
5259 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5261 Get sub-shapes, shared by input shapes.
5264 theShapes Either a list or compound of shapes to find common sub-shapes of.
5265 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5266 theMultiShare Specifies what type of shares should be checked:
5267 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5268 - False: causes to search sub-shapes shared between couples of input shapes.
5269 theName Object name; when specified, this parameter is used
5270 for result publication in the study. Otherwise, if automatic
5271 publication is switched on, default value is used for result name.
5273 Note: if theShapes contains single compound, the shares between all possible couples of
5274 its top-level shapes are returned; otherwise, only shares between 1st input shape
5275 and all rest input shapes are returned.
5278 List of all found sub-shapes.
5280 # Example: see GEOM_TestOthers.py
5281 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5282 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5283 self._autoPublish(aList, theName, "shared")
5286 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5287 # situated relatively the specified plane by the certain way,
5288 # defined through <VAR>theState</VAR> parameter.
5289 # @param theShape Shape to find sub-shapes of.
5290 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5291 # @param theAx1 Vector (or line, or linear edge), specifying normal
5292 # direction and location of the plane to find shapes on.
5293 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5294 # @param theName Object name; when specified, this parameter is used
5295 # for result publication in the study. Otherwise, if automatic
5296 # publication is switched on, default value is used for result name.
5298 # @return List of all found sub-shapes.
5300 # @ref swig_GetShapesOnPlane "Example"
5301 @ManageTransactions("ShapesOp")
5302 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5304 Find in theShape all sub-shapes of type theShapeType,
5305 situated relatively the specified plane by the certain way,
5306 defined through theState parameter.
5309 theShape Shape to find sub-shapes of.
5310 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5311 theAx1 Vector (or line, or linear edge), specifying normal
5312 direction and location of the plane to find shapes on.
5313 theState The state of the sub-shapes to find (see GEOM::shape_state)
5314 theName Object name; when specified, this parameter is used
5315 for result publication in the study. Otherwise, if automatic
5316 publication is switched on, default value is used for result name.
5319 List of all found sub-shapes.
5321 # Example: see GEOM_TestOthers.py
5322 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5323 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5324 self._autoPublish(aList, theName, "shapeOnPlane")
5327 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5328 # situated relatively the specified plane by the certain way,
5329 # defined through <VAR>theState</VAR> parameter.
5330 # @param theShape Shape to find sub-shapes of.
5331 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5332 # @param theAx1 Vector (or line, or linear edge), specifying normal
5333 # direction and location of the plane to find shapes on.
5334 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5336 # @return List of all found sub-shapes indices.
5338 # @ref swig_GetShapesOnPlaneIDs "Example"
5339 @ManageTransactions("ShapesOp")
5340 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5342 Find in theShape all sub-shapes of type theShapeType,
5343 situated relatively the specified plane by the certain way,
5344 defined through theState parameter.
5347 theShape Shape to find sub-shapes of.
5348 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5349 theAx1 Vector (or line, or linear edge), specifying normal
5350 direction and location of the plane to find shapes on.
5351 theState The state of the sub-shapes to find (see GEOM::shape_state)
5354 List of all found sub-shapes indices.
5356 # Example: see GEOM_TestOthers.py
5357 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5358 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5361 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5362 # situated relatively the specified plane by the certain way,
5363 # defined through <VAR>theState</VAR> parameter.
5364 # @param theShape Shape to find sub-shapes of.
5365 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5366 # @param theAx1 Vector (or line, or linear edge), specifying normal
5367 # direction of the plane to find shapes on.
5368 # @param thePnt Point specifying location of the plane to find shapes on.
5369 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5370 # @param theName Object name; when specified, this parameter is used
5371 # for result publication in the study. Otherwise, if automatic
5372 # publication is switched on, default value is used for result name.
5374 # @return List of all found sub-shapes.
5376 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5377 @ManageTransactions("ShapesOp")
5378 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5380 Find in theShape all sub-shapes of type theShapeType,
5381 situated relatively the specified plane by the certain way,
5382 defined through theState parameter.
5385 theShape Shape to find sub-shapes of.
5386 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5387 theAx1 Vector (or line, or linear edge), specifying normal
5388 direction and location of the plane to find shapes on.
5389 thePnt Point specifying location of the plane to find shapes on.
5390 theState The state of the sub-shapes to find (see GEOM::shape_state)
5391 theName Object name; when specified, this parameter is used
5392 for result publication in the study. Otherwise, if automatic
5393 publication is switched on, default value is used for result name.
5396 List of all found sub-shapes.
5398 # Example: see GEOM_TestOthers.py
5399 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5400 theAx1, thePnt, theState)
5401 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5402 self._autoPublish(aList, theName, "shapeOnPlane")
5405 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5406 # situated relatively the specified plane by the certain way,
5407 # defined through <VAR>theState</VAR> parameter.
5408 # @param theShape Shape to find sub-shapes of.
5409 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5410 # @param theAx1 Vector (or line, or linear edge), specifying normal
5411 # direction of the plane to find shapes on.
5412 # @param thePnt Point specifying location of the plane to find shapes on.
5413 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5415 # @return List of all found sub-shapes indices.
5417 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5418 @ManageTransactions("ShapesOp")
5419 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5421 Find in theShape all sub-shapes of type theShapeType,
5422 situated relatively the specified plane by the certain way,
5423 defined through theState parameter.
5426 theShape Shape to find sub-shapes of.
5427 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5428 theAx1 Vector (or line, or linear edge), specifying normal
5429 direction and location of the plane to find shapes on.
5430 thePnt Point specifying location of the plane to find shapes on.
5431 theState The state of the sub-shapes to find (see GEOM::shape_state)
5434 List of all found sub-shapes indices.
5436 # Example: see GEOM_TestOthers.py
5437 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5438 theAx1, thePnt, theState)
5439 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5442 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5443 # the specified cylinder by the certain way, defined through \a theState parameter.
5444 # @param theShape Shape to find sub-shapes of.
5445 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5446 # @param theAxis Vector (or line, or linear edge), specifying
5447 # axis of the cylinder to find shapes on.
5448 # @param theRadius Radius of the cylinder to find shapes on.
5449 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5450 # @param theName Object name; when specified, this parameter is used
5451 # for result publication in the study. Otherwise, if automatic
5452 # publication is switched on, default value is used for result name.
5454 # @return List of all found sub-shapes.
5456 # @ref swig_GetShapesOnCylinder "Example"
5457 @ManageTransactions("ShapesOp")
5458 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5460 Find in theShape all sub-shapes of type theShapeType, situated relatively
5461 the specified cylinder by the certain way, defined through theState parameter.
5464 theShape Shape to find sub-shapes of.
5465 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5466 theAxis Vector (or line, or linear edge), specifying
5467 axis of the cylinder to find shapes on.
5468 theRadius Radius of the cylinder to find shapes on.
5469 theState The state of the sub-shapes to find (see GEOM::shape_state)
5470 theName Object name; when specified, this parameter is used
5471 for result publication in the study. Otherwise, if automatic
5472 publication is switched on, default value is used for result name.
5475 List of all found sub-shapes.
5477 # Example: see GEOM_TestOthers.py
5478 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5479 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5480 self._autoPublish(aList, theName, "shapeOnCylinder")
5483 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5484 # the specified cylinder by the certain way, defined through \a theState parameter.
5485 # @param theShape Shape to find sub-shapes of.
5486 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5487 # @param theAxis Vector (or line, or linear edge), specifying
5488 # axis of the cylinder to find shapes on.
5489 # @param theRadius Radius of the cylinder to find shapes on.
5490 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5492 # @return List of all found sub-shapes indices.
5494 # @ref swig_GetShapesOnCylinderIDs "Example"
5495 @ManageTransactions("ShapesOp")
5496 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5498 Find in theShape all sub-shapes of type theShapeType, situated relatively
5499 the specified cylinder by the certain way, defined through theState parameter.
5502 theShape Shape to find sub-shapes of.
5503 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5504 theAxis Vector (or line, or linear edge), specifying
5505 axis of the cylinder to find shapes on.
5506 theRadius Radius of the cylinder to find shapes on.
5507 theState The state of the sub-shapes to find (see GEOM::shape_state)
5510 List of all found sub-shapes indices.
5512 # Example: see GEOM_TestOthers.py
5513 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5514 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5517 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5518 # the specified cylinder by the certain way, defined through \a theState parameter.
5519 # @param theShape Shape to find sub-shapes of.
5520 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5521 # @param theAxis Vector (or line, or linear edge), specifying
5522 # axis of the cylinder to find shapes on.
5523 # @param thePnt Point specifying location of the bottom of the cylinder.
5524 # @param theRadius Radius of the cylinder to find shapes on.
5525 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5526 # @param theName Object name; when specified, this parameter is used
5527 # for result publication in the study. Otherwise, if automatic
5528 # publication is switched on, default value is used for result name.
5530 # @return List of all found sub-shapes.
5532 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5533 @ManageTransactions("ShapesOp")
5534 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5536 Find in theShape all sub-shapes of type theShapeType, situated relatively
5537 the specified cylinder by the certain way, defined through theState parameter.
5540 theShape Shape to find sub-shapes of.
5541 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5542 theAxis Vector (or line, or linear edge), specifying
5543 axis of the cylinder to find shapes on.
5544 theRadius Radius of the cylinder to find shapes on.
5545 theState The state of the sub-shapes to find (see GEOM::shape_state)
5546 theName Object name; when specified, this parameter is used
5547 for result publication in the study. Otherwise, if automatic
5548 publication is switched on, default value is used for result name.
5551 List of all found sub-shapes.
5553 # Example: see GEOM_TestOthers.py
5554 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5555 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5556 self._autoPublish(aList, theName, "shapeOnCylinder")
5559 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5560 # the specified cylinder by the certain way, defined through \a theState parameter.
5561 # @param theShape Shape to find sub-shapes of.
5562 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5563 # @param theAxis Vector (or line, or linear edge), specifying
5564 # axis of the cylinder to find shapes on.
5565 # @param thePnt Point specifying location of the bottom of the cylinder.
5566 # @param theRadius Radius of the cylinder to find shapes on.
5567 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5569 # @return List of all found sub-shapes indices
5571 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5572 @ManageTransactions("ShapesOp")
5573 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5575 Find in theShape all sub-shapes of type theShapeType, situated relatively
5576 the specified cylinder by the certain way, defined through theState parameter.
5579 theShape Shape to find sub-shapes of.
5580 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5581 theAxis Vector (or line, or linear edge), specifying
5582 axis of the cylinder to find shapes on.
5583 theRadius Radius of the cylinder to find shapes on.
5584 theState The state of the sub-shapes to find (see GEOM::shape_state)
5587 List of all found sub-shapes indices.
5589 # Example: see GEOM_TestOthers.py
5590 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5591 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5594 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5595 # the specified sphere by the certain way, defined through \a theState parameter.
5596 # @param theShape Shape to find sub-shapes of.
5597 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5598 # @param theCenter Point, specifying center of the sphere to find shapes on.
5599 # @param theRadius Radius of the sphere to find shapes on.
5600 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5601 # @param theName Object name; when specified, this parameter is used
5602 # for result publication in the study. Otherwise, if automatic
5603 # publication is switched on, default value is used for result name.
5605 # @return List of all found sub-shapes.
5607 # @ref swig_GetShapesOnSphere "Example"
5608 @ManageTransactions("ShapesOp")
5609 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5611 Find in theShape all sub-shapes of type theShapeType, situated relatively
5612 the specified sphere by the certain way, defined through theState parameter.
5615 theShape Shape to find sub-shapes of.
5616 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5617 theCenter Point, specifying center of the sphere to find shapes on.
5618 theRadius Radius of the sphere to find shapes on.
5619 theState The state of the sub-shapes to find (see GEOM::shape_state)
5620 theName Object name; when specified, this parameter is used
5621 for result publication in the study. Otherwise, if automatic
5622 publication is switched on, default value is used for result name.
5625 List of all found sub-shapes.
5627 # Example: see GEOM_TestOthers.py
5628 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5629 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5630 self._autoPublish(aList, theName, "shapeOnSphere")
5633 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5634 # the specified sphere by the certain way, defined through \a theState parameter.
5635 # @param theShape Shape to find sub-shapes of.
5636 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5637 # @param theCenter Point, specifying center of the sphere to find shapes on.
5638 # @param theRadius Radius of the sphere to find shapes on.
5639 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5641 # @return List of all found sub-shapes indices.
5643 # @ref swig_GetShapesOnSphereIDs "Example"
5644 @ManageTransactions("ShapesOp")
5645 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5647 Find in theShape all sub-shapes of type theShapeType, situated relatively
5648 the specified sphere by the certain way, defined through theState parameter.
5651 theShape Shape to find sub-shapes of.
5652 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5653 theCenter Point, specifying center of the sphere to find shapes on.
5654 theRadius Radius of the sphere to find shapes on.
5655 theState The state of the sub-shapes to find (see GEOM::shape_state)
5658 List of all found sub-shapes indices.
5660 # Example: see GEOM_TestOthers.py
5661 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5662 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5665 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5666 # the specified quadrangle by the certain way, defined through \a theState parameter.
5667 # @param theShape Shape to find sub-shapes of.
5668 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5669 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5670 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5671 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5672 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5673 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5674 # @param theName Object name; when specified, this parameter is used
5675 # for result publication in the study. Otherwise, if automatic
5676 # publication is switched on, default value is used for result name.
5678 # @return List of all found sub-shapes.
5680 # @ref swig_GetShapesOnQuadrangle "Example"
5681 @ManageTransactions("ShapesOp")
5682 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5683 theTopLeftPoint, theTopRightPoint,
5684 theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5686 Find in theShape all sub-shapes of type theShapeType, situated relatively
5687 the specified quadrangle by the certain way, defined through theState parameter.
5690 theShape Shape to find sub-shapes of.
5691 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5692 theTopLeftPoint Point, specifying top left corner of a quadrangle
5693 theTopRightPoint Point, specifying top right corner of a quadrangle
5694 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5695 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5696 theState The state of the sub-shapes to find (see GEOM::shape_state)
5697 theName Object name; when specified, this parameter is used
5698 for result publication in the study. Otherwise, if automatic
5699 publication is switched on, default value is used for result name.
5702 List of all found sub-shapes.
5704 # Example: see GEOM_TestOthers.py
5705 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5706 theTopLeftPoint, theTopRightPoint,
5707 theBottomLeftPoint, theBottomRightPoint, theState)
5708 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5709 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5712 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5713 # the specified quadrangle by the certain way, defined through \a theState parameter.
5714 # @param theShape Shape to find sub-shapes of.
5715 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5716 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5717 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5718 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5719 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5720 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5722 # @return List of all found sub-shapes indices.
5724 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5725 @ManageTransactions("ShapesOp")
5726 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5727 theTopLeftPoint, theTopRightPoint,
5728 theBottomLeftPoint, theBottomRightPoint, theState):
5730 Find in theShape all sub-shapes of type theShapeType, situated relatively
5731 the specified quadrangle by the certain way, defined through theState parameter.
5734 theShape Shape to find sub-shapes of.
5735 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5736 theTopLeftPoint Point, specifying top left corner of a quadrangle
5737 theTopRightPoint Point, specifying top right corner of a quadrangle
5738 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5739 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5740 theState The state of the sub-shapes to find (see GEOM::shape_state)
5743 List of all found sub-shapes indices.
5746 # Example: see GEOM_TestOthers.py
5747 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5748 theTopLeftPoint, theTopRightPoint,
5749 theBottomLeftPoint, theBottomRightPoint, theState)
5750 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5753 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5754 # the specified \a theBox by the certain way, defined through \a theState parameter.
5755 # @param theBox Shape for relative comparing.
5756 # @param theShape Shape to find sub-shapes of.
5757 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5758 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5759 # @param theName Object name; when specified, this parameter is used
5760 # for result publication in the study. Otherwise, if automatic
5761 # publication is switched on, default value is used for result name.
5763 # @return List of all found sub-shapes.
5765 # @ref swig_GetShapesOnBox "Example"
5766 @ManageTransactions("ShapesOp")
5767 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5769 Find in theShape all sub-shapes of type theShapeType, situated relatively
5770 the specified theBox by the certain way, defined through theState parameter.
5773 theBox Shape for relative comparing.
5774 theShape Shape to find sub-shapes of.
5775 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5776 theState The state of the sub-shapes to find (see GEOM::shape_state)
5777 theName Object name; when specified, this parameter is used
5778 for result publication in the study. Otherwise, if automatic
5779 publication is switched on, default value is used for result name.
5782 List of all found sub-shapes.
5784 # Example: see GEOM_TestOthers.py
5785 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5786 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5787 self._autoPublish(aList, theName, "shapeOnBox")
5790 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5791 # the specified \a theBox by the certain way, defined through \a theState parameter.
5792 # @param theBox Shape for relative comparing.
5793 # @param theShape Shape to find sub-shapes of.
5794 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5795 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5797 # @return List of all found sub-shapes indices.
5799 # @ref swig_GetShapesOnBoxIDs "Example"
5800 @ManageTransactions("ShapesOp")
5801 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5803 Find in theShape all sub-shapes of type theShapeType, situated relatively
5804 the specified theBox by the certain way, defined through theState parameter.
5807 theBox Shape for relative comparing.
5808 theShape Shape to find sub-shapes of.
5809 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5810 theState The state of the sub-shapes to find (see GEOM::shape_state)
5813 List of all found sub-shapes indices.
5815 # Example: see GEOM_TestOthers.py
5816 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5817 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5820 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5821 # situated relatively the specified \a theCheckShape by the
5822 # certain way, defined through \a theState parameter.
5823 # @param theCheckShape Shape for relative comparing. It must be a solid.
5824 # @param theShape Shape to find sub-shapes of.
5825 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5826 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5827 # @param theName Object name; when specified, this parameter is used
5828 # for result publication in the study. Otherwise, if automatic
5829 # publication is switched on, default value is used for result name.
5831 # @return List of all found sub-shapes.
5833 # @ref swig_GetShapesOnShape "Example"
5834 @ManageTransactions("ShapesOp")
5835 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5837 Find in theShape all sub-shapes of type theShapeType,
5838 situated relatively the specified theCheckShape by the
5839 certain way, defined through theState parameter.
5842 theCheckShape Shape for relative comparing. It must be a solid.
5843 theShape Shape to find sub-shapes of.
5844 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5845 theState The state of the sub-shapes to find (see GEOM::shape_state)
5846 theName Object name; when specified, this parameter is used
5847 for result publication in the study. Otherwise, if automatic
5848 publication is switched on, default value is used for result name.
5851 List of all found sub-shapes.
5853 # Example: see GEOM_TestOthers.py
5854 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5855 theShapeType, theState)
5856 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5857 self._autoPublish(aList, theName, "shapeOnShape")
5860 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5861 # situated relatively the specified \a theCheckShape by the
5862 # certain way, defined through \a theState parameter.
5863 # @param theCheckShape Shape for relative comparing. It must be a solid.
5864 # @param theShape Shape to find sub-shapes of.
5865 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5866 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5867 # @param theName Object name; when specified, this parameter is used
5868 # for result publication in the study. Otherwise, if automatic
5869 # publication is switched on, default value is used for result name.
5871 # @return All found sub-shapes as compound.
5873 # @ref swig_GetShapesOnShapeAsCompound "Example"
5874 @ManageTransactions("ShapesOp")
5875 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5877 Find in theShape all sub-shapes of type theShapeType,
5878 situated relatively the specified theCheckShape by the
5879 certain way, defined through theState parameter.
5882 theCheckShape Shape for relative comparing. It must be a solid.
5883 theShape Shape to find sub-shapes of.
5884 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5885 theState The state of the sub-shapes to find (see GEOM::shape_state)
5886 theName Object name; when specified, this parameter is used
5887 for result publication in the study. Otherwise, if automatic
5888 publication is switched on, default value is used for result name.
5891 All found sub-shapes as compound.
5893 # Example: see GEOM_TestOthers.py
5894 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5895 theShapeType, theState)
5896 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5897 self._autoPublish(anObj, theName, "shapeOnShape")
5900 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5901 # situated relatively the specified \a theCheckShape by the
5902 # certain way, defined through \a theState parameter.
5903 # @param theCheckShape Shape for relative comparing. It must be a solid.
5904 # @param theShape Shape to find sub-shapes of.
5905 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5906 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5908 # @return List of all found sub-shapes indices.
5910 # @ref swig_GetShapesOnShapeIDs "Example"
5911 @ManageTransactions("ShapesOp")
5912 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5914 Find in theShape all sub-shapes of type theShapeType,
5915 situated relatively the specified theCheckShape by the
5916 certain way, defined through theState parameter.
5919 theCheckShape Shape for relative comparing. It must be a solid.
5920 theShape Shape to find sub-shapes of.
5921 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5922 theState The state of the sub-shapes to find (see GEOM::shape_state)
5925 List of all found sub-shapes indices.
5927 # Example: see GEOM_TestOthers.py
5928 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5929 theShapeType, theState)
5930 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5933 ## Get sub-shape(s) of theShapeWhere, which are
5934 # coincident with \a theShapeWhat or could be a part of it.
5935 # @param theShapeWhere Shape to find sub-shapes of.
5936 # @param theShapeWhat Shape, specifying what to find.
5937 # @param isNewImplementation implementation of GetInPlace functionality
5938 # (default = False, old alghorithm based on shape properties)
5939 # @param theName Object name; when specified, this parameter is used
5940 # for result publication in the study. Otherwise, if automatic
5941 # publication is switched on, default value is used for result name.
5943 # @return Compound which includes all found sub-shapes if they have different types;
5944 # or group of all found shapes of the equal type; or a single found sub-shape.
5946 # @note This function has a restriction on argument shapes.
5947 # If \a theShapeWhere has curved parts with significantly
5948 # outstanding centres (i.e. the mass centre of a part is closer to
5949 # \a theShapeWhat than to the part), such parts will not be found.
5950 # @image html get_in_place_lost_part.png
5952 # @ref swig_GetInPlace "Example"
5953 @ManageTransactions("ShapesOp")
5954 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5956 Get sub-shape(s) of theShapeWhere, which are
5957 coincident with theShapeWhat or could be a part of it.
5960 theShapeWhere Shape to find sub-shapes of.
5961 theShapeWhat Shape, specifying what to find.
5962 isNewImplementation Implementation of GetInPlace functionality
5963 (default = False, old alghorithm based on shape properties)
5964 theName Object name; when specified, this parameter is used
5965 for result publication in the study. Otherwise, if automatic
5966 publication is switched on, default value is used for result name.
5969 Compound which includes all found sub-shapes if they have different types;
5970 or group of all found shapes of the equal type; or a single found sub-shape.
5974 This function has a restriction on argument shapes.
5975 If theShapeWhere has curved parts with significantly
5976 outstanding centres (i.e. the mass centre of a part is closer to
5977 theShapeWhat than to the part), such parts will not be found.
5979 # Example: see GEOM_TestOthers.py
5981 if isNewImplementation:
5982 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5984 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5986 RaiseIfFailed("GetInPlace", self.ShapesOp)
5987 self._autoPublish(anObj, theName, "inplace")
5990 ## Get sub-shape(s) of \a theShapeWhere, which are
5991 # coincident with \a theShapeWhat or could be a part of it.
5993 # Implementation of this method is based on a saved history of an operation,
5994 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5995 # arguments (an argument shape or a sub-shape of an argument shape).
5996 # The operation could be the Partition or one of boolean operations,
5997 # performed on simple shapes (not on compounds).
5999 # @param theShapeWhere Shape to find sub-shapes of.
6000 # @param theShapeWhat Shape, specifying what to find (must be in the
6001 # building history of the ShapeWhere).
6002 # @param theName Object name; when specified, this parameter is used
6003 # for result publication in the study. Otherwise, if automatic
6004 # publication is switched on, default value is used for result name.
6006 # @return Compound which includes all found sub-shapes if they have different types;
6007 # or group of all found shapes of the equal type; or a single found sub-shape.
6009 # @ref swig_GetInPlace "Example"
6010 @ManageTransactions("ShapesOp")
6011 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6013 Implementation of this method is based on a saved history of an operation,
6014 produced theShapeWhere. The theShapeWhat must be among this operation's
6015 arguments (an argument shape or a sub-shape of an argument shape).
6016 The operation could be the Partition or one of boolean operations,
6017 performed on simple shapes (not on compounds).
6020 theShapeWhere Shape to find sub-shapes of.
6021 theShapeWhat Shape, specifying what to find (must be in the
6022 building history of the ShapeWhere).
6023 theName Object name; when specified, this parameter is used
6024 for result publication in the study. Otherwise, if automatic
6025 publication is switched on, default value is used for result name.
6028 Compound which includes all found sub-shapes if they have different types;
6029 or group of all found shapes of the equal type; or a single found sub-shape.
6031 # Example: see GEOM_TestOthers.py
6032 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6033 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6034 self._autoPublish(anObj, theName, "inplace")
6037 ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6038 # For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6039 # IDs of @a theShapeWhere.
6040 # For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6041 # two parts by a plane, then the result can be as this:
6042 # len( result_list ) = 35,
6043 # result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6044 # solids with IDs 2 and 36 within theShapeWhere
6046 # @param theShapeWhere Shape to find sub-shapes of.
6047 # @param theShapeWhat Shape, specifying what to find.
6048 # @return List of lists of sub-shape IDS of theShapeWhere.
6049 def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6051 A sort of GetInPlace functionality, returning IDs of sub-shapes.
6052 For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6053 IDs of @a theShapeWhere.
6054 For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6055 two parts by a plane, then the result can be as this:
6056 len( result_list ) = 35,
6057 result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6058 solids with IDs 2 and 36 within theShapeWhere
6061 theShapeWhere Shape to find sub-shapes of.
6062 theShapeWhat Shape, specifying what to find.
6065 List of lists of sub-shape IDS of theShapeWhere.
6067 return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6069 ## Get sub-shape of theShapeWhere, which is
6070 # equal to \a theShapeWhat.
6071 # @param theShapeWhere Shape to find sub-shape of.
6072 # @param theShapeWhat Shape, specifying what to find.
6073 # @param theName Object name; when specified, this parameter is used
6074 # for result publication in the study. Otherwise, if automatic
6075 # publication is switched on, default value is used for result name.
6077 # @return New GEOM.GEOM_Object for found sub-shape.
6079 # @ref swig_GetSame "Example"
6080 @ManageTransactions("ShapesOp")
6081 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6083 Get sub-shape of theShapeWhere, which is
6084 equal to theShapeWhat.
6087 theShapeWhere Shape to find sub-shape of.
6088 theShapeWhat Shape, specifying what to find.
6089 theName Object name; when specified, this parameter is used
6090 for result publication in the study. Otherwise, if automatic
6091 publication is switched on, default value is used for result name.
6094 New GEOM.GEOM_Object for found sub-shape.
6096 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6097 RaiseIfFailed("GetSame", self.ShapesOp)
6098 self._autoPublish(anObj, theName, "sameShape")
6102 ## Get sub-shape indices of theShapeWhere, which is
6103 # equal to \a theShapeWhat.
6104 # @param theShapeWhere Shape to find sub-shape of.
6105 # @param theShapeWhat Shape, specifying what to find.
6106 # @return List of all found sub-shapes indices.
6108 # @ref swig_GetSame "Example"
6109 @ManageTransactions("ShapesOp")
6110 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6112 Get sub-shape indices of theShapeWhere, which is
6113 equal to theShapeWhat.
6116 theShapeWhere Shape to find sub-shape of.
6117 theShapeWhat Shape, specifying what to find.
6120 List of all found sub-shapes indices.
6122 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6123 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6126 ## Resize the input edge with the new Min and Max parameters.
6127 # The input edge parameters range is [0, 1]. If theMin parameter is
6128 # negative, the input edge is extended, otherwise it is shrinked by
6129 # theMin parameter. If theMax is greater than 1, the edge is extended,
6130 # otherwise it is shrinked by theMax parameter.
6131 # @param theEdge the input edge to be resized.
6132 # @param theMin the minimal parameter value.
6133 # @param theMax the maximal parameter value.
6134 # @param theName Object name; when specified, this parameter is used
6135 # for result publication in the study. Otherwise, if automatic
6136 # publication is switched on, default value is used for result name.
6137 # @return New GEOM.GEOM_Object, containing the created edge.
6139 # @ref tui_extend "Example"
6140 @ManageTransactions("ShapesOp")
6141 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6143 Resize the input edge with the new Min and Max parameters.
6144 The input edge parameters range is [0, 1]. If theMin parameter is
6145 negative, the input edge is extended, otherwise it is shrinked by
6146 theMin parameter. If theMax is greater than 1, the edge is extended,
6147 otherwise it is shrinked by theMax parameter.
6150 theEdge the input edge to be resized.
6151 theMin the minimal parameter value.
6152 theMax the maximal parameter value.
6153 theName Object name; when specified, this parameter is used
6154 for result publication in the study. Otherwise, if automatic
6155 publication is switched on, default value is used for result name.
6158 New GEOM.GEOM_Object, containing the created edge.
6160 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6161 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6162 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6163 anObj.SetParameters(Parameters)
6164 self._autoPublish(anObj, theName, "edge")
6167 ## Resize the input face with the new UMin, UMax, VMin and VMax
6168 # parameters. The input face U and V parameters range is [0, 1]. If
6169 # theUMin parameter is negative, the input face is extended, otherwise
6170 # it is shrinked along U direction by theUMin parameter. If theUMax is
6171 # greater than 1, the face is extended, otherwise it is shrinked along
6172 # U direction by theUMax parameter. So as for theVMin, theVMax and
6173 # V direction of the input face.
6174 # @param theFace the input face to be resized.
6175 # @param theUMin the minimal U parameter value.
6176 # @param theUMax the maximal U parameter value.
6177 # @param theVMin the minimal V parameter value.
6178 # @param theVMax the maximal V parameter value.
6179 # @param theName Object name; when specified, this parameter is used
6180 # for result publication in the study. Otherwise, if automatic
6181 # publication is switched on, default value is used for result name.
6182 # @return New GEOM.GEOM_Object, containing the created face.
6184 # @ref tui_extend "Example"
6185 @ManageTransactions("ShapesOp")
6186 def ExtendFace(self, theFace, theUMin, theUMax,
6187 theVMin, theVMax, theName=None):
6189 Resize the input face with the new UMin, UMax, VMin and VMax
6190 parameters. The input face U and V parameters range is [0, 1]. If
6191 theUMin parameter is negative, the input face is extended, otherwise
6192 it is shrinked along U direction by theUMin parameter. If theUMax is
6193 greater than 1, the face is extended, otherwise it is shrinked along
6194 U direction by theUMax parameter. So as for theVMin, theVMax and
6195 V direction of the input face.
6198 theFace the input face to be resized.
6199 theUMin the minimal U parameter value.
6200 theUMax the maximal U parameter value.
6201 theVMin the minimal V parameter value.
6202 theVMax the maximal V parameter value.
6203 theName Object name; when specified, this parameter is used
6204 for result publication in the study. Otherwise, if automatic
6205 publication is switched on, default value is used for result name.
6208 New GEOM.GEOM_Object, containing the created face.
6210 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6211 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6213 RaiseIfFailed("ExtendFace", self.ShapesOp)
6214 anObj.SetParameters(Parameters)
6215 self._autoPublish(anObj, theName, "face")
6218 ## This function takes some face as input parameter and creates new
6219 # GEOM_Object, i.e. topological shape by extracting underlying surface
6220 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6221 # parameters of the source face (in the parametrical space).
6222 # @param theFace the input face.
6223 # @param theName Object name; when specified, this parameter is used
6224 # for result publication in the study. Otherwise, if automatic
6225 # publication is switched on, default value is used for result name.
6226 # @return New GEOM.GEOM_Object, containing the created face.
6228 # @ref tui_creation_surface "Example"
6229 @ManageTransactions("ShapesOp")
6230 def MakeSurfaceFromFace(self, theFace, theName=None):
6232 This function takes some face as input parameter and creates new
6233 GEOM_Object, i.e. topological shape by extracting underlying surface
6234 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6235 parameters of the source face (in the parametrical space).
6238 theFace the input face.
6239 theName Object name; when specified, this parameter is used
6240 for result publication in the study. Otherwise, if automatic
6241 publication is switched on, default value is used for result name.
6244 New GEOM.GEOM_Object, containing the created face.
6246 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6247 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6248 self._autoPublish(anObj, theName, "surface")
6254 ## @addtogroup l4_access
6257 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6258 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6259 # @param aShape Shape to get sub-shape of.
6260 # @param ListOfID List of sub-shapes indices.
6261 # @param theName Object name; when specified, this parameter is used
6262 # for result publication in the study. Otherwise, if automatic
6263 # publication is switched on, default value is used for result name.
6265 # @return Found sub-shape.
6267 # @ref swig_all_decompose "Example"
6268 def GetSubShape(self, aShape, ListOfID, theName=None):
6270 Obtain a composite sub-shape of aShape, composed from sub-shapes
6271 of aShape, selected by their unique IDs inside aShape
6274 aShape Shape to get sub-shape of.
6275 ListOfID List of sub-shapes indices.
6276 theName Object name; when specified, this parameter is used
6277 for result publication in the study. Otherwise, if automatic
6278 publication is switched on, default value is used for result name.
6283 # Example: see GEOM_TestAll.py
6284 anObj = self.AddSubShape(aShape,ListOfID)
6285 self._autoPublish(anObj, theName, "subshape")
6288 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6289 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6290 # @param aShape Shape to get sub-shape of.
6291 # @param aSubShape Sub-shapes of aShape.
6292 # @return ID of found sub-shape.
6294 # @ref swig_all_decompose "Example"
6295 @ManageTransactions("LocalOp")
6296 def GetSubShapeID(self, aShape, aSubShape):
6298 Obtain unique ID of sub-shape aSubShape inside aShape
6299 of aShape, selected by their unique IDs inside aShape
6302 aShape Shape to get sub-shape of.
6303 aSubShape Sub-shapes of aShape.
6306 ID of found sub-shape.
6308 # Example: see GEOM_TestAll.py
6309 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6310 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6313 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6314 # This function is provided for performance purpose. The complexity is O(n) with n
6315 # the number of subobjects of aShape
6316 # @param aShape Shape to get sub-shape of.
6317 # @param aSubShapes Sub-shapes of aShape.
6318 # @return list of IDs of found sub-shapes.
6320 # @ref swig_all_decompose "Example"
6321 @ManageTransactions("ShapesOp")
6322 def GetSubShapesIDs(self, aShape, aSubShapes):
6324 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6325 This function is provided for performance purpose. The complexity is O(n) with n
6326 the number of subobjects of aShape
6329 aShape Shape to get sub-shape of.
6330 aSubShapes Sub-shapes of aShape.
6333 List of IDs of found sub-shape.
6335 # Example: see GEOM_TestAll.py
6336 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6337 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6343 ## @addtogroup l4_decompose
6346 ## Get all sub-shapes and groups of \a theShape,
6347 # that were created already by any other methods.
6348 # @param theShape Any shape.
6349 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6350 # returned, else all found sub-shapes and groups.
6351 # @return List of existing sub-objects of \a theShape.
6353 # @ref swig_all_decompose "Example"
6354 @ManageTransactions("ShapesOp")
6355 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6357 Get all sub-shapes and groups of theShape,
6358 that were created already by any other methods.
6362 theGroupsOnly If this parameter is TRUE, only groups will be
6363 returned, else all found sub-shapes and groups.
6366 List of existing sub-objects of theShape.
6368 # Example: see GEOM_TestAll.py
6369 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6370 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6373 ## Get all groups of \a theShape,
6374 # that were created already by any other methods.
6375 # @param theShape Any shape.
6376 # @return List of existing groups of \a theShape.
6378 # @ref swig_all_decompose "Example"
6379 @ManageTransactions("ShapesOp")
6380 def GetGroups(self, theShape):
6382 Get all groups of theShape,
6383 that were created already by any other methods.
6389 List of existing groups of theShape.
6391 # Example: see GEOM_TestAll.py
6392 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6393 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6396 ## Explode a shape on sub-shapes of a given type.
6397 # If the shape itself matches the type, it is also returned.
6398 # @param aShape Shape to be exploded.
6399 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6400 # @param theName Object name; when specified, this parameter is used
6401 # for result publication in the study. Otherwise, if automatic
6402 # publication is switched on, default value is used for result name.
6404 # @return List of sub-shapes of type theShapeType, contained in theShape.
6406 # @ref swig_all_decompose "Example"
6407 @ManageTransactions("ShapesOp")
6408 def SubShapeAll(self, aShape, aType, theName=None):
6410 Explode a shape on sub-shapes of a given type.
6411 If the shape itself matches the type, it is also returned.
6414 aShape Shape to be exploded.
6415 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6416 theName Object name; when specified, this parameter is used
6417 for result publication in the study. Otherwise, if automatic
6418 publication is switched on, default value is used for result name.
6421 List of sub-shapes of type theShapeType, contained in theShape.
6423 # Example: see GEOM_TestAll.py
6424 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6425 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6426 self._autoPublish(ListObj, theName, "subshape")
6429 ## Explode a shape on sub-shapes of a given type.
6430 # @param aShape Shape to be exploded.
6431 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6432 # @return List of IDs of sub-shapes.
6434 # @ref swig_all_decompose "Example"
6435 @ManageTransactions("ShapesOp")
6436 def SubShapeAllIDs(self, aShape, aType):
6438 Explode a shape on sub-shapes of a given type.
6441 aShape Shape to be exploded (see geompy.ShapeType)
6442 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6445 List of IDs of sub-shapes.
6447 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6448 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6451 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6452 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6453 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6454 # @param aShape Shape to get sub-shape of.
6455 # @param ListOfInd List of sub-shapes indices.
6456 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6457 # @param theName Object name; when specified, this parameter is used
6458 # for result publication in the study. Otherwise, if automatic
6459 # publication is switched on, default value is used for result name.
6461 # @return A compound of sub-shapes of aShape.
6463 # @ref swig_all_decompose "Example"
6464 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6466 Obtain a compound of sub-shapes of aShape,
6467 selected by their indices in list of all sub-shapes of type aType.
6468 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6471 aShape Shape to get sub-shape of.
6472 ListOfID List of sub-shapes indices.
6473 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6474 theName Object name; when specified, this parameter is used
6475 for result publication in the study. Otherwise, if automatic
6476 publication is switched on, default value is used for result name.
6479 A compound of sub-shapes of aShape.
6481 # Example: see GEOM_TestAll.py
6483 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6484 for ind in ListOfInd:
6485 ListOfIDs.append(AllShapeIDsList[ind - 1])
6486 # note: auto-publishing is done in self.GetSubShape()
6487 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6490 ## Explode a shape on sub-shapes of a given type.
6491 # Sub-shapes will be sorted taking into account their gravity centers,
6492 # to provide stable order of sub-shapes. Please see
6493 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6494 # If the shape itself matches the type, it is also returned.
6495 # @param aShape Shape to be exploded.
6496 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6497 # @param theName Object name; when specified, this parameter is used
6498 # for result publication in the study. Otherwise, if automatic
6499 # publication is switched on, default value is used for result name.
6501 # @return List of sub-shapes of type theShapeType, contained in theShape.
6503 # @ref swig_SubShapeAllSorted "Example"
6504 @ManageTransactions("ShapesOp")
6505 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6507 Explode a shape on sub-shapes of a given type.
6508 Sub-shapes will be sorted taking into account their gravity centers,
6509 to provide stable order of sub-shapes.
6510 If the shape itself matches the type, it is also returned.
6513 aShape Shape to be exploded.
6514 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6515 theName Object name; when specified, this parameter is used
6516 for result publication in the study. Otherwise, if automatic
6517 publication is switched on, default value is used for result name.
6520 List of sub-shapes of type theShapeType, contained in theShape.
6522 # Example: see GEOM_TestAll.py
6523 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6524 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6525 self._autoPublish(ListObj, theName, "subshape")
6528 ## Explode a shape on sub-shapes of a given type.
6529 # Sub-shapes will be sorted taking into account their gravity centers,
6530 # to provide stable order of sub-shapes. Please see
6531 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6532 # @param aShape Shape to be exploded.
6533 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6534 # @return List of IDs of sub-shapes.
6536 # @ref swig_all_decompose "Example"
6537 @ManageTransactions("ShapesOp")
6538 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6540 Explode a shape on sub-shapes of a given type.
6541 Sub-shapes will be sorted taking into account their gravity centers,
6542 to provide stable order of sub-shapes.
6545 aShape Shape to be exploded.
6546 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6549 List of IDs of sub-shapes.
6551 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6552 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6555 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6556 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6557 # Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6558 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6559 # @param aShape Shape to get sub-shape of.
6560 # @param ListOfInd List of sub-shapes indices.
6561 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6562 # @param theName Object name; when specified, this parameter is used
6563 # for result publication in the study. Otherwise, if automatic
6564 # publication is switched on, default value is used for result name.
6566 # @return A compound of sub-shapes of aShape.
6568 # @ref swig_all_decompose "Example"
6569 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6571 Obtain a compound of sub-shapes of aShape,
6572 selected by they indices in sorted list of all sub-shapes of type aType.
6573 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6576 aShape Shape to get sub-shape of.
6577 ListOfID List of sub-shapes indices.
6578 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6579 theName Object name; when specified, this parameter is used
6580 for result publication in the study. Otherwise, if automatic
6581 publication is switched on, default value is used for result name.
6584 A compound of sub-shapes of aShape.
6586 # Example: see GEOM_TestAll.py
6588 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6589 for ind in ListOfInd:
6590 ListOfIDs.append(AllShapeIDsList[ind - 1])
6591 # note: auto-publishing is done in self.GetSubShape()
6592 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6595 ## Extract shapes (excluding the main shape) of given type.
6596 # @param aShape The shape.
6597 # @param aType The shape type (see ShapeType())
6598 # @param isSorted Boolean flag to switch sorting on/off. Please see
6599 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6600 # @param theName Object name; when specified, this parameter is used
6601 # for result publication in the study. Otherwise, if automatic
6602 # publication is switched on, default value is used for result name.
6604 # @return List of sub-shapes of type aType, contained in aShape.
6606 # @ref swig_FilletChamfer "Example"
6607 @ManageTransactions("ShapesOp")
6608 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6610 Extract shapes (excluding the main shape) of given type.
6614 aType The shape type (see geompy.ShapeType)
6615 isSorted Boolean flag to switch sorting on/off.
6616 theName Object name; when specified, this parameter is used
6617 for result publication in the study. Otherwise, if automatic
6618 publication is switched on, default value is used for result name.
6621 List of sub-shapes of type aType, contained in aShape.
6623 # Example: see GEOM_TestAll.py
6624 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6625 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6626 self._autoPublish(ListObj, theName, "subshape")
6629 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6630 # @param aShape Main shape.
6631 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6632 # @param theName Object name; when specified, this parameter is used
6633 # for result publication in the study. Otherwise, if automatic
6634 # publication is switched on, default value is used for result name.
6635 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6637 # @ref swig_all_decompose "Example"
6638 @ManageTransactions("ShapesOp")
6639 def SubShapes(self, aShape, anIDs, theName=None):
6641 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6645 anIDs List of unique IDs of sub-shapes inside theMainShape.
6646 theName Object name; when specified, this parameter is used
6647 for result publication in the study. Otherwise, if automatic
6648 publication is switched on, default value is used for result name.
6651 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6653 # Example: see GEOM_TestAll.py
6654 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6655 RaiseIfFailed("SubShapes", self.ShapesOp)
6656 self._autoPublish(ListObj, theName, "subshape")
6659 ## Explode a shape into edges sorted in a row from a starting point.
6660 # @param theShape the shape to be exploded on edges.
6661 # @param theStartPoint the starting point.
6662 # @param theName Object name; when specified, this parameter is used
6663 # for result publication in the study. Otherwise, if automatic
6664 # publication is switched on, default value is used for result name.
6665 # @return List of GEOM.GEOM_Object that is actually an ordered list
6666 # of edges sorted in a row from a starting point.
6668 # @ref swig_GetSubShapeEdgeSorted "Example"
6669 @ManageTransactions("ShapesOp")
6670 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6672 Explode a shape into edges sorted in a row from a starting point.
6675 theShape the shape to be exploded on edges.
6676 theStartPoint the starting point.
6677 theName Object name; when specified, this parameter is used
6678 for result publication in the study. Otherwise, if automatic
6679 publication is switched on, default value is used for result name.
6682 List of GEOM.GEOM_Object that is actually an ordered list
6683 of edges sorted in a row from a starting point.
6685 # Example: see GEOM_TestAll.py
6686 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6687 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6688 self._autoPublish(ListObj, theName, "SortedEdges")
6692 # Return the list of subshapes that satisfies a certain tolerance
6693 # criterion. The user defines the type of shapes to be returned, the
6694 # condition and the tolerance value. The operation is defined for
6695 # faces, edges and vertices only. E.g. for theShapeType FACE,
6696 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6697 # all faces of theShape that have tolerances greater then 1.e7.
6699 # @param theShape the shape to be exploded
6700 # @param theShapeType the type of sub-shapes to be returned (see
6701 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6702 # @param theCondition the condition type (see GEOM::comparison_condition).
6703 # @param theTolerance the tolerance filter.
6704 # @param theName Object name; when specified, this parameter is used
6705 # for result publication in the study. Otherwise, if automatic
6706 # publication is switched on, default value is used for result name.
6707 # @return the list of shapes that satisfy the conditions.
6709 # @ref swig_GetSubShapesWithTolerance "Example"
6710 @ManageTransactions("ShapesOp")
6711 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6712 theCondition, theTolerance, theName=None):
6714 Return the list of subshapes that satisfies a certain tolerance
6715 criterion. The user defines the type of shapes to be returned, the
6716 condition and the tolerance value. The operation is defined for
6717 faces, edges and vertices only. E.g. for theShapeType FACE,
6718 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6719 all faces of theShape that have tolerances greater then 1.e7.
6722 theShape the shape to be exploded
6723 theShapeType the type of sub-shapes to be returned (see
6724 ShapeType()). Can have the values FACE,
6725 EDGE and VERTEX only.
6726 theCondition the condition type (see GEOM::comparison_condition).
6727 theTolerance the tolerance filter.
6728 theName Object name; when specified, this parameter is used
6729 for result publication in the study. Otherwise, if automatic
6730 publication is switched on, default value is used for result name.
6733 The list of shapes that satisfy the conditions.
6735 # Example: see GEOM_TestAll.py
6736 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6737 theCondition, theTolerance)
6738 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6739 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6742 ## Check if the object is a sub-object of another GEOM object.
6743 # @param aSubObject Checked sub-object (or its parent object, in case if
6744 # \a theSubObjectIndex is non-zero).
6745 # @param anObject An object that is checked for ownership (or its parent object,
6746 # in case if \a theObjectIndex is non-zero).
6747 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6748 # identifies a sub-object within its parent specified via \a theSubObject.
6749 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6750 # identifies an object within its parent specified via \a theObject.
6751 # @return TRUE, if the given object contains sub-object.
6752 @ManageTransactions("ShapesOp")
6753 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6755 Check if the object is a sub-object of another GEOM object.
6758 aSubObject Checked sub-object (or its parent object, in case if
6759 \a theSubObjectIndex is non-zero).
6760 anObject An object that is checked for ownership (or its parent object,
6761 in case if \a theObjectIndex is non-zero).
6762 aSubObjectIndex When non-zero, specifies a sub-shape index that
6763 identifies a sub-object within its parent specified via \a theSubObject.
6764 anObjectIndex When non-zero, specifies a sub-shape index that
6765 identifies an object within its parent specified via \a theObject.
6768 TRUE, if the given object contains sub-object.
6770 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6771 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6774 ## Perform extraction of sub-shapes from the main shape.
6776 # @param theShape the main shape
6777 # @param theListOfID the list of sub-shape IDs to be extracted from
6779 # @return New GEOM.GEOM_Object, containing the shape without
6780 # extracted sub-shapes.
6782 # @ref swig_MakeExtraction "Example"
6783 @ManageTransactions("ShapesOp")
6784 def MakeExtraction(self, theShape, theListOfID, theName=None):
6786 Perform extraction of sub-shapes from the main shape.
6789 theShape the main shape
6790 theListOfID the list of sub-shape IDs to be extracted from
6794 New GEOM.GEOM_Object, containing the shape without
6795 extracted sub-shapes.
6797 # Example: see GEOM_TestAll.py
6798 (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6799 RaiseIfFailed("MakeExtraction", self.ShapesOp)
6800 self._autoPublish(anObj, theName, "Extraction")
6803 # end of l4_decompose
6806 ## @addtogroup l4_decompose_d
6809 ## Deprecated method
6810 # It works like SubShapeAllSortedCentres(), but wrongly
6811 # defines centres of faces, shells and solids.
6812 @ManageTransactions("ShapesOp")
6813 def SubShapeAllSorted(self, aShape, aType, theName=None):
6816 It works like geompy.SubShapeAllSortedCentres, but wrongly
6817 defines centres of faces, shells and solids.
6819 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6820 RaiseIfFailed("MakeExplode", self.ShapesOp)
6821 self._autoPublish(ListObj, theName, "subshape")
6824 ## Deprecated method
6825 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6826 # defines centres of faces, shells and solids.
6827 @ManageTransactions("ShapesOp")
6828 def SubShapeAllSortedIDs(self, aShape, aType):
6831 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6832 defines centres of faces, shells and solids.
6834 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6835 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6838 ## Deprecated method
6839 # It works like SubShapeSortedCentres(), but has a bug
6840 # (wrongly defines centres of faces, shells and solids).
6841 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6844 It works like geompy.SubShapeSortedCentres, but has a bug
6845 (wrongly defines centres of faces, shells and solids).
6848 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6849 for ind in ListOfInd:
6850 ListOfIDs.append(AllShapeIDsList[ind - 1])
6851 # note: auto-publishing is done in self.GetSubShape()
6852 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6855 # end of l4_decompose_d
6858 ## @addtogroup l3_healing
6861 ## Apply a sequence of Shape Healing operators to the given object.
6862 # @param theShape Shape to be processed.
6863 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6864 # @param theParameters List of names of parameters
6865 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6866 # @param theValues List of values of parameters, in the same order
6867 # as parameters are listed in <VAR>theParameters</VAR> list.
6868 # @param theName Object name; when specified, this parameter is used
6869 # for result publication in the study. Otherwise, if automatic
6870 # publication is switched on, default value is used for result name.
6872 # <b> Operators and Parameters: </b> \n
6874 # * \b FixShape - corrects invalid shapes. \n
6875 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6876 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6878 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6879 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6880 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6881 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6882 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6883 # - \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
6884 # - \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
6885 # - \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
6887 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6888 # surfaces in segments using a certain angle. \n
6889 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6890 # if Angle=180, four if Angle=90, etc). \n
6891 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6893 # * \b SplitClosedFaces - splits closed faces in segments.
6894 # The number of segments depends on the number of splitting points.\n
6895 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6897 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6898 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6899 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6900 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6901 # This and the previous parameters can take the following values:\n
6902 # \b Parametric \b Continuity \n
6903 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6904 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6905 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6906 # ruling out sharp edges).\n
6907 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6908 # are of the same magnitude).\n
6909 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6910 # or surfaces (d/du C(u)) are the same at junction. \n
6911 # \b Geometric \b Continuity \n
6912 # \b G1: first derivatives are proportional at junction.\n
6913 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6914 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6915 # \b G2: first and second derivatives are proportional at junction.
6916 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6917 # continuity requires that the underlying parameterization was continuous as well.
6918 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6920 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6921 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6922 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6923 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6924 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6925 # with the specified parameters.\n
6926 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6927 # with the specified parameters.\n
6928 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6929 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6930 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6931 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6933 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6934 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6935 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6936 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6937 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6939 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6940 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6943 # @return New GEOM.GEOM_Object, containing processed shape.
6945 # \n @ref tui_shape_processing "Example"
6946 @ManageTransactions("HealOp")
6947 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6949 Apply a sequence of Shape Healing operators to the given object.
6952 theShape Shape to be processed.
6953 theValues List of values of parameters, in the same order
6954 as parameters are listed in theParameters list.
6955 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6956 theParameters List of names of parameters
6957 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6958 theName Object name; when specified, this parameter is used
6959 for result publication in the study. Otherwise, if automatic
6960 publication is switched on, default value is used for result name.
6962 Operators and Parameters:
6964 * FixShape - corrects invalid shapes.
6965 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6966 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6967 * FixFaceSize - removes small faces, such as spots and strips.
6968 * FixFaceSize.Tolerance - defines minimum possible face size.
6969 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6970 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6971 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6972 * 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.
6973 * 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.
6974 * 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.
6976 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6977 in segments using a certain angle.
6978 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6979 if Angle=180, four if Angle=90, etc).
6980 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6981 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6983 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6984 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6985 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6986 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6987 * SplitContinuity.CurveContinuity - required continuity for curves.
6988 This and the previous parameters can take the following values:
6990 Parametric Continuity:
6991 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6992 coincidental. The curves or surfaces may still meet at an angle,
6993 giving rise to a sharp corner or edge).
6994 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6995 are parallel, ruling out sharp edges).
6996 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
6997 or surfaces are of the same magnitude).
6998 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
6999 curves or surfaces (d/du C(u)) are the same at junction.
7001 Geometric Continuity:
7002 G1: first derivatives are proportional at junction.
7003 The curve tangents thus have the same direction, but not necessarily the same magnitude.
7004 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
7005 G2: first and second derivatives are proportional at junction. As the names imply,
7006 geometric continuity requires the geometry to be continuous, while parametric continuity requires
7007 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
7008 geometric continuity of order n, but not vice-versa.
7009 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7010 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7011 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7012 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7013 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7014 the specified parameters.
7015 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7016 the specified parameters.
7017 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7018 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7019 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7020 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7021 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7022 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7023 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7024 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7025 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7026 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7027 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7030 New GEOM.GEOM_Object, containing processed shape.
7032 Note: For more information look through SALOME Geometry User's Guide->
7033 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7035 # Example: see GEOM_TestHealing.py
7036 theValues,Parameters = ParseList(theValues)
7037 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7038 # To avoid script failure in case of good argument shape
7039 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7041 RaiseIfFailed("ProcessShape", self.HealOp)
7042 for string in (theOperators + theParameters):
7043 Parameters = ":" + Parameters
7045 anObj.SetParameters(Parameters)
7046 self._autoPublish(anObj, theName, "healed")
7049 ## Remove faces from the given object (shape).
7050 # @param theObject Shape to be processed.
7051 # @param theFaces Indices of faces to be removed, if EMPTY then the method
7052 # removes ALL faces of the given object.
7053 # @param theName Object name; when specified, this parameter is used
7054 # for result publication in the study. Otherwise, if automatic
7055 # publication is switched on, default value is used for result name.
7057 # @return New GEOM.GEOM_Object, containing processed shape.
7059 # @ref tui_suppress_faces "Example"
7060 @ManageTransactions("HealOp")
7061 def SuppressFaces(self, theObject, theFaces, theName=None):
7063 Remove faces from the given object (shape).
7066 theObject Shape to be processed.
7067 theFaces Indices of faces to be removed, if EMPTY then the method
7068 removes ALL faces of the given object.
7069 theName Object name; when specified, this parameter is used
7070 for result publication in the study. Otherwise, if automatic
7071 publication is switched on, default value is used for result name.
7074 New GEOM.GEOM_Object, containing processed shape.
7076 # Example: see GEOM_TestHealing.py
7077 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7078 RaiseIfFailed("SuppressFaces", self.HealOp)
7079 self._autoPublish(anObj, theName, "suppressFaces")
7082 ## Sewing of faces into a single shell.
7083 # @param ListShape Shapes to be processed.
7084 # @param theTolerance Required tolerance value.
7085 # @param AllowNonManifold Flag that allows non-manifold sewing.
7086 # @param theName Object name; when specified, this parameter is used
7087 # for result publication in the study. Otherwise, if automatic
7088 # publication is switched on, default value is used for result name.
7090 # @return New GEOM.GEOM_Object, containing a result shell.
7092 # @ref tui_sewing "Example"
7093 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7095 Sewing of faces into a single shell.
7098 ListShape Shapes to be processed.
7099 theTolerance Required tolerance value.
7100 AllowNonManifold Flag that allows non-manifold sewing.
7101 theName Object name; when specified, this parameter is used
7102 for result publication in the study. Otherwise, if automatic
7103 publication is switched on, default value is used for result name.
7106 New GEOM.GEOM_Object, containing containing a result shell.
7108 # Example: see GEOM_TestHealing.py
7109 # note: auto-publishing is done in self.Sew()
7110 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7113 ## Sewing of faces into a single shell.
7114 # @param ListShape Shapes to be processed.
7115 # @param theTolerance Required tolerance value.
7116 # @param AllowNonManifold Flag that allows non-manifold sewing.
7117 # @param theName Object name; when specified, this parameter is used
7118 # for result publication in the study. Otherwise, if automatic
7119 # publication is switched on, default value is used for result name.
7121 # @return New GEOM.GEOM_Object, containing a result shell.
7122 @ManageTransactions("HealOp")
7123 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7125 Sewing of faces into a single shell.
7128 ListShape Shapes to be processed.
7129 theTolerance Required tolerance value.
7130 AllowNonManifold Flag that allows non-manifold sewing.
7131 theName Object name; when specified, this parameter is used
7132 for result publication in the study. Otherwise, if automatic
7133 publication is switched on, default value is used for result name.
7136 New GEOM.GEOM_Object, containing a result shell.
7138 # Example: see MakeSewing() above
7139 theTolerance,Parameters = ParseParameters(theTolerance)
7140 if AllowNonManifold:
7141 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7143 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7144 # To avoid script failure in case of good argument shape
7145 # (Fix of test cases geom/bugs11/L7,L8)
7146 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7148 RaiseIfFailed("Sew", self.HealOp)
7149 anObj.SetParameters(Parameters)
7150 self._autoPublish(anObj, theName, "sewed")
7153 ## Rebuild the topology of theSolids by removing
7154 # the faces that are shared by several solids.
7155 # @param theSolids A compound or a list of solids to be processed.
7156 # @param theName Object name; when specified, this parameter is used
7157 # for result publication in the study. Otherwise, if automatic
7158 # publication is switched on, default value is used for result name.
7160 # @return New GEOM.GEOM_Object, containing processed shape.
7162 # @ref tui_remove_webs "Example"
7163 @ManageTransactions("HealOp")
7164 def RemoveInternalFaces (self, theSolids, theName=None):
7166 Rebuild the topology of theSolids by removing
7167 the faces that are shared by several solids.
7170 theSolids A compound or a list of solids to be processed.
7171 theName Object name; when specified, this parameter is used
7172 for result publication in the study. Otherwise, if automatic
7173 publication is switched on, default value is used for result name.
7176 New GEOM.GEOM_Object, containing processed shape.
7178 # Example: see GEOM_TestHealing.py
7179 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7180 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7181 self._autoPublish(anObj, theName, "removeWebs")
7184 ## Remove internal wires and edges from the given object (face).
7185 # @param theObject Shape to be processed.
7186 # @param theWires Indices of wires to be removed, if EMPTY then the method
7187 # removes ALL internal wires of the given object.
7188 # @param theName Object name; when specified, this parameter is used
7189 # for result publication in the study. Otherwise, if automatic
7190 # publication is switched on, default value is used for result name.
7192 # @return New GEOM.GEOM_Object, containing processed shape.
7194 # @ref tui_suppress_internal_wires "Example"
7195 @ManageTransactions("HealOp")
7196 def SuppressInternalWires(self, theObject, theWires, theName=None):
7198 Remove internal wires and edges from the given object (face).
7201 theObject Shape to be processed.
7202 theWires Indices of wires to be removed, if EMPTY then the method
7203 removes ALL internal wires of the given object.
7204 theName Object name; when specified, this parameter is used
7205 for result publication in the study. Otherwise, if automatic
7206 publication is switched on, default value is used for result name.
7209 New GEOM.GEOM_Object, containing processed shape.
7211 # Example: see GEOM_TestHealing.py
7212 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7213 RaiseIfFailed("RemoveIntWires", self.HealOp)
7214 self._autoPublish(anObj, theName, "suppressWires")
7217 ## Remove internal closed contours (holes) from the given object.
7218 # @param theObject Shape to be processed.
7219 # @param theWires Indices of wires to be removed, if EMPTY then the method
7220 # removes ALL internal holes of the given object
7221 # @param theName Object name; when specified, this parameter is used
7222 # for result publication in the study. Otherwise, if automatic
7223 # publication is switched on, default value is used for result name.
7225 # @return New GEOM.GEOM_Object, containing processed shape.
7227 # @ref tui_suppress_holes "Example"
7228 @ManageTransactions("HealOp")
7229 def SuppressHoles(self, theObject, theWires, theName=None):
7231 Remove internal closed contours (holes) from the given object.
7234 theObject Shape to be processed.
7235 theWires Indices of wires to be removed, if EMPTY then the method
7236 removes ALL internal holes of the given object
7237 theName Object name; when specified, this parameter is used
7238 for result publication in the study. Otherwise, if automatic
7239 publication is switched on, default value is used for result name.
7242 New GEOM.GEOM_Object, containing processed shape.
7244 # Example: see GEOM_TestHealing.py
7245 anObj = self.HealOp.FillHoles(theObject, theWires)
7246 RaiseIfFailed("FillHoles", self.HealOp)
7247 self._autoPublish(anObj, theName, "suppressHoles")
7250 ## Close an open wire.
7251 # @param theObject Shape to be processed.
7252 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7253 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7254 # @param isCommonVertex If True : closure by creation of a common vertex,
7255 # If False : closure by creation of an edge between ends.
7256 # @param theName Object name; when specified, this parameter is used
7257 # for result publication in the study. Otherwise, if automatic
7258 # publication is switched on, default value is used for result name.
7260 # @return New GEOM.GEOM_Object, containing processed shape.
7262 # @ref tui_close_contour "Example"
7263 @ManageTransactions("HealOp")
7264 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7269 theObject Shape to be processed.
7270 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7271 if [ ], then theObject itself is a wire.
7272 isCommonVertex If True : closure by creation of a common vertex,
7273 If False : closure by creation of an edge between ends.
7274 theName Object name; when specified, this parameter is used
7275 for result publication in the study. Otherwise, if automatic
7276 publication is switched on, default value is used for result name.
7279 New GEOM.GEOM_Object, containing processed shape.
7281 # Example: see GEOM_TestHealing.py
7282 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7283 RaiseIfFailed("CloseContour", self.HealOp)
7284 self._autoPublish(anObj, theName, "closeContour")
7287 ## Addition of a point to a given edge object.
7288 # @param theObject Shape to be processed.
7289 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7290 # if -1, then theObject itself is the edge.
7291 # @param theValue Value of parameter on edge or length parameter,
7292 # depending on \a isByParameter.
7293 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7294 # if FALSE : \a theValue is treated as a length parameter [0..1]
7295 # @param theName Object name; when specified, this parameter is used
7296 # for result publication in the study. Otherwise, if automatic
7297 # publication is switched on, default value is used for result name.
7299 # @return New GEOM.GEOM_Object, containing processed shape.
7301 # @ref tui_add_point_on_edge "Example"
7302 @ManageTransactions("HealOp")
7303 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7305 Addition of a point to a given edge object.
7308 theObject Shape to be processed.
7309 theEdgeIndex Index of edge to be divided within theObject's shape,
7310 if -1, then theObject itself is the edge.
7311 theValue Value of parameter on edge or length parameter,
7312 depending on isByParameter.
7313 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7314 if FALSE : theValue is treated as a length parameter [0..1]
7315 theName Object name; when specified, this parameter is used
7316 for result publication in the study. Otherwise, if automatic
7317 publication is switched on, default value is used for result name.
7320 New GEOM.GEOM_Object, containing processed shape.
7322 # Example: see GEOM_TestHealing.py
7323 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7324 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7325 RaiseIfFailed("DivideEdge", self.HealOp)
7326 anObj.SetParameters(Parameters)
7327 self._autoPublish(anObj, theName, "divideEdge")
7330 ## Addition of points to a given edge of \a theObject by projecting
7331 # other points to the given edge.
7332 # @param theObject Shape to be processed.
7333 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7334 # if -1, then theObject itself is the edge.
7335 # @param thePoints List of points to project to theEdgeIndex-th edge.
7336 # @param theName Object name; when specified, this parameter is used
7337 # for result publication in the study. Otherwise, if automatic
7338 # publication is switched on, default value is used for result name.
7340 # @return New GEOM.GEOM_Object, containing processed shape.
7342 # @ref tui_add_point_on_edge "Example"
7343 @ManageTransactions("HealOp")
7344 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7346 Addition of points to a given edge of \a theObject by projecting
7347 other points to the given edge.
7350 theObject Shape to be processed.
7351 theEdgeIndex The edge or its index to be divided within theObject's shape,
7352 if -1, then theObject itself is the edge.
7353 thePoints List of points to project to theEdgeIndex-th edge.
7354 theName Object name; when specified, this parameter is used
7355 for result publication in the study. Otherwise, if automatic
7356 publication is switched on, default value is used for result name.
7359 New GEOM.GEOM_Object, containing processed shape.
7361 # Example: see GEOM_TestHealing.py
7362 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7363 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7364 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7365 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7366 self._autoPublish(anObj, theName, "divideEdge")
7369 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7370 # @param theWire Wire to minimize the number of C1 continuous edges in.
7371 # @param theVertices A list of vertices to suppress. If the list
7372 # is empty, all vertices in a wire will be assumed.
7373 # @param theName Object name; when specified, this parameter is used
7374 # for result publication in the study. Otherwise, if automatic
7375 # publication is switched on, default value is used for result name.
7377 # @return New GEOM.GEOM_Object with modified wire.
7379 # @ref tui_fuse_collinear_edges "Example"
7380 @ManageTransactions("HealOp")
7381 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7383 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7386 theWire Wire to minimize the number of C1 continuous edges in.
7387 theVertices A list of vertices to suppress. If the list
7388 is empty, all vertices in a wire will be assumed.
7389 theName Object name; when specified, this parameter is used
7390 for result publication in the study. Otherwise, if automatic
7391 publication is switched on, default value is used for result name.
7394 New GEOM.GEOM_Object with modified wire.
7396 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7397 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7398 self._autoPublish(anObj, theName, "fuseEdges")
7401 ## Change orientation of the given object. Updates given shape.
7402 # @param theObject Shape to be processed.
7403 # @return Updated <var>theObject</var>
7405 # @ref swig_todo "Example"
7406 @ManageTransactions("HealOp")
7407 def ChangeOrientationShell(self,theObject):
7409 Change orientation of the given object. Updates given shape.
7412 theObject Shape to be processed.
7417 theObject = self.HealOp.ChangeOrientation(theObject)
7418 RaiseIfFailed("ChangeOrientation", self.HealOp)
7421 ## Change orientation of the given object.
7422 # @param theObject Shape to be processed.
7423 # @param theName Object name; when specified, this parameter is used
7424 # for result publication in the study. Otherwise, if automatic
7425 # publication is switched on, default value is used for result name.
7427 # @return New GEOM.GEOM_Object, containing processed shape.
7429 # @ref swig_todo "Example"
7430 @ManageTransactions("HealOp")
7431 def ChangeOrientationShellCopy(self, theObject, theName=None):
7433 Change orientation of the given object.
7436 theObject Shape to be processed.
7437 theName Object name; when specified, this parameter is used
7438 for result publication in the study. Otherwise, if automatic
7439 publication is switched on, default value is used for result name.
7442 New GEOM.GEOM_Object, containing processed shape.
7444 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7445 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7446 self._autoPublish(anObj, theName, "reversed")
7449 ## Try to limit tolerance of the given object by value \a theTolerance.
7450 # @param theObject Shape to be processed.
7451 # @param theTolerance Required tolerance value.
7452 # @param theName Object name; when specified, this parameter is used
7453 # for result publication in the study. Otherwise, if automatic
7454 # publication is switched on, default value is used for result name.
7456 # @return New GEOM.GEOM_Object, containing processed shape.
7458 # @ref tui_limit_tolerance "Example"
7459 @ManageTransactions("HealOp")
7460 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7462 Try to limit tolerance of the given object by value theTolerance.
7465 theObject Shape to be processed.
7466 theTolerance Required tolerance value.
7467 theName Object name; when specified, this parameter is used
7468 for result publication in the study. Otherwise, if automatic
7469 publication is switched on, default value is used for result name.
7472 New GEOM.GEOM_Object, containing processed shape.
7474 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7475 RaiseIfFailed("LimitTolerance", self.HealOp)
7476 self._autoPublish(anObj, theName, "limitTolerance")
7479 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7480 # that constitute a free boundary of the given shape.
7481 # @param theObject Shape to get free boundary of.
7482 # @param theName Object name; when specified, this parameter is used
7483 # for result publication in the study. Otherwise, if automatic
7484 # publication is switched on, default value is used for result name.
7486 # @return [\a status, \a theClosedWires, \a theOpenWires]
7487 # \n \a status: FALSE, if an error(s) occurred during the method execution.
7488 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7489 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7491 # @ref tui_free_boundaries_page "Example"
7492 @ManageTransactions("HealOp")
7493 def GetFreeBoundary(self, theObject, theName=None):
7495 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7496 that constitute a free boundary of the given shape.
7499 theObject Shape to get free boundary of.
7500 theName Object name; when specified, this parameter is used
7501 for result publication in the study. Otherwise, if automatic
7502 publication is switched on, default value is used for result name.
7505 [status, theClosedWires, theOpenWires]
7506 status: FALSE, if an error(s) occurred during the method execution.
7507 theClosedWires: Closed wires on the free boundary of the given shape.
7508 theOpenWires: Open wires on the free boundary of the given shape.
7510 # Example: see GEOM_TestHealing.py
7511 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7512 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7513 self._autoPublish(anObj[1], theName, "closedWire")
7514 self._autoPublish(anObj[2], theName, "openWire")
7517 ## Replace coincident faces in \a theShapes by one face.
7518 # @param theShapes Initial shapes, either a list or compound of shapes.
7519 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7520 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7521 # otherwise all initial shapes.
7522 # @param theName Object name; when specified, this parameter is used
7523 # for result publication in the study. Otherwise, if automatic
7524 # publication is switched on, default value is used for result name.
7526 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7528 # @ref tui_glue_faces "Example"
7529 @ManageTransactions("ShapesOp")
7530 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7532 Replace coincident faces in theShapes by one face.
7535 theShapes Initial shapes, either a list or compound of shapes.
7536 theTolerance Maximum distance between faces, which can be considered as coincident.
7537 doKeepNonSolids If FALSE, only solids will present in the result,
7538 otherwise all initial shapes.
7539 theName Object name; when specified, this parameter is used
7540 for result publication in the study. Otherwise, if automatic
7541 publication is switched on, default value is used for result name.
7544 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7546 # Example: see GEOM_Spanner.py
7547 theTolerance,Parameters = ParseParameters(theTolerance)
7548 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7550 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7551 anObj.SetParameters(Parameters)
7552 self._autoPublish(anObj, theName, "glueFaces")
7555 ## Find coincident faces in \a theShapes for possible gluing.
7556 # @param theShapes Initial shapes, either a list or compound of shapes.
7557 # @param theTolerance Maximum distance between faces,
7558 # which can be considered as coincident.
7559 # @param theName Object name; when specified, this parameter is used
7560 # for result publication in the study. Otherwise, if automatic
7561 # publication is switched on, default value is used for result name.
7563 # @return GEOM.ListOfGO
7565 # @ref tui_glue_faces "Example"
7566 @ManageTransactions("ShapesOp")
7567 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7569 Find coincident faces in theShapes for possible gluing.
7572 theShapes Initial shapes, either a list or compound of shapes.
7573 theTolerance Maximum distance between faces,
7574 which can be considered as coincident.
7575 theName Object name; when specified, this parameter is used
7576 for result publication in the study. Otherwise, if automatic
7577 publication is switched on, default value is used for result name.
7582 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7583 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7584 self._autoPublish(anObj, theName, "facesToGlue")
7587 ## Replace coincident faces in \a theShapes by one face
7588 # in compliance with given list of faces
7589 # @param theShapes Initial shapes, either a list or compound of shapes.
7590 # @param theTolerance Maximum distance between faces,
7591 # which can be considered as coincident.
7592 # @param theFaces List of faces for gluing.
7593 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7594 # otherwise all initial shapes.
7595 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7596 # will be glued, otherwise only the edges,
7597 # belonging to <VAR>theFaces</VAR>.
7598 # @param theName Object name; when specified, this parameter is used
7599 # for result publication in the study. Otherwise, if automatic
7600 # publication is switched on, default value is used for result name.
7602 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7604 # @ref tui_glue_faces "Example"
7605 @ManageTransactions("ShapesOp")
7606 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7607 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7609 Replace coincident faces in theShapes by one face
7610 in compliance with given list of faces
7613 theShapes theShapes Initial shapes, either a list or compound of shapes.
7614 theTolerance Maximum distance between faces,
7615 which can be considered as coincident.
7616 theFaces List of faces for gluing.
7617 doKeepNonSolids If FALSE, only solids will present in the result,
7618 otherwise all initial shapes.
7619 doGlueAllEdges If TRUE, all coincident edges of theShape
7620 will be glued, otherwise only the edges,
7621 belonging to theFaces.
7622 theName Object name; when specified, this parameter is used
7623 for result publication in the study. Otherwise, if automatic
7624 publication is switched on, default value is used for result name.
7627 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7629 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7630 doKeepNonSolids, doGlueAllEdges)
7632 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7633 self._autoPublish(anObj, theName, "glueFaces")
7636 ## Replace coincident edges in \a theShapes by one edge.
7637 # @param theShapes Initial shapes, either a list or compound of shapes.
7638 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7639 # @param theName Object name; when specified, this parameter is used
7640 # for result publication in the study. Otherwise, if automatic
7641 # publication is switched on, default value is used for result name.
7643 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7645 # @ref tui_glue_edges "Example"
7646 @ManageTransactions("ShapesOp")
7647 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7649 Replace coincident edges in theShapes by one edge.
7652 theShapes Initial shapes, either a list or compound of shapes.
7653 theTolerance Maximum distance between edges, which can be considered as coincident.
7654 theName Object name; when specified, this parameter is used
7655 for result publication in the study. Otherwise, if automatic
7656 publication is switched on, default value is used for result name.
7659 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7661 theTolerance,Parameters = ParseParameters(theTolerance)
7662 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7664 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7665 anObj.SetParameters(Parameters)
7666 self._autoPublish(anObj, theName, "glueEdges")
7669 ## Find coincident edges in \a theShapes for possible gluing.
7670 # @param theShapes Initial shapes, either a list or compound of shapes.
7671 # @param theTolerance Maximum distance between edges,
7672 # which can be considered as coincident.
7673 # @param theName Object name; when specified, this parameter is used
7674 # for result publication in the study. Otherwise, if automatic
7675 # publication is switched on, default value is used for result name.
7677 # @return GEOM.ListOfGO
7679 # @ref tui_glue_edges "Example"
7680 @ManageTransactions("ShapesOp")
7681 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7683 Find coincident edges in theShapes for possible gluing.
7686 theShapes Initial shapes, either a list or compound of shapes.
7687 theTolerance Maximum distance between edges,
7688 which can be considered as coincident.
7689 theName Object name; when specified, this parameter is used
7690 for result publication in the study. Otherwise, if automatic
7691 publication is switched on, default value is used for result name.
7696 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7697 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7698 self._autoPublish(anObj, theName, "edgesToGlue")
7701 ## Replace coincident edges in theShapes by one edge
7702 # in compliance with given list of edges.
7703 # @param theShapes Initial shapes, either a list or compound of shapes.
7704 # @param theTolerance Maximum distance between edges,
7705 # which can be considered as coincident.
7706 # @param theEdges List of edges for gluing.
7707 # @param theName Object name; when specified, this parameter is used
7708 # for result publication in the study. Otherwise, if automatic
7709 # publication is switched on, default value is used for result name.
7711 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7713 # @ref tui_glue_edges "Example"
7714 @ManageTransactions("ShapesOp")
7715 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7717 Replace coincident edges in theShapes by one edge
7718 in compliance with given list of edges.
7721 theShapes Initial shapes, either a list or compound of shapes.
7722 theTolerance Maximum distance between edges,
7723 which can be considered as coincident.
7724 theEdges List of edges for gluing.
7725 theName Object name; when specified, this parameter is used
7726 for result publication in the study. Otherwise, if automatic
7727 publication is switched on, default value is used for result name.
7730 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7732 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7734 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7735 self._autoPublish(anObj, theName, "glueEdges")
7741 ## @addtogroup l3_boolean Boolean Operations
7744 # -----------------------------------------------------------------------------
7745 # Boolean (Common, Cut, Fuse, Section)
7746 # -----------------------------------------------------------------------------
7748 ## Perform one of boolean operations on two given shapes.
7749 # @param theShape1 First argument for boolean operation.
7750 # @param theShape2 Second argument for boolean operation.
7751 # @param theOperation Indicates the operation to be done:\n
7752 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7753 # @param checkSelfInte The flag that tells if the arguments should
7754 # be checked for self-intersection prior to the operation.
7755 # @param theName Object name; when specified, this parameter is used
7756 # for result publication in the study. Otherwise, if automatic
7757 # publication is switched on, default value is used for result name.
7759 # @note This algorithm doesn't find all types of self-intersections.
7760 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7761 # vertex/face and edge/face intersections. Face/face
7762 # intersections detection is switched off as it is a
7763 # time-consuming operation that gives an impact on performance.
7764 # To find all self-intersections please use
7765 # CheckSelfIntersections() method.
7767 # @return New GEOM.GEOM_Object, containing the result shape.
7769 # @ref tui_fuse "Example"
7770 @ManageTransactions("BoolOp")
7771 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7773 Perform one of boolean operations on two given shapes.
7776 theShape1 First argument for boolean operation.
7777 theShape2 Second argument for boolean operation.
7778 theOperation Indicates the operation to be done:
7779 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7780 checkSelfInte The flag that tells if the arguments should
7781 be checked for self-intersection prior to
7783 theName Object name; when specified, this parameter is used
7784 for result publication in the study. Otherwise, if automatic
7785 publication is switched on, default value is used for result name.
7788 This algorithm doesn't find all types of self-intersections.
7789 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7790 vertex/face and edge/face intersections. Face/face
7791 intersections detection is switched off as it is a
7792 time-consuming operation that gives an impact on performance.
7793 To find all self-intersections please use
7794 CheckSelfIntersections() method.
7797 New GEOM.GEOM_Object, containing the result shape.
7799 # Example: see GEOM_TestAll.py
7800 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7801 RaiseIfFailed("MakeBoolean", self.BoolOp)
7802 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7803 self._autoPublish(anObj, theName, def_names[theOperation])
7806 ## Perform Common boolean operation on two given shapes.
7807 # @param theShape1 First argument for boolean operation.
7808 # @param theShape2 Second argument for boolean operation.
7809 # @param checkSelfInte The flag that tells if the arguments should
7810 # be checked for self-intersection prior to the operation.
7811 # @param theName Object name; when specified, this parameter is used
7812 # for result publication in the study. Otherwise, if automatic
7813 # publication is switched on, default value is used for result name.
7815 # @note This algorithm doesn't find all types of self-intersections.
7816 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7817 # vertex/face and edge/face intersections. Face/face
7818 # intersections detection is switched off as it is a
7819 # time-consuming operation that gives an impact on performance.
7820 # To find all self-intersections please use
7821 # CheckSelfIntersections() method.
7823 # @return New GEOM.GEOM_Object, containing the result shape.
7825 # @ref tui_common "Example 1"
7826 # \n @ref swig_MakeCommon "Example 2"
7827 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7829 Perform Common boolean operation on two given shapes.
7832 theShape1 First argument for boolean operation.
7833 theShape2 Second argument for boolean operation.
7834 checkSelfInte The flag that tells if the arguments should
7835 be checked for self-intersection prior to
7837 theName Object name; when specified, this parameter is used
7838 for result publication in the study. Otherwise, if automatic
7839 publication is switched on, default value is used for result name.
7842 This algorithm doesn't find all types of self-intersections.
7843 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7844 vertex/face and edge/face intersections. Face/face
7845 intersections detection is switched off as it is a
7846 time-consuming operation that gives an impact on performance.
7847 To find all self-intersections please use
7848 CheckSelfIntersections() method.
7851 New GEOM.GEOM_Object, containing the result shape.
7853 # Example: see GEOM_TestOthers.py
7854 # note: auto-publishing is done in self.MakeBoolean()
7855 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7857 ## Perform Cut boolean operation on two given shapes.
7858 # @param theShape1 First argument for boolean operation.
7859 # @param theShape2 Second argument for boolean operation.
7860 # @param checkSelfInte The flag that tells if the arguments should
7861 # be checked for self-intersection prior to the operation.
7862 # @param theName Object name; when specified, this parameter is used
7863 # for result publication in the study. Otherwise, if automatic
7864 # publication is switched on, default value is used for result name.
7866 # @note This algorithm doesn't find all types of self-intersections.
7867 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7868 # vertex/face and edge/face intersections. Face/face
7869 # intersections detection is switched off as it is a
7870 # time-consuming operation that gives an impact on performance.
7871 # To find all self-intersections please use
7872 # CheckSelfIntersections() method.
7874 # @return New GEOM.GEOM_Object, containing the result shape.
7876 # @ref tui_cut "Example 1"
7877 # \n @ref swig_MakeCommon "Example 2"
7878 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7880 Perform Cut boolean operation on two given shapes.
7883 theShape1 First argument for boolean operation.
7884 theShape2 Second argument for boolean operation.
7885 checkSelfInte The flag that tells if the arguments should
7886 be checked for self-intersection prior to
7888 theName Object name; when specified, this parameter is used
7889 for result publication in the study. Otherwise, if automatic
7890 publication is switched on, default value is used for result name.
7893 This algorithm doesn't find all types of self-intersections.
7894 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7895 vertex/face and edge/face intersections. Face/face
7896 intersections detection is switched off as it is a
7897 time-consuming operation that gives an impact on performance.
7898 To find all self-intersections please use
7899 CheckSelfIntersections() method.
7902 New GEOM.GEOM_Object, containing the result shape.
7905 # Example: see GEOM_TestOthers.py
7906 # note: auto-publishing is done in self.MakeBoolean()
7907 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7909 ## Perform Fuse boolean operation on two given shapes.
7910 # @param theShape1 First argument for boolean operation.
7911 # @param theShape2 Second argument for boolean operation.
7912 # @param checkSelfInte The flag that tells if the arguments should
7913 # be checked for self-intersection prior to the operation.
7914 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7915 # operation should be performed during the operation.
7916 # @param theName Object name; when specified, this parameter is used
7917 # for result publication in the study. Otherwise, if automatic
7918 # publication is switched on, default value is used for result name.
7920 # @note This algorithm doesn't find all types of self-intersections.
7921 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7922 # vertex/face and edge/face intersections. Face/face
7923 # intersections detection is switched off as it is a
7924 # time-consuming operation that gives an impact on performance.
7925 # To find all self-intersections please use
7926 # CheckSelfIntersections() method.
7928 # @return New GEOM.GEOM_Object, containing the result shape.
7930 # @ref tui_fuse "Example 1"
7931 # \n @ref swig_MakeCommon "Example 2"
7932 @ManageTransactions("BoolOp")
7933 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7934 rmExtraEdges=False, theName=None):
7936 Perform Fuse boolean operation on two given shapes.
7939 theShape1 First argument for boolean operation.
7940 theShape2 Second argument for boolean operation.
7941 checkSelfInte The flag that tells if the arguments should
7942 be checked for self-intersection prior to
7944 rmExtraEdges The flag that tells if Remove Extra Edges
7945 operation should be performed during the operation.
7946 theName Object name; when specified, this parameter is used
7947 for result publication in the study. Otherwise, if automatic
7948 publication is switched on, default value is used for result name.
7951 This algorithm doesn't find all types of self-intersections.
7952 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7953 vertex/face and edge/face intersections. Face/face
7954 intersections detection is switched off as it is a
7955 time-consuming operation that gives an impact on performance.
7956 To find all self-intersections please use
7957 CheckSelfIntersections() method.
7960 New GEOM.GEOM_Object, containing the result shape.
7963 # Example: see GEOM_TestOthers.py
7964 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7965 checkSelfInte, rmExtraEdges)
7966 RaiseIfFailed("MakeFuse", self.BoolOp)
7967 self._autoPublish(anObj, theName, "fuse")
7970 ## Perform Section boolean operation on two given shapes.
7971 # @param theShape1 First argument for boolean operation.
7972 # @param theShape2 Second argument for boolean operation.
7973 # @param checkSelfInte The flag that tells if the arguments should
7974 # be checked for self-intersection prior to the operation.
7975 # If a self-intersection detected the operation fails.
7976 # @param theName Object name; when specified, this parameter is used
7977 # for result publication in the study. Otherwise, if automatic
7978 # publication is switched on, default value is used for result name.
7979 # @return New GEOM.GEOM_Object, containing the result shape.
7981 # @ref tui_section "Example 1"
7982 # \n @ref swig_MakeCommon "Example 2"
7983 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7985 Perform Section boolean operation on two given shapes.
7988 theShape1 First argument for boolean operation.
7989 theShape2 Second argument for boolean operation.
7990 checkSelfInte The flag that tells if the arguments should
7991 be checked for self-intersection prior to the operation.
7992 If a self-intersection detected the operation fails.
7993 theName Object name; when specified, this parameter is used
7994 for result publication in the study. Otherwise, if automatic
7995 publication is switched on, default value is used for result name.
7997 New GEOM.GEOM_Object, containing the result shape.
8000 # Example: see GEOM_TestOthers.py
8001 # note: auto-publishing is done in self.MakeBoolean()
8002 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
8004 ## Perform Fuse boolean operation on the list of shapes.
8005 # @param theShapesList Shapes to be fused.
8006 # @param checkSelfInte The flag that tells if the arguments should
8007 # be checked for self-intersection prior to the operation.
8008 # @param rmExtraEdges The flag that tells if Remove Extra Edges
8009 # operation should be performed during the operation.
8010 # @param theName Object name; when specified, this parameter is used
8011 # for result publication in the study. Otherwise, if automatic
8012 # publication is switched on, default value is used for result name.
8014 # @note This algorithm doesn't find all types of self-intersections.
8015 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8016 # vertex/face and edge/face intersections. Face/face
8017 # intersections detection is switched off as it is a
8018 # time-consuming operation that gives an impact on performance.
8019 # To find all self-intersections please use
8020 # CheckSelfIntersections() method.
8022 # @return New GEOM.GEOM_Object, containing the result shape.
8024 # @ref tui_fuse "Example 1"
8025 # \n @ref swig_MakeCommon "Example 2"
8026 @ManageTransactions("BoolOp")
8027 def MakeFuseList(self, theShapesList, checkSelfInte=False,
8028 rmExtraEdges=False, theName=None):
8030 Perform Fuse boolean operation on the list of shapes.
8033 theShapesList Shapes to be fused.
8034 checkSelfInte The flag that tells if the arguments should
8035 be checked for self-intersection prior to
8037 rmExtraEdges The flag that tells if Remove Extra Edges
8038 operation should be performed during the operation.
8039 theName Object name; when specified, this parameter is used
8040 for result publication in the study. Otherwise, if automatic
8041 publication is switched on, default value is used for result name.
8044 This algorithm doesn't find all types of self-intersections.
8045 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8046 vertex/face and edge/face intersections. Face/face
8047 intersections detection is switched off as it is a
8048 time-consuming operation that gives an impact on performance.
8049 To find all self-intersections please use
8050 CheckSelfIntersections() method.
8053 New GEOM.GEOM_Object, containing the result shape.
8056 # Example: see GEOM_TestOthers.py
8057 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8059 RaiseIfFailed("MakeFuseList", self.BoolOp)
8060 self._autoPublish(anObj, theName, "fuse")
8063 ## Perform Common boolean operation on the list of shapes.
8064 # @param theShapesList Shapes for Common operation.
8065 # @param checkSelfInte The flag that tells if the arguments should
8066 # be checked for self-intersection prior to the operation.
8067 # @param theName Object name; when specified, this parameter is used
8068 # for result publication in the study. Otherwise, if automatic
8069 # publication is switched on, default value is used for result name.
8071 # @note This algorithm doesn't find all types of self-intersections.
8072 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8073 # vertex/face and edge/face intersections. Face/face
8074 # intersections detection is switched off as it is a
8075 # time-consuming operation that gives an impact on performance.
8076 # To find all self-intersections please use
8077 # CheckSelfIntersections() method.
8079 # @return New GEOM.GEOM_Object, containing the result shape.
8081 # @ref tui_common "Example 1"
8082 # \n @ref swig_MakeCommon "Example 2"
8083 @ManageTransactions("BoolOp")
8084 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8086 Perform Common boolean operation on the list of shapes.
8089 theShapesList Shapes for Common operation.
8090 checkSelfInte The flag that tells if the arguments should
8091 be checked for self-intersection prior to
8093 theName Object name; when specified, this parameter is used
8094 for result publication in the study. Otherwise, if automatic
8095 publication is switched on, default value is used for result name.
8098 This algorithm doesn't find all types of self-intersections.
8099 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8100 vertex/face and edge/face intersections. Face/face
8101 intersections detection is switched off as it is a
8102 time-consuming operation that gives an impact on performance.
8103 To find all self-intersections please use
8104 CheckSelfIntersections() method.
8107 New GEOM.GEOM_Object, containing the result shape.
8110 # Example: see GEOM_TestOthers.py
8111 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8112 RaiseIfFailed("MakeCommonList", self.BoolOp)
8113 self._autoPublish(anObj, theName, "common")
8116 ## Perform Cut boolean operation on one object and the list of tools.
8117 # @param theMainShape The object of the operation.
8118 # @param theShapesList The list of tools of the operation.
8119 # @param checkSelfInte The flag that tells if the arguments should
8120 # be checked for self-intersection prior to the operation.
8121 # @param theName Object name; when specified, this parameter is used
8122 # for result publication in the study. Otherwise, if automatic
8123 # publication is switched on, default value is used for result name.
8125 # @note This algorithm doesn't find all types of self-intersections.
8126 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8127 # vertex/face and edge/face intersections. Face/face
8128 # intersections detection is switched off as it is a
8129 # time-consuming operation that gives an impact on performance.
8130 # To find all self-intersections please use
8131 # CheckSelfIntersections() method.
8133 # @return New GEOM.GEOM_Object, containing the result shape.
8135 # @ref tui_cut "Example 1"
8136 # \n @ref swig_MakeCommon "Example 2"
8137 @ManageTransactions("BoolOp")
8138 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8140 Perform Cut boolean operation on one object and the list of tools.
8143 theMainShape The object of the operation.
8144 theShapesList The list of tools of the operation.
8145 checkSelfInte The flag that tells if the arguments should
8146 be checked for self-intersection prior to
8148 theName Object name; when specified, this parameter is used
8149 for result publication in the study. Otherwise, if automatic
8150 publication is switched on, default value is used for result name.
8153 This algorithm doesn't find all types of self-intersections.
8154 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8155 vertex/face and edge/face intersections. Face/face
8156 intersections detection is switched off as it is a
8157 time-consuming operation that gives an impact on performance.
8158 To find all self-intersections please use
8159 CheckSelfIntersections() method.
8162 New GEOM.GEOM_Object, containing the result shape.
8165 # Example: see GEOM_TestOthers.py
8166 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8167 RaiseIfFailed("MakeCutList", self.BoolOp)
8168 self._autoPublish(anObj, theName, "cut")
8174 ## @addtogroup l3_basic_op
8177 ## Perform partition operation.
8178 # @param ListShapes Shapes to be intersected.
8179 # @param ListTools Shapes to intersect theShapes.
8180 # @param Limit Type of resulting shapes (see ShapeType()).\n
8181 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8182 # type will be detected automatically.
8183 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8184 # target type (equal to Limit) are kept in the result,
8185 # else standalone shapes of lower dimension
8186 # are kept also (if they exist).
8188 # @param theName Object name; when specified, this parameter is used
8189 # for result publication in the study. Otherwise, if automatic
8190 # publication is switched on, default value is used for result name.
8192 # @note Each compound from ListShapes and ListTools will be exploded
8193 # in order to avoid possible intersection between shapes from this compound.
8195 # After implementation new version of PartitionAlgo (October 2006)
8196 # other parameters are ignored by current functionality. They are kept
8197 # in this function only for support old versions.
8198 # @param ListKeepInside Shapes, outside which the results will be deleted.
8199 # Each shape from theKeepInside must belong to theShapes also.
8200 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8201 # Each shape from theRemoveInside must belong to theShapes also.
8202 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8203 # @param ListMaterials Material indices for each shape. Make sense,
8204 # only if theRemoveWebs is TRUE.
8206 # @return New GEOM.GEOM_Object, containing the result shapes.
8208 # @ref tui_partition "Example"
8209 @ManageTransactions("BoolOp")
8210 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8211 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8212 KeepNonlimitShapes=0, theName=None):
8214 Perform partition operation.
8217 ListShapes Shapes to be intersected.
8218 ListTools Shapes to intersect theShapes.
8219 Limit Type of resulting shapes (see geompy.ShapeType)
8220 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8221 type will be detected automatically.
8222 KeepNonlimitShapes if this parameter == 0, then only shapes of
8223 target type (equal to Limit) are kept in the result,
8224 else standalone shapes of lower dimension
8225 are kept also (if they exist).
8227 theName Object name; when specified, this parameter is used
8228 for result publication in the study. Otherwise, if automatic
8229 publication is switched on, default value is used for result name.
8231 Each compound from ListShapes and ListTools will be exploded
8232 in order to avoid possible intersection between shapes from
8235 After implementation new version of PartitionAlgo (October 2006) other
8236 parameters are ignored by current functionality. They are kept in this
8237 function only for support old versions.
8240 ListKeepInside Shapes, outside which the results will be deleted.
8241 Each shape from theKeepInside must belong to theShapes also.
8242 ListRemoveInside Shapes, inside which the results will be deleted.
8243 Each shape from theRemoveInside must belong to theShapes also.
8244 RemoveWebs If TRUE, perform Glue 3D algorithm.
8245 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8248 New GEOM.GEOM_Object, containing the result shapes.
8250 # Example: see GEOM_TestAll.py
8251 if Limit == self.ShapeType["AUTO"]:
8252 # automatic detection of the most appropriate shape limit type
8254 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8255 Limit = EnumToLong(lim)
8257 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8258 ListKeepInside, ListRemoveInside,
8259 Limit, RemoveWebs, ListMaterials,
8260 KeepNonlimitShapes);
8261 RaiseIfFailed("MakePartition", self.BoolOp)
8262 self._autoPublish(anObj, theName, "partition")
8265 ## Perform partition operation.
8266 # This method may be useful if it is needed to make a partition for
8267 # compound contains nonintersected shapes. Performance will be better
8268 # since intersection between shapes from compound is not performed.
8270 # Description of all parameters as in previous method MakePartition().
8271 # One additional parameter is provided:
8272 # @param checkSelfInte The flag that tells if the arguments should
8273 # be checked for self-intersection prior to the operation.
8275 # @note This algorithm doesn't find all types of self-intersections.
8276 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8277 # vertex/face and edge/face intersections. Face/face
8278 # intersections detection is switched off as it is a
8279 # time-consuming operation that gives an impact on performance.
8280 # To find all self-intersections please use
8281 # CheckSelfIntersections() method.
8283 # @note Passed compounds (via ListShapes or via ListTools)
8284 # have to consist of nonintersecting shapes.
8286 # @return New GEOM.GEOM_Object, containing the result shapes.
8288 # @ref swig_todo "Example"
8289 @ManageTransactions("BoolOp")
8290 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8291 ListKeepInside=[], ListRemoveInside=[],
8292 Limit=ShapeType["AUTO"], RemoveWebs=0,
8293 ListMaterials=[], KeepNonlimitShapes=0,
8294 checkSelfInte=False, theName=None):
8296 Perform partition operation.
8297 This method may be useful if it is needed to make a partition for
8298 compound contains nonintersected shapes. Performance will be better
8299 since intersection between shapes from compound is not performed.
8302 Description of all parameters as in method geompy.MakePartition.
8303 One additional parameter is provided:
8304 checkSelfInte The flag that tells if the arguments should
8305 be checked for self-intersection prior to
8309 This algorithm doesn't find all types of self-intersections.
8310 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8311 vertex/face and edge/face intersections. Face/face
8312 intersections detection is switched off as it is a
8313 time-consuming operation that gives an impact on performance.
8314 To find all self-intersections please use
8315 CheckSelfIntersections() method.
8318 Passed compounds (via ListShapes or via ListTools)
8319 have to consist of nonintersecting shapes.
8322 New GEOM.GEOM_Object, containing the result shapes.
8324 if Limit == self.ShapeType["AUTO"]:
8325 # automatic detection of the most appropriate shape limit type
8327 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8328 Limit = EnumToLong(lim)
8330 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8331 ListKeepInside, ListRemoveInside,
8332 Limit, RemoveWebs, ListMaterials,
8333 KeepNonlimitShapes, checkSelfInte);
8334 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8335 self._autoPublish(anObj, theName, "partition")
8338 ## See method MakePartition() for more information.
8340 # @ref tui_partition "Example 1"
8341 # \n @ref swig_Partition "Example 2"
8342 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8343 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8344 KeepNonlimitShapes=0, theName=None):
8346 See method geompy.MakePartition for more information.
8348 # Example: see GEOM_TestOthers.py
8349 # note: auto-publishing is done in self.MakePartition()
8350 anObj = self.MakePartition(ListShapes, ListTools,
8351 ListKeepInside, ListRemoveInside,
8352 Limit, RemoveWebs, ListMaterials,
8353 KeepNonlimitShapes, theName);
8356 ## Perform partition of the Shape with the Plane
8357 # @param theShape Shape to be intersected.
8358 # @param thePlane Tool shape, to intersect theShape.
8359 # @param theName Object name; when specified, this parameter is used
8360 # for result publication in the study. Otherwise, if automatic
8361 # publication is switched on, default value is used for result name.
8363 # @return New GEOM.GEOM_Object, containing the result shape.
8365 # @note This operation is a shortcut to the more general @ref MakePartition
8366 # operation, where @a theShape specifies single "object" (shape being partitioned)
8367 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8368 # @ref MakePartition operation have default values:
8369 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8370 # - @a KeepNonlimitShapes: 0
8371 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8372 # @a Materials (obsolete parameters): empty
8374 # @note I.e. the following two operations are equivalent:
8376 # Result = geompy.MakeHalfPartition(Object, Plane)
8377 # Result = geompy.MakePartition([Object], [Plane])
8380 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8382 # @ref tui_partition "Example"
8383 @ManageTransactions("BoolOp")
8384 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8386 Perform partition of the Shape with the Plane
8389 theShape Shape to be intersected.
8390 thePlane Tool shape, to intersect theShape.
8391 theName Object name; when specified, this parameter is used
8392 for result publication in the study. Otherwise, if automatic
8393 publication is switched on, default value is used for result name.
8396 New GEOM.GEOM_Object, containing the result shape.
8398 Note: This operation is a shortcut to the more general MakePartition
8399 operation, where theShape specifies single "object" (shape being partitioned)
8400 and thePlane specifies single "tool" (intersector shape). Other parameters of
8401 MakePartition operation have default values:
8402 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8403 - KeepNonlimitShapes: 0
8404 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8406 I.e. the following two operations are equivalent:
8407 Result = geompy.MakeHalfPartition(Object, Plane)
8408 Result = geompy.MakePartition([Object], [Plane])
8410 # Example: see GEOM_TestAll.py
8411 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8412 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8413 self._autoPublish(anObj, theName, "partition")
8416 # end of l3_basic_op
8419 ## @addtogroup l3_transform
8422 ## Translate the given object along the vector, specified
8423 # by its end points.
8424 # @param theObject The object to be translated.
8425 # @param thePoint1 Start point of translation vector.
8426 # @param thePoint2 End point of translation vector.
8427 # @param theCopy Flag used to translate object itself or create a copy.
8428 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8429 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8430 @ManageTransactions("TrsfOp")
8431 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8433 Translate the given object along the vector, specified by its end points.
8436 theObject The object to be translated.
8437 thePoint1 Start point of translation vector.
8438 thePoint2 End point of translation vector.
8439 theCopy Flag used to translate object itself or create a copy.
8442 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8443 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8446 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8448 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8449 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8452 ## Translate the given object along the vector, specified
8453 # by its end points, creating its copy before the translation.
8454 # @param theObject The object to be translated.
8455 # @param thePoint1 Start point of translation vector.
8456 # @param thePoint2 End point of translation vector.
8457 # @param theName Object name; when specified, this parameter is used
8458 # for result publication in the study. Otherwise, if automatic
8459 # publication is switched on, default value is used for result name.
8461 # @return New GEOM.GEOM_Object, containing the translated object.
8463 # @ref tui_translation "Example 1"
8464 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8465 @ManageTransactions("TrsfOp")
8466 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8468 Translate the given object along the vector, specified
8469 by its end points, creating its copy before the translation.
8472 theObject The object to be translated.
8473 thePoint1 Start point of translation vector.
8474 thePoint2 End point of translation vector.
8475 theName Object name; when specified, this parameter is used
8476 for result publication in the study. Otherwise, if automatic
8477 publication is switched on, default value is used for result name.
8480 New GEOM.GEOM_Object, containing the translated object.
8482 # Example: see GEOM_TestAll.py
8483 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8484 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8485 self._autoPublish(anObj, theName, "translated")
8488 ## Translate the given object along the vector, specified by its components.
8489 # @param theObject The object to be translated.
8490 # @param theDX,theDY,theDZ Components of translation vector.
8491 # @param theCopy Flag used to translate object itself or create a copy.
8492 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8493 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8495 # @ref tui_translation "Example"
8496 @ManageTransactions("TrsfOp")
8497 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8499 Translate the given object along the vector, specified by its components.
8502 theObject The object to be translated.
8503 theDX,theDY,theDZ Components of translation vector.
8504 theCopy Flag used to translate object itself or create a copy.
8507 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8508 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8510 # Example: see GEOM_TestAll.py
8511 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8513 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8515 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8516 anObj.SetParameters(Parameters)
8517 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8520 ## Translate the given object along the vector, specified
8521 # by its components, creating its copy before the translation.
8522 # @param theObject The object to be translated.
8523 # @param theDX,theDY,theDZ Components of translation vector.
8524 # @param theName Object name; when specified, this parameter is used
8525 # for result publication in the study. Otherwise, if automatic
8526 # publication is switched on, default value is used for result name.
8528 # @return New GEOM.GEOM_Object, containing the translated object.
8530 # @ref tui_translation "Example"
8531 @ManageTransactions("TrsfOp")
8532 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8534 Translate the given object along the vector, specified
8535 by its components, creating its copy before the translation.
8538 theObject The object to be translated.
8539 theDX,theDY,theDZ Components of translation vector.
8540 theName Object name; when specified, this parameter is used
8541 for result publication in the study. Otherwise, if automatic
8542 publication is switched on, default value is used for result name.
8545 New GEOM.GEOM_Object, containing the translated object.
8547 # Example: see GEOM_TestAll.py
8548 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8549 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8550 anObj.SetParameters(Parameters)
8551 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8552 self._autoPublish(anObj, theName, "translated")
8555 ## Translate the given object along the given vector.
8556 # @param theObject The object to be translated.
8557 # @param theVector The translation vector.
8558 # @param theCopy Flag used to translate object itself or create a copy.
8559 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8560 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8561 @ManageTransactions("TrsfOp")
8562 def TranslateVector(self, theObject, theVector, theCopy=False):
8564 Translate the given object along the given vector.
8567 theObject The object to be translated.
8568 theVector The translation vector.
8569 theCopy Flag used to translate object itself or create a copy.
8572 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8573 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8576 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8578 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8579 RaiseIfFailed("TranslateVector", self.TrsfOp)
8582 ## Translate the given object along the given vector,
8583 # creating its copy before the translation.
8584 # @param theObject The object to be translated.
8585 # @param theVector The translation vector.
8586 # @param theName Object name; when specified, this parameter is used
8587 # for result publication in the study. Otherwise, if automatic
8588 # publication is switched on, default value is used for result name.
8590 # @return New GEOM.GEOM_Object, containing the translated object.
8592 # @ref tui_translation "Example"
8593 @ManageTransactions("TrsfOp")
8594 def MakeTranslationVector(self, theObject, theVector, theName=None):
8596 Translate the given object along the given vector,
8597 creating its copy before the translation.
8600 theObject The object to be translated.
8601 theVector The translation vector.
8602 theName Object name; when specified, this parameter is used
8603 for result publication in the study. Otherwise, if automatic
8604 publication is switched on, default value is used for result name.
8607 New GEOM.GEOM_Object, containing the translated object.
8609 # Example: see GEOM_TestAll.py
8610 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8611 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8612 self._autoPublish(anObj, theName, "translated")
8615 ## Translate the given object along the given vector on given distance.
8616 # @param theObject The object to be translated.
8617 # @param theVector The translation vector.
8618 # @param theDistance The translation distance.
8619 # @param theCopy Flag used to translate object itself or create a copy.
8620 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8621 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8623 # @ref tui_translation "Example"
8624 @ManageTransactions("TrsfOp")
8625 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8627 Translate the given object along the given vector on given distance.
8630 theObject The object to be translated.
8631 theVector The translation vector.
8632 theDistance The translation distance.
8633 theCopy Flag used to translate object itself or create a copy.
8636 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8637 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8639 # Example: see GEOM_TestAll.py
8640 theDistance,Parameters = ParseParameters(theDistance)
8641 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8642 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8643 anObj.SetParameters(Parameters)
8646 ## Translate the given object along the given vector on given distance,
8647 # creating its copy before the translation.
8648 # @param theObject The object to be translated.
8649 # @param theVector The translation vector.
8650 # @param theDistance The translation distance.
8651 # @param theName Object name; when specified, this parameter is used
8652 # for result publication in the study. Otherwise, if automatic
8653 # publication is switched on, default value is used for result name.
8655 # @return New GEOM.GEOM_Object, containing the translated object.
8657 # @ref tui_translation "Example"
8658 @ManageTransactions("TrsfOp")
8659 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8661 Translate the given object along the given vector on given distance,
8662 creating its copy before the translation.
8665 theObject The object to be translated.
8666 theVector The translation vector.
8667 theDistance The translation distance.
8668 theName Object name; when specified, this parameter is used
8669 for result publication in the study. Otherwise, if automatic
8670 publication is switched on, default value is used for result name.
8673 New GEOM.GEOM_Object, containing the translated object.
8675 # Example: see GEOM_TestAll.py
8676 theDistance,Parameters = ParseParameters(theDistance)
8677 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8678 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8679 anObj.SetParameters(Parameters)
8680 self._autoPublish(anObj, theName, "translated")
8683 ## Rotate the given object around the given axis on the given angle.
8684 # @param theObject The object to be rotated.
8685 # @param theAxis Rotation axis.
8686 # @param theAngle Rotation angle in radians.
8687 # @param theCopy Flag used to rotate object itself or create a copy.
8689 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8690 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8692 # @ref tui_rotation "Example"
8693 @ManageTransactions("TrsfOp")
8694 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8696 Rotate the given object around the given axis on the given angle.
8699 theObject The object to be rotated.
8700 theAxis Rotation axis.
8701 theAngle Rotation angle in radians.
8702 theCopy Flag used to rotate object itself or create a copy.
8705 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8706 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8708 # Example: see GEOM_TestAll.py
8710 if isinstance(theAngle,str):
8712 theAngle, Parameters = ParseParameters(theAngle)
8714 theAngle = theAngle*math.pi/180.0
8716 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8718 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8719 RaiseIfFailed("Rotate", self.TrsfOp)
8720 anObj.SetParameters(Parameters)
8723 ## Rotate the given object around the given axis
8724 # on the given angle, creating its copy before the rotation.
8725 # @param theObject The object to be rotated.
8726 # @param theAxis Rotation axis.
8727 # @param theAngle Rotation angle in radians.
8728 # @param theName Object name; when specified, this parameter is used
8729 # for result publication in the study. Otherwise, if automatic
8730 # publication is switched on, default value is used for result name.
8732 # @return New GEOM.GEOM_Object, containing the rotated object.
8734 # @ref tui_rotation "Example"
8735 @ManageTransactions("TrsfOp")
8736 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8738 Rotate the given object around the given axis
8739 on the given angle, creating its copy before the rotatation.
8742 theObject The object to be rotated.
8743 theAxis Rotation axis.
8744 theAngle Rotation angle in radians.
8745 theName Object name; when specified, this parameter is used
8746 for result publication in the study. Otherwise, if automatic
8747 publication is switched on, default value is used for result name.
8750 New GEOM.GEOM_Object, containing the rotated object.
8752 # Example: see GEOM_TestAll.py
8754 if isinstance(theAngle,str):
8756 theAngle, Parameters = ParseParameters(theAngle)
8758 theAngle = theAngle*math.pi/180.0
8759 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8760 RaiseIfFailed("RotateCopy", self.TrsfOp)
8761 anObj.SetParameters(Parameters)
8762 self._autoPublish(anObj, theName, "rotated")
8765 ## Rotate given object around vector perpendicular to plane
8766 # containing three points.
8767 # @param theObject The object to be rotated.
8768 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8769 # containing the three points.
8770 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8771 # @param theCopy Flag used to rotate object itself or create a copy.
8772 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8773 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8774 @ManageTransactions("TrsfOp")
8775 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8777 Rotate given object around vector perpendicular to plane
8778 containing three points.
8781 theObject The object to be rotated.
8782 theCentPoint central point the axis is the vector perpendicular to the plane
8783 containing the three points.
8784 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8785 theCopy Flag used to rotate object itself or create a copy.
8788 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8789 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8792 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8794 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8795 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8798 ## Rotate given object around vector perpendicular to plane
8799 # containing three points, creating its copy before the rotatation.
8800 # @param theObject The object to be rotated.
8801 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8802 # containing the three points.
8803 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8804 # @param theName Object name; when specified, this parameter is used
8805 # for result publication in the study. Otherwise, if automatic
8806 # publication is switched on, default value is used for result name.
8808 # @return New GEOM.GEOM_Object, containing the rotated object.
8810 # @ref tui_rotation "Example"
8811 @ManageTransactions("TrsfOp")
8812 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8814 Rotate given object around vector perpendicular to plane
8815 containing three points, creating its copy before the rotatation.
8818 theObject The object to be rotated.
8819 theCentPoint central point the axis is the vector perpendicular to the plane
8820 containing the three points.
8821 thePoint1,thePoint2 in a perpendicular plane of the axis.
8822 theName Object name; when specified, this parameter is used
8823 for result publication in the study. Otherwise, if automatic
8824 publication is switched on, default value is used for result name.
8827 New GEOM.GEOM_Object, containing the rotated object.
8829 # Example: see GEOM_TestAll.py
8830 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8831 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8832 self._autoPublish(anObj, theName, "rotated")
8835 ## Scale the given object by the specified factor.
8836 # @param theObject The object to be scaled.
8837 # @param thePoint Center point for scaling.
8838 # Passing None for it means scaling relatively the origin of global CS.
8839 # @param theFactor Scaling factor value.
8840 # @param theCopy Flag used to scale object itself or create a copy.
8841 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8842 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8843 @ManageTransactions("TrsfOp")
8844 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8846 Scale the given object by the specified factor.
8849 theObject The object to be scaled.
8850 thePoint Center point for scaling.
8851 Passing None for it means scaling relatively the origin of global CS.
8852 theFactor Scaling factor value.
8853 theCopy Flag used to scale object itself or create a copy.
8856 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8857 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8859 # Example: see GEOM_TestAll.py
8860 theFactor, Parameters = ParseParameters(theFactor)
8862 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8864 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8865 RaiseIfFailed("Scale", self.TrsfOp)
8866 anObj.SetParameters(Parameters)
8869 ## Scale the given object by the factor, creating its copy before the scaling.
8870 # @param theObject The object to be scaled.
8871 # @param thePoint Center point for scaling.
8872 # Passing None for it means scaling relatively the origin of global CS.
8873 # @param theFactor Scaling factor value.
8874 # @param theName Object name; when specified, this parameter is used
8875 # for result publication in the study. Otherwise, if automatic
8876 # publication is switched on, default value is used for result name.
8878 # @return New GEOM.GEOM_Object, containing the scaled shape.
8880 # @ref tui_scale "Example"
8881 @ManageTransactions("TrsfOp")
8882 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8884 Scale the given object by the factor, creating its copy before the scaling.
8887 theObject The object to be scaled.
8888 thePoint Center point for scaling.
8889 Passing None for it means scaling relatively the origin of global CS.
8890 theFactor Scaling factor value.
8891 theName Object name; when specified, this parameter is used
8892 for result publication in the study. Otherwise, if automatic
8893 publication is switched on, default value is used for result name.
8896 New GEOM.GEOM_Object, containing the scaled shape.
8898 # Example: see GEOM_TestAll.py
8899 theFactor, Parameters = ParseParameters(theFactor)
8900 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8901 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8902 anObj.SetParameters(Parameters)
8903 self._autoPublish(anObj, theName, "scaled")
8906 ## Scale the given object by different factors along coordinate axes.
8907 # @param theObject The object to be scaled.
8908 # @param thePoint Center point for scaling.
8909 # Passing None for it means scaling relatively the origin of global CS.
8910 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8911 # @param theCopy Flag used to scale object itself or create a copy.
8912 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8913 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8914 @ManageTransactions("TrsfOp")
8915 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8917 Scale the given object by different factors along coordinate axes.
8920 theObject The object to be scaled.
8921 thePoint Center point for scaling.
8922 Passing None for it means scaling relatively the origin of global CS.
8923 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8924 theCopy Flag used to scale object itself or create a copy.
8927 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8928 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8930 # Example: see GEOM_TestAll.py
8931 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8933 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8934 theFactorX, theFactorY, theFactorZ)
8936 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8937 theFactorX, theFactorY, theFactorZ)
8938 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8939 anObj.SetParameters(Parameters)
8942 ## Scale the given object by different factors along coordinate axes,
8943 # creating its copy before the scaling.
8944 # @param theObject The object to be scaled.
8945 # @param thePoint Center point for scaling.
8946 # Passing None for it means scaling relatively the origin of global CS.
8947 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8948 # @param theName Object name; when specified, this parameter is used
8949 # for result publication in the study. Otherwise, if automatic
8950 # publication is switched on, default value is used for result name.
8952 # @return New GEOM.GEOM_Object, containing the scaled shape.
8954 # @ref swig_scale "Example"
8955 @ManageTransactions("TrsfOp")
8956 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8958 Scale the given object by different factors along coordinate axes,
8959 creating its copy before the scaling.
8962 theObject The object to be scaled.
8963 thePoint Center point for scaling.
8964 Passing None for it means scaling relatively the origin of global CS.
8965 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8966 theName Object name; when specified, this parameter is used
8967 for result publication in the study. Otherwise, if automatic
8968 publication is switched on, default value is used for result name.
8971 New GEOM.GEOM_Object, containing the scaled shape.
8973 # Example: see GEOM_TestAll.py
8974 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8975 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8976 theFactorX, theFactorY, theFactorZ)
8977 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8978 anObj.SetParameters(Parameters)
8979 self._autoPublish(anObj, theName, "scaled")
8982 ## Mirror an object relatively the given plane.
8983 # @param theObject The object to be mirrored.
8984 # @param thePlane Plane of symmetry.
8985 # @param theCopy Flag used to mirror object itself or create a copy.
8986 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8987 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8988 @ManageTransactions("TrsfOp")
8989 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8991 Mirror an object relatively the given plane.
8994 theObject The object to be mirrored.
8995 thePlane Plane of symmetry.
8996 theCopy Flag used to mirror object itself or create a copy.
8999 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9000 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9003 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9005 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
9006 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
9009 ## Create an object, symmetrical
9010 # to the given one relatively the given plane.
9011 # @param theObject The object to be mirrored.
9012 # @param thePlane Plane of symmetry.
9013 # @param theName Object name; when specified, this parameter is used
9014 # for result publication in the study. Otherwise, if automatic
9015 # publication is switched on, default value is used for result name.
9017 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9019 # @ref tui_mirror "Example"
9020 @ManageTransactions("TrsfOp")
9021 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9023 Create an object, symmetrical to the given one relatively the given plane.
9026 theObject The object to be mirrored.
9027 thePlane Plane of symmetry.
9028 theName Object name; when specified, this parameter is used
9029 for result publication in the study. Otherwise, if automatic
9030 publication is switched on, default value is used for result name.
9033 New GEOM.GEOM_Object, containing the mirrored shape.
9035 # Example: see GEOM_TestAll.py
9036 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9037 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9038 self._autoPublish(anObj, theName, "mirrored")
9041 ## Mirror an object relatively the given axis.
9042 # @param theObject The object to be mirrored.
9043 # @param theAxis Axis of symmetry.
9044 # @param theCopy Flag used to mirror object itself or create a copy.
9045 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9046 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9047 @ManageTransactions("TrsfOp")
9048 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9050 Mirror an object relatively the given axis.
9053 theObject The object to be mirrored.
9054 theAxis Axis of symmetry.
9055 theCopy Flag used to mirror object itself or create a copy.
9058 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9059 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9062 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9064 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9065 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9068 ## Create an object, symmetrical
9069 # to the given one relatively the given axis.
9070 # @param theObject The object to be mirrored.
9071 # @param theAxis Axis of symmetry.
9072 # @param theName Object name; when specified, this parameter is used
9073 # for result publication in the study. Otherwise, if automatic
9074 # publication is switched on, default value is used for result name.
9076 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9078 # @ref tui_mirror "Example"
9079 @ManageTransactions("TrsfOp")
9080 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9082 Create an object, symmetrical to the given one relatively the given axis.
9085 theObject The object to be mirrored.
9086 theAxis Axis of symmetry.
9087 theName Object name; when specified, this parameter is used
9088 for result publication in the study. Otherwise, if automatic
9089 publication is switched on, default value is used for result name.
9092 New GEOM.GEOM_Object, containing the mirrored shape.
9094 # Example: see GEOM_TestAll.py
9095 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9096 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9097 self._autoPublish(anObj, theName, "mirrored")
9100 ## Mirror an object relatively the given point.
9101 # @param theObject The object to be mirrored.
9102 # @param thePoint Point of symmetry.
9103 # @param theCopy Flag used to mirror object itself or create a copy.
9104 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9105 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9106 @ManageTransactions("TrsfOp")
9107 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9109 Mirror an object relatively the given point.
9112 theObject The object to be mirrored.
9113 thePoint Point of symmetry.
9114 theCopy Flag used to mirror object itself or create a copy.
9117 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9118 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9120 # Example: see GEOM_TestAll.py
9122 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9124 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9125 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9128 ## Create an object, symmetrical
9129 # to the given one relatively the given point.
9130 # @param theObject The object to be mirrored.
9131 # @param thePoint Point of symmetry.
9132 # @param theName Object name; when specified, this parameter is used
9133 # for result publication in the study. Otherwise, if automatic
9134 # publication is switched on, default value is used for result name.
9136 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9138 # @ref tui_mirror "Example"
9139 @ManageTransactions("TrsfOp")
9140 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9142 Create an object, symmetrical
9143 to the given one relatively the given point.
9146 theObject The object to be mirrored.
9147 thePoint Point of symmetry.
9148 theName Object name; when specified, this parameter is used
9149 for result publication in the study. Otherwise, if automatic
9150 publication is switched on, default value is used for result name.
9153 New GEOM.GEOM_Object, containing the mirrored shape.
9155 # Example: see GEOM_TestAll.py
9156 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9157 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9158 self._autoPublish(anObj, theName, "mirrored")
9161 ## Modify the location of the given object.
9162 # @param theObject The object to be displaced.
9163 # @param theStartLCS Coordinate system to perform displacement from it.\n
9164 # If \a theStartLCS is NULL, displacement
9165 # will be performed from global CS.\n
9166 # If \a theObject itself is used as \a theStartLCS,
9167 # its location will be changed to \a theEndLCS.
9168 # @param theEndLCS Coordinate system to perform displacement to it.
9169 # @param theCopy Flag used to displace object itself or create a copy.
9170 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9171 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9172 @ManageTransactions("TrsfOp")
9173 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9175 Modify the Location of the given object by LCS, creating its copy before the setting.
9178 theObject The object to be displaced.
9179 theStartLCS Coordinate system to perform displacement from it.
9180 If theStartLCS is NULL, displacement
9181 will be performed from global CS.
9182 If theObject itself is used as theStartLCS,
9183 its location will be changed to theEndLCS.
9184 theEndLCS Coordinate system to perform displacement to it.
9185 theCopy Flag used to displace object itself or create a copy.
9188 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9189 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9191 # Example: see GEOM_TestAll.py
9193 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9195 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9196 RaiseIfFailed("Displace", self.TrsfOp)
9199 ## Modify the Location of the given object by LCS,
9200 # creating its copy before the setting.
9201 # @param theObject The object to be displaced.
9202 # @param theStartLCS Coordinate system to perform displacement from it.\n
9203 # If \a theStartLCS is NULL, displacement
9204 # will be performed from global CS.\n
9205 # If \a theObject itself is used as \a theStartLCS,
9206 # its location will be changed to \a theEndLCS.
9207 # @param theEndLCS Coordinate system to perform displacement to it.
9208 # @param theName Object name; when specified, this parameter is used
9209 # for result publication in the study. Otherwise, if automatic
9210 # publication is switched on, default value is used for result name.
9212 # @return New GEOM.GEOM_Object, containing the displaced shape.
9214 # @ref tui_modify_location "Example"
9215 @ManageTransactions("TrsfOp")
9216 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9218 Modify the Location of the given object by LCS, creating its copy before the setting.
9221 theObject The object to be displaced.
9222 theStartLCS Coordinate system to perform displacement from it.
9223 If theStartLCS is NULL, displacement
9224 will be performed from global CS.
9225 If theObject itself is used as theStartLCS,
9226 its location will be changed to theEndLCS.
9227 theEndLCS Coordinate system to perform displacement to it.
9228 theName Object name; when specified, this parameter is used
9229 for result publication in the study. Otherwise, if automatic
9230 publication is switched on, default value is used for result name.
9233 New GEOM.GEOM_Object, containing the displaced shape.
9236 # create local coordinate systems
9237 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9238 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9239 # modify the location of the given object
9240 position = geompy.MakePosition(cylinder, cs1, cs2)
9242 # Example: see GEOM_TestAll.py
9243 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9244 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9245 self._autoPublish(anObj, theName, "displaced")
9248 ## Modify the Location of the given object by Path.
9249 # @param theObject The object to be displaced.
9250 # @param thePath Wire or Edge along that the object will be translated.
9251 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9252 # @param theCopy is to create a copy objects if true.
9253 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9254 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9255 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9257 # @ref tui_modify_location "Example"
9258 @ManageTransactions("TrsfOp")
9259 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9261 Modify the Location of the given object by Path.
9264 theObject The object to be displaced.
9265 thePath Wire or Edge along that the object will be translated.
9266 theDistance progress of Path (0 = start location, 1 = end of path location).
9267 theCopy is to create a copy objects if true.
9268 theReverse 0 - for usual direction, 1 - to reverse path direction.
9271 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9272 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9275 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9277 # Example: see GEOM_TestAll.py
9278 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9279 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9282 ## Modify the Location of the given object by Path, creating its copy before the operation.
9283 # @param theObject The object to be displaced.
9284 # @param thePath Wire or Edge along that the object will be translated.
9285 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9286 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9287 # @param theName Object name; when specified, this parameter is used
9288 # for result publication in the study. Otherwise, if automatic
9289 # publication is switched on, default value is used for result name.
9291 # @return New GEOM.GEOM_Object, containing the displaced shape.
9292 @ManageTransactions("TrsfOp")
9293 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9295 Modify the Location of the given object by Path, creating its copy before the operation.
9298 theObject The object to be displaced.
9299 thePath Wire or Edge along that the object will be translated.
9300 theDistance progress of Path (0 = start location, 1 = end of path location).
9301 theReverse 0 - for usual direction, 1 - to reverse path direction.
9302 theName Object name; when specified, this parameter is used
9303 for result publication in the study. Otherwise, if automatic
9304 publication is switched on, default value is used for result name.
9307 New GEOM.GEOM_Object, containing the displaced shape.
9309 # Example: see GEOM_TestAll.py
9310 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9311 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9312 self._autoPublish(anObj, theName, "displaced")
9315 ## Offset given shape.
9316 # @param theObject The base object for the offset.
9317 # @param theOffset Offset value.
9318 # @param theCopy Flag used to offset object itself or create a copy.
9319 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9320 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9321 @ManageTransactions("TrsfOp")
9322 def Offset(self, theObject, theOffset, theCopy=False):
9327 theObject The base object for the offset.
9328 theOffset Offset value.
9329 theCopy Flag used to offset object itself or create a copy.
9332 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9333 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9335 theOffset, Parameters = ParseParameters(theOffset)
9337 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9339 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9340 RaiseIfFailed("Offset", self.TrsfOp)
9341 anObj.SetParameters(Parameters)
9344 ## Create new object as offset of the given one. Gap between two adjacent
9345 # offset surfaces is filled by a pipe.
9346 # @param theObject The base object for the offset.
9347 # @param theOffset Offset value.
9348 # @param theName Object name; when specified, this parameter is used
9349 # for result publication in the study. Otherwise, if automatic
9350 # publication is switched on, default value is used for result name.
9352 # @return New GEOM.GEOM_Object, containing the offset object.
9354 # @sa MakeOffsetIntersectionJoin
9355 # @ref tui_offset "Example"
9356 @ManageTransactions("TrsfOp")
9357 def MakeOffset(self, theObject, theOffset, theName=None):
9359 Create new object as offset of the given one. Gap between adjacent
9360 offset surfaces is filled by a pipe.
9363 theObject The base object for the offset.
9364 theOffset Offset value.
9365 theName Object name; when specified, this parameter is used
9366 for result publication in the study. Otherwise, if automatic
9367 publication is switched on, default value is used for result name.
9370 New GEOM.GEOM_Object, containing the offset object.
9373 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9374 # create a new object as offset of the given object
9375 offset = geompy.MakeOffset(box, 70.)
9377 # Example: see GEOM_TestAll.py
9378 theOffset, Parameters = ParseParameters(theOffset)
9379 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9380 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9381 anObj.SetParameters(Parameters)
9382 self._autoPublish(anObj, theName, "offset")
9385 ## Create new object as offset of the given one. Gap between adjacent
9386 # offset surfaces is filled by extending and intersecting them.
9387 # @param theObject The base object for the offset.
9388 # @param theOffset Offset value.
9389 # @param theName Object name; when specified, this parameter is used
9390 # for result publication in the study. Otherwise, if automatic
9391 # publication is switched on, default value is used for result name.
9393 # @return New GEOM.GEOM_Object, containing the offset object.
9396 # @ref tui_offset "Example"
9397 @ManageTransactions("TrsfOp")
9398 def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9400 Create new object as offset of the given one. Gap between adjacent
9401 offset surfaces is filled by extending and intersecting them.
9404 theObject The base object for the offset.
9405 theOffset Offset value.
9406 theName Object name; when specified, this parameter is used
9407 for result publication in the study. Otherwise, if automatic
9408 publication is switched on, default value is used for result name.
9411 New GEOM.GEOM_Object, containing the offset object.
9414 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9415 # create a new box extended by 70
9416 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9418 # Example: see GEOM_TestAll.py
9419 theOffset, Parameters = ParseParameters( theOffset )
9420 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9421 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9422 anObj.SetParameters(Parameters)
9423 self._autoPublish(anObj, theName, "offset")
9426 ## Create new object as projection of the given one on another.
9427 # @param theSource The source object for the projection. It can be a point, edge or wire.
9428 # Edge and wire are acceptable if @a theTarget is a face.
9429 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9430 # @param theName Object name; when specified, this parameter is used
9431 # for result publication in the study. Otherwise, if automatic
9432 # publication is switched on, default value is used for result name.
9434 # @return New GEOM.GEOM_Object, containing the projection.
9436 # @ref tui_projection "Example"
9437 @ManageTransactions("TrsfOp")
9438 def MakeProjection(self, theSource, theTarget, theName=None):
9440 Create new object as projection of the given one on another.
9443 theSource The source object for the projection. It can be a point, edge or wire.
9444 Edge and wire are acceptable if theTarget is a face.
9445 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9446 theName Object name; when specified, this parameter is used
9447 for result publication in the study. Otherwise, if automatic
9448 publication is switched on, default value is used for result name.
9451 New GEOM.GEOM_Object, containing the projection.
9453 # Example: see GEOM_TestAll.py
9454 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9455 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9456 self._autoPublish(anObj, theName, "projection")
9459 ## Create a projection of the given point on a wire or an edge.
9460 # If there are no solutions or there are 2 or more solutions It throws an
9462 # @param thePoint the point to be projected.
9463 # @param theWire the wire. The edge is accepted as well.
9464 # @param theName Object name; when specified, this parameter is used
9465 # for result publication in the study. Otherwise, if automatic
9466 # publication is switched on, default value is used for result name.
9468 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9469 # \n \a u: The parameter of projection point on edge.
9470 # \n \a PointOnEdge: The projection point.
9471 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9473 # @ref tui_projection "Example"
9474 @ManageTransactions("TrsfOp")
9475 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9477 Create a projection of the given point on a wire or an edge.
9478 If there are no solutions or there are 2 or more solutions It throws an
9482 thePoint the point to be projected.
9483 theWire the wire. The edge is accepted as well.
9484 theName Object name; when specified, this parameter is used
9485 for result publication in the study. Otherwise, if automatic
9486 publication is switched on, default value is used for result name.
9489 [u, PointOnEdge, EdgeInWireIndex]
9490 u: The parameter of projection point on edge.
9491 PointOnEdge: The projection point.
9492 EdgeInWireIndex: The index of an edge in a wire.
9494 # Example: see GEOM_TestAll.py
9495 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9496 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9497 self._autoPublish(anObj[1], theName, "projection")
9500 # -----------------------------------------------------------------------------
9502 # -----------------------------------------------------------------------------
9504 ## Translate the given object along the given vector a given number times
9505 # @param theObject The object to be translated.
9506 # @param theVector Direction of the translation. DX if None.
9507 # @param theStep Distance to translate on.
9508 # @param theNbTimes Quantity of translations to be done.
9509 # @param theName Object name; when specified, this parameter is used
9510 # for result publication in the study. Otherwise, if automatic
9511 # publication is switched on, default value is used for result name.
9513 # @return New GEOM.GEOM_Object, containing compound of all
9514 # the shapes, obtained after each translation.
9516 # @ref tui_multi_translation "Example"
9517 @ManageTransactions("TrsfOp")
9518 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9520 Translate the given object along the given vector a given number times
9523 theObject The object to be translated.
9524 theVector Direction of the translation. DX if None.
9525 theStep Distance to translate on.
9526 theNbTimes Quantity of translations to be done.
9527 theName Object name; when specified, this parameter is used
9528 for result publication in the study. Otherwise, if automatic
9529 publication is switched on, default value is used for result name.
9532 New GEOM.GEOM_Object, containing compound of all
9533 the shapes, obtained after each translation.
9536 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9538 # Example: see GEOM_TestAll.py
9539 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9540 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9541 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9542 anObj.SetParameters(Parameters)
9543 self._autoPublish(anObj, theName, "multitranslation")
9546 ## Conseqently apply two specified translations to theObject specified number of times.
9547 # @param theObject The object to be translated.
9548 # @param theVector1 Direction of the first translation. DX if None.
9549 # @param theStep1 Step of the first translation.
9550 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9551 # @param theVector2 Direction of the second translation. DY if None.
9552 # @param theStep2 Step of the second translation.
9553 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9554 # @param theName Object name; when specified, this parameter is used
9555 # for result publication in the study. Otherwise, if automatic
9556 # publication is switched on, default value is used for result name.
9558 # @return New GEOM.GEOM_Object, containing compound of all
9559 # the shapes, obtained after each translation.
9561 # @ref tui_multi_translation "Example"
9562 @ManageTransactions("TrsfOp")
9563 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9564 theVector2, theStep2, theNbTimes2, theName=None):
9566 Conseqently apply two specified translations to theObject specified number of times.
9569 theObject The object to be translated.
9570 theVector1 Direction of the first translation. DX if None.
9571 theStep1 Step of the first translation.
9572 theNbTimes1 Quantity of translations to be done along theVector1.
9573 theVector2 Direction of the second translation. DY if None.
9574 theStep2 Step of the second translation.
9575 theNbTimes2 Quantity of translations to be done along theVector2.
9576 theName Object name; when specified, this parameter is used
9577 for result publication in the study. Otherwise, if automatic
9578 publication is switched on, default value is used for result name.
9581 New GEOM.GEOM_Object, containing compound of all
9582 the shapes, obtained after each translation.
9585 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9587 # Example: see GEOM_TestAll.py
9588 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9589 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9590 theVector2, theStep2, theNbTimes2)
9591 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9592 anObj.SetParameters(Parameters)
9593 self._autoPublish(anObj, theName, "multitranslation")
9596 ## Rotate the given object around the given axis a given number times.
9597 # Rotation angle will be 2*PI/theNbTimes.
9598 # @param theObject The object to be rotated.
9599 # @param theAxis The rotation axis. DZ if None.
9600 # @param theNbTimes Quantity of rotations to be done.
9601 # @param theName Object name; when specified, this parameter is used
9602 # for result publication in the study. Otherwise, if automatic
9603 # publication is switched on, default value is used for result name.
9605 # @return New GEOM.GEOM_Object, containing compound of all the
9606 # shapes, obtained after each rotation.
9608 # @ref tui_multi_rotation "Example"
9609 @ManageTransactions("TrsfOp")
9610 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9612 Rotate the given object around the given axis a given number times.
9613 Rotation angle will be 2*PI/theNbTimes.
9616 theObject The object to be rotated.
9617 theAxis The rotation axis. DZ if None.
9618 theNbTimes Quantity of rotations to be done.
9619 theName Object name; when specified, this parameter is used
9620 for result publication in the study. Otherwise, if automatic
9621 publication is switched on, default value is used for result name.
9624 New GEOM.GEOM_Object, containing compound of all the
9625 shapes, obtained after each rotation.
9628 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9630 # Example: see GEOM_TestAll.py
9631 theNbTimes, Parameters = ParseParameters(theNbTimes)
9632 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9633 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9634 anObj.SetParameters(Parameters)
9635 self._autoPublish(anObj, theName, "multirotation")
9638 ## Rotate the given object around the given axis
9639 # a given number times on the given angle.
9640 # @param theObject The object to be rotated.
9641 # @param theAxis The rotation axis. DZ if None.
9642 # @param theAngleStep Rotation angle in radians.
9643 # @param theNbTimes Quantity of rotations to be done.
9644 # @param theName Object name; when specified, this parameter is used
9645 # for result publication in the study. Otherwise, if automatic
9646 # publication is switched on, default value is used for result name.
9648 # @return New GEOM.GEOM_Object, containing compound of all the
9649 # shapes, obtained after each rotation.
9651 # @ref tui_multi_rotation "Example"
9652 @ManageTransactions("TrsfOp")
9653 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9655 Rotate the given object around the given axis
9656 a given number times on the given angle.
9659 theObject The object to be rotated.
9660 theAxis The rotation axis. DZ if None.
9661 theAngleStep Rotation angle in radians.
9662 theNbTimes Quantity of rotations to be done.
9663 theName Object name; when specified, this parameter is used
9664 for result publication in the study. Otherwise, if automatic
9665 publication is switched on, default value is used for result name.
9668 New GEOM.GEOM_Object, containing compound of all the
9669 shapes, obtained after each rotation.
9672 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9674 # Example: see GEOM_TestAll.py
9675 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9676 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9677 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9678 anObj.SetParameters(Parameters)
9679 self._autoPublish(anObj, theName, "multirotation")
9682 ## Rotate the given object around the given axis a given
9683 # number times and multi-translate each rotation result.
9684 # Rotation angle will be 2*PI/theNbTimes1.
9685 # Translation direction passes through center of gravity
9686 # of rotated shape and its projection on the rotation axis.
9687 # @param theObject The object to be rotated.
9688 # @param theAxis Rotation axis. DZ if None.
9689 # @param theNbTimes1 Quantity of rotations to be done.
9690 # @param theRadialStep Translation distance.
9691 # @param theNbTimes2 Quantity of translations to be done.
9692 # @param theName Object name; when specified, this parameter is used
9693 # for result publication in the study. Otherwise, if automatic
9694 # publication is switched on, default value is used for result name.
9696 # @return New GEOM.GEOM_Object, containing compound of all the
9697 # shapes, obtained after each transformation.
9699 # @ref tui_multi_rotation "Example"
9700 @ManageTransactions("TrsfOp")
9701 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9703 Rotate the given object around the
9704 given axis on the given angle a given number
9705 times and multi-translate each rotation result.
9706 Translation direction passes through center of gravity
9707 of rotated shape and its projection on the rotation axis.
9710 theObject The object to be rotated.
9711 theAxis Rotation axis. DZ if None.
9712 theNbTimes1 Quantity of rotations to be done.
9713 theRadialStep Translation distance.
9714 theNbTimes2 Quantity of translations to be done.
9715 theName Object name; when specified, this parameter is used
9716 for result publication in the study. Otherwise, if automatic
9717 publication is switched on, default value is used for result name.
9720 New GEOM.GEOM_Object, containing compound of all the
9721 shapes, obtained after each transformation.
9724 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9726 # Example: see GEOM_TestAll.py
9727 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9728 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9729 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9730 anObj.SetParameters(Parameters)
9731 self._autoPublish(anObj, theName, "multirotation")
9734 ## Rotate the given object around the
9735 # given axis on the given angle a given number
9736 # times and multi-translate each rotation result.
9737 # Translation direction passes through center of gravity
9738 # of rotated shape and its projection on the rotation axis.
9739 # @param theObject The object to be rotated.
9740 # @param theAxis Rotation axis. DZ if None.
9741 # @param theAngleStep Rotation angle in radians.
9742 # @param theNbTimes1 Quantity of rotations to be done.
9743 # @param theRadialStep Translation distance.
9744 # @param theNbTimes2 Quantity of translations to be done.
9745 # @param theName Object name; when specified, this parameter is used
9746 # for result publication in the study. Otherwise, if automatic
9747 # publication is switched on, default value is used for result name.
9749 # @return New GEOM.GEOM_Object, containing compound of all the
9750 # shapes, obtained after each transformation.
9752 # @ref tui_multi_rotation "Example"
9753 @ManageTransactions("TrsfOp")
9754 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9756 Rotate the given object around the
9757 given axis on the given angle a given number
9758 times and multi-translate each rotation result.
9759 Translation direction passes through center of gravity
9760 of rotated shape and its projection on the rotation axis.
9763 theObject The object to be rotated.
9764 theAxis Rotation axis. DZ if None.
9765 theAngleStep Rotation angle in radians.
9766 theNbTimes1 Quantity of rotations to be done.
9767 theRadialStep Translation distance.
9768 theNbTimes2 Quantity of translations to be done.
9769 theName Object name; when specified, this parameter is used
9770 for result publication in the study. Otherwise, if automatic
9771 publication is switched on, default value is used for result name.
9774 New GEOM.GEOM_Object, containing compound of all the
9775 shapes, obtained after each transformation.
9778 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9780 # Example: see GEOM_TestAll.py
9781 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9782 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9783 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9784 anObj.SetParameters(Parameters)
9785 self._autoPublish(anObj, theName, "multirotation")
9788 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9790 # @ref swig_MakeMultiRotation "Example"
9791 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9793 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9796 pz = geompy.MakeVertex(0, 0, 100)
9797 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9798 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9800 # Example: see GEOM_TestOthers.py
9801 aVec = self.MakeLine(aPoint,aDir)
9802 # note: auto-publishing is done in self.MultiRotate1D()
9803 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9806 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9808 # @ref swig_MakeMultiRotation "Example"
9809 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9811 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9814 pz = geompy.MakeVertex(0, 0, 100)
9815 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9816 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9818 # Example: see GEOM_TestOthers.py
9819 aVec = self.MakeLine(aPoint,aDir)
9820 # note: auto-publishing is done in self.MultiRotate1D()
9821 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9824 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9826 # @ref swig_MakeMultiRotation "Example"
9827 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9829 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9832 pz = geompy.MakeVertex(0, 0, 100)
9833 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9834 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9836 # Example: see GEOM_TestOthers.py
9837 aVec = self.MakeLine(aPoint,aDir)
9838 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9839 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9842 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9844 # @ref swig_MakeMultiRotation "Example"
9845 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9847 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9850 pz = geompy.MakeVertex(0, 0, 100)
9851 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9852 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9854 # Example: see GEOM_TestOthers.py
9855 aVec = self.MakeLine(aPoint,aDir)
9856 # note: auto-publishing is done in self.MultiRotate2D()
9857 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9861 # Compute a wire or a face that represents a projection of the source
9862 # shape onto cylinder. The cylinder's coordinate system is the same
9863 # as the global coordinate system.
9865 # @param theObject The object to be projected. It can be either
9866 # a planar wire or a face.
9867 # @param theRadius The radius of the cylinder.
9868 # @param theStartAngle The starting angle in radians from
9869 # the cylinder's X axis around Z axis. The angle from which
9870 # the projection is started.
9871 # @param theAngleLength The projection length angle in radians.
9872 # The angle in which to project the total length of the wire.
9873 # If it is negative the projection is not scaled and natural
9874 # wire length is kept for the projection.
9875 # @param theAngleRotation The desired angle in radians between
9876 # the tangent vector to the first curve at the first point of
9877 # the theObject's projection in 2D space and U-direction of
9878 # cylinder's 2D space.
9879 # @param theName Object name; when specified, this parameter is used
9880 # for result publication in the study. Otherwise, if automatic
9881 # publication is switched on, default value is used for result name.
9883 # @return New GEOM.GEOM_Object, containing the result shape. The result
9884 # represents a wire or a face that represents a projection of
9885 # the source shape onto a cylinder.
9887 # @ref tui_projection "Example"
9888 def MakeProjectionOnCylinder (self, theObject, theRadius,
9889 theStartAngle=0.0, theAngleLength=-1.0,
9890 theAngleRotation=0.0,
9893 Compute a wire or a face that represents a projection of the source
9894 shape onto cylinder. The cylinder's coordinate system is the same
9895 as the global coordinate system.
9898 theObject The object to be projected. It can be either
9899 a planar wire or a face.
9900 theRadius The radius of the cylinder.
9901 theStartAngle The starting angle in radians from the cylinder's X axis
9902 around Z axis. The angle from which the projection is started.
9903 theAngleLength The projection length angle in radians. The angle in which
9904 to project the total length of the wire. If it is negative the
9905 projection is not scaled and natural wire length is kept for
9907 theAngleRotation The desired angle in radians between
9908 the tangent vector to the first curve at the first
9909 point of the theObject's projection in 2D space and
9910 U-direction of cylinder's 2D space.
9911 theName Object name; when specified, this parameter is used
9912 for result publication in the study. Otherwise, if automatic
9913 publication is switched on, default value is used for result name.
9916 New GEOM.GEOM_Object, containing the result shape. The result
9917 represents a wire or a face that represents a projection of
9918 the source shape onto a cylinder.
9920 # Example: see GEOM_TestAll.py
9921 flagStartAngle = False
9922 if isinstance(theStartAngle,str):
9923 flagStartAngle = True
9924 flagAngleLength = False
9925 if isinstance(theAngleLength,str):
9926 flagAngleLength = True
9927 flagAngleRotation = False
9928 if isinstance(theAngleRotation,str):
9929 flagAngleRotation = True
9930 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9931 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9933 theStartAngle = theStartAngle*math.pi/180.
9935 theAngleLength = theAngleLength*math.pi/180.
9936 if flagAngleRotation:
9937 theAngleRotation = theAngleRotation*math.pi/180.
9938 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9939 theStartAngle, theAngleLength, theAngleRotation)
9940 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9941 anObj.SetParameters(Parameters)
9942 self._autoPublish(anObj, theName, "projection")
9945 # end of l3_transform
9948 ## @addtogroup l3_transform_d
9951 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9952 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9954 Deprecated method. Use MultiRotate1DNbTimes instead.
9956 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9957 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9959 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9960 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9961 @ManageTransactions("TrsfOp")
9962 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9964 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9965 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9968 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9970 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9971 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9972 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9973 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9974 anObj.SetParameters(Parameters)
9975 self._autoPublish(anObj, theName, "multirotation")
9978 ## The same, as MultiRotate1D(), but axis is given by direction and point
9979 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9980 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9982 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9983 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9986 pz = geompy.MakeVertex(0, 0, 100)
9987 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9988 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9990 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9991 aVec = self.MakeLine(aPoint,aDir)
9992 # note: auto-publishing is done in self.MultiRotate1D()
9993 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
9996 ## The same, as MultiRotate2D(), but axis is given by direction and point
9997 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
9998 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
10000 The same, as MultiRotate2D(), but axis is given by direction and point
10001 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10004 pz = geompy.MakeVertex(0, 0, 100)
10005 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
10006 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
10008 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
10009 aVec = self.MakeLine(aPoint,aDir)
10010 # note: auto-publishing is done in self.MultiRotate2D()
10011 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10014 # end of l3_transform_d
10017 ## @addtogroup l3_local
10020 ## Perform a fillet on all edges of the given shape.
10021 # @param theShape Shape, to perform fillet on.
10022 # @param theR Fillet radius.
10023 # @param theName Object name; when specified, this parameter is used
10024 # for result publication in the study. Otherwise, if automatic
10025 # publication is switched on, default value is used for result name.
10027 # @return New GEOM.GEOM_Object, containing the result shape.
10029 # @ref tui_fillet "Example 1"
10030 # \n @ref swig_MakeFilletAll "Example 2"
10031 @ManageTransactions("LocalOp")
10032 def MakeFilletAll(self, theShape, theR, theName=None):
10034 Perform a fillet on all edges of the given shape.
10037 theShape Shape, to perform fillet on.
10038 theR Fillet radius.
10039 theName Object name; when specified, this parameter is used
10040 for result publication in the study. Otherwise, if automatic
10041 publication is switched on, default value is used for result name.
10044 New GEOM.GEOM_Object, containing the result shape.
10047 filletall = geompy.MakeFilletAll(prism, 10.)
10049 # Example: see GEOM_TestOthers.py
10050 theR,Parameters = ParseParameters(theR)
10051 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10052 RaiseIfFailed("MakeFilletAll", self.LocalOp)
10053 anObj.SetParameters(Parameters)
10054 self._autoPublish(anObj, theName, "fillet")
10057 ## Perform a fillet on the specified edges/faces of the given shape
10058 # @param theShape Shape, to perform fillet on.
10059 # @param theR Fillet radius.
10060 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10061 # @param theListShapes Global indices of edges/faces to perform fillet on.
10062 # @param theName Object name; when specified, this parameter is used
10063 # for result publication in the study. Otherwise, if automatic
10064 # publication is switched on, default value is used for result name.
10066 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10068 # @return New GEOM.GEOM_Object, containing the result shape.
10070 # @ref tui_fillet "Example"
10071 @ManageTransactions("LocalOp")
10072 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10074 Perform a fillet on the specified edges/faces of the given shape
10077 theShape Shape, to perform fillet on.
10078 theR Fillet radius.
10079 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10080 theListShapes Global indices of edges/faces to perform fillet on.
10081 theName Object name; when specified, this parameter is used
10082 for result publication in the study. Otherwise, if automatic
10083 publication is switched on, default value is used for result name.
10086 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10089 New GEOM.GEOM_Object, containing the result shape.
10092 # get the list of IDs (IDList) for the fillet
10093 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10095 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10096 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10097 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10098 # make a fillet on the specified edges of the given shape
10099 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10101 # Example: see GEOM_TestAll.py
10102 theR,Parameters = ParseParameters(theR)
10104 if theShapeType == self.ShapeType["EDGE"]:
10105 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10106 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10108 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10109 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10110 anObj.SetParameters(Parameters)
10111 self._autoPublish(anObj, theName, "fillet")
10114 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10115 @ManageTransactions("LocalOp")
10116 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10118 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10121 # get the list of IDs (IDList) for the fillet
10122 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10124 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10125 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10126 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10127 # make a fillet on the specified edges of the given shape
10128 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10130 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10132 if theShapeType == self.ShapeType["EDGE"]:
10133 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10134 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10136 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10137 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10138 anObj.SetParameters(Parameters)
10139 self._autoPublish(anObj, theName, "fillet")
10142 ## Perform a fillet on the specified edges of the given shape
10143 # @param theShape Wire Shape to perform fillet on.
10144 # @param theR Fillet radius.
10145 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10146 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10147 # \note The list of vertices could be empty,
10148 # in this case fillet will done done at all vertices in wire
10149 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10150 # by the length of the edges, nearest to the fillet vertex.
10151 # But sometimes the next edge is C1 continuous with the one, nearest to
10152 # the fillet point, and such two (or more) edges can be united to allow
10153 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10154 # thus ignoring the secant vertex (vertices).
10155 # @param theName Object name; when specified, this parameter is used
10156 # for result publication in the study. Otherwise, if automatic
10157 # publication is switched on, default value is used for result name.
10159 # @return New GEOM.GEOM_Object, containing the result shape.
10161 # @ref tui_fillet2d "Example"
10162 @ManageTransactions("LocalOp")
10163 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10165 Perform a fillet on the specified edges of the given shape
10168 theShape Wire Shape to perform fillet on.
10169 theR Fillet radius.
10170 theListOfVertexes Global indices of vertexes to perform fillet on.
10171 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10172 by the length of the edges, nearest to the fillet vertex.
10173 But sometimes the next edge is C1 continuous with the one, nearest to
10174 the fillet point, and such two (or more) edges can be united to allow
10175 bigger radius. Set this flag to TRUE to allow collinear edges union,
10176 thus ignoring the secant vertex (vertices).
10177 theName Object name; when specified, this parameter is used
10178 for result publication in the study. Otherwise, if automatic
10179 publication is switched on, default value is used for result name.
10181 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10183 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10186 New GEOM.GEOM_Object, containing the result shape.
10190 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10191 # make fillet at given wire vertices with giver radius
10192 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10194 # Example: see GEOM_TestAll.py
10195 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10196 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10197 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10198 anObj.SetParameters(Parameters)
10199 self._autoPublish(anObj, theName, "fillet")
10202 ## Perform a fillet at the specified vertices of the given face/shell.
10203 # @param theShape Face or Shell shape to perform fillet on.
10204 # @param theR Fillet radius.
10205 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10206 # @param theName Object name; when specified, this parameter is used
10207 # for result publication in the study. Otherwise, if automatic
10208 # publication is switched on, default value is used for result name.
10210 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10212 # @return New GEOM.GEOM_Object, containing the result shape.
10214 # @ref tui_fillet2d "Example"
10215 @ManageTransactions("LocalOp")
10216 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10218 Perform a fillet at the specified vertices of the given face/shell.
10221 theShape Face or Shell shape to perform fillet on.
10222 theR Fillet radius.
10223 theListOfVertexes Global indices of vertexes to perform fillet on.
10224 theName Object name; when specified, this parameter is used
10225 for result publication in the study. Otherwise, if automatic
10226 publication is switched on, default value is used for result name.
10228 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10231 New GEOM.GEOM_Object, containing the result shape.
10234 face = geompy.MakeFaceHW(100, 100, 1)
10235 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10237 # Example: see GEOM_TestAll.py
10238 theR,Parameters = ParseParameters(theR)
10239 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10240 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10241 anObj.SetParameters(Parameters)
10242 self._autoPublish(anObj, theName, "fillet")
10245 ## Perform a symmetric chamfer on all edges of the given shape.
10246 # @param theShape Shape, to perform chamfer on.
10247 # @param theD Chamfer size along each face.
10248 # @param theName Object name; when specified, this parameter is used
10249 # for result publication in the study. Otherwise, if automatic
10250 # publication is switched on, default value is used for result name.
10252 # @return New GEOM.GEOM_Object, containing the result shape.
10254 # @ref tui_chamfer "Example 1"
10255 # \n @ref swig_MakeChamferAll "Example 2"
10256 @ManageTransactions("LocalOp")
10257 def MakeChamferAll(self, theShape, theD, theName=None):
10259 Perform a symmetric chamfer on all edges of the given shape.
10262 theShape Shape, to perform chamfer on.
10263 theD Chamfer size along each face.
10264 theName Object name; when specified, this parameter is used
10265 for result publication in the study. Otherwise, if automatic
10266 publication is switched on, default value is used for result name.
10269 New GEOM.GEOM_Object, containing the result shape.
10272 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10274 # Example: see GEOM_TestOthers.py
10275 theD,Parameters = ParseParameters(theD)
10276 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10277 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10278 anObj.SetParameters(Parameters)
10279 self._autoPublish(anObj, theName, "chamfer")
10282 ## Perform a chamfer on edges, common to the specified faces,
10283 # with distance D1 on the Face1
10284 # @param theShape Shape, to perform chamfer on.
10285 # @param theD1 Chamfer size along \a theFace1.
10286 # @param theD2 Chamfer size along \a theFace2.
10287 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10288 # @param theName Object name; when specified, this parameter is used
10289 # for result publication in the study. Otherwise, if automatic
10290 # publication is switched on, default value is used for result name.
10292 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10294 # @return New GEOM.GEOM_Object, containing the result shape.
10296 # @ref tui_chamfer "Example"
10297 @ManageTransactions("LocalOp")
10298 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10300 Perform a chamfer on edges, common to the specified faces,
10301 with distance D1 on the Face1
10304 theShape Shape, to perform chamfer on.
10305 theD1 Chamfer size along theFace1.
10306 theD2 Chamfer size along theFace2.
10307 theFace1,theFace2 Global indices of two faces of theShape.
10308 theName Object name; when specified, this parameter is used
10309 for result publication in the study. Otherwise, if automatic
10310 publication is switched on, default value is used for result name.
10313 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10316 New GEOM.GEOM_Object, containing the result shape.
10319 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10320 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10321 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10322 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10324 # Example: see GEOM_TestAll.py
10325 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10326 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10327 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10328 anObj.SetParameters(Parameters)
10329 self._autoPublish(anObj, theName, "chamfer")
10332 ## Perform a chamfer on edges
10333 # @param theShape Shape, to perform chamfer on.
10334 # @param theD Chamfer length
10335 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10336 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10337 # @param theName Object name; when specified, this parameter is used
10338 # for result publication in the study. Otherwise, if automatic
10339 # publication is switched on, default value is used for result name.
10341 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10343 # @return New GEOM.GEOM_Object, containing the result shape.
10344 @ManageTransactions("LocalOp")
10345 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10347 Perform a chamfer on edges
10350 theShape Shape, to perform chamfer on.
10351 theD1 Chamfer size along theFace1.
10352 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10353 theFace1,theFace2 Global indices of two faces of theShape.
10354 theName Object name; when specified, this parameter is used
10355 for result publication in the study. Otherwise, if automatic
10356 publication is switched on, default value is used for result name.
10359 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10362 New GEOM.GEOM_Object, containing the result shape.
10365 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10366 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10367 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10369 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10372 if isinstance(theAngle,str):
10374 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10376 theAngle = theAngle*math.pi/180.0
10377 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10378 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10379 anObj.SetParameters(Parameters)
10380 self._autoPublish(anObj, theName, "chamfer")
10383 ## Perform a chamfer on all edges of the specified faces,
10384 # with distance D1 on the first specified face (if several for one edge)
10385 # @param theShape Shape, to perform chamfer on.
10386 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10387 # connected to the edge, are in \a theFaces, \a theD1
10388 # will be get along face, which is nearer to \a theFaces beginning.
10389 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10390 # @param theFaces Sequence of global indices of faces of \a theShape.
10391 # @param theName Object name; when specified, this parameter is used
10392 # for result publication in the study. Otherwise, if automatic
10393 # publication is switched on, default value is used for result name.
10395 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10397 # @return New GEOM.GEOM_Object, containing the result shape.
10399 # @ref tui_chamfer "Example"
10400 @ManageTransactions("LocalOp")
10401 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10403 Perform a chamfer on all edges of the specified faces,
10404 with distance D1 on the first specified face (if several for one edge)
10407 theShape Shape, to perform chamfer on.
10408 theD1 Chamfer size along face from theFaces. If both faces,
10409 connected to the edge, are in theFaces, theD1
10410 will be get along face, which is nearer to theFaces beginning.
10411 theD2 Chamfer size along another of two faces, connected to the edge.
10412 theFaces Sequence of global indices of faces of theShape.
10413 theName Object name; when specified, this parameter is used
10414 for result publication in the study. Otherwise, if automatic
10415 publication is switched on, default value is used for result name.
10417 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10420 New GEOM.GEOM_Object, containing the result shape.
10422 # Example: see GEOM_TestAll.py
10423 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10424 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10425 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10426 anObj.SetParameters(Parameters)
10427 self._autoPublish(anObj, theName, "chamfer")
10430 ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10431 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10433 # @ref swig_FilletChamfer "Example"
10434 @ManageTransactions("LocalOp")
10435 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10437 The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10438 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10441 if isinstance(theAngle,str):
10443 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10445 theAngle = theAngle*math.pi/180.0
10446 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10447 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10448 anObj.SetParameters(Parameters)
10449 self._autoPublish(anObj, theName, "chamfer")
10452 ## Perform a chamfer on edges,
10453 # with distance D1 on the first specified face (if several for one edge)
10454 # @param theShape Shape, to perform chamfer on.
10455 # @param theD1,theD2 Chamfer size
10456 # @param theEdges Sequence of edges of \a theShape.
10457 # @param theName Object name; when specified, this parameter is used
10458 # for result publication in the study. Otherwise, if automatic
10459 # publication is switched on, default value is used for result name.
10461 # @return New GEOM.GEOM_Object, containing the result shape.
10463 # @ref swig_FilletChamfer "Example"
10464 @ManageTransactions("LocalOp")
10465 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10467 Perform a chamfer on edges,
10468 with distance D1 on the first specified face (if several for one edge)
10471 theShape Shape, to perform chamfer on.
10472 theD1,theD2 Chamfer size
10473 theEdges Sequence of edges of theShape.
10474 theName Object name; when specified, this parameter is used
10475 for result publication in the study. Otherwise, if automatic
10476 publication is switched on, default value is used for result name.
10479 New GEOM.GEOM_Object, containing the result shape.
10481 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10482 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10483 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10484 anObj.SetParameters(Parameters)
10485 self._autoPublish(anObj, theName, "chamfer")
10488 ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10489 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10490 @ManageTransactions("LocalOp")
10491 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10493 The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10494 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10497 if isinstance(theAngle,str):
10499 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10501 theAngle = theAngle*math.pi/180.0
10502 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10503 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10504 anObj.SetParameters(Parameters)
10505 self._autoPublish(anObj, theName, "chamfer")
10508 ## @sa MakeChamferEdge(), MakeChamferFaces()
10510 # @ref swig_MakeChamfer "Example"
10511 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10513 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10515 # Example: see GEOM_TestOthers.py
10517 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10518 if aShapeType == self.ShapeType["EDGE"]:
10519 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10521 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10524 ## Remove material from a solid by extrusion of the base shape on the given distance.
10525 # @param theInit Shape to remove material from. It must be a solid or
10526 # a compound made of a single solid.
10527 # @param theBase Closed edge or wire defining the base shape to be extruded.
10528 # @param theH Prism dimension along the normal to theBase
10529 # @param theAngle Draft angle in degrees.
10530 # @param theInvert If true material changes the direction
10531 # @param theName Object name; when specified, this parameter is used
10532 # for result publication in the study. Otherwise, if automatic
10533 # publication is switched on, default value is used for result name.
10535 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10537 # @ref tui_creation_prism "Example"
10538 @ManageTransactions("PrimOp")
10539 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10541 Add material to a solid by extrusion of the base shape on the given distance.
10544 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10545 theBase Closed edge or wire defining the base shape to be extruded.
10546 theH Prism dimension along the normal to theBase
10547 theAngle Draft angle in degrees.
10548 theInvert If true material changes the direction.
10549 theName Object name; when specified, this parameter is used
10550 for result publication in the study. Otherwise, if automatic
10551 publication is switched on, default value is used for result name.
10554 New GEOM.GEOM_Object, containing the initial shape with removed material.
10556 # Example: see GEOM_TestAll.py
10557 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10558 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10559 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10560 anObj.SetParameters(Parameters)
10561 self._autoPublish(anObj, theName, "extrudedCut")
10564 ## Add material to a solid by extrusion of the base shape on the given distance.
10565 # @param theInit Shape to add material to. It must be a solid or
10566 # a compound made of a single solid.
10567 # @param theBase Closed edge or wire defining the base shape to be extruded.
10568 # @param theH Prism dimension along the normal to theBase
10569 # @param theAngle Draft angle in degrees.
10570 # @param theInvert If true material changes the direction
10571 # @param theName Object name; when specified, this parameter is used
10572 # for result publication in the study. Otherwise, if automatic
10573 # publication is switched on, default value is used for result name.
10575 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10577 # @ref tui_creation_prism "Example"
10578 @ManageTransactions("PrimOp")
10579 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10581 Add material to a solid by extrusion of the base shape on the given distance.
10584 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10585 theBase Closed edge or wire defining the base shape to be extruded.
10586 theH Prism dimension along the normal to theBase
10587 theAngle Draft angle in degrees.
10588 theInvert If true material changes the direction.
10589 theName Object name; when specified, this parameter is used
10590 for result publication in the study. Otherwise, if automatic
10591 publication is switched on, default value is used for result name.
10594 New GEOM.GEOM_Object, containing the initial shape with added material.
10596 # Example: see GEOM_TestAll.py
10597 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10598 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10599 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10600 anObj.SetParameters(Parameters)
10601 self._autoPublish(anObj, theName, "extrudedBoss")
10607 ## @addtogroup l3_basic_op
10610 ## Perform an Archimde operation on the given shape with given parameters.
10611 # The object presenting the resulting face is returned.
10612 # @param theShape Shape to be put in water.
10613 # @param theWeight Weight of the shape.
10614 # @param theWaterDensity Density of the water.
10615 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10616 # @param theName Object name; when specified, this parameter is used
10617 # for result publication in the study. Otherwise, if automatic
10618 # publication is switched on, default value is used for result name.
10620 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10621 # by a plane, corresponding to water level.
10623 # @ref tui_archimede "Example"
10624 @ManageTransactions("LocalOp")
10625 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10627 Perform an Archimde operation on the given shape with given parameters.
10628 The object presenting the resulting face is returned.
10631 theShape Shape to be put in water.
10632 theWeight Weight of the shape.
10633 theWaterDensity Density of the water.
10634 theMeshDeflection Deflection of the mesh, using to compute the section.
10635 theName Object name; when specified, this parameter is used
10636 for result publication in the study. Otherwise, if automatic
10637 publication is switched on, default value is used for result name.
10640 New GEOM.GEOM_Object, containing a section of theShape
10641 by a plane, corresponding to water level.
10643 # Example: see GEOM_TestAll.py
10644 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10645 theWeight,theWaterDensity,theMeshDeflection)
10646 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10647 RaiseIfFailed("MakeArchimede", self.LocalOp)
10648 anObj.SetParameters(Parameters)
10649 self._autoPublish(anObj, theName, "archimede")
10652 # end of l3_basic_op
10655 ## @addtogroup l2_measure
10658 ## Get point coordinates
10659 # @return [x, y, z]
10661 # @ref tui_point_coordinates_page "Example"
10662 @ManageTransactions("MeasuOp")
10663 def PointCoordinates(self,Point):
10665 Get point coordinates
10670 # Example: see GEOM_TestMeasures.py
10671 aTuple = self.MeasuOp.PointCoordinates(Point)
10672 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10675 ## Get vector coordinates
10676 # @return [x, y, z]
10678 # @ref tui_measurement_tools_page "Example"
10679 def VectorCoordinates(self,Vector):
10681 Get vector coordinates
10687 p1=self.GetFirstVertex(Vector)
10688 p2=self.GetLastVertex(Vector)
10690 X1=self.PointCoordinates(p1)
10691 X2=self.PointCoordinates(p2)
10693 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10696 ## Compute cross product
10697 # @return vector w=u^v
10699 # @ref tui_measurement_tools_page "Example"
10700 def CrossProduct(self, Vector1, Vector2):
10702 Compute cross product
10704 Returns: vector w=u^v
10706 u=self.VectorCoordinates(Vector1)
10707 v=self.VectorCoordinates(Vector2)
10708 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])
10712 ## Compute cross product
10713 # @return dot product p=u.v
10715 # @ref tui_measurement_tools_page "Example"
10716 def DotProduct(self, Vector1, Vector2):
10718 Compute cross product
10720 Returns: dot product p=u.v
10722 u=self.VectorCoordinates(Vector1)
10723 v=self.VectorCoordinates(Vector2)
10724 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10729 ## Get summarized length of all wires,
10730 # area of surface and volume of the given shape.
10731 # @param theShape Shape to define properties of.
10732 # @param theTolerance maximal relative error of area
10733 # and volume computation.
10734 # @return [theLength, theSurfArea, theVolume]\n
10735 # theLength: Summarized length of all wires of the given shape.\n
10736 # theSurfArea: Area of surface of the given shape.\n
10737 # theVolume: Volume of the given shape.
10739 # @ref tui_basic_properties_page "Example"
10740 @ManageTransactions("MeasuOp")
10741 def BasicProperties(self,theShape, theTolerance=1.e-6):
10743 Get summarized length of all wires,
10744 area of surface and volume of the given shape.
10747 theShape Shape to define properties of.
10748 theTolerance maximal relative error of area
10749 and volume computation.
10752 [theLength, theSurfArea, theVolume]
10753 theLength: Summarized length of all wires of the given shape.
10754 theSurfArea: Area of surface of the given shape.
10755 theVolume: Volume of the given shape.
10757 # Example: see GEOM_TestMeasures.py
10758 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10759 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10762 ## Get parameters of bounding box of the given shape
10763 # @param theShape Shape to obtain bounding box of.
10764 # @param precise TRUE for precise computation; FALSE for fast one.
10765 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10766 # Xmin,Xmax: Limits of shape along OX axis.
10767 # Ymin,Ymax: Limits of shape along OY axis.
10768 # Zmin,Zmax: Limits of shape along OZ axis.
10770 # @ref tui_bounding_box_page "Example"
10771 @ManageTransactions("MeasuOp")
10772 def BoundingBox (self, theShape, precise=False):
10774 Get parameters of bounding box of the given shape
10777 theShape Shape to obtain bounding box of.
10778 precise TRUE for precise computation; FALSE for fast one.
10781 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10782 Xmin,Xmax: Limits of shape along OX axis.
10783 Ymin,Ymax: Limits of shape along OY axis.
10784 Zmin,Zmax: Limits of shape along OZ axis.
10786 # Example: see GEOM_TestMeasures.py
10787 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10788 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10791 ## Get bounding box of the given shape
10792 # @param theShape Shape to obtain bounding box of.
10793 # @param precise TRUE for precise computation; FALSE for fast one.
10794 # @param theName Object name; when specified, this parameter is used
10795 # for result publication in the study. Otherwise, if automatic
10796 # publication is switched on, default value is used for result name.
10798 # @return New GEOM.GEOM_Object, containing the created box.
10800 # @ref tui_bounding_box_page "Example"
10801 @ManageTransactions("MeasuOp")
10802 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10804 Get bounding box of the given shape
10807 theShape Shape to obtain bounding box of.
10808 precise TRUE for precise computation; FALSE for fast one.
10809 theName Object name; when specified, this parameter is used
10810 for result publication in the study. Otherwise, if automatic
10811 publication is switched on, default value is used for result name.
10814 New GEOM.GEOM_Object, containing the created box.
10816 # Example: see GEOM_TestMeasures.py
10817 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10818 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10819 self._autoPublish(anObj, theName, "bndbox")
10822 ## Get inertia matrix and moments of inertia of theShape.
10823 # @param theShape Shape to calculate inertia of.
10824 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10825 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10826 # Ix,Iy,Iz: Moments of inertia of the given shape.
10828 # @ref tui_inertia_page "Example"
10829 @ManageTransactions("MeasuOp")
10830 def Inertia(self,theShape):
10832 Get inertia matrix and moments of inertia of theShape.
10835 theShape Shape to calculate inertia of.
10838 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10839 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10840 Ix,Iy,Iz: Moments of inertia of the given shape.
10842 # Example: see GEOM_TestMeasures.py
10843 aTuple = self.MeasuOp.GetInertia(theShape)
10844 RaiseIfFailed("GetInertia", self.MeasuOp)
10847 ## Get if coords are included in the shape (ST_IN or ST_ON)
10848 # @param theShape Shape
10849 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10850 # @param tolerance to be used (default is 1.0e-7)
10851 # @return list_of_boolean = [res1, res2, ...]
10852 @ManageTransactions("MeasuOp")
10853 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10855 Get if coords are included in the shape (ST_IN or ST_ON)
10859 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10860 tolerance to be used (default is 1.0e-7)
10863 list_of_boolean = [res1, res2, ...]
10865 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10867 ## Get minimal distance between the given shapes.
10868 # @param theShape1,theShape2 Shapes to find minimal distance between.
10869 # @return Value of the minimal distance between the given shapes.
10871 # @ref tui_min_distance_page "Example"
10872 @ManageTransactions("MeasuOp")
10873 def MinDistance(self, theShape1, theShape2):
10875 Get minimal distance between the given shapes.
10878 theShape1,theShape2 Shapes to find minimal distance between.
10881 Value of the minimal distance between the given shapes.
10883 # Example: see GEOM_TestMeasures.py
10884 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10885 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10888 ## Get minimal distance between the given shapes.
10889 # @param theShape1,theShape2 Shapes to find minimal distance between.
10890 # @return Value of the minimal distance between the given shapes, in form of list
10891 # [Distance, DX, DY, DZ].
10893 # @ref tui_min_distance_page "Example"
10894 @ManageTransactions("MeasuOp")
10895 def MinDistanceComponents(self, theShape1, theShape2):
10897 Get minimal distance between the given shapes.
10900 theShape1,theShape2 Shapes to find minimal distance between.
10903 Value of the minimal distance between the given shapes, in form of list
10904 [Distance, DX, DY, DZ]
10906 # Example: see GEOM_TestMeasures.py
10907 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10908 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10909 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10912 ## Get closest points of the given shapes.
10913 # @param theShape1,theShape2 Shapes to find closest points of.
10914 # @return The number of found solutions (-1 in case of infinite number of
10915 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10917 # @ref tui_min_distance_page "Example"
10918 @ManageTransactions("MeasuOp")
10919 def ClosestPoints (self, theShape1, theShape2):
10921 Get closest points of the given shapes.
10924 theShape1,theShape2 Shapes to find closest points of.
10927 The number of found solutions (-1 in case of infinite number of
10928 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10930 # Example: see GEOM_TestMeasures.py
10931 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10932 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10935 ## Get angle between the given shapes in degrees.
10936 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10937 # @note If both arguments are vectors, the angle is computed in accordance
10938 # with their orientations, otherwise the minimum angle is computed.
10939 # @return Value of the angle between the given shapes in degrees.
10941 # @ref tui_angle_page "Example"
10942 @ManageTransactions("MeasuOp")
10943 def GetAngle(self, theShape1, theShape2):
10945 Get angle between the given shapes in degrees.
10948 theShape1,theShape2 Lines or linear edges to find angle between.
10951 If both arguments are vectors, the angle is computed in accordance
10952 with their orientations, otherwise the minimum angle is computed.
10955 Value of the angle between the given shapes in degrees.
10957 # Example: see GEOM_TestMeasures.py
10958 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10959 RaiseIfFailed("GetAngle", self.MeasuOp)
10962 ## Get angle between the given shapes in radians.
10963 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10964 # @note If both arguments are vectors, the angle is computed in accordance
10965 # with their orientations, otherwise the minimum angle is computed.
10966 # @return Value of the angle between the given shapes in radians.
10968 # @ref tui_angle_page "Example"
10969 @ManageTransactions("MeasuOp")
10970 def GetAngleRadians(self, theShape1, theShape2):
10972 Get angle between the given shapes in radians.
10975 theShape1,theShape2 Lines or linear edges to find angle between.
10979 If both arguments are vectors, the angle is computed in accordance
10980 with their orientations, otherwise the minimum angle is computed.
10983 Value of the angle between the given shapes in radians.
10985 # Example: see GEOM_TestMeasures.py
10986 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10987 RaiseIfFailed("GetAngle", self.MeasuOp)
10990 ## Get angle between the given vectors in degrees.
10991 # @param theShape1,theShape2 Vectors to find angle between.
10992 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10993 # if False, the opposite vector to the normal vector is used.
10994 # @return Value of the angle between the given vectors in degrees.
10996 # @ref tui_angle_page "Example"
10997 @ManageTransactions("MeasuOp")
10998 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
11000 Get angle between the given vectors in degrees.
11003 theShape1,theShape2 Vectors to find angle between.
11004 theFlag If True, the normal vector is defined by the two vectors cross,
11005 if False, the opposite vector to the normal vector is used.
11008 Value of the angle between the given vectors in degrees.
11010 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11012 anAngle = 360. - anAngle
11013 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11016 ## The same as GetAngleVectors, but the result is in radians.
11017 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11019 Get angle between the given vectors in radians.
11022 theShape1,theShape2 Vectors to find angle between.
11023 theFlag If True, the normal vector is defined by the two vectors cross,
11024 if False, the opposite vector to the normal vector is used.
11027 Value of the angle between the given vectors in radians.
11029 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11032 ## @name Curve Curvature Measurement
11033 # Methods for receiving radius of curvature of curves
11034 # in the given point
11037 ## Measure curvature of a curve at a point, set by parameter.
11038 # @param theCurve a curve.
11039 # @param theParam parameter.
11040 # @return radius of curvature of \a theCurve.
11042 # @ref swig_todo "Example"
11043 @ManageTransactions("MeasuOp")
11044 def CurveCurvatureByParam(self, theCurve, theParam):
11046 Measure curvature of a curve at a point, set by parameter.
11050 theParam parameter.
11053 radius of curvature of theCurve.
11055 # Example: see GEOM_TestMeasures.py
11056 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11057 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11060 ## Measure curvature of a curve at a point.
11061 # @param theCurve a curve.
11062 # @param thePoint given point.
11063 # @return radius of curvature of \a theCurve.
11065 # @ref swig_todo "Example"
11066 @ManageTransactions("MeasuOp")
11067 def CurveCurvatureByPoint(self, theCurve, thePoint):
11069 Measure curvature of a curve at a point.
11073 thePoint given point.
11076 radius of curvature of theCurve.
11078 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11079 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11083 ## @name Surface Curvature Measurement
11084 # Methods for receiving max and min radius of curvature of surfaces
11085 # in the given point
11088 ## Measure max radius of curvature of surface.
11089 # @param theSurf the given surface.
11090 # @param theUParam Value of U-parameter on the referenced surface.
11091 # @param theVParam Value of V-parameter on the referenced surface.
11092 # @return max radius of curvature of theSurf.
11094 ## @ref swig_todo "Example"
11095 @ManageTransactions("MeasuOp")
11096 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11098 Measure max radius of curvature of surface.
11101 theSurf the given surface.
11102 theUParam Value of U-parameter on the referenced surface.
11103 theVParam Value of V-parameter on the referenced surface.
11106 max radius of curvature of theSurf.
11108 # Example: see GEOM_TestMeasures.py
11109 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11110 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11113 ## Measure max radius of curvature of surface in the given point
11114 # @param theSurf the given surface.
11115 # @param thePoint given point.
11116 # @return max radius of curvature of theSurf.
11118 ## @ref swig_todo "Example"
11119 @ManageTransactions("MeasuOp")
11120 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11122 Measure max radius of curvature of surface in the given point.
11125 theSurf the given surface.
11126 thePoint given point.
11129 max radius of curvature of theSurf.
11131 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11132 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11135 ## Measure min radius of curvature of surface.
11136 # @param theSurf the given surface.
11137 # @param theUParam Value of U-parameter on the referenced surface.
11138 # @param theVParam Value of V-parameter on the referenced surface.
11139 # @return min radius of curvature of theSurf.
11141 ## @ref swig_todo "Example"
11142 @ManageTransactions("MeasuOp")
11143 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11145 Measure min radius of curvature of surface.
11148 theSurf the given surface.
11149 theUParam Value of U-parameter on the referenced surface.
11150 theVParam Value of V-parameter on the referenced surface.
11153 Min radius of curvature of theSurf.
11155 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11156 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11159 ## Measure min radius of curvature of surface in the given point
11160 # @param theSurf the given surface.
11161 # @param thePoint given point.
11162 # @return min radius of curvature of theSurf.
11164 ## @ref swig_todo "Example"
11165 @ManageTransactions("MeasuOp")
11166 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11168 Measure min radius of curvature of surface in the given point.
11171 theSurf the given surface.
11172 thePoint given point.
11175 Min radius of curvature of theSurf.
11177 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11178 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11182 ## Measure curvature radius of surface in the given point along the given direction.
11183 # @param theSurf the given face.
11184 # @param thePoint given point.
11185 # @param theDirection given direction.
11186 # @param theName Object name; when specified, this parameter is used
11187 # for result publication in the study. Otherwise, if automatic
11188 # publication is switched on, default value is used for result name.
11190 # @return New GEOM.GEOM_Object, containing vector of curvature of theSurf.
11191 # The returned vector is codirectional with the normal to the face
11192 # in the given point in case of positive curvature value
11193 # and opposite to the normal in case of negative curvature.
11194 # The normal of the returned vector is equal to the
11195 # absolute value of the curvature radius.
11196 # Null shape is returned in case of infinite radius
11197 # (zero curvature), for example, in case of flat face.
11199 ## @ref swig_CurvatureOnFace "Example"
11200 @ManageTransactions("MeasuOp")
11201 def CurvatureOnFace(self, theSurf, thePoint, theDirection, theName=None):
11203 Measure curvature radius of surface in the given point along the given direction.
11206 theSurf the given face.
11207 thePoint given point.
11208 theDirection given direction.
11209 theName Object name; when specified, this parameter is used
11210 for result publication in the study. Otherwise, if automatic
11211 publication is switched on, default value is used for result name.
11214 New GEOM.GEOM_Object, containing vector of curvature of theSurf.
11215 The returned vector is codirectional with the normal to the face
11216 in the given point in case of positive curvature value
11217 and opposite to the normal in case of negative curvature.
11218 The normal of the returned vector is equal to the
11219 absolute value of the curvature radius.
11220 Null shape is returned in case of infinite radius
11221 (zero curvature), for example, in case of flat face.
11224 curvature_1 = geompy.CurvatureOnFace(Face_1, Vertex_1, OX)
11226 aVec = self.MeasuOp.SurfaceCurvatureByPointAndDirection(theSurf,thePoint,theDirection)
11227 if self.MeasuOp.GetErrorCode() != "ZERO_CURVATURE":
11228 RaiseIfFailed("CurvatureOnFace", self.MeasuOp)
11229 self._autoPublish(aVec, theName, "curvature")
11232 ## Get min and max tolerances of sub-shapes of theShape
11233 # @param theShape Shape, to get tolerances of.
11234 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11235 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11236 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11237 # VertMin,VertMax: Min and max tolerances of the vertices.
11239 # @ref tui_tolerance_page "Example"
11240 @ManageTransactions("MeasuOp")
11241 def Tolerance(self,theShape):
11243 Get min and max tolerances of sub-shapes of theShape
11246 theShape Shape, to get tolerances of.
11249 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11250 FaceMin,FaceMax: Min and max tolerances of the faces.
11251 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11252 VertMin,VertMax: Min and max tolerances of the vertices.
11254 # Example: see GEOM_TestMeasures.py
11255 aTuple = self.MeasuOp.GetTolerance(theShape)
11256 RaiseIfFailed("GetTolerance", self.MeasuOp)
11259 ## Obtain description of the given shape (number of sub-shapes of each type)
11260 # @param theShape Shape to be described.
11261 # @return Description of the given shape.
11263 # @ref tui_whatis_page "Example"
11264 @ManageTransactions("MeasuOp")
11265 def WhatIs(self,theShape):
11267 Obtain description of the given shape (number of sub-shapes of each type)
11270 theShape Shape to be described.
11273 Description of the given shape.
11275 # Example: see GEOM_TestMeasures.py
11276 aDescr = self.MeasuOp.WhatIs(theShape)
11277 RaiseIfFailed("WhatIs", self.MeasuOp)
11280 ## Obtain quantity of shapes of the given type in \a theShape.
11281 # If \a theShape is of type \a theType, it is also counted.
11282 # @param theShape Shape to be described.
11283 # @param theType the given ShapeType().
11284 # @return Quantity of shapes of type \a theType in \a theShape.
11286 # @ref tui_measurement_tools_page "Example"
11287 def NbShapes (self, theShape, theType):
11289 Obtain quantity of shapes of the given type in theShape.
11290 If theShape is of type theType, it is also counted.
11293 theShape Shape to be described.
11294 theType the given geompy.ShapeType
11297 Quantity of shapes of type theType in theShape.
11299 # Example: see GEOM_TestMeasures.py
11300 listSh = self.SubShapeAllIDs(theShape, theType)
11304 ## Obtain quantity of shapes of each type in \a theShape.
11305 # The \a theShape is also counted.
11306 # @param theShape Shape to be described.
11307 # @return Dictionary of ShapeType() with bound quantities of shapes.
11309 # @ref tui_measurement_tools_page "Example"
11310 def ShapeInfo (self, theShape):
11312 Obtain quantity of shapes of each type in theShape.
11313 The theShape is also counted.
11316 theShape Shape to be described.
11319 Dictionary of geompy.ShapeType with bound quantities of shapes.
11321 # Example: see GEOM_TestMeasures.py
11323 for typeSh in self.ShapeType:
11324 if typeSh in ( "AUTO", "SHAPE" ): continue
11325 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11331 def GetCreationInformation(self, theShape):
11333 infos = theShape.GetCreationInformation()
11336 opName = info.operationName
11337 if not opName: opName = "no info available"
11338 if res: res += "\n"
11339 res += "Operation: " + opName
11341 for parVal in info.params:
11342 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11345 ## Get a point, situated at the centre of mass of theShape.
11346 # @param theShape Shape to define centre of mass of.
11347 # @param theName Object name; when specified, this parameter is used
11348 # for result publication in the study. Otherwise, if automatic
11349 # publication is switched on, default value is used for result name.
11351 # @return New GEOM.GEOM_Object, containing the created point.
11353 # @ref tui_center_of_mass_page "Example"
11354 @ManageTransactions("MeasuOp")
11355 def MakeCDG(self, theShape, theName=None):
11357 Get a point, situated at the centre of mass of theShape.
11360 theShape Shape to define centre of mass of.
11361 theName Object name; when specified, this parameter is used
11362 for result publication in the study. Otherwise, if automatic
11363 publication is switched on, default value is used for result name.
11366 New GEOM.GEOM_Object, containing the created point.
11368 # Example: see GEOM_TestMeasures.py
11369 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11370 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11371 self._autoPublish(anObj, theName, "centerOfMass")
11374 ## Get a vertex sub-shape by index.
11375 # @param theShape Shape to find sub-shape.
11376 # @param theIndex Index to find vertex by this index (starting from zero)
11377 # @param theUseOri To consider edge/wire orientation or not
11378 # @param theName Object name; when specified, this parameter is used
11379 # for result publication in the study. Otherwise, if automatic
11380 # publication is switched on, default value is used for result name.
11382 # @return New GEOM.GEOM_Object, containing the created vertex.
11384 # @ref tui_measurement_tools_page "Example"
11385 @ManageTransactions("MeasuOp")
11386 def GetVertexByIndex(self, theShape, theIndex, theUseOri=True, theName=None):
11388 Get a vertex sub-shape by index.
11391 theShape Shape to find sub-shape.
11392 theIndex Index to find vertex by this index (starting from zero)
11393 theUseOri To consider edge/wire orientation or not
11394 theName Object name; when specified, this parameter is used
11395 for result publication in the study. Otherwise, if automatic
11396 publication is switched on, default value is used for result name.
11399 New GEOM.GEOM_Object, containing the created vertex.
11401 # Example: see GEOM_TestMeasures.py
11402 if isinstance( theUseOri, str ): # theUseOri was inserted before theName
11403 theUseOri, theName = True, theUseOri
11404 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex, theUseOri)
11405 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11406 self._autoPublish(anObj, theName, "vertex")
11409 ## Get the first vertex of wire/edge depended orientation.
11410 # @param theShape Shape to find first vertex.
11411 # @param theName Object name; when specified, this parameter is used
11412 # for result publication in the study. Otherwise, if automatic
11413 # publication is switched on, default value is used for result name.
11415 # @return New GEOM.GEOM_Object, containing the created vertex.
11417 # @ref tui_measurement_tools_page "Example"
11418 def GetFirstVertex(self, theShape, theName=None):
11420 Get the first vertex of wire/edge depended orientation.
11423 theShape Shape to find first vertex.
11424 theName Object name; when specified, this parameter is used
11425 for result publication in the study. Otherwise, if automatic
11426 publication is switched on, default value is used for result name.
11429 New GEOM.GEOM_Object, containing the created vertex.
11431 # Example: see GEOM_TestMeasures.py
11432 # note: auto-publishing is done in self.GetVertexByIndex()
11433 return self.GetVertexByIndex(theShape, 0, True, theName)
11435 ## Get the last vertex of wire/edge depended orientation.
11436 # @param theShape Shape to find last vertex.
11437 # @param theName Object name; when specified, this parameter is used
11438 # for result publication in the study. Otherwise, if automatic
11439 # publication is switched on, default value is used for result name.
11441 # @return New GEOM.GEOM_Object, containing the created vertex.
11443 # @ref tui_measurement_tools_page "Example"
11444 def GetLastVertex(self, theShape, theName=None):
11446 Get the last vertex of wire/edge depended orientation.
11449 theShape Shape to find last vertex.
11450 theName Object name; when specified, this parameter is used
11451 for result publication in the study. Otherwise, if automatic
11452 publication is switched on, default value is used for result name.
11455 New GEOM.GEOM_Object, containing the created vertex.
11457 # Example: see GEOM_TestMeasures.py
11458 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11459 # note: auto-publishing is done in self.GetVertexByIndex()
11460 return self.GetVertexByIndex(theShape, (nb_vert-1), True, theName)
11462 ## Get a normale to the given face. If the point is not given,
11463 # the normale is calculated at the center of mass.
11464 # @param theFace Face to define normale of.
11465 # @param theOptionalPoint Point to compute the normale at.
11466 # @param theName Object name; when specified, this parameter is used
11467 # for result publication in the study. Otherwise, if automatic
11468 # publication is switched on, default value is used for result name.
11470 # @return New GEOM.GEOM_Object, containing the created vector.
11472 # @ref swig_todo "Example"
11473 @ManageTransactions("MeasuOp")
11474 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11476 Get a normale to the given face. If the point is not given,
11477 the normale is calculated at the center of mass.
11480 theFace Face to define normale of.
11481 theOptionalPoint Point to compute the normale at.
11482 theName Object name; when specified, this parameter is used
11483 for result publication in the study. Otherwise, if automatic
11484 publication is switched on, default value is used for result name.
11487 New GEOM.GEOM_Object, containing the created vector.
11489 # Example: see GEOM_TestMeasures.py
11490 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11491 RaiseIfFailed("GetNormal", self.MeasuOp)
11492 self._autoPublish(anObj, theName, "normal")
11495 ## Print shape errors obtained from CheckShape.
11496 # @param theShape Shape that was checked.
11497 # @param theShapeErrors the shape errors obtained by CheckShape.
11498 # @param theReturnStatus If 0 the description of problem is printed.
11499 # If 1 the description of problem is returned.
11500 # @return If theReturnStatus is equal to 1 the description is returned.
11501 # Otherwise doesn't return anything.
11503 # @ref tui_check_shape_page "Example"
11504 @ManageTransactions("MeasuOp")
11505 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11507 Print shape errors obtained from CheckShape.
11510 theShape Shape that was checked.
11511 theShapeErrors the shape errors obtained by CheckShape.
11512 theReturnStatus If 0 the description of problem is printed.
11513 If 1 the description of problem is returned.
11516 If theReturnStatus is equal to 1 the description is returned.
11517 Otherwise doesn't return anything.
11519 # Example: see GEOM_TestMeasures.py
11520 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11521 if theReturnStatus == 1:
11526 ## Check a topology of the given shape.
11527 # @param theShape Shape to check validity of.
11528 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11529 # if TRUE, the shape's geometry will be checked also.
11530 # @param theReturnStatus If 0 and if theShape is invalid, a description
11531 # of problem is printed.
11532 # If 1 isValid flag and the description of
11533 # problem is returned.
11534 # If 2 isValid flag and the list of error data
11536 # @return TRUE, if the shape "seems to be valid".
11537 # If theShape is invalid, prints a description of problem.
11538 # If theReturnStatus is equal to 1 the description is returned
11539 # along with IsValid flag.
11540 # If theReturnStatus is equal to 2 the list of error data is
11541 # returned along with IsValid flag.
11543 # @ref tui_check_shape_page "Example"
11544 @ManageTransactions("MeasuOp")
11545 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11547 Check a topology of the given shape.
11550 theShape Shape to check validity of.
11551 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11552 if TRUE, the shape's geometry will be checked also.
11553 theReturnStatus If 0 and if theShape is invalid, a description
11554 of problem is printed.
11555 If 1 IsValid flag and the description of
11556 problem is returned.
11557 If 2 IsValid flag and the list of error data
11561 TRUE, if the shape "seems to be valid".
11562 If theShape is invalid, prints a description of problem.
11563 If theReturnStatus is equal to 1 the description is returned
11564 along with IsValid flag.
11565 If theReturnStatus is equal to 2 the list of error data is
11566 returned along with IsValid flag.
11568 # Example: see GEOM_TestMeasures.py
11570 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11571 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11573 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11574 RaiseIfFailed("CheckShape", self.MeasuOp)
11576 if theReturnStatus == 0:
11577 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11579 if theReturnStatus == 1:
11580 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11581 return (IsValid, Descr)
11582 elif theReturnStatus == 2:
11583 return (IsValid, ShapeErrors)
11586 ## Detect self-intersections in the given shape.
11587 # @param theShape Shape to check.
11588 # @param theCheckLevel is the level of self-intersection check.
11589 # Possible input values are:
11590 # - GEOM.SI_V_V(0) - only V/V interferences
11591 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11592 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11593 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11594 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11595 # - GEOM.SI_ALL(5) - all interferences.
11596 # @return TRUE, if the shape contains no self-intersections.
11598 # @ref tui_check_self_intersections_page "Example"
11599 @ManageTransactions("MeasuOp")
11600 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11602 Detect self-intersections in the given shape.
11605 theShape Shape to check.
11606 theCheckLevel is the level of self-intersection check.
11607 Possible input values are:
11608 - GEOM.SI_V_V(0) - only V/V interferences
11609 - GEOM.SI_V_E(1) - V/V and V/E interferences
11610 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11611 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11612 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11613 - GEOM.SI_ALL(5) - all interferences.
11616 TRUE, if the shape contains no self-intersections.
11618 # Example: see GEOM_TestMeasures.py
11619 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11620 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11623 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11624 # @param theShape Shape to check.
11625 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11626 # - if \a theDeflection <= 0, default deflection 0.001 is used
11627 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11628 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11629 # - if \a theTolerance > 0, algorithm detects gaps
11630 # @return TRUE, if the shape contains no self-intersections.
11632 # @ref tui_check_self_intersections_fast_page "Example"
11633 @ManageTransactions("MeasuOp")
11634 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11636 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11639 theShape Shape to check.
11640 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11641 - if theDeflection <= 0, default deflection 0.001 is used
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
11647 TRUE, if the shape contains no self-intersections.
11649 # Example: see GEOM_TestMeasures.py
11650 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11651 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11654 ## Check boolean and partition operations arguments.
11655 # @param theShape the argument of an operation to be checked
11656 # @return TRUE if the argument is valid for a boolean or partition
11657 # operation; FALSE otherwise.
11658 @ManageTransactions("MeasuOp")
11659 def CheckBOPArguments(self, theShape):
11661 Check boolean and partition operations arguments.
11664 theShape the argument of an operation to be checked
11667 TRUE if the argument is valid for a boolean or partition
11668 operation; FALSE otherwise.
11670 return self.MeasuOp.CheckBOPArguments(theShape)
11672 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11673 # @param theShape1 First source object
11674 # @param theShape2 Second source object
11675 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11676 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11677 # - if \a theTolerance > 0, algorithm detects gaps
11678 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11679 # - if \a theDeflection <= 0, default deflection 0.001 is used
11680 # @return TRUE, if there are intersections (gaps) between source shapes
11681 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11682 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11684 # @ref tui_fast_intersection_page "Example"
11685 @ManageTransactions("MeasuOp")
11686 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11688 Detect intersections of the given shapes with algorithm based on mesh intersections.
11691 theShape1 First source object
11692 theShape2 Second source object
11693 theTolerance Specifies a distance between shapes used for detecting gaps:
11694 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11695 - if theTolerance > 0, algorithm detects gaps
11696 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11697 - if theDeflection <= 0, default deflection 0.001 is used
11700 TRUE, if there are intersections (gaps) between source shapes
11701 List of sub-shapes IDs from 1st shape that localize intersection.
11702 List of sub-shapes IDs from 2nd shape that localize intersection.
11704 # Example: see GEOM_TestMeasures.py
11705 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11706 RaiseIfFailed("FastIntersect", self.MeasuOp)
11707 return IsOk, Res1, Res2
11709 ## Get position (LCS) of theShape.
11711 # Origin of the LCS is situated at the shape's center of mass.
11712 # Axes of the LCS are obtained from shape's location or,
11713 # if the shape is a planar face, from position of its plane.
11715 # @param theShape Shape to calculate position of.
11716 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11717 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11718 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11719 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11721 # @ref swig_todo "Example"
11722 @ManageTransactions("MeasuOp")
11723 def GetPosition(self,theShape):
11725 Get position (LCS) of theShape.
11726 Origin of the LCS is situated at the shape's center of mass.
11727 Axes of the LCS are obtained from shape's location or,
11728 if the shape is a planar face, from position of its plane.
11731 theShape Shape to calculate position of.
11734 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11735 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11736 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11737 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11739 # Example: see GEOM_TestMeasures.py
11740 aTuple = self.MeasuOp.GetPosition(theShape)
11741 RaiseIfFailed("GetPosition", self.MeasuOp)
11744 ## Get kind of theShape.
11746 # @param theShape Shape to get a kind of.
11747 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11748 # and a list of parameters, describing the shape.
11749 # @note Concrete meaning of each value, returned via \a theIntegers
11750 # or \a theDoubles list depends on the kind() of the shape.
11752 # @ref swig_todo "Example"
11753 @ManageTransactions("MeasuOp")
11754 def KindOfShape(self,theShape):
11756 Get kind of theShape.
11759 theShape Shape to get a kind of.
11762 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11763 and a list of parameters, describing the shape.
11765 Concrete meaning of each value, returned via theIntegers
11766 or theDoubles list depends on the geompy.kind of the shape
11768 # Example: see GEOM_TestMeasures.py
11769 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11770 RaiseIfFailed("KindOfShape", self.MeasuOp)
11772 aKind = aRoughTuple[0]
11773 anInts = aRoughTuple[1]
11774 aDbls = aRoughTuple[2]
11776 # Now there is no exception from this rule:
11777 aKindTuple = [aKind] + aDbls + anInts
11779 # If they are we will regroup parameters for such kind of shape.
11781 #if aKind == kind.SOME_KIND:
11782 # # SOME_KIND int int double int double double
11783 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11787 ## The function takes a single face with holes and returns a list of faces,
11788 # first of them is the original face without holes, and the other faces are placed
11789 # on the same surface as the original face but bounded by each hole wire.
11790 # If the original face has no holes, it will be returned as an output
11791 # @param theShape Face to perform operation on.
11793 # @return GEOM.ListOfGO, list created faces, where first of them is the original face without holes
11794 @ManageTransactions("MeasuOp")
11795 def PatchFace(self, theShape):
11797 The function takes a single face with holes and returns a list of faces,
11798 first of them is the original face without holes, and the other faces are placed
11799 on the same surface as the original face but bounded by each hole wire.
11800 If the original face has no holes, it will be returned as an output
11803 theShape Face to perform operation on.
11806 GEOM.ListOfGO, list created faces, where first of them is the original face without holes
11809 Circle_1 = geompy.MakeCircle(None, None, 190)
11810 Circle_2 = geompy.MakeCircle(None, None, 100)
11811 Face_1 = geompy.MakeFaceWires([Circle_1], 1)
11812 Face_2 = geompy.MakeFaceWires([Circle_2], 1)
11813 Cut_1 = geompy.MakeCutList(Face_1, [Face_2], True)
11814 faces = geompy.PatchFace(Cut_1)
11816 aList = self.MeasuOp.PatchFace(theShape)
11817 RaiseIfFailed("PatchFace", self.MeasuOp)
11820 ## Returns the string that describes if the shell is good for solid.
11821 # This is a support method for MakeSolid.
11823 # @param theShell the shell to be checked.
11824 # @return Returns a string that describes the shell validity for
11825 # solid construction.
11826 @ManageTransactions("MeasuOp")
11827 def _IsGoodForSolid(self, theShell):
11829 Returns the string that describes if the shell is good for solid.
11830 This is a support method for MakeSolid.
11833 theShell the shell to be checked.
11836 Returns a string that describes the shell validity for
11837 solid construction.
11839 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11842 # end of l2_measure
11845 ## @addtogroup l2_import_export
11848 ## Import a shape from the BREP, IGES, STEP or other file
11849 # (depends on given format) with given name.
11851 # Note: this function is deprecated, it is kept for backward compatibility only
11852 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11854 # @param theFileName The file, containing the shape.
11855 # @param theFormatName Specify format for the file reading.
11856 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11857 # If format 'IGES_SCALE' is used instead of 'IGES' or
11858 # format 'STEP_SCALE' is used instead of 'STEP',
11859 # length unit will be set to 'meter' and result model will be scaled.
11860 # @param theName Object name; when specified, this parameter is used
11861 # for result publication in the study. Otherwise, if automatic
11862 # publication is switched on, default value is used for result name.
11864 # @return New GEOM.GEOM_Object, containing the imported shape.
11865 # If material names are imported it returns the list of
11866 # objects. The first one is the imported object followed by
11868 # @note Auto publishing is allowed for the shape itself. Imported
11869 # material groups are not automatically published.
11871 # @ref swig_Import_Export "Example"
11872 @ManageTransactions("InsertOp")
11873 def ImportFile(self, theFileName, theFormatName, theName=None):
11875 Import a shape from the BREP, IGES, STEP or other file
11876 (depends on given format) with given name.
11878 Note: this function is deprecated, it is kept for backward compatibility only
11879 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11882 theFileName The file, containing the shape.
11883 theFormatName Specify format for the file reading.
11884 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11885 If format 'IGES_SCALE' is used instead of 'IGES' or
11886 format 'STEP_SCALE' is used instead of 'STEP',
11887 length unit will be set to 'meter' and result model will be scaled.
11888 theName Object name; when specified, this parameter is used
11889 for result publication in the study. Otherwise, if automatic
11890 publication is switched on, default value is used for result name.
11893 New GEOM.GEOM_Object, containing the imported shape.
11894 If material names are imported it returns the list of
11895 objects. The first one is the imported object followed by
11898 Auto publishing is allowed for the shape itself. Imported
11899 material groups are not automatically published.
11901 # Example: see GEOM_TestOthers.py
11903 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11904 where <FormatName> is a name of desirable format for importing.
11906 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11907 RaiseIfFailed("ImportFile", self.InsertOp)
11908 aNbObj = len(aListObj)
11910 self._autoPublish(aListObj[0], theName, "imported")
11915 ## Deprecated analog of ImportFile()
11916 def Import(self, theFileName, theFormatName, theName=None):
11918 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11920 # note: auto-publishing is done in self.ImportFile()
11921 return self.ImportFile(theFileName, theFormatName, theName)
11923 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11925 # @note As the byte-stream representing the shape data can be quite large, this method
11926 # is not automatically dumped to the Python script with the DumpStudy functionality;
11927 # so please use this method carefully, only for strong reasons.
11929 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11932 # @param theStream The BRep binary stream.
11933 # @param theName Object name; when specified, this parameter is used
11934 # for result publication in the study. Otherwise, if automatic
11935 # publication is switched on, default value is used for result name.
11937 # @return New GEOM_Object, containing the shape, read from theStream.
11939 # @ref swig_Import_Export "Example"
11940 @ManageTransactions("InsertOp")
11941 def RestoreShape (self, theStream, theName=None):
11943 Read a shape from the binary stream, containing its bounding representation (BRep).
11946 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11949 theStream The BRep binary stream.
11950 theName Object name; when specified, this parameter is used
11951 for result publication in the study. Otherwise, if automatic
11952 publication is switched on, default value is used for result name.
11955 New GEOM_Object, containing the shape, read from theStream.
11957 # Example: see GEOM_TestOthers.py
11959 # this is the workaround to ignore invalid case when data stream is empty
11960 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11961 print("WARNING: Result of RestoreShape is a NULL shape!")
11963 anObj = self.InsertOp.RestoreShape(theStream)
11964 RaiseIfFailed("RestoreShape", self.InsertOp)
11965 self._autoPublish(anObj, theName, "restored")
11968 ## Export the given shape into a file with given name.
11970 # Note: this function is deprecated, it is kept for backward compatibility only
11971 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11973 # @param theObject Shape to be stored in the file.
11974 # @param theFileName Name of the file to store the given shape in.
11975 # @param theFormatName Specify format for the shape storage.
11976 # Available formats can be obtained with
11977 # geompy.InsertOp.ExportTranslators()[0] method.
11979 # @ref swig_Import_Export "Example"
11980 @ManageTransactions("InsertOp")
11981 def Export(self, theObject, theFileName, theFormatName):
11983 Export the given shape into a file with given name.
11985 Note: this function is deprecated, it is kept for backward compatibility only
11986 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11989 theObject Shape to be stored in the file.
11990 theFileName Name of the file to store the given shape in.
11991 theFormatName Specify format for the shape storage.
11992 Available formats can be obtained with
11993 geompy.InsertOp.ExportTranslators()[0] method.
11995 # Example: see GEOM_TestOthers.py
11997 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11998 where <FormatName> is a name of desirable format for exporting.
12000 self.InsertOp.Export(theObject, theFileName, theFormatName)
12001 if self.InsertOp.IsDone() == 0:
12002 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
12006 # end of l2_import_export
12009 ## @addtogroup l3_blocks
12012 ## Create a quadrangle face from four edges. Order of Edges is not
12013 # important. It is not necessary that edges share the same vertex.
12014 # @param E1,E2,E3,E4 Edges for the face bound.
12015 # @param theName Object name; when specified, this parameter is used
12016 # for result publication in the study. Otherwise, if automatic
12017 # publication is switched on, default value is used for result name.
12019 # @return New GEOM.GEOM_Object, containing the created face.
12021 # @ref tui_building_by_blocks_page "Example"
12022 @ManageTransactions("BlocksOp")
12023 def MakeQuad(self, E1, E2, E3, E4, theName=None):
12025 Create a quadrangle face from four edges. Order of Edges is not
12026 important. It is not necessary that edges share the same vertex.
12029 E1,E2,E3,E4 Edges for the face bound.
12030 theName Object name; when specified, this parameter is used
12031 for result publication in the study. Otherwise, if automatic
12032 publication is switched on, default value is used for result name.
12035 New GEOM.GEOM_Object, containing the created face.
12038 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
12040 # Example: see GEOM_Spanner.py
12041 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
12042 RaiseIfFailed("MakeQuad", self.BlocksOp)
12043 self._autoPublish(anObj, theName, "quad")
12046 ## Create a quadrangle face on two edges.
12047 # The missing edges will be built by creating the shortest ones.
12048 # @param E1,E2 Two opposite edges for the face.
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 face.
12055 # @ref tui_building_by_blocks_page "Example"
12056 @ManageTransactions("BlocksOp")
12057 def MakeQuad2Edges(self, E1, E2, theName=None):
12059 Create a quadrangle face on two edges.
12060 The missing edges will be built by creating the shortest ones.
12063 E1,E2 Two opposite edges for the face.
12064 theName Object name; when specified, this parameter is used
12065 for result publication in the study. Otherwise, if automatic
12066 publication is switched on, default value is used for result name.
12069 New GEOM.GEOM_Object, containing the created face.
12073 p1 = geompy.MakeVertex( 0., 0., 0.)
12074 p2 = geompy.MakeVertex(150., 30., 0.)
12075 p3 = geompy.MakeVertex( 0., 120., 50.)
12076 p4 = geompy.MakeVertex( 0., 40., 70.)
12078 edge1 = geompy.MakeEdge(p1, p2)
12079 edge2 = geompy.MakeEdge(p3, p4)
12080 # create a quadrangle face from two edges
12081 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
12083 # Example: see GEOM_Spanner.py
12084 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
12085 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
12086 self._autoPublish(anObj, theName, "quad")
12089 ## Create a quadrangle face with specified corners.
12090 # The missing edges will be built by creating the shortest ones.
12091 # @param V1,V2,V3,V4 Corner vertices for the face.
12092 # @param theName Object name; when specified, this parameter is used
12093 # for result publication in the study. Otherwise, if automatic
12094 # publication is switched on, default value is used for result name.
12096 # @return New GEOM.GEOM_Object, containing the created face.
12098 # @ref tui_building_by_blocks_page "Example 1"
12099 # \n @ref swig_MakeQuad4Vertices "Example 2"
12100 @ManageTransactions("BlocksOp")
12101 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12103 Create a quadrangle face with specified corners.
12104 The missing edges will be built by creating the shortest ones.
12107 V1,V2,V3,V4 Corner vertices for the face.
12108 theName Object name; when specified, this parameter is used
12109 for result publication in the study. Otherwise, if automatic
12110 publication is switched on, default value is used for result name.
12113 New GEOM.GEOM_Object, containing the created face.
12117 p1 = geompy.MakeVertex( 0., 0., 0.)
12118 p2 = geompy.MakeVertex(150., 30., 0.)
12119 p3 = geompy.MakeVertex( 0., 120., 50.)
12120 p4 = geompy.MakeVertex( 0., 40., 70.)
12121 # create a quadrangle from four points in its corners
12122 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12124 # Example: see GEOM_Spanner.py
12125 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12126 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12127 self._autoPublish(anObj, theName, "quad")
12130 ## Create a hexahedral solid, bounded by the six given faces. Order of
12131 # faces is not important. It is not necessary that Faces share the same edge.
12132 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12133 # @param theName Object name; when specified, this parameter is used
12134 # for result publication in the study. Otherwise, if automatic
12135 # publication is switched on, default value is used for result name.
12137 # @return New GEOM.GEOM_Object, containing the created solid.
12139 # @ref tui_building_by_blocks_page "Example 1"
12140 # \n @ref swig_MakeHexa "Example 2"
12141 @ManageTransactions("BlocksOp")
12142 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12144 Create a hexahedral solid, bounded by the six given faces. Order of
12145 faces is not important. It is not necessary that Faces share the same edge.
12148 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12149 theName Object name; when specified, this parameter is used
12150 for result publication in the study. Otherwise, if automatic
12151 publication is switched on, default value is used for result name.
12154 New GEOM.GEOM_Object, containing the created solid.
12157 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12159 # Example: see GEOM_Spanner.py
12160 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12161 RaiseIfFailed("MakeHexa", self.BlocksOp)
12162 self._autoPublish(anObj, theName, "hexa")
12165 ## Create a hexahedral solid between two given faces.
12166 # The missing faces will be built by creating the smallest ones.
12167 # @param F1,F2 Two opposite faces for the hexahedral solid.
12168 # @param theName Object name; when specified, this parameter is used
12169 # for result publication in the study. Otherwise, if automatic
12170 # publication is switched on, default value is used for result name.
12172 # @return New GEOM.GEOM_Object, containing the created solid.
12174 # @ref tui_building_by_blocks_page "Example 1"
12175 # \n @ref swig_MakeHexa2Faces "Example 2"
12176 @ManageTransactions("BlocksOp")
12177 def MakeHexa2Faces(self, F1, F2, theName=None):
12179 Create a hexahedral solid between two given faces.
12180 The missing faces will be built by creating the smallest ones.
12183 F1,F2 Two opposite faces for the hexahedral solid.
12184 theName Object name; when specified, this parameter is used
12185 for result publication in the study. Otherwise, if automatic
12186 publication is switched on, default value is used for result name.
12189 New GEOM.GEOM_Object, containing the created solid.
12192 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12194 # Example: see GEOM_Spanner.py
12195 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12196 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12197 self._autoPublish(anObj, theName, "hexa")
12203 ## @addtogroup l3_blocks_op
12206 ## Get a vertex, found in the given shape by its coordinates.
12207 # @param theShape Block or a compound of blocks.
12208 # @param theX,theY,theZ Coordinates of the sought vertex.
12209 # @param theEpsilon Maximum allowed distance between the resulting
12210 # vertex and point with the given coordinates.
12211 # @param theName Object name; when specified, this parameter is used
12212 # for result publication in the study. Otherwise, if automatic
12213 # publication is switched on, default value is used for result name.
12215 # @return New GEOM.GEOM_Object, containing the found vertex.
12217 # @ref swig_GetPoint "Example"
12218 @ManageTransactions("BlocksOp")
12219 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12221 Get a vertex, found in the given shape by its coordinates.
12224 theShape Block or a compound of blocks.
12225 theX,theY,theZ Coordinates of the sought vertex.
12226 theEpsilon Maximum allowed distance between the resulting
12227 vertex and point with the given coordinates.
12228 theName Object name; when specified, this parameter is used
12229 for result publication in the study. Otherwise, if automatic
12230 publication is switched on, default value is used for result name.
12233 New GEOM.GEOM_Object, containing the found vertex.
12236 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12238 # Example: see GEOM_TestOthers.py
12239 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12240 RaiseIfFailed("GetPoint", self.BlocksOp)
12241 self._autoPublish(anObj, theName, "vertex")
12244 ## Find a vertex of the given shape, which has minimal distance to the given point.
12245 # @param theShape Any shape.
12246 # @param thePoint Point, close to the desired vertex.
12247 # @param theName Object name; when specified, this parameter is used
12248 # for result publication in the study. Otherwise, if automatic
12249 # publication is switched on, default value is used for result name.
12251 # @return New GEOM.GEOM_Object, containing the found vertex.
12253 # @ref swig_GetVertexNearPoint "Example"
12254 @ManageTransactions("BlocksOp")
12255 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12257 Find a vertex of the given shape, which has minimal distance to the given point.
12260 theShape Any shape.
12261 thePoint Point, close to the desired vertex.
12262 theName Object name; when specified, this parameter is used
12263 for result publication in the study. Otherwise, if automatic
12264 publication is switched on, default value is used for result name.
12267 New GEOM.GEOM_Object, containing the found vertex.
12270 pmidle = geompy.MakeVertex(50, 0, 50)
12271 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12273 # Example: see GEOM_TestOthers.py
12274 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12275 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12276 self._autoPublish(anObj, theName, "vertex")
12279 ## Get an edge, found in the given shape by two given vertices.
12280 # @param theShape Block or a compound of blocks.
12281 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12282 # @param theName Object name; when specified, this parameter is used
12283 # for result publication in the study. Otherwise, if automatic
12284 # publication is switched on, default value is used for result name.
12286 # @return New GEOM.GEOM_Object, containing the found edge.
12288 # @ref swig_GetEdge "Example"
12289 @ManageTransactions("BlocksOp")
12290 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12292 Get an edge, found in the given shape by two given vertices.
12295 theShape Block or a compound of blocks.
12296 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12297 theName Object name; when specified, this parameter is used
12298 for result publication in the study. Otherwise, if automatic
12299 publication is switched on, default value is used for result name.
12302 New GEOM.GEOM_Object, containing the found edge.
12304 # Example: see GEOM_Spanner.py
12305 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12306 RaiseIfFailed("GetEdge", self.BlocksOp)
12307 self._autoPublish(anObj, theName, "edge")
12310 ## Find an edge of the given shape, which has minimal distance to the given point.
12311 # @param theShape Block or a compound of blocks.
12312 # @param thePoint Point, close to the desired edge.
12313 # @param theName Object name; when specified, this parameter is used
12314 # for result publication in the study. Otherwise, if automatic
12315 # publication is switched on, default value is used for result name.
12317 # @return New GEOM.GEOM_Object, containing the found edge.
12319 # @ref swig_GetEdgeNearPoint "Example"
12320 @ManageTransactions("BlocksOp")
12321 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12323 Find an edge of the given shape, which has minimal distance to the given point.
12326 theShape Block or a compound of blocks.
12327 thePoint Point, close to the desired edge.
12328 theName Object name; when specified, this parameter is used
12329 for result publication in the study. Otherwise, if automatic
12330 publication is switched on, default value is used for result name.
12333 New GEOM.GEOM_Object, containing the found edge.
12335 # Example: see GEOM_TestOthers.py
12336 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12337 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12338 self._autoPublish(anObj, theName, "edge")
12341 ## Returns a face, found in the given shape by four given corner vertices.
12342 # @param theShape Block or a compound of blocks.
12343 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12344 # @param theName Object name; when specified, this parameter is used
12345 # for result publication in the study. Otherwise, if automatic
12346 # publication is switched on, default value is used for result name.
12348 # @return New GEOM.GEOM_Object, containing the found face.
12350 # @ref swig_todo "Example"
12351 @ManageTransactions("BlocksOp")
12352 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12354 Returns a face, found in the given shape by four given corner vertices.
12357 theShape Block or a compound of blocks.
12358 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12359 theName Object name; when specified, this parameter is used
12360 for result publication in the study. Otherwise, if automatic
12361 publication is switched on, default value is used for result name.
12364 New GEOM.GEOM_Object, containing the found face.
12366 # Example: see GEOM_Spanner.py
12367 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12368 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12369 self._autoPublish(anObj, theName, "face")
12372 ## Get a face of block, found in the given shape by two given edges.
12373 # @param theShape Block or a compound of blocks.
12374 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12375 # @param theName Object name; when specified, this parameter is used
12376 # for result publication in the study. Otherwise, if automatic
12377 # publication is switched on, default value is used for result name.
12379 # @return New GEOM.GEOM_Object, containing the found face.
12381 # @ref swig_todo "Example"
12382 @ManageTransactions("BlocksOp")
12383 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12385 Get a face of block, found in the given shape by two given edges.
12388 theShape Block or a compound of blocks.
12389 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12390 theName Object name; when specified, this parameter is used
12391 for result publication in the study. Otherwise, if automatic
12392 publication is switched on, default value is used for result name.
12395 New GEOM.GEOM_Object, containing the found face.
12397 # Example: see GEOM_Spanner.py
12398 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12399 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12400 self._autoPublish(anObj, theName, "face")
12403 ## Find a face, opposite to the given one in the given block.
12404 # @param theBlock Must be a hexahedral solid.
12405 # @param theFace Face of \a theBlock, opposite to the desired face.
12406 # @param theName Object name; when specified, this parameter is used
12407 # for result publication in the study. Otherwise, if automatic
12408 # publication is switched on, default value is used for result name.
12410 # @return New GEOM.GEOM_Object, containing the found face.
12412 # @ref swig_GetOppositeFace "Example"
12413 @ManageTransactions("BlocksOp")
12414 def GetOppositeFace(self, theBlock, theFace, theName=None):
12416 Find a face, opposite to the given one in the given block.
12419 theBlock Must be a hexahedral solid.
12420 theFace Face of theBlock, opposite to the desired face.
12421 theName Object name; when specified, this parameter is used
12422 for result publication in the study. Otherwise, if automatic
12423 publication is switched on, default value is used for result name.
12426 New GEOM.GEOM_Object, containing the found face.
12428 # Example: see GEOM_Spanner.py
12429 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12430 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12431 self._autoPublish(anObj, theName, "face")
12434 ## Find a face of the given shape, which has minimal distance to the given point.
12435 # @param theShape Block or a compound of blocks.
12436 # @param thePoint Point, close to the desired face.
12437 # @param theName Object name; when specified, this parameter is used
12438 # for result publication in the study. Otherwise, if automatic
12439 # publication is switched on, default value is used for result name.
12441 # @return New GEOM.GEOM_Object, containing the found face.
12443 # @ref swig_GetFaceNearPoint "Example"
12444 @ManageTransactions("BlocksOp")
12445 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12447 Find a face of the given shape, which has minimal distance to the given point.
12450 theShape Block or a compound of blocks.
12451 thePoint Point, close to the desired face.
12452 theName Object name; when specified, this parameter is used
12453 for result publication in the study. Otherwise, if automatic
12454 publication is switched on, default value is used for result name.
12457 New GEOM.GEOM_Object, containing the found face.
12459 # Example: see GEOM_Spanner.py
12460 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12461 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12462 self._autoPublish(anObj, theName, "face")
12465 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12466 # @param theBlock Block or a compound of blocks.
12467 # @param theVector Vector, close to the normale of the desired face.
12468 # @param theName Object name; when specified, this parameter is used
12469 # for result publication in the study. Otherwise, if automatic
12470 # publication is switched on, default value is used for result name.
12472 # @return New GEOM.GEOM_Object, containing the found face.
12474 # @ref swig_todo "Example"
12475 @ManageTransactions("BlocksOp")
12476 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12478 Find a face of block, whose outside normale has minimal angle with the given vector.
12481 theBlock Block or a compound of blocks.
12482 theVector Vector, close to the normale of the desired face.
12483 theName Object name; when specified, this parameter is used
12484 for result publication in the study. Otherwise, if automatic
12485 publication is switched on, default value is used for result name.
12488 New GEOM.GEOM_Object, containing the found face.
12490 # Example: see GEOM_Spanner.py
12491 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12492 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12493 self._autoPublish(anObj, theName, "face")
12496 ## Find all sub-shapes of type \a theShapeType of the given shape,
12497 # which have minimal distance to the given point.
12498 # @param theShape Any shape.
12499 # @param thePoint Point, close to the desired shape.
12500 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12501 # @param theTolerance The tolerance for distances comparison. All shapes
12502 # with distances to the given point in interval
12503 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12504 # @param theName Object name; when specified, this parameter is used
12505 # for result publication in the study. Otherwise, if automatic
12506 # publication is switched on, default value is used for result name.
12508 # @return New GEOM_Object, containing a group of all found shapes.
12510 # @ref swig_GetShapesNearPoint "Example"
12511 @ManageTransactions("BlocksOp")
12512 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12514 Find all sub-shapes of type theShapeType of the given shape,
12515 which have minimal distance to the given point.
12518 theShape Any shape.
12519 thePoint Point, close to the desired shape.
12520 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12521 theTolerance The tolerance for distances comparison. All shapes
12522 with distances to the given point in interval
12523 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12524 theName Object name; when specified, this parameter is used
12525 for result publication in the study. Otherwise, if automatic
12526 publication is switched on, default value is used for result name.
12529 New GEOM_Object, containing a group of all found shapes.
12531 # Example: see GEOM_TestOthers.py
12532 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12533 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12534 self._autoPublish(anObj, theName, "group")
12537 # end of l3_blocks_op
12540 ## @addtogroup l4_blocks_measure
12543 ## Check, if the compound of blocks is given.
12544 # To be considered as a compound of blocks, the
12545 # given shape must satisfy the following conditions:
12546 # - Each element of the compound should be a Block (6 faces).
12547 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12548 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12549 # there are more than 4 edges in the only wire of a face,
12550 # this face is considered to be quadrangle if it has 4 bounds
12551 # (1 or more edge) of C1 continuity.
12552 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12553 # - The compound should be connexe.
12554 # - The glue between two quadrangle faces should be applied.
12555 # @param theCompound The compound to check.
12556 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12557 # taking into account C1 continuity.
12558 # @param theAngTolerance the angular tolerance to check if two neighbor
12559 # edges are codirectional in the common vertex with this
12560 # tolerance. This parameter is used only if
12561 # <VAR>theIsUseC1</VAR> is set to True.
12562 # @return TRUE, if the given shape is a compound of blocks.
12563 # If theCompound is not valid, prints all discovered errors.
12565 # @ref tui_check_compound_of_blocks_page "Example 1"
12566 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12567 @ManageTransactions("BlocksOp")
12568 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12569 theAngTolerance = 1.e-12):
12571 Check, if the compound of blocks is given.
12572 To be considered as a compound of blocks, the
12573 given shape must satisfy the following conditions:
12574 - Each element of the compound should be a Block (6 faces).
12575 - Each face should be a quadrangle, i.e. it should have only 1 wire
12576 with 4 edges. If theIsUseC1 is set to True and
12577 there are more than 4 edges in the only wire of a face,
12578 this face is considered to be quadrangle if it has 4 bounds
12579 (1 or more edge) of C1 continuity.
12580 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12581 - The compound should be connexe.
12582 - The glue between two quadrangle faces should be applied.
12585 theCompound The compound to check.
12586 theIsUseC1 Flag to check if there are 4 bounds on a face
12587 taking into account C1 continuity.
12588 theAngTolerance the angular tolerance to check if two neighbor
12589 edges are codirectional in the common vertex with this
12590 tolerance. This parameter is used only if
12591 theIsUseC1 is set to True.
12594 TRUE, if the given shape is a compound of blocks.
12595 If theCompound is not valid, prints all discovered errors.
12597 # Example: see GEOM_Spanner.py
12600 aTolerance = theAngTolerance
12601 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12602 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12604 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12608 ## Retrieve all non blocks solids and faces from \a theShape.
12609 # @param theShape The shape to explore.
12610 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12611 # taking into account C1 continuity.
12612 # @param theAngTolerance the angular tolerance to check if two neighbor
12613 # edges are codirectional in the common vertex with this
12614 # tolerance. This parameter is used only if
12615 # <VAR>theIsUseC1</VAR> is set to True.
12616 # @param theName Object name; when specified, this parameter is used
12617 # for result publication in the study. Otherwise, if automatic
12618 # publication is switched on, default value is used for result name.
12620 # @return A tuple of two GEOM_Objects. The first object is a group of all
12621 # non block solids (= not 6 faces, or with 6 faces, but with the
12622 # presence of non-quadrangular faces). The second object is a
12623 # group of all non quadrangular faces (= faces with more then
12624 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12625 # with 1 wire with not 4 edges that do not form 4 bounds of
12628 # @ref tui_get_non_blocks_page "Example 1"
12629 # \n @ref swig_GetNonBlocks "Example 2"
12630 @ManageTransactions("BlocksOp")
12631 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12632 theAngTolerance = 1.e-12, theName=None):
12634 Retrieve all non blocks solids and faces from theShape.
12637 theShape The shape to explore.
12638 theIsUseC1 Flag to check if there are 4 bounds on a face
12639 taking into account C1 continuity.
12640 theAngTolerance the angular tolerance to check if two neighbor
12641 edges are codirectional in the common vertex with this
12642 tolerance. This parameter is used only if
12643 theIsUseC1 is set to True.
12644 theName Object name; when specified, this parameter is used
12645 for result publication in the study. Otherwise, if automatic
12646 publication is switched on, default value is used for result name.
12649 A tuple of two GEOM_Objects. The first object is a group of all
12650 non block solids (= not 6 faces, or with 6 faces, but with the
12651 presence of non-quadrangular faces). The second object is a
12652 group of all non quadrangular faces (= faces with more then
12653 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12654 with 1 wire with not 4 edges that do not form 4 bounds of
12658 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12660 # Example: see GEOM_Spanner.py
12663 aTolerance = theAngTolerance
12664 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12665 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12666 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12669 ## Remove all seam and degenerated edges from \a theShape.
12670 # Unite faces and edges, sharing one surface. It means that
12671 # this faces must have references to one C++ surface object (handle).
12672 # @param theShape The compound or single solid to remove irregular edges from.
12673 # @param doUnionFaces If True, then unite faces. If False (the default value),
12674 # do not unite faces.
12675 # @param theName Object name; when specified, this parameter is used
12676 # for result publication in the study. Otherwise, if automatic
12677 # publication is switched on, default value is used for result name.
12679 # @return Improved shape.
12681 # @ref swig_RemoveExtraEdges "Example"
12682 @ManageTransactions("BlocksOp")
12683 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12685 Remove all seam and degenerated edges from theShape.
12686 Unite faces and edges, sharing one surface. It means that
12687 this faces must have references to one C++ surface object (handle).
12690 theShape The compound or single solid to remove irregular edges from.
12691 doUnionFaces If True, then unite faces. If False (the default value),
12692 do not unite faces.
12693 theName Object name; when specified, this parameter is used
12694 for result publication in the study. Otherwise, if automatic
12695 publication is switched on, default value is used for result name.
12700 # Example: see GEOM_TestOthers.py
12701 nbFacesOptimum = -1 # -1 means do not unite faces
12702 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12703 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12704 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12705 self._autoPublish(anObj, theName, "removeExtraEdges")
12708 ## Performs union faces of \a theShape
12709 # Unite faces sharing one surface. It means that
12710 # these faces must have references to one C++ surface object (handle).
12711 # @param theShape The compound or single solid that contains faces
12712 # to perform union.
12713 # @param theName Object name; when specified, this parameter is used
12714 # for result publication in the study. Otherwise, if automatic
12715 # publication is switched on, default value is used for result name.
12717 # @return Improved shape.
12719 # @ref swig_UnionFaces "Example"
12720 @ManageTransactions("BlocksOp")
12721 def UnionFaces(self, theShape, theName=None):
12723 Performs union faces of theShape.
12724 Unite faces sharing one surface. It means that
12725 these faces must have references to one C++ surface object (handle).
12728 theShape The compound or single solid that contains faces
12730 theName Object name; when specified, this parameter is used
12731 for result publication in the study. Otherwise, if automatic
12732 publication is switched on, default value is used for result name.
12737 # Example: see GEOM_TestOthers.py
12738 anObj = self.BlocksOp.UnionFaces(theShape)
12739 RaiseIfFailed("UnionFaces", self.BlocksOp)
12740 self._autoPublish(anObj, theName, "unionFaces")
12743 ## Check, if the given shape is a blocks compound.
12744 # Fix all detected errors.
12745 # \note Single block can be also fixed by this method.
12746 # @param theShape The compound to check and improve.
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 Improved compound.
12753 # @ref swig_CheckAndImprove "Example"
12754 @ManageTransactions("BlocksOp")
12755 def CheckAndImprove(self, theShape, theName=None):
12757 Check, if the given shape is a blocks compound.
12758 Fix all detected errors.
12761 Single block can be also fixed by this method.
12764 theShape The compound to check and improve.
12765 theName Object name; when specified, this parameter is used
12766 for result publication in the study. Otherwise, if automatic
12767 publication is switched on, default value is used for result name.
12772 # Example: see GEOM_TestOthers.py
12773 anObj = self.BlocksOp.CheckAndImprove(theShape)
12774 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12775 self._autoPublish(anObj, theName, "improved")
12778 # end of l4_blocks_measure
12781 ## @addtogroup l3_blocks_op
12784 ## Get all the blocks, contained in the given compound.
12785 # @param theCompound The compound to explode.
12786 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12787 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12788 # @param theName Object name; when specified, this parameter is used
12789 # for result publication in the study. Otherwise, if automatic
12790 # publication is switched on, default value is used for result name.
12792 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12794 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12796 # @ref tui_explode_on_blocks "Example 1"
12797 # \n @ref swig_MakeBlockExplode "Example 2"
12798 @ManageTransactions("BlocksOp")
12799 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12801 Get all the blocks, contained in the given compound.
12804 theCompound The compound to explode.
12805 theMinNbFaces If solid has lower number of faces, it is not a block.
12806 theMaxNbFaces If solid has higher number of faces, it is not a block.
12807 theName Object name; when specified, this parameter is used
12808 for result publication in the study. Otherwise, if automatic
12809 publication is switched on, default value is used for result name.
12812 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12815 List of GEOM.GEOM_Object, containing the retrieved blocks.
12817 # Example: see GEOM_TestOthers.py
12818 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12819 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12820 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12821 for anObj in aList:
12822 anObj.SetParameters(Parameters)
12824 self._autoPublish(aList, theName, "block")
12827 ## Find block, containing the given point inside its volume or on boundary.
12828 # @param theCompound Compound, to find block in.
12829 # @param thePoint Point, close to the desired block. If the point lays on
12830 # boundary between some blocks, we return block with nearest center.
12831 # @param theName Object name; when specified, this parameter is used
12832 # for result publication in the study. Otherwise, if automatic
12833 # publication is switched on, default value is used for result name.
12835 # @return New GEOM.GEOM_Object, containing the found block.
12837 # @ref swig_todo "Example"
12838 @ManageTransactions("BlocksOp")
12839 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12841 Find block, containing the given point inside its volume or on boundary.
12844 theCompound Compound, to find block in.
12845 thePoint Point, close to the desired block. If the point lays on
12846 boundary between some blocks, we return block with nearest center.
12847 theName Object name; when specified, this parameter is used
12848 for result publication in the study. Otherwise, if automatic
12849 publication is switched on, default value is used for result name.
12852 New GEOM.GEOM_Object, containing the found block.
12854 # Example: see GEOM_Spanner.py
12855 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12856 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12857 self._autoPublish(anObj, theName, "block")
12860 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12861 # @param theCompound Compound, to find block in.
12862 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12863 # @param theName Object name; when specified, this parameter is used
12864 # for result publication in the study. Otherwise, if automatic
12865 # publication is switched on, default value is used for result name.
12867 # @return New GEOM.GEOM_Object, containing the found block.
12869 # @ref swig_GetBlockByParts "Example"
12870 @ManageTransactions("BlocksOp")
12871 def GetBlockByParts(self, theCompound, theParts, theName=None):
12873 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12876 theCompound Compound, to find block in.
12877 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12878 theName Object name; when specified, this parameter is used
12879 for result publication in the study. Otherwise, if automatic
12880 publication is switched on, default value is used for result name.
12883 New GEOM_Object, containing the found block.
12885 # Example: see GEOM_TestOthers.py
12886 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12887 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12888 self._autoPublish(anObj, theName, "block")
12891 ## Return all blocks, containing all the elements, passed as the parts.
12892 # @param theCompound Compound, to find blocks in.
12893 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12894 # @param theName Object name; when specified, this parameter is used
12895 # for result publication in the study. Otherwise, if automatic
12896 # publication is switched on, default value is used for result name.
12898 # @return List of GEOM.GEOM_Object, containing the found blocks.
12900 # @ref swig_todo "Example"
12901 @ManageTransactions("BlocksOp")
12902 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12904 Return all blocks, containing all the elements, passed as the parts.
12907 theCompound Compound, to find blocks in.
12908 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12909 theName Object name; when specified, this parameter is used
12910 for result publication in the study. Otherwise, if automatic
12911 publication is switched on, default value is used for result name.
12914 List of GEOM.GEOM_Object, containing the found blocks.
12916 # Example: see GEOM_Spanner.py
12917 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12918 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12919 self._autoPublish(aList, theName, "block")
12922 ## Multi-transformate block and glue the result.
12923 # Transformation is defined so, as to superpose direction faces.
12924 # @param Block Hexahedral solid to be multi-transformed.
12925 # @param DirFace1 ID of First direction face.
12926 # @param DirFace2 ID of Second direction face.
12927 # @param NbTimes Quantity of transformations to be done.
12928 # @param theName Object name; when specified, this parameter is used
12929 # for result publication in the study. Otherwise, if automatic
12930 # publication is switched on, default value is used for result name.
12932 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12934 # @return New GEOM.GEOM_Object, containing the result shape.
12936 # @ref tui_multi_transformation "Example"
12937 @ManageTransactions("BlocksOp")
12938 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12940 Multi-transformate block and glue the result.
12941 Transformation is defined so, as to superpose direction faces.
12944 Block Hexahedral solid to be multi-transformed.
12945 DirFace1 ID of First direction face.
12946 DirFace2 ID of Second direction face.
12947 NbTimes Quantity of transformations to be done.
12948 theName Object name; when specified, this parameter is used
12949 for result publication in the study. Otherwise, if automatic
12950 publication is switched on, default value is used for result name.
12953 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12956 New GEOM.GEOM_Object, containing the result shape.
12958 # Example: see GEOM_Spanner.py
12959 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12960 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12961 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12962 anObj.SetParameters(Parameters)
12963 self._autoPublish(anObj, theName, "transformed")
12966 ## Multi-transformate block and glue the result.
12967 # @param Block Hexahedral solid to be multi-transformed.
12968 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12969 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12970 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12971 # @param theName Object name; when specified, this parameter is used
12972 # for result publication in the study. Otherwise, if automatic
12973 # publication is switched on, default value is used for result name.
12975 # @return New GEOM.GEOM_Object, containing the result shape.
12977 # @ref tui_multi_transformation "Example"
12978 @ManageTransactions("BlocksOp")
12979 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12980 DirFace1V, DirFace2V, NbTimesV, theName=None):
12982 Multi-transformate block and glue the result.
12985 Block Hexahedral solid to be multi-transformed.
12986 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12987 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12988 NbTimesU,NbTimesV Quantity of transformations to be done.
12989 theName Object name; when specified, this parameter is used
12990 for result publication in the study. Otherwise, if automatic
12991 publication is switched on, default value is used for result name.
12994 New GEOM.GEOM_Object, containing the result shape.
12996 # Example: see GEOM_Spanner.py
12997 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12998 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12999 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
13000 DirFace1V, DirFace2V, NbTimesV)
13001 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
13002 anObj.SetParameters(Parameters)
13003 self._autoPublish(anObj, theName, "transformed")
13006 ## Build all possible propagation groups.
13007 # Propagation group is a set of all edges, opposite to one (main)
13008 # edge of this group directly or through other opposite edges.
13009 # Notion of Opposite Edge make sense only on quadrangle face.
13010 # @param theShape Shape to build propagation groups on.
13011 # @param theName Object name; when specified, this parameter is used
13012 # for result publication in the study. Otherwise, if automatic
13013 # publication is switched on, default value is used for result name.
13015 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
13017 # @ref swig_Propagate "Example"
13018 @ManageTransactions("BlocksOp")
13019 def Propagate(self, theShape, theName=None):
13021 Build all possible propagation groups.
13022 Propagation group is a set of all edges, opposite to one (main)
13023 edge of this group directly or through other opposite edges.
13024 Notion of Opposite Edge make sense only on quadrangle face.
13027 theShape Shape to build propagation groups on.
13028 theName Object name; when specified, this parameter is used
13029 for result publication in the study. Otherwise, if automatic
13030 publication is switched on, default value is used for result name.
13033 List of GEOM.GEOM_Object, each of them is a propagation group.
13035 # Example: see GEOM_TestOthers.py
13036 listChains = self.BlocksOp.Propagate(theShape)
13037 RaiseIfFailed("Propagate", self.BlocksOp)
13038 self._autoPublish(listChains, theName, "propagate")
13041 # end of l3_blocks_op
13044 ## @addtogroup l3_groups
13047 ## Creates a new group which will store sub-shapes of theMainShape
13048 # @param theMainShape is a GEOM object on which the group is selected
13049 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
13050 # @param theName Object name; when specified, this parameter is used
13051 # for result publication in the study. Otherwise, if automatic
13052 # publication is switched on, default value is used for result name.
13054 # @return a newly created GEOM group (GEOM.GEOM_Object)
13056 # @ref tui_working_with_groups_page "Example 1"
13057 # \n @ref swig_CreateGroup "Example 2"
13058 @ManageTransactions("GroupOp")
13059 def CreateGroup(self, theMainShape, theShapeType, theName=None):
13061 Creates a new group which will store sub-shapes of theMainShape
13064 theMainShape is a GEOM object on which the group is selected
13065 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
13066 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
13067 theName Object name; when specified, this parameter is used
13068 for result publication in the study. Otherwise, if automatic
13069 publication is switched on, default value is used for result name.
13072 a newly created GEOM group
13075 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
13078 # Example: see GEOM_TestOthers.py
13079 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
13080 RaiseIfFailed("CreateGroup", self.GroupOp)
13081 self._autoPublish(anObj, theName, "group")
13084 ## Adds a sub-object with ID theSubShapeId to the group
13085 # @param theGroup is a GEOM group to which the new sub-shape is added
13086 # @param theSubShapeID is a sub-shape ID in the main object.
13087 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13089 # @ref tui_working_with_groups_page "Example"
13090 @ManageTransactions("GroupOp")
13091 def AddObject(self,theGroup, theSubShapeID):
13093 Adds a sub-object with ID theSubShapeId to the group
13096 theGroup is a GEOM group to which the new sub-shape is added
13097 theSubShapeID is a sub-shape ID in the main object.
13100 Use method GetSubShapeID() to get an unique ID of the sub-shape
13102 # Example: see GEOM_TestOthers.py
13103 self.GroupOp.AddObject(theGroup, theSubShapeID)
13104 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13105 RaiseIfFailed("AddObject", self.GroupOp)
13109 ## Removes a sub-object with ID \a theSubShapeId from the group
13110 # @param theGroup is a GEOM group from which the new sub-shape is removed
13111 # @param theSubShapeID is a sub-shape ID in the main object.
13112 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13114 # @ref tui_working_with_groups_page "Example"
13115 @ManageTransactions("GroupOp")
13116 def RemoveObject(self,theGroup, theSubShapeID):
13118 Removes a sub-object with ID theSubShapeId from the group
13121 theGroup is a GEOM group from which the new sub-shape is removed
13122 theSubShapeID is a sub-shape ID in the main object.
13125 Use method GetSubShapeID() to get an unique ID of the sub-shape
13127 # Example: see GEOM_TestOthers.py
13128 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13129 RaiseIfFailed("RemoveObject", self.GroupOp)
13132 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13133 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13134 # @param theSubShapes is a list of sub-shapes to be added.
13136 # @ref tui_working_with_groups_page "Example"
13137 @ManageTransactions("GroupOp")
13138 def UnionList (self,theGroup, theSubShapes):
13140 Adds to the group all the given shapes. No errors, if some shapes are already included.
13143 theGroup is a GEOM group to which the new sub-shapes are added.
13144 theSubShapes is a list of sub-shapes to be added.
13146 # Example: see GEOM_TestOthers.py
13147 self.GroupOp.UnionList(theGroup, theSubShapes)
13148 RaiseIfFailed("UnionList", self.GroupOp)
13151 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13152 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13153 # @param theSubShapes is a list of indices of sub-shapes to be added.
13155 # @ref swig_UnionIDs "Example"
13156 @ManageTransactions("GroupOp")
13157 def UnionIDs(self,theGroup, theSubShapes):
13159 Adds to the group all the given shapes. No errors, if some shapes are already included.
13162 theGroup is a GEOM group to which the new sub-shapes are added.
13163 theSubShapes is a list of indices of sub-shapes to be added.
13165 # Example: see GEOM_TestOthers.py
13166 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13167 RaiseIfFailed("UnionIDs", self.GroupOp)
13170 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13171 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13172 # @param theSubShapes is a list of sub-shapes to be removed.
13174 # @ref tui_working_with_groups_page "Example"
13175 @ManageTransactions("GroupOp")
13176 def DifferenceList (self,theGroup, theSubShapes):
13178 Removes from the group all the given shapes. No errors, if some shapes are not included.
13181 theGroup is a GEOM group from which the sub-shapes are removed.
13182 theSubShapes is a list of sub-shapes to be removed.
13184 # Example: see GEOM_TestOthers.py
13185 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13186 RaiseIfFailed("DifferenceList", self.GroupOp)
13189 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13190 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13191 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13193 # @ref swig_DifferenceIDs "Example"
13194 @ManageTransactions("GroupOp")
13195 def DifferenceIDs(self,theGroup, theSubShapes):
13197 Removes from the group all the given shapes. No errors, if some shapes are not included.
13200 theGroup is a GEOM group from which the sub-shapes are removed.
13201 theSubShapes is a list of indices of sub-shapes to be removed.
13203 # Example: see GEOM_TestOthers.py
13204 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13205 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13208 ## Union of two groups.
13209 # New group is created. It will contain all entities
13210 # which are present in groups theGroup1 and theGroup2.
13211 # @param theGroup1, theGroup2 are the initial GEOM groups
13212 # to create the united group from.
13213 # @param theName Object name; when specified, this parameter is used
13214 # for result publication in the study. Otherwise, if automatic
13215 # publication is switched on, default value is used for result name.
13217 # @return a newly created GEOM group.
13219 # @ref tui_union_groups_anchor "Example"
13220 @ManageTransactions("GroupOp")
13221 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13223 Union of two groups.
13224 New group is created. It will contain all entities
13225 which are present in groups theGroup1 and theGroup2.
13228 theGroup1, theGroup2 are the initial GEOM groups
13229 to create the united group from.
13230 theName Object name; when specified, this parameter is used
13231 for result publication in the study. Otherwise, if automatic
13232 publication is switched on, default value is used for result name.
13235 a newly created GEOM group.
13237 # Example: see GEOM_TestOthers.py
13238 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13239 RaiseIfFailed("UnionGroups", self.GroupOp)
13240 self._autoPublish(aGroup, theName, "group")
13243 ## Intersection of two groups.
13244 # New group is created. It will contain only those entities
13245 # which are present in both groups theGroup1 and theGroup2.
13246 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13247 # @param 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.
13251 # @return a newly created GEOM group.
13253 # @ref tui_intersect_groups_anchor "Example"
13254 @ManageTransactions("GroupOp")
13255 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13257 Intersection of two groups.
13258 New group is created. It will contain only those entities
13259 which are present in both groups theGroup1 and theGroup2.
13262 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13263 theName Object name; when specified, this parameter is used
13264 for result publication in the study. Otherwise, if automatic
13265 publication is switched on, default value is used for result name.
13268 a newly created GEOM group.
13270 # Example: see GEOM_TestOthers.py
13271 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13272 RaiseIfFailed("IntersectGroups", self.GroupOp)
13273 self._autoPublish(aGroup, theName, "group")
13276 ## Cut of two groups.
13277 # New group is created. It will contain entities which are
13278 # present in group theGroup1 but are not present in group theGroup2.
13279 # @param theGroup1 is a GEOM group to include elements of.
13280 # @param theGroup2 is a GEOM group to exclude elements of.
13281 # @param theName Object name; when specified, this parameter is used
13282 # for result publication in the study. Otherwise, if automatic
13283 # publication is switched on, default value is used for result name.
13285 # @return a newly created GEOM group.
13287 # @ref tui_cut_groups_anchor "Example"
13288 @ManageTransactions("GroupOp")
13289 def CutGroups (self, theGroup1, theGroup2, theName=None):
13292 New group is created. It will contain entities which are
13293 present in group theGroup1 but are not present in group theGroup2.
13296 theGroup1 is a GEOM group to include elements of.
13297 theGroup2 is a GEOM group to exclude elements of.
13298 theName Object name; when specified, this parameter is used
13299 for result publication in the study. Otherwise, if automatic
13300 publication is switched on, default value is used for result name.
13303 a newly created GEOM group.
13305 # Example: see GEOM_TestOthers.py
13306 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13307 RaiseIfFailed("CutGroups", self.GroupOp)
13308 self._autoPublish(aGroup, theName, "group")
13311 ## Union of list of groups.
13312 # New group is created. It will contain all entities that are
13313 # present in groups listed in theGList.
13314 # @param theGList is a list of GEOM groups to create the united group from.
13315 # @param theName Object name; when specified, this parameter is used
13316 # for result publication in the study. Otherwise, if automatic
13317 # publication is switched on, default value is used for result name.
13319 # @return a newly created GEOM group.
13321 # @ref tui_union_groups_anchor "Example"
13322 @ManageTransactions("GroupOp")
13323 def UnionListOfGroups (self, theGList, theName=None):
13325 Union of list of groups.
13326 New group is created. It will contain all entities that are
13327 present in groups listed in theGList.
13330 theGList is a list of GEOM groups to create the united group from.
13331 theName Object name; when specified, this parameter is used
13332 for result publication in the study. Otherwise, if automatic
13333 publication is switched on, default value is used for result name.
13336 a newly created GEOM group.
13338 # Example: see GEOM_TestOthers.py
13339 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13340 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13341 self._autoPublish(aGroup, theName, "group")
13344 ## Cut of lists of groups.
13345 # New group is created. It will contain only entities
13346 # which are present in groups listed in theGList.
13347 # @param theGList is a list of GEOM groups to include elements of.
13348 # @param theName Object name; when specified, this parameter is used
13349 # for result publication in the study. Otherwise, if automatic
13350 # publication is switched on, default value is used for result name.
13352 # @return a newly created GEOM group.
13354 # @ref tui_intersect_groups_anchor "Example"
13355 @ManageTransactions("GroupOp")
13356 def IntersectListOfGroups (self, theGList, theName=None):
13358 Cut of lists of groups.
13359 New group is created. It will contain only entities
13360 which are present in groups listed in theGList.
13363 theGList is a list of GEOM groups to include elements of.
13364 theName Object name; when specified, this parameter is used
13365 for result publication in the study. Otherwise, if automatic
13366 publication is switched on, default value is used for result name.
13369 a newly created GEOM group.
13371 # Example: see GEOM_TestOthers.py
13372 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13373 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13374 self._autoPublish(aGroup, theName, "group")
13377 ## Cut of lists of groups.
13378 # New group is created. It will contain only entities
13379 # which are present in groups listed in theGList1 but
13380 # are not present in groups from theGList2.
13381 # @param theGList1 is a list of GEOM groups to include elements of.
13382 # @param theGList2 is a list of GEOM groups to exclude elements of.
13383 # @param theName Object name; when specified, this parameter is used
13384 # for result publication in the study. Otherwise, if automatic
13385 # publication is switched on, default value is used for result name.
13387 # @return a newly created GEOM group.
13389 # @ref tui_cut_groups_anchor "Example"
13390 @ManageTransactions("GroupOp")
13391 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13393 Cut of lists of groups.
13394 New group is created. It will contain only entities
13395 which are present in groups listed in theGList1 but
13396 are not present in groups from theGList2.
13399 theGList1 is a list of GEOM groups to include elements of.
13400 theGList2 is a list of GEOM groups to exclude elements of.
13401 theName Object name; when specified, this parameter is used
13402 for result publication in the study. Otherwise, if automatic
13403 publication is switched on, default value is used for result name.
13406 a newly created GEOM group.
13408 # Example: see GEOM_TestOthers.py
13409 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13410 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13411 self._autoPublish(aGroup, theName, "group")
13414 ## Returns a list of sub-objects ID stored in the group
13415 # @param theGroup is a GEOM group for which a list of IDs is requested
13417 # @ref swig_GetObjectIDs "Example"
13418 @ManageTransactions("GroupOp")
13419 def GetObjectIDs(self,theGroup):
13421 Returns a list of sub-objects ID stored in the group
13424 theGroup is a GEOM group for which a list of IDs is requested
13426 # Example: see GEOM_TestOthers.py
13427 ListIDs = self.GroupOp.GetObjects(theGroup)
13428 RaiseIfFailed("GetObjects", self.GroupOp)
13431 ## Returns a type of sub-objects stored in the group
13432 # @param theGroup is a GEOM group which type is returned.
13434 # @ref swig_GetType "Example"
13435 @ManageTransactions("GroupOp")
13436 def GetType(self,theGroup):
13438 Returns a type of sub-objects stored in the group
13441 theGroup is a GEOM group which type is returned.
13443 # Example: see GEOM_TestOthers.py
13444 aType = self.GroupOp.GetType(theGroup)
13445 RaiseIfFailed("GetType", self.GroupOp)
13448 ## Convert a type of geom object from id to string value
13449 # @param theId is a GEOM object type id.
13450 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13451 # @ref swig_GetType "Example"
13452 def ShapeIdToType(self, theId):
13454 Convert a type of geom object from id to string value
13457 theId is a GEOM object type id.
13460 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13487 return "REVOLUTION"
13535 return "FREE_BOUNDS"
13543 return "THRUSECTIONS"
13545 return "COMPOUNDFILTER"
13547 return "SHAPES_ON_SHAPE"
13549 return "ELLIPSE_ARC"
13551 return "3DSKETCHER"
13557 return "PIPETSHAPE"
13558 return "Shape Id not exist."
13560 ## Returns a main shape associated with the group
13561 # @param theGroup is a GEOM group for which a main shape object is requested
13562 # @return a GEOM object which is a main shape for theGroup
13564 # @ref swig_GetMainShape "Example"
13565 @ManageTransactions("GroupOp")
13566 def GetMainShape(self,theGroup):
13568 Returns a main shape associated with the group
13571 theGroup is a GEOM group for which a main shape object is requested
13574 a GEOM object which is a main shape for theGroup
13576 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13578 # Example: see GEOM_TestOthers.py
13579 anObj = self.GroupOp.GetMainShape(theGroup)
13580 RaiseIfFailed("GetMainShape", self.GroupOp)
13583 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13584 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13585 # @param theShape given shape (see GEOM.GEOM_Object)
13586 # @param min_length minimum length of edges of theShape
13587 # @param max_length maximum length of edges of theShape
13588 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13589 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13590 # @param theName Object name; when specified, this parameter is used
13591 # for result publication in the study. Otherwise, if automatic
13592 # publication is switched on, default value is used for result name.
13594 # @return a newly created GEOM group of edges
13596 # @@ref swig_todo "Example"
13597 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13599 Create group of edges of theShape, whose length is in range [min_length, max_length].
13600 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13603 theShape given shape
13604 min_length minimum length of edges of theShape
13605 max_length maximum length of edges of theShape
13606 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13607 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13608 theName Object name; when specified, this parameter is used
13609 for result publication in the study. Otherwise, if automatic
13610 publication is switched on, default value is used for result name.
13613 a newly created GEOM group of edges.
13615 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13616 edges_in_range = []
13618 Props = self.BasicProperties(edge)
13619 if min_length <= Props[0] and Props[0] <= max_length:
13620 if (not include_min) and (min_length == Props[0]):
13623 if (not include_max) and (Props[0] == max_length):
13626 edges_in_range.append(edge)
13628 if len(edges_in_range) <= 0:
13629 print("No edges found by given criteria")
13632 # note: auto-publishing is done in self.CreateGroup()
13633 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13634 self.UnionList(group_edges, edges_in_range)
13638 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13639 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13640 # @param min_length minimum length of edges of selected shape
13641 # @param max_length maximum length of edges of selected shape
13642 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13643 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13644 # @return a newly created GEOM group of edges
13645 # @ref swig_todo "Example"
13646 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13648 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13649 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13652 min_length minimum length of edges of selected shape
13653 max_length maximum length of edges of selected shape
13654 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13655 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13658 a newly created GEOM group of edges.
13660 nb_selected = sg.SelectedCount()
13661 if nb_selected < 1:
13662 print("Select a shape before calling this function, please.")
13664 if nb_selected > 1:
13665 print("Only one shape must be selected")
13668 id_shape = sg.getSelected(0)
13669 shape = IDToObject( id_shape )
13671 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13675 if include_min: left_str = " <= "
13676 if include_max: right_str = " <= "
13678 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13679 + left_str + "length" + right_str + repr(max_length))
13681 sg.updateObjBrowser()
13688 #@@ insert new functions before this line @@ do not remove this line @@#
13690 ## Create a copy of the given object
13692 # @param theOriginal geometry object for copy
13693 # @param theName Object name; when specified, this parameter is used
13694 # for result publication in the study. Otherwise, if automatic
13695 # publication is switched on, default value is used for result name.
13697 # @return New GEOM_Object, containing the copied shape.
13699 # @ingroup l1_geomBuilder_auxiliary
13700 # @ref swig_MakeCopy "Example"
13701 @ManageTransactions("InsertOp")
13702 def MakeCopy(self, theOriginal, theName=None):
13704 Create a copy of the given object
13707 theOriginal geometry object for copy
13708 theName Object name; when specified, this parameter is used
13709 for result publication in the study. Otherwise, if automatic
13710 publication is switched on, default value is used for result name.
13713 New GEOM_Object, containing the copied shape.
13715 Example of usage: Copy = geompy.MakeCopy(Box)
13717 # Example: see GEOM_TestAll.py
13718 anObj = self.InsertOp.MakeCopy(theOriginal)
13719 RaiseIfFailed("MakeCopy", self.InsertOp)
13720 self._autoPublish(anObj, theName, "copy")
13723 ## Add Path to load python scripts from
13724 # @param Path a path to load python scripts from
13725 # @ingroup l1_geomBuilder_auxiliary
13726 def addPath(self,Path):
13728 Add Path to load python scripts from
13731 Path a path to load python scripts from
13733 if (sys.path.count(Path) < 1):
13734 sys.path.append(Path)
13738 ## Load marker texture from the file
13739 # @param Path a path to the texture file
13740 # @return unique texture identifier
13741 # @ingroup l1_geomBuilder_auxiliary
13742 @ManageTransactions("InsertOp")
13743 def LoadTexture(self, Path):
13745 Load marker texture from the file
13748 Path a path to the texture file
13751 unique texture identifier
13753 # Example: see GEOM_TestAll.py
13754 ID = self.InsertOp.LoadTexture(Path)
13755 RaiseIfFailed("LoadTexture", self.InsertOp)
13758 ## Get internal name of the object based on its study entry
13759 # @note This method does not provide an unique identifier of the geometry object.
13760 # @note This is internal function of GEOM component, though it can be used outside it for
13761 # appropriate reason (e.g. for identification of geometry object).
13762 # @param obj geometry object
13763 # @return unique object identifier
13764 # @ingroup l1_geomBuilder_auxiliary
13765 def getObjectID(self, obj):
13767 Get internal name of the object based on its study entry.
13768 Note: this method does not provide an unique identifier of the geometry object.
13769 It is an internal function of GEOM component, though it can be used outside GEOM for
13770 appropriate reason (e.g. for identification of geometry object).
13773 obj geometry object
13776 unique object identifier
13779 entry = salome.ObjectToID(obj)
13780 if entry is not None:
13781 lst = entry.split(":")
13783 ID = lst[-1] # -1 means last item in the list
13784 return "GEOM_" + ID
13789 ## Add marker texture. @a Width and @a Height parameters
13790 # specify width and height of the texture in pixels.
13791 # If @a RowData is @c True, @a Texture parameter should represent texture data
13792 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13793 # parameter should be unpacked string, in which '1' symbols represent opaque
13794 # pixels and '0' represent transparent pixels of the texture bitmap.
13796 # @param Width texture width in pixels
13797 # @param Height texture height in pixels
13798 # @param Texture texture data
13799 # @param RowData if @c True, @a Texture data are packed in the byte stream
13800 # @return unique texture identifier
13801 # @ingroup l1_geomBuilder_auxiliary
13802 @ManageTransactions("InsertOp")
13803 def AddTexture(self, Width, Height, Texture, RowData=False):
13805 Add marker texture. Width and Height parameters
13806 specify width and height of the texture in pixels.
13807 If RowData is True, Texture parameter should represent texture data
13808 packed into the byte array. If RowData is False (default), Texture
13809 parameter should be unpacked string, in which '1' symbols represent opaque
13810 pixels and '0' represent transparent pixels of the texture bitmap.
13813 Width texture width in pixels
13814 Height texture height in pixels
13815 Texture texture data
13816 RowData if True, Texture data are packed in the byte stream
13819 return unique texture identifier
13821 if not RowData: Texture = PackData(Texture)
13822 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13823 RaiseIfFailed("AddTexture", self.InsertOp)
13826 ## Transfer not topological data from one GEOM object to another.
13828 # @param theObjectFrom the source object of non-topological data
13829 # @param theObjectTo the destination object of non-topological data
13830 # @param theFindMethod method to search sub-shapes of theObjectFrom
13831 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13832 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13833 # Other values of GEOM.find_shape_method are not supported.
13835 # @return True in case of success; False otherwise.
13837 # @ingroup l1_geomBuilder_auxiliary
13839 # @ref swig_TransferData "Example"
13840 @ManageTransactions("InsertOp")
13841 def TransferData(self, theObjectFrom, theObjectTo,
13842 theFindMethod=GEOM.FSM_GetInPlace):
13844 Transfer not topological data from one GEOM object to another.
13847 theObjectFrom the source object of non-topological data
13848 theObjectTo the destination object of non-topological data
13849 theFindMethod method to search sub-shapes of theObjectFrom
13850 in shape theObjectTo. Possible values are:
13851 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13852 and GEOM.FSM_GetInPlace_Old. Other values of
13853 GEOM.find_shape_method are not supported.
13856 True in case of success; False otherwise.
13858 # Example: see GEOM_TestOthers.py
13860 # Example: see GEOM_TestAll.py
13861 isOk = self.InsertOp.TransferData(theObjectFrom,
13862 theObjectTo, theFindMethod)
13863 RaiseIfFailed("TransferData", self.InsertOp)
13866 ## Creates a new folder object. It is a container for any GEOM objects.
13867 # @param Name name of the container
13868 # @param Father parent object. If None,
13869 # folder under 'Geometry' root object will be created.
13870 # @return a new created folder
13871 # @ingroup l1_publish_data
13872 def NewFolder(self, Name, Father=None):
13874 Create a new folder object. It is an auxiliary container for any GEOM objects.
13877 Name name of the container
13878 Father parent object. If None,
13879 folder under 'Geometry' root object will be created.
13882 a new created folder
13884 return self.CreateFolder(Name, Father)
13886 ## Move object to the specified folder
13887 # @param Object object to move
13888 # @param Folder target folder
13889 # @ingroup l1_publish_data
13890 def PutToFolder(self, Object, Folder):
13892 Move object to the specified folder
13895 Object object to move
13896 Folder target folder
13898 self.MoveToFolder(Object, Folder)
13901 ## Move list of objects to the specified folder
13902 # @param ListOfSO list of objects to move
13903 # @param Folder target folder
13904 # @ingroup l1_publish_data
13905 def PutListToFolder(self, ListOfSO, Folder):
13907 Move list of objects to the specified folder
13910 ListOfSO list of objects to move
13911 Folder target folder
13913 self.MoveListToFolder(ListOfSO, Folder)
13916 ## @addtogroup l2_field
13920 # @param shape the shape the field lies on
13921 # @param name the field name
13922 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13923 # @param dimension dimension of the shape the field lies on
13924 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13925 # @param componentNames names of components
13926 # @return a created field
13927 @ManageTransactions("FieldOp")
13928 def CreateField(self, shape, name, type, dimension, componentNames):
13933 shape the shape the field lies on
13934 name the field name
13935 type type of field data
13936 dimension dimension of the shape the field lies on
13937 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13938 componentNames names of components
13943 if isinstance( type, int ):
13944 if type < 0 or type > 3:
13945 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13946 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13948 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13949 RaiseIfFailed("CreateField", self.FieldOp)
13951 geom._autoPublish( f, "", name)
13954 ## Removes a field from the GEOM component
13955 # @param field the field to remove
13956 def RemoveField(self, field):
13957 "Removes a field from the GEOM component"
13959 if isinstance( field, GEOM._objref_GEOM_Field ):
13960 geom.RemoveObject( field )
13961 elif isinstance( field, geomField ):
13962 geom.RemoveObject( field.field )
13964 raise RuntimeError("RemoveField() : the object is not a field")
13967 ## Returns number of fields on a shape
13968 @ManageTransactions("FieldOp")
13969 def CountFields(self, shape):
13970 "Returns number of fields on a shape"
13971 nb = self.FieldOp.CountFields( shape )
13972 RaiseIfFailed("CountFields", self.FieldOp)
13975 ## Returns all fields on a shape
13976 @ManageTransactions("FieldOp")
13977 def GetFields(self, shape):
13978 "Returns all fields on a shape"
13979 ff = self.FieldOp.GetFields( shape )
13980 RaiseIfFailed("GetFields", self.FieldOp)
13983 ## Returns a field on a shape by its name
13984 @ManageTransactions("FieldOp")
13985 def GetField(self, shape, name):
13986 "Returns a field on a shape by its name"
13987 f = self.FieldOp.GetField( shape, name )
13988 RaiseIfFailed("GetField", self.FieldOp)
13994 ## @addtogroup l2_testing
13997 ## Build a mesh on the given shape.
13998 # @param shape the source shape
13999 # @param linear_deflection linear deflection coefficient
14000 # @param is_relative says if given value of deflection is relative to shape's bounding box
14001 # @param angular_deflection angular deflection for edges in degrees
14002 # @return True in case of success; otherwise False.
14003 @ManageTransactions("TestOp")
14004 def Tesselate(self, shape, linear_deflection=0, is_relative=True, angular_deflection=0):
14005 """Build a mesh on the given shape.
14008 shape the source shape
14009 linear_deflection linear deflection coefficient
14010 is_relative says if given value of deflection is relative to shape's bounding box
14011 angular_deflection angular deflection for edges in degrees
14014 True in case of success; otherwise False.
14016 if angular_deflection > 0:
14017 angular_deflection = angular_deflection * math.pi / 180.
14018 r = self.TestOp.Tesselate(shape, linear_deflection, is_relative, angular_deflection)
14019 RaiseIfFailed("Tesselate", self.TestOp)
14022 # end of l2_testing
14026 # Register the new proxy for GEOM_Gen
14027 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
14030 ## Field on Geometry
14031 # @ingroup l2_field
14032 class geomField( GEOM._objref_GEOM_Field ):
14034 def __init__(self, *args):
14035 GEOM._objref_GEOM_Field.__init__(self, *args)
14036 self.field = GEOM._objref_GEOM_Field
14039 ## Returns the shape the field lies on
14040 def getShape(self):
14041 "Returns the shape the field lies on"
14042 return self.field.GetShape(self)
14044 ## Returns the field name
14046 "Returns the field name"
14047 return self.field.GetName(self)
14049 ## Returns type of field data as integer [0-3]
14051 "Returns type of field data"
14052 return EnumToLong(self.field.GetDataType(self))
14054 ## Returns type of field data:
14055 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
14056 def getTypeEnum(self):
14057 "Returns type of field data"
14058 return self.field.GetDataType(self)
14060 ## Returns dimension of the shape the field lies on:
14061 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
14062 def getDimension(self):
14063 """Returns dimension of the shape the field lies on:
14064 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
14065 return self.field.GetDimension(self)
14067 ## Returns names of components
14068 def getComponents(self):
14069 "Returns names of components"
14070 return self.field.GetComponents(self)
14072 ## Adds a time step to the field
14073 # @param step the time step number further used as the step identifier
14074 # @param stamp the time step time
14075 # @param values the values of the time step
14076 def addStep(self, step, stamp, values):
14077 "Adds a time step to the field"
14078 stp = self.field.AddStep( self, step, stamp )
14080 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
14082 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
14083 self.setValues( step, values )
14086 ## Remove a time step from the field
14087 def removeStep(self,step):
14088 "Remove a time step from the field"
14091 stepObj = self.field.GetStep( self, step )
14093 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
14096 #traceback.print_exc()
14098 self.field.RemoveStep( self, step )
14100 geom.myBuilder.RemoveObjectWithChildren( stepSO )
14103 ## Returns number of time steps in the field
14104 def countSteps(self):
14105 "Returns number of time steps in the field"
14106 return self.field.CountSteps(self)
14108 ## Returns a list of time step IDs in the field
14109 def getSteps(self):
14110 "Returns a list of time step IDs in the field"
14111 return self.field.GetSteps(self)
14113 ## Returns a time step by its ID
14114 def getStep(self,step):
14115 "Returns a time step by its ID"
14116 stp = self.field.GetStep(self, step)
14118 raise RuntimeError("Step %s is missing from this field"%step)
14121 ## Returns the time of the field step
14122 def getStamp(self,step):
14123 "Returns the time of the field step"
14124 return self.getStep(step).GetStamp()
14126 ## Changes the time of the field step
14127 def setStamp(self, step, stamp):
14128 "Changes the time of the field step"
14129 return self.getStep(step).SetStamp(stamp)
14131 ## Returns values of the field step
14132 def getValues(self, step):
14133 "Returns values of the field step"
14134 return self.getStep(step).GetValues()
14136 ## Changes values of the field step
14137 def setValues(self, step, values):
14138 "Changes values of the field step"
14139 stp = self.getStep(step)
14140 errBeg = "Field.setValues(values) : Error: "
14142 ok = stp.SetValues( values )
14143 except Exception as e:
14145 if excStr.find("WrongPythonType") > 0:
14146 raise RuntimeError(errBeg +\
14147 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14148 raise RuntimeError(errBeg + str(e))
14150 nbOK = self.field.GetArraySize(self)
14153 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14155 raise RuntimeError(errBeg + "failed")
14158 pass # end of class geomField
14160 # Register the new proxy for GEOM_Field
14161 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14164 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14165 # interface to GEOM operations.
14170 # salome.salome_init()
14171 # from salome.geom import geomBuilder
14172 # geompy = geomBuilder.New()
14174 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14175 # @return geomBuilder instance
14176 def New( instance=None):
14178 Create a new geomBuilder instance.The geomBuilder class provides the Python
14179 interface to GEOM operations.
14183 salome.salome_init()
14184 from salome.geom import geomBuilder
14185 geompy = geomBuilder.New()
14188 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14190 geomBuilder instance
14192 #print "New geomBuilder ", study, instance
14196 if instance and isinstance( instance, SALOMEDS._objref_Study ):
14198 sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14203 geom = geomBuilder()
14204 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14209 # Register methods from the plug-ins in the geomBuilder class
14210 plugins_var = os.environ.get( "GEOM_PluginsList" )
14213 if plugins_var is not None:
14214 plugins = plugins_var.split( ":" )
14215 plugins=[x for x in plugins if len(x)>0]
14216 if plugins is not None:
14217 for pluginName in plugins:
14218 pluginBuilderName = pluginName + "Builder"
14220 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14221 except Exception as e:
14222 from salome_utils import verbose
14223 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14225 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14226 plugin = eval( pluginBuilderName )
14228 # add methods from plugin module to the geomBuilder class
14229 for k in dir( plugin ):
14230 if k[0] == '_': continue
14231 method = getattr( plugin, k )
14232 if type( method ).__name__ == 'function':
14233 if not hasattr( geomBuilder, k ):
14234 setattr( geomBuilder, k, method )