1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # GEOM GEOM_SWIG : binding of C++ implementation with Python
22 # File : geomBuilder.py
23 # Author : Paul RASCLE, EDF
27 \namespace geomBuilder
28 \brief Module geomBuilder
32 ## @defgroup geomBuilder geomBuilder Python module
37 ## By default, all functions of geomBuilder Python module do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of \ref geomBuilder.geomBuilder.addToStudy() "addToStudy()"
40 ## or \ref geomBuilder.geomBuilder.addToStudyInFather() "addToStudyInFather()"
43 ## However, it is possible to publish result data in the study
44 ## automatically. For this, almost each function of
45 ## \ref geomBuilder.geomBuilder "geomBuilder" class has
46 ## an additional @a theName parameter (@c None by default).
47 ## As soon as non-empty string value is passed to this parameter,
48 ## the result object is published in the study automatically.
50 ## For example, consider the following Python script:
54 ## from salome.geom import geomBuilder
55 ## geompy = geomBuilder.New()
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
57 ## geompy.addToStudy(box, "box") # explicit publishing
60 ## Last two lines can be replaced by one-line instruction:
63 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
69 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
72 ## Note, that some functions produce more than one geometrical objects. For example,
73 ## \ref geomBuilder.geomBuilder.GetNonBlocks() "GetNonBlocks()" function returns two objects:
74 ## group of all non-hexa solids and group of all non-quad faces.
75 ## For such functions it is possible to specify separate names for results.
80 ## # create and publish cylinder
81 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
82 ## # get non blocks from cylinder
83 ## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
86 ## Above example will publish both result compounds (first with non-hexa solids and
87 ## second with non-quad faces) as two items, both named "nonblock".
88 ## However, if second command is invoked as
91 ## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
94 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
96 ## Automatic publication of all results can be also enabled/disabled by means of the function
97 ## \ref geomBuilder.geomBuilder.addToStudyAuto() "addToStudyAuto()". The automatic publishing
98 ## is managed by the numeric parameter passed to this function:
99 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
100 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
101 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
102 ## value passed as parameter has the same effect.
103 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
104 ## maximum number of sub-shapes allowed for publishing is set to specified value.
106 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
107 ## to the functions creating objects, instead default names will be used. However, you
108 ## can always change the behavior, by passing explicit name to the @a theName parameter
109 ## and it will be used instead default one.
110 ## The publishing of the collections of objects will be done according to the above
111 ## mentioned rules (maximum allowed number of sub-shapes).
117 ## from salome.geom import geomBuilder
118 ## geompy = geomBuilder.New()
119 ## geompy.addToStudyAuto() # enable automatic publication
120 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
121 ## # the box is created and published in the study with default name
122 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
123 ## vertices = geompy.SubShapeAll(box, geomBuilder.ShapeType['VERTEX'])
124 ## # only 5 first vertices will be published, with default names
125 ## print len(vertices)
126 ## # note, that result value still contains all 8 vertices
127 ## geompy.addToStudyAuto(-1) # disable automatic publication
130 ## This feature can be used, for example, for debugging purposes.
133 ## - Use automatic publication feature with caution. When it is enabled, any function of
134 ## \ref geomBuilder.geomBuilder "geomBuilder" class publishes the results in the study,
135 ## that can lead to the huge size of the study data tree.
136 ## For example, repeating call of \ref geomBuilder.geomBuilder.SubShapeAll() "SubShapeAll()"
137 ## command on the same main shape each time will publish all child objects, that will lead
138 ## to a lot of duplicated items in the study.
139 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
140 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
141 ## - Some functions of \ref geomBuilder.geomBuilder "geomBuilder" class do not have
142 ## \a theName parameter (and, thus, do not support automatic publication).
143 ## For example, some transformation operations like
144 ## \ref geomBuilder.geomBuilder.TranslateDXDYDZ() "TranslateDXDYDZ()".
145 ## Refer to the documentation to check if some function has such possibility.
147 ## It is possible to customize the representation of the geometrical
148 ## data in the data tree; this can be done by using folders. A folder can
149 ## be created in the study tree using function
150 ## \ref geomBuilder.geomBuilder.NewFolder() "NewFolder()"
151 ## (by default it is created under the "Geometry" root object).
152 ## As soon as folder is created, any published geometry object
153 ## can be moved into it.
159 ## from salome.geom import geomBuilder
160 ## geompy = geomBuilder.New()
161 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "Box")
162 ## # the box was created and published in the study
163 ## folder = geompy.NewFolder("Primitives")
164 ## # an empty "Primitives" folder was created under default "Geometry" root object
165 ## geompy.PutToFolder(box, folder)
166 ## # the box was moved into "Primitives" folder
169 ## Subfolders are also can be created by specifying another folder as a parent:
172 ## subfolder = geompy.NewFolder("3D", folder)
173 ## # "3D" folder was created under "Primitives" folder
177 ## - Folder container is just a representation layer object that
178 ## deals with already published objects only. So, any geometry object
179 ## should be published in the study (for example, with
180 ## \ref geomBuilder.geomBuilder.PutToFolder() "addToStudy()" function)
181 ## BEFORE moving it into any existing folder.
182 ## - \ref geomBuilder.geomBuilder.PutToFolder() "PutToFolder()" function
183 ## does not change physical position of geometry object in the study tree,
184 ## it only affects on the representation of the data tree.
185 ## - It is impossible to publish geometry object using any folder as father.
187 ## \defgroup l1_publish_data
188 ## \defgroup l1_geomBuilder_auxiliary
189 ## \defgroup l1_geomBuilder_purpose
192 ## @defgroup l1_publish_data Publishing results in SALOME study
194 ## @defgroup l1_geomBuilder_auxiliary Auxiliary data structures and methods
196 ## @defgroup l1_geomBuilder_purpose All package methods, grouped by their purpose
198 ## @defgroup l2_import_export Importing/exporting geometrical objects
199 ## @defgroup l2_creating Creating geometrical objects
201 ## @defgroup l3_basic_go Creating Basic Geometric Objects
203 ## @defgroup l4_curves Creating Curves
206 ## @defgroup l3_3d_primitives Creating 3D Primitives
207 ## @defgroup l3_complex Creating Complex Objects
208 ## @defgroup l3_groups Working with groups
209 ## @defgroup l3_blocks Building by blocks
211 ## @defgroup l4_blocks_measure Check and Improve
214 ## @defgroup l3_sketcher Sketcher
215 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
217 ## @defgroup l4_decompose Decompose objects
218 ## @defgroup l4_decompose_d Decompose objects deprecated methods
219 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
220 ## @defgroup l4_obtain Access to sub-shapes by a criteria
221 ## @defgroup l4_advanced Advanced objects creation functions
226 ## @defgroup l2_transforming Transforming geometrical objects
228 ## @defgroup l3_basic_op Basic Operations
229 ## @defgroup l3_boolean Boolean Operations
230 ## @defgroup l3_transform Transformation Operations
231 ## @defgroup l3_transform_d Transformation Operations deprecated methods
232 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
233 ## @defgroup l3_blocks_op Blocks Operations
234 ## @defgroup l3_healing Repairing Operations
235 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
238 ## @defgroup l2_measure Using measurement tools
239 ## @defgroup l2_field Field on Geometry
245 # initialize SALOME session in try/except block
246 # to avoid problems in some cases, e.g. when generating documentation
254 from salome_notebook import *
261 from salome.geom.gsketcher import Sketcher3D, Sketcher2D, Polyline2D
263 # In case the omniORBpy EnumItem class does not fully support Python 3
264 # (for instance in version 4.2.1-2), the comparison ordering methods must be
268 GEOM.COMPOUND < GEOM.SOLID
270 def enumitem_eq(self, other):
272 if isinstance(other, omniORB.EnumItem):
273 if other._parent_id == self._parent_id:
274 return self._v == other._v
276 return self._parent_id == other._parent_id
278 return id(self) == id(other)
280 return id(self) == id(other)
282 def enumitem_lt(self, other):
284 if isinstance(other, omniORB.EnumItem):
285 if other._parent_id == self._parent_id:
286 return self._v < other._v
288 return self._parent_id < other._parent_id
290 return id(self) < id(other)
292 return id(self) < id(other)
294 def enumitem_le(self, other):
296 if isinstance(other, omniORB.EnumItem):
297 if other._parent_id == self._parent_id:
298 return self._v <= other._v
300 return self._parent_id <= other._parent_id
302 return id(self) <= id(other)
304 return id(self) <= id(other)
306 def enumitem_gt(self, other):
308 if isinstance(other, omniORB.EnumItem):
309 if other._parent_id == self._parent_id:
310 return self._v > other._v
312 return self._parent_id > other._parent_id
314 return id(self) > id(other)
316 return id(self) > id(other)
318 def enumitem_ge(self, other):
320 if isinstance(other, omniORB.EnumItem):
321 if other._parent_id == self._parent_id:
322 return self._v >= other._v
324 return self._parent_id >= other._parent_id
326 return id(self) >= id(other)
328 return id(self) >= id(other)
330 GEOM.omniORB.EnumItem.__eq__ = enumitem_eq
331 GEOM.omniORB.EnumItem.__lt__ = enumitem_lt
332 GEOM.omniORB.EnumItem.__le__ = enumitem_le
333 GEOM.omniORB.EnumItem.__gt__ = enumitem_gt
334 GEOM.omniORB.EnumItem.__ge__ = enumitem_ge
335 omniORB.EnumItem.__eq__ = enumitem_eq
336 omniORB.EnumItem.__lt__ = enumitem_lt
337 omniORB.EnumItem.__le__ = enumitem_le
338 omniORB.EnumItem.__gt__ = enumitem_gt
339 omniORB.EnumItem.__ge__ = enumitem_ge
342 def _toListOfNames(_names, _size=-1):
345 if type(_names) in [list, tuple]:
346 for i in _names: l.append(i)
349 if l and len(l) < _size:
350 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
353 # Decorator function to manage transactions for all geometric operations.
354 def ManageTransactions(theOpeName):
355 def MTDecorator(theFunction):
356 # To keep the original function name an documentation.
357 @functools.wraps(theFunction)
358 def OpenCallClose(self, *args, **kwargs):
360 anOperation = getattr(self, theOpeName)
361 anOperation.StartOperation()
364 res = theFunction(self, *args, **kwargs)
366 anOperation.FinishOperation()
370 anOperation.AbortOperation()
375 ## Raise an Error, containing the Method_name, if Operation is Failed
376 ## @ingroup l1_geomBuilder_auxiliary
377 def RaiseIfFailed (Method_name, Operation):
378 if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
379 raise RuntimeError(Method_name + " : " + Operation.GetErrorCode())
381 ## Return list of variables value from salome notebook
382 ## @ingroup l1_geomBuilder_auxiliary
383 def ParseParameters(*parameters):
386 for parameter in parameters:
387 if isinstance(parameter, list):
388 lResults = ParseParameters(*parameter)
389 if len(lResults) > 0:
390 Result.append(lResults[:-1])
391 StringResult += lResults[-1].split(":")
395 if isinstance(parameter,str):
396 if notebook.isVariable(parameter):
397 Result.append(notebook.get(parameter))
399 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
402 Result.append(parameter)
404 StringResult.append(str(parameter))
408 Result.append(":".join(StringResult))
410 Result = ":".join(StringResult)
413 ## Return list of variables value from salome notebook
414 ## @ingroup l1_geomBuilder_auxiliary
418 for parameter in list:
419 if isinstance(parameter,str) and notebook.isVariable(parameter):
420 Result.append(str(notebook.get(parameter)))
423 Result.append(str(parameter))
426 StringResult = StringResult + str(parameter)
427 StringResult = StringResult + ":"
429 StringResult = StringResult[:len(StringResult)-1]
430 return Result, StringResult
432 ## Return list of variables value from salome notebook
433 ## @ingroup l1_geomBuilder_auxiliary
434 def ParseSketcherCommand(command):
437 sections = command.split(":")
438 for section in sections:
439 parameters = section.split(" ")
441 for parameter in parameters:
442 if paramIndex > 1 and parameter.find("'") != -1:
443 parameter = parameter.replace("'","")
444 if notebook.isVariable(parameter):
445 Result = Result + str(notebook.get(parameter)) + " "
448 raise RuntimeError("Variable with name '" + parameter + "' doesn't exist!!!")
452 Result = Result + str(parameter) + " "
455 StringResult = StringResult + parameter
456 StringResult = StringResult + ":"
458 paramIndex = paramIndex + 1
460 Result = Result[:len(Result)-1] + ":"
462 Result = Result[:len(Result)-1]
463 return Result, StringResult
465 ## Helper function which can be used to pack the passed string to the byte data.
466 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
467 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
470 ## val = PackData("10001110") # val = 0xAE
471 ## val = PackData("1") # val = 0x80
473 ## @param data unpacked data - a string containing '1' and '0' symbols
474 ## @return data packed to the byte stream
475 ## @ingroup l1_geomBuilder_auxiliary
478 Helper function which can be used to pack the passed string to the byte data.
479 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
480 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
483 data unpacked data - a string containing '1' and '0' symbols
486 data packed to the byte stream
489 val = PackData("10001110") # val = 0xAE
490 val = PackData("1") # val = 0x80
493 if len(data)%8: bytes += 1
495 for b in range(bytes):
496 d = data[b*8:(b+1)*8]
501 if d[i] == "1": val += 1
503 raise "Invalid symbol %s" % d[i]
510 ## Read bitmap texture from the text file.
511 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
512 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
513 ## The function returns width and height of the pixmap in pixels and byte stream representing
514 ## texture bitmap itself.
516 ## This function can be used to read the texture to the byte stream in order to pass it to
517 ## the AddTexture() function of geomBuilder class.
520 ## from salome.geom import geomBuilder
521 ## geompy = geomBuilder.New()
522 ## texture = geompy.readtexture('mytexture.dat')
523 ## texture = geompy.AddTexture(*texture)
524 ## obj.SetMarkerTexture(texture)
526 ## @param fname texture file name
527 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
528 ## @ingroup l1_geomBuilder_auxiliary
529 def ReadTexture(fname):
531 Read bitmap texture from the text file.
532 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
533 A zero symbol ('0') represents transparent pixel of the texture bitmap.
534 The function returns width and height of the pixmap in pixels and byte stream representing
535 texture bitmap itself.
536 This function can be used to read the texture to the byte stream in order to pass it to
537 the AddTexture() function of geomBuilder class.
540 fname texture file name
543 sequence of tree values: texture's width, height in pixels and its byte stream
546 from salome.geom import geomBuilder
547 geompy = geomBuilder.New()
548 texture = geompy.readtexture('mytexture.dat')
549 texture = geompy.AddTexture(*texture)
550 obj.SetMarkerTexture(texture)
554 lines = [ l.strip() for l in f.readlines()]
557 if lines: maxlen = max([len(x) for x in lines])
559 if maxlen%8: lenbytes += 1
563 lenline = (len(line)/8+1)*8
566 lenline = (len(line)/8)*8
568 for i in range(lenline/8):
571 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
574 bytedata += PackData(byte)
576 for i in range(lenline/8, lenbytes):
577 bytedata += PackData("0")
579 return lenbytes*8, len(lines), bytedata
584 ## Returns a long value from enumeration type
585 # Can be used for CORBA enumerator types like GEOM.shape_type
586 # @param theItem enumeration type
587 # @ingroup l1_geomBuilder_auxiliary
588 def EnumToLong(theItem):
590 Returns a long value from enumeration type
591 Can be used for CORBA enumerator types like geomBuilder.ShapeType
594 theItem enumeration type
597 if hasattr(theItem, "_v"): ret = theItem._v
600 ## Pack an argument into a list
602 if isinstance( arg, list ):
604 if hasattr( arg, "__getitem__" ):
608 ## Information about closed/unclosed state of shell or wire
609 # @ingroup l1_geomBuilder_auxiliary
612 Information about closed/unclosed state of shell or wire
618 ## Private class used to bind calls of plugin operations to geomBuilder
619 class PluginOperation:
620 def __init__(self, operation, function):
621 self.operation = operation
622 self.function = function
625 @ManageTransactions("operation")
626 def __call__(self, *args):
627 res = self.function(self.operation, *args)
628 RaiseIfFailed(self.function.__name__, self.operation)
631 # Warning: geom is a singleton
637 class geomBuilder(GEOM._objref_GEOM_Gen):
639 ## Enumeration ShapeType as a dictionary. \n
640 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
641 # @ingroup l1_geomBuilder_auxiliary
642 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
644 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
645 # and a list of parameters, describing the shape.
646 # List of parameters, describing the shape:
647 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
648 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
650 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
652 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
654 # - SPHERE: [xc yc zc R]
655 # - CYLINDER: [xb yb zb dx dy dz R H]
656 # - BOX: [xc yc zc ax ay az]
657 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
658 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
659 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
660 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
661 # - SOLID: [nb_faces nb_edges nb_vertices]
663 # - SPHERE2D: [xc yc zc R]
664 # - CYLINDER2D: [xb yb zb dx dy dz R H]
665 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
666 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
667 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
668 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
669 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
670 # - PLANE: [xo yo zo dx dy dz]
671 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
672 # - FACE: [nb_edges nb_vertices]
674 # - CIRCLE: [xc yc zc dx dy dz R]
675 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
676 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
677 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
678 # - LINE: [xo yo zo dx dy dz]
679 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
680 # - EDGE: [nb_vertices]
684 # - LCS: [x y z xx xy xz yx yy yz zx zy zz]
685 # @ingroup l1_geomBuilder_auxiliary
686 kind = GEOM.GEOM_IKindOfShape
688 def __new__(cls, *args):
693 #print "==== __new__ ", engine, geom, doLcc, created
695 # geom engine is either retrieved from engine, or created
697 # Following test avoids a recursive loop
700 # geom engine not created: existing engine found
702 if doLcc and not created:
704 # FindOrLoadComponent called:
705 # 1. CORBA resolution of server
706 # 2. the __new__ method is called again
707 #print "==== FindOrLoadComponent ", engine, geom, doLcc, created
708 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
711 # FindOrLoadComponent not called
713 # geomBuilder instance is created from lcc.FindOrLoadComponent
714 #print "==== super ", engine, geom, doLcc, created
715 geom = super(geomBuilder,cls).__new__(cls)
718 # geom engine not created: existing engine found
719 #print "==== existing ", engine, geom, doLcc, created
721 #print "return geom 1 ", geom
724 #print "return geom 2 ", geom
727 def __init__(self, *args):
729 #print "-------- geomBuilder __init__ --- ", created, self
732 GEOM._objref_GEOM_Gen.__init__(self, *args)
733 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
734 self.myBuilder = None
752 ## Process object publication in the study, as follows:
753 # - if @a theName is specified (not None), the object is published in the study
754 # with this name, not taking into account "auto-publishing" option;
755 # - if @a theName is NOT specified, the object is published in the study
756 # (using default name, which can be customized using @a theDefaultName parameter)
757 # only if auto-publishing is switched on.
759 # @param theObj object, a subject for publishing
760 # @param theName object name for study
761 # @param theDefaultName default name for the auto-publishing
763 # @sa addToStudyAuto()
764 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
766 def _item_name(_names, _defname, _idx=-1):
767 if not _names: _names = _defname
768 if type(_names) in [list, tuple]:
770 if _idx >= len(_names) or not _names[_idx]:
771 if type(_defname) not in [list, tuple]:
772 _name = "%s_%d"%(_defname, _idx+1)
773 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
774 _name = _defname[_idx]
776 _name = "%noname_%d"%(dn, _idx+1)
782 # must be wrong usage
787 _name = "%s_%d"%(_names, _idx+1)
793 def _publish( _name, _obj ):
795 if isinstance( _obj, GEOM._objref_GEOM_Field ):
796 fatherObj = _obj.GetShape()
797 elif isinstance( _obj, GEOM._objref_GEOM_FieldStep ):
798 fatherObj = _obj.GetField()
799 elif not _obj.IsMainShape():
800 fatherObj = _obj.GetMainShape()
802 if fatherObj and fatherObj.GetStudyEntry():
803 self.addToStudyInFather(fatherObj, _obj, _name)
805 self.addToStudy(_obj, _name)
811 if not theName and not self.myMaxNbSubShapesAllowed:
812 return # nothing to do: auto-publishing is disabled
813 if not theName and not theDefaultName:
814 return # neither theName nor theDefaultName is given
816 if type(theObj) in [list, tuple]:
817 # list of objects is being published
820 if not obj: continue # bad object
821 name = _item_name(theName, theDefaultName, idx)
822 _publish( name, obj )
824 if not theName and idx == self.myMaxNbSubShapesAllowed: break
828 # single object is published
829 name = _item_name(theName, theDefaultName)
830 _publish( name, theObj )
833 ## @addtogroup l1_geomBuilder_auxiliary
836 self.myStudy = salome.myStudy
837 self.myBuilder = self.myStudy.NewBuilder()
838 self.father = self.myStudy.FindComponent("GEOM")
839 notebook.myStudy = salome.myStudy
840 if self.father is None:
841 self.father = self.myBuilder.NewComponent("GEOM")
842 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
843 FName = A1._narrow(SALOMEDS.AttributeName)
844 FName.SetValue("Geometry")
845 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
846 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
847 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
848 self.myBuilder.DefineComponentInstance(self.father,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 ()
864 # set GEOM as root in the use case tree
865 self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
866 self.myUseCaseBuilder.SetRootCurrent()
867 self.myUseCaseBuilder.Append(self.father)
869 # load data from the study file, if necessary
870 self.myBuilder.LoadWith(self.father, self)
873 def GetPluginOperations(self, libraryName):
874 op = GEOM._objref_GEOM_Gen.GetPluginOperations(self, libraryName)
877 ## Enable / disable results auto-publishing
879 # The automatic publishing is managed in the following way:
880 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
881 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
882 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
883 # value passed as parameter has the same effect.
884 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
885 # maximum number of sub-shapes allowed for publishing is set to specified value.
887 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
888 # @ingroup l1_publish_data
889 def addToStudyAuto(self, maxNbSubShapes=-1):
891 Enable / disable results auto-publishing
893 The automatic publishing is managed in the following way:
894 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
895 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
896 maximum number of sub-shapes allowed for publishing is unlimited; any negative
897 value passed as parameter has the same effect.
898 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
899 maximum number of sub-shapes allowed for publishing is set to this value.
902 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
905 geompy.addToStudyAuto() # enable auto-publishing
906 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
907 geompy.addToStudyAuto(0) # disable auto-publishing
909 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
912 ## Dump component to the Python script
913 # This method overrides IDL function to allow default values for the parameters.
914 def DumpPython(self, theIsPublished=True, theIsMultiFile=True):
916 Dump component to the Python script
917 This method overrides IDL function to allow default values for the parameters.
919 return GEOM._objref_GEOM_Gen.DumpPython(self, theIsPublished, theIsMultiFile)
921 ## Get name for sub-shape aSubObj of shape aMainObj
923 # @ref swig_SubShapeName "Example"
924 @ManageTransactions("ShapesOp")
925 def SubShapeName(self,aSubObj, aMainObj):
927 Get name for sub-shape aSubObj of shape aMainObj
929 # Example: see GEOM_TestAll.py
931 #aSubId = orb.object_to_string(aSubObj)
932 #aMainId = orb.object_to_string(aMainObj)
933 #index = gg.getIndexTopology(aSubId, aMainId)
934 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
935 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
936 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
939 ## Publish in study aShape with name aName
941 # \param aShape the shape to be published
942 # \param aName the name for the shape
943 # \param doRestoreSubShapes if True, finds and publishes also
944 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
945 # and published sub-shapes of arguments
946 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
947 # these arguments description
948 # \return study entry of the published shape in form of string
950 # @ingroup l1_publish_data
951 # @ref swig_all_addtostudy "Example"
952 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
953 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
955 Publish in study aShape with name aName
958 aShape the shape to be published
959 aName the name for the shape
960 doRestoreSubShapes if True, finds and publishes also
961 sub-shapes of aShape, corresponding to its arguments
962 and published sub-shapes of arguments
963 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
964 these arguments description
967 study entry of the published shape in form of string
970 id_block1 = geompy.addToStudy(Block1, "Block 1")
972 # Example: see GEOM_TestAll.py
974 aSObject = self.AddInStudy(aShape, aName, None)
975 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
976 if doRestoreSubShapes:
977 self.RestoreSubShapesSO(aSObject, theArgs,
978 theFindMethod, theInheritFirstArg, True )
980 print("addToStudy() failed")
982 return aShape.GetStudyEntry()
984 ## Publish in study aShape with name aName as sub-object of previously published aFather
985 # \param aFather previously published object
986 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
987 # \param aName the name for the shape
989 # \return study entry of the published shape in form of string
991 # @ingroup l1_publish_data
992 # @ref swig_all_addtostudyInFather "Example"
993 def addToStudyInFather(self, aFather, aShape, aName):
995 Publish in study aShape with name aName as sub-object of previously published aFather
998 aFather previously published object
999 aShape the shape to be published as sub-object of aFather
1000 aName the name for the shape
1003 study entry of the published shape in form of string
1005 # Example: see GEOM_TestAll.py
1007 aSObject = self.AddInStudy(aShape, aName, aFather)
1008 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
1010 print("addToStudyInFather() failed")
1012 return aShape.GetStudyEntry()
1014 ## Unpublish object in study
1016 # \param obj the object to be unpublished
1017 def hideInStudy(self, obj):
1019 Unpublish object in study
1022 obj the object to be unpublished
1024 ior = salome.orb.object_to_string(obj)
1025 aSObject = self.myStudy.FindObjectIOR(ior)
1026 if aSObject is not None:
1027 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
1028 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1029 drwAttribute.SetDrawable(False)
1030 # hide references if any
1031 vso = self.myStudy.FindDependances(aSObject);
1033 genericAttribute = self.myBuilder.FindOrCreateAttribute(refObj, "AttributeDrawable")
1034 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
1035 drwAttribute.SetDrawable(False)
1039 # end of l1_geomBuilder_auxiliary
1042 ## @addtogroup l3_restore_ss
1045 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1046 # To be used from python scripts out of addToStudy() (non-default usage)
1047 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1048 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1049 # If this list is empty, all operation arguments will be published
1050 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1051 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
1052 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1053 # Do not publish sub-shapes in place of arguments, but only
1054 # in place of sub-shapes of the first argument,
1055 # because the whole shape corresponds to the first argument.
1056 # Mainly to be used after transformations, but it also can be
1057 # useful after partition with one object shape, and some other
1058 # operations, where only the first argument has to be considered.
1059 # If theObject has only one argument shape, this flag is automatically
1060 # considered as True, not regarding really passed value.
1061 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1062 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1063 # \return list of published sub-shapes
1065 # @ref tui_restore_prs_params "Example"
1066 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1067 theInheritFirstArg=False, theAddPrefix=True):
1069 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1070 To be used from python scripts out of geompy.addToStudy (non-default usage)
1073 theObject published GEOM.GEOM_Object, arguments of which will be published
1074 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1075 If this list is empty, all operation arguments will be published
1076 theFindMethod method to search sub-shapes, corresponding to arguments and
1077 their sub-shapes. Value from enumeration GEOM.find_shape_method.
1078 theInheritFirstArg set properties of the first argument for theObject.
1079 Do not publish sub-shapes in place of arguments, but only
1080 in place of sub-shapes of the first argument,
1081 because the whole shape corresponds to the first argument.
1082 Mainly to be used after transformations, but it also can be
1083 useful after partition with one object shape, and some other
1084 operations, where only the first argument has to be considered.
1085 If theObject has only one argument shape, this flag is automatically
1086 considered as True, not regarding really passed value.
1087 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1088 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1090 list of published sub-shapes
1092 # Example: see GEOM_TestAll.py
1093 return self.RestoreSubShapesO(theObject, theArgs,
1094 theFindMethod, theInheritFirstArg, theAddPrefix)
1096 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
1097 # To be used from python scripts out of addToStudy() (non-default usage)
1098 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
1099 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1100 # If this list is empty, all operation arguments will be published
1101 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
1102 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
1103 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
1104 # Do not publish sub-shapes in place of arguments, but only
1105 # in place of sub-shapes of the first argument,
1106 # because the whole shape corresponds to the first argument.
1107 # Mainly to be used after transformations, but it also can be
1108 # useful after partition with one object shape, and some other
1109 # operations, where only the first argument has to be considered.
1110 # If theObject has only one argument shape, this flag is automatically
1111 # considered as True, not regarding really passed value.
1112 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
1113 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1114 # \return list of published sub-shapes
1116 # @ref tui_restore_prs_params "Example"
1117 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
1118 theInheritFirstArg=False, theAddPrefix=True):
1120 Publish sub-shapes, standing for arguments and sub-shapes of arguments
1121 To be used from python scripts out of geompy.addToStudy() (non-default usage)
1124 theObject published GEOM.GEOM_Object, arguments of which will be published
1125 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
1126 If this list is empty, all operation arguments will be published
1127 theFindMethod method to search sub-shapes, corresponding to arguments and
1128 their sub-shapes. Value from enumeration GEOM::find_shape_method.
1129 theInheritFirstArg set properties of the first argument for theObject.
1130 Do not publish sub-shapes in place of arguments, but only
1131 in place of sub-shapes of the first argument,
1132 because the whole shape corresponds to the first argument.
1133 Mainly to be used after transformations, but it also can be
1134 useful after partition with one object shape, and some other
1135 operations, where only the first argument has to be considered.
1136 If theObject has only one argument shape, this flag is automatically
1137 considered as True, not regarding really passed value.
1138 theAddPrefix add prefix "from_" to names of restored sub-shapes,
1139 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
1142 list of published sub-shapes
1144 # Example: see GEOM_TestAll.py
1145 return self.RestoreGivenSubShapesO(theObject, theArgs,
1146 theFindMethod, theInheritFirstArg, theAddPrefix)
1148 # end of l3_restore_ss
1151 ## @addtogroup l3_basic_go
1154 ## Create point by three coordinates.
1155 # @param theX The X coordinate of the point.
1156 # @param theY The Y coordinate of the point.
1157 # @param theZ The Z coordinate of the point.
1158 # @param theName Object name; when specified, this parameter is used
1159 # for result publication in the study. Otherwise, if automatic
1160 # publication is switched on, default value is used for result name.
1162 # @return New GEOM.GEOM_Object, containing the created point.
1164 # @ref tui_creation_point "Example"
1165 @ManageTransactions("BasicOp")
1166 def MakeVertex(self, theX, theY, theZ, theName=None):
1168 Create point by three coordinates.
1171 theX The X coordinate of the point.
1172 theY The Y coordinate of the point.
1173 theZ The Z coordinate of the point.
1174 theName Object name; when specified, this parameter is used
1175 for result publication in the study. Otherwise, if automatic
1176 publication is switched on, default value is used for result name.
1179 New GEOM.GEOM_Object, containing the created point.
1181 # Example: see GEOM_TestAll.py
1182 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1183 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
1184 RaiseIfFailed("MakePointXYZ", self.BasicOp)
1185 anObj.SetParameters(Parameters)
1186 self._autoPublish(anObj, theName, "vertex")
1189 ## Create a point, distant from the referenced point
1190 # on the given distances along the coordinate axes.
1191 # @param theReference The referenced point.
1192 # @param theX Displacement from the referenced point along OX axis.
1193 # @param theY Displacement from the referenced point along OY axis.
1194 # @param theZ Displacement from the referenced point along OZ axis.
1195 # @param theName Object name; when specified, this parameter is used
1196 # for result publication in the study. Otherwise, if automatic
1197 # publication is switched on, default value is used for result name.
1199 # @return New GEOM.GEOM_Object, containing the created point.
1201 # @ref tui_creation_point "Example"
1202 @ManageTransactions("BasicOp")
1203 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
1205 Create a point, distant from the referenced point
1206 on the given distances along the coordinate axes.
1209 theReference The referenced point.
1210 theX Displacement from the referenced point along OX axis.
1211 theY Displacement from the referenced point along OY axis.
1212 theZ Displacement from the referenced point along OZ axis.
1213 theName Object name; when specified, this parameter is used
1214 for result publication in the study. Otherwise, if automatic
1215 publication is switched on, default value is used for result name.
1218 New GEOM.GEOM_Object, containing the created point.
1220 # Example: see GEOM_TestAll.py
1221 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1222 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1223 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1224 anObj.SetParameters(Parameters)
1225 self._autoPublish(anObj, theName, "vertex")
1228 ## Create a point, corresponding to the given parameter on the given curve.
1229 # @param theRefCurve The referenced curve.
1230 # @param theParameter Value of parameter on the referenced curve.
1231 # @param takeOrientationIntoAccount flag that tells if it is necessary
1232 # to take the curve's orientation into account for the
1233 # operation. I.e. if this flag is set, the results for the same
1234 # parameters (except the value 0.5) is different for forward
1235 # and reversed curves. If it is not set the result is the same.
1236 # @param theName Object name; when specified, this parameter is used
1237 # for result publication in the study. Otherwise, if automatic
1238 # publication is switched on, default value is used for result name.
1240 # @return New GEOM.GEOM_Object, containing the created point.
1242 # @ref tui_creation_point "Example"
1243 @ManageTransactions("BasicOp")
1244 def MakeVertexOnCurve(self, theRefCurve, theParameter,
1245 takeOrientationIntoAccount=False, theName=None):
1247 Create a point, corresponding to the given parameter on the given curve.
1250 theRefCurve The referenced curve.
1251 theParameter Value of parameter on the referenced curve.
1252 takeOrientationIntoAccount flag that tells if it is necessary
1253 to take the curve's orientation into account for the
1254 operation. I.e. if this flag is set, the results for
1255 the same parameters (except the value 0.5) is different
1256 for forward and reversed curves. If it is not set
1257 the result is the same.
1258 theName Object name; when specified, this parameter is used
1259 for result publication in the study. Otherwise, if automatic
1260 publication is switched on, default value is used for result name.
1263 New GEOM.GEOM_Object, containing the created point.
1266 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1268 # Example: see GEOM_TestAll.py
1269 theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
1270 theParameter, takeOrientationIntoAccount)
1271 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
1272 takeOrientationIntoAccount)
1273 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1274 anObj.SetParameters(Parameters)
1275 self._autoPublish(anObj, theName, "vertex")
1278 ## Create a point by projection give coordinates on the given curve
1279 # @param theRefCurve The referenced curve.
1280 # @param theX X-coordinate in 3D space
1281 # @param theY Y-coordinate in 3D space
1282 # @param theZ Z-coordinate in 3D space
1283 # @param theName Object name; when specified, this parameter is used
1284 # for result publication in the study. Otherwise, if automatic
1285 # publication is switched on, default value is used for result name.
1287 # @return New GEOM.GEOM_Object, containing the created point.
1289 # @ref tui_creation_point "Example"
1290 @ManageTransactions("BasicOp")
1291 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1293 Create a point by projection give coordinates on the given curve
1296 theRefCurve The referenced curve.
1297 theX X-coordinate in 3D space
1298 theY Y-coordinate in 3D space
1299 theZ Z-coordinate in 3D space
1300 theName Object name; when specified, this parameter is used
1301 for result publication in the study. Otherwise, if automatic
1302 publication is switched on, default value is used for result name.
1305 New GEOM.GEOM_Object, containing the created point.
1308 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1310 # Example: see GEOM_TestAll.py
1311 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1312 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1313 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1314 anObj.SetParameters(Parameters)
1315 self._autoPublish(anObj, theName, "vertex")
1318 ## Create a point, corresponding to the given length on the given curve.
1319 # @param theRefCurve The referenced curve.
1320 # @param theLength Length on the referenced curve. It can be negative.
1321 # @param theStartPoint Point allowing to choose the direction for the calculation
1322 # of the length. If None, start from the first point of theRefCurve.
1323 # @param theName Object name; when specified, this parameter is used
1324 # for result publication in the study. Otherwise, if automatic
1325 # publication is switched on, default value is used for result name.
1327 # @return New GEOM.GEOM_Object, containing the created point.
1329 # @ref tui_creation_point "Example"
1330 @ManageTransactions("BasicOp")
1331 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1333 Create a point, corresponding to the given length on the given curve.
1336 theRefCurve The referenced curve.
1337 theLength Length on the referenced curve. It can be negative.
1338 theStartPoint Point allowing to choose the direction for the calculation
1339 of the length. If None, start from the first point of theRefCurve.
1340 theName Object name; when specified, this parameter is used
1341 for result publication in the study. Otherwise, if automatic
1342 publication is switched on, default value is used for result name.
1345 New GEOM.GEOM_Object, containing the created point.
1347 # Example: see GEOM_TestAll.py
1348 theLength, Parameters = ParseParameters(theLength)
1349 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1350 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1351 anObj.SetParameters(Parameters)
1352 self._autoPublish(anObj, theName, "vertex")
1355 ## Create a point, corresponding to the given parameters on the
1357 # @param theRefSurf The referenced surface.
1358 # @param theUParameter Value of U-parameter on the referenced surface.
1359 # @param theVParameter Value of V-parameter on the referenced surface.
1360 # @param theName Object name; when specified, this parameter is used
1361 # for result publication in the study. Otherwise, if automatic
1362 # publication is switched on, default value is used for result name.
1364 # @return New GEOM.GEOM_Object, containing the created point.
1366 # @ref swig_MakeVertexOnSurface "Example"
1367 @ManageTransactions("BasicOp")
1368 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1370 Create a point, corresponding to the given parameters on the
1374 theRefSurf The referenced surface.
1375 theUParameter Value of U-parameter on the referenced surface.
1376 theVParameter Value of V-parameter on the referenced surface.
1377 theName Object name; when specified, this parameter is used
1378 for result publication in the study. Otherwise, if automatic
1379 publication is switched on, default value is used for result name.
1382 New GEOM.GEOM_Object, containing the created point.
1385 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1387 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1388 # Example: see GEOM_TestAll.py
1389 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1390 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1391 anObj.SetParameters(Parameters);
1392 self._autoPublish(anObj, theName, "vertex")
1395 ## Create a point by projection give coordinates on the given surface
1396 # @param theRefSurf The referenced surface.
1397 # @param theX X-coordinate in 3D space
1398 # @param theY Y-coordinate in 3D space
1399 # @param theZ Z-coordinate in 3D space
1400 # @param theName Object name; when specified, this parameter is used
1401 # for result publication in the study. Otherwise, if automatic
1402 # publication is switched on, default value is used for result name.
1404 # @return New GEOM.GEOM_Object, containing the created point.
1406 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1407 @ManageTransactions("BasicOp")
1408 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1410 Create a point by projection give coordinates on the given surface
1413 theRefSurf The referenced surface.
1414 theX X-coordinate in 3D space
1415 theY Y-coordinate in 3D space
1416 theZ Z-coordinate in 3D space
1417 theName Object name; when specified, this parameter is used
1418 for result publication in the study. Otherwise, if automatic
1419 publication is switched on, default value is used for result name.
1422 New GEOM.GEOM_Object, containing the created point.
1425 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1427 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1428 # Example: see GEOM_TestAll.py
1429 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1430 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1431 anObj.SetParameters(Parameters);
1432 self._autoPublish(anObj, theName, "vertex")
1435 ## Create a point, which lays on the given face.
1436 # The point will lay in arbitrary place of the face.
1437 # The only condition on it is a non-zero distance to the face boundary.
1438 # Such point can be used to uniquely identify the face inside any
1439 # shape in case, when the shape does not contain overlapped faces.
1440 # @param theFace The referenced face.
1441 # @param theName Object name; when specified, this parameter is used
1442 # for result publication in the study. Otherwise, if automatic
1443 # publication is switched on, default value is used for result name.
1445 # @return New GEOM.GEOM_Object, containing the created point.
1447 # @ref swig_MakeVertexInsideFace "Example"
1448 @ManageTransactions("BasicOp")
1449 def MakeVertexInsideFace (self, theFace, theName=None):
1451 Create a point, which lays on the given face.
1452 The point will lay in arbitrary place of the face.
1453 The only condition on it is a non-zero distance to the face boundary.
1454 Such point can be used to uniquely identify the face inside any
1455 shape in case, when the shape does not contain overlapped faces.
1458 theFace The referenced face.
1459 theName Object name; when specified, this parameter is used
1460 for result publication in the study. Otherwise, if automatic
1461 publication is switched on, default value is used for result name.
1464 New GEOM.GEOM_Object, containing the created point.
1467 p_on_face = geompy.MakeVertexInsideFace(Face)
1469 # Example: see GEOM_TestAll.py
1470 anObj = self.BasicOp.MakePointOnFace(theFace)
1471 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1472 self._autoPublish(anObj, theName, "vertex")
1475 ## Create a point on intersection of two lines.
1476 # @param theRefLine1, theRefLine2 The referenced lines.
1477 # @param theName Object name; when specified, this parameter is used
1478 # for result publication in the study. Otherwise, if automatic
1479 # publication is switched on, default value is used for result name.
1481 # @return New GEOM.GEOM_Object, containing the created point.
1483 # @ref swig_MakeVertexOnLinesIntersection "Example"
1484 @ManageTransactions("BasicOp")
1485 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1487 Create a point on intersection of two lines.
1490 theRefLine1, theRefLine2 The referenced lines.
1491 theName Object name; when specified, this parameter is used
1492 for result publication in the study. Otherwise, if automatic
1493 publication is switched on, default value is used for result name.
1496 New GEOM.GEOM_Object, containing the created point.
1498 # Example: see GEOM_TestAll.py
1499 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1500 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1501 self._autoPublish(anObj, theName, "vertex")
1504 ## Create a tangent, corresponding to the given parameter on the given curve.
1505 # @param theRefCurve The referenced curve.
1506 # @param theParameter Value of parameter on the referenced curve.
1507 # @param theName Object name; when specified, this parameter is used
1508 # for result publication in the study. Otherwise, if automatic
1509 # publication is switched on, default value is used for result name.
1511 # @return New GEOM.GEOM_Object, containing the created tangent.
1513 # @ref swig_MakeTangentOnCurve "Example"
1514 @ManageTransactions("BasicOp")
1515 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1517 Create a tangent, corresponding to the given parameter on the given curve.
1520 theRefCurve The referenced curve.
1521 theParameter Value of parameter on the referenced curve.
1522 theName Object name; when specified, this parameter is used
1523 for result publication in the study. Otherwise, if automatic
1524 publication is switched on, default value is used for result name.
1527 New GEOM.GEOM_Object, containing the created tangent.
1530 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1532 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1533 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1534 self._autoPublish(anObj, theName, "tangent")
1537 ## Create a tangent plane, corresponding to the given parameter on the given face.
1538 # @param theFace The face for which tangent plane should be built.
1539 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1540 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1541 # @param theTrimSize the size of plane.
1542 # @param theName Object name; when specified, this parameter is used
1543 # for result publication in the study. Otherwise, if automatic
1544 # publication is switched on, default value is used for result name.
1546 # @return New GEOM.GEOM_Object, containing the created tangent.
1548 # @ref swig_MakeTangentPlaneOnFace "Example"
1549 @ManageTransactions("BasicOp")
1550 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1552 Create a tangent plane, corresponding to the given parameter on the given face.
1555 theFace The face for which tangent plane should be built.
1556 theParameterV vertical value of the center point (0.0 - 1.0).
1557 theParameterU horisontal value of the center point (0.0 - 1.0).
1558 theTrimSize the size of plane.
1559 theName Object name; when specified, this parameter is used
1560 for result publication in the study. Otherwise, if automatic
1561 publication is switched on, default value is used for result name.
1564 New GEOM.GEOM_Object, containing the created tangent.
1567 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1569 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1570 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1571 self._autoPublish(anObj, theName, "tangent")
1574 ## Create a vector with the given components.
1575 # @param theDX X component of the vector.
1576 # @param theDY Y component of the vector.
1577 # @param theDZ Z component of the vector.
1578 # @param theName Object name; when specified, this parameter is used
1579 # for result publication in the study. Otherwise, if automatic
1580 # publication is switched on, default value is used for result name.
1582 # @return New GEOM.GEOM_Object, containing the created vector.
1584 # @ref tui_creation_vector "Example"
1585 @ManageTransactions("BasicOp")
1586 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1588 Create a vector with the given components.
1591 theDX X component of the vector.
1592 theDY Y component of the vector.
1593 theDZ Z component of the vector.
1594 theName Object name; when specified, this parameter is used
1595 for result publication in the study. Otherwise, if automatic
1596 publication is switched on, default value is used for result name.
1599 New GEOM.GEOM_Object, containing the created vector.
1601 # Example: see GEOM_TestAll.py
1602 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1603 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1604 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1605 anObj.SetParameters(Parameters)
1606 self._autoPublish(anObj, theName, "vector")
1609 ## Create a vector between two points.
1610 # @param thePnt1 Start point for the vector.
1611 # @param thePnt2 End point for the vector.
1612 # @param theName Object name; when specified, this parameter is used
1613 # for result publication in the study. Otherwise, if automatic
1614 # publication is switched on, default value is used for result name.
1616 # @return New GEOM.GEOM_Object, containing the created vector.
1618 # @ref tui_creation_vector "Example"
1619 @ManageTransactions("BasicOp")
1620 def MakeVector(self, thePnt1, thePnt2, theName=None):
1622 Create a vector between two points.
1625 thePnt1 Start point for the vector.
1626 thePnt2 End point for the vector.
1627 theName Object name; when specified, this parameter is used
1628 for result publication in the study. Otherwise, if automatic
1629 publication is switched on, default value is used for result name.
1632 New GEOM.GEOM_Object, containing the created vector.
1634 # Example: see GEOM_TestAll.py
1635 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1636 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1637 self._autoPublish(anObj, theName, "vector")
1640 ## Create a line, passing through the given point
1641 # and parallel to the given direction
1642 # @param thePnt Point. The resulting line will pass through it.
1643 # @param theDir Direction. The resulting line will be parallel to it.
1644 # @param theName Object name; when specified, this parameter is used
1645 # for result publication in the study. Otherwise, if automatic
1646 # publication is switched on, default value is used for result name.
1648 # @return New GEOM.GEOM_Object, containing the created line.
1650 # @ref tui_creation_line "Example"
1651 @ManageTransactions("BasicOp")
1652 def MakeLine(self, thePnt, theDir, theName=None):
1654 Create a line, passing through the given point
1655 and parallel to the given direction
1658 thePnt Point. The resulting line will pass through it.
1659 theDir Direction. The resulting line will be parallel to it.
1660 theName Object name; when specified, this parameter is used
1661 for result publication in the study. Otherwise, if automatic
1662 publication is switched on, default value is used for result name.
1665 New GEOM.GEOM_Object, containing the created line.
1667 # Example: see GEOM_TestAll.py
1668 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1669 RaiseIfFailed("MakeLine", self.BasicOp)
1670 self._autoPublish(anObj, theName, "line")
1673 ## Create a line, passing through the given points
1674 # @param thePnt1 First of two points, defining the line.
1675 # @param thePnt2 Second of two points, defining the line.
1676 # @param theName Object name; when specified, this parameter is used
1677 # for result publication in the study. Otherwise, if automatic
1678 # publication is switched on, default value is used for result name.
1680 # @return New GEOM.GEOM_Object, containing the created line.
1682 # @ref tui_creation_line "Example"
1683 @ManageTransactions("BasicOp")
1684 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1686 Create a line, passing through the given points
1689 thePnt1 First of two points, defining the line.
1690 thePnt2 Second of two points, defining the line.
1691 theName Object name; when specified, this parameter is used
1692 for result publication in the study. Otherwise, if automatic
1693 publication is switched on, default value is used for result name.
1696 New GEOM.GEOM_Object, containing the created line.
1698 # Example: see GEOM_TestAll.py
1699 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1700 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1701 self._autoPublish(anObj, theName, "line")
1704 ## Create a line on two faces intersection.
1705 # @param theFace1 First of two faces, defining the line.
1706 # @param theFace2 Second of two faces, defining the line.
1707 # @param theName Object name; when specified, this parameter is used
1708 # for result publication in the study. Otherwise, if automatic
1709 # publication is switched on, default value is used for result name.
1711 # @return New GEOM.GEOM_Object, containing the created line.
1713 # @ref swig_MakeLineTwoFaces "Example"
1714 @ManageTransactions("BasicOp")
1715 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1717 Create a line on two faces intersection.
1720 theFace1 First of two faces, defining the line.
1721 theFace2 Second of two faces, defining the line.
1722 theName Object name; when specified, this parameter is used
1723 for result publication in the study. Otherwise, if automatic
1724 publication is switched on, default value is used for result name.
1727 New GEOM.GEOM_Object, containing the created line.
1729 # Example: see GEOM_TestAll.py
1730 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1731 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1732 self._autoPublish(anObj, theName, "line")
1735 ## Create a plane, passing through the given point
1736 # and normal to the given vector.
1737 # @param thePnt Point, the plane has to pass through.
1738 # @param theVec Vector, defining the plane normal direction.
1739 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1740 # @param theName Object name; when specified, this parameter is used
1741 # for result publication in the study. Otherwise, if automatic
1742 # publication is switched on, default value is used for result name.
1744 # @return New GEOM.GEOM_Object, containing the created plane.
1746 # @ref tui_creation_plane "Example"
1747 @ManageTransactions("BasicOp")
1748 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1750 Create a plane, passing through the given point
1751 and normal to the given vector.
1754 thePnt Point, the plane has to pass through.
1755 theVec Vector, defining the plane normal direction.
1756 theTrimSize Half size of a side of quadrangle face, representing the plane.
1757 theName Object name; when specified, this parameter is used
1758 for result publication in the study. Otherwise, if automatic
1759 publication is switched on, default value is used for result name.
1762 New GEOM.GEOM_Object, containing the created plane.
1764 # Example: see GEOM_TestAll.py
1765 theTrimSize, Parameters = ParseParameters(theTrimSize);
1766 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1767 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1768 anObj.SetParameters(Parameters)
1769 self._autoPublish(anObj, theName, "plane")
1772 ## Create a plane, passing through the three given points
1773 # @param thePnt1 First of three points, defining the plane.
1774 # @param thePnt2 Second of three points, defining the plane.
1775 # @param thePnt3 Third of three points, defining the plane.
1776 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1777 # @param theName Object name; when specified, this parameter is used
1778 # for result publication in the study. Otherwise, if automatic
1779 # publication is switched on, default value is used for result name.
1781 # @return New GEOM.GEOM_Object, containing the created plane.
1783 # @ref tui_creation_plane "Example"
1784 @ManageTransactions("BasicOp")
1785 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1787 Create a plane, passing through the three given points
1790 thePnt1 First of three points, defining the plane.
1791 thePnt2 Second of three points, defining the plane.
1792 thePnt3 Third of three points, defining the plane.
1793 theTrimSize Half size of a side of quadrangle face, representing the plane.
1794 theName Object name; when specified, this parameter is used
1795 for result publication in the study. Otherwise, if automatic
1796 publication is switched on, default value is used for result name.
1799 New GEOM.GEOM_Object, containing the created plane.
1801 # Example: see GEOM_TestAll.py
1802 theTrimSize, Parameters = ParseParameters(theTrimSize);
1803 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1804 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1805 anObj.SetParameters(Parameters)
1806 self._autoPublish(anObj, theName, "plane")
1809 ## Create a plane, similar to the existing one, but with another size of representing face.
1810 # @param theFace Referenced plane or LCS(Marker).
1811 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1812 # @param theName Object name; when specified, this parameter is used
1813 # for result publication in the study. Otherwise, if automatic
1814 # publication is switched on, default value is used for result name.
1816 # @return New GEOM.GEOM_Object, containing the created plane.
1818 # @ref tui_creation_plane "Example"
1819 @ManageTransactions("BasicOp")
1820 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1822 Create a plane, similar to the existing one, but with another size of representing face.
1825 theFace Referenced plane or LCS(Marker).
1826 theTrimSize New half size of a side of quadrangle face, representing the plane.
1827 theName Object name; when specified, this parameter is used
1828 for result publication in the study. Otherwise, if automatic
1829 publication is switched on, default value is used for result name.
1832 New GEOM.GEOM_Object, containing the created plane.
1834 # Example: see GEOM_TestAll.py
1835 theTrimSize, Parameters = ParseParameters(theTrimSize);
1836 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1837 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1838 anObj.SetParameters(Parameters)
1839 self._autoPublish(anObj, theName, "plane")
1842 ## Create a plane, passing through the 2 vectors
1843 # with center in a start point of the first vector.
1844 # @param theVec1 Vector, defining center point and plane direction.
1845 # @param theVec2 Vector, defining the plane normal direction.
1846 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1847 # @param theName Object name; when specified, this parameter is used
1848 # for result publication in the study. Otherwise, if automatic
1849 # publication is switched on, default value is used for result name.
1851 # @return New GEOM.GEOM_Object, containing the created plane.
1853 # @ref tui_creation_plane "Example"
1854 @ManageTransactions("BasicOp")
1855 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1857 Create a plane, passing through the 2 vectors
1858 with center in a start point of the first vector.
1861 theVec1 Vector, defining center point and plane direction.
1862 theVec2 Vector, defining the plane normal direction.
1863 theTrimSize Half size of a side of quadrangle face, representing the plane.
1864 theName Object name; when specified, this parameter is used
1865 for result publication in the study. Otherwise, if automatic
1866 publication is switched on, default value is used for result name.
1869 New GEOM.GEOM_Object, containing the created plane.
1871 # Example: see GEOM_TestAll.py
1872 theTrimSize, Parameters = ParseParameters(theTrimSize);
1873 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1874 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1875 anObj.SetParameters(Parameters)
1876 self._autoPublish(anObj, theName, "plane")
1879 ## Create a plane, based on a Local coordinate system.
1880 # @param theLCS coordinate system, defining plane.
1881 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1882 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1883 # @param theName Object name; when specified, this parameter is used
1884 # for result publication in the study. Otherwise, if automatic
1885 # publication is switched on, default value is used for result name.
1887 # @return New GEOM.GEOM_Object, containing the created plane.
1889 # @ref tui_creation_plane "Example"
1890 @ManageTransactions("BasicOp")
1891 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1893 Create a plane, based on a Local coordinate system.
1896 theLCS coordinate system, defining plane.
1897 theTrimSize Half size of a side of quadrangle face, representing the plane.
1898 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1899 theName Object name; when specified, this parameter is used
1900 for result publication in the study. Otherwise, if automatic
1901 publication is switched on, default value is used for result name.
1904 New GEOM.GEOM_Object, containing the created plane.
1906 # Example: see GEOM_TestAll.py
1907 theTrimSize, Parameters = ParseParameters(theTrimSize);
1908 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1909 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1910 anObj.SetParameters(Parameters)
1911 self._autoPublish(anObj, theName, "plane")
1914 ## Create a local coordinate system.
1915 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1916 # @param XDX,XDY,XDZ Three components of OX direction
1917 # @param YDX,YDY,YDZ Three components of OY direction
1918 # @param theName Object name; when specified, this parameter is used
1919 # for result publication in the study. Otherwise, if automatic
1920 # publication is switched on, default value is used for result name.
1922 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1924 # @ref swig_MakeMarker "Example"
1925 @ManageTransactions("BasicOp")
1926 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1928 Create a local coordinate system.
1931 OX,OY,OZ Three coordinates of coordinate system origin.
1932 XDX,XDY,XDZ Three components of OX direction
1933 YDX,YDY,YDZ Three components of OY direction
1934 theName Object name; when specified, this parameter is used
1935 for result publication in the study. Otherwise, if automatic
1936 publication is switched on, default value is used for result name.
1939 New GEOM.GEOM_Object, containing the created coordinate system.
1941 # Example: see GEOM_TestAll.py
1942 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1943 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1944 RaiseIfFailed("MakeMarker", self.BasicOp)
1945 anObj.SetParameters(Parameters)
1946 self._autoPublish(anObj, theName, "lcs")
1949 ## Create a local coordinate system from shape.
1950 # @param theShape The initial shape to detect the coordinate system.
1951 # @param theName Object name; when specified, this parameter is used
1952 # for result publication in the study. Otherwise, if automatic
1953 # publication is switched on, default value is used for result name.
1955 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1957 # @ref tui_creation_lcs "Example"
1958 @ManageTransactions("BasicOp")
1959 def MakeMarkerFromShape(self, theShape, theName=None):
1961 Create a local coordinate system from shape.
1964 theShape The initial shape to detect the coordinate system.
1965 theName Object name; when specified, this parameter is used
1966 for result publication in the study. Otherwise, if automatic
1967 publication is switched on, default value is used for result name.
1970 New GEOM.GEOM_Object, containing the created coordinate system.
1972 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1973 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1974 self._autoPublish(anObj, theName, "lcs")
1977 ## Create a local coordinate system from point and two vectors.
1978 # @param theOrigin Point of coordinate system origin.
1979 # @param theXVec Vector of X direction
1980 # @param theYVec Vector of Y direction
1981 # @param theName Object name; when specified, this parameter is used
1982 # for result publication in the study. Otherwise, if automatic
1983 # publication is switched on, default value is used for result name.
1985 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1987 # @ref tui_creation_lcs "Example"
1988 @ManageTransactions("BasicOp")
1989 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1991 Create a local coordinate system from point and two vectors.
1994 theOrigin Point of coordinate system origin.
1995 theXVec Vector of X direction
1996 theYVec Vector of Y direction
1997 theName Object name; when specified, this parameter is used
1998 for result publication in the study. Otherwise, if automatic
1999 publication is switched on, default value is used for result name.
2002 New GEOM.GEOM_Object, containing the created coordinate system.
2005 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
2006 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
2007 self._autoPublish(anObj, theName, "lcs")
2010 # end of l3_basic_go
2013 ## @addtogroup l4_curves
2016 ## Create an arc of circle, passing through three given points.
2017 # @param thePnt1 Start point of the arc.
2018 # @param thePnt2 Middle point of the arc.
2019 # @param thePnt3 End point of the arc.
2020 # @param theName Object name; when specified, this parameter is used
2021 # for result publication in the study. Otherwise, if automatic
2022 # publication is switched on, default value is used for result name.
2024 # @return New GEOM.GEOM_Object, containing the created arc.
2026 # @ref swig_MakeArc "Example"
2027 @ManageTransactions("CurvesOp")
2028 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
2030 Create an arc of circle, passing through three given points.
2033 thePnt1 Start point of the arc.
2034 thePnt2 Middle point of the arc.
2035 thePnt3 End point of the arc.
2036 theName Object name; when specified, this parameter is used
2037 for result publication in the study. Otherwise, if automatic
2038 publication is switched on, default value is used for result name.
2041 New GEOM.GEOM_Object, containing the created arc.
2043 # Example: see GEOM_TestAll.py
2044 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
2045 RaiseIfFailed("MakeArc", self.CurvesOp)
2046 self._autoPublish(anObj, theName, "arc")
2049 ## Create an arc of circle from a center and 2 points.
2050 # @param thePnt1 Center of the arc
2051 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
2052 # @param thePnt3 End point of the arc (Gives also a direction)
2053 # @param theSense Orientation of the arc
2054 # @param theName Object name; when specified, this parameter is used
2055 # for result publication in the study. Otherwise, if automatic
2056 # publication is switched on, default value is used for result name.
2058 # @return New GEOM.GEOM_Object, containing the created arc.
2060 # @ref swig_MakeArc "Example"
2061 @ManageTransactions("CurvesOp")
2062 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
2064 Create an arc of circle from a center and 2 points.
2067 thePnt1 Center of the arc
2068 thePnt2 Start point of the arc. (Gives also the radius of the arc)
2069 thePnt3 End point of the arc (Gives also a direction)
2070 theSense Orientation of the arc
2071 theName Object name; when specified, this parameter is used
2072 for result publication in the study. Otherwise, if automatic
2073 publication is switched on, default value is used for result name.
2076 New GEOM.GEOM_Object, containing the created arc.
2078 # Example: see GEOM_TestAll.py
2079 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
2080 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
2081 self._autoPublish(anObj, theName, "arc")
2084 ## Create an arc of ellipse, of center and two points.
2085 # @param theCenter Center of the arc.
2086 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2087 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2088 # @param theName Object name; when specified, this parameter is used
2089 # for result publication in the study. Otherwise, if automatic
2090 # publication is switched on, default value is used for result name.
2092 # @return New GEOM.GEOM_Object, containing the created arc.
2094 # @ref swig_MakeArc "Example"
2095 @ManageTransactions("CurvesOp")
2096 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
2098 Create an arc of ellipse, of center and two points.
2101 theCenter Center of the arc.
2102 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
2103 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
2104 theName Object name; when specified, this parameter is used
2105 for result publication in the study. Otherwise, if automatic
2106 publication is switched on, default value is used for result name.
2109 New GEOM.GEOM_Object, containing the created arc.
2111 # Example: see GEOM_TestAll.py
2112 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
2113 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
2114 self._autoPublish(anObj, theName, "arc")
2117 ## Create a circle with given center, normal vector and radius.
2118 # @param thePnt Circle center.
2119 # @param theVec Vector, normal to the plane of the circle.
2120 # @param theR Circle radius.
2121 # @param theName Object name; when specified, this parameter is used
2122 # for result publication in the study. Otherwise, if automatic
2123 # publication is switched on, default value is used for result name.
2125 # @return New GEOM.GEOM_Object, containing the created circle.
2127 # @ref tui_creation_circle "Example"
2128 @ManageTransactions("CurvesOp")
2129 def MakeCircle(self, thePnt, theVec, theR, theName=None):
2131 Create a circle with given center, normal vector and radius.
2134 thePnt Circle center.
2135 theVec Vector, normal to the plane of the circle.
2137 theName Object name; when specified, this parameter is used
2138 for result publication in the study. Otherwise, if automatic
2139 publication is switched on, default value is used for result name.
2142 New GEOM.GEOM_Object, containing the created circle.
2144 # Example: see GEOM_TestAll.py
2145 theR, Parameters = ParseParameters(theR)
2146 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
2147 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2148 anObj.SetParameters(Parameters)
2149 self._autoPublish(anObj, theName, "circle")
2152 ## Create a circle with given radius.
2153 # Center of the circle will be in the origin of global
2154 # coordinate system and normal vector will be codirected with Z axis
2155 # @param theR Circle radius.
2156 # @param theName Object name; when specified, this parameter is used
2157 # for result publication in the study. Otherwise, if automatic
2158 # publication is switched on, default value is used for result name.
2160 # @return New GEOM.GEOM_Object, containing the created circle.
2161 @ManageTransactions("CurvesOp")
2162 def MakeCircleR(self, theR, theName=None):
2164 Create a circle with given radius.
2165 Center of the circle will be in the origin of global
2166 coordinate system and normal vector will be codirected with Z axis
2170 theName Object name; when specified, this parameter is used
2171 for result publication in the study. Otherwise, if automatic
2172 publication is switched on, default value is used for result name.
2175 New GEOM.GEOM_Object, containing the created circle.
2177 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
2178 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
2179 self._autoPublish(anObj, theName, "circle")
2182 ## Create a circle, passing through three given points
2183 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2184 # @param theName Object name; when specified, this parameter is used
2185 # for result publication in the study. Otherwise, if automatic
2186 # publication is switched on, default value is used for result name.
2188 # @return New GEOM.GEOM_Object, containing the created circle.
2190 # @ref tui_creation_circle "Example"
2191 @ManageTransactions("CurvesOp")
2192 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2194 Create a circle, passing through three given points
2197 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2198 theName Object name; when specified, this parameter is used
2199 for result publication in the study. Otherwise, if automatic
2200 publication is switched on, default value is used for result name.
2203 New GEOM.GEOM_Object, containing the created circle.
2205 # Example: see GEOM_TestAll.py
2206 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
2207 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
2208 self._autoPublish(anObj, theName, "circle")
2211 ## Create a circle, with given point1 as center,
2212 # passing through the point2 as radius and laying in the plane,
2213 # defined by all three given points.
2214 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
2215 # @param theName Object name; when specified, this parameter is used
2216 # for result publication in the study. Otherwise, if automatic
2217 # publication is switched on, default value is used for result name.
2219 # @return New GEOM.GEOM_Object, containing the created circle.
2221 # @ref swig_MakeCircle "Example"
2222 @ManageTransactions("CurvesOp")
2223 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2225 Create a circle, with given point1 as center,
2226 passing through the point2 as radius and laying in the plane,
2227 defined by all three given points.
2230 thePnt1,thePnt2,thePnt3 Points, defining the circle.
2231 theName Object name; when specified, this parameter is used
2232 for result publication in the study. Otherwise, if automatic
2233 publication is switched on, default value is used for result name.
2236 New GEOM.GEOM_Object, containing the created circle.
2238 # Example: see GEOM_example6.py
2239 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
2240 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
2241 self._autoPublish(anObj, theName, "circle")
2244 ## Create an ellipse with given center, normal vector and radiuses.
2245 # @param thePnt Ellipse center.
2246 # @param theVec Vector, normal to the plane of the ellipse.
2247 # @param theRMajor Major ellipse radius.
2248 # @param theRMinor Minor ellipse radius.
2249 # @param theVecMaj Vector, direction of the ellipse's main axis.
2250 # @param theName Object name; when specified, this parameter is used
2251 # for result publication in the study. Otherwise, if automatic
2252 # publication is switched on, default value is used for result name.
2254 # @return New GEOM.GEOM_Object, containing the created ellipse.
2256 # @ref tui_creation_ellipse "Example"
2257 @ManageTransactions("CurvesOp")
2258 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2260 Create an ellipse with given center, normal vector and radiuses.
2263 thePnt Ellipse center.
2264 theVec Vector, normal to the plane of the ellipse.
2265 theRMajor Major ellipse radius.
2266 theRMinor Minor ellipse radius.
2267 theVecMaj Vector, direction of the ellipse's main axis.
2268 theName Object name; when specified, this parameter is used
2269 for result publication in the study. Otherwise, if automatic
2270 publication is switched on, default value is used for result name.
2273 New GEOM.GEOM_Object, containing the created ellipse.
2275 # Example: see GEOM_TestAll.py
2276 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2277 if theVecMaj is not None:
2278 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2280 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2282 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2283 anObj.SetParameters(Parameters)
2284 self._autoPublish(anObj, theName, "ellipse")
2287 ## Create an ellipse with given radiuses.
2288 # Center of the ellipse will be in the origin of global
2289 # coordinate system and normal vector will be codirected with Z axis
2290 # @param theRMajor Major ellipse radius.
2291 # @param theRMinor Minor ellipse radius.
2292 # @param theName Object name; when specified, this parameter is used
2293 # for result publication in the study. Otherwise, if automatic
2294 # publication is switched on, default value is used for result name.
2296 # @return New GEOM.GEOM_Object, containing the created ellipse.
2297 @ManageTransactions("CurvesOp")
2298 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2300 Create an ellipse with given radiuses.
2301 Center of the ellipse will be in the origin of global
2302 coordinate system and normal vector will be codirected with Z axis
2305 theRMajor Major ellipse radius.
2306 theRMinor Minor ellipse radius.
2307 theName Object name; when specified, this parameter is used
2308 for result publication in the study. Otherwise, if automatic
2309 publication is switched on, default value is used for result name.
2312 New GEOM.GEOM_Object, containing the created ellipse.
2314 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2315 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2316 self._autoPublish(anObj, theName, "ellipse")
2319 ## Create a polyline on the set of points.
2320 # @param thePoints Sequence of points for the polyline.
2321 # @param theIsClosed If True, build a closed wire.
2322 # @param theName Object name; when specified, this parameter is used
2323 # for result publication in the study. Otherwise, if automatic
2324 # publication is switched on, default value is used for result name.
2326 # @return New GEOM.GEOM_Object, containing the created polyline.
2328 # @ref tui_creation_curve "Example"
2329 @ManageTransactions("CurvesOp")
2330 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2332 Create a polyline on the set of points.
2335 thePoints Sequence of points for the polyline.
2336 theIsClosed If True, build a closed wire.
2337 theName Object name; when specified, this parameter is used
2338 for result publication in the study. Otherwise, if automatic
2339 publication is switched on, default value is used for result name.
2342 New GEOM.GEOM_Object, containing the created polyline.
2344 # Example: see GEOM_TestAll.py
2345 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2346 RaiseIfFailed("MakePolyline", self.CurvesOp)
2347 self._autoPublish(anObj, theName, "polyline")
2350 ## Create bezier curve on the set of points.
2351 # @param thePoints Sequence of points for the bezier curve.
2352 # @param theIsClosed If True, build a closed curve.
2353 # @param theName Object name; when specified, this parameter is used
2354 # for result publication in the study. Otherwise, if automatic
2355 # publication is switched on, default value is used for result name.
2357 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2359 # @ref tui_creation_curve "Example"
2360 @ManageTransactions("CurvesOp")
2361 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2363 Create bezier curve on the set of points.
2366 thePoints Sequence of points for the bezier curve.
2367 theIsClosed If True, build a closed curve.
2368 theName Object name; when specified, this parameter is used
2369 for result publication in the study. Otherwise, if automatic
2370 publication is switched on, default value is used for result name.
2373 New GEOM.GEOM_Object, containing the created bezier curve.
2375 # Example: see GEOM_TestAll.py
2376 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2377 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2378 self._autoPublish(anObj, theName, "bezier")
2381 ## Create B-Spline curve on the set of points.
2382 # @param thePoints Sequence of points for the B-Spline curve.
2383 # @param theIsClosed If True, build a closed curve.
2384 # @param theDoReordering If TRUE, the algo does not follow the order of
2385 # \a thePoints but searches for the closest vertex.
2386 # @param theName Object name; when specified, this parameter is used
2387 # for result publication in the study. Otherwise, if automatic
2388 # publication is switched on, default value is used for result name.
2390 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2392 # @ref tui_creation_curve "Example"
2393 @ManageTransactions("CurvesOp")
2394 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2396 Create B-Spline curve on the set of points.
2399 thePoints Sequence of points for the B-Spline curve.
2400 theIsClosed If True, build a closed curve.
2401 theDoReordering If True, the algo does not follow the order of
2402 thePoints but searches for the closest vertex.
2403 theName Object name; when specified, this parameter is used
2404 for result publication in the study. Otherwise, if automatic
2405 publication is switched on, default value is used for result name.
2408 New GEOM.GEOM_Object, containing the created B-Spline curve.
2410 # Example: see GEOM_TestAll.py
2411 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2412 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2413 self._autoPublish(anObj, theName, "bspline")
2416 ## Create B-Spline curve on the set of points.
2417 # @param thePoints Sequence of points for the B-Spline curve.
2418 # @param theFirstVec Vector object, defining the curve direction at its first point.
2419 # @param theLastVec Vector object, defining the curve direction at its last point.
2420 # @param theName Object name; when specified, this parameter is used
2421 # for result publication in the study. Otherwise, if automatic
2422 # publication is switched on, default value is used for result name.
2424 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2426 # @ref tui_creation_curve "Example"
2427 @ManageTransactions("CurvesOp")
2428 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2430 Create B-Spline curve on the set of points.
2433 thePoints Sequence of points for the B-Spline curve.
2434 theFirstVec Vector object, defining the curve direction at its first point.
2435 theLastVec Vector object, defining the curve direction at its last point.
2436 theName Object name; when specified, this parameter is used
2437 for result publication in the study. Otherwise, if automatic
2438 publication is switched on, default value is used for result name.
2441 New GEOM.GEOM_Object, containing the created B-Spline curve.
2443 # Example: see GEOM_TestAll.py
2444 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2445 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2446 self._autoPublish(anObj, theName, "bspline")
2449 ## Creates a curve using the parametric definition of the basic points.
2450 # @param thexExpr parametric equation of the coordinates X.
2451 # @param theyExpr parametric equation of the coordinates Y.
2452 # @param thezExpr parametric equation of the coordinates Z.
2453 # @param theParamMin the minimal value of the parameter.
2454 # @param theParamMax the maximum value of the parameter.
2455 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2456 # @param theCurveType the type of the curve,
2457 # one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2458 # @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.
2459 # @param theName Object name; when specified, this parameter is used
2460 # for result publication in the study. Otherwise, if automatic
2461 # publication is switched on, default value is used for result name.
2463 # @return New GEOM.GEOM_Object, containing the created curve.
2465 # @ref tui_creation_curve "Example"
2466 @ManageTransactions("CurvesOp")
2467 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2468 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2470 Creates a curve using the parametric definition of the basic points.
2473 thexExpr parametric equation of the coordinates X.
2474 theyExpr parametric equation of the coordinates Y.
2475 thezExpr parametric equation of the coordinates Z.
2476 theParamMin the minimal value of the parameter.
2477 theParamMax the maximum value of the parameter.
2478 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2479 theCurveType the type of the curve,
2480 one of GEOM.Polyline, GEOM.Bezier, GEOM.Interpolation.
2481 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2482 method is used which can lead to a bug.
2483 theName Object name; when specified, this parameter is used
2484 for result publication in the study. Otherwise, if automatic
2485 publication is switched on, default value is used for result name.
2488 New GEOM.GEOM_Object, containing the created curve.
2490 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2492 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2494 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2495 RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
2496 anObj.SetParameters(Parameters)
2497 self._autoPublish(anObj, theName, "curve")
2500 ## Create an isoline curve on a face.
2501 # @param theFace the face for which an isoline is created.
2502 # @param IsUIsoline True for U-isoline creation; False for V-isoline
2504 # @param theParameter the U parameter for U-isoline or V parameter
2506 # @param theName Object name; when specified, this parameter is used
2507 # for result publication in the study. Otherwise, if automatic
2508 # publication is switched on, default value is used for result name.
2510 # @return New GEOM.GEOM_Object, containing the created isoline edge or
2511 # a compound of edges.
2513 # @ref tui_creation_curve "Example"
2514 @ManageTransactions("CurvesOp")
2515 def MakeIsoline(self, theFace, IsUIsoline, theParameter, theName=None):
2517 Create an isoline curve on a face.
2520 theFace the face for which an isoline is created.
2521 IsUIsoline True for U-isoline creation; False for V-isoline
2523 theParameter the U parameter for U-isoline or V parameter
2525 theName Object name; when specified, this parameter is used
2526 for result publication in the study. Otherwise, if automatic
2527 publication is switched on, default value is used for result name.
2530 New GEOM.GEOM_Object, containing the created isoline edge or a
2533 # Example: see GEOM_TestAll.py
2534 anObj = self.CurvesOp.MakeIsoline(theFace, IsUIsoline, theParameter)
2535 RaiseIfFailed("MakeIsoline", self.CurvesOp)
2537 self._autoPublish(anObj, theName, "U-Isoline")
2539 self._autoPublish(anObj, theName, "V-Isoline")
2545 ## @addtogroup l3_sketcher
2548 ## Create a sketcher (wire or face), following the textual description,
2549 # passed through <VAR>theCommand</VAR> argument. \n
2550 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2551 # Format of the description string have to be the following:
2553 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2556 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2558 # - "R angle" : Set the direction by angle
2559 # - "D dx dy" : Set the direction by DX & DY
2562 # - "TT x y" : Create segment by point at X & Y
2563 # - "T dx dy" : Create segment by point with DX & DY
2564 # - "L length" : Create segment by direction & Length
2565 # - "IX x" : Create segment by direction & Intersect. X
2566 # - "IY y" : Create segment by direction & Intersect. Y
2569 # - "C radius length" : Create arc by direction, radius and length(in degree)
2570 # - "AA x y": Create arc by point at X & Y
2571 # - "A dx dy" : Create arc by point with DX & DY
2572 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2573 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2574 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2575 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2578 # - "WW" : Close Wire (to finish)
2579 # - "WF" : Close Wire and build face (to finish)
2582 # - Flag1 (= reverse) is 0 or 2 ...
2583 # - if 0 the drawn arc is the one of lower angle (< Pi)
2584 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2587 # - Flag2 (= control tolerance) is 0 or 1 ...
2588 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2589 # - if 1 the wire is built only if the end point is on the arc
2590 # with a tolerance of 10^-7 on the distance else the creation fails
2592 # @param theCommand String, defining the sketcher in local
2593 # coordinates of the working plane.
2594 # @param theWorkingPlane Nine double values, defining origin,
2595 # OZ and OX directions of the working plane.
2596 # @param theName Object name; when specified, this parameter is used
2597 # for result publication in the study. Otherwise, if automatic
2598 # publication is switched on, default value is used for result name.
2600 # @return New GEOM.GEOM_Object, containing the created wire.
2602 # @ref tui_sketcher_page "Example"
2603 @ManageTransactions("CurvesOp")
2604 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2606 Create a sketcher (wire or face), following the textual description, passed
2607 through theCommand argument.
2608 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2609 Format of the description string have to be the following:
2610 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2612 - x1, y1 are coordinates of the first sketcher point (zero by default),
2614 - "R angle" : Set the direction by angle
2615 - "D dx dy" : Set the direction by DX & DY
2617 - "TT x y" : Create segment by point at X & Y
2618 - "T dx dy" : Create segment by point with DX & DY
2619 - "L length" : Create segment by direction & Length
2620 - "IX x" : Create segment by direction & Intersect. X
2621 - "IY y" : Create segment by direction & Intersect. Y
2623 - "C radius length" : Create arc by direction, radius and length(in degree)
2624 - "AA x y": Create arc by point at X & Y
2625 - "A dx dy" : Create arc by point with DX & DY
2626 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2627 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2628 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2629 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2631 - "WW" : Close Wire (to finish)
2632 - "WF" : Close Wire and build face (to finish)
2634 - Flag1 (= reverse) is 0 or 2 ...
2635 - if 0 the drawn arc is the one of lower angle (< Pi)
2636 - if 2 the drawn arc ius the one of greater angle (> Pi)
2638 - Flag2 (= control tolerance) is 0 or 1 ...
2639 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2640 - if 1 the wire is built only if the end point is on the arc
2641 with a tolerance of 10^-7 on the distance else the creation fails
2644 theCommand String, defining the sketcher in local
2645 coordinates of the working plane.
2646 theWorkingPlane Nine double values, defining origin,
2647 OZ and OX directions of the working plane.
2648 theName Object name; when specified, this parameter is used
2649 for result publication in the study. Otherwise, if automatic
2650 publication is switched on, default value is used for result name.
2653 New GEOM.GEOM_Object, containing the created wire.
2655 # Example: see GEOM_TestAll.py
2656 theCommand,Parameters = ParseSketcherCommand(theCommand)
2657 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2658 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2659 anObj.SetParameters(Parameters)
2660 self._autoPublish(anObj, theName, "wire")
2663 ## Create a sketcher (wire or face), following the textual description,
2664 # passed through <VAR>theCommand</VAR> argument. \n
2665 # For format of the description string see MakeSketcher() method.\n
2666 # @param theCommand String, defining the sketcher in local
2667 # coordinates of the working plane.
2668 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2669 # @param theName Object name; when specified, this parameter is used
2670 # for result publication in the study. Otherwise, if automatic
2671 # publication is switched on, default value is used for result name.
2673 # @return New GEOM.GEOM_Object, containing the created wire.
2675 # @ref tui_sketcher_page "Example"
2676 @ManageTransactions("CurvesOp")
2677 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2679 Create a sketcher (wire or face), following the textual description,
2680 passed through theCommand argument.
2681 For format of the description string see geompy.MakeSketcher() method.
2684 theCommand String, defining the sketcher in local
2685 coordinates of the working plane.
2686 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2687 theName Object name; when specified, this parameter is used
2688 for result publication in the study. Otherwise, if automatic
2689 publication is switched on, default value is used for result name.
2692 New GEOM.GEOM_Object, containing the created wire.
2694 theCommand,Parameters = ParseSketcherCommand(theCommand)
2695 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2696 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2697 anObj.SetParameters(Parameters)
2698 self._autoPublish(anObj, theName, "wire")
2701 ## Obtain a 2D sketcher interface
2702 # @return An instance of @ref gsketcher.Sketcher2D "Sketcher2D" interface
2703 def Sketcher2D (self):
2705 Obtain a 2D sketcher interface.
2708 sk = geompy.Sketcher2D()
2710 sk.addSegmentRelative(15, 70)
2711 sk.addSegmentPerpY(50)
2712 sk.addArcRadiusRelative(25, 15, 14.5, 0)
2713 sk.addArcCenterAbsolute(1, 1, 50, 50, 0, 0)
2714 sk.addArcDirectionRadiusLength(20, 20, 101, 162.13)
2716 Sketch_1 = sk.wire(geomObj_1)
2718 sk = Sketcher2D (self)
2721 ## Create a sketcher wire, following the numerical description,
2722 # passed through <VAR>theCoordinates</VAR> argument. \n
2723 # @param theCoordinates double values, defining points to create a wire,
2725 # @param theName Object name; when specified, this parameter is used
2726 # for result publication in the study. Otherwise, if automatic
2727 # publication is switched on, default value is used for result name.
2729 # @return New GEOM.GEOM_Object, containing the created wire.
2731 # @ref tui_3dsketcher_page "Example"
2732 @ManageTransactions("CurvesOp")
2733 def Make3DSketcher(self, theCoordinates, theName=None):
2735 Create a sketcher wire, following the numerical description,
2736 passed through theCoordinates argument.
2739 theCoordinates double values, defining points to create a wire,
2741 theName Object name; when specified, this parameter is used
2742 for result publication in the study. Otherwise, if automatic
2743 publication is switched on, default value is used for result name.
2746 New GEOM_Object, containing the created wire.
2748 theCoordinates,Parameters = ParseParameters(theCoordinates)
2749 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2750 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2751 anObj.SetParameters(Parameters)
2752 self._autoPublish(anObj, theName, "wire")
2755 ## Obtain a 3D sketcher interface
2756 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2758 # @ref tui_3dsketcher_page "Example"
2759 def Sketcher3D (self):
2761 Obtain a 3D sketcher interface.
2764 sk = geompy.Sketcher3D()
2765 sk.addPointsAbsolute(0,0,0, 70,0,0)
2766 sk.addPointsRelative(0, 0, 130)
2767 sk.addPointAnglesLength("OXY", 50, 0, 100)
2768 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2770 a3D_Sketcher_1 = sk.wire()
2772 sk = Sketcher3D (self)
2775 ## Obtain a 2D polyline creation interface
2776 # @return An instance of @ref gsketcher.Polyline2D "Polyline2D" interface
2778 # @ref tui_3dsketcher_page "Example"
2779 def Polyline2D (self):
2781 Obtain a 2D polyline creation interface.
2784 pl = geompy.Polyline2D()
2785 pl.addSection("section 1", GEOM.Polyline, True)
2786 pl.addPoints(0, 0, 10, 0, 10, 10)
2787 pl.addSection("section 2", GEOM.Interpolation, False)
2788 pl.addPoints(20, 0, 30, 0, 30, 10)
2789 resultObj = pl.result(WorkingPlane)
2791 pl = Polyline2D (self)
2794 # end of l3_sketcher
2797 ## @addtogroup l3_3d_primitives
2800 ## Create a box by coordinates of two opposite vertices.
2802 # @param x1,y1,z1 double values, defining first point it.
2803 # @param x2,y2,z2 double values, defining first point it.
2804 # @param theName Object name; when specified, this parameter is used
2805 # for result publication in the study. Otherwise, if automatic
2806 # publication is switched on, default value is used for result name.
2808 # @return New GEOM.GEOM_Object, containing the created box.
2810 # @ref tui_creation_box "Example"
2811 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2813 Create a box by coordinates of two opposite vertices.
2816 x1,y1,z1 double values, defining first point.
2817 x2,y2,z2 double values, defining second point.
2818 theName Object name; when specified, this parameter is used
2819 for result publication in the study. Otherwise, if automatic
2820 publication is switched on, default value is used for result name.
2823 New GEOM.GEOM_Object, containing the created box.
2825 # Example: see GEOM_TestAll.py
2826 pnt1 = self.MakeVertex(x1,y1,z1)
2827 pnt2 = self.MakeVertex(x2,y2,z2)
2828 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2829 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2831 ## Create a box with specified dimensions along the coordinate axes
2832 # and with edges, parallel to the coordinate axes.
2833 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2834 # @param theDX Length of Box edges, parallel to OX axis.
2835 # @param theDY Length of Box edges, parallel to OY axis.
2836 # @param theDZ Length of Box edges, parallel to OZ axis.
2837 # @param theName Object name; when specified, this parameter is used
2838 # for result publication in the study. Otherwise, if automatic
2839 # publication is switched on, default value is used for result name.
2841 # @return New GEOM.GEOM_Object, containing the created box.
2843 # @ref tui_creation_box "Example"
2844 @ManageTransactions("PrimOp")
2845 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2847 Create a box with specified dimensions along the coordinate axes
2848 and with edges, parallel to the coordinate axes.
2849 Center of the box will be at point (DX/2, DY/2, DZ/2).
2852 theDX Length of Box edges, parallel to OX axis.
2853 theDY Length of Box edges, parallel to OY axis.
2854 theDZ Length of Box edges, parallel to OZ axis.
2855 theName Object name; when specified, this parameter is used
2856 for result publication in the study. Otherwise, if automatic
2857 publication is switched on, default value is used for result name.
2860 New GEOM.GEOM_Object, containing the created box.
2862 # Example: see GEOM_TestAll.py
2863 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2864 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2865 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2866 anObj.SetParameters(Parameters)
2867 self._autoPublish(anObj, theName, "box")
2870 ## Create a box with two specified opposite vertices,
2871 # and with edges, parallel to the coordinate axes
2872 # @param thePnt1 First of two opposite vertices.
2873 # @param thePnt2 Second of two opposite vertices.
2874 # @param theName Object name; when specified, this parameter is used
2875 # for result publication in the study. Otherwise, if automatic
2876 # publication is switched on, default value is used for result name.
2878 # @return New GEOM.GEOM_Object, containing the created box.
2880 # @ref tui_creation_box "Example"
2881 @ManageTransactions("PrimOp")
2882 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2884 Create a box with two specified opposite vertices,
2885 and with edges, parallel to the coordinate axes
2888 thePnt1 First of two opposite vertices.
2889 thePnt2 Second of two opposite vertices.
2890 theName Object name; when specified, this parameter is used
2891 for result publication in the study. Otherwise, if automatic
2892 publication is switched on, default value is used for result name.
2895 New GEOM.GEOM_Object, containing the created box.
2897 # Example: see GEOM_TestAll.py
2898 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2899 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2900 self._autoPublish(anObj, theName, "box")
2903 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2904 # @param theH height of Face.
2905 # @param theW width of Face.
2906 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2907 # @param theName Object name; when specified, this parameter is used
2908 # for result publication in the study. Otherwise, if automatic
2909 # publication is switched on, default value is used for result name.
2911 # @return New GEOM.GEOM_Object, containing the created face.
2913 # @ref tui_creation_face "Example"
2914 @ManageTransactions("PrimOp")
2915 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2917 Create a face with specified dimensions with edges parallel to coordinate axes.
2920 theH height of Face.
2922 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2923 theName Object name; when specified, this parameter is used
2924 for result publication in the study. Otherwise, if automatic
2925 publication is switched on, default value is used for result name.
2928 New GEOM.GEOM_Object, containing the created face.
2930 # Example: see GEOM_TestAll.py
2931 theH,theW,Parameters = ParseParameters(theH, theW)
2932 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2933 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2934 anObj.SetParameters(Parameters)
2935 self._autoPublish(anObj, theName, "rectangle")
2938 ## Create a face from another plane and two sizes,
2939 # vertical size and horisontal size.
2940 # @param theObj Normale vector to the creating face or
2942 # @param theH Height (vertical size).
2943 # @param theW Width (horisontal size).
2944 # @param theName Object name; when specified, this parameter is used
2945 # for result publication in the study. Otherwise, if automatic
2946 # publication is switched on, default value is used for result name.
2948 # @return New GEOM.GEOM_Object, containing the created face.
2950 # @ref tui_creation_face "Example"
2951 @ManageTransactions("PrimOp")
2952 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2954 Create a face from another plane and two sizes,
2955 vertical size and horisontal size.
2958 theObj Normale vector to the creating face or
2960 theH Height (vertical size).
2961 theW Width (horisontal size).
2962 theName Object name; when specified, this parameter is used
2963 for result publication in the study. Otherwise, if automatic
2964 publication is switched on, default value is used for result name.
2967 New GEOM_Object, containing the created face.
2969 # Example: see GEOM_TestAll.py
2970 theH,theW,Parameters = ParseParameters(theH, theW)
2971 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2972 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2973 anObj.SetParameters(Parameters)
2974 self._autoPublish(anObj, theName, "rectangle")
2977 ## Create a disk with given center, normal vector and radius.
2978 # @param thePnt Disk center.
2979 # @param theVec Vector, normal to the plane of the disk.
2980 # @param theR Disk radius.
2981 # @param theName Object name; when specified, this parameter is used
2982 # for result publication in the study. Otherwise, if automatic
2983 # publication is switched on, default value is used for result name.
2985 # @return New GEOM.GEOM_Object, containing the created disk.
2987 # @ref tui_creation_disk "Example"
2988 @ManageTransactions("PrimOp")
2989 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2991 Create a disk with given center, normal vector and radius.
2995 theVec Vector, normal to the plane of the disk.
2997 theName Object name; when specified, this parameter is used
2998 for result publication in the study. Otherwise, if automatic
2999 publication is switched on, default value is used for result name.
3002 New GEOM.GEOM_Object, containing the created disk.
3004 # Example: see GEOM_TestAll.py
3005 theR,Parameters = ParseParameters(theR)
3006 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
3007 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
3008 anObj.SetParameters(Parameters)
3009 self._autoPublish(anObj, theName, "disk")
3012 ## Create a disk, passing through three given points
3013 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
3014 # @param theName Object name; when specified, this parameter is used
3015 # for result publication in the study. Otherwise, if automatic
3016 # publication is switched on, default value is used for result name.
3018 # @return New GEOM.GEOM_Object, containing the created disk.
3020 # @ref tui_creation_disk "Example"
3021 @ManageTransactions("PrimOp")
3022 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
3024 Create a disk, passing through three given points
3027 thePnt1,thePnt2,thePnt3 Points, defining the disk.
3028 theName Object name; when specified, this parameter is used
3029 for result publication in the study. Otherwise, if automatic
3030 publication is switched on, default value is used for result name.
3033 New GEOM.GEOM_Object, containing the created disk.
3035 # Example: see GEOM_TestAll.py
3036 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
3037 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
3038 self._autoPublish(anObj, theName, "disk")
3041 ## Create a disk with specified dimensions along OX-OY coordinate axes.
3042 # @param theR Radius of Face.
3043 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
3044 # @param theName Object name; when specified, this parameter is used
3045 # for result publication in the study. Otherwise, if automatic
3046 # publication is switched on, default value is used for result name.
3048 # @return New GEOM.GEOM_Object, containing the created disk.
3050 # @ref tui_creation_face "Example"
3051 @ManageTransactions("PrimOp")
3052 def MakeDiskR(self, theR, theOrientation, theName=None):
3054 Create a disk with specified dimensions along OX-OY coordinate axes.
3057 theR Radius of Face.
3058 theOrientation set the orientation belong axis OXY or OYZ or OZX
3059 theName Object name; when specified, this parameter is used
3060 for result publication in the study. Otherwise, if automatic
3061 publication is switched on, default value is used for result name.
3064 New GEOM.GEOM_Object, containing the created disk.
3067 Disk3 = geompy.MakeDiskR(100., 1)
3069 # Example: see GEOM_TestAll.py
3070 theR,Parameters = ParseParameters(theR)
3071 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
3072 RaiseIfFailed("MakeDiskR", self.PrimOp)
3073 anObj.SetParameters(Parameters)
3074 self._autoPublish(anObj, theName, "disk")
3077 ## Create a cylinder with given base point, axis, radius and height.
3078 # @param thePnt Central point of cylinder base.
3079 # @param theAxis Cylinder axis.
3080 # @param theR Cylinder radius.
3081 # @param theH Cylinder height.
3082 # @param theName Object name; when specified, this parameter is used
3083 # for result publication in the study. Otherwise, if automatic
3084 # publication is switched on, default value is used for result name.
3086 # @return New GEOM.GEOM_Object, containing the created cylinder.
3088 # @ref tui_creation_cylinder "Example"
3089 @ManageTransactions("PrimOp")
3090 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
3092 Create a cylinder with given base point, axis, radius and height.
3095 thePnt Central point of cylinder base.
3096 theAxis Cylinder axis.
3097 theR Cylinder radius.
3098 theH Cylinder height.
3099 theName Object name; when specified, this parameter is used
3100 for result publication in the study. Otherwise, if automatic
3101 publication is switched on, default value is used for result name.
3104 New GEOM.GEOM_Object, containing the created cylinder.
3106 # Example: see GEOM_TestAll.py
3107 theR,theH,Parameters = ParseParameters(theR, theH)
3108 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
3109 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
3110 anObj.SetParameters(Parameters)
3111 self._autoPublish(anObj, theName, "cylinder")
3114 ## Create a portion of cylinder with given base point, axis, radius, height and angle.
3115 # @param thePnt Central point of cylinder base.
3116 # @param theAxis Cylinder axis.
3117 # @param theR Cylinder radius.
3118 # @param theH Cylinder height.
3119 # @param theA Cylinder angle in radians.
3120 # @param theName Object name; when specified, this parameter is used
3121 # for result publication in the study. Otherwise, if automatic
3122 # publication is switched on, default value is used for result name.
3124 # @return New GEOM.GEOM_Object, containing the created cylinder.
3126 # @ref tui_creation_cylinder "Example"
3127 @ManageTransactions("PrimOp")
3128 def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
3130 Create a portion of cylinder with given base point, axis, radius, height and angle.
3133 thePnt Central point of cylinder base.
3134 theAxis Cylinder axis.
3135 theR Cylinder radius.
3136 theH Cylinder height.
3137 theA Cylinder angle in radians.
3138 theName Object name; when specified, this parameter is used
3139 for result publication in the study. Otherwise, if automatic
3140 publication is switched on, default value is used for result name.
3143 New GEOM.GEOM_Object, containing the created cylinder.
3145 # Example: see GEOM_TestAll.py
3147 if isinstance(theA,str):
3149 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3151 theA = theA*math.pi/180.
3152 if theA<=0. or theA>=2*math.pi:
3153 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3154 anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
3155 RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
3156 anObj.SetParameters(Parameters)
3157 self._autoPublish(anObj, theName, "cylinder")
3160 ## Create a cylinder with given radius and height at
3161 # the origin of coordinate system. Axis of the cylinder
3162 # will be collinear to the OZ axis of the coordinate system.
3163 # @param theR Cylinder radius.
3164 # @param theH Cylinder height.
3165 # @param theName Object name; when specified, this parameter is used
3166 # for result publication in the study. Otherwise, if automatic
3167 # publication is switched on, default value is used for result name.
3169 # @return New GEOM.GEOM_Object, containing the created cylinder.
3171 # @ref tui_creation_cylinder "Example"
3172 @ManageTransactions("PrimOp")
3173 def MakeCylinderRH(self, theR, theH, theName=None):
3175 Create a cylinder with given radius and height at
3176 the origin of coordinate system. Axis of the cylinder
3177 will be collinear to the OZ axis of the coordinate system.
3180 theR Cylinder radius.
3181 theH Cylinder height.
3182 theName Object name; when specified, this parameter is used
3183 for result publication in the study. Otherwise, if automatic
3184 publication is switched on, default value is used for result name.
3187 New GEOM.GEOM_Object, containing the created cylinder.
3189 # Example: see GEOM_TestAll.py
3190 theR,theH,Parameters = ParseParameters(theR, theH)
3191 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
3192 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
3193 anObj.SetParameters(Parameters)
3194 self._autoPublish(anObj, theName, "cylinder")
3197 ## Create a portion of cylinder with given radius, height and angle at
3198 # the origin of coordinate system. Axis of the cylinder
3199 # will be collinear to the OZ axis of the coordinate system.
3200 # @param theR Cylinder radius.
3201 # @param theH Cylinder height.
3202 # @param theA Cylinder angle in radians.
3203 # @param theName Object name; when specified, this parameter is used
3204 # for result publication in the study. Otherwise, if automatic
3205 # publication is switched on, default value is used for result name.
3207 # @return New GEOM.GEOM_Object, containing the created cylinder.
3209 # @ref tui_creation_cylinder "Example"
3210 @ManageTransactions("PrimOp")
3211 def MakeCylinderRHA(self, theR, theH, theA, theName=None):
3213 Create a portion of cylinder with given radius, height and angle at
3214 the origin of coordinate system. Axis of the cylinder
3215 will be collinear to the OZ axis of the coordinate system.
3218 theR Cylinder radius.
3219 theH Cylinder height.
3220 theA Cylinder angle in radians.
3221 theName Object name; when specified, this parameter is used
3222 for result publication in the study. Otherwise, if automatic
3223 publication is switched on, default value is used for result name.
3226 New GEOM.GEOM_Object, containing the created cylinder.
3228 # Example: see GEOM_TestAll.py
3230 if isinstance(theA,str):
3232 theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
3234 theA = theA*math.pi/180.
3235 if theA<=0. or theA>=2*math.pi:
3236 raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
3237 anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
3238 RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
3239 anObj.SetParameters(Parameters)
3240 self._autoPublish(anObj, theName, "cylinder")
3243 ## Create a sphere with given center and radius.
3244 # @param thePnt Sphere center.
3245 # @param theR Sphere radius.
3246 # @param theName Object name; when specified, this parameter is used
3247 # for result publication in the study. Otherwise, if automatic
3248 # publication is switched on, default value is used for result name.
3250 # @return New GEOM.GEOM_Object, containing the created sphere.
3252 # @ref tui_creation_sphere "Example"
3253 @ManageTransactions("PrimOp")
3254 def MakeSpherePntR(self, thePnt, theR, theName=None):
3256 Create a sphere with given center and radius.
3259 thePnt Sphere center.
3261 theName Object name; when specified, this parameter is used
3262 for result publication in the study. Otherwise, if automatic
3263 publication is switched on, default value is used for result name.
3266 New GEOM.GEOM_Object, containing the created sphere.
3268 # Example: see GEOM_TestAll.py
3269 theR,Parameters = ParseParameters(theR)
3270 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
3271 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
3272 anObj.SetParameters(Parameters)
3273 self._autoPublish(anObj, theName, "sphere")
3276 ## Create a sphere with given center and radius.
3277 # @param x,y,z Coordinates of sphere center.
3278 # @param theR Sphere radius.
3279 # @param theName Object name; when specified, this parameter is used
3280 # for result publication in the study. Otherwise, if automatic
3281 # publication is switched on, default value is used for result name.
3283 # @return New GEOM.GEOM_Object, containing the created sphere.
3285 # @ref tui_creation_sphere "Example"
3286 def MakeSphere(self, x, y, z, theR, theName=None):
3288 Create a sphere with given center and radius.
3291 x,y,z Coordinates of sphere center.
3293 theName Object name; when specified, this parameter is used
3294 for result publication in the study. Otherwise, if automatic
3295 publication is switched on, default value is used for result name.
3298 New GEOM.GEOM_Object, containing the created sphere.
3300 # Example: see GEOM_TestAll.py
3301 point = self.MakeVertex(x, y, z)
3302 # note: auto-publishing is done in self.MakeSpherePntR()
3303 anObj = self.MakeSpherePntR(point, theR, theName)
3306 ## Create a sphere with given radius at the origin of coordinate system.
3307 # @param theR Sphere radius.
3308 # @param theName Object name; when specified, this parameter is used
3309 # for result publication in the study. Otherwise, if automatic
3310 # publication is switched on, default value is used for result name.
3312 # @return New GEOM.GEOM_Object, containing the created sphere.
3314 # @ref tui_creation_sphere "Example"
3315 @ManageTransactions("PrimOp")
3316 def MakeSphereR(self, theR, theName=None):
3318 Create a sphere with given radius at the origin of coordinate system.
3322 theName Object name; when specified, this parameter is used
3323 for result publication in the study. Otherwise, if automatic
3324 publication is switched on, default value is used for result name.
3327 New GEOM.GEOM_Object, containing the created sphere.
3329 # Example: see GEOM_TestAll.py
3330 theR,Parameters = ParseParameters(theR)
3331 anObj = self.PrimOp.MakeSphereR(theR)
3332 RaiseIfFailed("MakeSphereR", self.PrimOp)
3333 anObj.SetParameters(Parameters)
3334 self._autoPublish(anObj, theName, "sphere")
3337 ## Create a cone with given base point, axis, height and radiuses.
3338 # @param thePnt Central point of the first cone base.
3339 # @param theAxis Cone axis.
3340 # @param theR1 Radius of the first cone base.
3341 # @param theR2 Radius of the second cone base.
3342 # \note If both radiuses are non-zero, the cone will be truncated.
3343 # \note If the radiuses are equal, a cylinder will be created instead.
3344 # @param theH Cone height.
3345 # @param theName Object name; when specified, this parameter is used
3346 # for result publication in the study. Otherwise, if automatic
3347 # publication is switched on, default value is used for result name.
3349 # @return New GEOM.GEOM_Object, containing the created cone.
3351 # @ref tui_creation_cone "Example"
3352 @ManageTransactions("PrimOp")
3353 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
3355 Create a cone with given base point, axis, height and radiuses.
3358 thePnt Central point of the first cone base.
3360 theR1 Radius of the first cone base.
3361 theR2 Radius of the second cone base.
3363 theName Object name; when specified, this parameter is used
3364 for result publication in the study. Otherwise, if automatic
3365 publication is switched on, default value is used for result name.
3368 If both radiuses are non-zero, the cone will be truncated.
3369 If the radiuses are equal, a cylinder will be created instead.
3372 New GEOM.GEOM_Object, containing the created cone.
3374 # Example: see GEOM_TestAll.py
3375 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3376 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
3377 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
3378 anObj.SetParameters(Parameters)
3379 self._autoPublish(anObj, theName, "cone")
3382 ## Create a cone with given height and radiuses at
3383 # the origin of coordinate system. Axis of the cone will
3384 # be collinear to the OZ axis of the coordinate system.
3385 # @param theR1 Radius of the first cone base.
3386 # @param theR2 Radius of the second cone base.
3387 # \note If both radiuses are non-zero, the cone will be truncated.
3388 # \note If the radiuses are equal, a cylinder will be created instead.
3389 # @param theH Cone height.
3390 # @param theName Object name; when specified, this parameter is used
3391 # for result publication in the study. Otherwise, if automatic
3392 # publication is switched on, default value is used for result name.
3394 # @return New GEOM.GEOM_Object, containing the created cone.
3396 # @ref tui_creation_cone "Example"
3397 @ManageTransactions("PrimOp")
3398 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
3400 Create a cone with given height and radiuses at
3401 the origin of coordinate system. Axis of the cone will
3402 be collinear to the OZ axis of the coordinate system.
3405 theR1 Radius of the first cone base.
3406 theR2 Radius of the second cone base.
3408 theName Object name; when specified, this parameter is used
3409 for result publication in the study. Otherwise, if automatic
3410 publication is switched on, default value is used for result name.
3413 If both radiuses are non-zero, the cone will be truncated.
3414 If the radiuses are equal, a cylinder will be created instead.
3417 New GEOM.GEOM_Object, containing the created cone.
3419 # Example: see GEOM_TestAll.py
3420 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
3421 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
3422 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
3423 anObj.SetParameters(Parameters)
3424 self._autoPublish(anObj, theName, "cone")
3427 ## Create a torus with given center, normal vector and radiuses.
3428 # @param thePnt Torus central point.
3429 # @param theVec Torus axis of symmetry.
3430 # @param theRMajor Torus major radius.
3431 # @param theRMinor Torus minor radius.
3432 # @param theName Object name; when specified, this parameter is used
3433 # for result publication in the study. Otherwise, if automatic
3434 # publication is switched on, default value is used for result name.
3436 # @return New GEOM.GEOM_Object, containing the created torus.
3438 # @ref tui_creation_torus "Example"
3439 @ManageTransactions("PrimOp")
3440 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
3442 Create a torus with given center, normal vector and radiuses.
3445 thePnt Torus central point.
3446 theVec Torus axis of symmetry.
3447 theRMajor Torus major radius.
3448 theRMinor Torus minor radius.
3449 theName Object name; when specified, this parameter is used
3450 for result publication in the study. Otherwise, if automatic
3451 publication is switched on, default value is used for result name.
3454 New GEOM.GEOM_Object, containing the created torus.
3456 # Example: see GEOM_TestAll.py
3457 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3458 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3459 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3460 anObj.SetParameters(Parameters)
3461 self._autoPublish(anObj, theName, "torus")
3464 ## Create a torus with given radiuses at the origin of coordinate system.
3465 # @param theRMajor Torus major radius.
3466 # @param theRMinor Torus minor radius.
3467 # @param theName Object name; when specified, this parameter is used
3468 # for result publication in the study. Otherwise, if automatic
3469 # publication is switched on, default value is used for result name.
3471 # @return New GEOM.GEOM_Object, containing the created torus.
3473 # @ref tui_creation_torus "Example"
3474 @ManageTransactions("PrimOp")
3475 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3477 Create a torus with given radiuses at the origin of coordinate system.
3480 theRMajor Torus major radius.
3481 theRMinor Torus minor radius.
3482 theName Object name; when specified, this parameter is used
3483 for result publication in the study. Otherwise, if automatic
3484 publication is switched on, default value is used for result name.
3487 New GEOM.GEOM_Object, containing the created torus.
3489 # Example: see GEOM_TestAll.py
3490 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3491 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3492 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3493 anObj.SetParameters(Parameters)
3494 self._autoPublish(anObj, theName, "torus")
3497 # end of l3_3d_primitives
3500 ## @addtogroup l3_complex
3503 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3504 # @param theBase Base shape to be extruded.
3505 # @param thePoint1 First end of extrusion vector.
3506 # @param thePoint2 Second end of extrusion vector.
3507 # @param theScaleFactor Use it to make prism with scaled second base.
3508 # Nagative value means not scaled second base.
3509 # @param theName Object name; when specified, this parameter is used
3510 # for result publication in the study. Otherwise, if automatic
3511 # publication is switched on, default value is used for result name.
3513 # @return New GEOM.GEOM_Object, containing the created prism.
3515 # @ref tui_creation_prism "Example"
3516 @ManageTransactions("PrimOp")
3517 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3519 Create a shape by extrusion of the base shape along a vector, defined by two points.
3522 theBase Base shape to be extruded.
3523 thePoint1 First end of extrusion vector.
3524 thePoint2 Second end of extrusion vector.
3525 theScaleFactor Use it to make prism with scaled second base.
3526 Nagative value means not scaled second base.
3527 theName Object name; when specified, this parameter is used
3528 for result publication in the study. Otherwise, if automatic
3529 publication is switched on, default value is used for result name.
3532 New GEOM.GEOM_Object, containing the created prism.
3534 # Example: see GEOM_TestAll.py
3537 if theScaleFactor > 0:
3538 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3539 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3541 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3542 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3543 anObj.SetParameters(Parameters)
3544 self._autoPublish(anObj, theName, "prism")
3547 ## Create a shape by extrusion of the base shape along a
3548 # vector, defined by two points, in 2 Ways (forward/backward).
3549 # @param theBase Base shape to be extruded.
3550 # @param thePoint1 First end of extrusion vector.
3551 # @param thePoint2 Second end of extrusion vector.
3552 # @param theName Object name; when specified, this parameter is used
3553 # for result publication in the study. Otherwise, if automatic
3554 # publication is switched on, default value is used for result name.
3556 # @return New GEOM.GEOM_Object, containing the created prism.
3558 # @ref tui_creation_prism "Example"
3559 @ManageTransactions("PrimOp")
3560 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3562 Create a shape by extrusion of the base shape along a
3563 vector, defined by two points, in 2 Ways (forward/backward).
3566 theBase Base shape to be extruded.
3567 thePoint1 First end of extrusion vector.
3568 thePoint2 Second end of extrusion vector.
3569 theName Object name; when specified, this parameter is used
3570 for result publication in the study. Otherwise, if automatic
3571 publication is switched on, default value is used for result name.
3574 New GEOM.GEOM_Object, containing the created prism.
3576 # Example: see GEOM_TestAll.py
3577 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3578 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3579 self._autoPublish(anObj, theName, "prism")
3582 ## Create a shape by extrusion of the base shape along the vector,
3583 # i.e. all the space, transfixed by the base shape during its translation
3584 # along the vector on the given distance.
3585 # @param theBase Base shape to be extruded.
3586 # @param theVec Direction of extrusion.
3587 # @param theH Prism dimension along theVec.
3588 # @param theScaleFactor Use it to make prism with scaled second base.
3589 # Negative value means not scaled second base.
3590 # @param theName Object name; when specified, this parameter is used
3591 # for result publication in the study. Otherwise, if automatic
3592 # publication is switched on, default value is used for result name.
3594 # @return New GEOM.GEOM_Object, containing the created prism.
3596 # @ref tui_creation_prism "Example"
3597 @ManageTransactions("PrimOp")
3598 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3600 Create a shape by extrusion of the base shape along the vector,
3601 i.e. all the space, transfixed by the base shape during its translation
3602 along the vector on the given distance.
3605 theBase Base shape to be extruded.
3606 theVec Direction of extrusion.
3607 theH Prism dimension along theVec.
3608 theScaleFactor Use it to make prism with scaled second base.
3609 Negative value means not scaled second base.
3610 theName Object name; when specified, this parameter is used
3611 for result publication in the study. Otherwise, if automatic
3612 publication is switched on, default value is used for result name.
3615 New GEOM.GEOM_Object, containing the created prism.
3617 # Example: see GEOM_TestAll.py
3620 if theScaleFactor > 0:
3621 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3622 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3624 theH,Parameters = ParseParameters(theH)
3625 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3626 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3627 anObj.SetParameters(Parameters)
3628 self._autoPublish(anObj, theName, "prism")
3631 ## Create a shape by extrusion of the base shape along the vector,
3632 # i.e. all the space, transfixed by the base shape during its translation
3633 # along the vector on the given distance in 2 Ways (forward/backward).
3634 # @param theBase Base shape to be extruded.
3635 # @param theVec Direction of extrusion.
3636 # @param theH Prism dimension along theVec in forward direction.
3637 # @param theName Object name; when specified, this parameter is used
3638 # for result publication in the study. Otherwise, if automatic
3639 # publication is switched on, default value is used for result name.
3641 # @return New GEOM.GEOM_Object, containing the created prism.
3643 # @ref tui_creation_prism "Example"
3644 @ManageTransactions("PrimOp")
3645 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3647 Create a shape by extrusion of the base shape along the vector,
3648 i.e. all the space, transfixed by the base shape during its translation
3649 along the vector on the given distance in 2 Ways (forward/backward).
3652 theBase Base shape to be extruded.
3653 theVec Direction of extrusion.
3654 theH Prism dimension along theVec in forward direction.
3655 theName Object name; when specified, this parameter is used
3656 for result publication in the study. Otherwise, if automatic
3657 publication is switched on, default value is used for result name.
3660 New GEOM.GEOM_Object, containing the created prism.
3662 # Example: see GEOM_TestAll.py
3663 theH,Parameters = ParseParameters(theH)
3664 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3665 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3666 anObj.SetParameters(Parameters)
3667 self._autoPublish(anObj, theName, "prism")
3670 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3671 # @param theBase Base shape to be extruded.
3672 # @param theDX, theDY, theDZ Directions of extrusion.
3673 # @param theScaleFactor Use it to make prism with scaled second base.
3674 # Nagative value means not scaled second base.
3675 # @param theName Object name; when specified, this parameter is used
3676 # for result publication in the study. Otherwise, if automatic
3677 # publication is switched on, default value is used for result name.
3679 # @return New GEOM.GEOM_Object, containing the created prism.
3681 # @ref tui_creation_prism "Example"
3682 @ManageTransactions("PrimOp")
3683 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3685 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3688 theBase Base shape to be extruded.
3689 theDX, theDY, theDZ Directions of extrusion.
3690 theScaleFactor Use it to make prism with scaled second base.
3691 Nagative value means not scaled second base.
3692 theName Object name; when specified, this parameter is used
3693 for result publication in the study. Otherwise, if automatic
3694 publication is switched on, default value is used for result name.
3697 New GEOM.GEOM_Object, containing the created prism.
3699 # Example: see GEOM_TestAll.py
3702 if theScaleFactor > 0:
3703 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3704 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3706 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3707 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3708 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3709 anObj.SetParameters(Parameters)
3710 self._autoPublish(anObj, theName, "prism")
3713 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3714 # i.e. all the space, transfixed by the base shape during its translation
3715 # along the vector on the given distance in 2 Ways (forward/backward).
3716 # @param theBase Base shape to be extruded.
3717 # @param theDX, theDY, theDZ Directions of extrusion.
3718 # @param theName Object name; when specified, this parameter is used
3719 # for result publication in the study. Otherwise, if automatic
3720 # publication is switched on, default value is used for result name.
3722 # @return New GEOM.GEOM_Object, containing the created prism.
3724 # @ref tui_creation_prism "Example"
3725 @ManageTransactions("PrimOp")
3726 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3728 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3729 i.e. all the space, transfixed by the base shape during its translation
3730 along the vector on the given distance in 2 Ways (forward/backward).
3733 theBase Base shape to be extruded.
3734 theDX, theDY, theDZ Directions of extrusion.
3735 theName Object name; when specified, this parameter is used
3736 for result publication in the study. Otherwise, if automatic
3737 publication is switched on, default value is used for result name.
3740 New GEOM.GEOM_Object, containing the created prism.
3742 # Example: see GEOM_TestAll.py
3743 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3744 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3745 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3746 anObj.SetParameters(Parameters)
3747 self._autoPublish(anObj, theName, "prism")
3750 ## Create a shape by revolution of the base shape around the axis
3751 # on the given angle, i.e. all the space, transfixed by the base
3752 # shape during its rotation around the axis on the given angle.
3753 # @param theBase Base shape to be rotated.
3754 # @param theAxis Rotation axis.
3755 # @param theAngle Rotation angle in radians.
3756 # @param theName Object name; when specified, this parameter is used
3757 # for result publication in the study. Otherwise, if automatic
3758 # publication is switched on, default value is used for result name.
3760 # @return New GEOM.GEOM_Object, containing the created revolution.
3762 # @ref tui_creation_revolution "Example"
3763 @ManageTransactions("PrimOp")
3764 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3766 Create a shape by revolution of the base shape around the axis
3767 on the given angle, i.e. all the space, transfixed by the base
3768 shape during its rotation around the axis on the given angle.
3771 theBase Base shape to be rotated.
3772 theAxis Rotation axis.
3773 theAngle Rotation angle in radians.
3774 theName Object name; when specified, this parameter is used
3775 for result publication in the study. Otherwise, if automatic
3776 publication is switched on, default value is used for result name.
3779 New GEOM.GEOM_Object, containing the created revolution.
3781 # Example: see GEOM_TestAll.py
3782 theAngle,Parameters = ParseParameters(theAngle)
3783 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3784 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3785 anObj.SetParameters(Parameters)
3786 self._autoPublish(anObj, theName, "revolution")
3789 ## Create a shape by revolution of the base shape around the axis
3790 # on the given angle, i.e. all the space, transfixed by the base
3791 # shape during its rotation around the axis on the given angle in
3792 # both directions (forward/backward)
3793 # @param theBase Base shape to be rotated.
3794 # @param theAxis Rotation axis.
3795 # @param theAngle Rotation angle in radians.
3796 # @param theName Object name; when specified, this parameter is used
3797 # for result publication in the study. Otherwise, if automatic
3798 # publication is switched on, default value is used for result name.
3800 # @return New GEOM.GEOM_Object, containing the created revolution.
3802 # @ref tui_creation_revolution "Example"
3803 @ManageTransactions("PrimOp")
3804 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3806 Create a shape by revolution of the base shape around the axis
3807 on the given angle, i.e. all the space, transfixed by the base
3808 shape during its rotation around the axis on the given angle in
3809 both directions (forward/backward).
3812 theBase Base shape to be rotated.
3813 theAxis Rotation axis.
3814 theAngle Rotation angle in radians.
3815 theName Object name; when specified, this parameter is used
3816 for result publication in the study. Otherwise, if automatic
3817 publication is switched on, default value is used for result name.
3820 New GEOM.GEOM_Object, containing the created revolution.
3822 theAngle,Parameters = ParseParameters(theAngle)
3823 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3824 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3825 anObj.SetParameters(Parameters)
3826 self._autoPublish(anObj, theName, "revolution")
3829 ## Create a face from a given set of contours.
3830 # @param theContours either a list or a compound of edges/wires.
3831 # @param theMinDeg a minimal degree of BSpline surface to create.
3832 # @param theMaxDeg a maximal degree of BSpline surface to create.
3833 # @param theTol2D a 2d tolerance to be reached.
3834 # @param theTol3D a 3d tolerance to be reached.
3835 # @param theNbIter a number of iteration of approximation algorithm.
3836 # @param theMethod Kind of method to perform filling operation
3837 # (see GEOM.filling_oper_method enum).
3838 # @param isApprox if True, BSpline curves are generated in the process
3839 # of surface construction. By default it is False, that means
3840 # the surface is created using given curves. The usage of
3841 # Approximation makes the algorithm work slower, but allows
3842 # building the surface for rather complex cases.
3843 # @param theName Object name; when specified, this parameter is used
3844 # for result publication in the study. Otherwise, if automatic
3845 # publication is switched on, default value is used for result name.
3847 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3849 # @ref tui_creation_filling "Example"
3850 @ManageTransactions("PrimOp")
3851 def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3852 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3854 Create a face from a given set of contours.
3857 theContours either a list or a compound of edges/wires.
3858 theMinDeg a minimal degree of BSpline surface to create.
3859 theMaxDeg a maximal degree of BSpline surface to create.
3860 theTol2D a 2d tolerance to be reached.
3861 theTol3D a 3d tolerance to be reached.
3862 theNbIter a number of iteration of approximation algorithm.
3863 theMethod Kind of method to perform filling operation
3864 (see GEOM.filling_oper_method enum).
3865 isApprox if True, BSpline curves are generated in the process
3866 of surface construction. By default it is False, that means
3867 the surface is created using given curves. The usage of
3868 Approximation makes the algorithm work slower, but allows
3869 building the surface for rather complex cases.
3870 theName Object name; when specified, this parameter is used
3871 for result publication in the study. Otherwise, if automatic
3872 publication is switched on, default value is used for result name.
3875 New GEOM.GEOM_Object (face), containing the created filling surface.
3878 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3880 # Example: see GEOM_TestAll.py
3881 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3882 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3883 theTol2D, theTol3D, theNbIter,
3884 theMethod, isApprox)
3885 RaiseIfFailed("MakeFilling", self.PrimOp)
3886 anObj.SetParameters(Parameters)
3887 self._autoPublish(anObj, theName, "filling")
3891 ## Create a face from a given set of contours.
3892 # This method corresponds to MakeFilling() with isApprox=True.
3893 # @param theContours either a list or a compound of edges/wires.
3894 # @param theMinDeg a minimal degree of BSpline surface to create.
3895 # @param theMaxDeg a maximal degree of BSpline surface to create.
3896 # @param theTol3D a 3d tolerance to be reached.
3897 # @param theName Object name; when specified, this parameter is used
3898 # for result publication in the study. Otherwise, if automatic
3899 # publication is switched on, default value is used for result name.
3901 # @return New GEOM.GEOM_Object (face), containing the created filling surface.
3903 # @ref tui_creation_filling "Example"
3904 @ManageTransactions("PrimOp")
3905 def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3907 Create a filling from the given compound of contours.
3908 This method corresponds to MakeFilling() with isApprox=True.
3911 theContours either a list or a compound of edges/wires.
3912 theMinDeg a minimal degree of BSpline surface to create.
3913 theMaxDeg a maximal degree of BSpline surface to create.
3914 theTol3D a 3d tolerance to be reached.
3915 theName Object name; when specified, this parameter is used
3916 for result publication in the study. Otherwise, if automatic
3917 publication is switched on, default value is used for result name.
3920 New GEOM.GEOM_Object (face), containing the created filling surface.
3923 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3925 # Example: see GEOM_TestAll.py
3926 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3927 anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
3928 0, theTol3D, 0, GEOM.FOM_Default, True)
3929 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3930 anObj.SetParameters(Parameters)
3931 self._autoPublish(anObj, theName, "filling")
3934 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3935 # @param theSeqSections - set of specified sections.
3936 # @param theModeSolid - mode defining building solid or shell
3937 # @param thePreci - precision 3D used for smoothing
3938 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3939 # @param theName Object name; when specified, this parameter is used
3940 # for result publication in the study. Otherwise, if automatic
3941 # publication is switched on, default value is used for result name.
3943 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3945 # @ref swig_todo "Example"
3946 @ManageTransactions("PrimOp")
3947 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3949 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3952 theSeqSections - set of specified sections.
3953 theModeSolid - mode defining building solid or shell
3954 thePreci - precision 3D used for smoothing
3955 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3956 theName Object name; when specified, this parameter is used
3957 for result publication in the study. Otherwise, if automatic
3958 publication is switched on, default value is used for result name.
3961 New GEOM.GEOM_Object, containing the created shell or solid.
3963 # Example: see GEOM_TestAll.py
3964 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3965 RaiseIfFailed("MakeThruSections", self.PrimOp)
3966 self._autoPublish(anObj, theName, "filling")
3969 ## Create a shape by extrusion of the base shape along
3970 # the path shape. The path shape can be a wire or an edge. It is
3971 # possible to generate groups along with the result by means of
3972 # setting the flag \a IsGenerateGroups.<BR>
3973 # If \a thePath is a closed edge or wire and \a IsGenerateGroups is
3974 # set, an error is occurred. If \a thePath is not closed edge/wire,
3975 # the following groups are returned:
3976 # - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
3978 # - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
3981 # "Down" and "Up" groups contain:
3982 # - Edges if \a theBase is edge or wire;
3983 # - Faces if \a theBase is face or shell.<BR>
3985 # "Side1" and "Side2" groups contain edges generated from the first
3986 # and last vertices of \a theBase. The first and last vertices are
3987 # determined taking into account edge/wire orientation.<BR>
3988 # "Other" group represents faces generated from the bounding edges of
3991 # @param theBase Base shape to be extruded.
3992 # @param thePath Path shape to extrude the base shape along it.
3993 # @param IsGenerateGroups flag that tells if it is necessary to
3994 # create groups. It is equal to False by default.
3995 # @param theName Object name; when specified, this parameter is used
3996 # for result publication in the study. Otherwise, if automatic
3997 # publication is switched on, default value is used for result name.
3999 # @return New GEOM.GEOM_Object, containing the created pipe if
4000 # \a IsGenerateGroups is not set. Otherwise it returns a
4001 # list of GEOM.GEOM_Object. Its first element is the created pipe, the
4002 # remaining ones are created groups.
4004 # @ref tui_creation_pipe "Example"
4005 @ManageTransactions("PrimOp")
4006 def MakePipe(self, theBase, thePath,
4007 IsGenerateGroups=False, theName=None):
4009 Create a shape by extrusion of the base shape along
4010 the path shape. The path shape can be a wire or an edge. It is
4011 possible to generate groups along with the result by means of
4012 setting the flag IsGenerateGroups.
4013 If thePath is a closed edge or wire and IsGenerateGroups is
4014 set, an error is occurred. If thePath is not closed edge/wire,
4015 the following groups are returned:
4016 - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
4018 - If theBase is closed edge or wire, face or shell: "Down", "Up",
4020 "Down" and "Up" groups contain:
4021 - Edges if theBase is edge or wire;
4022 - Faces if theBase is face or shell.
4023 "Side1" and "Side2" groups contain edges generated from the first
4024 and last vertices of theBase. The first and last vertices are
4025 determined taking into account edge/wire orientation.
4026 "Other" group represents faces generated from the bounding edges of
4030 theBase Base shape to be extruded.
4031 thePath Path shape to extrude the base shape along it.
4032 IsGenerateGroups flag that tells if it is necessary to
4033 create groups. It is equal to False by default.
4034 theName Object name; when specified, this parameter is used
4035 for result publication in the study. Otherwise, if automatic
4036 publication is switched on, default value is used for result name.
4039 New GEOM.GEOM_Object, containing the created pipe if
4040 IsGenerateGroups is not set. Otherwise it returns a
4041 list of GEOM.GEOM_Object. Its first element is the created pipe, the
4042 remaining ones are created groups.
4044 # Example: see GEOM_TestAll.py
4045 aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
4046 RaiseIfFailed("MakePipe", self.PrimOp)
4048 if IsGenerateGroups:
4049 self._autoPublish(aList, theName, "pipe")
4052 self._autoPublish(aList[0], theName, "pipe")
4055 ## Create a shape by extrusion of the profile shape along
4056 # the path shape. The path shape can be a wire or an edge.
4057 # the several profiles can be specified in the several locations of path.
4058 # It is possible to generate groups along with the result by means of
4059 # setting the flag \a IsGenerateGroups. For detailed information on
4060 # groups that can be created please see the method MakePipe().
4061 # @param theSeqBases - list of Bases shape to be extruded.
4062 # @param theLocations - list of locations on the path corresponding
4063 # specified list of the Bases shapes. Number of locations
4064 # should be equal to number of bases or list of locations can be empty.
4065 # @param thePath - Path shape to extrude the base shape along it.
4066 # @param theWithContact - the mode defining that the section is translated to be in
4067 # contact with the spine.
4068 # @param theWithCorrection - defining that the section is rotated to be
4069 # orthogonal to the spine tangent in the correspondent point
4070 # @param IsGenerateGroups - flag that tells if it is necessary to
4071 # create groups. It is equal to False by default.
4072 # @param theName Object name; when specified, this parameter is used
4073 # for result publication in the study. Otherwise, if automatic
4074 # publication is switched on, default value is used for result name.
4076 # @return New GEOM.GEOM_Object, containing the created pipe if
4077 # \a IsGenerateGroups is not set. Otherwise it returns new
4078 # GEOM.ListOfGO. Its first element is the created pipe, the
4079 # remaining ones are created groups.
4081 # @ref tui_creation_pipe_with_diff_sec "Example"
4082 @ManageTransactions("PrimOp")
4083 def MakePipeWithDifferentSections(self, theSeqBases,
4084 theLocations, thePath,
4085 theWithContact, theWithCorrection,
4086 IsGenerateGroups=False, theName=None):
4088 Create a shape by extrusion of the profile shape along
4089 the path shape. The path shape can be a wire or an edge.
4090 the several profiles can be specified in the several locations of path.
4091 It is possible to generate groups along with the result by means of
4092 setting the flag IsGenerateGroups. For detailed information on
4093 groups that can be created please see the method geompy.MakePipe().
4096 theSeqBases - list of Bases shape to be extruded.
4097 theLocations - list of locations on the path corresponding
4098 specified list of the Bases shapes. Number of locations
4099 should be equal to number of bases or list of locations can be empty.
4100 thePath - Path shape to extrude the base shape along it.
4101 theWithContact - the mode defining that the section is translated to be in
4102 contact with the spine(0/1)
4103 theWithCorrection - defining that the section is rotated to be
4104 orthogonal to the spine tangent in the correspondent point (0/1)
4105 IsGenerateGroups - flag that tells if it is necessary to
4106 create groups. It is equal to False by default.
4107 theName Object name; when specified, this parameter is used
4108 for result publication in the study. Otherwise, if automatic
4109 publication is switched on, default value is used for result name.
4112 New GEOM.GEOM_Object, containing the created pipe if
4113 IsGenerateGroups is not set. Otherwise it returns new
4114 GEOM.ListOfGO. Its first element is the created pipe, the
4115 remaining ones are created groups.
4117 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4118 theLocations, thePath,
4119 theWithContact, theWithCorrection,
4120 False, IsGenerateGroups)
4121 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
4123 if IsGenerateGroups:
4124 self._autoPublish(aList, theName, "pipe")
4127 self._autoPublish(aList[0], theName, "pipe")
4130 ## Create a shape by extrusion of the profile shape along
4131 # the path shape. This function is a version of
4132 # MakePipeWithDifferentSections() with the same parameters, except
4133 # eliminated theWithContact and theWithCorrection. So it is
4134 # possible to find the description of all parameters is in this
4135 # method. The difference is that this method performs the operation
4136 # step by step, i.e. it creates pipes between each pair of neighbor
4137 # sections and fuses them into a single shape.
4139 # @ref tui_creation_pipe_with_diff_sec "Example"
4140 @ManageTransactions("PrimOp")
4141 def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
4142 theLocations, thePath,
4143 IsGenerateGroups=False, theName=None):
4145 Create a shape by extrusion of the profile shape along
4146 the path shape. This function is a version of
4147 MakePipeWithDifferentSections() with the same parameters, except
4148 eliminated theWithContact and theWithCorrection. So it is
4149 possible to find the description of all parameters is in this
4150 method. The difference is that this method performs the operation
4151 step by step, i.e. it creates pipes between each pair of neighbor
4152 sections and fuses them into a single shape.
4154 aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
4155 theLocations, thePath,
4157 True, IsGenerateGroups)
4158 RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
4160 if IsGenerateGroups:
4161 self._autoPublish(aList, theName, "pipe")
4164 self._autoPublish(aList[0], theName, "pipe")
4167 ## Create a shape by extrusion of the profile shape along
4168 # the path shape. The path shape can be a wire or an edge.
4169 # the several profiles can be specified in the several locations of path.
4170 # It is possible to generate groups along with the result by means of
4171 # setting the flag \a IsGenerateGroups. For detailed information on
4172 # groups that can be created please see the method MakePipe().
4173 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
4174 # shell or face. If number of faces in neighbour sections
4175 # aren't coincided result solid between such sections will
4176 # be created using external boundaries of this shells.
4177 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
4178 # This list is used for searching correspondences between
4179 # faces in the sections. Size of this list must be equal
4180 # to size of list of base shapes.
4181 # @param theLocations - list of locations on the path corresponding
4182 # specified list of the Bases shapes. Number of locations
4183 # should be equal to number of bases. First and last
4184 # locations must be coincided with first and last vertexes
4185 # of path correspondingly.
4186 # @param thePath - Path shape to extrude the base shape along it.
4187 # @param theWithContact - the mode defining that the section is translated to be in
4188 # contact with the spine.
4189 # @param theWithCorrection - defining that the section is rotated to be
4190 # orthogonal to the spine tangent in the correspondent point
4191 # @param IsGenerateGroups - flag that tells if it is necessary to
4192 # create groups. It is equal to False by default.
4193 # @param theName Object name; when specified, this parameter is used
4194 # for result publication in the study. Otherwise, if automatic
4195 # publication is switched on, default value is used for result name.
4197 # @return New GEOM.GEOM_Object, containing the created solids if
4198 # \a IsGenerateGroups is not set. Otherwise it returns new
4199 # GEOM.ListOfGO. Its first element is the created solids, the
4200 # remaining ones are created groups.
4202 # @ref tui_creation_pipe_with_shell_sec "Example"
4203 @ManageTransactions("PrimOp")
4204 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
4205 theLocations, thePath,
4206 theWithContact, theWithCorrection,
4207 IsGenerateGroups=False, theName=None):
4209 Create a shape by extrusion of the profile shape along
4210 the path shape. The path shape can be a wire or an edge.
4211 the several profiles can be specified in the several locations of path.
4212 It is possible to generate groups along with the result by means of
4213 setting the flag IsGenerateGroups. For detailed information on
4214 groups that can be created please see the method geompy.MakePipe().
4217 theSeqBases - list of Bases shape to be extruded. Base shape must be
4218 shell or face. If number of faces in neighbour sections
4219 aren't coincided result solid between such sections will
4220 be created using external boundaries of this shells.
4221 theSeqSubBases - list of corresponding sub-shapes of section shapes.
4222 This list is used for searching correspondences between
4223 faces in the sections. Size of this list must be equal
4224 to size of list of base shapes.
4225 theLocations - list of locations on the path corresponding
4226 specified list of the Bases shapes. Number of locations
4227 should be equal to number of bases. First and last
4228 locations must be coincided with first and last vertexes
4229 of path correspondingly.
4230 thePath - Path shape to extrude the base shape along it.
4231 theWithContact - the mode defining that the section is translated to be in
4232 contact with the spine (0/1)
4233 theWithCorrection - defining that the section is rotated to be
4234 orthogonal to the spine tangent in the correspondent point (0/1)
4235 IsGenerateGroups - flag that tells if it is necessary to
4236 create groups. It is equal to False by default.
4237 theName Object name; when specified, this parameter is used
4238 for result publication in the study. Otherwise, if automatic
4239 publication is switched on, default value is used for result name.
4242 New GEOM.GEOM_Object, containing the created solids if
4243 IsGenerateGroups is not set. Otherwise it returns new
4244 GEOM.ListOfGO. Its first element is the created solids, the
4245 remaining ones are created groups.
4247 aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
4248 theLocations, thePath,
4249 theWithContact, theWithCorrection,
4251 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4253 if IsGenerateGroups:
4254 self._autoPublish(aList, theName, "pipe")
4257 self._autoPublish(aList[0], theName, "pipe")
4260 ## Create a shape by extrusion of the profile shape along
4261 # the path shape. This function is used only for debug pipe
4262 # functionality - it is a version of function MakePipeWithShellSections()
4263 # which give a possibility to receive information about
4264 # creating pipe between each pair of sections step by step.
4265 @ManageTransactions("PrimOp")
4266 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
4267 theLocations, thePath,
4268 theWithContact, theWithCorrection,
4269 IsGenerateGroups=False, theName=None):
4271 Create a shape by extrusion of the profile shape along
4272 the path shape. This function is used only for debug pipe
4273 functionality - it is a version of previous function
4274 geompy.MakePipeWithShellSections() which give a possibility to
4275 receive information about creating pipe between each pair of
4276 sections step by step.
4279 nbsect = len(theSeqBases)
4280 nbsubsect = len(theSeqSubBases)
4281 #print "nbsect = ",nbsect
4282 for i in range(1,nbsect):
4284 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
4285 tmpLocations = [ theLocations[i-1], theLocations[i] ]
4287 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
4288 aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
4289 tmpLocations, thePath,
4290 theWithContact, theWithCorrection,
4292 if self.PrimOp.IsDone() == 0:
4293 print("Problems with pipe creation between ",i," and ",i+1," sections")
4294 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
4297 print("Pipe between ",i," and ",i+1," sections is OK")
4298 res.append(aList[0])
4302 resc = self.MakeCompound(res)
4303 #resc = self.MakeSewing(res, 0.001)
4304 #print "resc: ",resc
4305 self._autoPublish(resc, theName, "pipe")
4308 ## Create solids between given sections.
4309 # It is possible to generate groups along with the result by means of
4310 # setting the flag \a IsGenerateGroups. For detailed information on
4311 # groups that can be created please see the method MakePipe().
4312 # @param theSeqBases - list of sections (shell or face).
4313 # @param theLocations - list of corresponding vertexes
4314 # @param IsGenerateGroups - flag that tells if it is necessary to
4315 # create groups. It is equal to False by default.
4316 # @param theName Object name; when specified, this parameter is used
4317 # for result publication in the study. Otherwise, if automatic
4318 # publication is switched on, default value is used for result name.
4320 # @return New GEOM.GEOM_Object, containing the created solids if
4321 # \a IsGenerateGroups is not set. Otherwise it returns new
4322 # GEOM.ListOfGO. Its first element is the created solids, the
4323 # remaining ones are created groups.
4325 # @ref tui_creation_pipe_without_path "Example"
4326 @ManageTransactions("PrimOp")
4327 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
4328 IsGenerateGroups=False, theName=None):
4330 Create solids between given sections.
4331 It is possible to generate groups along with the result by means of
4332 setting the flag IsGenerateGroups. For detailed information on
4333 groups that can be created please see the method geompy.MakePipe().
4336 theSeqBases - list of sections (shell or face).
4337 theLocations - list of corresponding vertexes
4338 IsGenerateGroups - flag that tells if it is necessary to
4339 create groups. It is equal to False by default.
4340 theName Object name; when specified, this parameter is used
4341 for result publication in the study. Otherwise, if automatic
4342 publication is switched on, default value is used for result name.
4345 New GEOM.GEOM_Object, containing the created solids if
4346 IsGenerateGroups is not set. Otherwise it returns new
4347 GEOM.ListOfGO. Its first element is the created solids, the
4348 remaining ones are created groups.
4350 aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
4352 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
4354 if IsGenerateGroups:
4355 self._autoPublish(aList, theName, "pipe")
4358 self._autoPublish(aList[0], theName, "pipe")
4361 ## Create a shape by extrusion of the base shape along
4362 # the path shape with constant bi-normal direction along the given vector.
4363 # The path shape can be a wire or an edge.
4364 # It is possible to generate groups along with the result by means of
4365 # setting the flag \a IsGenerateGroups. For detailed information on
4366 # groups that can be created please see the method MakePipe().
4367 # @param theBase Base shape to be extruded.
4368 # @param thePath Path shape to extrude the base shape along it.
4369 # @param theVec Vector defines a constant binormal direction to keep the
4370 # same angle between the direction and the sections
4371 # along the sweep surface.
4372 # @param IsGenerateGroups flag that tells if it is necessary to
4373 # create groups. It is equal to False by default.
4374 # @param theName Object name; when specified, this parameter is used
4375 # for result publication in the study. Otherwise, if automatic
4376 # publication is switched on, default value is used for result name.
4378 # @return New GEOM.GEOM_Object, containing the created pipe if
4379 # \a IsGenerateGroups is not set. Otherwise it returns new
4380 # GEOM.ListOfGO. Its first element is the created pipe, the
4381 # remaining ones are created groups.
4383 # @ref tui_creation_pipe "Example"
4384 @ManageTransactions("PrimOp")
4385 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
4386 IsGenerateGroups=False, theName=None):
4388 Create a shape by extrusion of the base shape along
4389 the path shape with constant bi-normal direction along the given vector.
4390 The path shape can be a wire or an edge.
4391 It is possible to generate groups along with the result by means of
4392 setting the flag IsGenerateGroups. For detailed information on
4393 groups that can be created please see the method geompy.MakePipe().
4396 theBase Base shape to be extruded.
4397 thePath Path shape to extrude the base shape along it.
4398 theVec Vector defines a constant binormal direction to keep the
4399 same angle between the direction and the sections
4400 along the sweep surface.
4401 IsGenerateGroups flag that tells if it is necessary to
4402 create groups. It is equal to False by default.
4403 theName Object name; when specified, this parameter is used
4404 for result publication in the study. Otherwise, if automatic
4405 publication is switched on, default value is used for result name.
4408 New GEOM.GEOM_Object, containing the created pipe if
4409 IsGenerateGroups is not set. Otherwise it returns new
4410 GEOM.ListOfGO. Its first element is the created pipe, the
4411 remaining ones are created groups.
4413 # Example: see GEOM_TestAll.py
4414 aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
4415 theVec, IsGenerateGroups)
4416 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
4418 if IsGenerateGroups:
4419 self._autoPublish(aList, theName, "pipe")
4422 self._autoPublish(aList[0], theName, "pipe")
4425 ## Makes a thick solid from a shape. If the input is a surface shape
4426 # (face or shell) the result is a thick solid. If an input shape is
4427 # a solid the result is a hollowed solid with removed faces.
4428 # @param theShape Face or Shell to get thick solid or solid to get
4430 # @param theThickness Thickness of the resulting solid
4431 # @param theFacesIDs the list of face IDs to be removed from the
4432 # result. It is ignored if \a theShape is a face or a shell.
4433 # It is empty by default.
4434 # @param theInside If true the thickness is applied towards inside
4435 # @param theName Object name; when specified, this parameter is used
4436 # for result publication in the study. Otherwise, if automatic
4437 # publication is switched on, default value is used for result name.
4439 # @return New GEOM.GEOM_Object, containing the created solid
4441 # @ref tui_creation_thickness "Example"
4442 @ManageTransactions("PrimOp")
4443 def MakeThickSolid(self, theShape, theThickness,
4444 theFacesIDs=[], theInside=False, theName=None):
4446 Make a thick solid from a shape. If the input is a surface shape
4447 (face or shell) the result is a thick solid. If an input shape is
4448 a solid the result is a hollowed solid with removed faces.
4451 theShape Face or Shell to get thick solid or solid to get
4453 theThickness Thickness of the resulting solid
4454 theFacesIDs the list of face IDs to be removed from the
4455 result. It is ignored if theShape is a face or a
4456 shell. It is empty by default.
4457 theInside If true the thickness is applied towards inside
4458 theName Object name; when specified, this parameter is used
4459 for result publication in the study. Otherwise, if automatic
4460 publication is switched on, default value is used for result name.
4463 New GEOM.GEOM_Object, containing the created solid
4465 # Example: see GEOM_TestAll.py
4466 theThickness,Parameters = ParseParameters(theThickness)
4467 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4468 theThickness, True, theInside)
4469 RaiseIfFailed("MakeThickSolid", self.PrimOp)
4470 anObj.SetParameters(Parameters)
4471 self._autoPublish(anObj, theName, "thickSolid")
4475 ## Modifies a shape to make it a thick solid. If the input is a surface
4476 # shape (face or shell) the result is a thick solid. If an input shape
4477 # is a solid the result is a hollowed solid with removed faces.
4478 # @param theShape Face or Shell to get thick solid or solid to get
4480 # @param theThickness Thickness of the resulting solid
4481 # @param theFacesIDs the list of face IDs to be removed from the
4482 # result. It is ignored if \a theShape is a face or a shell.
4483 # It is empty by default.
4484 # @param theInside If true the thickness is applied towards inside
4486 # @return The modified shape
4488 # @ref tui_creation_thickness "Example"
4489 @ManageTransactions("PrimOp")
4490 def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
4492 Modifies a shape to make it a thick solid. If the input is a
4493 surface shape (face or shell) the result is a thick solid. If
4494 an input shape is a solid the result is a hollowed solid with
4498 theShape Face or Shell to get thick solid or solid to get
4500 theThickness Thickness of the resulting solid
4501 theFacesIDs the list of face IDs to be removed from the
4502 result. It is ignored if \a theShape is a face or
4503 a shell. It is empty by default.
4504 theInside If true the thickness is applied towards inside
4509 # Example: see GEOM_TestAll.py
4510 theThickness,Parameters = ParseParameters(theThickness)
4511 anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
4512 theThickness, False, theInside)
4513 RaiseIfFailed("Thicken", self.PrimOp)
4514 anObj.SetParameters(Parameters)
4517 ## Build a middle path of a pipe-like shape.
4518 # The path shape can be a wire or an edge.
4519 # @param theShape It can be closed or unclosed pipe-like shell
4520 # or a pipe-like solid.
4521 # @param theBase1, theBase2 Two bases of the supposed pipe. This
4522 # should be wires or faces of theShape.
4523 # @param theName Object name; when specified, this parameter is used
4524 # for result publication in the study. Otherwise, if automatic
4525 # publication is switched on, default value is used for result name.
4527 # @note It is not assumed that exact or approximate copy of theShape
4528 # can be obtained by applying existing Pipe operation on the
4529 # resulting "Path" wire taking theBase1 as the base - it is not
4530 # always possible; though in some particular cases it might work
4531 # it is not guaranteed. Thus, RestorePath function should not be
4532 # considered as an exact reverse operation of the Pipe.
4534 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4535 # source pipe's "path".
4537 # @ref tui_creation_pipe_path "Example"
4538 @ManageTransactions("PrimOp")
4539 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
4541 Build a middle path of a pipe-like shape.
4542 The path shape can be a wire or an edge.
4545 theShape It can be closed or unclosed pipe-like shell
4546 or a pipe-like solid.
4547 theBase1, theBase2 Two bases of the supposed pipe. This
4548 should be wires or faces of theShape.
4549 theName Object name; when specified, this parameter is used
4550 for result publication in the study. Otherwise, if automatic
4551 publication is switched on, default value is used for result name.
4554 New GEOM_Object, containing an edge or wire that represent
4557 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
4558 RaiseIfFailed("RestorePath", self.PrimOp)
4559 self._autoPublish(anObj, theName, "path")
4562 ## Build a middle path of a pipe-like shape.
4563 # The path shape can be a wire or an edge.
4564 # @param theShape It can be closed or unclosed pipe-like shell
4565 # or a pipe-like solid.
4566 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
4567 # should be lists of edges of theShape.
4568 # @param theName Object name; when specified, this parameter is used
4569 # for result publication in the study. Otherwise, if automatic
4570 # publication is switched on, default value is used for result name.
4572 # @note It is not assumed that exact or approximate copy of theShape
4573 # can be obtained by applying existing Pipe operation on the
4574 # resulting "Path" wire taking theBase1 as the base - it is not
4575 # always possible; though in some particular cases it might work
4576 # it is not guaranteed. Thus, RestorePath function should not be
4577 # considered as an exact reverse operation of the Pipe.
4579 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
4580 # source pipe's "path".
4582 # @ref tui_creation_pipe_path "Example"
4583 @ManageTransactions("PrimOp")
4584 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
4586 Build a middle path of a pipe-like shape.
4587 The path shape can be a wire or an edge.
4590 theShape It can be closed or unclosed pipe-like shell
4591 or a pipe-like solid.
4592 listEdges1, listEdges2 Two bases of the supposed pipe. This
4593 should be lists of edges of theShape.
4594 theName Object name; when specified, this parameter is used
4595 for result publication in the study. Otherwise, if automatic
4596 publication is switched on, default value is used for result name.
4599 New GEOM_Object, containing an edge or wire that represent
4602 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
4603 RaiseIfFailed("RestorePath", self.PrimOp)
4604 self._autoPublish(anObj, theName, "path")
4610 ## @addtogroup l3_basic_go
4613 ## Create a linear edge with specified ends.
4614 # @param thePnt1 Point for the first end of edge.
4615 # @param thePnt2 Point for the second end of edge.
4616 # @param theName Object name; when specified, this parameter is used
4617 # for result publication in the study. Otherwise, if automatic
4618 # publication is switched on, default value is used for result name.
4620 # @return New GEOM.GEOM_Object, containing the created edge.
4622 # @ref tui_creation_edge "Example"
4623 @ManageTransactions("ShapesOp")
4624 def MakeEdge(self, thePnt1, thePnt2, theName=None):
4626 Create a linear edge with specified ends.
4629 thePnt1 Point for the first end of edge.
4630 thePnt2 Point for the second end of edge.
4631 theName Object name; when specified, this parameter is used
4632 for result publication in the study. Otherwise, if automatic
4633 publication is switched on, default value is used for result name.
4636 New GEOM.GEOM_Object, containing the created edge.
4638 # Example: see GEOM_TestAll.py
4639 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
4640 RaiseIfFailed("MakeEdge", self.ShapesOp)
4641 self._autoPublish(anObj, theName, "edge")
4644 ## Create a new edge, corresponding to the given length on the given curve.
4645 # @param theRefCurve The referenced curve (edge).
4646 # @param theLength Length on the referenced curve. It can be negative.
4647 # @param theStartPoint Any point can be selected for it, the new edge will begin
4648 # at the end of \a theRefCurve, close to the selected point.
4649 # If None, start from the first point of \a theRefCurve.
4650 # @param theName Object name; when specified, this parameter is used
4651 # for result publication in the study. Otherwise, if automatic
4652 # publication is switched on, default value is used for result name.
4654 # @return New GEOM.GEOM_Object, containing the created edge.
4656 # @ref tui_creation_edge "Example"
4657 @ManageTransactions("ShapesOp")
4658 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
4660 Create a new edge, corresponding to the given length on the given curve.
4663 theRefCurve The referenced curve (edge).
4664 theLength Length on the referenced curve. It can be negative.
4665 theStartPoint Any point can be selected for it, the new edge will begin
4666 at the end of theRefCurve, close to the selected point.
4667 If None, start from the first point of theRefCurve.
4668 theName Object name; when specified, this parameter is used
4669 for result publication in the study. Otherwise, if automatic
4670 publication is switched on, default value is used for result name.
4673 New GEOM.GEOM_Object, containing the created edge.
4675 # Example: see GEOM_TestAll.py
4676 theLength, Parameters = ParseParameters(theLength)
4677 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
4678 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
4679 anObj.SetParameters(Parameters)
4680 self._autoPublish(anObj, theName, "edge")
4683 ## Create an edge from specified wire.
4684 # @param theWire source Wire
4685 # @param theLinearTolerance linear tolerance value (default = 1e-07)
4686 # @param theAngularTolerance angular tolerance value (default = 1e-12)
4687 # @param theName Object name; when specified, this parameter is used
4688 # for result publication in the study. Otherwise, if automatic
4689 # publication is switched on, default value is used for result name.
4691 # @return New GEOM.GEOM_Object, containing the created edge.
4693 # @ref tui_creation_edge "Example"
4694 @ManageTransactions("ShapesOp")
4695 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
4697 Create an edge from specified wire.
4701 theLinearTolerance linear tolerance value (default = 1e-07)
4702 theAngularTolerance angular tolerance value (default = 1e-12)
4703 theName Object name; when specified, this parameter is used
4704 for result publication in the study. Otherwise, if automatic
4705 publication is switched on, default value is used for result name.
4708 New GEOM.GEOM_Object, containing the created edge.
4710 # Example: see GEOM_TestAll.py
4711 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
4712 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
4713 self._autoPublish(anObj, theName, "edge")
4716 ## Create a wire from the set of edges and wires.
4717 # @param theEdgesAndWires List of edges and/or wires.
4718 # @param theTolerance Maximum distance between vertices, that will be merged.
4719 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
4720 # @param theName Object name; when specified, this parameter is used
4721 # for result publication in the study. Otherwise, if automatic
4722 # publication is switched on, default value is used for result name.
4724 # @return New GEOM.GEOM_Object, containing the created wire.
4726 # @ref tui_creation_wire "Example"
4727 @ManageTransactions("ShapesOp")
4728 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
4730 Create a wire from the set of edges and wires.
4733 theEdgesAndWires List of edges and/or wires.
4734 theTolerance Maximum distance between vertices, that will be merged.
4735 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
4736 theName Object name; when specified, this parameter is used
4737 for result publication in the study. Otherwise, if automatic
4738 publication is switched on, default value is used for result name.
4741 New GEOM.GEOM_Object, containing the created wire.
4743 # Example: see GEOM_TestAll.py
4744 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
4745 RaiseIfFailed("MakeWire", self.ShapesOp)
4746 self._autoPublish(anObj, theName, "wire")
4749 ## Create a face on the given wire.
4750 # @param theWire closed Wire or Edge to build the face on.
4751 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4752 # If the tolerance of the obtained planar face is less
4753 # than 1e-06, this face will be returned, otherwise the
4754 # algorithm tries to build any suitable face on the given
4755 # wire and prints a warning message.
4756 # @param theName Object name; when specified, this parameter is used
4757 # for result publication in the study. Otherwise, if automatic
4758 # publication is switched on, default value is used for result name.
4760 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4762 # @ref tui_creation_face "Example"
4763 @ManageTransactions("ShapesOp")
4764 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4766 Create a face on the given wire.
4769 theWire closed Wire or Edge to build the face on.
4770 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4771 If the tolerance of the obtained planar face is less
4772 than 1e-06, this face will be returned, otherwise the
4773 algorithm tries to build any suitable face on the given
4774 wire and prints a warning message.
4775 theName Object name; when specified, this parameter is used
4776 for result publication in the study. Otherwise, if automatic
4777 publication is switched on, default value is used for result name.
4780 New GEOM.GEOM_Object, containing the created face (compound of faces).
4782 # Example: see GEOM_TestAll.py
4783 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4784 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4785 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4787 RaiseIfFailed("MakeFace", self.ShapesOp)
4788 self._autoPublish(anObj, theName, "face")
4791 ## Create a face on the given wires set.
4792 # @param theWires List of closed wires or edges to build the face on.
4793 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4794 # If the tolerance of the obtained planar face is less
4795 # than 1e-06, this face will be returned, otherwise the
4796 # algorithm tries to build any suitable face on the given
4797 # wire and prints a warning message.
4798 # @param theName Object name; when specified, this parameter is used
4799 # for result publication in the study. Otherwise, if automatic
4800 # publication is switched on, default value is used for result name.
4802 # @return New GEOM.GEOM_Object, containing the created face (compound of faces).
4804 # @ref tui_creation_face "Example"
4805 @ManageTransactions("ShapesOp")
4806 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4808 Create a face on the given wires set.
4811 theWires List of closed wires or edges to build the face on.
4812 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4813 If the tolerance of the obtained planar face is less
4814 than 1e-06, this face will be returned, otherwise the
4815 algorithm tries to build any suitable face on the given
4816 wire and prints a warning message.
4817 theName Object name; when specified, this parameter is used
4818 for result publication in the study. Otherwise, if automatic
4819 publication is switched on, default value is used for result name.
4822 New GEOM.GEOM_Object, containing the created face (compound of faces).
4824 # Example: see GEOM_TestAll.py
4825 anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
4826 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4827 print("WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built.")
4829 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4830 self._autoPublish(anObj, theName, "face")
4833 ## See MakeFaceWires() method for details.
4835 # @ref tui_creation_face "Example 1"
4836 # \n @ref swig_MakeFaces "Example 2"
4837 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4839 See geompy.MakeFaceWires() method for details.
4841 # Example: see GEOM_TestOthers.py
4842 # note: auto-publishing is done in self.MakeFaceWires()
4843 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4846 ## Create a face based on a surface from given face bounded
4848 # @param theFace the face whose surface is used to create a new face.
4849 # @param theWire the wire that will bound a new face.
4850 # @param theName Object name; when specified, this parameter is used
4851 # for result publication in the study. Otherwise, if automatic
4852 # publication is switched on, default value is used for result name.
4854 # @return New GEOM.GEOM_Object, containing the created face.
4856 # @ref tui_creation_face "Example"
4857 @ManageTransactions("ShapesOp")
4858 def MakeFaceFromSurface(self, theFace, theWire, theName=None):
4860 Create a face based on a surface from given face bounded
4864 theFace the face whose surface is used to create a new face.
4865 theWire the wire that will bound a new face.
4866 theName Object name; when specified, this parameter is used
4867 for result publication in the study. Otherwise, if automatic
4868 publication is switched on, default value is used for result name.
4871 New GEOM.GEOM_Object, containing the created face.
4873 # Example: see GEOM_TestAll.py
4874 anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
4875 RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
4876 self._autoPublish(anObj, theName, "face")
4879 ## Create a face from a set of edges with the given constraints.
4880 # @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4881 # - edges should form a closed wire;
4882 # - for each edge, constraint face is optional: if a constraint face is missing
4883 # for some edge, this means that there no constraint associated with this edge.
4884 # @param theName Object name; when specified, this parameter is used
4885 # for result publication in the study. Otherwise, if automatic
4886 # publication is switched on, default value is used for result name.
4888 # @return New GEOM.GEOM_Object, containing the created face.
4890 # @ref tui_creation_face "Example"
4891 @ManageTransactions("ShapesOp")
4892 def MakeFaceWithConstraints(self, theConstraints, theName=None):
4894 Create a face from a set of edges with the given constraints.
4897 theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
4898 - edges should form a closed wire;
4899 - for each edge, constraint face is optional: if a constraint face is missing
4900 for some edge, this means that there no constraint associated with this edge.
4901 theName Object name; when specified, this parameter is used
4902 for result publication in the study. Otherwise, if automatic
4903 publication is switched on, default value is used for result name.
4906 New GEOM.GEOM_Object, containing the created face.
4908 # Example: see GEOM_TestAll.py
4909 anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
4911 RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
4912 self._autoPublish(anObj, theName, "face")
4915 ## Create a shell from the set of faces, shells and/or compounds of faces.
4916 # @param theFacesAndShells List of faces, shells and/or compounds of faces.
4917 # @param theName Object name; when specified, this parameter is used
4918 # for result publication in the study. Otherwise, if automatic
4919 # publication is switched on, default value is used for result name.
4921 # @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
4923 # @ref tui_creation_shell "Example"
4924 @ManageTransactions("ShapesOp")
4925 def MakeShell(self, theFacesAndShells, theName=None):
4927 Create a shell from the set of faces and shells.
4930 theFacesAndShells List of faces and/or shells.
4931 theName Object name; when specified, this parameter is used
4932 for result publication in the study. Otherwise, if automatic
4933 publication is switched on, default value is used for result name.
4936 New GEOM.GEOM_Object, containing the created shell (compound of shells).
4938 # Example: see GEOM_TestAll.py
4939 anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
4940 RaiseIfFailed("MakeShell", self.ShapesOp)
4941 self._autoPublish(anObj, theName, "shell")
4944 ## Create a solid, bounded by the given shells.
4945 # @param theShells Sequence of bounding shells.
4946 # @param theName Object name; when specified, this parameter is used
4947 # for result publication in the study. Otherwise, if automatic
4948 # publication is switched on, default value is used for result name.
4950 # @return New GEOM.GEOM_Object, containing the created solid.
4952 # @ref tui_creation_solid "Example"
4953 @ManageTransactions("ShapesOp")
4954 def MakeSolid(self, theShells, theName=None):
4956 Create a solid, bounded by the given shells.
4959 theShells Sequence of bounding shells.
4960 theName Object name; when specified, this parameter is used
4961 for result publication in the study. Otherwise, if automatic
4962 publication is switched on, default value is used for result name.
4965 New GEOM.GEOM_Object, containing the created solid.
4967 # Example: see GEOM_TestAll.py
4968 theShells = ToList(theShells)
4969 if len(theShells) == 1:
4970 descr = self._IsGoodForSolid(theShells[0])
4972 # raise RuntimeError, "MakeSolidShells : " + descr
4973 if descr == "WRN_SHAPE_UNCLOSED":
4974 raise RuntimeError("MakeSolidShells : Unable to create solid from unclosed shape")
4975 anObj = self.ShapesOp.MakeSolidShells(theShells)
4976 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4977 self._autoPublish(anObj, theName, "solid")
4980 ## Create a compound of the given shapes.
4981 # @param theShapes List of shapes to put in compound.
4982 # @param theName Object name; when specified, this parameter is used
4983 # for result publication in the study. Otherwise, if automatic
4984 # publication is switched on, default value is used for result name.
4986 # @return New GEOM.GEOM_Object, containing the created compound.
4988 # @ref tui_creation_compound "Example"
4989 @ManageTransactions("ShapesOp")
4990 def MakeCompound(self, theShapes, theName=None):
4992 Create a compound of the given shapes.
4995 theShapes List of shapes to put in compound.
4996 theName Object name; when specified, this parameter is used
4997 for result publication in the study. Otherwise, if automatic
4998 publication is switched on, default value is used for result name.
5001 New GEOM.GEOM_Object, containing the created compound.
5003 # Example: see GEOM_TestAll.py
5004 anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
5005 RaiseIfFailed("MakeCompound", self.ShapesOp)
5006 self._autoPublish(anObj, theName, "compound")
5009 ## Create a solid (or solids) from the set of faces and/or shells.
5010 # @param theFacesOrShells List of faces and/or shells.
5011 # @param isIntersect If TRUE, forces performing intersections
5012 # between arguments; otherwise (default) intersection is not performed.
5013 # @param theName Object name; when specified, this parameter is used
5014 # for result publication in the study. Otherwise, if automatic
5015 # publication is switched on, default value is used for result name.
5017 # @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5019 # @ref tui_creation_solid_from_faces "Example"
5020 @ManageTransactions("ShapesOp")
5021 def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
5023 Create a solid (or solids) from the set of connected faces and/or shells.
5026 theFacesOrShells List of faces and/or shells.
5027 isIntersect If TRUE, forces performing intersections
5028 between arguments; otherwise (default) intersection is not performed
5029 theName Object name; when specified, this parameter is used.
5030 for result publication in the study. Otherwise, if automatic
5031 publication is switched on, default value is used for result name.
5034 New GEOM.GEOM_Object, containing the created solid (or compound of solids).
5036 # Example: see GEOM_TestAll.py
5037 anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
5038 RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
5039 self._autoPublish(anObj, theName, "solid")
5042 # end of l3_basic_go
5045 ## @addtogroup l2_measure
5048 ## Gives quantity of faces in the given shape.
5049 # @param theShape Shape to count faces of.
5050 # @return Quantity of faces.
5052 # @ref swig_NumberOf "Example"
5053 @ManageTransactions("ShapesOp")
5054 def NumberOfFaces(self, theShape):
5056 Gives quantity of faces in the given shape.
5059 theShape Shape to count faces of.
5064 # Example: see GEOM_TestOthers.py
5065 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
5066 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
5069 ## Gives quantity of edges in the given shape.
5070 # @param theShape Shape to count edges of.
5071 # @return Quantity of edges.
5073 # @ref swig_NumberOf "Example"
5074 @ManageTransactions("ShapesOp")
5075 def NumberOfEdges(self, theShape):
5077 Gives quantity of edges in the given shape.
5080 theShape Shape to count edges of.
5085 # Example: see GEOM_TestOthers.py
5086 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
5087 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
5090 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
5091 # @param theShape Shape to count sub-shapes of.
5092 # @param theShapeType Type of sub-shapes to count (see ShapeType())
5093 # @return Quantity of sub-shapes of given type.
5095 # @ref swig_NumberOf "Example"
5096 @ManageTransactions("ShapesOp")
5097 def NumberOfSubShapes(self, theShape, theShapeType):
5099 Gives quantity of sub-shapes of type theShapeType in the given shape.
5102 theShape Shape to count sub-shapes of.
5103 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
5106 Quantity of sub-shapes of given type.
5108 # Example: see GEOM_TestOthers.py
5109 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
5110 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
5113 ## Gives quantity of solids in the given shape.
5114 # @param theShape Shape to count solids in.
5115 # @return Quantity of solids.
5117 # @ref swig_NumberOf "Example"
5118 @ManageTransactions("ShapesOp")
5119 def NumberOfSolids(self, theShape):
5121 Gives quantity of solids in the given shape.
5124 theShape Shape to count solids in.
5129 # Example: see GEOM_TestOthers.py
5130 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, self.ShapeType["SOLID"])
5131 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
5137 ## @addtogroup l3_healing
5140 ## Reverses an orientation the given shape.
5141 # @param theShape Shape to be reversed.
5142 # @param theName Object name; when specified, this parameter is used
5143 # for result publication in the study. Otherwise, if automatic
5144 # publication is switched on, default value is used for result name.
5146 # @return The reversed copy of theShape.
5148 # @ref swig_ChangeOrientation "Example"
5149 @ManageTransactions("ShapesOp")
5150 def ChangeOrientation(self, theShape, theName=None):
5152 Reverses an orientation the given shape.
5155 theShape Shape to be reversed.
5156 theName Object name; when specified, this parameter is used
5157 for result publication in the study. Otherwise, if automatic
5158 publication is switched on, default value is used for result name.
5161 The reversed copy of theShape.
5163 # Example: see GEOM_TestAll.py
5164 anObj = self.ShapesOp.ChangeOrientation(theShape)
5165 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
5166 self._autoPublish(anObj, theName, "reversed")
5169 ## See ChangeOrientation() method for details.
5171 # @ref swig_OrientationChange "Example"
5172 def OrientationChange(self, theShape, theName=None):
5174 See geompy.ChangeOrientation method for details.
5176 # Example: see GEOM_TestOthers.py
5177 # note: auto-publishing is done in self.ChangeOrientation()
5178 anObj = self.ChangeOrientation(theShape, theName)
5184 ## @addtogroup l4_obtain
5187 ## Retrieve all free faces from the given shape.
5188 # Free face is a face, which is not shared between two shells of the shape.
5189 # @param theShape Shape to find free faces in.
5190 # @return List of IDs of all free faces, contained in theShape.
5192 # @ref tui_free_faces_page "Example"
5193 @ManageTransactions("ShapesOp")
5194 def GetFreeFacesIDs(self,theShape):
5196 Retrieve all free faces from the given shape.
5197 Free face is a face, which is not shared between two shells of the shape.
5200 theShape Shape to find free faces in.
5203 List of IDs of all free faces, contained in theShape.
5205 # Example: see GEOM_TestOthers.py
5206 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
5207 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
5210 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5211 # @param theShape1 Shape to find sub-shapes in.
5212 # @param theShape2 Shape to find shared sub-shapes with.
5213 # @param theShapeType Type of sub-shapes to be retrieved.
5214 # @param theName Object name; when specified, this parameter is used
5215 # for result publication in the study. Otherwise, if automatic
5216 # publication is switched on, default value is used for result name.
5218 # @return List of sub-shapes of theShape1, shared with theShape2.
5220 # @ref swig_GetSharedShapes "Example"
5221 @ManageTransactions("ShapesOp")
5222 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
5224 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
5227 theShape1 Shape to find sub-shapes in.
5228 theShape2 Shape to find shared sub-shapes with.
5229 theShapeType Type of sub-shapes to be retrieved.
5230 theName Object name; when specified, this parameter is used
5231 for result publication in the study. Otherwise, if automatic
5232 publication is switched on, default value is used for result name.
5235 List of sub-shapes of theShape1, shared with theShape2.
5237 # Example: see GEOM_TestOthers.py
5238 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
5239 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
5240 self._autoPublish(aList, theName, "shared")
5243 ## Get sub-shapes, shared by input shapes.
5244 # @param theShapes Either a list or compound of shapes to find common sub-shapes of.
5245 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
5246 # @param theMultiShare Specifies what type of shares should be checked:
5247 # - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5248 # - @c False: causes to search sub-shapes shared between couples of input shapes.
5249 # @param theName Object name; when specified, this parameter is used
5250 # for result publication in the study. Otherwise, if automatic
5251 # publication is switched on, default value is used for result name.
5253 # @note If @a theShapes contains single compound, the shares between all possible couples of
5254 # its top-level shapes are returned; otherwise, only shares between 1st input shape
5255 # and all rest input shapes are returned.
5257 # @return List of all found sub-shapes.
5260 # - @ref tui_shared_shapes "Example 1"
5261 # - @ref swig_GetSharedShapes "Example 2"
5262 @ManageTransactions("ShapesOp")
5263 def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
5265 Get sub-shapes, shared by input shapes.
5268 theShapes Either a list or compound of shapes to find common sub-shapes of.
5269 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
5270 theMultiShare Specifies what type of shares should be checked:
5271 - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
5272 - False: causes to search sub-shapes shared between couples of input shapes.
5273 theName Object name; when specified, this parameter is used
5274 for result publication in the study. Otherwise, if automatic
5275 publication is switched on, default value is used for result name.
5277 Note: if theShapes contains single compound, the shares between all possible couples of
5278 its top-level shapes are returned; otherwise, only shares between 1st input shape
5279 and all rest input shapes are returned.
5282 List of all found sub-shapes.
5284 # Example: see GEOM_TestOthers.py
5285 aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
5286 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
5287 self._autoPublish(aList, theName, "shared")
5290 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5291 # situated relatively the specified plane by the certain way,
5292 # defined through <VAR>theState</VAR> parameter.
5293 # @param theShape Shape to find sub-shapes of.
5294 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5295 # @param theAx1 Vector (or line, or linear edge), specifying normal
5296 # direction and location of the plane to find shapes on.
5297 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5298 # @param theName Object name; when specified, this parameter is used
5299 # for result publication in the study. Otherwise, if automatic
5300 # publication is switched on, default value is used for result name.
5302 # @return List of all found sub-shapes.
5304 # @ref swig_GetShapesOnPlane "Example"
5305 @ManageTransactions("ShapesOp")
5306 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
5308 Find in theShape all sub-shapes of type theShapeType,
5309 situated relatively the specified plane by the certain way,
5310 defined through theState parameter.
5313 theShape Shape to find sub-shapes of.
5314 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5315 theAx1 Vector (or line, or linear edge), specifying normal
5316 direction and location of the plane to find shapes on.
5317 theState The state of the sub-shapes to find (see GEOM::shape_state)
5318 theName Object name; when specified, this parameter is used
5319 for result publication in the study. Otherwise, if automatic
5320 publication is switched on, default value is used for result name.
5323 List of all found sub-shapes.
5325 # Example: see GEOM_TestOthers.py
5326 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
5327 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
5328 self._autoPublish(aList, theName, "shapeOnPlane")
5331 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5332 # situated relatively the specified plane by the certain way,
5333 # defined through <VAR>theState</VAR> parameter.
5334 # @param theShape Shape to find sub-shapes of.
5335 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5336 # @param theAx1 Vector (or line, or linear edge), specifying normal
5337 # direction and location of the plane to find shapes on.
5338 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5340 # @return List of all found sub-shapes indices.
5342 # @ref swig_GetShapesOnPlaneIDs "Example"
5343 @ManageTransactions("ShapesOp")
5344 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
5346 Find in theShape all sub-shapes of type theShapeType,
5347 situated relatively the specified plane by the certain way,
5348 defined through theState parameter.
5351 theShape Shape to find sub-shapes of.
5352 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5353 theAx1 Vector (or line, or linear edge), specifying normal
5354 direction and location of the plane to find shapes on.
5355 theState The state of the sub-shapes to find (see GEOM::shape_state)
5358 List of all found sub-shapes indices.
5360 # Example: see GEOM_TestOthers.py
5361 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
5362 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
5365 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5366 # situated relatively the specified plane by the certain way,
5367 # defined through <VAR>theState</VAR> parameter.
5368 # @param theShape Shape to find sub-shapes of.
5369 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5370 # @param theAx1 Vector (or line, or linear edge), specifying normal
5371 # direction of the plane to find shapes on.
5372 # @param thePnt Point specifying location of the plane to find shapes on.
5373 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5374 # @param theName Object name; when specified, this parameter is used
5375 # for result publication in the study. Otherwise, if automatic
5376 # publication is switched on, default value is used for result name.
5378 # @return List of all found sub-shapes.
5380 # @ref swig_GetShapesOnPlaneWithLocation "Example"
5381 @ManageTransactions("ShapesOp")
5382 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
5384 Find in theShape all sub-shapes of type theShapeType,
5385 situated relatively the specified plane by the certain way,
5386 defined through theState parameter.
5389 theShape Shape to find sub-shapes of.
5390 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5391 theAx1 Vector (or line, or linear edge), specifying normal
5392 direction and location of the plane to find shapes on.
5393 thePnt Point specifying location of the plane to find shapes on.
5394 theState The state of the sub-shapes to find (see GEOM::shape_state)
5395 theName Object name; when specified, this parameter is used
5396 for result publication in the study. Otherwise, if automatic
5397 publication is switched on, default value is used for result name.
5400 List of all found sub-shapes.
5402 # Example: see GEOM_TestOthers.py
5403 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
5404 theAx1, thePnt, theState)
5405 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
5406 self._autoPublish(aList, theName, "shapeOnPlane")
5409 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
5410 # situated relatively the specified plane by the certain way,
5411 # defined through <VAR>theState</VAR> parameter.
5412 # @param theShape Shape to find sub-shapes of.
5413 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5414 # @param theAx1 Vector (or line, or linear edge), specifying normal
5415 # direction of the plane to find shapes on.
5416 # @param thePnt Point specifying location of the plane to find shapes on.
5417 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5419 # @return List of all found sub-shapes indices.
5421 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
5422 @ManageTransactions("ShapesOp")
5423 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
5425 Find in theShape all sub-shapes of type theShapeType,
5426 situated relatively the specified plane by the certain way,
5427 defined through theState parameter.
5430 theShape Shape to find sub-shapes of.
5431 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5432 theAx1 Vector (or line, or linear edge), specifying normal
5433 direction and location of the plane to find shapes on.
5434 thePnt Point specifying location of the plane to find shapes on.
5435 theState The state of the sub-shapes to find (see GEOM::shape_state)
5438 List of all found sub-shapes indices.
5440 # Example: see GEOM_TestOthers.py
5441 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
5442 theAx1, thePnt, theState)
5443 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
5446 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5447 # the specified cylinder by the certain way, defined through \a theState parameter.
5448 # @param theShape Shape to find sub-shapes of.
5449 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5450 # @param theAxis Vector (or line, or linear edge), specifying
5451 # axis of the cylinder to find shapes on.
5452 # @param theRadius Radius of the cylinder to find shapes on.
5453 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5454 # @param theName Object name; when specified, this parameter is used
5455 # for result publication in the study. Otherwise, if automatic
5456 # publication is switched on, default value is used for result name.
5458 # @return List of all found sub-shapes.
5460 # @ref swig_GetShapesOnCylinder "Example"
5461 @ManageTransactions("ShapesOp")
5462 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
5464 Find in theShape all sub-shapes of type theShapeType, situated relatively
5465 the specified cylinder by the certain way, defined through theState parameter.
5468 theShape Shape to find sub-shapes of.
5469 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5470 theAxis Vector (or line, or linear edge), specifying
5471 axis of the cylinder to find shapes on.
5472 theRadius Radius of the cylinder to find shapes on.
5473 theState The state of the sub-shapes to find (see GEOM::shape_state)
5474 theName Object name; when specified, this parameter is used
5475 for result publication in the study. Otherwise, if automatic
5476 publication is switched on, default value is used for result name.
5479 List of all found sub-shapes.
5481 # Example: see GEOM_TestOthers.py
5482 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
5483 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
5484 self._autoPublish(aList, theName, "shapeOnCylinder")
5487 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5488 # the specified cylinder by the certain way, defined through \a theState parameter.
5489 # @param theShape Shape to find sub-shapes of.
5490 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5491 # @param theAxis Vector (or line, or linear edge), specifying
5492 # axis of the cylinder to find shapes on.
5493 # @param theRadius Radius of the cylinder to find shapes on.
5494 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5496 # @return List of all found sub-shapes indices.
5498 # @ref swig_GetShapesOnCylinderIDs "Example"
5499 @ManageTransactions("ShapesOp")
5500 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
5502 Find in theShape all sub-shapes of type theShapeType, situated relatively
5503 the specified cylinder by the certain way, defined through theState parameter.
5506 theShape Shape to find sub-shapes of.
5507 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5508 theAxis Vector (or line, or linear edge), specifying
5509 axis of the cylinder to find shapes on.
5510 theRadius Radius of the cylinder to find shapes on.
5511 theState The state of the sub-shapes to find (see GEOM::shape_state)
5514 List of all found sub-shapes indices.
5516 # Example: see GEOM_TestOthers.py
5517 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
5518 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
5521 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5522 # the specified cylinder by the certain way, defined through \a theState parameter.
5523 # @param theShape Shape to find sub-shapes of.
5524 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5525 # @param theAxis Vector (or line, or linear edge), specifying
5526 # axis of the cylinder to find shapes on.
5527 # @param thePnt Point specifying location of the bottom of the cylinder.
5528 # @param theRadius Radius of the cylinder to find shapes on.
5529 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5530 # @param theName Object name; when specified, this parameter is used
5531 # for result publication in the study. Otherwise, if automatic
5532 # publication is switched on, default value is used for result name.
5534 # @return List of all found sub-shapes.
5536 # @ref swig_GetShapesOnCylinderWithLocation "Example"
5537 @ManageTransactions("ShapesOp")
5538 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
5540 Find in theShape all sub-shapes of type theShapeType, situated relatively
5541 the specified cylinder by the certain way, defined through theState parameter.
5544 theShape Shape to find sub-shapes of.
5545 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5546 theAxis Vector (or line, or linear edge), specifying
5547 axis of the cylinder to find shapes on.
5548 theRadius Radius of the cylinder to find shapes on.
5549 theState The state of the sub-shapes to find (see GEOM::shape_state)
5550 theName Object name; when specified, this parameter is used
5551 for result publication in the study. Otherwise, if automatic
5552 publication is switched on, default value is used for result name.
5555 List of all found sub-shapes.
5557 # Example: see GEOM_TestOthers.py
5558 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5559 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
5560 self._autoPublish(aList, theName, "shapeOnCylinder")
5563 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5564 # the specified cylinder by the certain way, defined through \a theState parameter.
5565 # @param theShape Shape to find sub-shapes of.
5566 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5567 # @param theAxis Vector (or line, or linear edge), specifying
5568 # axis of the cylinder to find shapes on.
5569 # @param thePnt Point specifying location of the bottom of the cylinder.
5570 # @param theRadius Radius of the cylinder to find shapes on.
5571 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5573 # @return List of all found sub-shapes indices
5575 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
5576 @ManageTransactions("ShapesOp")
5577 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
5579 Find in theShape all sub-shapes of type theShapeType, situated relatively
5580 the specified cylinder by the certain way, defined through theState parameter.
5583 theShape Shape to find sub-shapes of.
5584 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5585 theAxis Vector (or line, or linear edge), specifying
5586 axis of the cylinder to find shapes on.
5587 theRadius Radius of the cylinder to find shapes on.
5588 theState The state of the sub-shapes to find (see GEOM::shape_state)
5591 List of all found sub-shapes indices.
5593 # Example: see GEOM_TestOthers.py
5594 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
5595 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
5598 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5599 # the specified sphere by the certain way, defined through \a theState parameter.
5600 # @param theShape Shape to find sub-shapes of.
5601 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5602 # @param theCenter Point, specifying center of the sphere to find shapes on.
5603 # @param theRadius Radius of the sphere to find shapes on.
5604 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5605 # @param theName Object name; when specified, this parameter is used
5606 # for result publication in the study. Otherwise, if automatic
5607 # publication is switched on, default value is used for result name.
5609 # @return List of all found sub-shapes.
5611 # @ref swig_GetShapesOnSphere "Example"
5612 @ManageTransactions("ShapesOp")
5613 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
5615 Find in theShape all sub-shapes of type theShapeType, situated relatively
5616 the specified sphere by the certain way, defined through theState parameter.
5619 theShape Shape to find sub-shapes of.
5620 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5621 theCenter Point, specifying center of the sphere to find shapes on.
5622 theRadius Radius of the sphere to find shapes on.
5623 theState The state of the sub-shapes to find (see GEOM::shape_state)
5624 theName Object name; when specified, this parameter is used
5625 for result publication in the study. Otherwise, if automatic
5626 publication is switched on, default value is used for result name.
5629 List of all found sub-shapes.
5631 # Example: see GEOM_TestOthers.py
5632 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
5633 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
5634 self._autoPublish(aList, theName, "shapeOnSphere")
5637 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5638 # the specified sphere by the certain way, defined through \a theState parameter.
5639 # @param theShape Shape to find sub-shapes of.
5640 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5641 # @param theCenter Point, specifying center of the sphere to find shapes on.
5642 # @param theRadius Radius of the sphere to find shapes on.
5643 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5645 # @return List of all found sub-shapes indices.
5647 # @ref swig_GetShapesOnSphereIDs "Example"
5648 @ManageTransactions("ShapesOp")
5649 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
5651 Find in theShape all sub-shapes of type theShapeType, situated relatively
5652 the specified sphere by the certain way, defined through theState parameter.
5655 theShape Shape to find sub-shapes of.
5656 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5657 theCenter Point, specifying center of the sphere to find shapes on.
5658 theRadius Radius of the sphere to find shapes on.
5659 theState The state of the sub-shapes to find (see GEOM::shape_state)
5662 List of all found sub-shapes indices.
5664 # Example: see GEOM_TestOthers.py
5665 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
5666 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
5669 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5670 # the specified quadrangle by the certain way, defined through \a theState parameter.
5671 # @param theShape Shape to find sub-shapes of.
5672 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5673 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5674 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5675 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5676 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5677 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5678 # @param theName Object name; when specified, this parameter is used
5679 # for result publication in the study. Otherwise, if automatic
5680 # publication is switched on, default value is used for result name.
5682 # @return List of all found sub-shapes.
5684 # @ref swig_GetShapesOnQuadrangle "Example"
5685 @ManageTransactions("ShapesOp")
5686 def GetShapesOnQuadrangle(self, theShape, theShapeType,
5687 theTopLeftPoint, theTopRightPoint,
5688 theBottomLeftPoint, theBottomRightPoint, theState, theName=None):
5690 Find in theShape all sub-shapes of type theShapeType, situated relatively
5691 the specified quadrangle by the certain way, defined through theState parameter.
5694 theShape Shape to find sub-shapes of.
5695 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5696 theTopLeftPoint Point, specifying top left corner of a quadrangle
5697 theTopRightPoint Point, specifying top right corner of a quadrangle
5698 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5699 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5700 theState The state of the sub-shapes to find (see GEOM::shape_state)
5701 theName Object name; when specified, this parameter is used
5702 for result publication in the study. Otherwise, if automatic
5703 publication is switched on, default value is used for result name.
5706 List of all found sub-shapes.
5708 # Example: see GEOM_TestOthers.py
5709 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
5710 theTopLeftPoint, theTopRightPoint,
5711 theBottomLeftPoint, theBottomRightPoint, theState)
5712 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
5713 self._autoPublish(aList, theName, "shapeOnQuadrangle")
5716 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5717 # the specified quadrangle by the certain way, defined through \a theState parameter.
5718 # @param theShape Shape to find sub-shapes of.
5719 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5720 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
5721 # @param theTopRightPoint Point, specifying top right corner of a quadrangle
5722 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5723 # @param theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5724 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5726 # @return List of all found sub-shapes indices.
5728 # @ref swig_GetShapesOnQuadrangleIDs "Example"
5729 @ManageTransactions("ShapesOp")
5730 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
5731 theTopLeftPoint, theTopRightPoint,
5732 theBottomLeftPoint, theBottomRightPoint, theState):
5734 Find in theShape all sub-shapes of type theShapeType, situated relatively
5735 the specified quadrangle by the certain way, defined through theState parameter.
5738 theShape Shape to find sub-shapes of.
5739 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5740 theTopLeftPoint Point, specifying top left corner of a quadrangle
5741 theTopRightPoint Point, specifying top right corner of a quadrangle
5742 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
5743 theBottomRightPoint Point, specifying bottom right corner of a quadrangle
5744 theState The state of the sub-shapes to find (see GEOM::shape_state)
5747 List of all found sub-shapes indices.
5750 # Example: see GEOM_TestOthers.py
5751 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
5752 theTopLeftPoint, theTopRightPoint,
5753 theBottomLeftPoint, theBottomRightPoint, theState)
5754 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
5757 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5758 # the specified \a theBox by the certain way, defined through \a theState parameter.
5759 # @param theBox Shape for relative comparing.
5760 # @param theShape Shape to find sub-shapes of.
5761 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5762 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5763 # @param theName Object name; when specified, this parameter is used
5764 # for result publication in the study. Otherwise, if automatic
5765 # publication is switched on, default value is used for result name.
5767 # @return List of all found sub-shapes.
5769 # @ref swig_GetShapesOnBox "Example"
5770 @ManageTransactions("ShapesOp")
5771 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
5773 Find in theShape all sub-shapes of type theShapeType, situated relatively
5774 the specified theBox by the certain way, defined through theState parameter.
5777 theBox Shape for relative comparing.
5778 theShape Shape to find sub-shapes of.
5779 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5780 theState The state of the sub-shapes to find (see GEOM::shape_state)
5781 theName Object name; when specified, this parameter is used
5782 for result publication in the study. Otherwise, if automatic
5783 publication is switched on, default value is used for result name.
5786 List of all found sub-shapes.
5788 # Example: see GEOM_TestOthers.py
5789 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
5790 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
5791 self._autoPublish(aList, theName, "shapeOnBox")
5794 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
5795 # the specified \a theBox by the certain way, defined through \a theState parameter.
5796 # @param theBox Shape for relative comparing.
5797 # @param theShape Shape to find sub-shapes of.
5798 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5799 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5801 # @return List of all found sub-shapes indices.
5803 # @ref swig_GetShapesOnBoxIDs "Example"
5804 @ManageTransactions("ShapesOp")
5805 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
5807 Find in theShape all sub-shapes of type theShapeType, situated relatively
5808 the specified theBox by the certain way, defined through theState parameter.
5811 theBox Shape for relative comparing.
5812 theShape Shape to find sub-shapes of.
5813 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5814 theState The state of the sub-shapes to find (see GEOM::shape_state)
5817 List of all found sub-shapes indices.
5819 # Example: see GEOM_TestOthers.py
5820 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
5821 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
5824 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5825 # situated relatively the specified \a theCheckShape by the
5826 # certain way, defined through \a theState parameter.
5827 # @param theCheckShape Shape for relative comparing. It must be a solid.
5828 # @param theShape Shape to find sub-shapes of.
5829 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5830 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5831 # @param theName Object name; when specified, this parameter is used
5832 # for result publication in the study. Otherwise, if automatic
5833 # publication is switched on, default value is used for result name.
5835 # @return List of all found sub-shapes.
5837 # @ref swig_GetShapesOnShape "Example"
5838 @ManageTransactions("ShapesOp")
5839 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5841 Find in theShape all sub-shapes of type theShapeType,
5842 situated relatively the specified theCheckShape by the
5843 certain way, defined through theState parameter.
5846 theCheckShape Shape for relative comparing. It must be a solid.
5847 theShape Shape to find sub-shapes of.
5848 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5849 theState The state of the sub-shapes to find (see GEOM::shape_state)
5850 theName Object name; when specified, this parameter is used
5851 for result publication in the study. Otherwise, if automatic
5852 publication is switched on, default value is used for result name.
5855 List of all found sub-shapes.
5857 # Example: see GEOM_TestOthers.py
5858 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
5859 theShapeType, theState)
5860 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
5861 self._autoPublish(aList, theName, "shapeOnShape")
5864 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5865 # situated relatively the specified \a theCheckShape by the
5866 # certain way, defined through \a theState parameter.
5867 # @param theCheckShape Shape for relative comparing. It must be a solid.
5868 # @param theShape Shape to find sub-shapes of.
5869 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5870 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5871 # @param theName Object name; when specified, this parameter is used
5872 # for result publication in the study. Otherwise, if automatic
5873 # publication is switched on, default value is used for result name.
5875 # @return All found sub-shapes as compound.
5877 # @ref swig_GetShapesOnShapeAsCompound "Example"
5878 @ManageTransactions("ShapesOp")
5879 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
5881 Find in theShape all sub-shapes of type theShapeType,
5882 situated relatively the specified theCheckShape by the
5883 certain way, defined through theState parameter.
5886 theCheckShape Shape for relative comparing. It must be a solid.
5887 theShape Shape to find sub-shapes of.
5888 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5889 theState The state of the sub-shapes to find (see GEOM::shape_state)
5890 theName Object name; when specified, this parameter is used
5891 for result publication in the study. Otherwise, if automatic
5892 publication is switched on, default value is used for result name.
5895 All found sub-shapes as compound.
5897 # Example: see GEOM_TestOthers.py
5898 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5899 theShapeType, theState)
5900 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5901 self._autoPublish(anObj, theName, "shapeOnShape")
5904 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5905 # situated relatively the specified \a theCheckShape by the
5906 # certain way, defined through \a theState parameter.
5907 # @param theCheckShape Shape for relative comparing. It must be a solid.
5908 # @param theShape Shape to find sub-shapes of.
5909 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5910 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5912 # @return List of all found sub-shapes indices.
5914 # @ref swig_GetShapesOnShapeIDs "Example"
5915 @ManageTransactions("ShapesOp")
5916 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5918 Find in theShape all sub-shapes of type theShapeType,
5919 situated relatively the specified theCheckShape by the
5920 certain way, defined through theState parameter.
5923 theCheckShape Shape for relative comparing. It must be a solid.
5924 theShape Shape to find sub-shapes of.
5925 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5926 theState The state of the sub-shapes to find (see GEOM::shape_state)
5929 List of all found sub-shapes indices.
5931 # Example: see GEOM_TestOthers.py
5932 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5933 theShapeType, theState)
5934 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5937 ## Get sub-shape(s) of theShapeWhere, which are
5938 # coincident with \a theShapeWhat or could be a part of it.
5939 # @param theShapeWhere Shape to find sub-shapes of.
5940 # @param theShapeWhat Shape, specifying what to find.
5941 # @param isNewImplementation implementation of GetInPlace functionality
5942 # (default = False, old alghorithm based on shape properties)
5943 # @param theName Object name; when specified, this parameter is used
5944 # for result publication in the study. Otherwise, if automatic
5945 # publication is switched on, default value is used for result name.
5947 # @return Compound which includes all found sub-shapes if they have different types;
5948 # or group of all found shapes of the equal type; or a single found sub-shape.
5950 # @note This function has a restriction on argument shapes.
5951 # If \a theShapeWhere has curved parts with significantly
5952 # outstanding centres (i.e. the mass centre of a part is closer to
5953 # \a theShapeWhat than to the part), such parts will not be found.
5954 # @image html get_in_place_lost_part.png
5956 # @ref swig_GetInPlace "Example"
5957 @ManageTransactions("ShapesOp")
5958 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5960 Get sub-shape(s) of theShapeWhere, which are
5961 coincident with theShapeWhat or could be a part of it.
5964 theShapeWhere Shape to find sub-shapes of.
5965 theShapeWhat Shape, specifying what to find.
5966 isNewImplementation Implementation of GetInPlace functionality
5967 (default = False, old alghorithm based on shape properties)
5968 theName Object name; when specified, this parameter is used
5969 for result publication in the study. Otherwise, if automatic
5970 publication is switched on, default value is used for result name.
5973 Compound which includes all found sub-shapes if they have different types;
5974 or group of all found shapes of the equal type; or a single found sub-shape.
5978 This function has a restriction on argument shapes.
5979 If theShapeWhere has curved parts with significantly
5980 outstanding centres (i.e. the mass centre of a part is closer to
5981 theShapeWhat than to the part), such parts will not be found.
5983 # Example: see GEOM_TestOthers.py
5985 if isNewImplementation:
5986 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5988 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5990 RaiseIfFailed("GetInPlace", self.ShapesOp)
5991 self._autoPublish(anObj, theName, "inplace")
5994 ## Get sub-shape(s) of \a theShapeWhere, which are
5995 # coincident with \a theShapeWhat or could be a part of it.
5997 # Implementation of this method is based on a saved history of an operation,
5998 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5999 # arguments (an argument shape or a sub-shape of an argument shape).
6000 # The operation could be the Partition or one of boolean operations,
6001 # performed on simple shapes (not on compounds).
6003 # @param theShapeWhere Shape to find sub-shapes of.
6004 # @param theShapeWhat Shape, specifying what to find (must be in the
6005 # building history of the ShapeWhere).
6006 # @param theName Object name; when specified, this parameter is used
6007 # for result publication in the study. Otherwise, if automatic
6008 # publication is switched on, default value is used for result name.
6010 # @return Compound which includes all found sub-shapes if they have different types;
6011 # or group of all found shapes of the equal type; or a single found sub-shape.
6013 # @ref swig_GetInPlace "Example"
6014 @ManageTransactions("ShapesOp")
6015 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
6017 Implementation of this method is based on a saved history of an operation,
6018 produced theShapeWhere. The theShapeWhat must be among this operation's
6019 arguments (an argument shape or a sub-shape of an argument shape).
6020 The operation could be the Partition or one of boolean operations,
6021 performed on simple shapes (not on compounds).
6024 theShapeWhere Shape to find sub-shapes of.
6025 theShapeWhat Shape, specifying what to find (must be in the
6026 building history of the ShapeWhere).
6027 theName Object name; when specified, this parameter is used
6028 for result publication in the study. Otherwise, if automatic
6029 publication is switched on, default value is used for result name.
6032 Compound which includes all found sub-shapes if they have different types;
6033 or group of all found shapes of the equal type; or a single found sub-shape.
6035 # Example: see GEOM_TestOthers.py
6036 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
6037 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
6038 self._autoPublish(anObj, theName, "inplace")
6041 ## A sort of GetInPlace functionality, returning IDs of sub-shapes.
6042 # For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6043 # IDs of @a theShapeWhere.
6044 # For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6045 # two parts by a plane, then the result can be as this:
6046 # len( result_list ) = 35,
6047 # result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6048 # solids with IDs 2 and 36 within theShapeWhere
6050 # @param theShapeWhere Shape to find sub-shapes of.
6051 # @param theShapeWhat Shape, specifying what to find.
6052 # @return List of lists of sub-shape IDS of theShapeWhere.
6053 def GetInPlaceMap(self, theShapeWhere, theShapeWhat):
6055 A sort of GetInPlace functionality, returning IDs of sub-shapes.
6056 For each sub-shape ID of @a theShapeWhat return a list of corresponding sub-shape
6057 IDs of @a theShapeWhere.
6058 For example, if theShapeWhat is a box and theShapeWhere is this box cut into
6059 two parts by a plane, then the result can be as this:
6060 len( result_list ) = 35,
6061 result_list[ 1 ] = [ 2, 36 ], which means that the box (ID 1) turned into two
6062 solids with IDs 2 and 36 within theShapeWhere
6065 theShapeWhere Shape to find sub-shapes of.
6066 theShapeWhat Shape, specifying what to find.
6069 List of lists of sub-shape IDS of theShapeWhere.
6071 return self.ShapesOp.GetInPlaceMap(theShapeWhere, theShapeWhat)
6073 ## Get sub-shape of theShapeWhere, which is
6074 # equal to \a theShapeWhat.
6075 # @param theShapeWhere Shape to find sub-shape of.
6076 # @param theShapeWhat Shape, specifying what to find.
6077 # @param theName Object name; when specified, this parameter is used
6078 # for result publication in the study. Otherwise, if automatic
6079 # publication is switched on, default value is used for result name.
6081 # @return New GEOM.GEOM_Object for found sub-shape.
6083 # @ref swig_GetSame "Example"
6084 @ManageTransactions("ShapesOp")
6085 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
6087 Get sub-shape of theShapeWhere, which is
6088 equal to theShapeWhat.
6091 theShapeWhere Shape to find sub-shape of.
6092 theShapeWhat Shape, specifying what to find.
6093 theName Object name; when specified, this parameter is used
6094 for result publication in the study. Otherwise, if automatic
6095 publication is switched on, default value is used for result name.
6098 New GEOM.GEOM_Object for found sub-shape.
6100 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
6101 RaiseIfFailed("GetSame", self.ShapesOp)
6102 self._autoPublish(anObj, theName, "sameShape")
6106 ## Get sub-shape indices of theShapeWhere, which is
6107 # equal to \a theShapeWhat.
6108 # @param theShapeWhere Shape to find sub-shape of.
6109 # @param theShapeWhat Shape, specifying what to find.
6110 # @return List of all found sub-shapes indices.
6112 # @ref swig_GetSame "Example"
6113 @ManageTransactions("ShapesOp")
6114 def GetSameIDs(self, theShapeWhere, theShapeWhat):
6116 Get sub-shape indices of theShapeWhere, which is
6117 equal to theShapeWhat.
6120 theShapeWhere Shape to find sub-shape of.
6121 theShapeWhat Shape, specifying what to find.
6124 List of all found sub-shapes indices.
6126 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
6127 RaiseIfFailed("GetSameIDs", self.ShapesOp)
6130 ## Resize the input edge with the new Min and Max parameters.
6131 # The input edge parameters range is [0, 1]. If theMin parameter is
6132 # negative, the input edge is extended, otherwise it is shrinked by
6133 # theMin parameter. If theMax is greater than 1, the edge is extended,
6134 # otherwise it is shrinked by theMax parameter.
6135 # @param theEdge the input edge to be resized.
6136 # @param theMin the minimal parameter value.
6137 # @param theMax the maximal parameter value.
6138 # @param theName Object name; when specified, this parameter is used
6139 # for result publication in the study. Otherwise, if automatic
6140 # publication is switched on, default value is used for result name.
6141 # @return New GEOM.GEOM_Object, containing the created edge.
6143 # @ref tui_extend "Example"
6144 @ManageTransactions("ShapesOp")
6145 def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
6147 Resize the input edge with the new Min and Max parameters.
6148 The input edge parameters range is [0, 1]. If theMin parameter is
6149 negative, the input edge is extended, otherwise it is shrinked by
6150 theMin parameter. If theMax is greater than 1, the edge is extended,
6151 otherwise it is shrinked by theMax parameter.
6154 theEdge the input edge to be resized.
6155 theMin the minimal parameter value.
6156 theMax the maximal parameter value.
6157 theName Object name; when specified, this parameter is used
6158 for result publication in the study. Otherwise, if automatic
6159 publication is switched on, default value is used for result name.
6162 New GEOM.GEOM_Object, containing the created edge.
6164 theMin, theMax, Parameters = ParseParameters(theMin, theMax)
6165 anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
6166 RaiseIfFailed("ExtendEdge", self.ShapesOp)
6167 anObj.SetParameters(Parameters)
6168 self._autoPublish(anObj, theName, "edge")
6171 ## Resize the input face with the new UMin, UMax, VMin and VMax
6172 # parameters. The input face U and V parameters range is [0, 1]. If
6173 # theUMin parameter is negative, the input face is extended, otherwise
6174 # it is shrinked along U direction by theUMin parameter. If theUMax is
6175 # greater than 1, the face is extended, otherwise it is shrinked along
6176 # U direction by theUMax parameter. So as for theVMin, theVMax and
6177 # V direction of the input face.
6178 # @param theFace the input face to be resized.
6179 # @param theUMin the minimal U parameter value.
6180 # @param theUMax the maximal U parameter value.
6181 # @param theVMin the minimal V parameter value.
6182 # @param theVMax the maximal V parameter value.
6183 # @param theName Object name; when specified, this parameter is used
6184 # for result publication in the study. Otherwise, if automatic
6185 # publication is switched on, default value is used for result name.
6186 # @return New GEOM.GEOM_Object, containing the created face.
6188 # @ref tui_extend "Example"
6189 @ManageTransactions("ShapesOp")
6190 def ExtendFace(self, theFace, theUMin, theUMax,
6191 theVMin, theVMax, theName=None):
6193 Resize the input face with the new UMin, UMax, VMin and VMax
6194 parameters. The input face U and V parameters range is [0, 1]. If
6195 theUMin parameter is negative, the input face is extended, otherwise
6196 it is shrinked along U direction by theUMin parameter. If theUMax is
6197 greater than 1, the face is extended, otherwise it is shrinked along
6198 U direction by theUMax parameter. So as for theVMin, theVMax and
6199 V direction of the input face.
6202 theFace the input face to be resized.
6203 theUMin the minimal U parameter value.
6204 theUMax the maximal U parameter value.
6205 theVMin the minimal V parameter value.
6206 theVMax the maximal V parameter value.
6207 theName Object name; when specified, this parameter is used
6208 for result publication in the study. Otherwise, if automatic
6209 publication is switched on, default value is used for result name.
6212 New GEOM.GEOM_Object, containing the created face.
6214 theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
6215 anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
6217 RaiseIfFailed("ExtendFace", self.ShapesOp)
6218 anObj.SetParameters(Parameters)
6219 self._autoPublish(anObj, theName, "face")
6222 ## This function takes some face as input parameter and creates new
6223 # GEOM_Object, i.e. topological shape by extracting underlying surface
6224 # of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6225 # parameters of the source face (in the parametrical space).
6226 # @param theFace the input face.
6227 # @param theName Object name; when specified, this parameter is used
6228 # for result publication in the study. Otherwise, if automatic
6229 # publication is switched on, default value is used for result name.
6230 # @return New GEOM.GEOM_Object, containing the created face.
6232 # @ref tui_creation_surface "Example"
6233 @ManageTransactions("ShapesOp")
6234 def MakeSurfaceFromFace(self, theFace, theName=None):
6236 This function takes some face as input parameter and creates new
6237 GEOM_Object, i.e. topological shape by extracting underlying surface
6238 of the source face and limiting it by the Umin, Umax, Vmin, Vmax
6239 parameters of the source face (in the parametrical space).
6242 theFace the input face.
6243 theName Object name; when specified, this parameter is used
6244 for result publication in the study. Otherwise, if automatic
6245 publication is switched on, default value is used for result name.
6248 New GEOM.GEOM_Object, containing the created face.
6250 anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
6251 RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
6252 self._autoPublish(anObj, theName, "surface")
6258 ## @addtogroup l4_access
6261 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
6262 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6263 # @param aShape Shape to get sub-shape of.
6264 # @param ListOfID List of sub-shapes indices.
6265 # @param theName Object name; when specified, this parameter is used
6266 # for result publication in the study. Otherwise, if automatic
6267 # publication is switched on, default value is used for result name.
6269 # @return Found sub-shape.
6271 # @ref swig_all_decompose "Example"
6272 def GetSubShape(self, aShape, ListOfID, theName=None):
6274 Obtain a composite sub-shape of aShape, composed from sub-shapes
6275 of aShape, selected by their unique IDs inside aShape
6278 aShape Shape to get sub-shape of.
6279 ListOfID List of sub-shapes indices.
6280 theName Object name; when specified, this parameter is used
6281 for result publication in the study. Otherwise, if automatic
6282 publication is switched on, default value is used for result name.
6287 # Example: see GEOM_TestAll.py
6288 anObj = self.AddSubShape(aShape,ListOfID)
6289 self._autoPublish(anObj, theName, "subshape")
6292 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
6293 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
6294 # @param aShape Shape to get sub-shape of.
6295 # @param aSubShape Sub-shapes of aShape.
6296 # @return ID of found sub-shape.
6298 # @ref swig_all_decompose "Example"
6299 @ManageTransactions("LocalOp")
6300 def GetSubShapeID(self, aShape, aSubShape):
6302 Obtain unique ID of sub-shape aSubShape inside aShape
6303 of aShape, selected by their unique IDs inside aShape
6306 aShape Shape to get sub-shape of.
6307 aSubShape Sub-shapes of aShape.
6310 ID of found sub-shape.
6312 # Example: see GEOM_TestAll.py
6313 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
6314 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
6317 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
6318 # This function is provided for performance purpose. The complexity is O(n) with n
6319 # the number of subobjects of aShape
6320 # @param aShape Shape to get sub-shape of.
6321 # @param aSubShapes Sub-shapes of aShape.
6322 # @return list of IDs of found sub-shapes.
6324 # @ref swig_all_decompose "Example"
6325 @ManageTransactions("ShapesOp")
6326 def GetSubShapesIDs(self, aShape, aSubShapes):
6328 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
6329 This function is provided for performance purpose. The complexity is O(n) with n
6330 the number of subobjects of aShape
6333 aShape Shape to get sub-shape of.
6334 aSubShapes Sub-shapes of aShape.
6337 List of IDs of found sub-shape.
6339 # Example: see GEOM_TestAll.py
6340 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
6341 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
6347 ## @addtogroup l4_decompose
6350 ## Get all sub-shapes and groups of \a theShape,
6351 # that were created already by any other methods.
6352 # @param theShape Any shape.
6353 # @param theGroupsOnly If this parameter is TRUE, only groups will be
6354 # returned, else all found sub-shapes and groups.
6355 # @return List of existing sub-objects of \a theShape.
6357 # @ref swig_all_decompose "Example"
6358 @ManageTransactions("ShapesOp")
6359 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
6361 Get all sub-shapes and groups of theShape,
6362 that were created already by any other methods.
6366 theGroupsOnly If this parameter is TRUE, only groups will be
6367 returned, else all found sub-shapes and groups.
6370 List of existing sub-objects of theShape.
6372 # Example: see GEOM_TestAll.py
6373 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
6374 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6377 ## Get all groups of \a theShape,
6378 # that were created already by any other methods.
6379 # @param theShape Any shape.
6380 # @return List of existing groups of \a theShape.
6382 # @ref swig_all_decompose "Example"
6383 @ManageTransactions("ShapesOp")
6384 def GetGroups(self, theShape):
6386 Get all groups of theShape,
6387 that were created already by any other methods.
6393 List of existing groups of theShape.
6395 # Example: see GEOM_TestAll.py
6396 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
6397 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
6400 ## Explode a shape on sub-shapes of a given type.
6401 # If the shape itself matches the type, it is also returned.
6402 # @param aShape Shape to be exploded.
6403 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6404 # @param theName Object name; when specified, this parameter is used
6405 # for result publication in the study. Otherwise, if automatic
6406 # publication is switched on, default value is used for result name.
6408 # @return List of sub-shapes of type theShapeType, contained in theShape.
6410 # @ref swig_all_decompose "Example"
6411 @ManageTransactions("ShapesOp")
6412 def SubShapeAll(self, aShape, aType, theName=None):
6414 Explode a shape on sub-shapes of a given type.
6415 If the shape itself matches the type, it is also returned.
6418 aShape Shape to be exploded.
6419 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6420 theName Object name; when specified, this parameter is used
6421 for result publication in the study. Otherwise, if automatic
6422 publication is switched on, default value is used for result name.
6425 List of sub-shapes of type theShapeType, contained in theShape.
6427 # Example: see GEOM_TestAll.py
6428 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
6429 RaiseIfFailed("SubShapeAll", self.ShapesOp)
6430 self._autoPublish(ListObj, theName, "subshape")
6433 ## Explode a shape on sub-shapes of a given type.
6434 # @param aShape Shape to be exploded.
6435 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6436 # @return List of IDs of sub-shapes.
6438 # @ref swig_all_decompose "Example"
6439 @ManageTransactions("ShapesOp")
6440 def SubShapeAllIDs(self, aShape, aType):
6442 Explode a shape on sub-shapes of a given type.
6445 aShape Shape to be exploded (see geompy.ShapeType)
6446 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6449 List of IDs of sub-shapes.
6451 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
6452 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6455 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6456 # selected by their indices in list of all sub-shapes of type <VAR>aType</VAR>.
6457 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6458 # @param aShape Shape to get sub-shape of.
6459 # @param ListOfInd List of sub-shapes indices.
6460 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6461 # @param theName Object name; when specified, this parameter is used
6462 # for result publication in the study. Otherwise, if automatic
6463 # publication is switched on, default value is used for result name.
6465 # @return A compound of sub-shapes of aShape.
6467 # @ref swig_all_decompose "Example"
6468 def SubShape(self, aShape, aType, ListOfInd, theName=None):
6470 Obtain a compound of sub-shapes of aShape,
6471 selected by their indices in list of all sub-shapes of type aType.
6472 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6475 aShape Shape to get sub-shape of.
6476 ListOfID List of sub-shapes indices.
6477 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6478 theName Object name; when specified, this parameter is used
6479 for result publication in the study. Otherwise, if automatic
6480 publication is switched on, default value is used for result name.
6483 A compound of sub-shapes of aShape.
6485 # Example: see GEOM_TestAll.py
6487 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
6488 for ind in ListOfInd:
6489 ListOfIDs.append(AllShapeIDsList[ind - 1])
6490 # note: auto-publishing is done in self.GetSubShape()
6491 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6494 ## Explode a shape on sub-shapes of a given type.
6495 # Sub-shapes will be sorted taking into account their gravity centers,
6496 # to provide stable order of sub-shapes. Please see
6497 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6498 # If the shape itself matches the type, it is also returned.
6499 # @param aShape Shape to be exploded.
6500 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6501 # @param theName Object name; when specified, this parameter is used
6502 # for result publication in the study. Otherwise, if automatic
6503 # publication is switched on, default value is used for result name.
6505 # @return List of sub-shapes of type theShapeType, contained in theShape.
6507 # @ref swig_SubShapeAllSorted "Example"
6508 @ManageTransactions("ShapesOp")
6509 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
6511 Explode a shape on sub-shapes of a given type.
6512 Sub-shapes will be sorted taking into account their gravity centers,
6513 to provide stable order of sub-shapes.
6514 If the shape itself matches the type, it is also returned.
6517 aShape Shape to be exploded.
6518 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6519 theName Object name; when specified, this parameter is used
6520 for result publication in the study. Otherwise, if automatic
6521 publication is switched on, default value is used for result name.
6524 List of sub-shapes of type theShapeType, contained in theShape.
6526 # Example: see GEOM_TestAll.py
6527 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
6528 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
6529 self._autoPublish(ListObj, theName, "subshape")
6532 ## Explode a shape on sub-shapes of a given type.
6533 # Sub-shapes will be sorted taking into account their gravity centers,
6534 # to provide stable order of sub-shapes. Please see
6535 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6536 # @param aShape Shape to be exploded.
6537 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6538 # @return List of IDs of sub-shapes.
6540 # @ref swig_all_decompose "Example"
6541 @ManageTransactions("ShapesOp")
6542 def SubShapeAllSortedCentresIDs(self, aShape, aType):
6544 Explode a shape on sub-shapes of a given type.
6545 Sub-shapes will be sorted taking into account their gravity centers,
6546 to provide stable order of sub-shapes.
6549 aShape Shape to be exploded.
6550 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6553 List of IDs of sub-shapes.
6555 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
6556 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6559 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
6560 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
6561 # Please see @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6562 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6563 # @param aShape Shape to get sub-shape of.
6564 # @param ListOfInd List of sub-shapes indices.
6565 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
6566 # @param theName Object name; when specified, this parameter is used
6567 # for result publication in the study. Otherwise, if automatic
6568 # publication is switched on, default value is used for result name.
6570 # @return A compound of sub-shapes of aShape.
6572 # @ref swig_all_decompose "Example"
6573 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
6575 Obtain a compound of sub-shapes of aShape,
6576 selected by they indices in sorted list of all sub-shapes of type aType.
6577 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
6580 aShape Shape to get sub-shape of.
6581 ListOfID List of sub-shapes indices.
6582 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
6583 theName Object name; when specified, this parameter is used
6584 for result publication in the study. Otherwise, if automatic
6585 publication is switched on, default value is used for result name.
6588 A compound of sub-shapes of aShape.
6590 # Example: see GEOM_TestAll.py
6592 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
6593 for ind in ListOfInd:
6594 ListOfIDs.append(AllShapeIDsList[ind - 1])
6595 # note: auto-publishing is done in self.GetSubShape()
6596 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6599 ## Extract shapes (excluding the main shape) of given type.
6600 # @param aShape The shape.
6601 # @param aType The shape type (see ShapeType())
6602 # @param isSorted Boolean flag to switch sorting on/off. Please see
6603 # @ref sorting_shapes_page "Description of Sorting Shapes Algorithm".
6604 # @param theName Object name; when specified, this parameter is used
6605 # for result publication in the study. Otherwise, if automatic
6606 # publication is switched on, default value is used for result name.
6608 # @return List of sub-shapes of type aType, contained in aShape.
6610 # @ref swig_FilletChamfer "Example"
6611 @ManageTransactions("ShapesOp")
6612 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
6614 Extract shapes (excluding the main shape) of given type.
6618 aType The shape type (see geompy.ShapeType)
6619 isSorted Boolean flag to switch sorting on/off.
6620 theName Object name; when specified, this parameter is used
6621 for result publication in the study. Otherwise, if automatic
6622 publication is switched on, default value is used for result name.
6625 List of sub-shapes of type aType, contained in aShape.
6627 # Example: see GEOM_TestAll.py
6628 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
6629 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
6630 self._autoPublish(ListObj, theName, "subshape")
6633 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
6634 # @param aShape Main shape.
6635 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
6636 # @param theName Object name; when specified, this parameter is used
6637 # for result publication in the study. Otherwise, if automatic
6638 # publication is switched on, default value is used for result name.
6639 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6641 # @ref swig_all_decompose "Example"
6642 @ManageTransactions("ShapesOp")
6643 def SubShapes(self, aShape, anIDs, theName=None):
6645 Get a set of sub-shapes defined by their unique IDs inside theMainShape
6649 anIDs List of unique IDs of sub-shapes inside theMainShape.
6650 theName Object name; when specified, this parameter is used
6651 for result publication in the study. Otherwise, if automatic
6652 publication is switched on, default value is used for result name.
6655 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
6657 # Example: see GEOM_TestAll.py
6658 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
6659 RaiseIfFailed("SubShapes", self.ShapesOp)
6660 self._autoPublish(ListObj, theName, "subshape")
6663 ## Explode a shape into edges sorted in a row from a starting point.
6664 # @param theShape the shape to be exploded on edges.
6665 # @param theStartPoint the starting point.
6666 # @param theName Object name; when specified, this parameter is used
6667 # for result publication in the study. Otherwise, if automatic
6668 # publication is switched on, default value is used for result name.
6669 # @return List of GEOM.GEOM_Object that is actually an ordered list
6670 # of edges sorted in a row from a starting point.
6672 # @ref swig_GetSubShapeEdgeSorted "Example"
6673 @ManageTransactions("ShapesOp")
6674 def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
6676 Explode a shape into edges sorted in a row from a starting point.
6679 theShape the shape to be exploded on edges.
6680 theStartPoint the starting point.
6681 theName Object name; when specified, this parameter is used
6682 for result publication in the study. Otherwise, if automatic
6683 publication is switched on, default value is used for result name.
6686 List of GEOM.GEOM_Object that is actually an ordered list
6687 of edges sorted in a row from a starting point.
6689 # Example: see GEOM_TestAll.py
6690 ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
6691 RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
6692 self._autoPublish(ListObj, theName, "SortedEdges")
6696 # Return the list of subshapes that satisfies a certain tolerance
6697 # criterion. The user defines the type of shapes to be returned, the
6698 # condition and the tolerance value. The operation is defined for
6699 # faces, edges and vertices only. E.g. for theShapeType FACE,
6700 # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6701 # all faces of theShape that have tolerances greater then 1.e7.
6703 # @param theShape the shape to be exploded
6704 # @param theShapeType the type of sub-shapes to be returned (see
6705 # ShapeType()). Can have the values FACE, EDGE and VERTEX only.
6706 # @param theCondition the condition type (see GEOM::comparison_condition).
6707 # @param theTolerance the tolerance filter.
6708 # @param theName Object name; when specified, this parameter is used
6709 # for result publication in the study. Otherwise, if automatic
6710 # publication is switched on, default value is used for result name.
6711 # @return the list of shapes that satisfy the conditions.
6713 # @ref swig_GetSubShapesWithTolerance "Example"
6714 @ManageTransactions("ShapesOp")
6715 def GetSubShapesWithTolerance(self, theShape, theShapeType,
6716 theCondition, theTolerance, theName=None):
6718 Return the list of subshapes that satisfies a certain tolerance
6719 criterion. The user defines the type of shapes to be returned, the
6720 condition and the tolerance value. The operation is defined for
6721 faces, edges and vertices only. E.g. for theShapeType FACE,
6722 theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
6723 all faces of theShape that have tolerances greater then 1.e7.
6726 theShape the shape to be exploded
6727 theShapeType the type of sub-shapes to be returned (see
6728 ShapeType()). Can have the values FACE,
6729 EDGE and VERTEX only.
6730 theCondition the condition type (see GEOM::comparison_condition).
6731 theTolerance the tolerance filter.
6732 theName Object name; when specified, this parameter is used
6733 for result publication in the study. Otherwise, if automatic
6734 publication is switched on, default value is used for result name.
6737 The list of shapes that satisfy the conditions.
6739 # Example: see GEOM_TestAll.py
6740 ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
6741 theCondition, theTolerance)
6742 RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
6743 self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
6746 ## Check if the object is a sub-object of another GEOM object.
6747 # @param aSubObject Checked sub-object (or its parent object, in case if
6748 # \a theSubObjectIndex is non-zero).
6749 # @param anObject An object that is checked for ownership (or its parent object,
6750 # in case if \a theObjectIndex is non-zero).
6751 # @param aSubObjectIndex When non-zero, specifies a sub-shape index that
6752 # identifies a sub-object within its parent specified via \a theSubObject.
6753 # @param anObjectIndex When non-zero, specifies a sub-shape index that
6754 # identifies an object within its parent specified via \a theObject.
6755 # @return TRUE, if the given object contains sub-object.
6756 @ManageTransactions("ShapesOp")
6757 def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
6759 Check if the object is a sub-object of another GEOM object.
6762 aSubObject Checked sub-object (or its parent object, in case if
6763 \a theSubObjectIndex is non-zero).
6764 anObject An object that is checked for ownership (or its parent object,
6765 in case if \a theObjectIndex is non-zero).
6766 aSubObjectIndex When non-zero, specifies a sub-shape index that
6767 identifies a sub-object within its parent specified via \a theSubObject.
6768 anObjectIndex When non-zero, specifies a sub-shape index that
6769 identifies an object within its parent specified via \a theObject.
6772 TRUE, if the given object contains sub-object.
6774 IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
6775 RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
6778 ## Perform extraction of sub-shapes from the main shape.
6780 # @param theShape the main shape
6781 # @param theListOfID the list of sub-shape IDs to be extracted from
6783 # @return New GEOM.GEOM_Object, containing the shape without
6784 # extracted sub-shapes.
6786 # @ref swig_MakeExtraction "Example"
6787 @ManageTransactions("ShapesOp")
6788 def MakeExtraction(self, theShape, theListOfID, theName=None):
6790 Perform extraction of sub-shapes from the main shape.
6793 theShape the main shape
6794 theListOfID the list of sub-shape IDs to be extracted from
6798 New GEOM.GEOM_Object, containing the shape without
6799 extracted sub-shapes.
6801 # Example: see GEOM_TestAll.py
6802 (anObj, aStat) = self.ShapesOp.MakeExtraction(theShape, theListOfID)
6803 RaiseIfFailed("MakeExtraction", self.ShapesOp)
6804 self._autoPublish(anObj, theName, "Extraction")
6807 # end of l4_decompose
6810 ## @addtogroup l4_decompose_d
6813 ## Deprecated method
6814 # It works like SubShapeAllSortedCentres(), but wrongly
6815 # defines centres of faces, shells and solids.
6816 @ManageTransactions("ShapesOp")
6817 def SubShapeAllSorted(self, aShape, aType, theName=None):
6820 It works like geompy.SubShapeAllSortedCentres, but wrongly
6821 defines centres of faces, shells and solids.
6823 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
6824 RaiseIfFailed("MakeExplode", self.ShapesOp)
6825 self._autoPublish(ListObj, theName, "subshape")
6828 ## Deprecated method
6829 # It works like SubShapeAllSortedCentresIDs(), but wrongly
6830 # defines centres of faces, shells and solids.
6831 @ManageTransactions("ShapesOp")
6832 def SubShapeAllSortedIDs(self, aShape, aType):
6835 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
6836 defines centres of faces, shells and solids.
6838 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
6839 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
6842 ## Deprecated method
6843 # It works like SubShapeSortedCentres(), but has a bug
6844 # (wrongly defines centres of faces, shells and solids).
6845 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
6848 It works like geompy.SubShapeSortedCentres, but has a bug
6849 (wrongly defines centres of faces, shells and solids).
6852 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
6853 for ind in ListOfInd:
6854 ListOfIDs.append(AllShapeIDsList[ind - 1])
6855 # note: auto-publishing is done in self.GetSubShape()
6856 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
6859 # end of l4_decompose_d
6862 ## @addtogroup l3_healing
6865 ## Apply a sequence of Shape Healing operators to the given object.
6866 # @param theShape Shape to be processed.
6867 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
6868 # @param theParameters List of names of parameters
6869 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
6870 # @param theValues List of values of parameters, in the same order
6871 # as parameters are listed in <VAR>theParameters</VAR> list.
6872 # @param theName Object name; when specified, this parameter is used
6873 # for result publication in the study. Otherwise, if automatic
6874 # publication is switched on, default value is used for result name.
6876 # <b> Operators and Parameters: </b> \n
6878 # * \b FixShape - corrects invalid shapes. \n
6879 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
6880 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
6882 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
6883 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
6884 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
6885 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
6886 # - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
6887 # - \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
6888 # - \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
6889 # - \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
6891 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
6892 # surfaces in segments using a certain angle. \n
6893 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6894 # if Angle=180, four if Angle=90, etc). \n
6895 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
6897 # * \b SplitClosedFaces - splits closed faces in segments.
6898 # The number of segments depends on the number of splitting points.\n
6899 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
6901 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
6902 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
6903 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
6904 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
6905 # This and the previous parameters can take the following values:\n
6906 # \b Parametric \b Continuity \n
6907 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
6908 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
6909 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
6910 # ruling out sharp edges).\n
6911 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
6912 # are of the same magnitude).\n
6913 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
6914 # or surfaces (d/du C(u)) are the same at junction. \n
6915 # \b Geometric \b Continuity \n
6916 # \b G1: first derivatives are proportional at junction.\n
6917 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
6918 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
6919 # \b G2: first and second derivatives are proportional at junction.
6920 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
6921 # continuity requires that the underlying parameterization was continuous as well.
6922 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
6924 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
6925 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
6926 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
6927 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
6928 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
6929 # with the specified parameters.\n
6930 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
6931 # with the specified parameters.\n
6932 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
6933 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
6934 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
6935 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
6937 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
6938 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
6939 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
6940 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
6941 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
6943 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
6944 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
6947 # @return New GEOM.GEOM_Object, containing processed shape.
6949 # \n @ref tui_shape_processing "Example"
6950 @ManageTransactions("HealOp")
6951 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
6953 Apply a sequence of Shape Healing operators to the given object.
6956 theShape Shape to be processed.
6957 theValues List of values of parameters, in the same order
6958 as parameters are listed in theParameters list.
6959 theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
6960 theParameters List of names of parameters
6961 ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
6962 theName Object name; when specified, this parameter is used
6963 for result publication in the study. Otherwise, if automatic
6964 publication is switched on, default value is used for result name.
6966 Operators and Parameters:
6968 * FixShape - corrects invalid shapes.
6969 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
6970 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
6971 * FixFaceSize - removes small faces, such as spots and strips.
6972 * FixFaceSize.Tolerance - defines minimum possible face size.
6973 * DropSmallEdges - removes edges, which merge with neighbouring edges.
6974 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
6975 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
6976 * 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.
6977 * 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.
6978 * 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.
6980 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
6981 in segments using a certain angle.
6982 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
6983 if Angle=180, four if Angle=90, etc).
6984 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
6985 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
6987 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
6988 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
6989 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
6990 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
6991 * SplitContinuity.CurveContinuity - required continuity for curves.
6992 This and the previous parameters can take the following values:
6994 Parametric Continuity:
6995 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
6996 coincidental. The curves or surfaces may still meet at an angle,
6997 giving rise to a sharp corner or edge).
6998 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
6999 are parallel, ruling out sharp edges).
7000 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
7001 or surfaces are of the same magnitude).
7002 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
7003 curves or surfaces (d/du C(u)) are the same at junction.
7005 Geometric Continuity:
7006 G1: first derivatives are proportional at junction.
7007 The curve tangents thus have the same direction, but not necessarily the same magnitude.
7008 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
7009 G2: first and second derivatives are proportional at junction. As the names imply,
7010 geometric continuity requires the geometry to be continuous, while parametric continuity requires
7011 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
7012 geometric continuity of order n, but not vice-versa.
7013 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
7014 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
7015 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
7016 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
7017 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
7018 the specified parameters.
7019 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
7020 the specified parameters.
7021 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
7022 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
7023 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
7024 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
7025 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
7026 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
7027 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
7028 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
7029 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
7030 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
7031 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
7034 New GEOM.GEOM_Object, containing processed shape.
7036 Note: For more information look through SALOME Geometry User's Guide->
7037 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
7039 # Example: see GEOM_TestHealing.py
7040 theValues,Parameters = ParseList(theValues)
7041 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
7042 # To avoid script failure in case of good argument shape
7043 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7045 RaiseIfFailed("ProcessShape", self.HealOp)
7046 for string in (theOperators + theParameters):
7047 Parameters = ":" + Parameters
7049 anObj.SetParameters(Parameters)
7050 self._autoPublish(anObj, theName, "healed")
7053 ## Remove faces from the given object (shape).
7054 # @param theObject Shape to be processed.
7055 # @param theFaces Indices of faces to be removed, if EMPTY then the method
7056 # removes ALL faces of the given object.
7057 # @param theName Object name; when specified, this parameter is used
7058 # for result publication in the study. Otherwise, if automatic
7059 # publication is switched on, default value is used for result name.
7061 # @return New GEOM.GEOM_Object, containing processed shape.
7063 # @ref tui_suppress_faces "Example"
7064 @ManageTransactions("HealOp")
7065 def SuppressFaces(self, theObject, theFaces, theName=None):
7067 Remove faces from the given object (shape).
7070 theObject Shape to be processed.
7071 theFaces Indices of faces to be removed, if EMPTY then the method
7072 removes ALL faces of the given object.
7073 theName Object name; when specified, this parameter is used
7074 for result publication in the study. Otherwise, if automatic
7075 publication is switched on, default value is used for result name.
7078 New GEOM.GEOM_Object, containing processed shape.
7080 # Example: see GEOM_TestHealing.py
7081 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
7082 RaiseIfFailed("SuppressFaces", self.HealOp)
7083 self._autoPublish(anObj, theName, "suppressFaces")
7086 ## Sewing of faces into a single shell.
7087 # @param ListShape Shapes to be processed.
7088 # @param theTolerance Required tolerance value.
7089 # @param AllowNonManifold Flag that allows non-manifold sewing.
7090 # @param theName Object name; when specified, this parameter is used
7091 # for result publication in the study. Otherwise, if automatic
7092 # publication is switched on, default value is used for result name.
7094 # @return New GEOM.GEOM_Object, containing a result shell.
7096 # @ref tui_sewing "Example"
7097 def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7099 Sewing of faces into a single shell.
7102 ListShape Shapes to be processed.
7103 theTolerance Required tolerance value.
7104 AllowNonManifold Flag that allows non-manifold sewing.
7105 theName Object name; when specified, this parameter is used
7106 for result publication in the study. Otherwise, if automatic
7107 publication is switched on, default value is used for result name.
7110 New GEOM.GEOM_Object, containing containing a result shell.
7112 # Example: see GEOM_TestHealing.py
7113 # note: auto-publishing is done in self.Sew()
7114 anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
7117 ## Sewing of faces into a single shell.
7118 # @param ListShape Shapes to be processed.
7119 # @param theTolerance Required tolerance value.
7120 # @param AllowNonManifold Flag that allows non-manifold sewing.
7121 # @param theName Object name; when specified, this parameter is used
7122 # for result publication in the study. Otherwise, if automatic
7123 # publication is switched on, default value is used for result name.
7125 # @return New GEOM.GEOM_Object, containing a result shell.
7126 @ManageTransactions("HealOp")
7127 def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
7129 Sewing of faces into a single shell.
7132 ListShape Shapes to be processed.
7133 theTolerance Required tolerance value.
7134 AllowNonManifold Flag that allows non-manifold sewing.
7135 theName Object name; when specified, this parameter is used
7136 for result publication in the study. Otherwise, if automatic
7137 publication is switched on, default value is used for result name.
7140 New GEOM.GEOM_Object, containing a result shell.
7142 # Example: see MakeSewing() above
7143 theTolerance,Parameters = ParseParameters(theTolerance)
7144 if AllowNonManifold:
7145 anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
7147 anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
7148 # To avoid script failure in case of good argument shape
7149 # (Fix of test cases geom/bugs11/L7,L8)
7150 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
7152 RaiseIfFailed("Sew", self.HealOp)
7153 anObj.SetParameters(Parameters)
7154 self._autoPublish(anObj, theName, "sewed")
7157 ## Rebuild the topology of theSolids by removing
7158 # the faces that are shared by several solids.
7159 # @param theSolids A compound or a list of solids to be processed.
7160 # @param theName Object name; when specified, this parameter is used
7161 # for result publication in the study. Otherwise, if automatic
7162 # publication is switched on, default value is used for result name.
7164 # @return New GEOM.GEOM_Object, containing processed shape.
7166 # @ref tui_remove_webs "Example"
7167 @ManageTransactions("HealOp")
7168 def RemoveInternalFaces (self, theSolids, theName=None):
7170 Rebuild the topology of theSolids by removing
7171 the faces that are shared by several solids.
7174 theSolids A compound or a list of solids to be processed.
7175 theName Object name; when specified, this parameter is used
7176 for result publication in the study. Otherwise, if automatic
7177 publication is switched on, default value is used for result name.
7180 New GEOM.GEOM_Object, containing processed shape.
7182 # Example: see GEOM_TestHealing.py
7183 anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
7184 RaiseIfFailed("RemoveInternalFaces", self.HealOp)
7185 self._autoPublish(anObj, theName, "removeWebs")
7188 ## Remove internal wires and edges from the given object (face).
7189 # @param theObject Shape to be processed.
7190 # @param theWires Indices of wires to be removed, if EMPTY then the method
7191 # removes ALL internal wires of the given object.
7192 # @param theName Object name; when specified, this parameter is used
7193 # for result publication in the study. Otherwise, if automatic
7194 # publication is switched on, default value is used for result name.
7196 # @return New GEOM.GEOM_Object, containing processed shape.
7198 # @ref tui_suppress_internal_wires "Example"
7199 @ManageTransactions("HealOp")
7200 def SuppressInternalWires(self, theObject, theWires, theName=None):
7202 Remove internal wires and edges from the given object (face).
7205 theObject Shape to be processed.
7206 theWires Indices of wires to be removed, if EMPTY then the method
7207 removes ALL internal wires of the given object.
7208 theName Object name; when specified, this parameter is used
7209 for result publication in the study. Otherwise, if automatic
7210 publication is switched on, default value is used for result name.
7213 New GEOM.GEOM_Object, containing processed shape.
7215 # Example: see GEOM_TestHealing.py
7216 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
7217 RaiseIfFailed("RemoveIntWires", self.HealOp)
7218 self._autoPublish(anObj, theName, "suppressWires")
7221 ## Remove internal closed contours (holes) from the given object.
7222 # @param theObject Shape to be processed.
7223 # @param theWires Indices of wires to be removed, if EMPTY then the method
7224 # removes ALL internal holes of the given object
7225 # @param theName Object name; when specified, this parameter is used
7226 # for result publication in the study. Otherwise, if automatic
7227 # publication is switched on, default value is used for result name.
7229 # @return New GEOM.GEOM_Object, containing processed shape.
7231 # @ref tui_suppress_holes "Example"
7232 @ManageTransactions("HealOp")
7233 def SuppressHoles(self, theObject, theWires, theName=None):
7235 Remove internal closed contours (holes) from the given object.
7238 theObject Shape to be processed.
7239 theWires Indices of wires to be removed, if EMPTY then the method
7240 removes ALL internal holes of the given object
7241 theName Object name; when specified, this parameter is used
7242 for result publication in the study. Otherwise, if automatic
7243 publication is switched on, default value is used for result name.
7246 New GEOM.GEOM_Object, containing processed shape.
7248 # Example: see GEOM_TestHealing.py
7249 anObj = self.HealOp.FillHoles(theObject, theWires)
7250 RaiseIfFailed("FillHoles", self.HealOp)
7251 self._autoPublish(anObj, theName, "suppressHoles")
7254 ## Close an open wire.
7255 # @param theObject Shape to be processed.
7256 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
7257 # if [ ], then <VAR>theObject</VAR> itself is a wire.
7258 # @param isCommonVertex If True : closure by creation of a common vertex,
7259 # If False : closure by creation of an edge between ends.
7260 # @param theName Object name; when specified, this parameter is used
7261 # for result publication in the study. Otherwise, if automatic
7262 # publication is switched on, default value is used for result name.
7264 # @return New GEOM.GEOM_Object, containing processed shape.
7266 # @ref tui_close_contour "Example"
7267 @ManageTransactions("HealOp")
7268 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
7273 theObject Shape to be processed.
7274 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
7275 if [ ], then theObject itself is a wire.
7276 isCommonVertex If True : closure by creation of a common vertex,
7277 If False : closure by creation of an edge between ends.
7278 theName Object name; when specified, this parameter is used
7279 for result publication in the study. Otherwise, if automatic
7280 publication is switched on, default value is used for result name.
7283 New GEOM.GEOM_Object, containing processed shape.
7285 # Example: see GEOM_TestHealing.py
7286 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
7287 RaiseIfFailed("CloseContour", self.HealOp)
7288 self._autoPublish(anObj, theName, "closeContour")
7291 ## Addition of a point to a given edge object.
7292 # @param theObject Shape to be processed.
7293 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7294 # if -1, then theObject itself is the edge.
7295 # @param theValue Value of parameter on edge or length parameter,
7296 # depending on \a isByParameter.
7297 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
7298 # if FALSE : \a theValue is treated as a length parameter [0..1]
7299 # @param theName Object name; when specified, this parameter is used
7300 # for result publication in the study. Otherwise, if automatic
7301 # publication is switched on, default value is used for result name.
7303 # @return New GEOM.GEOM_Object, containing processed shape.
7305 # @ref tui_add_point_on_edge "Example"
7306 @ManageTransactions("HealOp")
7307 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
7309 Addition of a point to a given edge object.
7312 theObject Shape to be processed.
7313 theEdgeIndex Index of edge to be divided within theObject's shape,
7314 if -1, then theObject itself is the edge.
7315 theValue Value of parameter on edge or length parameter,
7316 depending on isByParameter.
7317 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
7318 if FALSE : theValue is treated as a length parameter [0..1]
7319 theName Object name; when specified, this parameter is used
7320 for result publication in the study. Otherwise, if automatic
7321 publication is switched on, default value is used for result name.
7324 New GEOM.GEOM_Object, containing processed shape.
7326 # Example: see GEOM_TestHealing.py
7327 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
7328 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
7329 RaiseIfFailed("DivideEdge", self.HealOp)
7330 anObj.SetParameters(Parameters)
7331 self._autoPublish(anObj, theName, "divideEdge")
7334 ## Addition of points to a given edge of \a theObject by projecting
7335 # other points to the given edge.
7336 # @param theObject Shape to be processed.
7337 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
7338 # if -1, then theObject itself is the edge.
7339 # @param thePoints List of points to project to theEdgeIndex-th edge.
7340 # @param theName Object name; when specified, this parameter is used
7341 # for result publication in the study. Otherwise, if automatic
7342 # publication is switched on, default value is used for result name.
7344 # @return New GEOM.GEOM_Object, containing processed shape.
7346 # @ref tui_add_point_on_edge "Example"
7347 @ManageTransactions("HealOp")
7348 def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
7350 Addition of points to a given edge of \a theObject by projecting
7351 other points to the given edge.
7354 theObject Shape to be processed.
7355 theEdgeIndex The edge or its index to be divided within theObject's shape,
7356 if -1, then theObject itself is the edge.
7357 thePoints List of points to project to theEdgeIndex-th edge.
7358 theName Object name; when specified, this parameter is used
7359 for result publication in the study. Otherwise, if automatic
7360 publication is switched on, default value is used for result name.
7363 New GEOM.GEOM_Object, containing processed shape.
7365 # Example: see GEOM_TestHealing.py
7366 if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
7367 theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
7368 anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
7369 RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
7370 self._autoPublish(anObj, theName, "divideEdge")
7373 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7374 # @param theWire Wire to minimize the number of C1 continuous edges in.
7375 # @param theVertices A list of vertices to suppress. If the list
7376 # is empty, all vertices in a wire will be assumed.
7377 # @param theName Object name; when specified, this parameter is used
7378 # for result publication in the study. Otherwise, if automatic
7379 # publication is switched on, default value is used for result name.
7381 # @return New GEOM.GEOM_Object with modified wire.
7383 # @ref tui_fuse_collinear_edges "Example"
7384 @ManageTransactions("HealOp")
7385 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
7387 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
7390 theWire Wire to minimize the number of C1 continuous edges in.
7391 theVertices A list of vertices to suppress. If the list
7392 is empty, all vertices in a wire will be assumed.
7393 theName Object name; when specified, this parameter is used
7394 for result publication in the study. Otherwise, if automatic
7395 publication is switched on, default value is used for result name.
7398 New GEOM.GEOM_Object with modified wire.
7400 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
7401 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
7402 self._autoPublish(anObj, theName, "fuseEdges")
7405 ## Change orientation of the given object. Updates given shape.
7406 # @param theObject Shape to be processed.
7407 # @return Updated <var>theObject</var>
7409 # @ref swig_todo "Example"
7410 @ManageTransactions("HealOp")
7411 def ChangeOrientationShell(self,theObject):
7413 Change orientation of the given object. Updates given shape.
7416 theObject Shape to be processed.
7421 theObject = self.HealOp.ChangeOrientation(theObject)
7422 RaiseIfFailed("ChangeOrientation", self.HealOp)
7425 ## Change orientation of the given object.
7426 # @param theObject Shape to be processed.
7427 # @param theName Object name; when specified, this parameter is used
7428 # for result publication in the study. Otherwise, if automatic
7429 # publication is switched on, default value is used for result name.
7431 # @return New GEOM.GEOM_Object, containing processed shape.
7433 # @ref swig_todo "Example"
7434 @ManageTransactions("HealOp")
7435 def ChangeOrientationShellCopy(self, theObject, theName=None):
7437 Change orientation of the given object.
7440 theObject Shape to be processed.
7441 theName Object name; when specified, this parameter is used
7442 for result publication in the study. Otherwise, if automatic
7443 publication is switched on, default value is used for result name.
7446 New GEOM.GEOM_Object, containing processed shape.
7448 anObj = self.HealOp.ChangeOrientationCopy(theObject)
7449 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
7450 self._autoPublish(anObj, theName, "reversed")
7453 ## Try to limit tolerance of the given object by value \a theTolerance.
7454 # @param theObject Shape to be processed.
7455 # @param theTolerance Required tolerance value.
7456 # @param theName Object name; when specified, this parameter is used
7457 # for result publication in the study. Otherwise, if automatic
7458 # publication is switched on, default value is used for result name.
7460 # @return New GEOM.GEOM_Object, containing processed shape.
7462 # @ref tui_limit_tolerance "Example"
7463 @ManageTransactions("HealOp")
7464 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
7466 Try to limit tolerance of the given object by value theTolerance.
7469 theObject Shape to be processed.
7470 theTolerance Required tolerance value.
7471 theName Object name; when specified, this parameter is used
7472 for result publication in the study. Otherwise, if automatic
7473 publication is switched on, default value is used for result name.
7476 New GEOM.GEOM_Object, containing processed shape.
7478 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
7479 RaiseIfFailed("LimitTolerance", self.HealOp)
7480 self._autoPublish(anObj, theName, "limitTolerance")
7483 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7484 # that constitute a free boundary of the given shape.
7485 # @param theObject Shape to get free boundary of.
7486 # @param theName Object name; when specified, this parameter is used
7487 # for result publication in the study. Otherwise, if automatic
7488 # publication is switched on, default value is used for result name.
7490 # @return [\a status, \a theClosedWires, \a theOpenWires]
7491 # \n \a status: FALSE, if an error(s) occurred during the method execution.
7492 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
7493 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
7495 # @ref tui_free_boundaries_page "Example"
7496 @ManageTransactions("HealOp")
7497 def GetFreeBoundary(self, theObject, theName=None):
7499 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
7500 that constitute a free boundary of the given shape.
7503 theObject Shape to get free boundary of.
7504 theName Object name; when specified, this parameter is used
7505 for result publication in the study. Otherwise, if automatic
7506 publication is switched on, default value is used for result name.
7509 [status, theClosedWires, theOpenWires]
7510 status: FALSE, if an error(s) occurred during the method execution.
7511 theClosedWires: Closed wires on the free boundary of the given shape.
7512 theOpenWires: Open wires on the free boundary of the given shape.
7514 # Example: see GEOM_TestHealing.py
7515 anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
7516 RaiseIfFailed("GetFreeBoundary", self.HealOp)
7517 self._autoPublish(anObj[1], theName, "closedWire")
7518 self._autoPublish(anObj[2], theName, "openWire")
7521 ## Replace coincident faces in \a theShapes by one face.
7522 # @param theShapes Initial shapes, either a list or compound of shapes.
7523 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
7524 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7525 # otherwise all initial shapes.
7526 # @param theName Object name; when specified, this parameter is used
7527 # for result publication in the study. Otherwise, if automatic
7528 # publication is switched on, default value is used for result name.
7530 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7532 # @ref tui_glue_faces "Example"
7533 @ManageTransactions("ShapesOp")
7534 def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
7536 Replace coincident faces in theShapes by one face.
7539 theShapes Initial shapes, either a list or compound of shapes.
7540 theTolerance Maximum distance between faces, which can be considered as coincident.
7541 doKeepNonSolids If FALSE, only solids will present in the result,
7542 otherwise all initial shapes.
7543 theName Object name; when specified, this parameter is used
7544 for result publication in the study. Otherwise, if automatic
7545 publication is switched on, default value is used for result name.
7548 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7550 # Example: see GEOM_Spanner.py
7551 theTolerance,Parameters = ParseParameters(theTolerance)
7552 anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
7554 raise RuntimeError("MakeGlueFaces : " + self.ShapesOp.GetErrorCode())
7555 anObj.SetParameters(Parameters)
7556 self._autoPublish(anObj, theName, "glueFaces")
7559 ## Find coincident faces in \a theShapes for possible gluing.
7560 # @param theShapes Initial shapes, either a list or compound of shapes.
7561 # @param theTolerance Maximum distance between faces,
7562 # which can be considered as coincident.
7563 # @param theName Object name; when specified, this parameter is used
7564 # for result publication in the study. Otherwise, if automatic
7565 # publication is switched on, default value is used for result name.
7567 # @return GEOM.ListOfGO
7569 # @ref tui_glue_faces "Example"
7570 @ManageTransactions("ShapesOp")
7571 def GetGlueFaces(self, theShapes, theTolerance, theName=None):
7573 Find coincident faces in theShapes for possible gluing.
7576 theShapes Initial shapes, either a list or compound of shapes.
7577 theTolerance Maximum distance between faces,
7578 which can be considered as coincident.
7579 theName Object name; when specified, this parameter is used
7580 for result publication in the study. Otherwise, if automatic
7581 publication is switched on, default value is used for result name.
7586 anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
7587 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
7588 self._autoPublish(anObj, theName, "facesToGlue")
7591 ## Replace coincident faces in \a theShapes by one face
7592 # in compliance with given list of faces
7593 # @param theShapes Initial shapes, either a list or compound of shapes.
7594 # @param theTolerance Maximum distance between faces,
7595 # which can be considered as coincident.
7596 # @param theFaces List of faces for gluing.
7597 # @param doKeepNonSolids If FALSE, only solids will present in the result,
7598 # otherwise all initial shapes.
7599 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
7600 # will be glued, otherwise only the edges,
7601 # belonging to <VAR>theFaces</VAR>.
7602 # @param theName Object name; when specified, this parameter is used
7603 # for result publication in the study. Otherwise, if automatic
7604 # publication is switched on, default value is used for result name.
7606 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7608 # @ref tui_glue_faces "Example"
7609 @ManageTransactions("ShapesOp")
7610 def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
7611 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
7613 Replace coincident faces in theShapes by one face
7614 in compliance with given list of faces
7617 theShapes theShapes Initial shapes, either a list or compound of shapes.
7618 theTolerance Maximum distance between faces,
7619 which can be considered as coincident.
7620 theFaces List of faces for gluing.
7621 doKeepNonSolids If FALSE, only solids will present in the result,
7622 otherwise all initial shapes.
7623 doGlueAllEdges If TRUE, all coincident edges of theShape
7624 will be glued, otherwise only the edges,
7625 belonging to theFaces.
7626 theName Object name; when specified, this parameter is used
7627 for result publication in the study. Otherwise, if automatic
7628 publication is switched on, default value is used for result name.
7631 New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
7633 anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
7634 doKeepNonSolids, doGlueAllEdges)
7636 raise RuntimeError("MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode())
7637 self._autoPublish(anObj, theName, "glueFaces")
7640 ## Replace coincident edges in \a theShapes by one edge.
7641 # @param theShapes Initial shapes, either a list or compound of shapes.
7642 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
7643 # @param theName Object name; when specified, this parameter is used
7644 # for result publication in the study. Otherwise, if automatic
7645 # publication is switched on, default value is used for result name.
7647 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7649 # @ref tui_glue_edges "Example"
7650 @ManageTransactions("ShapesOp")
7651 def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
7653 Replace coincident edges in theShapes by one edge.
7656 theShapes Initial shapes, either a list or compound of shapes.
7657 theTolerance Maximum distance between edges, which can be considered as coincident.
7658 theName Object name; when specified, this parameter is used
7659 for result publication in the study. Otherwise, if automatic
7660 publication is switched on, default value is used for result name.
7663 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7665 theTolerance,Parameters = ParseParameters(theTolerance)
7666 anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
7668 raise RuntimeError("MakeGlueEdges : " + self.ShapesOp.GetErrorCode())
7669 anObj.SetParameters(Parameters)
7670 self._autoPublish(anObj, theName, "glueEdges")
7673 ## Find coincident edges in \a theShapes for possible gluing.
7674 # @param theShapes Initial shapes, either a list or compound of shapes.
7675 # @param theTolerance Maximum distance between edges,
7676 # which can be considered as coincident.
7677 # @param theName Object name; when specified, this parameter is used
7678 # for result publication in the study. Otherwise, if automatic
7679 # publication is switched on, default value is used for result name.
7681 # @return GEOM.ListOfGO
7683 # @ref tui_glue_edges "Example"
7684 @ManageTransactions("ShapesOp")
7685 def GetGlueEdges(self, theShapes, theTolerance, theName=None):
7687 Find coincident edges in theShapes for possible gluing.
7690 theShapes Initial shapes, either a list or compound of shapes.
7691 theTolerance Maximum distance between edges,
7692 which can be considered as coincident.
7693 theName Object name; when specified, this parameter is used
7694 for result publication in the study. Otherwise, if automatic
7695 publication is switched on, default value is used for result name.
7700 anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
7701 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
7702 self._autoPublish(anObj, theName, "edgesToGlue")
7705 ## Replace coincident edges in theShapes by one edge
7706 # in compliance with given list of edges.
7707 # @param theShapes Initial shapes, either a list or compound of shapes.
7708 # @param theTolerance Maximum distance between edges,
7709 # which can be considered as coincident.
7710 # @param theEdges List of edges for gluing.
7711 # @param theName Object name; when specified, this parameter is used
7712 # for result publication in the study. Otherwise, if automatic
7713 # publication is switched on, default value is used for result name.
7715 # @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7717 # @ref tui_glue_edges "Example"
7718 @ManageTransactions("ShapesOp")
7719 def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
7721 Replace coincident edges in theShapes by one edge
7722 in compliance with given list of edges.
7725 theShapes Initial shapes, either a list or compound of shapes.
7726 theTolerance Maximum distance between edges,
7727 which can be considered as coincident.
7728 theEdges List of edges for gluing.
7729 theName Object name; when specified, this parameter is used
7730 for result publication in the study. Otherwise, if automatic
7731 publication is switched on, default value is used for result name.
7734 New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
7736 anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
7738 raise RuntimeError("MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode())
7739 self._autoPublish(anObj, theName, "glueEdges")
7745 ## @addtogroup l3_boolean Boolean Operations
7748 # -----------------------------------------------------------------------------
7749 # Boolean (Common, Cut, Fuse, Section)
7750 # -----------------------------------------------------------------------------
7752 ## Perform one of boolean operations on two given shapes.
7753 # @param theShape1 First argument for boolean operation.
7754 # @param theShape2 Second argument for boolean operation.
7755 # @param theOperation Indicates the operation to be done:\n
7756 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7757 # @param checkSelfInte The flag that tells if the arguments should
7758 # be checked for self-intersection prior to the operation.
7759 # @param theName Object name; when specified, this parameter is used
7760 # for result publication in the study. Otherwise, if automatic
7761 # publication is switched on, default value is used for result name.
7763 # @note This algorithm doesn't find all types of self-intersections.
7764 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7765 # vertex/face and edge/face intersections. Face/face
7766 # intersections detection is switched off as it is a
7767 # time-consuming operation that gives an impact on performance.
7768 # To find all self-intersections please use
7769 # CheckSelfIntersections() method.
7771 # @return New GEOM.GEOM_Object, containing the result shape.
7773 # @ref tui_fuse "Example"
7774 @ManageTransactions("BoolOp")
7775 def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
7777 Perform one of boolean operations on two given shapes.
7780 theShape1 First argument for boolean operation.
7781 theShape2 Second argument for boolean operation.
7782 theOperation Indicates the operation to be done:
7783 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
7784 checkSelfInte The flag that tells if the arguments should
7785 be checked for self-intersection prior to
7787 theName Object name; when specified, this parameter is used
7788 for result publication in the study. Otherwise, if automatic
7789 publication is switched on, default value is used for result name.
7792 This algorithm doesn't find all types of self-intersections.
7793 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7794 vertex/face and edge/face intersections. Face/face
7795 intersections detection is switched off as it is a
7796 time-consuming operation that gives an impact on performance.
7797 To find all self-intersections please use
7798 CheckSelfIntersections() method.
7801 New GEOM.GEOM_Object, containing the result shape.
7803 # Example: see GEOM_TestAll.py
7804 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
7805 RaiseIfFailed("MakeBoolean", self.BoolOp)
7806 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
7807 self._autoPublish(anObj, theName, def_names[theOperation])
7810 ## Perform Common boolean operation on two given shapes.
7811 # @param theShape1 First argument for boolean operation.
7812 # @param theShape2 Second argument for boolean operation.
7813 # @param checkSelfInte The flag that tells if the arguments should
7814 # be checked for self-intersection prior to the operation.
7815 # @param theName Object name; when specified, this parameter is used
7816 # for result publication in the study. Otherwise, if automatic
7817 # publication is switched on, default value is used for result name.
7819 # @note This algorithm doesn't find all types of self-intersections.
7820 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7821 # vertex/face and edge/face intersections. Face/face
7822 # intersections detection is switched off as it is a
7823 # time-consuming operation that gives an impact on performance.
7824 # To find all self-intersections please use
7825 # CheckSelfIntersections() method.
7827 # @return New GEOM.GEOM_Object, containing the result shape.
7829 # @ref tui_common "Example 1"
7830 # \n @ref swig_MakeCommon "Example 2"
7831 def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7833 Perform Common boolean operation on two given shapes.
7836 theShape1 First argument for boolean operation.
7837 theShape2 Second argument for boolean operation.
7838 checkSelfInte The flag that tells if the arguments should
7839 be checked for self-intersection prior to
7841 theName Object name; when specified, this parameter is used
7842 for result publication in the study. Otherwise, if automatic
7843 publication is switched on, default value is used for result name.
7846 This algorithm doesn't find all types of self-intersections.
7847 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7848 vertex/face and edge/face intersections. Face/face
7849 intersections detection is switched off as it is a
7850 time-consuming operation that gives an impact on performance.
7851 To find all self-intersections please use
7852 CheckSelfIntersections() method.
7855 New GEOM.GEOM_Object, containing the result shape.
7857 # Example: see GEOM_TestOthers.py
7858 # note: auto-publishing is done in self.MakeBoolean()
7859 return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
7861 ## Perform Cut boolean operation on two given shapes.
7862 # @param theShape1 First argument for boolean operation.
7863 # @param theShape2 Second argument for boolean operation.
7864 # @param checkSelfInte The flag that tells if the arguments should
7865 # be checked for self-intersection prior to the operation.
7866 # @param theName Object name; when specified, this parameter is used
7867 # for result publication in the study. Otherwise, if automatic
7868 # publication is switched on, default value is used for result name.
7870 # @note This algorithm doesn't find all types of self-intersections.
7871 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7872 # vertex/face and edge/face intersections. Face/face
7873 # intersections detection is switched off as it is a
7874 # time-consuming operation that gives an impact on performance.
7875 # To find all self-intersections please use
7876 # CheckSelfIntersections() method.
7878 # @return New GEOM.GEOM_Object, containing the result shape.
7880 # @ref tui_cut "Example 1"
7881 # \n @ref swig_MakeCommon "Example 2"
7882 def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7884 Perform Cut boolean operation on two given shapes.
7887 theShape1 First argument for boolean operation.
7888 theShape2 Second argument for boolean operation.
7889 checkSelfInte The flag that tells if the arguments should
7890 be checked for self-intersection prior to
7892 theName Object name; when specified, this parameter is used
7893 for result publication in the study. Otherwise, if automatic
7894 publication is switched on, default value is used for result name.
7897 This algorithm doesn't find all types of self-intersections.
7898 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7899 vertex/face and edge/face intersections. Face/face
7900 intersections detection is switched off as it is a
7901 time-consuming operation that gives an impact on performance.
7902 To find all self-intersections please use
7903 CheckSelfIntersections() method.
7906 New GEOM.GEOM_Object, containing the result shape.
7909 # Example: see GEOM_TestOthers.py
7910 # note: auto-publishing is done in self.MakeBoolean()
7911 return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
7913 ## Perform Fuse boolean operation on two given shapes.
7914 # @param theShape1 First argument for boolean operation.
7915 # @param theShape2 Second argument for boolean operation.
7916 # @param checkSelfInte The flag that tells if the arguments should
7917 # be checked for self-intersection prior to the operation.
7918 # @param rmExtraEdges The flag that tells if Remove Extra Edges
7919 # operation should be performed during the operation.
7920 # @param theName Object name; when specified, this parameter is used
7921 # for result publication in the study. Otherwise, if automatic
7922 # publication is switched on, default value is used for result name.
7924 # @note This algorithm doesn't find all types of self-intersections.
7925 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7926 # vertex/face and edge/face intersections. Face/face
7927 # intersections detection is switched off as it is a
7928 # time-consuming operation that gives an impact on performance.
7929 # To find all self-intersections please use
7930 # CheckSelfIntersections() method.
7932 # @return New GEOM.GEOM_Object, containing the result shape.
7934 # @ref tui_fuse "Example 1"
7935 # \n @ref swig_MakeCommon "Example 2"
7936 @ManageTransactions("BoolOp")
7937 def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
7938 rmExtraEdges=False, theName=None):
7940 Perform Fuse boolean operation on two given shapes.
7943 theShape1 First argument for boolean operation.
7944 theShape2 Second argument for boolean operation.
7945 checkSelfInte The flag that tells if the arguments should
7946 be checked for self-intersection prior to
7948 rmExtraEdges The flag that tells if Remove Extra Edges
7949 operation should be performed during the operation.
7950 theName Object name; when specified, this parameter is used
7951 for result publication in the study. Otherwise, if automatic
7952 publication is switched on, default value is used for result name.
7955 This algorithm doesn't find all types of self-intersections.
7956 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
7957 vertex/face and edge/face intersections. Face/face
7958 intersections detection is switched off as it is a
7959 time-consuming operation that gives an impact on performance.
7960 To find all self-intersections please use
7961 CheckSelfIntersections() method.
7964 New GEOM.GEOM_Object, containing the result shape.
7967 # Example: see GEOM_TestOthers.py
7968 anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
7969 checkSelfInte, rmExtraEdges)
7970 RaiseIfFailed("MakeFuse", self.BoolOp)
7971 self._autoPublish(anObj, theName, "fuse")
7974 ## Perform Section boolean operation on two given shapes.
7975 # @param theShape1 First argument for boolean operation.
7976 # @param theShape2 Second argument for boolean operation.
7977 # @param checkSelfInte The flag that tells if the arguments should
7978 # be checked for self-intersection prior to the operation.
7979 # If a self-intersection detected the operation fails.
7980 # @param theName Object name; when specified, this parameter is used
7981 # for result publication in the study. Otherwise, if automatic
7982 # publication is switched on, default value is used for result name.
7983 # @return New GEOM.GEOM_Object, containing the result shape.
7985 # @ref tui_section "Example 1"
7986 # \n @ref swig_MakeCommon "Example 2"
7987 def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
7989 Perform Section boolean operation on two given shapes.
7992 theShape1 First argument for boolean operation.
7993 theShape2 Second argument for boolean operation.
7994 checkSelfInte The flag that tells if the arguments should
7995 be checked for self-intersection prior to the operation.
7996 If a self-intersection detected the operation fails.
7997 theName Object name; when specified, this parameter is used
7998 for result publication in the study. Otherwise, if automatic
7999 publication is switched on, default value is used for result name.
8001 New GEOM.GEOM_Object, containing the result shape.
8004 # Example: see GEOM_TestOthers.py
8005 # note: auto-publishing is done in self.MakeBoolean()
8006 return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
8008 ## Perform Fuse boolean operation on the list of shapes.
8009 # @param theShapesList Shapes to be fused.
8010 # @param checkSelfInte The flag that tells if the arguments should
8011 # be checked for self-intersection prior to the operation.
8012 # @param rmExtraEdges The flag that tells if Remove Extra Edges
8013 # operation should be performed during the operation.
8014 # @param theName Object name; when specified, this parameter is used
8015 # for result publication in the study. Otherwise, if automatic
8016 # publication is switched on, default value is used for result name.
8018 # @note This algorithm doesn't find all types of self-intersections.
8019 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8020 # vertex/face and edge/face intersections. Face/face
8021 # intersections detection is switched off as it is a
8022 # time-consuming operation that gives an impact on performance.
8023 # To find all self-intersections please use
8024 # CheckSelfIntersections() method.
8026 # @return New GEOM.GEOM_Object, containing the result shape.
8028 # @ref tui_fuse "Example 1"
8029 # \n @ref swig_MakeCommon "Example 2"
8030 @ManageTransactions("BoolOp")
8031 def MakeFuseList(self, theShapesList, checkSelfInte=False,
8032 rmExtraEdges=False, theName=None):
8034 Perform Fuse boolean operation on the list of shapes.
8037 theShapesList Shapes to be fused.
8038 checkSelfInte The flag that tells if the arguments should
8039 be checked for self-intersection prior to
8041 rmExtraEdges The flag that tells if Remove Extra Edges
8042 operation should be performed during the operation.
8043 theName Object name; when specified, this parameter is used
8044 for result publication in the study. Otherwise, if automatic
8045 publication is switched on, default value is used for result name.
8048 This algorithm doesn't find all types of self-intersections.
8049 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8050 vertex/face and edge/face intersections. Face/face
8051 intersections detection is switched off as it is a
8052 time-consuming operation that gives an impact on performance.
8053 To find all self-intersections please use
8054 CheckSelfIntersections() method.
8057 New GEOM.GEOM_Object, containing the result shape.
8060 # Example: see GEOM_TestOthers.py
8061 anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
8063 RaiseIfFailed("MakeFuseList", self.BoolOp)
8064 self._autoPublish(anObj, theName, "fuse")
8067 ## Perform Common boolean operation on the list of shapes.
8068 # @param theShapesList Shapes for Common operation.
8069 # @param checkSelfInte The flag that tells if the arguments should
8070 # be checked for self-intersection prior to the operation.
8071 # @param theName Object name; when specified, this parameter is used
8072 # for result publication in the study. Otherwise, if automatic
8073 # publication is switched on, default value is used for result name.
8075 # @note This algorithm doesn't find all types of self-intersections.
8076 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8077 # vertex/face and edge/face intersections. Face/face
8078 # intersections detection is switched off as it is a
8079 # time-consuming operation that gives an impact on performance.
8080 # To find all self-intersections please use
8081 # CheckSelfIntersections() method.
8083 # @return New GEOM.GEOM_Object, containing the result shape.
8085 # @ref tui_common "Example 1"
8086 # \n @ref swig_MakeCommon "Example 2"
8087 @ManageTransactions("BoolOp")
8088 def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
8090 Perform Common boolean operation on the list of shapes.
8093 theShapesList Shapes for Common operation.
8094 checkSelfInte The flag that tells if the arguments should
8095 be checked for self-intersection prior to
8097 theName Object name; when specified, this parameter is used
8098 for result publication in the study. Otherwise, if automatic
8099 publication is switched on, default value is used for result name.
8102 This algorithm doesn't find all types of self-intersections.
8103 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8104 vertex/face and edge/face intersections. Face/face
8105 intersections detection is switched off as it is a
8106 time-consuming operation that gives an impact on performance.
8107 To find all self-intersections please use
8108 CheckSelfIntersections() method.
8111 New GEOM.GEOM_Object, containing the result shape.
8114 # Example: see GEOM_TestOthers.py
8115 anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
8116 RaiseIfFailed("MakeCommonList", self.BoolOp)
8117 self._autoPublish(anObj, theName, "common")
8120 ## Perform Cut boolean operation on one object and the list of tools.
8121 # @param theMainShape The object of the operation.
8122 # @param theShapesList The list of tools of the operation.
8123 # @param checkSelfInte The flag that tells if the arguments should
8124 # be checked for self-intersection prior to the operation.
8125 # @param theName Object name; when specified, this parameter is used
8126 # for result publication in the study. Otherwise, if automatic
8127 # publication is switched on, default value is used for result name.
8129 # @note This algorithm doesn't find all types of self-intersections.
8130 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8131 # vertex/face and edge/face intersections. Face/face
8132 # intersections detection is switched off as it is a
8133 # time-consuming operation that gives an impact on performance.
8134 # To find all self-intersections please use
8135 # CheckSelfIntersections() method.
8137 # @return New GEOM.GEOM_Object, containing the result shape.
8139 # @ref tui_cut "Example 1"
8140 # \n @ref swig_MakeCommon "Example 2"
8141 @ManageTransactions("BoolOp")
8142 def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
8144 Perform Cut boolean operation on one object and the list of tools.
8147 theMainShape The object of the operation.
8148 theShapesList The list of tools of the operation.
8149 checkSelfInte The flag that tells if the arguments should
8150 be checked for self-intersection prior to
8152 theName Object name; when specified, this parameter is used
8153 for result publication in the study. Otherwise, if automatic
8154 publication is switched on, default value is used for result name.
8157 This algorithm doesn't find all types of self-intersections.
8158 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8159 vertex/face and edge/face intersections. Face/face
8160 intersections detection is switched off as it is a
8161 time-consuming operation that gives an impact on performance.
8162 To find all self-intersections please use
8163 CheckSelfIntersections() method.
8166 New GEOM.GEOM_Object, containing the result shape.
8169 # Example: see GEOM_TestOthers.py
8170 anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
8171 RaiseIfFailed("MakeCutList", self.BoolOp)
8172 self._autoPublish(anObj, theName, "cut")
8178 ## @addtogroup l3_basic_op
8181 ## Perform partition operation.
8182 # @param ListShapes Shapes to be intersected.
8183 # @param ListTools Shapes to intersect theShapes.
8184 # @param Limit Type of resulting shapes (see ShapeType()).\n
8185 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
8186 # type will be detected automatically.
8187 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
8188 # target type (equal to Limit) are kept in the result,
8189 # else standalone shapes of lower dimension
8190 # are kept also (if they exist).
8192 # @param theName Object name; when specified, this parameter is used
8193 # for result publication in the study. Otherwise, if automatic
8194 # publication is switched on, default value is used for result name.
8196 # @note Each compound from ListShapes and ListTools will be exploded
8197 # in order to avoid possible intersection between shapes from this compound.
8199 # After implementation new version of PartitionAlgo (October 2006)
8200 # other parameters are ignored by current functionality. They are kept
8201 # in this function only for support old versions.
8202 # @param ListKeepInside Shapes, outside which the results will be deleted.
8203 # Each shape from theKeepInside must belong to theShapes also.
8204 # @param ListRemoveInside Shapes, inside which the results will be deleted.
8205 # Each shape from theRemoveInside must belong to theShapes also.
8206 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
8207 # @param ListMaterials Material indices for each shape. Make sense,
8208 # only if theRemoveWebs is TRUE.
8210 # @return New GEOM.GEOM_Object, containing the result shapes.
8212 # @ref tui_partition "Example"
8213 @ManageTransactions("BoolOp")
8214 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8215 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8216 KeepNonlimitShapes=0, theName=None):
8218 Perform partition operation.
8221 ListShapes Shapes to be intersected.
8222 ListTools Shapes to intersect theShapes.
8223 Limit Type of resulting shapes (see geompy.ShapeType)
8224 If this parameter is set to -1 ("Auto"), most appropriate shape limit
8225 type will be detected automatically.
8226 KeepNonlimitShapes if this parameter == 0, then only shapes of
8227 target type (equal to Limit) are kept in the result,
8228 else standalone shapes of lower dimension
8229 are kept also (if they exist).
8231 theName Object name; when specified, this parameter is used
8232 for result publication in the study. Otherwise, if automatic
8233 publication is switched on, default value is used for result name.
8235 Each compound from ListShapes and ListTools will be exploded
8236 in order to avoid possible intersection between shapes from
8239 After implementation new version of PartitionAlgo (October 2006) other
8240 parameters are ignored by current functionality. They are kept in this
8241 function only for support old versions.
8244 ListKeepInside Shapes, outside which the results will be deleted.
8245 Each shape from theKeepInside must belong to theShapes also.
8246 ListRemoveInside Shapes, inside which the results will be deleted.
8247 Each shape from theRemoveInside must belong to theShapes also.
8248 RemoveWebs If TRUE, perform Glue 3D algorithm.
8249 ListMaterials Material indices for each shape. Make sense, only if theRemoveWebs is TRUE.
8252 New GEOM.GEOM_Object, containing the result shapes.
8254 # Example: see GEOM_TestAll.py
8255 if Limit == self.ShapeType["AUTO"]:
8256 # automatic detection of the most appropriate shape limit type
8258 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8259 Limit = EnumToLong(lim)
8261 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
8262 ListKeepInside, ListRemoveInside,
8263 Limit, RemoveWebs, ListMaterials,
8264 KeepNonlimitShapes);
8265 RaiseIfFailed("MakePartition", self.BoolOp)
8266 self._autoPublish(anObj, theName, "partition")
8269 ## Perform partition operation.
8270 # This method may be useful if it is needed to make a partition for
8271 # compound contains nonintersected shapes. Performance will be better
8272 # since intersection between shapes from compound is not performed.
8274 # Description of all parameters as in previous method MakePartition().
8275 # One additional parameter is provided:
8276 # @param checkSelfInte The flag that tells if the arguments should
8277 # be checked for self-intersection prior to the operation.
8279 # @note This algorithm doesn't find all types of self-intersections.
8280 # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8281 # vertex/face and edge/face intersections. Face/face
8282 # intersections detection is switched off as it is a
8283 # time-consuming operation that gives an impact on performance.
8284 # To find all self-intersections please use
8285 # CheckSelfIntersections() method.
8287 # @note Passed compounds (via ListShapes or via ListTools)
8288 # have to consist of nonintersecting shapes.
8290 # @return New GEOM.GEOM_Object, containing the result shapes.
8292 # @ref swig_todo "Example"
8293 @ManageTransactions("BoolOp")
8294 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
8295 ListKeepInside=[], ListRemoveInside=[],
8296 Limit=ShapeType["AUTO"], RemoveWebs=0,
8297 ListMaterials=[], KeepNonlimitShapes=0,
8298 checkSelfInte=False, theName=None):
8300 Perform partition operation.
8301 This method may be useful if it is needed to make a partition for
8302 compound contains nonintersected shapes. Performance will be better
8303 since intersection between shapes from compound is not performed.
8306 Description of all parameters as in method geompy.MakePartition.
8307 One additional parameter is provided:
8308 checkSelfInte The flag that tells if the arguments should
8309 be checked for self-intersection prior to
8313 This algorithm doesn't find all types of self-intersections.
8314 It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
8315 vertex/face and edge/face intersections. Face/face
8316 intersections detection is switched off as it is a
8317 time-consuming operation that gives an impact on performance.
8318 To find all self-intersections please use
8319 CheckSelfIntersections() method.
8322 Passed compounds (via ListShapes or via ListTools)
8323 have to consist of nonintersecting shapes.
8326 New GEOM.GEOM_Object, containing the result shapes.
8328 if Limit == self.ShapeType["AUTO"]:
8329 # automatic detection of the most appropriate shape limit type
8331 for s in ListShapes: lim = min(lim, s.GetMaxShapeType())
8332 Limit = EnumToLong(lim)
8334 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
8335 ListKeepInside, ListRemoveInside,
8336 Limit, RemoveWebs, ListMaterials,
8337 KeepNonlimitShapes, checkSelfInte);
8338 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
8339 self._autoPublish(anObj, theName, "partition")
8342 ## See method MakePartition() for more information.
8344 # @ref tui_partition "Example 1"
8345 # \n @ref swig_Partition "Example 2"
8346 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
8347 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
8348 KeepNonlimitShapes=0, theName=None):
8350 See method geompy.MakePartition for more information.
8352 # Example: see GEOM_TestOthers.py
8353 # note: auto-publishing is done in self.MakePartition()
8354 anObj = self.MakePartition(ListShapes, ListTools,
8355 ListKeepInside, ListRemoveInside,
8356 Limit, RemoveWebs, ListMaterials,
8357 KeepNonlimitShapes, theName);
8360 ## Perform partition of the Shape with the Plane
8361 # @param theShape Shape to be intersected.
8362 # @param thePlane Tool shape, to intersect theShape.
8363 # @param theName Object name; when specified, this parameter is used
8364 # for result publication in the study. Otherwise, if automatic
8365 # publication is switched on, default value is used for result name.
8367 # @return New GEOM.GEOM_Object, containing the result shape.
8369 # @note This operation is a shortcut to the more general @ref MakePartition
8370 # operation, where @a theShape specifies single "object" (shape being partitioned)
8371 # and @a thePlane specifies single "tool" (intersector shape). Other parameters of
8372 # @ref MakePartition operation have default values:
8373 # - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
8374 # - @a KeepNonlimitShapes: 0
8375 # - @a KeepInside, @a RemoveInside, @a RemoveWebs,
8376 # @a Materials (obsolete parameters): empty
8378 # @note I.e. the following two operations are equivalent:
8380 # Result = geompy.MakeHalfPartition(Object, Plane)
8381 # Result = geompy.MakePartition([Object], [Plane])
8384 # @sa MakePartition, MakePartitionNonSelfIntersectedShape
8386 # @ref tui_partition "Example"
8387 @ManageTransactions("BoolOp")
8388 def MakeHalfPartition(self, theShape, thePlane, theName=None):
8390 Perform partition of the Shape with the Plane
8393 theShape Shape to be intersected.
8394 thePlane Tool shape, to intersect theShape.
8395 theName Object name; when specified, this parameter is used
8396 for result publication in the study. Otherwise, if automatic
8397 publication is switched on, default value is used for result name.
8400 New GEOM.GEOM_Object, containing the result shape.
8402 Note: This operation is a shortcut to the more general MakePartition
8403 operation, where theShape specifies single "object" (shape being partitioned)
8404 and thePlane specifies single "tool" (intersector shape). Other parameters of
8405 MakePartition operation have default values:
8406 - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
8407 - KeepNonlimitShapes: 0
8408 - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
8410 I.e. the following two operations are equivalent:
8411 Result = geompy.MakeHalfPartition(Object, Plane)
8412 Result = geompy.MakePartition([Object], [Plane])
8414 # Example: see GEOM_TestAll.py
8415 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
8416 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
8417 self._autoPublish(anObj, theName, "partition")
8420 # end of l3_basic_op
8423 ## @addtogroup l3_transform
8426 ## Translate the given object along the vector, specified
8427 # by its end points.
8428 # @param theObject The object to be translated.
8429 # @param thePoint1 Start point of translation vector.
8430 # @param thePoint2 End point of translation vector.
8431 # @param theCopy Flag used to translate object itself or create a copy.
8432 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8433 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8434 @ManageTransactions("TrsfOp")
8435 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
8437 Translate the given object along the vector, specified by its end points.
8440 theObject The object to be translated.
8441 thePoint1 Start point of translation vector.
8442 thePoint2 End point of translation vector.
8443 theCopy Flag used to translate object itself or create a copy.
8446 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8447 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8450 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8452 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
8453 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
8456 ## Translate the given object along the vector, specified
8457 # by its end points, creating its copy before the translation.
8458 # @param theObject The object to be translated.
8459 # @param thePoint1 Start point of translation vector.
8460 # @param thePoint2 End point of translation vector.
8461 # @param theName Object name; when specified, this parameter is used
8462 # for result publication in the study. Otherwise, if automatic
8463 # publication is switched on, default value is used for result name.
8465 # @return New GEOM.GEOM_Object, containing the translated object.
8467 # @ref tui_translation "Example 1"
8468 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
8469 @ManageTransactions("TrsfOp")
8470 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
8472 Translate the given object along the vector, specified
8473 by its end points, creating its copy before the translation.
8476 theObject The object to be translated.
8477 thePoint1 Start point of translation vector.
8478 thePoint2 End point of translation vector.
8479 theName Object name; when specified, this parameter is used
8480 for result publication in the study. Otherwise, if automatic
8481 publication is switched on, default value is used for result name.
8484 New GEOM.GEOM_Object, containing the translated object.
8486 # Example: see GEOM_TestAll.py
8487 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
8488 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
8489 self._autoPublish(anObj, theName, "translated")
8492 ## Translate the given object along the vector, specified by its components.
8493 # @param theObject The object to be translated.
8494 # @param theDX,theDY,theDZ Components of translation vector.
8495 # @param theCopy Flag used to translate object itself or create a copy.
8496 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8497 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8499 # @ref tui_translation "Example"
8500 @ManageTransactions("TrsfOp")
8501 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
8503 Translate the given object along the vector, specified by its components.
8506 theObject The object to be translated.
8507 theDX,theDY,theDZ Components of translation vector.
8508 theCopy Flag used to translate object itself or create a copy.
8511 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8512 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8514 # Example: see GEOM_TestAll.py
8515 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8517 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8519 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
8520 anObj.SetParameters(Parameters)
8521 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8524 ## Translate the given object along the vector, specified
8525 # by its components, creating its copy before the translation.
8526 # @param theObject The object to be translated.
8527 # @param theDX,theDY,theDZ Components of translation vector.
8528 # @param theName Object name; when specified, this parameter is used
8529 # for result publication in the study. Otherwise, if automatic
8530 # publication is switched on, default value is used for result name.
8532 # @return New GEOM.GEOM_Object, containing the translated object.
8534 # @ref tui_translation "Example"
8535 @ManageTransactions("TrsfOp")
8536 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
8538 Translate the given object along the vector, specified
8539 by its components, creating its copy before the translation.
8542 theObject The object to be translated.
8543 theDX,theDY,theDZ Components of translation vector.
8544 theName Object name; when specified, this parameter is used
8545 for result publication in the study. Otherwise, if automatic
8546 publication is switched on, default value is used for result name.
8549 New GEOM.GEOM_Object, containing the translated object.
8551 # Example: see GEOM_TestAll.py
8552 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
8553 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
8554 anObj.SetParameters(Parameters)
8555 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
8556 self._autoPublish(anObj, theName, "translated")
8559 ## Translate the given object along the given vector.
8560 # @param theObject The object to be translated.
8561 # @param theVector The translation vector.
8562 # @param theCopy Flag used to translate object itself or create a copy.
8563 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8564 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8565 @ManageTransactions("TrsfOp")
8566 def TranslateVector(self, theObject, theVector, theCopy=False):
8568 Translate the given object along the given vector.
8571 theObject The object to be translated.
8572 theVector The translation vector.
8573 theCopy Flag used to translate object itself or create a copy.
8576 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8577 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8580 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8582 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
8583 RaiseIfFailed("TranslateVector", self.TrsfOp)
8586 ## Translate the given object along the given vector,
8587 # creating its copy before the translation.
8588 # @param theObject The object to be translated.
8589 # @param theVector The translation vector.
8590 # @param theName Object name; when specified, this parameter is used
8591 # for result publication in the study. Otherwise, if automatic
8592 # publication is switched on, default value is used for result name.
8594 # @return New GEOM.GEOM_Object, containing the translated object.
8596 # @ref tui_translation "Example"
8597 @ManageTransactions("TrsfOp")
8598 def MakeTranslationVector(self, theObject, theVector, theName=None):
8600 Translate the given object along the given vector,
8601 creating its copy before the translation.
8604 theObject The object to be translated.
8605 theVector The translation vector.
8606 theName Object name; when specified, this parameter is used
8607 for result publication in the study. Otherwise, if automatic
8608 publication is switched on, default value is used for result name.
8611 New GEOM.GEOM_Object, containing the translated object.
8613 # Example: see GEOM_TestAll.py
8614 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
8615 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
8616 self._autoPublish(anObj, theName, "translated")
8619 ## Translate the given object along the given vector on given distance.
8620 # @param theObject The object to be translated.
8621 # @param theVector The translation vector.
8622 # @param theDistance The translation distance.
8623 # @param theCopy Flag used to translate object itself or create a copy.
8624 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8625 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
8627 # @ref tui_translation "Example"
8628 @ManageTransactions("TrsfOp")
8629 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
8631 Translate the given object along the given vector on given distance.
8634 theObject The object to be translated.
8635 theVector The translation vector.
8636 theDistance The translation distance.
8637 theCopy Flag used to translate object itself or create a copy.
8640 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8641 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
8643 # Example: see GEOM_TestAll.py
8644 theDistance,Parameters = ParseParameters(theDistance)
8645 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
8646 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8647 anObj.SetParameters(Parameters)
8650 ## Translate the given object along the given vector on given distance,
8651 # creating its copy before the translation.
8652 # @param theObject The object to be translated.
8653 # @param theVector The translation vector.
8654 # @param theDistance The translation distance.
8655 # @param theName Object name; when specified, this parameter is used
8656 # for result publication in the study. Otherwise, if automatic
8657 # publication is switched on, default value is used for result name.
8659 # @return New GEOM.GEOM_Object, containing the translated object.
8661 # @ref tui_translation "Example"
8662 @ManageTransactions("TrsfOp")
8663 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
8665 Translate the given object along the given vector on given distance,
8666 creating its copy before the translation.
8669 theObject The object to be translated.
8670 theVector The translation vector.
8671 theDistance The translation distance.
8672 theName Object name; when specified, this parameter is used
8673 for result publication in the study. Otherwise, if automatic
8674 publication is switched on, default value is used for result name.
8677 New GEOM.GEOM_Object, containing the translated object.
8679 # Example: see GEOM_TestAll.py
8680 theDistance,Parameters = ParseParameters(theDistance)
8681 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
8682 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
8683 anObj.SetParameters(Parameters)
8684 self._autoPublish(anObj, theName, "translated")
8687 ## Rotate the given object around the given axis on the given angle.
8688 # @param theObject The object to be rotated.
8689 # @param theAxis Rotation axis.
8690 # @param theAngle Rotation angle in radians.
8691 # @param theCopy Flag used to rotate object itself or create a copy.
8693 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8694 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8696 # @ref tui_rotation "Example"
8697 @ManageTransactions("TrsfOp")
8698 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
8700 Rotate the given object around the given axis on the given angle.
8703 theObject The object to be rotated.
8704 theAxis Rotation axis.
8705 theAngle Rotation angle in radians.
8706 theCopy Flag used to rotate object itself or create a copy.
8709 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8710 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8712 # Example: see GEOM_TestAll.py
8714 if isinstance(theAngle,str):
8716 theAngle, Parameters = ParseParameters(theAngle)
8718 theAngle = theAngle*math.pi/180.0
8720 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8722 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
8723 RaiseIfFailed("Rotate", self.TrsfOp)
8724 anObj.SetParameters(Parameters)
8727 ## Rotate the given object around the given axis
8728 # on the given angle, creating its copy before the rotation.
8729 # @param theObject The object to be rotated.
8730 # @param theAxis Rotation axis.
8731 # @param theAngle Rotation angle in radians.
8732 # @param theName Object name; when specified, this parameter is used
8733 # for result publication in the study. Otherwise, if automatic
8734 # publication is switched on, default value is used for result name.
8736 # @return New GEOM.GEOM_Object, containing the rotated object.
8738 # @ref tui_rotation "Example"
8739 @ManageTransactions("TrsfOp")
8740 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
8742 Rotate the given object around the given axis
8743 on the given angle, creating its copy before the rotatation.
8746 theObject The object to be rotated.
8747 theAxis Rotation axis.
8748 theAngle Rotation angle in radians.
8749 theName Object name; when specified, this parameter is used
8750 for result publication in the study. Otherwise, if automatic
8751 publication is switched on, default value is used for result name.
8754 New GEOM.GEOM_Object, containing the rotated object.
8756 # Example: see GEOM_TestAll.py
8758 if isinstance(theAngle,str):
8760 theAngle, Parameters = ParseParameters(theAngle)
8762 theAngle = theAngle*math.pi/180.0
8763 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
8764 RaiseIfFailed("RotateCopy", self.TrsfOp)
8765 anObj.SetParameters(Parameters)
8766 self._autoPublish(anObj, theName, "rotated")
8769 ## Rotate given object around vector perpendicular to plane
8770 # containing three points.
8771 # @param theObject The object to be rotated.
8772 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8773 # containing the three points.
8774 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
8775 # @param theCopy Flag used to rotate object itself or create a copy.
8776 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8777 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
8778 @ManageTransactions("TrsfOp")
8779 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
8781 Rotate given object around vector perpendicular to plane
8782 containing three points.
8785 theObject The object to be rotated.
8786 theCentPoint central point the axis is the vector perpendicular to the plane
8787 containing the three points.
8788 thePoint1,thePoint2 points in a perpendicular plane of the axis.
8789 theCopy Flag used to rotate object itself or create a copy.
8792 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8793 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
8796 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8798 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
8799 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
8802 ## Rotate given object around vector perpendicular to plane
8803 # containing three points, creating its copy before the rotatation.
8804 # @param theObject The object to be rotated.
8805 # @param theCentPoint central point the axis is the vector perpendicular to the plane
8806 # containing the three points.
8807 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
8808 # @param theName Object name; when specified, this parameter is used
8809 # for result publication in the study. Otherwise, if automatic
8810 # publication is switched on, default value is used for result name.
8812 # @return New GEOM.GEOM_Object, containing the rotated object.
8814 # @ref tui_rotation "Example"
8815 @ManageTransactions("TrsfOp")
8816 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
8818 Rotate given object around vector perpendicular to plane
8819 containing three points, creating its copy before the rotatation.
8822 theObject The object to be rotated.
8823 theCentPoint central point the axis is the vector perpendicular to the plane
8824 containing the three points.
8825 thePoint1,thePoint2 in a perpendicular plane of the axis.
8826 theName Object name; when specified, this parameter is used
8827 for result publication in the study. Otherwise, if automatic
8828 publication is switched on, default value is used for result name.
8831 New GEOM.GEOM_Object, containing the rotated object.
8833 # Example: see GEOM_TestAll.py
8834 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
8835 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
8836 self._autoPublish(anObj, theName, "rotated")
8839 ## Scale the given object by the specified factor.
8840 # @param theObject The object to be scaled.
8841 # @param thePoint Center point for scaling.
8842 # Passing None for it means scaling relatively the origin of global CS.
8843 # @param theFactor Scaling factor value.
8844 # @param theCopy Flag used to scale object itself or create a copy.
8845 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8846 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8847 @ManageTransactions("TrsfOp")
8848 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
8850 Scale the given object by the specified factor.
8853 theObject The object to be scaled.
8854 thePoint Center point for scaling.
8855 Passing None for it means scaling relatively the origin of global CS.
8856 theFactor Scaling factor value.
8857 theCopy Flag used to scale object itself or create a copy.
8860 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8861 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8863 # Example: see GEOM_TestAll.py
8864 theFactor, Parameters = ParseParameters(theFactor)
8866 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8868 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
8869 RaiseIfFailed("Scale", self.TrsfOp)
8870 anObj.SetParameters(Parameters)
8873 ## Scale the given object by the factor, creating its copy before the scaling.
8874 # @param theObject The object to be scaled.
8875 # @param thePoint Center point for scaling.
8876 # Passing None for it means scaling relatively the origin of global CS.
8877 # @param theFactor Scaling factor value.
8878 # @param theName Object name; when specified, this parameter is used
8879 # for result publication in the study. Otherwise, if automatic
8880 # publication is switched on, default value is used for result name.
8882 # @return New GEOM.GEOM_Object, containing the scaled shape.
8884 # @ref tui_scale "Example"
8885 @ManageTransactions("TrsfOp")
8886 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
8888 Scale the given object by the factor, creating its copy before the scaling.
8891 theObject The object to be scaled.
8892 thePoint Center point for scaling.
8893 Passing None for it means scaling relatively the origin of global CS.
8894 theFactor Scaling factor value.
8895 theName Object name; when specified, this parameter is used
8896 for result publication in the study. Otherwise, if automatic
8897 publication is switched on, default value is used for result name.
8900 New GEOM.GEOM_Object, containing the scaled shape.
8902 # Example: see GEOM_TestAll.py
8903 theFactor, Parameters = ParseParameters(theFactor)
8904 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
8905 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
8906 anObj.SetParameters(Parameters)
8907 self._autoPublish(anObj, theName, "scaled")
8910 ## Scale the given object by different factors along coordinate axes.
8911 # @param theObject The object to be scaled.
8912 # @param thePoint Center point for scaling.
8913 # Passing None for it means scaling relatively the origin of global CS.
8914 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8915 # @param theCopy Flag used to scale object itself or create a copy.
8916 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8917 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
8918 @ManageTransactions("TrsfOp")
8919 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
8921 Scale the given object by different factors along coordinate axes.
8924 theObject The object to be scaled.
8925 thePoint Center point for scaling.
8926 Passing None for it means scaling relatively the origin of global CS.
8927 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8928 theCopy Flag used to scale object itself or create a copy.
8931 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
8932 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
8934 # Example: see GEOM_TestAll.py
8935 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8937 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8938 theFactorX, theFactorY, theFactorZ)
8940 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
8941 theFactorX, theFactorY, theFactorZ)
8942 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
8943 anObj.SetParameters(Parameters)
8946 ## Scale the given object by different factors along coordinate axes,
8947 # creating its copy before the scaling.
8948 # @param theObject The object to be scaled.
8949 # @param thePoint Center point for scaling.
8950 # Passing None for it means scaling relatively the origin of global CS.
8951 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8952 # @param theName Object name; when specified, this parameter is used
8953 # for result publication in the study. Otherwise, if automatic
8954 # publication is switched on, default value is used for result name.
8956 # @return New GEOM.GEOM_Object, containing the scaled shape.
8958 # @ref swig_scale "Example"
8959 @ManageTransactions("TrsfOp")
8960 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
8962 Scale the given object by different factors along coordinate axes,
8963 creating its copy before the scaling.
8966 theObject The object to be scaled.
8967 thePoint Center point for scaling.
8968 Passing None for it means scaling relatively the origin of global CS.
8969 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
8970 theName Object name; when specified, this parameter is used
8971 for result publication in the study. Otherwise, if automatic
8972 publication is switched on, default value is used for result name.
8975 New GEOM.GEOM_Object, containing the scaled shape.
8977 # Example: see GEOM_TestAll.py
8978 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
8979 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
8980 theFactorX, theFactorY, theFactorZ)
8981 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
8982 anObj.SetParameters(Parameters)
8983 self._autoPublish(anObj, theName, "scaled")
8986 ## Mirror an object relatively the given plane.
8987 # @param theObject The object to be mirrored.
8988 # @param thePlane Plane of symmetry.
8989 # @param theCopy Flag used to mirror object itself or create a copy.
8990 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
8991 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
8992 @ManageTransactions("TrsfOp")
8993 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
8995 Mirror an object relatively the given plane.
8998 theObject The object to be mirrored.
8999 thePlane Plane of symmetry.
9000 theCopy Flag used to mirror object itself or create a copy.
9003 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9004 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9007 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9009 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
9010 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
9013 ## Create an object, symmetrical
9014 # to the given one relatively the given plane.
9015 # @param theObject The object to be mirrored.
9016 # @param thePlane Plane of symmetry.
9017 # @param theName Object name; when specified, this parameter is used
9018 # for result publication in the study. Otherwise, if automatic
9019 # publication is switched on, default value is used for result name.
9021 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9023 # @ref tui_mirror "Example"
9024 @ManageTransactions("TrsfOp")
9025 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
9027 Create an object, symmetrical to the given one relatively the given plane.
9030 theObject The object to be mirrored.
9031 thePlane Plane of symmetry.
9032 theName Object name; when specified, this parameter is used
9033 for result publication in the study. Otherwise, if automatic
9034 publication is switched on, default value is used for result name.
9037 New GEOM.GEOM_Object, containing the mirrored shape.
9039 # Example: see GEOM_TestAll.py
9040 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
9041 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
9042 self._autoPublish(anObj, theName, "mirrored")
9045 ## Mirror an object relatively the given axis.
9046 # @param theObject The object to be mirrored.
9047 # @param theAxis Axis of symmetry.
9048 # @param theCopy Flag used to mirror object itself or create a copy.
9049 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9050 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9051 @ManageTransactions("TrsfOp")
9052 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
9054 Mirror an object relatively the given axis.
9057 theObject The object to be mirrored.
9058 theAxis Axis of symmetry.
9059 theCopy Flag used to mirror object itself or create a copy.
9062 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9063 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9066 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9068 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
9069 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
9072 ## Create an object, symmetrical
9073 # to the given one relatively the given axis.
9074 # @param theObject The object to be mirrored.
9075 # @param theAxis Axis of symmetry.
9076 # @param theName Object name; when specified, this parameter is used
9077 # for result publication in the study. Otherwise, if automatic
9078 # publication is switched on, default value is used for result name.
9080 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9082 # @ref tui_mirror "Example"
9083 @ManageTransactions("TrsfOp")
9084 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
9086 Create an object, symmetrical to the given one relatively the given axis.
9089 theObject The object to be mirrored.
9090 theAxis Axis of symmetry.
9091 theName Object name; when specified, this parameter is used
9092 for result publication in the study. Otherwise, if automatic
9093 publication is switched on, default value is used for result name.
9096 New GEOM.GEOM_Object, containing the mirrored shape.
9098 # Example: see GEOM_TestAll.py
9099 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
9100 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
9101 self._autoPublish(anObj, theName, "mirrored")
9104 ## Mirror an object relatively the given point.
9105 # @param theObject The object to be mirrored.
9106 # @param thePoint Point of symmetry.
9107 # @param theCopy Flag used to mirror object itself or create a copy.
9108 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9109 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
9110 @ManageTransactions("TrsfOp")
9111 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
9113 Mirror an object relatively the given point.
9116 theObject The object to be mirrored.
9117 thePoint Point of symmetry.
9118 theCopy Flag used to mirror object itself or create a copy.
9121 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9122 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
9124 # Example: see GEOM_TestAll.py
9126 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9128 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
9129 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
9132 ## Create an object, symmetrical
9133 # to the given one relatively the given point.
9134 # @param theObject The object to be mirrored.
9135 # @param thePoint Point of symmetry.
9136 # @param theName Object name; when specified, this parameter is used
9137 # for result publication in the study. Otherwise, if automatic
9138 # publication is switched on, default value is used for result name.
9140 # @return New GEOM.GEOM_Object, containing the mirrored shape.
9142 # @ref tui_mirror "Example"
9143 @ManageTransactions("TrsfOp")
9144 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
9146 Create an object, symmetrical
9147 to the given one relatively the given point.
9150 theObject The object to be mirrored.
9151 thePoint Point of symmetry.
9152 theName Object name; when specified, this parameter is used
9153 for result publication in the study. Otherwise, if automatic
9154 publication is switched on, default value is used for result name.
9157 New GEOM.GEOM_Object, containing the mirrored shape.
9159 # Example: see GEOM_TestAll.py
9160 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
9161 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
9162 self._autoPublish(anObj, theName, "mirrored")
9165 ## Modify the location of the given object.
9166 # @param theObject The object to be displaced.
9167 # @param theStartLCS Coordinate system to perform displacement from it.\n
9168 # If \a theStartLCS is NULL, displacement
9169 # will be performed from global CS.\n
9170 # If \a theObject itself is used as \a theStartLCS,
9171 # its location will be changed to \a theEndLCS.
9172 # @param theEndLCS Coordinate system to perform displacement to it.
9173 # @param theCopy Flag used to displace object itself or create a copy.
9174 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9175 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
9176 @ManageTransactions("TrsfOp")
9177 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
9179 Modify the Location of the given object by LCS, creating its copy before the setting.
9182 theObject The object to be displaced.
9183 theStartLCS Coordinate system to perform displacement from it.
9184 If theStartLCS is NULL, displacement
9185 will be performed from global CS.
9186 If theObject itself is used as theStartLCS,
9187 its location will be changed to theEndLCS.
9188 theEndLCS Coordinate system to perform displacement to it.
9189 theCopy Flag used to displace object itself or create a copy.
9192 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9193 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
9195 # Example: see GEOM_TestAll.py
9197 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9199 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
9200 RaiseIfFailed("Displace", self.TrsfOp)
9203 ## Modify the Location of the given object by LCS,
9204 # creating its copy before the setting.
9205 # @param theObject The object to be displaced.
9206 # @param theStartLCS Coordinate system to perform displacement from it.\n
9207 # If \a theStartLCS is NULL, displacement
9208 # will be performed from global CS.\n
9209 # If \a theObject itself is used as \a theStartLCS,
9210 # its location will be changed to \a theEndLCS.
9211 # @param theEndLCS Coordinate system to perform displacement to it.
9212 # @param theName Object name; when specified, this parameter is used
9213 # for result publication in the study. Otherwise, if automatic
9214 # publication is switched on, default value is used for result name.
9216 # @return New GEOM.GEOM_Object, containing the displaced shape.
9218 # @ref tui_modify_location "Example"
9219 @ManageTransactions("TrsfOp")
9220 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
9222 Modify the Location of the given object by LCS, creating its copy before the setting.
9225 theObject The object to be displaced.
9226 theStartLCS Coordinate system to perform displacement from it.
9227 If theStartLCS is NULL, displacement
9228 will be performed from global CS.
9229 If theObject itself is used as theStartLCS,
9230 its location will be changed to theEndLCS.
9231 theEndLCS Coordinate system to perform displacement to it.
9232 theName Object name; when specified, this parameter is used
9233 for result publication in the study. Otherwise, if automatic
9234 publication is switched on, default value is used for result name.
9237 New GEOM.GEOM_Object, containing the displaced shape.
9240 # create local coordinate systems
9241 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
9242 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
9243 # modify the location of the given object
9244 position = geompy.MakePosition(cylinder, cs1, cs2)
9246 # Example: see GEOM_TestAll.py
9247 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
9248 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
9249 self._autoPublish(anObj, theName, "displaced")
9252 ## Modify the Location of the given object by Path.
9253 # @param theObject The object to be displaced.
9254 # @param thePath Wire or Edge along that the object will be translated.
9255 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9256 # @param theCopy is to create a copy objects if true.
9257 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9258 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
9259 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
9261 # @ref tui_modify_location "Example"
9262 @ManageTransactions("TrsfOp")
9263 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
9265 Modify the Location of the given object by Path.
9268 theObject The object to be displaced.
9269 thePath Wire or Edge along that the object will be translated.
9270 theDistance progress of Path (0 = start location, 1 = end of path location).
9271 theCopy is to create a copy objects if true.
9272 theReverse 0 - for usual direction, 1 - to reverse path direction.
9275 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
9276 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
9279 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
9281 # Example: see GEOM_TestAll.py
9282 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
9283 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9286 ## Modify the Location of the given object by Path, creating its copy before the operation.
9287 # @param theObject The object to be displaced.
9288 # @param thePath Wire or Edge along that the object will be translated.
9289 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
9290 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
9291 # @param theName Object name; when specified, this parameter is used
9292 # for result publication in the study. Otherwise, if automatic
9293 # publication is switched on, default value is used for result name.
9295 # @return New GEOM.GEOM_Object, containing the displaced shape.
9296 @ManageTransactions("TrsfOp")
9297 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
9299 Modify the Location of the given object by Path, creating its copy before the operation.
9302 theObject The object to be displaced.
9303 thePath Wire or Edge along that the object will be translated.
9304 theDistance progress of Path (0 = start location, 1 = end of path location).
9305 theReverse 0 - for usual direction, 1 - to reverse path direction.
9306 theName Object name; when specified, this parameter is used
9307 for result publication in the study. Otherwise, if automatic
9308 publication is switched on, default value is used for result name.
9311 New GEOM.GEOM_Object, containing the displaced shape.
9313 # Example: see GEOM_TestAll.py
9314 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
9315 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
9316 self._autoPublish(anObj, theName, "displaced")
9319 ## Offset given shape.
9320 # @param theObject The base object for the offset.
9321 # @param theOffset Offset value.
9322 # @param theCopy Flag used to offset object itself or create a copy.
9323 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
9324 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
9325 @ManageTransactions("TrsfOp")
9326 def Offset(self, theObject, theOffset, theCopy=False):
9331 theObject The base object for the offset.
9332 theOffset Offset value.
9333 theCopy Flag used to offset object itself or create a copy.
9336 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
9337 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
9339 theOffset, Parameters = ParseParameters(theOffset)
9341 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset, True)
9343 anObj = self.TrsfOp.OffsetShape(theObject, theOffset, True)
9344 RaiseIfFailed("Offset", self.TrsfOp)
9345 anObj.SetParameters(Parameters)
9348 ## Create new object as offset of the given one. Gap between two adjacent
9349 # offset surfaces is filled by a pipe.
9350 # @param theObject The base object for the offset.
9351 # @param theOffset Offset value.
9352 # @param theName Object name; when specified, this parameter is used
9353 # for result publication in the study. Otherwise, if automatic
9354 # publication is switched on, default value is used for result name.
9356 # @return New GEOM.GEOM_Object, containing the offset object.
9358 # @sa MakeOffsetIntersectionJoin
9359 # @ref tui_offset "Example"
9360 @ManageTransactions("TrsfOp")
9361 def MakeOffset(self, theObject, theOffset, theName=None):
9363 Create new object as offset of the given one. Gap between adjacent
9364 offset surfaces is filled by a pipe.
9367 theObject The base object for the offset.
9368 theOffset Offset value.
9369 theName Object name; when specified, this parameter is used
9370 for result publication in the study. Otherwise, if automatic
9371 publication is switched on, default value is used for result name.
9374 New GEOM.GEOM_Object, containing the offset object.
9377 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9378 # create a new object as offset of the given object
9379 offset = geompy.MakeOffset(box, 70.)
9381 # Example: see GEOM_TestAll.py
9382 theOffset, Parameters = ParseParameters(theOffset)
9383 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, True )
9384 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9385 anObj.SetParameters(Parameters)
9386 self._autoPublish(anObj, theName, "offset")
9389 ## Create new object as offset of the given one. Gap between adjacent
9390 # offset surfaces is filled by extending and intersecting them.
9391 # @param theObject The base object for the offset.
9392 # @param theOffset Offset value.
9393 # @param theName Object name; when specified, this parameter is used
9394 # for result publication in the study. Otherwise, if automatic
9395 # publication is switched on, default value is used for result name.
9397 # @return New GEOM.GEOM_Object, containing the offset object.
9400 # @ref tui_offset "Example"
9401 @ManageTransactions("TrsfOp")
9402 def MakeOffsetIntersectionJoin(self, theObject, theOffset, theName=None):
9404 Create new object as offset of the given one. Gap between adjacent
9405 offset surfaces is filled by extending and intersecting them.
9408 theObject The base object for the offset.
9409 theOffset Offset value.
9410 theName Object name; when specified, this parameter is used
9411 for result publication in the study. Otherwise, if automatic
9412 publication is switched on, default value is used for result name.
9415 New GEOM.GEOM_Object, containing the offset object.
9418 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
9419 # create a new box extended by 70
9420 offset = geompy.MakeOffsetIntersectionJoin(box, 70.)
9422 # Example: see GEOM_TestAll.py
9423 theOffset, Parameters = ParseParameters( theOffset )
9424 anObj = self.TrsfOp.OffsetShapeCopy( theObject, theOffset, False )
9425 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
9426 anObj.SetParameters(Parameters)
9427 self._autoPublish(anObj, theName, "offset")
9430 ## Create new object as projection of the given one on another.
9431 # @param theSource The source object for the projection. It can be a point, edge or wire.
9432 # Edge and wire are acceptable if @a theTarget is a face.
9433 # @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
9434 # @param theName Object name; when specified, this parameter is used
9435 # for result publication in the study. Otherwise, if automatic
9436 # publication is switched on, default value is used for result name.
9438 # @return New GEOM.GEOM_Object, containing the projection.
9440 # @ref tui_projection "Example"
9441 @ManageTransactions("TrsfOp")
9442 def MakeProjection(self, theSource, theTarget, theName=None):
9444 Create new object as projection of the given one on another.
9447 theSource The source object for the projection. It can be a point, edge or wire.
9448 Edge and wire are acceptable if theTarget is a face.
9449 theTarget The target object. It can be planar or cylindrical face, edge or wire.
9450 theName Object name; when specified, this parameter is used
9451 for result publication in the study. Otherwise, if automatic
9452 publication is switched on, default value is used for result name.
9455 New GEOM.GEOM_Object, containing the projection.
9457 # Example: see GEOM_TestAll.py
9458 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
9459 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
9460 self._autoPublish(anObj, theName, "projection")
9463 ## Create a projection of the given point on a wire or an edge.
9464 # If there are no solutions or there are 2 or more solutions It throws an
9466 # @param thePoint the point to be projected.
9467 # @param theWire the wire. The edge is accepted as well.
9468 # @param theName Object name; when specified, this parameter is used
9469 # for result publication in the study. Otherwise, if automatic
9470 # publication is switched on, default value is used for result name.
9472 # @return [\a u, \a PointOnEdge, \a EdgeInWireIndex]
9473 # \n \a u: The parameter of projection point on edge.
9474 # \n \a PointOnEdge: The projection point.
9475 # \n \a EdgeInWireIndex: The index of an edge in a wire.
9477 # @ref tui_projection "Example"
9478 @ManageTransactions("TrsfOp")
9479 def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
9481 Create a projection of the given point on a wire or an edge.
9482 If there are no solutions or there are 2 or more solutions It throws an
9486 thePoint the point to be projected.
9487 theWire the wire. The edge is accepted as well.
9488 theName Object name; when specified, this parameter is used
9489 for result publication in the study. Otherwise, if automatic
9490 publication is switched on, default value is used for result name.
9493 [u, PointOnEdge, EdgeInWireIndex]
9494 u: The parameter of projection point on edge.
9495 PointOnEdge: The projection point.
9496 EdgeInWireIndex: The index of an edge in a wire.
9498 # Example: see GEOM_TestAll.py
9499 anObj = self.TrsfOp.ProjectPointOnWire(thePoint, theWire)
9500 RaiseIfFailed("ProjectPointOnWire", self.TrsfOp)
9501 self._autoPublish(anObj[1], theName, "projection")
9504 # -----------------------------------------------------------------------------
9506 # -----------------------------------------------------------------------------
9508 ## Translate the given object along the given vector a given number times
9509 # @param theObject The object to be translated.
9510 # @param theVector Direction of the translation. DX if None.
9511 # @param theStep Distance to translate on.
9512 # @param theNbTimes Quantity of translations to be done.
9513 # @param theName Object name; when specified, this parameter is used
9514 # for result publication in the study. Otherwise, if automatic
9515 # publication is switched on, default value is used for result name.
9517 # @return New GEOM.GEOM_Object, containing compound of all
9518 # the shapes, obtained after each translation.
9520 # @ref tui_multi_translation "Example"
9521 @ManageTransactions("TrsfOp")
9522 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
9524 Translate the given object along the given vector a given number times
9527 theObject The object to be translated.
9528 theVector Direction of the translation. DX if None.
9529 theStep Distance to translate on.
9530 theNbTimes Quantity of translations to be done.
9531 theName Object name; when specified, this parameter is used
9532 for result publication in the study. Otherwise, if automatic
9533 publication is switched on, default value is used for result name.
9536 New GEOM.GEOM_Object, containing compound of all
9537 the shapes, obtained after each translation.
9540 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
9542 # Example: see GEOM_TestAll.py
9543 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
9544 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
9545 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
9546 anObj.SetParameters(Parameters)
9547 self._autoPublish(anObj, theName, "multitranslation")
9550 ## Conseqently apply two specified translations to theObject specified number of times.
9551 # @param theObject The object to be translated.
9552 # @param theVector1 Direction of the first translation. DX if None.
9553 # @param theStep1 Step of the first translation.
9554 # @param theNbTimes1 Quantity of translations to be done along theVector1.
9555 # @param theVector2 Direction of the second translation. DY if None.
9556 # @param theStep2 Step of the second translation.
9557 # @param theNbTimes2 Quantity of translations to be done along theVector2.
9558 # @param theName Object name; when specified, this parameter is used
9559 # for result publication in the study. Otherwise, if automatic
9560 # publication is switched on, default value is used for result name.
9562 # @return New GEOM.GEOM_Object, containing compound of all
9563 # the shapes, obtained after each translation.
9565 # @ref tui_multi_translation "Example"
9566 @ManageTransactions("TrsfOp")
9567 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
9568 theVector2, theStep2, theNbTimes2, theName=None):
9570 Conseqently apply two specified translations to theObject specified number of times.
9573 theObject The object to be translated.
9574 theVector1 Direction of the first translation. DX if None.
9575 theStep1 Step of the first translation.
9576 theNbTimes1 Quantity of translations to be done along theVector1.
9577 theVector2 Direction of the second translation. DY if None.
9578 theStep2 Step of the second translation.
9579 theNbTimes2 Quantity of translations to be done along theVector2.
9580 theName Object name; when specified, this parameter is used
9581 for result publication in the study. Otherwise, if automatic
9582 publication is switched on, default value is used for result name.
9585 New GEOM.GEOM_Object, containing compound of all
9586 the shapes, obtained after each translation.
9589 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
9591 # Example: see GEOM_TestAll.py
9592 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
9593 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
9594 theVector2, theStep2, theNbTimes2)
9595 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
9596 anObj.SetParameters(Parameters)
9597 self._autoPublish(anObj, theName, "multitranslation")
9600 ## Rotate the given object around the given axis a given number times.
9601 # Rotation angle will be 2*PI/theNbTimes.
9602 # @param theObject The object to be rotated.
9603 # @param theAxis The rotation axis. DZ if None.
9604 # @param theNbTimes Quantity of rotations to be done.
9605 # @param theName Object name; when specified, this parameter is used
9606 # for result publication in the study. Otherwise, if automatic
9607 # publication is switched on, default value is used for result name.
9609 # @return New GEOM.GEOM_Object, containing compound of all the
9610 # shapes, obtained after each rotation.
9612 # @ref tui_multi_rotation "Example"
9613 @ManageTransactions("TrsfOp")
9614 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
9616 Rotate the given object around the given axis a given number times.
9617 Rotation angle will be 2*PI/theNbTimes.
9620 theObject The object to be rotated.
9621 theAxis The rotation axis. DZ if None.
9622 theNbTimes Quantity of rotations to be done.
9623 theName Object name; when specified, this parameter is used
9624 for result publication in the study. Otherwise, if automatic
9625 publication is switched on, default value is used for result name.
9628 New GEOM.GEOM_Object, containing compound of all the
9629 shapes, obtained after each rotation.
9632 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
9634 # Example: see GEOM_TestAll.py
9635 theNbTimes, Parameters = ParseParameters(theNbTimes)
9636 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
9637 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
9638 anObj.SetParameters(Parameters)
9639 self._autoPublish(anObj, theName, "multirotation")
9642 ## Rotate the given object around the given axis
9643 # a given number times on the given angle.
9644 # @param theObject The object to be rotated.
9645 # @param theAxis The rotation axis. DZ if None.
9646 # @param theAngleStep Rotation angle in radians.
9647 # @param theNbTimes Quantity of rotations to be done.
9648 # @param theName Object name; when specified, this parameter is used
9649 # for result publication in the study. Otherwise, if automatic
9650 # publication is switched on, default value is used for result name.
9652 # @return New GEOM.GEOM_Object, containing compound of all the
9653 # shapes, obtained after each rotation.
9655 # @ref tui_multi_rotation "Example"
9656 @ManageTransactions("TrsfOp")
9657 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
9659 Rotate the given object around the given axis
9660 a given number times on the given angle.
9663 theObject The object to be rotated.
9664 theAxis The rotation axis. DZ if None.
9665 theAngleStep Rotation angle in radians.
9666 theNbTimes Quantity of rotations to be done.
9667 theName Object name; when specified, this parameter is used
9668 for result publication in the study. Otherwise, if automatic
9669 publication is switched on, default value is used for result name.
9672 New GEOM.GEOM_Object, containing compound of all the
9673 shapes, obtained after each rotation.
9676 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
9678 # Example: see GEOM_TestAll.py
9679 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
9680 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
9681 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
9682 anObj.SetParameters(Parameters)
9683 self._autoPublish(anObj, theName, "multirotation")
9686 ## Rotate the given object around the given axis a given
9687 # number times and multi-translate each rotation result.
9688 # Rotation angle will be 2*PI/theNbTimes1.
9689 # Translation direction passes through center of gravity
9690 # of rotated shape and its projection on the rotation axis.
9691 # @param theObject The object to be rotated.
9692 # @param theAxis Rotation axis. DZ if None.
9693 # @param theNbTimes1 Quantity of rotations to be done.
9694 # @param theRadialStep Translation distance.
9695 # @param theNbTimes2 Quantity of translations to be done.
9696 # @param theName Object name; when specified, this parameter is used
9697 # for result publication in the study. Otherwise, if automatic
9698 # publication is switched on, default value is used for result name.
9700 # @return New GEOM.GEOM_Object, containing compound of all the
9701 # shapes, obtained after each transformation.
9703 # @ref tui_multi_rotation "Example"
9704 @ManageTransactions("TrsfOp")
9705 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9707 Rotate the given object around the
9708 given axis on the given angle a given number
9709 times and multi-translate each rotation result.
9710 Translation direction passes through center of gravity
9711 of rotated shape and its projection on the rotation axis.
9714 theObject The object to be rotated.
9715 theAxis Rotation axis. DZ if None.
9716 theNbTimes1 Quantity of rotations to be done.
9717 theRadialStep Translation distance.
9718 theNbTimes2 Quantity of translations to be done.
9719 theName Object name; when specified, this parameter is used
9720 for result publication in the study. Otherwise, if automatic
9721 publication is switched on, default value is used for result name.
9724 New GEOM.GEOM_Object, containing compound of all the
9725 shapes, obtained after each transformation.
9728 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9730 # Example: see GEOM_TestAll.py
9731 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
9732 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
9733 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
9734 anObj.SetParameters(Parameters)
9735 self._autoPublish(anObj, theName, "multirotation")
9738 ## Rotate the given object around the
9739 # given axis on the given angle a given number
9740 # times and multi-translate each rotation result.
9741 # Translation direction passes through center of gravity
9742 # of rotated shape and its projection on the rotation axis.
9743 # @param theObject The object to be rotated.
9744 # @param theAxis Rotation axis. DZ if None.
9745 # @param theAngleStep Rotation angle in radians.
9746 # @param theNbTimes1 Quantity of rotations to be done.
9747 # @param theRadialStep Translation distance.
9748 # @param theNbTimes2 Quantity of translations to be done.
9749 # @param theName Object name; when specified, this parameter is used
9750 # for result publication in the study. Otherwise, if automatic
9751 # publication is switched on, default value is used for result name.
9753 # @return New GEOM.GEOM_Object, containing compound of all the
9754 # shapes, obtained after each transformation.
9756 # @ref tui_multi_rotation "Example"
9757 @ManageTransactions("TrsfOp")
9758 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
9760 Rotate the given object around the
9761 given axis on the given angle a given number
9762 times and multi-translate each rotation result.
9763 Translation direction passes through center of gravity
9764 of rotated shape and its projection on the rotation axis.
9767 theObject The object to be rotated.
9768 theAxis Rotation axis. DZ if None.
9769 theAngleStep Rotation angle in radians.
9770 theNbTimes1 Quantity of rotations to be done.
9771 theRadialStep Translation distance.
9772 theNbTimes2 Quantity of translations to be done.
9773 theName Object name; when specified, this parameter is used
9774 for result publication in the study. Otherwise, if automatic
9775 publication is switched on, default value is used for result name.
9778 New GEOM.GEOM_Object, containing compound of all the
9779 shapes, obtained after each transformation.
9782 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
9784 # Example: see GEOM_TestAll.py
9785 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9786 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
9787 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
9788 anObj.SetParameters(Parameters)
9789 self._autoPublish(anObj, theName, "multirotation")
9792 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
9794 # @ref swig_MakeMultiRotation "Example"
9795 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9797 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
9800 pz = geompy.MakeVertex(0, 0, 100)
9801 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9802 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
9804 # Example: see GEOM_TestOthers.py
9805 aVec = self.MakeLine(aPoint,aDir)
9806 # note: auto-publishing is done in self.MultiRotate1D()
9807 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
9810 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
9812 # @ref swig_MakeMultiRotation "Example"
9813 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
9815 The same, as geompy.MultiRotate1D, but axis is given by direction and point
9818 pz = geompy.MakeVertex(0, 0, 100)
9819 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9820 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
9822 # Example: see GEOM_TestOthers.py
9823 aVec = self.MakeLine(aPoint,aDir)
9824 # note: auto-publishing is done in self.MultiRotate1D()
9825 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
9828 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9830 # @ref swig_MakeMultiRotation "Example"
9831 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
9833 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
9836 pz = geompy.MakeVertex(0, 0, 100)
9837 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9838 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
9840 # Example: see GEOM_TestOthers.py
9841 aVec = self.MakeLine(aPoint,aDir)
9842 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
9843 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
9846 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
9848 # @ref swig_MakeMultiRotation "Example"
9849 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
9851 The same, as MultiRotate2DByStep(), but axis is given by direction and point
9854 pz = geompy.MakeVertex(0, 0, 100)
9855 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9856 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
9858 # Example: see GEOM_TestOthers.py
9859 aVec = self.MakeLine(aPoint,aDir)
9860 # note: auto-publishing is done in self.MultiRotate2D()
9861 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
9865 # Compute a wire or a face that represents a projection of the source
9866 # shape onto cylinder. The cylinder's coordinate system is the same
9867 # as the global coordinate system.
9869 # @param theObject The object to be projected. It can be either
9870 # a planar wire or a face.
9871 # @param theRadius The radius of the cylinder.
9872 # @param theStartAngle The starting angle in radians from
9873 # the cylinder's X axis around Z axis. The angle from which
9874 # the projection is started.
9875 # @param theAngleLength The projection length angle in radians.
9876 # The angle in which to project the total length of the wire.
9877 # If it is negative the projection is not scaled and natural
9878 # wire length is kept for the projection.
9879 # @param theAngleRotation The desired angle in radians between
9880 # the tangent vector to the first curve at the first point of
9881 # the theObject's projection in 2D space and U-direction of
9882 # cylinder's 2D space.
9883 # @param theName Object name; when specified, this parameter is used
9884 # for result publication in the study. Otherwise, if automatic
9885 # publication is switched on, default value is used for result name.
9887 # @return New GEOM.GEOM_Object, containing the result shape. The result
9888 # represents a wire or a face that represents a projection of
9889 # the source shape onto a cylinder.
9891 # @ref tui_projection "Example"
9892 def MakeProjectionOnCylinder (self, theObject, theRadius,
9893 theStartAngle=0.0, theAngleLength=-1.0,
9894 theAngleRotation=0.0,
9897 Compute a wire or a face that represents a projection of the source
9898 shape onto cylinder. The cylinder's coordinate system is the same
9899 as the global coordinate system.
9902 theObject The object to be projected. It can be either
9903 a planar wire or a face.
9904 theRadius The radius of the cylinder.
9905 theStartAngle The starting angle in radians from the cylinder's X axis
9906 around Z axis. The angle from which the projection is started.
9907 theAngleLength The projection length angle in radians. The angle in which
9908 to project the total length of the wire. If it is negative the
9909 projection is not scaled and natural wire length is kept for
9911 theAngleRotation The desired angle in radians between
9912 the tangent vector to the first curve at the first
9913 point of the theObject's projection in 2D space and
9914 U-direction of cylinder's 2D space.
9915 theName Object name; when specified, this parameter is used
9916 for result publication in the study. Otherwise, if automatic
9917 publication is switched on, default value is used for result name.
9920 New GEOM.GEOM_Object, containing the result shape. The result
9921 represents a wire or a face that represents a projection of
9922 the source shape onto a cylinder.
9924 # Example: see GEOM_TestAll.py
9925 flagStartAngle = False
9926 if isinstance(theStartAngle,str):
9927 flagStartAngle = True
9928 flagAngleLength = False
9929 if isinstance(theAngleLength,str):
9930 flagAngleLength = True
9931 flagAngleRotation = False
9932 if isinstance(theAngleRotation,str):
9933 flagAngleRotation = True
9934 theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
9935 theRadius, theStartAngle, theAngleLength, theAngleRotation)
9937 theStartAngle = theStartAngle*math.pi/180.
9939 theAngleLength = theAngleLength*math.pi/180.
9940 if flagAngleRotation:
9941 theAngleRotation = theAngleRotation*math.pi/180.
9942 anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
9943 theStartAngle, theAngleLength, theAngleRotation)
9944 RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
9945 anObj.SetParameters(Parameters)
9946 self._autoPublish(anObj, theName, "projection")
9949 # end of l3_transform
9952 ## @addtogroup l3_transform_d
9955 ## Deprecated method. Use MultiRotate1DNbTimes instead.
9956 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
9958 Deprecated method. Use MultiRotate1DNbTimes instead.
9960 print("The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead.")
9961 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
9963 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9964 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9965 @ManageTransactions("TrsfOp")
9966 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
9968 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
9969 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
9972 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
9974 print("The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead.")
9975 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
9976 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
9977 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
9978 anObj.SetParameters(Parameters)
9979 self._autoPublish(anObj, theName, "multirotation")
9982 ## The same, as MultiRotate1D(), but axis is given by direction and point
9983 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9984 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
9986 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
9987 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
9990 pz = geompy.MakeVertex(0, 0, 100)
9991 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
9992 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
9994 print("The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.")
9995 aVec = self.MakeLine(aPoint,aDir)
9996 # note: auto-publishing is done in self.MultiRotate1D()
9997 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
10000 ## The same, as MultiRotate2D(), but axis is given by direction and point
10001 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10002 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
10004 The same, as MultiRotate2D(), but axis is given by direction and point
10005 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
10008 pz = geompy.MakeVertex(0, 0, 100)
10009 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
10010 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
10012 print("The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead.")
10013 aVec = self.MakeLine(aPoint,aDir)
10014 # note: auto-publishing is done in self.MultiRotate2D()
10015 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
10018 # end of l3_transform_d
10021 ## @addtogroup l3_local
10024 ## Perform a fillet on all edges of the given shape.
10025 # @param theShape Shape, to perform fillet on.
10026 # @param theR Fillet radius.
10027 # @param theName Object name; when specified, this parameter is used
10028 # for result publication in the study. Otherwise, if automatic
10029 # publication is switched on, default value is used for result name.
10031 # @return New GEOM.GEOM_Object, containing the result shape.
10033 # @ref tui_fillet "Example 1"
10034 # \n @ref swig_MakeFilletAll "Example 2"
10035 @ManageTransactions("LocalOp")
10036 def MakeFilletAll(self, theShape, theR, theName=None):
10038 Perform a fillet on all edges of the given shape.
10041 theShape Shape, to perform fillet on.
10042 theR Fillet radius.
10043 theName Object name; when specified, this parameter is used
10044 for result publication in the study. Otherwise, if automatic
10045 publication is switched on, default value is used for result name.
10048 New GEOM.GEOM_Object, containing the result shape.
10051 filletall = geompy.MakeFilletAll(prism, 10.)
10053 # Example: see GEOM_TestOthers.py
10054 theR,Parameters = ParseParameters(theR)
10055 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
10056 RaiseIfFailed("MakeFilletAll", self.LocalOp)
10057 anObj.SetParameters(Parameters)
10058 self._autoPublish(anObj, theName, "fillet")
10061 ## Perform a fillet on the specified edges/faces of the given shape
10062 # @param theShape Shape, to perform fillet on.
10063 # @param theR Fillet radius.
10064 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
10065 # @param theListShapes Global indices of edges/faces to perform fillet on.
10066 # @param theName Object name; when specified, this parameter is used
10067 # for result publication in the study. Otherwise, if automatic
10068 # publication is switched on, default value is used for result name.
10070 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10072 # @return New GEOM.GEOM_Object, containing the result shape.
10074 # @ref tui_fillet "Example"
10075 @ManageTransactions("LocalOp")
10076 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
10078 Perform a fillet on the specified edges/faces of the given shape
10081 theShape Shape, to perform fillet on.
10082 theR Fillet radius.
10083 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
10084 theListShapes Global indices of edges/faces to perform fillet on.
10085 theName Object name; when specified, this parameter is used
10086 for result publication in the study. Otherwise, if automatic
10087 publication is switched on, default value is used for result name.
10090 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10093 New GEOM.GEOM_Object, containing the result shape.
10096 # get the list of IDs (IDList) for the fillet
10097 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10099 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10100 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10101 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10102 # make a fillet on the specified edges of the given shape
10103 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
10105 # Example: see GEOM_TestAll.py
10106 theR,Parameters = ParseParameters(theR)
10108 if theShapeType == self.ShapeType["EDGE"]:
10109 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
10110 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
10112 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
10113 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
10114 anObj.SetParameters(Parameters)
10115 self._autoPublish(anObj, theName, "fillet")
10118 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
10119 @ManageTransactions("LocalOp")
10120 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
10122 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
10125 # get the list of IDs (IDList) for the fillet
10126 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
10128 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
10129 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
10130 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
10131 # make a fillet on the specified edges of the given shape
10132 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
10134 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
10136 if theShapeType == self.ShapeType["EDGE"]:
10137 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
10138 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
10140 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
10141 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
10142 anObj.SetParameters(Parameters)
10143 self._autoPublish(anObj, theName, "fillet")
10146 ## Perform a fillet on the specified edges of the given shape
10147 # @param theShape Wire Shape to perform fillet on.
10148 # @param theR Fillet radius.
10149 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10150 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
10151 # \note The list of vertices could be empty,
10152 # in this case fillet will done done at all vertices in wire
10153 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
10154 # by the length of the edges, nearest to the fillet vertex.
10155 # But sometimes the next edge is C1 continuous with the one, nearest to
10156 # the fillet point, and such two (or more) edges can be united to allow
10157 # bigger radius. Set this flag to TRUE to allow collinear edges union,
10158 # thus ignoring the secant vertex (vertices).
10159 # @param theName Object name; when specified, this parameter is used
10160 # for result publication in the study. Otherwise, if automatic
10161 # publication is switched on, default value is used for result name.
10163 # @return New GEOM.GEOM_Object, containing the result shape.
10165 # @ref tui_fillet2d "Example"
10166 @ManageTransactions("LocalOp")
10167 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
10169 Perform a fillet on the specified edges of the given shape
10172 theShape Wire Shape to perform fillet on.
10173 theR Fillet radius.
10174 theListOfVertexes Global indices of vertexes to perform fillet on.
10175 doIgnoreSecantVertices If FALSE, fillet radius is always limited
10176 by the length of the edges, nearest to the fillet vertex.
10177 But sometimes the next edge is C1 continuous with the one, nearest to
10178 the fillet point, and such two (or more) edges can be united to allow
10179 bigger radius. Set this flag to TRUE to allow collinear edges union,
10180 thus ignoring the secant vertex (vertices).
10181 theName Object name; when specified, this parameter is used
10182 for result publication in the study. Otherwise, if automatic
10183 publication is switched on, default value is used for result name.
10185 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10187 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
10190 New GEOM.GEOM_Object, containing the result shape.
10194 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
10195 # make fillet at given wire vertices with giver radius
10196 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
10198 # Example: see GEOM_TestAll.py
10199 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
10200 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
10201 RaiseIfFailed("MakeFillet1D", self.LocalOp)
10202 anObj.SetParameters(Parameters)
10203 self._autoPublish(anObj, theName, "fillet")
10206 ## Perform a fillet at the specified vertices of the given face/shell.
10207 # @param theShape Face or Shell shape to perform fillet on.
10208 # @param theR Fillet radius.
10209 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
10210 # @param theName Object name; when specified, this parameter is used
10211 # for result publication in the study. Otherwise, if automatic
10212 # publication is switched on, default value is used for result name.
10214 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10216 # @return New GEOM.GEOM_Object, containing the result shape.
10218 # @ref tui_fillet2d "Example"
10219 @ManageTransactions("LocalOp")
10220 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
10222 Perform a fillet at the specified vertices of the given face/shell.
10225 theShape Face or Shell shape to perform fillet on.
10226 theR Fillet radius.
10227 theListOfVertexes Global indices of vertexes to perform fillet on.
10228 theName Object name; when specified, this parameter is used
10229 for result publication in the study. Otherwise, if automatic
10230 publication is switched on, default value is used for result name.
10232 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10235 New GEOM.GEOM_Object, containing the result shape.
10238 face = geompy.MakeFaceHW(100, 100, 1)
10239 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
10241 # Example: see GEOM_TestAll.py
10242 theR,Parameters = ParseParameters(theR)
10243 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
10244 RaiseIfFailed("MakeFillet2D", self.LocalOp)
10245 anObj.SetParameters(Parameters)
10246 self._autoPublish(anObj, theName, "fillet")
10249 ## Perform a symmetric chamfer on all edges of the given shape.
10250 # @param theShape Shape, to perform chamfer on.
10251 # @param theD Chamfer size along each face.
10252 # @param theName Object name; when specified, this parameter is used
10253 # for result publication in the study. Otherwise, if automatic
10254 # publication is switched on, default value is used for result name.
10256 # @return New GEOM.GEOM_Object, containing the result shape.
10258 # @ref tui_chamfer "Example 1"
10259 # \n @ref swig_MakeChamferAll "Example 2"
10260 @ManageTransactions("LocalOp")
10261 def MakeChamferAll(self, theShape, theD, theName=None):
10263 Perform a symmetric chamfer on all edges of the given shape.
10266 theShape Shape, to perform chamfer on.
10267 theD Chamfer size along each face.
10268 theName Object name; when specified, this parameter is used
10269 for result publication in the study. Otherwise, if automatic
10270 publication is switched on, default value is used for result name.
10273 New GEOM.GEOM_Object, containing the result shape.
10276 chamfer_all = geompy.MakeChamferAll(prism, 10.)
10278 # Example: see GEOM_TestOthers.py
10279 theD,Parameters = ParseParameters(theD)
10280 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
10281 RaiseIfFailed("MakeChamferAll", self.LocalOp)
10282 anObj.SetParameters(Parameters)
10283 self._autoPublish(anObj, theName, "chamfer")
10286 ## Perform a chamfer on edges, common to the specified faces,
10287 # with distance D1 on the Face1
10288 # @param theShape Shape, to perform chamfer on.
10289 # @param theD1 Chamfer size along \a theFace1.
10290 # @param theD2 Chamfer size along \a theFace2.
10291 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10292 # @param theName Object name; when specified, this parameter is used
10293 # for result publication in the study. Otherwise, if automatic
10294 # publication is switched on, default value is used for result name.
10296 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10298 # @return New GEOM.GEOM_Object, containing the result shape.
10300 # @ref tui_chamfer "Example"
10301 @ManageTransactions("LocalOp")
10302 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
10304 Perform a chamfer on edges, common to the specified faces,
10305 with distance D1 on the Face1
10308 theShape Shape, to perform chamfer on.
10309 theD1 Chamfer size along theFace1.
10310 theD2 Chamfer size along theFace2.
10311 theFace1,theFace2 Global indices of two faces of theShape.
10312 theName Object name; when specified, this parameter is used
10313 for result publication in the study. Otherwise, if automatic
10314 publication is switched on, default value is used for result name.
10317 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10320 New GEOM.GEOM_Object, containing the result shape.
10323 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10324 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10325 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10326 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
10328 # Example: see GEOM_TestAll.py
10329 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10330 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
10331 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
10332 anObj.SetParameters(Parameters)
10333 self._autoPublish(anObj, theName, "chamfer")
10336 ## Perform a chamfer on edges
10337 # @param theShape Shape, to perform chamfer on.
10338 # @param theD Chamfer length
10339 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10340 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
10341 # @param theName Object name; when specified, this parameter is used
10342 # for result publication in the study. Otherwise, if automatic
10343 # publication is switched on, default value is used for result name.
10345 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10347 # @return New GEOM.GEOM_Object, containing the result shape.
10348 @ManageTransactions("LocalOp")
10349 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
10351 Perform a chamfer on edges
10354 theShape Shape, to perform chamfer on.
10355 theD1 Chamfer size along theFace1.
10356 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
10357 theFace1,theFace2 Global indices of two faces of theShape.
10358 theName Object name; when specified, this parameter is used
10359 for result publication in the study. Otherwise, if automatic
10360 publication is switched on, default value is used for result name.
10363 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
10366 New GEOM.GEOM_Object, containing the result shape.
10369 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
10370 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
10371 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
10373 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
10376 if isinstance(theAngle,str):
10378 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10380 theAngle = theAngle*math.pi/180.0
10381 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
10382 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
10383 anObj.SetParameters(Parameters)
10384 self._autoPublish(anObj, theName, "chamfer")
10387 ## Perform a chamfer on all edges of the specified faces,
10388 # with distance D1 on the first specified face (if several for one edge)
10389 # @param theShape Shape, to perform chamfer on.
10390 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
10391 # connected to the edge, are in \a theFaces, \a theD1
10392 # will be get along face, which is nearer to \a theFaces beginning.
10393 # @param theD2 Chamfer size along another of two faces, connected to the edge.
10394 # @param theFaces Sequence of global indices of faces of \a theShape.
10395 # @param theName Object name; when specified, this parameter is used
10396 # for result publication in the study. Otherwise, if automatic
10397 # publication is switched on, default value is used for result name.
10399 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
10401 # @return New GEOM.GEOM_Object, containing the result shape.
10403 # @ref tui_chamfer "Example"
10404 @ManageTransactions("LocalOp")
10405 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
10407 Perform a chamfer on all edges of the specified faces,
10408 with distance D1 on the first specified face (if several for one edge)
10411 theShape Shape, to perform chamfer on.
10412 theD1 Chamfer size along face from theFaces. If both faces,
10413 connected to the edge, are in theFaces, theD1
10414 will be get along face, which is nearer to theFaces beginning.
10415 theD2 Chamfer size along another of two faces, connected to the edge.
10416 theFaces Sequence of global indices of faces of theShape.
10417 theName Object name; when specified, this parameter is used
10418 for result publication in the study. Otherwise, if automatic
10419 publication is switched on, default value is used for result name.
10421 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
10424 New GEOM.GEOM_Object, containing the result shape.
10426 # Example: see GEOM_TestAll.py
10427 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10428 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
10429 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
10430 anObj.SetParameters(Parameters)
10431 self._autoPublish(anObj, theName, "chamfer")
10434 ## The Same that MakeChamferFaces() but with params theD is chamfer length and
10435 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10437 # @ref swig_FilletChamfer "Example"
10438 @ManageTransactions("LocalOp")
10439 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
10441 The Same that geompy.MakeChamferFaces but with params theD is chamfer length and
10442 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10445 if isinstance(theAngle,str):
10447 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10449 theAngle = theAngle*math.pi/180.0
10450 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
10451 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
10452 anObj.SetParameters(Parameters)
10453 self._autoPublish(anObj, theName, "chamfer")
10456 ## Perform a chamfer on edges,
10457 # with distance D1 on the first specified face (if several for one edge)
10458 # @param theShape Shape, to perform chamfer on.
10459 # @param theD1,theD2 Chamfer size
10460 # @param theEdges Sequence of edges of \a theShape.
10461 # @param theName Object name; when specified, this parameter is used
10462 # for result publication in the study. Otherwise, if automatic
10463 # publication is switched on, default value is used for result name.
10465 # @return New GEOM.GEOM_Object, containing the result shape.
10467 # @ref swig_FilletChamfer "Example"
10468 @ManageTransactions("LocalOp")
10469 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
10471 Perform a chamfer on edges,
10472 with distance D1 on the first specified face (if several for one edge)
10475 theShape Shape, to perform chamfer on.
10476 theD1,theD2 Chamfer size
10477 theEdges Sequence of edges of theShape.
10478 theName Object name; when specified, this parameter is used
10479 for result publication in the study. Otherwise, if automatic
10480 publication is switched on, default value is used for result name.
10483 New GEOM.GEOM_Object, containing the result shape.
10485 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
10486 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
10487 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
10488 anObj.SetParameters(Parameters)
10489 self._autoPublish(anObj, theName, "chamfer")
10492 ## The Same that MakeChamferEdges() but with params theD is chamfer length and
10493 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10494 @ManageTransactions("LocalOp")
10495 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
10497 The Same that geompy.MakeChamferEdges but with params theD is chamfer length and
10498 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
10501 if isinstance(theAngle,str):
10503 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
10505 theAngle = theAngle*math.pi/180.0
10506 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
10507 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
10508 anObj.SetParameters(Parameters)
10509 self._autoPublish(anObj, theName, "chamfer")
10512 ## @sa MakeChamferEdge(), MakeChamferFaces()
10514 # @ref swig_MakeChamfer "Example"
10515 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
10517 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
10519 # Example: see GEOM_TestOthers.py
10521 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
10522 if aShapeType == self.ShapeType["EDGE"]:
10523 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
10525 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
10528 ## Remove material from a solid by extrusion of the base shape on the given distance.
10529 # @param theInit Shape to remove material from. It must be a solid or
10530 # a compound made of a single solid.
10531 # @param theBase Closed edge or wire defining the base shape to be extruded.
10532 # @param theH Prism dimension along the normal to theBase
10533 # @param theAngle Draft angle in degrees.
10534 # @param theInvert If true material changes the direction
10535 # @param theName Object name; when specified, this parameter is used
10536 # for result publication in the study. Otherwise, if automatic
10537 # publication is switched on, default value is used for result name.
10539 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
10541 # @ref tui_creation_prism "Example"
10542 @ManageTransactions("PrimOp")
10543 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10545 Add material to a solid by extrusion of the base shape on the given distance.
10548 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
10549 theBase Closed edge or wire defining the base shape to be extruded.
10550 theH Prism dimension along the normal to theBase
10551 theAngle Draft angle in degrees.
10552 theInvert If true material changes the direction.
10553 theName Object name; when specified, this parameter is used
10554 for result publication in the study. Otherwise, if automatic
10555 publication is switched on, default value is used for result name.
10558 New GEOM.GEOM_Object, containing the initial shape with removed material.
10560 # Example: see GEOM_TestAll.py
10561 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10562 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
10563 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10564 anObj.SetParameters(Parameters)
10565 self._autoPublish(anObj, theName, "extrudedCut")
10568 ## Add material to a solid by extrusion of the base shape on the given distance.
10569 # @param theInit Shape to add material to. It must be a solid or
10570 # a compound made of a single solid.
10571 # @param theBase Closed edge or wire defining the base shape to be extruded.
10572 # @param theH Prism dimension along the normal to theBase
10573 # @param theAngle Draft angle in degrees.
10574 # @param theInvert If true material changes the direction
10575 # @param theName Object name; when specified, this parameter is used
10576 # for result publication in the study. Otherwise, if automatic
10577 # publication is switched on, default value is used for result name.
10579 # @return New GEOM.GEOM_Object, containing the initial shape with added material
10581 # @ref tui_creation_prism "Example"
10582 @ManageTransactions("PrimOp")
10583 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
10585 Add material to a solid by extrusion of the base shape on the given distance.
10588 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
10589 theBase Closed edge or wire defining the base shape to be extruded.
10590 theH Prism dimension along the normal to theBase
10591 theAngle Draft angle in degrees.
10592 theInvert If true material changes the direction.
10593 theName Object name; when specified, this parameter is used
10594 for result publication in the study. Otherwise, if automatic
10595 publication is switched on, default value is used for result name.
10598 New GEOM.GEOM_Object, containing the initial shape with added material.
10600 # Example: see GEOM_TestAll.py
10601 theH,theAngle,Parameters = ParseParameters(theH,theAngle)
10602 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
10603 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
10604 anObj.SetParameters(Parameters)
10605 self._autoPublish(anObj, theName, "extrudedBoss")
10611 ## @addtogroup l3_basic_op
10614 ## Perform an Archimde operation on the given shape with given parameters.
10615 # The object presenting the resulting face is returned.
10616 # @param theShape Shape to be put in water.
10617 # @param theWeight Weight of the shape.
10618 # @param theWaterDensity Density of the water.
10619 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
10620 # @param theName Object name; when specified, this parameter is used
10621 # for result publication in the study. Otherwise, if automatic
10622 # publication is switched on, default value is used for result name.
10624 # @return New GEOM.GEOM_Object, containing a section of \a theShape
10625 # by a plane, corresponding to water level.
10627 # @ref tui_archimede "Example"
10628 @ManageTransactions("LocalOp")
10629 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
10631 Perform an Archimde operation on the given shape with given parameters.
10632 The object presenting the resulting face is returned.
10635 theShape Shape to be put in water.
10636 theWeight Weight of the shape.
10637 theWaterDensity Density of the water.
10638 theMeshDeflection Deflection of the mesh, using to compute the section.
10639 theName Object name; when specified, this parameter is used
10640 for result publication in the study. Otherwise, if automatic
10641 publication is switched on, default value is used for result name.
10644 New GEOM.GEOM_Object, containing a section of theShape
10645 by a plane, corresponding to water level.
10647 # Example: see GEOM_TestAll.py
10648 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
10649 theWeight,theWaterDensity,theMeshDeflection)
10650 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
10651 RaiseIfFailed("MakeArchimede", self.LocalOp)
10652 anObj.SetParameters(Parameters)
10653 self._autoPublish(anObj, theName, "archimede")
10656 # end of l3_basic_op
10659 ## @addtogroup l2_measure
10662 ## Get point coordinates
10663 # @return [x, y, z]
10665 # @ref tui_point_coordinates_page "Example"
10666 @ManageTransactions("MeasuOp")
10667 def PointCoordinates(self,Point):
10669 Get point coordinates
10674 # Example: see GEOM_TestMeasures.py
10675 aTuple = self.MeasuOp.PointCoordinates(Point)
10676 RaiseIfFailed("PointCoordinates", self.MeasuOp)
10679 ## Get vector coordinates
10680 # @return [x, y, z]
10682 # @ref tui_measurement_tools_page "Example"
10683 def VectorCoordinates(self,Vector):
10685 Get vector coordinates
10691 p1=self.GetFirstVertex(Vector)
10692 p2=self.GetLastVertex(Vector)
10694 X1=self.PointCoordinates(p1)
10695 X2=self.PointCoordinates(p2)
10697 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
10700 ## Compute cross product
10701 # @return vector w=u^v
10703 # @ref tui_measurement_tools_page "Example"
10704 def CrossProduct(self, Vector1, Vector2):
10706 Compute cross product
10708 Returns: vector w=u^v
10710 u=self.VectorCoordinates(Vector1)
10711 v=self.VectorCoordinates(Vector2)
10712 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])
10716 ## Compute cross product
10717 # @return dot product p=u.v
10719 # @ref tui_measurement_tools_page "Example"
10720 def DotProduct(self, Vector1, Vector2):
10722 Compute cross product
10724 Returns: dot product p=u.v
10726 u=self.VectorCoordinates(Vector1)
10727 v=self.VectorCoordinates(Vector2)
10728 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
10733 ## Get summarized length of all wires,
10734 # area of surface and volume of the given shape.
10735 # @param theShape Shape to define properties of.
10736 # @param theTolerance maximal relative error of area
10737 # and volume computation.
10738 # @return [theLength, theSurfArea, theVolume]\n
10739 # theLength: Summarized length of all wires of the given shape.\n
10740 # theSurfArea: Area of surface of the given shape.\n
10741 # theVolume: Volume of the given shape.
10743 # @ref tui_basic_properties_page "Example"
10744 @ManageTransactions("MeasuOp")
10745 def BasicProperties(self,theShape, theTolerance=1.e-6):
10747 Get summarized length of all wires,
10748 area of surface and volume of the given shape.
10751 theShape Shape to define properties of.
10752 theTolerance maximal relative error of area
10753 and volume computation.
10756 [theLength, theSurfArea, theVolume]
10757 theLength: Summarized length of all wires of the given shape.
10758 theSurfArea: Area of surface of the given shape.
10759 theVolume: Volume of the given shape.
10761 # Example: see GEOM_TestMeasures.py
10762 aTuple = self.MeasuOp.GetBasicProperties(theShape, theTolerance)
10763 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
10766 ## Get parameters of bounding box of the given shape
10767 # @param theShape Shape to obtain bounding box of.
10768 # @param precise TRUE for precise computation; FALSE for fast one.
10769 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10770 # Xmin,Xmax: Limits of shape along OX axis.
10771 # Ymin,Ymax: Limits of shape along OY axis.
10772 # Zmin,Zmax: Limits of shape along OZ axis.
10774 # @ref tui_bounding_box_page "Example"
10775 @ManageTransactions("MeasuOp")
10776 def BoundingBox (self, theShape, precise=False):
10778 Get parameters of bounding box of the given shape
10781 theShape Shape to obtain bounding box of.
10782 precise TRUE for precise computation; FALSE for fast one.
10785 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
10786 Xmin,Xmax: Limits of shape along OX axis.
10787 Ymin,Ymax: Limits of shape along OY axis.
10788 Zmin,Zmax: Limits of shape along OZ axis.
10790 # Example: see GEOM_TestMeasures.py
10791 aTuple = self.MeasuOp.GetBoundingBox(theShape, precise)
10792 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
10795 ## Get bounding box of the given shape
10796 # @param theShape Shape to obtain bounding box of.
10797 # @param precise TRUE for precise computation; FALSE for fast one.
10798 # @param theName Object name; when specified, this parameter is used
10799 # for result publication in the study. Otherwise, if automatic
10800 # publication is switched on, default value is used for result name.
10802 # @return New GEOM.GEOM_Object, containing the created box.
10804 # @ref tui_bounding_box_page "Example"
10805 @ManageTransactions("MeasuOp")
10806 def MakeBoundingBox (self, theShape, precise=False, theName=None):
10808 Get bounding box of the given shape
10811 theShape Shape to obtain bounding box of.
10812 precise TRUE for precise computation; FALSE for fast one.
10813 theName Object name; when specified, this parameter is used
10814 for result publication in the study. Otherwise, if automatic
10815 publication is switched on, default value is used for result name.
10818 New GEOM.GEOM_Object, containing the created box.
10820 # Example: see GEOM_TestMeasures.py
10821 anObj = self.MeasuOp.MakeBoundingBox(theShape, precise)
10822 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
10823 self._autoPublish(anObj, theName, "bndbox")
10826 ## Get inertia matrix and moments of inertia of theShape.
10827 # @param theShape Shape to calculate inertia of.
10828 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10829 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
10830 # Ix,Iy,Iz: Moments of inertia of the given shape.
10832 # @ref tui_inertia_page "Example"
10833 @ManageTransactions("MeasuOp")
10834 def Inertia(self,theShape):
10836 Get inertia matrix and moments of inertia of theShape.
10839 theShape Shape to calculate inertia of.
10842 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
10843 I(1-3)(1-3): Components of the inertia matrix of the given shape.
10844 Ix,Iy,Iz: Moments of inertia of the given shape.
10846 # Example: see GEOM_TestMeasures.py
10847 aTuple = self.MeasuOp.GetInertia(theShape)
10848 RaiseIfFailed("GetInertia", self.MeasuOp)
10851 ## Get if coords are included in the shape (ST_IN or ST_ON)
10852 # @param theShape Shape
10853 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10854 # @param tolerance to be used (default is 1.0e-7)
10855 # @return list_of_boolean = [res1, res2, ...]
10856 @ManageTransactions("MeasuOp")
10857 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
10859 Get if coords are included in the shape (ST_IN or ST_ON)
10863 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
10864 tolerance to be used (default is 1.0e-7)
10867 list_of_boolean = [res1, res2, ...]
10869 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
10871 ## Get minimal distance between the given shapes.
10872 # @param theShape1,theShape2 Shapes to find minimal distance between.
10873 # @return Value of the minimal distance between the given shapes.
10875 # @ref tui_min_distance_page "Example"
10876 @ManageTransactions("MeasuOp")
10877 def MinDistance(self, theShape1, theShape2):
10879 Get minimal distance between the given shapes.
10882 theShape1,theShape2 Shapes to find minimal distance between.
10885 Value of the minimal distance between the given shapes.
10887 # Example: see GEOM_TestMeasures.py
10888 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10889 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10892 ## Get minimal distance between the given shapes.
10893 # @param theShape1,theShape2 Shapes to find minimal distance between.
10894 # @return Value of the minimal distance between the given shapes, in form of list
10895 # [Distance, DX, DY, DZ].
10897 # @ref tui_min_distance_page "Example"
10898 @ManageTransactions("MeasuOp")
10899 def MinDistanceComponents(self, theShape1, theShape2):
10901 Get minimal distance between the given shapes.
10904 theShape1,theShape2 Shapes to find minimal distance between.
10907 Value of the minimal distance between the given shapes, in form of list
10908 [Distance, DX, DY, DZ]
10910 # Example: see GEOM_TestMeasures.py
10911 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
10912 RaiseIfFailed("GetMinDistance", self.MeasuOp)
10913 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
10916 ## Get closest points of the given shapes.
10917 # @param theShape1,theShape2 Shapes to find closest points of.
10918 # @return The number of found solutions (-1 in case of infinite number of
10919 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10921 # @ref tui_min_distance_page "Example"
10922 @ManageTransactions("MeasuOp")
10923 def ClosestPoints (self, theShape1, theShape2):
10925 Get closest points of the given shapes.
10928 theShape1,theShape2 Shapes to find closest points of.
10931 The number of found solutions (-1 in case of infinite number of
10932 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
10934 # Example: see GEOM_TestMeasures.py
10935 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
10936 RaiseIfFailed("ClosestPoints", self.MeasuOp)
10939 ## Get angle between the given shapes in degrees.
10940 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10941 # @note If both arguments are vectors, the angle is computed in accordance
10942 # with their orientations, otherwise the minimum angle is computed.
10943 # @return Value of the angle between the given shapes in degrees.
10945 # @ref tui_angle_page "Example"
10946 @ManageTransactions("MeasuOp")
10947 def GetAngle(self, theShape1, theShape2):
10949 Get angle between the given shapes in degrees.
10952 theShape1,theShape2 Lines or linear edges to find angle between.
10955 If both arguments are vectors, the angle is computed in accordance
10956 with their orientations, otherwise the minimum angle is computed.
10959 Value of the angle between the given shapes in degrees.
10961 # Example: see GEOM_TestMeasures.py
10962 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
10963 RaiseIfFailed("GetAngle", self.MeasuOp)
10966 ## Get angle between the given shapes in radians.
10967 # @param theShape1,theShape2 Lines or linear edges to find angle between.
10968 # @note If both arguments are vectors, the angle is computed in accordance
10969 # with their orientations, otherwise the minimum angle is computed.
10970 # @return Value of the angle between the given shapes in radians.
10972 # @ref tui_angle_page "Example"
10973 @ManageTransactions("MeasuOp")
10974 def GetAngleRadians(self, theShape1, theShape2):
10976 Get angle between the given shapes in radians.
10979 theShape1,theShape2 Lines or linear edges to find angle between.
10983 If both arguments are vectors, the angle is computed in accordance
10984 with their orientations, otherwise the minimum angle is computed.
10987 Value of the angle between the given shapes in radians.
10989 # Example: see GEOM_TestMeasures.py
10990 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
10991 RaiseIfFailed("GetAngle", self.MeasuOp)
10994 ## Get angle between the given vectors in degrees.
10995 # @param theShape1,theShape2 Vectors to find angle between.
10996 # @param theFlag If True, the normal vector is defined by the two vectors cross,
10997 # if False, the opposite vector to the normal vector is used.
10998 # @return Value of the angle between the given vectors in degrees.
11000 # @ref tui_angle_page "Example"
11001 @ManageTransactions("MeasuOp")
11002 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
11004 Get angle between the given vectors in degrees.
11007 theShape1,theShape2 Vectors to find angle between.
11008 theFlag If True, the normal vector is defined by the two vectors cross,
11009 if False, the opposite vector to the normal vector is used.
11012 Value of the angle between the given vectors in degrees.
11014 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
11016 anAngle = 360. - anAngle
11017 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
11020 ## The same as GetAngleVectors, but the result is in radians.
11021 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
11023 Get angle between the given vectors in radians.
11026 theShape1,theShape2 Vectors to find angle between.
11027 theFlag If True, the normal vector is defined by the two vectors cross,
11028 if False, the opposite vector to the normal vector is used.
11031 Value of the angle between the given vectors in radians.
11033 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
11036 ## @name Curve Curvature Measurement
11037 # Methods for receiving radius of curvature of curves
11038 # in the given point
11041 ## Measure curvature of a curve at a point, set by parameter.
11042 # @param theCurve a curve.
11043 # @param theParam parameter.
11044 # @return radius of curvature of \a theCurve.
11046 # @ref swig_todo "Example"
11047 @ManageTransactions("MeasuOp")
11048 def CurveCurvatureByParam(self, theCurve, theParam):
11050 Measure curvature of a curve at a point, set by parameter.
11054 theParam parameter.
11057 radius of curvature of theCurve.
11059 # Example: see GEOM_TestMeasures.py
11060 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
11061 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
11064 ## Measure curvature of a curve at a point.
11065 # @param theCurve a curve.
11066 # @param thePoint given point.
11067 # @return radius of curvature of \a theCurve.
11069 # @ref swig_todo "Example"
11070 @ManageTransactions("MeasuOp")
11071 def CurveCurvatureByPoint(self, theCurve, thePoint):
11073 Measure curvature of a curve at a point.
11077 thePoint given point.
11080 radius of curvature of theCurve.
11082 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
11083 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
11087 ## @name Surface Curvature Measurement
11088 # Methods for receiving max and min radius of curvature of surfaces
11089 # in the given point
11092 ## Measure max radius of curvature of surface.
11093 # @param theSurf the given surface.
11094 # @param theUParam Value of U-parameter on the referenced surface.
11095 # @param theVParam Value of V-parameter on the referenced surface.
11096 # @return max radius of curvature of theSurf.
11098 ## @ref swig_todo "Example"
11099 @ManageTransactions("MeasuOp")
11100 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11102 Measure max radius of curvature of surface.
11105 theSurf the given surface.
11106 theUParam Value of U-parameter on the referenced surface.
11107 theVParam Value of V-parameter on the referenced surface.
11110 max radius of curvature of theSurf.
11112 # Example: see GEOM_TestMeasures.py
11113 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11114 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
11117 ## Measure max radius of curvature of surface in the given point
11118 # @param theSurf the given surface.
11119 # @param thePoint given point.
11120 # @return max radius of curvature of theSurf.
11122 ## @ref swig_todo "Example"
11123 @ManageTransactions("MeasuOp")
11124 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
11126 Measure max radius of curvature of surface in the given point.
11129 theSurf the given surface.
11130 thePoint given point.
11133 max radius of curvature of theSurf.
11135 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
11136 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
11139 ## Measure min radius of curvature of surface.
11140 # @param theSurf the given surface.
11141 # @param theUParam Value of U-parameter on the referenced surface.
11142 # @param theVParam Value of V-parameter on the referenced surface.
11143 # @return min radius of curvature of theSurf.
11145 ## @ref swig_todo "Example"
11146 @ManageTransactions("MeasuOp")
11147 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
11149 Measure min radius of curvature of surface.
11152 theSurf the given surface.
11153 theUParam Value of U-parameter on the referenced surface.
11154 theVParam Value of V-parameter on the referenced surface.
11157 Min radius of curvature of theSurf.
11159 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
11160 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
11163 ## Measure min radius of curvature of surface in the given point
11164 # @param theSurf the given surface.
11165 # @param thePoint given point.
11166 # @return min radius of curvature of theSurf.
11168 ## @ref swig_todo "Example"
11169 @ManageTransactions("MeasuOp")
11170 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
11172 Measure min radius of curvature of surface in the given point.
11175 theSurf the given surface.
11176 thePoint given point.
11179 Min radius of curvature of theSurf.
11181 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
11182 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
11186 ## Get min and max tolerances of sub-shapes of theShape
11187 # @param theShape Shape, to get tolerances of.
11188 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
11189 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
11190 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
11191 # VertMin,VertMax: Min and max tolerances of the vertices.
11193 # @ref tui_tolerance_page "Example"
11194 @ManageTransactions("MeasuOp")
11195 def Tolerance(self,theShape):
11197 Get min and max tolerances of sub-shapes of theShape
11200 theShape Shape, to get tolerances of.
11203 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
11204 FaceMin,FaceMax: Min and max tolerances of the faces.
11205 EdgeMin,EdgeMax: Min and max tolerances of the edges.
11206 VertMin,VertMax: Min and max tolerances of the vertices.
11208 # Example: see GEOM_TestMeasures.py
11209 aTuple = self.MeasuOp.GetTolerance(theShape)
11210 RaiseIfFailed("GetTolerance", self.MeasuOp)
11213 ## Obtain description of the given shape (number of sub-shapes of each type)
11214 # @param theShape Shape to be described.
11215 # @return Description of the given shape.
11217 # @ref tui_whatis_page "Example"
11218 @ManageTransactions("MeasuOp")
11219 def WhatIs(self,theShape):
11221 Obtain description of the given shape (number of sub-shapes of each type)
11224 theShape Shape to be described.
11227 Description of the given shape.
11229 # Example: see GEOM_TestMeasures.py
11230 aDescr = self.MeasuOp.WhatIs(theShape)
11231 RaiseIfFailed("WhatIs", self.MeasuOp)
11234 ## Obtain quantity of shapes of the given type in \a theShape.
11235 # If \a theShape is of type \a theType, it is also counted.
11236 # @param theShape Shape to be described.
11237 # @param theType the given ShapeType().
11238 # @return Quantity of shapes of type \a theType in \a theShape.
11240 # @ref tui_measurement_tools_page "Example"
11241 def NbShapes (self, theShape, theType):
11243 Obtain quantity of shapes of the given type in theShape.
11244 If theShape is of type theType, it is also counted.
11247 theShape Shape to be described.
11248 theType the given geompy.ShapeType
11251 Quantity of shapes of type theType in theShape.
11253 # Example: see GEOM_TestMeasures.py
11254 listSh = self.SubShapeAllIDs(theShape, theType)
11258 ## Obtain quantity of shapes of each type in \a theShape.
11259 # The \a theShape is also counted.
11260 # @param theShape Shape to be described.
11261 # @return Dictionary of ShapeType() with bound quantities of shapes.
11263 # @ref tui_measurement_tools_page "Example"
11264 def ShapeInfo (self, theShape):
11266 Obtain quantity of shapes of each type in theShape.
11267 The theShape is also counted.
11270 theShape Shape to be described.
11273 Dictionary of geompy.ShapeType with bound quantities of shapes.
11275 # Example: see GEOM_TestMeasures.py
11277 for typeSh in self.ShapeType:
11278 if typeSh in ( "AUTO", "SHAPE" ): continue
11279 listSh = self.SubShapeAllIDs(theShape, self.ShapeType[typeSh])
11285 def GetCreationInformation(self, theShape):
11287 infos = theShape.GetCreationInformation()
11290 opName = info.operationName
11291 if not opName: opName = "no info available"
11292 if res: res += "\n"
11293 res += "Operation: " + opName
11295 for parVal in info.params:
11296 res += "\n \t%s = %s" % ( parVal.name, parVal.value )
11299 ## Get a point, situated at the centre of mass of theShape.
11300 # @param theShape Shape to define centre of mass of.
11301 # @param theName Object name; when specified, this parameter is used
11302 # for result publication in the study. Otherwise, if automatic
11303 # publication is switched on, default value is used for result name.
11305 # @return New GEOM.GEOM_Object, containing the created point.
11307 # @ref tui_center_of_mass_page "Example"
11308 @ManageTransactions("MeasuOp")
11309 def MakeCDG(self, theShape, theName=None):
11311 Get a point, situated at the centre of mass of theShape.
11314 theShape Shape to define centre of mass of.
11315 theName Object name; when specified, this parameter is used
11316 for result publication in the study. Otherwise, if automatic
11317 publication is switched on, default value is used for result name.
11320 New GEOM.GEOM_Object, containing the created point.
11322 # Example: see GEOM_TestMeasures.py
11323 anObj = self.MeasuOp.GetCentreOfMass(theShape)
11324 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
11325 self._autoPublish(anObj, theName, "centerOfMass")
11328 ## Get a vertex sub-shape by index depended with orientation.
11329 # @param theShape Shape to find sub-shape.
11330 # @param theIndex Index to find vertex by this index (starting from zero)
11331 # @param theName Object name; when specified, this parameter is used
11332 # for result publication in the study. Otherwise, if automatic
11333 # publication is switched on, default value is used for result name.
11335 # @return New GEOM.GEOM_Object, containing the created vertex.
11337 # @ref tui_measurement_tools_page "Example"
11338 @ManageTransactions("MeasuOp")
11339 def GetVertexByIndex(self, theShape, theIndex, theName=None):
11341 Get a vertex sub-shape by index depended with orientation.
11344 theShape Shape to find sub-shape.
11345 theIndex Index to find vertex by this index (starting from zero)
11346 theName Object name; when specified, this parameter is used
11347 for result publication in the study. Otherwise, if automatic
11348 publication is switched on, default value is used for result name.
11351 New GEOM.GEOM_Object, containing the created vertex.
11353 # Example: see GEOM_TestMeasures.py
11354 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
11355 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
11356 self._autoPublish(anObj, theName, "vertex")
11359 ## Get the first vertex of wire/edge depended orientation.
11360 # @param theShape Shape to find first vertex.
11361 # @param 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.
11365 # @return New GEOM.GEOM_Object, containing the created vertex.
11367 # @ref tui_measurement_tools_page "Example"
11368 def GetFirstVertex(self, theShape, theName=None):
11370 Get the first vertex of wire/edge depended orientation.
11373 theShape Shape to find first vertex.
11374 theName Object name; when specified, this parameter is used
11375 for result publication in the study. Otherwise, if automatic
11376 publication is switched on, default value is used for result name.
11379 New GEOM.GEOM_Object, containing the created vertex.
11381 # Example: see GEOM_TestMeasures.py
11382 # note: auto-publishing is done in self.GetVertexByIndex()
11383 return self.GetVertexByIndex(theShape, 0, theName)
11385 ## Get the last vertex of wire/edge depended orientation.
11386 # @param theShape Shape to find last vertex.
11387 # @param theName Object name; when specified, this parameter is used
11388 # for result publication in the study. Otherwise, if automatic
11389 # publication is switched on, default value is used for result name.
11391 # @return New GEOM.GEOM_Object, containing the created vertex.
11393 # @ref tui_measurement_tools_page "Example"
11394 def GetLastVertex(self, theShape, theName=None):
11396 Get the last vertex of wire/edge depended orientation.
11399 theShape Shape to find last vertex.
11400 theName Object name; when specified, this parameter is used
11401 for result publication in the study. Otherwise, if automatic
11402 publication is switched on, default value is used for result name.
11405 New GEOM.GEOM_Object, containing the created vertex.
11407 # Example: see GEOM_TestMeasures.py
11408 nb_vert = self.NumberOfSubShapes(theShape, self.ShapeType["VERTEX"])
11409 # note: auto-publishing is done in self.GetVertexByIndex()
11410 return self.GetVertexByIndex(theShape, (nb_vert-1), theName)
11412 ## Get a normale to the given face. If the point is not given,
11413 # the normale is calculated at the center of mass.
11414 # @param theFace Face to define normale of.
11415 # @param theOptionalPoint Point to compute the normale at.
11416 # @param theName Object name; when specified, this parameter is used
11417 # for result publication in the study. Otherwise, if automatic
11418 # publication is switched on, default value is used for result name.
11420 # @return New GEOM.GEOM_Object, containing the created vector.
11422 # @ref swig_todo "Example"
11423 @ManageTransactions("MeasuOp")
11424 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
11426 Get a normale to the given face. If the point is not given,
11427 the normale is calculated at the center of mass.
11430 theFace Face to define normale of.
11431 theOptionalPoint Point to compute the normale at.
11432 theName Object name; when specified, this parameter is used
11433 for result publication in the study. Otherwise, if automatic
11434 publication is switched on, default value is used for result name.
11437 New GEOM.GEOM_Object, containing the created vector.
11439 # Example: see GEOM_TestMeasures.py
11440 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
11441 RaiseIfFailed("GetNormal", self.MeasuOp)
11442 self._autoPublish(anObj, theName, "normal")
11445 ## Print shape errors obtained from CheckShape.
11446 # @param theShape Shape that was checked.
11447 # @param theShapeErrors the shape errors obtained by CheckShape.
11448 # @param theReturnStatus If 0 the description of problem is printed.
11449 # If 1 the description of problem is returned.
11450 # @return If theReturnStatus is equal to 1 the description is returned.
11451 # Otherwise doesn't return anything.
11453 # @ref tui_check_shape_page "Example"
11454 @ManageTransactions("MeasuOp")
11455 def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
11457 Print shape errors obtained from CheckShape.
11460 theShape Shape that was checked.
11461 theShapeErrors the shape errors obtained by CheckShape.
11462 theReturnStatus If 0 the description of problem is printed.
11463 If 1 the description of problem is returned.
11466 If theReturnStatus is equal to 1 the description is returned.
11467 Otherwise doesn't return anything.
11469 # Example: see GEOM_TestMeasures.py
11470 Descr = self.MeasuOp.PrintShapeErrors(theShape, theShapeErrors)
11471 if theReturnStatus == 1:
11476 ## Check a topology of the given shape.
11477 # @param theShape Shape to check validity of.
11478 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
11479 # if TRUE, the shape's geometry will be checked also.
11480 # @param theReturnStatus If 0 and if theShape is invalid, a description
11481 # of problem is printed.
11482 # If 1 isValid flag and the description of
11483 # problem is returned.
11484 # If 2 isValid flag and the list of error data
11486 # @return TRUE, if the shape "seems to be valid".
11487 # If theShape is invalid, prints a description of problem.
11488 # If theReturnStatus is equal to 1 the description is returned
11489 # along with IsValid flag.
11490 # If theReturnStatus is equal to 2 the list of error data is
11491 # returned along with IsValid flag.
11493 # @ref tui_check_shape_page "Example"
11494 @ManageTransactions("MeasuOp")
11495 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
11497 Check a topology of the given shape.
11500 theShape Shape to check validity of.
11501 theIsCheckGeom If FALSE, only the shape's topology will be checked,
11502 if TRUE, the shape's geometry will be checked also.
11503 theReturnStatus If 0 and if theShape is invalid, a description
11504 of problem is printed.
11505 If 1 IsValid flag and the description of
11506 problem is returned.
11507 If 2 IsValid flag and the list of error data
11511 TRUE, if the shape "seems to be valid".
11512 If theShape is invalid, prints a description of problem.
11513 If theReturnStatus is equal to 1 the description is returned
11514 along with IsValid flag.
11515 If theReturnStatus is equal to 2 the list of error data is
11516 returned along with IsValid flag.
11518 # Example: see GEOM_TestMeasures.py
11520 (IsValid, ShapeErrors) = self.MeasuOp.CheckShapeWithGeometry(theShape)
11521 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
11523 (IsValid, ShapeErrors) = self.MeasuOp.CheckShape(theShape)
11524 RaiseIfFailed("CheckShape", self.MeasuOp)
11526 if theReturnStatus == 0:
11527 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11529 if theReturnStatus == 1:
11530 Descr = self.MeasuOp.PrintShapeErrors(theShape, ShapeErrors)
11531 return (IsValid, Descr)
11532 elif theReturnStatus == 2:
11533 return (IsValid, ShapeErrors)
11536 ## Detect self-intersections in the given shape.
11537 # @param theShape Shape to check.
11538 # @param theCheckLevel is the level of self-intersection check.
11539 # Possible input values are:
11540 # - GEOM.SI_V_V(0) - only V/V interferences
11541 # - GEOM.SI_V_E(1) - V/V and V/E interferences
11542 # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11543 # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11544 # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11545 # - GEOM.SI_ALL(5) - all interferences.
11546 # @return TRUE, if the shape contains no self-intersections.
11548 # @ref tui_check_self_intersections_page "Example"
11549 @ManageTransactions("MeasuOp")
11550 def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
11552 Detect self-intersections in the given shape.
11555 theShape Shape to check.
11556 theCheckLevel is the level of self-intersection check.
11557 Possible input values are:
11558 - GEOM.SI_V_V(0) - only V/V interferences
11559 - GEOM.SI_V_E(1) - V/V and V/E interferences
11560 - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
11561 - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
11562 - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
11563 - GEOM.SI_ALL(5) - all interferences.
11566 TRUE, if the shape contains no self-intersections.
11568 # Example: see GEOM_TestMeasures.py
11569 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
11570 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
11573 ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
11574 # @param theShape Shape to check.
11575 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11576 # - if \a theDeflection <= 0, default deflection 0.001 is used
11577 # @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
11578 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11579 # - if \a theTolerance > 0, algorithm detects gaps
11580 # @return TRUE, if the shape contains no self-intersections.
11582 # @ref tui_check_self_intersections_fast_page "Example"
11583 @ManageTransactions("MeasuOp")
11584 def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
11586 Detect self-intersections of the given shape with algorithm based on mesh intersections.
11589 theShape Shape to check.
11590 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11591 - if theDeflection <= 0, default deflection 0.001 is used
11592 theTolerance Specifies a distance between shapes used for detecting gaps:
11593 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11594 - if theTolerance > 0, algorithm detects gaps
11597 TRUE, if the shape contains no self-intersections.
11599 # Example: see GEOM_TestMeasures.py
11600 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
11601 RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
11604 ## Check boolean and partition operations arguments.
11605 # @param theShape the argument of an operation to be checked
11606 # @return TRUE if the argument is valid for a boolean or partition
11607 # operation; FALSE otherwise.
11608 @ManageTransactions("MeasuOp")
11609 def CheckBOPArguments(self, theShape):
11611 Check boolean and partition operations arguments.
11614 theShape the argument of an operation to be checked
11617 TRUE if the argument is valid for a boolean or partition
11618 operation; FALSE otherwise.
11620 return self.MeasuOp.CheckBOPArguments(theShape)
11622 ## Detect intersections of the given shapes with algorithm based on mesh intersections.
11623 # @param theShape1 First source object
11624 # @param theShape2 Second source object
11625 # @param theTolerance Specifies a distance between shapes used for detecting gaps:
11626 # - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
11627 # - if \a theTolerance > 0, algorithm detects gaps
11628 # @param theDeflection Linear deflection coefficient that specifies quality of tessellation:
11629 # - if \a theDeflection <= 0, default deflection 0.001 is used
11630 # @return TRUE, if there are intersections (gaps) between source shapes
11631 # @return List of sub-shapes IDs from 1st shape that localize intersection.
11632 # @return List of sub-shapes IDs from 2nd shape that localize intersection.
11634 # @ref tui_fast_intersection_page "Example"
11635 @ManageTransactions("MeasuOp")
11636 def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
11638 Detect intersections of the given shapes with algorithm based on mesh intersections.
11641 theShape1 First source object
11642 theShape2 Second source object
11643 theTolerance Specifies a distance between shapes used for detecting gaps:
11644 - if theTolerance <= 0, algorithm detects intersections (default behavior)
11645 - if theTolerance > 0, algorithm detects gaps
11646 theDeflection Linear deflection coefficient that specifies quality of tessellation:
11647 - if theDeflection <= 0, default deflection 0.001 is used
11650 TRUE, if there are intersections (gaps) between source shapes
11651 List of sub-shapes IDs from 1st shape that localize intersection.
11652 List of sub-shapes IDs from 2nd shape that localize intersection.
11654 # Example: see GEOM_TestMeasures.py
11655 IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
11656 RaiseIfFailed("FastIntersect", self.MeasuOp)
11657 return IsOk, Res1, Res2
11659 ## Get position (LCS) of theShape.
11661 # Origin of the LCS is situated at the shape's center of mass.
11662 # Axes of the LCS are obtained from shape's location or,
11663 # if the shape is a planar face, from position of its plane.
11665 # @param theShape Shape to calculate position of.
11666 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11667 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
11668 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11669 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11671 # @ref swig_todo "Example"
11672 @ManageTransactions("MeasuOp")
11673 def GetPosition(self,theShape):
11675 Get position (LCS) of theShape.
11676 Origin of the LCS is situated at the shape's center of mass.
11677 Axes of the LCS are obtained from shape's location or,
11678 if the shape is a planar face, from position of its plane.
11681 theShape Shape to calculate position of.
11684 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
11685 Ox,Oy,Oz: Coordinates of shape's LCS origin.
11686 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
11687 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
11689 # Example: see GEOM_TestMeasures.py
11690 aTuple = self.MeasuOp.GetPosition(theShape)
11691 RaiseIfFailed("GetPosition", self.MeasuOp)
11694 ## Get kind of theShape.
11696 # @param theShape Shape to get a kind of.
11697 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
11698 # and a list of parameters, describing the shape.
11699 # @note Concrete meaning of each value, returned via \a theIntegers
11700 # or \a theDoubles list depends on the kind() of the shape.
11702 # @ref swig_todo "Example"
11703 @ManageTransactions("MeasuOp")
11704 def KindOfShape(self,theShape):
11706 Get kind of theShape.
11709 theShape Shape to get a kind of.
11712 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
11713 and a list of parameters, describing the shape.
11715 Concrete meaning of each value, returned via theIntegers
11716 or theDoubles list depends on the geompy.kind of the shape
11718 # Example: see GEOM_TestMeasures.py
11719 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
11720 RaiseIfFailed("KindOfShape", self.MeasuOp)
11722 aKind = aRoughTuple[0]
11723 anInts = aRoughTuple[1]
11724 aDbls = aRoughTuple[2]
11726 # Now there is no exception from this rule:
11727 aKindTuple = [aKind] + aDbls + anInts
11729 # If they are we will regroup parameters for such kind of shape.
11731 #if aKind == kind.SOME_KIND:
11732 # # SOME_KIND int int double int double double
11733 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
11737 ## Returns the string that describes if the shell is good for solid.
11738 # This is a support method for MakeSolid.
11740 # @param theShell the shell to be checked.
11741 # @return Returns a string that describes the shell validity for
11742 # solid construction.
11743 @ManageTransactions("MeasuOp")
11744 def _IsGoodForSolid(self, theShell):
11746 Returns the string that describes if the shell is good for solid.
11747 This is a support method for MakeSolid.
11750 theShell the shell to be checked.
11753 Returns a string that describes the shell validity for
11754 solid construction.
11756 aDescr = self.MeasuOp.IsGoodForSolid(theShell)
11759 # end of l2_measure
11762 ## @addtogroup l2_import_export
11765 ## Import a shape from the BREP, IGES, STEP or other file
11766 # (depends on given format) with given name.
11768 # Note: this function is deprecated, it is kept for backward compatibility only
11769 # Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11771 # @param theFileName The file, containing the shape.
11772 # @param theFormatName Specify format for the file reading.
11773 # Available formats can be obtained with InsertOp.ImportTranslators() method.
11774 # If format 'IGES_SCALE' is used instead of 'IGES' or
11775 # format 'STEP_SCALE' is used instead of 'STEP',
11776 # length unit will be set to 'meter' and result model will be scaled.
11777 # @param theName Object name; when specified, this parameter is used
11778 # for result publication in the study. Otherwise, if automatic
11779 # publication is switched on, default value is used for result name.
11781 # @return New GEOM.GEOM_Object, containing the imported shape.
11782 # If material names are imported it returns the list of
11783 # objects. The first one is the imported object followed by
11785 # @note Auto publishing is allowed for the shape itself. Imported
11786 # material groups are not automatically published.
11788 # @ref swig_Import_Export "Example"
11789 @ManageTransactions("InsertOp")
11790 def ImportFile(self, theFileName, theFormatName, theName=None):
11792 Import a shape from the BREP, IGES, STEP or other file
11793 (depends on given format) with given name.
11795 Note: this function is deprecated, it is kept for backward compatibility only
11796 Use Import<FormatName> instead, where <FormatName> is a name of desirable format to import.
11799 theFileName The file, containing the shape.
11800 theFormatName Specify format for the file reading.
11801 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
11802 If format 'IGES_SCALE' is used instead of 'IGES' or
11803 format 'STEP_SCALE' is used instead of 'STEP',
11804 length unit will be set to 'meter' and result model will be scaled.
11805 theName Object name; when specified, this parameter is used
11806 for result publication in the study. Otherwise, if automatic
11807 publication is switched on, default value is used for result name.
11810 New GEOM.GEOM_Object, containing the imported shape.
11811 If material names are imported it returns the list of
11812 objects. The first one is the imported object followed by
11815 Auto publishing is allowed for the shape itself. Imported
11816 material groups are not automatically published.
11818 # Example: see GEOM_TestOthers.py
11820 WARNING: Function ImportFile is deprecated, use Import<FormatName> instead,
11821 where <FormatName> is a name of desirable format for importing.
11823 aListObj = self.InsertOp.ImportFile(theFileName, theFormatName)
11824 RaiseIfFailed("ImportFile", self.InsertOp)
11825 aNbObj = len(aListObj)
11827 self._autoPublish(aListObj[0], theName, "imported")
11832 ## Deprecated analog of ImportFile()
11833 def Import(self, theFileName, theFormatName, theName=None):
11835 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
11837 # note: auto-publishing is done in self.ImportFile()
11838 return self.ImportFile(theFileName, theFormatName, theName)
11840 ## Read a shape from the binary stream, containing its bounding representation (BRep).
11842 # @note As the byte-stream representing the shape data can be quite large, this method
11843 # is not automatically dumped to the Python script with the DumpStudy functionality;
11844 # so please use this method carefully, only for strong reasons.
11846 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's
11849 # @param theStream The BRep binary stream.
11850 # @param theName Object name; when specified, this parameter is used
11851 # for result publication in the study. Otherwise, if automatic
11852 # publication is switched on, default value is used for result name.
11854 # @return New GEOM_Object, containing the shape, read from theStream.
11856 # @ref swig_Import_Export "Example"
11857 @ManageTransactions("InsertOp")
11858 def RestoreShape (self, theStream, theName=None):
11860 Read a shape from the binary stream, containing its bounding representation (BRep).
11863 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
11866 theStream The BRep binary stream.
11867 theName Object name; when specified, this parameter is used
11868 for result publication in the study. Otherwise, if automatic
11869 publication is switched on, default value is used for result name.
11872 New GEOM_Object, containing the shape, read from theStream.
11874 # Example: see GEOM_TestOthers.py
11876 # this is the workaround to ignore invalid case when data stream is empty
11877 if int(os.getenv("GEOM_IGNORE_RESTORE_SHAPE", "0")) > 0:
11878 print("WARNING: Result of RestoreShape is a NULL shape!")
11880 anObj = self.InsertOp.RestoreShape(theStream)
11881 RaiseIfFailed("RestoreShape", self.InsertOp)
11882 self._autoPublish(anObj, theName, "restored")
11885 ## Export the given shape into a file with given name.
11887 # Note: this function is deprecated, it is kept for backward compatibility only
11888 # Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11890 # @param theObject Shape to be stored in the file.
11891 # @param theFileName Name of the file to store the given shape in.
11892 # @param theFormatName Specify format for the shape storage.
11893 # Available formats can be obtained with
11894 # geompy.InsertOp.ExportTranslators()[0] method.
11896 # @ref swig_Import_Export "Example"
11897 @ManageTransactions("InsertOp")
11898 def Export(self, theObject, theFileName, theFormatName):
11900 Export the given shape into a file with given name.
11902 Note: this function is deprecated, it is kept for backward compatibility only
11903 Use Export<FormatName> instead, where <FormatName> is a name of desirable format to export.
11906 theObject Shape to be stored in the file.
11907 theFileName Name of the file to store the given shape in.
11908 theFormatName Specify format for the shape storage.
11909 Available formats can be obtained with
11910 geompy.InsertOp.ExportTranslators()[0] method.
11912 # Example: see GEOM_TestOthers.py
11914 WARNING: Function Export is deprecated, use Export<FormatName> instead,
11915 where <FormatName> is a name of desirable format for exporting.
11917 self.InsertOp.Export(theObject, theFileName, theFormatName)
11918 if self.InsertOp.IsDone() == 0:
11919 raise RuntimeError("Export : " + self.InsertOp.GetErrorCode())
11923 # end of l2_import_export
11926 ## @addtogroup l3_blocks
11929 ## Create a quadrangle face from four edges. Order of Edges is not
11930 # important. It is not necessary that edges share the same vertex.
11931 # @param E1,E2,E3,E4 Edges for the face bound.
11932 # @param theName Object name; when specified, this parameter is used
11933 # for result publication in the study. Otherwise, if automatic
11934 # publication is switched on, default value is used for result name.
11936 # @return New GEOM.GEOM_Object, containing the created face.
11938 # @ref tui_building_by_blocks_page "Example"
11939 @ManageTransactions("BlocksOp")
11940 def MakeQuad(self, E1, E2, E3, E4, theName=None):
11942 Create a quadrangle face from four edges. Order of Edges is not
11943 important. It is not necessary that edges share the same vertex.
11946 E1,E2,E3,E4 Edges for the face bound.
11947 theName Object name; when specified, this parameter is used
11948 for result publication in the study. Otherwise, if automatic
11949 publication is switched on, default value is used for result name.
11952 New GEOM.GEOM_Object, containing the created face.
11955 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
11957 # Example: see GEOM_Spanner.py
11958 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
11959 RaiseIfFailed("MakeQuad", self.BlocksOp)
11960 self._autoPublish(anObj, theName, "quad")
11963 ## Create a quadrangle face on two edges.
11964 # The missing edges will be built by creating the shortest ones.
11965 # @param E1,E2 Two opposite edges for the face.
11966 # @param theName Object name; when specified, this parameter is used
11967 # for result publication in the study. Otherwise, if automatic
11968 # publication is switched on, default value is used for result name.
11970 # @return New GEOM.GEOM_Object, containing the created face.
11972 # @ref tui_building_by_blocks_page "Example"
11973 @ManageTransactions("BlocksOp")
11974 def MakeQuad2Edges(self, E1, E2, theName=None):
11976 Create a quadrangle face on two edges.
11977 The missing edges will be built by creating the shortest ones.
11980 E1,E2 Two opposite edges for the face.
11981 theName Object name; when specified, this parameter is used
11982 for result publication in the study. Otherwise, if automatic
11983 publication is switched on, default value is used for result name.
11986 New GEOM.GEOM_Object, containing the created face.
11990 p1 = geompy.MakeVertex( 0., 0., 0.)
11991 p2 = geompy.MakeVertex(150., 30., 0.)
11992 p3 = geompy.MakeVertex( 0., 120., 50.)
11993 p4 = geompy.MakeVertex( 0., 40., 70.)
11995 edge1 = geompy.MakeEdge(p1, p2)
11996 edge2 = geompy.MakeEdge(p3, p4)
11997 # create a quadrangle face from two edges
11998 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
12000 # Example: see GEOM_Spanner.py
12001 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
12002 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
12003 self._autoPublish(anObj, theName, "quad")
12006 ## Create a quadrangle face with specified corners.
12007 # The missing edges will be built by creating the shortest ones.
12008 # @param V1,V2,V3,V4 Corner vertices for the face.
12009 # @param theName Object name; when specified, this parameter is used
12010 # for result publication in the study. Otherwise, if automatic
12011 # publication is switched on, default value is used for result name.
12013 # @return New GEOM.GEOM_Object, containing the created face.
12015 # @ref tui_building_by_blocks_page "Example 1"
12016 # \n @ref swig_MakeQuad4Vertices "Example 2"
12017 @ManageTransactions("BlocksOp")
12018 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
12020 Create a quadrangle face with specified corners.
12021 The missing edges will be built by creating the shortest ones.
12024 V1,V2,V3,V4 Corner vertices for the face.
12025 theName Object name; when specified, this parameter is used
12026 for result publication in the study. Otherwise, if automatic
12027 publication is switched on, default value is used for result name.
12030 New GEOM.GEOM_Object, containing the created face.
12034 p1 = geompy.MakeVertex( 0., 0., 0.)
12035 p2 = geompy.MakeVertex(150., 30., 0.)
12036 p3 = geompy.MakeVertex( 0., 120., 50.)
12037 p4 = geompy.MakeVertex( 0., 40., 70.)
12038 # create a quadrangle from four points in its corners
12039 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
12041 # Example: see GEOM_Spanner.py
12042 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
12043 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
12044 self._autoPublish(anObj, theName, "quad")
12047 ## Create a hexahedral solid, bounded by the six given faces. Order of
12048 # faces is not important. It is not necessary that Faces share the same edge.
12049 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12050 # @param theName Object name; when specified, this parameter is used
12051 # for result publication in the study. Otherwise, if automatic
12052 # publication is switched on, default value is used for result name.
12054 # @return New GEOM.GEOM_Object, containing the created solid.
12056 # @ref tui_building_by_blocks_page "Example 1"
12057 # \n @ref swig_MakeHexa "Example 2"
12058 @ManageTransactions("BlocksOp")
12059 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
12061 Create a hexahedral solid, bounded by the six given faces. Order of
12062 faces is not important. It is not necessary that Faces share the same edge.
12065 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
12066 theName Object name; when specified, this parameter is used
12067 for result publication in the study. Otherwise, if automatic
12068 publication is switched on, default value is used for result name.
12071 New GEOM.GEOM_Object, containing the created solid.
12074 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
12076 # Example: see GEOM_Spanner.py
12077 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
12078 RaiseIfFailed("MakeHexa", self.BlocksOp)
12079 self._autoPublish(anObj, theName, "hexa")
12082 ## Create a hexahedral solid between two given faces.
12083 # The missing faces will be built by creating the smallest ones.
12084 # @param F1,F2 Two opposite faces for the hexahedral solid.
12085 # @param theName Object name; when specified, this parameter is used
12086 # for result publication in the study. Otherwise, if automatic
12087 # publication is switched on, default value is used for result name.
12089 # @return New GEOM.GEOM_Object, containing the created solid.
12091 # @ref tui_building_by_blocks_page "Example 1"
12092 # \n @ref swig_MakeHexa2Faces "Example 2"
12093 @ManageTransactions("BlocksOp")
12094 def MakeHexa2Faces(self, F1, F2, theName=None):
12096 Create a hexahedral solid between two given faces.
12097 The missing faces will be built by creating the smallest ones.
12100 F1,F2 Two opposite faces for the hexahedral solid.
12101 theName Object name; when specified, this parameter is used
12102 for result publication in the study. Otherwise, if automatic
12103 publication is switched on, default value is used for result name.
12106 New GEOM.GEOM_Object, containing the created solid.
12109 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
12111 # Example: see GEOM_Spanner.py
12112 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
12113 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
12114 self._autoPublish(anObj, theName, "hexa")
12120 ## @addtogroup l3_blocks_op
12123 ## Get a vertex, found in the given shape by its coordinates.
12124 # @param theShape Block or a compound of blocks.
12125 # @param theX,theY,theZ Coordinates of the sought vertex.
12126 # @param theEpsilon Maximum allowed distance between the resulting
12127 # vertex and point with the given coordinates.
12128 # @param theName Object name; when specified, this parameter is used
12129 # for result publication in the study. Otherwise, if automatic
12130 # publication is switched on, default value is used for result name.
12132 # @return New GEOM.GEOM_Object, containing the found vertex.
12134 # @ref swig_GetPoint "Example"
12135 @ManageTransactions("BlocksOp")
12136 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
12138 Get a vertex, found in the given shape by its coordinates.
12141 theShape Block or a compound of blocks.
12142 theX,theY,theZ Coordinates of the sought vertex.
12143 theEpsilon Maximum allowed distance between the resulting
12144 vertex and point with the given coordinates.
12145 theName Object name; when specified, this parameter is used
12146 for result publication in the study. Otherwise, if automatic
12147 publication is switched on, default value is used for result name.
12150 New GEOM.GEOM_Object, containing the found vertex.
12153 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
12155 # Example: see GEOM_TestOthers.py
12156 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
12157 RaiseIfFailed("GetPoint", self.BlocksOp)
12158 self._autoPublish(anObj, theName, "vertex")
12161 ## Find a vertex of the given shape, which has minimal distance to the given point.
12162 # @param theShape Any shape.
12163 # @param thePoint Point, close to the desired vertex.
12164 # @param theName Object name; when specified, this parameter is used
12165 # for result publication in the study. Otherwise, if automatic
12166 # publication is switched on, default value is used for result name.
12168 # @return New GEOM.GEOM_Object, containing the found vertex.
12170 # @ref swig_GetVertexNearPoint "Example"
12171 @ManageTransactions("BlocksOp")
12172 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
12174 Find a vertex of the given shape, which has minimal distance to the given point.
12177 theShape Any shape.
12178 thePoint Point, close to the desired vertex.
12179 theName Object name; when specified, this parameter is used
12180 for result publication in the study. Otherwise, if automatic
12181 publication is switched on, default value is used for result name.
12184 New GEOM.GEOM_Object, containing the found vertex.
12187 pmidle = geompy.MakeVertex(50, 0, 50)
12188 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
12190 # Example: see GEOM_TestOthers.py
12191 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
12192 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
12193 self._autoPublish(anObj, theName, "vertex")
12196 ## Get an edge, found in the given shape by two given vertices.
12197 # @param theShape Block or a compound of blocks.
12198 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
12199 # @param theName Object name; when specified, this parameter is used
12200 # for result publication in the study. Otherwise, if automatic
12201 # publication is switched on, default value is used for result name.
12203 # @return New GEOM.GEOM_Object, containing the found edge.
12205 # @ref swig_GetEdge "Example"
12206 @ManageTransactions("BlocksOp")
12207 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
12209 Get an edge, found in the given shape by two given vertices.
12212 theShape Block or a compound of blocks.
12213 thePoint1,thePoint2 Points, close to the ends of the desired edge.
12214 theName Object name; when specified, this parameter is used
12215 for result publication in the study. Otherwise, if automatic
12216 publication is switched on, default value is used for result name.
12219 New GEOM.GEOM_Object, containing the found edge.
12221 # Example: see GEOM_Spanner.py
12222 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
12223 RaiseIfFailed("GetEdge", self.BlocksOp)
12224 self._autoPublish(anObj, theName, "edge")
12227 ## Find an edge of the given shape, which has minimal distance to the given point.
12228 # @param theShape Block or a compound of blocks.
12229 # @param thePoint Point, close to the desired edge.
12230 # @param theName Object name; when specified, this parameter is used
12231 # for result publication in the study. Otherwise, if automatic
12232 # publication is switched on, default value is used for result name.
12234 # @return New GEOM.GEOM_Object, containing the found edge.
12236 # @ref swig_GetEdgeNearPoint "Example"
12237 @ManageTransactions("BlocksOp")
12238 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
12240 Find an edge of the given shape, which has minimal distance to the given point.
12243 theShape Block or a compound of blocks.
12244 thePoint Point, close to the desired edge.
12245 theName Object name; when specified, this parameter is used
12246 for result publication in the study. Otherwise, if automatic
12247 publication is switched on, default value is used for result name.
12250 New GEOM.GEOM_Object, containing the found edge.
12252 # Example: see GEOM_TestOthers.py
12253 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
12254 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
12255 self._autoPublish(anObj, theName, "edge")
12258 ## Returns a face, found in the given shape by four given corner vertices.
12259 # @param theShape Block or a compound of blocks.
12260 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12261 # @param theName Object name; when specified, this parameter is used
12262 # for result publication in the study. Otherwise, if automatic
12263 # publication is switched on, default value is used for result name.
12265 # @return New GEOM.GEOM_Object, containing the found face.
12267 # @ref swig_todo "Example"
12268 @ManageTransactions("BlocksOp")
12269 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
12271 Returns a face, found in the given shape by four given corner vertices.
12274 theShape Block or a compound of blocks.
12275 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
12276 theName Object name; when specified, this parameter is used
12277 for result publication in the study. Otherwise, if automatic
12278 publication is switched on, default value is used for result name.
12281 New GEOM.GEOM_Object, containing the found face.
12283 # Example: see GEOM_Spanner.py
12284 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
12285 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
12286 self._autoPublish(anObj, theName, "face")
12289 ## Get a face of block, found in the given shape by two given edges.
12290 # @param theShape Block or a compound of blocks.
12291 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
12292 # @param theName Object name; when specified, this parameter is used
12293 # for result publication in the study. Otherwise, if automatic
12294 # publication is switched on, default value is used for result name.
12296 # @return New GEOM.GEOM_Object, containing the found face.
12298 # @ref swig_todo "Example"
12299 @ManageTransactions("BlocksOp")
12300 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
12302 Get a face of block, found in the given shape by two given edges.
12305 theShape Block or a compound of blocks.
12306 theEdge1,theEdge2 Edges, close to the edges of the desired face.
12307 theName Object name; when specified, this parameter is used
12308 for result publication in the study. Otherwise, if automatic
12309 publication is switched on, default value is used for result name.
12312 New GEOM.GEOM_Object, containing the found face.
12314 # Example: see GEOM_Spanner.py
12315 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
12316 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
12317 self._autoPublish(anObj, theName, "face")
12320 ## Find a face, opposite to the given one in the given block.
12321 # @param theBlock Must be a hexahedral solid.
12322 # @param theFace Face of \a theBlock, opposite to the desired face.
12323 # @param theName Object name; when specified, this parameter is used
12324 # for result publication in the study. Otherwise, if automatic
12325 # publication is switched on, default value is used for result name.
12327 # @return New GEOM.GEOM_Object, containing the found face.
12329 # @ref swig_GetOppositeFace "Example"
12330 @ManageTransactions("BlocksOp")
12331 def GetOppositeFace(self, theBlock, theFace, theName=None):
12333 Find a face, opposite to the given one in the given block.
12336 theBlock Must be a hexahedral solid.
12337 theFace Face of theBlock, opposite to the desired face.
12338 theName Object name; when specified, this parameter is used
12339 for result publication in the study. Otherwise, if automatic
12340 publication is switched on, default value is used for result name.
12343 New GEOM.GEOM_Object, containing the found face.
12345 # Example: see GEOM_Spanner.py
12346 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
12347 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
12348 self._autoPublish(anObj, theName, "face")
12351 ## Find a face of the given shape, which has minimal distance to the given point.
12352 # @param theShape Block or a compound of blocks.
12353 # @param thePoint Point, close to the desired face.
12354 # @param theName Object name; when specified, this parameter is used
12355 # for result publication in the study. Otherwise, if automatic
12356 # publication is switched on, default value is used for result name.
12358 # @return New GEOM.GEOM_Object, containing the found face.
12360 # @ref swig_GetFaceNearPoint "Example"
12361 @ManageTransactions("BlocksOp")
12362 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
12364 Find a face of the given shape, which has minimal distance to the given point.
12367 theShape Block or a compound of blocks.
12368 thePoint Point, close to the desired face.
12369 theName Object name; when specified, this parameter is used
12370 for result publication in the study. Otherwise, if automatic
12371 publication is switched on, default value is used for result name.
12374 New GEOM.GEOM_Object, containing the found face.
12376 # Example: see GEOM_Spanner.py
12377 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
12378 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
12379 self._autoPublish(anObj, theName, "face")
12382 ## Find a face of block, whose outside normale has minimal angle with the given vector.
12383 # @param theBlock Block or a compound of blocks.
12384 # @param theVector Vector, close to the normale of the desired face.
12385 # @param theName Object name; when specified, this parameter is used
12386 # for result publication in the study. Otherwise, if automatic
12387 # publication is switched on, default value is used for result name.
12389 # @return New GEOM.GEOM_Object, containing the found face.
12391 # @ref swig_todo "Example"
12392 @ManageTransactions("BlocksOp")
12393 def GetFaceByNormale(self, theBlock, theVector, theName=None):
12395 Find a face of block, whose outside normale has minimal angle with the given vector.
12398 theBlock Block or a compound of blocks.
12399 theVector Vector, close to the normale of the desired face.
12400 theName Object name; when specified, this parameter is used
12401 for result publication in the study. Otherwise, if automatic
12402 publication is switched on, default value is used for result name.
12405 New GEOM.GEOM_Object, containing the found face.
12407 # Example: see GEOM_Spanner.py
12408 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
12409 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
12410 self._autoPublish(anObj, theName, "face")
12413 ## Find all sub-shapes of type \a theShapeType of the given shape,
12414 # which have minimal distance to the given point.
12415 # @param theShape Any shape.
12416 # @param thePoint Point, close to the desired shape.
12417 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
12418 # @param theTolerance The tolerance for distances comparison. All shapes
12419 # with distances to the given point in interval
12420 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
12421 # @param 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.
12425 # @return New GEOM_Object, containing a group of all found shapes.
12427 # @ref swig_GetShapesNearPoint "Example"
12428 @ManageTransactions("BlocksOp")
12429 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
12431 Find all sub-shapes of type theShapeType of the given shape,
12432 which have minimal distance to the given point.
12435 theShape Any shape.
12436 thePoint Point, close to the desired shape.
12437 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
12438 theTolerance The tolerance for distances comparison. All shapes
12439 with distances to the given point in interval
12440 [minimal_distance, minimal_distance + theTolerance] will be gathered.
12441 theName Object name; when specified, this parameter is used
12442 for result publication in the study. Otherwise, if automatic
12443 publication is switched on, default value is used for result name.
12446 New GEOM_Object, containing a group of all found shapes.
12448 # Example: see GEOM_TestOthers.py
12449 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
12450 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
12451 self._autoPublish(anObj, theName, "group")
12454 # end of l3_blocks_op
12457 ## @addtogroup l4_blocks_measure
12460 ## Check, if the compound of blocks is given.
12461 # To be considered as a compound of blocks, the
12462 # given shape must satisfy the following conditions:
12463 # - Each element of the compound should be a Block (6 faces).
12464 # - Each face should be a quadrangle, i.e. it should have only 1 wire
12465 # with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
12466 # there are more than 4 edges in the only wire of a face,
12467 # this face is considered to be quadrangle if it has 4 bounds
12468 # (1 or more edge) of C1 continuity.
12469 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12470 # - The compound should be connexe.
12471 # - The glue between two quadrangle faces should be applied.
12472 # @param theCompound The compound to check.
12473 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12474 # taking into account C1 continuity.
12475 # @param theAngTolerance the angular tolerance to check if two neighbor
12476 # edges are codirectional in the common vertex with this
12477 # tolerance. This parameter is used only if
12478 # <VAR>theIsUseC1</VAR> is set to True.
12479 # @return TRUE, if the given shape is a compound of blocks.
12480 # If theCompound is not valid, prints all discovered errors.
12482 # @ref tui_check_compound_of_blocks_page "Example 1"
12483 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
12484 @ManageTransactions("BlocksOp")
12485 def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
12486 theAngTolerance = 1.e-12):
12488 Check, if the compound of blocks is given.
12489 To be considered as a compound of blocks, the
12490 given shape must satisfy the following conditions:
12491 - Each element of the compound should be a Block (6 faces).
12492 - Each face should be a quadrangle, i.e. it should have only 1 wire
12493 with 4 edges. If theIsUseC1 is set to True and
12494 there are more than 4 edges in the only wire of a face,
12495 this face is considered to be quadrangle if it has 4 bounds
12496 (1 or more edge) of C1 continuity.
12497 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
12498 - The compound should be connexe.
12499 - The glue between two quadrangle faces should be applied.
12502 theCompound The compound to check.
12503 theIsUseC1 Flag to check if there are 4 bounds on a face
12504 taking into account C1 continuity.
12505 theAngTolerance the angular tolerance to check if two neighbor
12506 edges are codirectional in the common vertex with this
12507 tolerance. This parameter is used only if
12508 theIsUseC1 is set to True.
12511 TRUE, if the given shape is a compound of blocks.
12512 If theCompound is not valid, prints all discovered errors.
12514 # Example: see GEOM_Spanner.py
12517 aTolerance = theAngTolerance
12518 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
12519 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
12521 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
12525 ## Retrieve all non blocks solids and faces from \a theShape.
12526 # @param theShape The shape to explore.
12527 # @param theIsUseC1 Flag to check if there are 4 bounds on a face
12528 # taking into account C1 continuity.
12529 # @param theAngTolerance the angular tolerance to check if two neighbor
12530 # edges are codirectional in the common vertex with this
12531 # tolerance. This parameter is used only if
12532 # <VAR>theIsUseC1</VAR> is set to True.
12533 # @param theName Object name; when specified, this parameter is used
12534 # for result publication in the study. Otherwise, if automatic
12535 # publication is switched on, default value is used for result name.
12537 # @return A tuple of two GEOM_Objects. The first object is a group of all
12538 # non block solids (= not 6 faces, or with 6 faces, but with the
12539 # presence of non-quadrangular faces). The second object is a
12540 # group of all non quadrangular faces (= faces with more then
12541 # 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12542 # with 1 wire with not 4 edges that do not form 4 bounds of
12545 # @ref tui_get_non_blocks_page "Example 1"
12546 # \n @ref swig_GetNonBlocks "Example 2"
12547 @ManageTransactions("BlocksOp")
12548 def GetNonBlocks (self, theShape, theIsUseC1 = False,
12549 theAngTolerance = 1.e-12, theName=None):
12551 Retrieve all non blocks solids and faces from theShape.
12554 theShape The shape to explore.
12555 theIsUseC1 Flag to check if there are 4 bounds on a face
12556 taking into account C1 continuity.
12557 theAngTolerance the angular tolerance to check if two neighbor
12558 edges are codirectional in the common vertex with this
12559 tolerance. This parameter is used only if
12560 theIsUseC1 is set to True.
12561 theName Object name; when specified, this parameter is used
12562 for result publication in the study. Otherwise, if automatic
12563 publication is switched on, default value is used for result name.
12566 A tuple of two GEOM_Objects. The first object is a group of all
12567 non block solids (= not 6 faces, or with 6 faces, but with the
12568 presence of non-quadrangular faces). The second object is a
12569 group of all non quadrangular faces (= faces with more then
12570 1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
12571 with 1 wire with not 4 edges that do not form 4 bounds of
12575 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
12577 # Example: see GEOM_Spanner.py
12580 aTolerance = theAngTolerance
12581 aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
12582 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
12583 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
12586 ## Remove all seam and degenerated edges from \a theShape.
12587 # Unite faces and edges, sharing one surface. It means that
12588 # this faces must have references to one C++ surface object (handle).
12589 # @param theShape The compound or single solid to remove irregular edges from.
12590 # @param doUnionFaces If True, then unite faces. If False (the default value),
12591 # do not unite faces.
12592 # @param theName Object name; when specified, this parameter is used
12593 # for result publication in the study. Otherwise, if automatic
12594 # publication is switched on, default value is used for result name.
12596 # @return Improved shape.
12598 # @ref swig_RemoveExtraEdges "Example"
12599 @ManageTransactions("BlocksOp")
12600 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
12602 Remove all seam and degenerated edges from theShape.
12603 Unite faces and edges, sharing one surface. It means that
12604 this faces must have references to one C++ surface object (handle).
12607 theShape The compound or single solid to remove irregular edges from.
12608 doUnionFaces If True, then unite faces. If False (the default value),
12609 do not unite faces.
12610 theName Object name; when specified, this parameter is used
12611 for result publication in the study. Otherwise, if automatic
12612 publication is switched on, default value is used for result name.
12617 # Example: see GEOM_TestOthers.py
12618 nbFacesOptimum = -1 # -1 means do not unite faces
12619 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
12620 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
12621 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
12622 self._autoPublish(anObj, theName, "removeExtraEdges")
12625 ## Performs union faces of \a theShape
12626 # Unite faces sharing one surface. It means that
12627 # these faces must have references to one C++ surface object (handle).
12628 # @param theShape The compound or single solid that contains faces
12629 # to perform union.
12630 # @param theName Object name; when specified, this parameter is used
12631 # for result publication in the study. Otherwise, if automatic
12632 # publication is switched on, default value is used for result name.
12634 # @return Improved shape.
12636 # @ref swig_UnionFaces "Example"
12637 @ManageTransactions("BlocksOp")
12638 def UnionFaces(self, theShape, theName=None):
12640 Performs union faces of theShape.
12641 Unite faces sharing one surface. It means that
12642 these faces must have references to one C++ surface object (handle).
12645 theShape The compound or single solid that contains faces
12647 theName Object name; when specified, this parameter is used
12648 for result publication in the study. Otherwise, if automatic
12649 publication is switched on, default value is used for result name.
12654 # Example: see GEOM_TestOthers.py
12655 anObj = self.BlocksOp.UnionFaces(theShape)
12656 RaiseIfFailed("UnionFaces", self.BlocksOp)
12657 self._autoPublish(anObj, theName, "unionFaces")
12660 ## Check, if the given shape is a blocks compound.
12661 # Fix all detected errors.
12662 # \note Single block can be also fixed by this method.
12663 # @param theShape The compound to check and improve.
12664 # @param theName Object name; when specified, this parameter is used
12665 # for result publication in the study. Otherwise, if automatic
12666 # publication is switched on, default value is used for result name.
12668 # @return Improved compound.
12670 # @ref swig_CheckAndImprove "Example"
12671 @ManageTransactions("BlocksOp")
12672 def CheckAndImprove(self, theShape, theName=None):
12674 Check, if the given shape is a blocks compound.
12675 Fix all detected errors.
12678 Single block can be also fixed by this method.
12681 theShape The compound to check and improve.
12682 theName Object name; when specified, this parameter is used
12683 for result publication in the study. Otherwise, if automatic
12684 publication is switched on, default value is used for result name.
12689 # Example: see GEOM_TestOthers.py
12690 anObj = self.BlocksOp.CheckAndImprove(theShape)
12691 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
12692 self._autoPublish(anObj, theName, "improved")
12695 # end of l4_blocks_measure
12698 ## @addtogroup l3_blocks_op
12701 ## Get all the blocks, contained in the given compound.
12702 # @param theCompound The compound to explode.
12703 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
12704 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
12705 # @param theName Object name; when specified, this parameter is used
12706 # for result publication in the study. Otherwise, if automatic
12707 # publication is switched on, default value is used for result name.
12709 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12711 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
12713 # @ref tui_explode_on_blocks "Example 1"
12714 # \n @ref swig_MakeBlockExplode "Example 2"
12715 @ManageTransactions("BlocksOp")
12716 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
12718 Get all the blocks, contained in the given compound.
12721 theCompound The compound to explode.
12722 theMinNbFaces If solid has lower number of faces, it is not a block.
12723 theMaxNbFaces If solid has higher number of faces, it is not a block.
12724 theName Object name; when specified, this parameter is used
12725 for result publication in the study. Otherwise, if automatic
12726 publication is switched on, default value is used for result name.
12729 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
12732 List of GEOM.GEOM_Object, containing the retrieved blocks.
12734 # Example: see GEOM_TestOthers.py
12735 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
12736 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
12737 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
12738 for anObj in aList:
12739 anObj.SetParameters(Parameters)
12741 self._autoPublish(aList, theName, "block")
12744 ## Find block, containing the given point inside its volume or on boundary.
12745 # @param theCompound Compound, to find block in.
12746 # @param thePoint Point, close to the desired block. If the point lays on
12747 # boundary between some blocks, we return block with nearest center.
12748 # @param theName Object name; when specified, this parameter is used
12749 # for result publication in the study. Otherwise, if automatic
12750 # publication is switched on, default value is used for result name.
12752 # @return New GEOM.GEOM_Object, containing the found block.
12754 # @ref swig_todo "Example"
12755 @ManageTransactions("BlocksOp")
12756 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
12758 Find block, containing the given point inside its volume or on boundary.
12761 theCompound Compound, to find block in.
12762 thePoint Point, close to the desired block. If the point lays on
12763 boundary between some blocks, we return block with nearest center.
12764 theName Object name; when specified, this parameter is used
12765 for result publication in the study. Otherwise, if automatic
12766 publication is switched on, default value is used for result name.
12769 New GEOM.GEOM_Object, containing the found block.
12771 # Example: see GEOM_Spanner.py
12772 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
12773 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
12774 self._autoPublish(anObj, theName, "block")
12777 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12778 # @param theCompound Compound, to find block in.
12779 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
12780 # @param theName Object name; when specified, this parameter is used
12781 # for result publication in the study. Otherwise, if automatic
12782 # publication is switched on, default value is used for result name.
12784 # @return New GEOM.GEOM_Object, containing the found block.
12786 # @ref swig_GetBlockByParts "Example"
12787 @ManageTransactions("BlocksOp")
12788 def GetBlockByParts(self, theCompound, theParts, theName=None):
12790 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
12793 theCompound Compound, to find block in.
12794 theParts List of faces and/or edges and/or vertices to be parts of the found block.
12795 theName Object name; when specified, this parameter is used
12796 for result publication in the study. Otherwise, if automatic
12797 publication is switched on, default value is used for result name.
12800 New GEOM_Object, containing the found block.
12802 # Example: see GEOM_TestOthers.py
12803 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
12804 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
12805 self._autoPublish(anObj, theName, "block")
12808 ## Return all blocks, containing all the elements, passed as the parts.
12809 # @param theCompound Compound, to find blocks in.
12810 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12811 # @param theName Object name; when specified, this parameter is used
12812 # for result publication in the study. Otherwise, if automatic
12813 # publication is switched on, default value is used for result name.
12815 # @return List of GEOM.GEOM_Object, containing the found blocks.
12817 # @ref swig_todo "Example"
12818 @ManageTransactions("BlocksOp")
12819 def GetBlocksByParts(self, theCompound, theParts, theName=None):
12821 Return all blocks, containing all the elements, passed as the parts.
12824 theCompound Compound, to find blocks in.
12825 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
12826 theName Object name; when specified, this parameter is used
12827 for result publication in the study. Otherwise, if automatic
12828 publication is switched on, default value is used for result name.
12831 List of GEOM.GEOM_Object, containing the found blocks.
12833 # Example: see GEOM_Spanner.py
12834 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
12835 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
12836 self._autoPublish(aList, theName, "block")
12839 ## Multi-transformate block and glue the result.
12840 # Transformation is defined so, as to superpose direction faces.
12841 # @param Block Hexahedral solid to be multi-transformed.
12842 # @param DirFace1 ID of First direction face.
12843 # @param DirFace2 ID of Second direction face.
12844 # @param NbTimes Quantity of transformations to be done.
12845 # @param theName Object name; when specified, this parameter is used
12846 # for result publication in the study. Otherwise, if automatic
12847 # publication is switched on, default value is used for result name.
12849 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12851 # @return New GEOM.GEOM_Object, containing the result shape.
12853 # @ref tui_multi_transformation "Example"
12854 @ManageTransactions("BlocksOp")
12855 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
12857 Multi-transformate block and glue the result.
12858 Transformation is defined so, as to superpose direction faces.
12861 Block Hexahedral solid to be multi-transformed.
12862 DirFace1 ID of First direction face.
12863 DirFace2 ID of Second direction face.
12864 NbTimes Quantity of transformations to be done.
12865 theName Object name; when specified, this parameter is used
12866 for result publication in the study. Otherwise, if automatic
12867 publication is switched on, default value is used for result name.
12870 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
12873 New GEOM.GEOM_Object, containing the result shape.
12875 # Example: see GEOM_Spanner.py
12876 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
12877 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
12878 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
12879 anObj.SetParameters(Parameters)
12880 self._autoPublish(anObj, theName, "transformed")
12883 ## Multi-transformate block and glue the result.
12884 # @param Block Hexahedral solid to be multi-transformed.
12885 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12886 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12887 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
12888 # @param theName Object name; when specified, this parameter is used
12889 # for result publication in the study. Otherwise, if automatic
12890 # publication is switched on, default value is used for result name.
12892 # @return New GEOM.GEOM_Object, containing the result shape.
12894 # @ref tui_multi_transformation "Example"
12895 @ManageTransactions("BlocksOp")
12896 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
12897 DirFace1V, DirFace2V, NbTimesV, theName=None):
12899 Multi-transformate block and glue the result.
12902 Block Hexahedral solid to be multi-transformed.
12903 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
12904 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
12905 NbTimesU,NbTimesV Quantity of transformations to be done.
12906 theName Object name; when specified, this parameter is used
12907 for result publication in the study. Otherwise, if automatic
12908 publication is switched on, default value is used for result name.
12911 New GEOM.GEOM_Object, containing the result shape.
12913 # Example: see GEOM_Spanner.py
12914 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
12915 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
12916 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
12917 DirFace1V, DirFace2V, NbTimesV)
12918 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
12919 anObj.SetParameters(Parameters)
12920 self._autoPublish(anObj, theName, "transformed")
12923 ## Build all possible propagation groups.
12924 # Propagation group is a set of all edges, opposite to one (main)
12925 # edge of this group directly or through other opposite edges.
12926 # Notion of Opposite Edge make sense only on quadrangle face.
12927 # @param theShape Shape to build propagation groups on.
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 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
12934 # @ref swig_Propagate "Example"
12935 @ManageTransactions("BlocksOp")
12936 def Propagate(self, theShape, theName=None):
12938 Build all possible propagation groups.
12939 Propagation group is a set of all edges, opposite to one (main)
12940 edge of this group directly or through other opposite edges.
12941 Notion of Opposite Edge make sense only on quadrangle face.
12944 theShape Shape to build propagation groups on.
12945 theName Object name; when specified, this parameter is used
12946 for result publication in the study. Otherwise, if automatic
12947 publication is switched on, default value is used for result name.
12950 List of GEOM.GEOM_Object, each of them is a propagation group.
12952 # Example: see GEOM_TestOthers.py
12953 listChains = self.BlocksOp.Propagate(theShape)
12954 RaiseIfFailed("Propagate", self.BlocksOp)
12955 self._autoPublish(listChains, theName, "propagate")
12958 # end of l3_blocks_op
12961 ## @addtogroup l3_groups
12964 ## Creates a new group which will store sub-shapes of theMainShape
12965 # @param theMainShape is a GEOM object on which the group is selected
12966 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
12967 # @param theName Object name; when specified, this parameter is used
12968 # for result publication in the study. Otherwise, if automatic
12969 # publication is switched on, default value is used for result name.
12971 # @return a newly created GEOM group (GEOM.GEOM_Object)
12973 # @ref tui_working_with_groups_page "Example 1"
12974 # \n @ref swig_CreateGroup "Example 2"
12975 @ManageTransactions("GroupOp")
12976 def CreateGroup(self, theMainShape, theShapeType, theName=None):
12978 Creates a new group which will store sub-shapes of theMainShape
12981 theMainShape is a GEOM object on which the group is selected
12982 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
12983 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
12984 theName Object name; when specified, this parameter is used
12985 for result publication in the study. Otherwise, if automatic
12986 publication is switched on, default value is used for result name.
12989 a newly created GEOM group
12992 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
12995 # Example: see GEOM_TestOthers.py
12996 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
12997 RaiseIfFailed("CreateGroup", self.GroupOp)
12998 self._autoPublish(anObj, theName, "group")
13001 ## Adds a sub-object with ID theSubShapeId to the group
13002 # @param theGroup is a GEOM group to which the new sub-shape is added
13003 # @param theSubShapeID is a sub-shape ID in the main object.
13004 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13006 # @ref tui_working_with_groups_page "Example"
13007 @ManageTransactions("GroupOp")
13008 def AddObject(self,theGroup, theSubShapeID):
13010 Adds a sub-object with ID theSubShapeId to the group
13013 theGroup is a GEOM group to which the new sub-shape is added
13014 theSubShapeID is a sub-shape ID in the main object.
13017 Use method GetSubShapeID() to get an unique ID of the sub-shape
13019 # Example: see GEOM_TestOthers.py
13020 self.GroupOp.AddObject(theGroup, theSubShapeID)
13021 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
13022 RaiseIfFailed("AddObject", self.GroupOp)
13026 ## Removes a sub-object with ID \a theSubShapeId from the group
13027 # @param theGroup is a GEOM group from which the new sub-shape is removed
13028 # @param theSubShapeID is a sub-shape ID in the main object.
13029 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
13031 # @ref tui_working_with_groups_page "Example"
13032 @ManageTransactions("GroupOp")
13033 def RemoveObject(self,theGroup, theSubShapeID):
13035 Removes a sub-object with ID theSubShapeId from the group
13038 theGroup is a GEOM group from which the new sub-shape is removed
13039 theSubShapeID is a sub-shape ID in the main object.
13042 Use method GetSubShapeID() to get an unique ID of the sub-shape
13044 # Example: see GEOM_TestOthers.py
13045 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
13046 RaiseIfFailed("RemoveObject", self.GroupOp)
13049 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13050 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13051 # @param theSubShapes is a list of sub-shapes to be added.
13053 # @ref tui_working_with_groups_page "Example"
13054 @ManageTransactions("GroupOp")
13055 def UnionList (self,theGroup, theSubShapes):
13057 Adds to the group all the given shapes. No errors, if some shapes are already included.
13060 theGroup is a GEOM group to which the new sub-shapes are added.
13061 theSubShapes is a list of sub-shapes to be added.
13063 # Example: see GEOM_TestOthers.py
13064 self.GroupOp.UnionList(theGroup, theSubShapes)
13065 RaiseIfFailed("UnionList", self.GroupOp)
13068 ## Adds to the group all the given shapes. No errors, if some shapes are already included.
13069 # @param theGroup is a GEOM group to which the new sub-shapes are added.
13070 # @param theSubShapes is a list of indices of sub-shapes to be added.
13072 # @ref swig_UnionIDs "Example"
13073 @ManageTransactions("GroupOp")
13074 def UnionIDs(self,theGroup, theSubShapes):
13076 Adds to the group all the given shapes. No errors, if some shapes are already included.
13079 theGroup is a GEOM group to which the new sub-shapes are added.
13080 theSubShapes is a list of indices of sub-shapes to be added.
13082 # Example: see GEOM_TestOthers.py
13083 self.GroupOp.UnionIDs(theGroup, theSubShapes)
13084 RaiseIfFailed("UnionIDs", self.GroupOp)
13087 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13088 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13089 # @param theSubShapes is a list of sub-shapes to be removed.
13091 # @ref tui_working_with_groups_page "Example"
13092 @ManageTransactions("GroupOp")
13093 def DifferenceList (self,theGroup, theSubShapes):
13095 Removes from the group all the given shapes. No errors, if some shapes are not included.
13098 theGroup is a GEOM group from which the sub-shapes are removed.
13099 theSubShapes is a list of sub-shapes to be removed.
13101 # Example: see GEOM_TestOthers.py
13102 self.GroupOp.DifferenceList(theGroup, theSubShapes)
13103 RaiseIfFailed("DifferenceList", self.GroupOp)
13106 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
13107 # @param theGroup is a GEOM group from which the sub-shapes are removed.
13108 # @param theSubShapes is a list of indices of sub-shapes to be removed.
13110 # @ref swig_DifferenceIDs "Example"
13111 @ManageTransactions("GroupOp")
13112 def DifferenceIDs(self,theGroup, theSubShapes):
13114 Removes from the group all the given shapes. No errors, if some shapes are not included.
13117 theGroup is a GEOM group from which the sub-shapes are removed.
13118 theSubShapes is a list of indices of sub-shapes to be removed.
13120 # Example: see GEOM_TestOthers.py
13121 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
13122 RaiseIfFailed("DifferenceIDs", self.GroupOp)
13125 ## Union of two groups.
13126 # New group is created. It will contain all entities
13127 # which are present in groups theGroup1 and theGroup2.
13128 # @param theGroup1, theGroup2 are the initial GEOM groups
13129 # to create the united group from.
13130 # @param theName Object name; when specified, this parameter is used
13131 # for result publication in the study. Otherwise, if automatic
13132 # publication is switched on, default value is used for result name.
13134 # @return a newly created GEOM group.
13136 # @ref tui_union_groups_anchor "Example"
13137 @ManageTransactions("GroupOp")
13138 def UnionGroups (self, theGroup1, theGroup2, theName=None):
13140 Union of two groups.
13141 New group is created. It will contain all entities
13142 which are present in groups theGroup1 and theGroup2.
13145 theGroup1, theGroup2 are the initial GEOM groups
13146 to create the united group from.
13147 theName Object name; when specified, this parameter is used
13148 for result publication in the study. Otherwise, if automatic
13149 publication is switched on, default value is used for result name.
13152 a newly created GEOM group.
13154 # Example: see GEOM_TestOthers.py
13155 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
13156 RaiseIfFailed("UnionGroups", self.GroupOp)
13157 self._autoPublish(aGroup, theName, "group")
13160 ## Intersection of two groups.
13161 # New group is created. It will contain only those entities
13162 # which are present in both groups theGroup1 and theGroup2.
13163 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13164 # @param theName Object name; when specified, this parameter is used
13165 # for result publication in the study. Otherwise, if automatic
13166 # publication is switched on, default value is used for result name.
13168 # @return a newly created GEOM group.
13170 # @ref tui_intersect_groups_anchor "Example"
13171 @ManageTransactions("GroupOp")
13172 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
13174 Intersection of two groups.
13175 New group is created. It will contain only those entities
13176 which are present in both groups theGroup1 and theGroup2.
13179 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
13180 theName Object name; when specified, this parameter is used
13181 for result publication in the study. Otherwise, if automatic
13182 publication is switched on, default value is used for result name.
13185 a newly created GEOM group.
13187 # Example: see GEOM_TestOthers.py
13188 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
13189 RaiseIfFailed("IntersectGroups", self.GroupOp)
13190 self._autoPublish(aGroup, theName, "group")
13193 ## Cut of two groups.
13194 # New group is created. It will contain entities which are
13195 # present in group theGroup1 but are not present in group theGroup2.
13196 # @param theGroup1 is a GEOM group to include elements of.
13197 # @param theGroup2 is a GEOM group to exclude elements of.
13198 # @param theName Object name; when specified, this parameter is used
13199 # for result publication in the study. Otherwise, if automatic
13200 # publication is switched on, default value is used for result name.
13202 # @return a newly created GEOM group.
13204 # @ref tui_cut_groups_anchor "Example"
13205 @ManageTransactions("GroupOp")
13206 def CutGroups (self, theGroup1, theGroup2, theName=None):
13209 New group is created. It will contain entities which are
13210 present in group theGroup1 but are not present in group theGroup2.
13213 theGroup1 is a GEOM group to include elements of.
13214 theGroup2 is a GEOM group to exclude elements of.
13215 theName Object name; when specified, this parameter is used
13216 for result publication in the study. Otherwise, if automatic
13217 publication is switched on, default value is used for result name.
13220 a newly created GEOM group.
13222 # Example: see GEOM_TestOthers.py
13223 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
13224 RaiseIfFailed("CutGroups", self.GroupOp)
13225 self._autoPublish(aGroup, theName, "group")
13228 ## Union of list of groups.
13229 # New group is created. It will contain all entities that are
13230 # present in groups listed in theGList.
13231 # @param theGList is a list of GEOM groups to create the united group from.
13232 # @param theName Object name; when specified, this parameter is used
13233 # for result publication in the study. Otherwise, if automatic
13234 # publication is switched on, default value is used for result name.
13236 # @return a newly created GEOM group.
13238 # @ref tui_union_groups_anchor "Example"
13239 @ManageTransactions("GroupOp")
13240 def UnionListOfGroups (self, theGList, theName=None):
13242 Union of list of groups.
13243 New group is created. It will contain all entities that are
13244 present in groups listed in theGList.
13247 theGList is a list of GEOM groups to create the united group from.
13248 theName Object name; when specified, this parameter is used
13249 for result publication in the study. Otherwise, if automatic
13250 publication is switched on, default value is used for result name.
13253 a newly created GEOM group.
13255 # Example: see GEOM_TestOthers.py
13256 aGroup = self.GroupOp.UnionListOfGroups(theGList)
13257 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
13258 self._autoPublish(aGroup, theName, "group")
13261 ## Cut of lists of groups.
13262 # New group is created. It will contain only entities
13263 # which are present in groups listed in theGList.
13264 # @param theGList is a list of GEOM groups to include elements of.
13265 # @param theName Object name; when specified, this parameter is used
13266 # for result publication in the study. Otherwise, if automatic
13267 # publication is switched on, default value is used for result name.
13269 # @return a newly created GEOM group.
13271 # @ref tui_intersect_groups_anchor "Example"
13272 @ManageTransactions("GroupOp")
13273 def IntersectListOfGroups (self, theGList, theName=None):
13275 Cut of lists of groups.
13276 New group is created. It will contain only entities
13277 which are present in groups listed in theGList.
13280 theGList is a list of GEOM groups to include elements of.
13281 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.
13286 a newly created GEOM group.
13288 # Example: see GEOM_TestOthers.py
13289 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
13290 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
13291 self._autoPublish(aGroup, theName, "group")
13294 ## Cut of lists of groups.
13295 # New group is created. It will contain only entities
13296 # which are present in groups listed in theGList1 but
13297 # are not present in groups from theGList2.
13298 # @param theGList1 is a list of GEOM groups to include elements of.
13299 # @param theGList2 is a list of GEOM groups to exclude elements of.
13300 # @param theName Object name; when specified, this parameter is used
13301 # for result publication in the study. Otherwise, if automatic
13302 # publication is switched on, default value is used for result name.
13304 # @return a newly created GEOM group.
13306 # @ref tui_cut_groups_anchor "Example"
13307 @ManageTransactions("GroupOp")
13308 def CutListOfGroups (self, theGList1, theGList2, theName=None):
13310 Cut of lists of groups.
13311 New group is created. It will contain only entities
13312 which are present in groups listed in theGList1 but
13313 are not present in groups from theGList2.
13316 theGList1 is a list of GEOM groups to include elements of.
13317 theGList2 is a list of GEOM groups to exclude elements of.
13318 theName Object name; when specified, this parameter is used
13319 for result publication in the study. Otherwise, if automatic
13320 publication is switched on, default value is used for result name.
13323 a newly created GEOM group.
13325 # Example: see GEOM_TestOthers.py
13326 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
13327 RaiseIfFailed("CutListOfGroups", self.GroupOp)
13328 self._autoPublish(aGroup, theName, "group")
13331 ## Returns a list of sub-objects ID stored in the group
13332 # @param theGroup is a GEOM group for which a list of IDs is requested
13334 # @ref swig_GetObjectIDs "Example"
13335 @ManageTransactions("GroupOp")
13336 def GetObjectIDs(self,theGroup):
13338 Returns a list of sub-objects ID stored in the group
13341 theGroup is a GEOM group for which a list of IDs is requested
13343 # Example: see GEOM_TestOthers.py
13344 ListIDs = self.GroupOp.GetObjects(theGroup)
13345 RaiseIfFailed("GetObjects", self.GroupOp)
13348 ## Returns a type of sub-objects stored in the group
13349 # @param theGroup is a GEOM group which type is returned.
13351 # @ref swig_GetType "Example"
13352 @ManageTransactions("GroupOp")
13353 def GetType(self,theGroup):
13355 Returns a type of sub-objects stored in the group
13358 theGroup is a GEOM group which type is returned.
13360 # Example: see GEOM_TestOthers.py
13361 aType = self.GroupOp.GetType(theGroup)
13362 RaiseIfFailed("GetType", self.GroupOp)
13365 ## Convert a type of geom object from id to string value
13366 # @param theId is a GEOM object type id.
13367 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13368 # @ref swig_GetType "Example"
13369 def ShapeIdToType(self, theId):
13371 Convert a type of geom object from id to string value
13374 theId is a GEOM object type id.
13377 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
13404 return "REVOLUTION"
13452 return "FREE_BOUNDS"
13460 return "THRUSECTIONS"
13462 return "COMPOUNDFILTER"
13464 return "SHAPES_ON_SHAPE"
13466 return "ELLIPSE_ARC"
13468 return "3DSKETCHER"
13474 return "PIPETSHAPE"
13475 return "Shape Id not exist."
13477 ## Returns a main shape associated with the group
13478 # @param theGroup is a GEOM group for which a main shape object is requested
13479 # @return a GEOM object which is a main shape for theGroup
13481 # @ref swig_GetMainShape "Example"
13482 @ManageTransactions("GroupOp")
13483 def GetMainShape(self,theGroup):
13485 Returns a main shape associated with the group
13488 theGroup is a GEOM group for which a main shape object is requested
13491 a GEOM object which is a main shape for theGroup
13493 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
13495 # Example: see GEOM_TestOthers.py
13496 anObj = self.GroupOp.GetMainShape(theGroup)
13497 RaiseIfFailed("GetMainShape", self.GroupOp)
13500 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
13501 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13502 # @param theShape given shape (see GEOM.GEOM_Object)
13503 # @param min_length minimum length of edges of theShape
13504 # @param max_length maximum length of edges of theShape
13505 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13506 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13507 # @param theName Object name; when specified, this parameter is used
13508 # for result publication in the study. Otherwise, if automatic
13509 # publication is switched on, default value is used for result name.
13511 # @return a newly created GEOM group of edges
13513 # @@ref swig_todo "Example"
13514 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
13516 Create group of edges of theShape, whose length is in range [min_length, max_length].
13517 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13520 theShape given shape
13521 min_length minimum length of edges of theShape
13522 max_length maximum length of edges of theShape
13523 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13524 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13525 theName Object name; when specified, this parameter is used
13526 for result publication in the study. Otherwise, if automatic
13527 publication is switched on, default value is used for result name.
13530 a newly created GEOM group of edges.
13532 edges = self.SubShapeAll(theShape, self.ShapeType["EDGE"])
13533 edges_in_range = []
13535 Props = self.BasicProperties(edge)
13536 if min_length <= Props[0] and Props[0] <= max_length:
13537 if (not include_min) and (min_length == Props[0]):
13540 if (not include_max) and (Props[0] == max_length):
13543 edges_in_range.append(edge)
13545 if len(edges_in_range) <= 0:
13546 print("No edges found by given criteria")
13549 # note: auto-publishing is done in self.CreateGroup()
13550 group_edges = self.CreateGroup(theShape, self.ShapeType["EDGE"], theName)
13551 self.UnionList(group_edges, edges_in_range)
13555 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
13556 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
13557 # @param min_length minimum length of edges of selected shape
13558 # @param max_length maximum length of edges of selected shape
13559 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13560 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13561 # @return a newly created GEOM group of edges
13562 # @ref swig_todo "Example"
13563 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
13565 Create group of edges of selected shape, whose length is in range [min_length, max_length].
13566 If include_min/max == 0, edges with length == min/max_length will not be included in result.
13569 min_length minimum length of edges of selected shape
13570 max_length maximum length of edges of selected shape
13571 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
13572 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
13575 a newly created GEOM group of edges.
13577 nb_selected = sg.SelectedCount()
13578 if nb_selected < 1:
13579 print("Select a shape before calling this function, please.")
13581 if nb_selected > 1:
13582 print("Only one shape must be selected")
13585 id_shape = sg.getSelected(0)
13586 shape = IDToObject( id_shape )
13588 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
13592 if include_min: left_str = " <= "
13593 if include_max: right_str = " <= "
13595 self.addToStudyInFather(shape, group_edges, "Group of edges with " + repr(min_length)
13596 + left_str + "length" + right_str + repr(max_length))
13598 sg.updateObjBrowser()
13605 #@@ insert new functions before this line @@ do not remove this line @@#
13607 ## Create a copy of the given object
13609 # @param theOriginal geometry object for copy
13610 # @param theName Object name; when specified, this parameter is used
13611 # for result publication in the study. Otherwise, if automatic
13612 # publication is switched on, default value is used for result name.
13614 # @return New GEOM_Object, containing the copied shape.
13616 # @ingroup l1_geomBuilder_auxiliary
13617 # @ref swig_MakeCopy "Example"
13618 @ManageTransactions("InsertOp")
13619 def MakeCopy(self, theOriginal, theName=None):
13621 Create a copy of the given object
13624 theOriginal geometry object for copy
13625 theName Object name; when specified, this parameter is used
13626 for result publication in the study. Otherwise, if automatic
13627 publication is switched on, default value is used for result name.
13630 New GEOM_Object, containing the copied shape.
13632 Example of usage: Copy = geompy.MakeCopy(Box)
13634 # Example: see GEOM_TestAll.py
13635 anObj = self.InsertOp.MakeCopy(theOriginal)
13636 RaiseIfFailed("MakeCopy", self.InsertOp)
13637 self._autoPublish(anObj, theName, "copy")
13640 ## Add Path to load python scripts from
13641 # @param Path a path to load python scripts from
13642 # @ingroup l1_geomBuilder_auxiliary
13643 def addPath(self,Path):
13645 Add Path to load python scripts from
13648 Path a path to load python scripts from
13650 if (sys.path.count(Path) < 1):
13651 sys.path.append(Path)
13655 ## Load marker texture from the file
13656 # @param Path a path to the texture file
13657 # @return unique texture identifier
13658 # @ingroup l1_geomBuilder_auxiliary
13659 @ManageTransactions("InsertOp")
13660 def LoadTexture(self, Path):
13662 Load marker texture from the file
13665 Path a path to the texture file
13668 unique texture identifier
13670 # Example: see GEOM_TestAll.py
13671 ID = self.InsertOp.LoadTexture(Path)
13672 RaiseIfFailed("LoadTexture", self.InsertOp)
13675 ## Get internal name of the object based on its study entry
13676 # @note This method does not provide an unique identifier of the geometry object.
13677 # @note This is internal function of GEOM component, though it can be used outside it for
13678 # appropriate reason (e.g. for identification of geometry object).
13679 # @param obj geometry object
13680 # @return unique object identifier
13681 # @ingroup l1_geomBuilder_auxiliary
13682 def getObjectID(self, obj):
13684 Get internal name of the object based on its study entry.
13685 Note: this method does not provide an unique identifier of the geometry object.
13686 It is an internal function of GEOM component, though it can be used outside GEOM for
13687 appropriate reason (e.g. for identification of geometry object).
13690 obj geometry object
13693 unique object identifier
13696 entry = salome.ObjectToID(obj)
13697 if entry is not None:
13698 lst = entry.split(":")
13700 ID = lst[-1] # -1 means last item in the list
13701 return "GEOM_" + ID
13706 ## Add marker texture. @a Width and @a Height parameters
13707 # specify width and height of the texture in pixels.
13708 # If @a RowData is @c True, @a Texture parameter should represent texture data
13709 # packed into the byte array. If @a RowData is @c False (default), @a Texture
13710 # parameter should be unpacked string, in which '1' symbols represent opaque
13711 # pixels and '0' represent transparent pixels of the texture bitmap.
13713 # @param Width texture width in pixels
13714 # @param Height texture height in pixels
13715 # @param Texture texture data
13716 # @param RowData if @c True, @a Texture data are packed in the byte stream
13717 # @return unique texture identifier
13718 # @ingroup l1_geomBuilder_auxiliary
13719 @ManageTransactions("InsertOp")
13720 def AddTexture(self, Width, Height, Texture, RowData=False):
13722 Add marker texture. Width and Height parameters
13723 specify width and height of the texture in pixels.
13724 If RowData is True, Texture parameter should represent texture data
13725 packed into the byte array. If RowData is False (default), Texture
13726 parameter should be unpacked string, in which '1' symbols represent opaque
13727 pixels and '0' represent transparent pixels of the texture bitmap.
13730 Width texture width in pixels
13731 Height texture height in pixels
13732 Texture texture data
13733 RowData if True, Texture data are packed in the byte stream
13736 return unique texture identifier
13738 if not RowData: Texture = PackData(Texture)
13739 ID = self.InsertOp.AddTexture(Width, Height, Texture)
13740 RaiseIfFailed("AddTexture", self.InsertOp)
13743 ## Transfer not topological data from one GEOM object to another.
13745 # @param theObjectFrom the source object of non-topological data
13746 # @param theObjectTo the destination object of non-topological data
13747 # @param theFindMethod method to search sub-shapes of theObjectFrom
13748 # in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
13749 # GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
13750 # Other values of GEOM.find_shape_method are not supported.
13752 # @return True in case of success; False otherwise.
13754 # @ingroup l1_geomBuilder_auxiliary
13756 # @ref swig_TransferData "Example"
13757 @ManageTransactions("InsertOp")
13758 def TransferData(self, theObjectFrom, theObjectTo,
13759 theFindMethod=GEOM.FSM_GetInPlace):
13761 Transfer not topological data from one GEOM object to another.
13764 theObjectFrom the source object of non-topological data
13765 theObjectTo the destination object of non-topological data
13766 theFindMethod method to search sub-shapes of theObjectFrom
13767 in shape theObjectTo. Possible values are:
13768 GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
13769 and GEOM.FSM_GetInPlace_Old. Other values of
13770 GEOM.find_shape_method are not supported.
13773 True in case of success; False otherwise.
13775 # Example: see GEOM_TestOthers.py
13777 # Example: see GEOM_TestAll.py
13778 isOk = self.InsertOp.TransferData(theObjectFrom,
13779 theObjectTo, theFindMethod)
13780 RaiseIfFailed("TransferData", self.InsertOp)
13783 ## Creates a new folder object. It is a container for any GEOM objects.
13784 # @param Name name of the container
13785 # @param Father parent object. If None,
13786 # folder under 'Geometry' root object will be created.
13787 # @return a new created folder
13788 # @ingroup l1_publish_data
13789 def NewFolder(self, Name, Father=None):
13791 Create a new folder object. It is an auxiliary container for any GEOM objects.
13794 Name name of the container
13795 Father parent object. If None,
13796 folder under 'Geometry' root object will be created.
13799 a new created folder
13801 if not Father: Father = self.father
13802 return self.CreateFolder(Name, Father)
13804 ## Move object to the specified folder
13805 # @param Object object to move
13806 # @param Folder target folder
13807 # @ingroup l1_publish_data
13808 def PutToFolder(self, Object, Folder):
13810 Move object to the specified folder
13813 Object object to move
13814 Folder target folder
13816 self.MoveToFolder(Object, Folder)
13819 ## Move list of objects to the specified folder
13820 # @param ListOfSO list of objects to move
13821 # @param Folder target folder
13822 # @ingroup l1_publish_data
13823 def PutListToFolder(self, ListOfSO, Folder):
13825 Move list of objects to the specified folder
13828 ListOfSO list of objects to move
13829 Folder target folder
13831 self.MoveListToFolder(ListOfSO, Folder)
13834 ## @addtogroup l2_field
13838 # @param shape the shape the field lies on
13839 # @param name the field name
13840 # @param type type of field data: 0 - bool, 1 - int, 2 - double, 3 - string
13841 # @param dimension dimension of the shape the field lies on
13842 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13843 # @param componentNames names of components
13844 # @return a created field
13845 @ManageTransactions("FieldOp")
13846 def CreateField(self, shape, name, type, dimension, componentNames):
13851 shape the shape the field lies on
13852 name the field name
13853 type type of field data
13854 dimension dimension of the shape the field lies on
13855 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13856 componentNames names of components
13861 if isinstance( type, int ):
13862 if type < 0 or type > 3:
13863 raise RuntimeError("CreateField : Error: data type must be within [0-3] range")
13864 type = [GEOM.FDT_Bool,GEOM.FDT_Int,GEOM.FDT_Double,GEOM.FDT_String][type]
13866 f = self.FieldOp.CreateField( shape, name, type, dimension, componentNames)
13867 RaiseIfFailed("CreateField", self.FieldOp)
13869 geom._autoPublish( f, "", name)
13872 ## Removes a field from the GEOM component
13873 # @param field the field to remove
13874 def RemoveField(self, field):
13875 "Removes a field from the GEOM component"
13877 if isinstance( field, GEOM._objref_GEOM_Field ):
13878 geom.RemoveObject( field )
13879 elif isinstance( field, geomField ):
13880 geom.RemoveObject( field.field )
13882 raise RuntimeError("RemoveField() : the object is not a field")
13885 ## Returns number of fields on a shape
13886 @ManageTransactions("FieldOp")
13887 def CountFields(self, shape):
13888 "Returns number of fields on a shape"
13889 nb = self.FieldOp.CountFields( shape )
13890 RaiseIfFailed("CountFields", self.FieldOp)
13893 ## Returns all fields on a shape
13894 @ManageTransactions("FieldOp")
13895 def GetFields(self, shape):
13896 "Returns all fields on a shape"
13897 ff = self.FieldOp.GetFields( shape )
13898 RaiseIfFailed("GetFields", self.FieldOp)
13901 ## Returns a field on a shape by its name
13902 @ManageTransactions("FieldOp")
13903 def GetField(self, shape, name):
13904 "Returns a field on a shape by its name"
13905 f = self.FieldOp.GetField( shape, name )
13906 RaiseIfFailed("GetField", self.FieldOp)
13913 # Register the new proxy for GEOM_Gen
13914 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geomBuilder)
13917 ## Field on Geometry
13918 # @ingroup l2_field
13919 class geomField( GEOM._objref_GEOM_Field ):
13921 def __init__(self, *args):
13922 GEOM._objref_GEOM_Field.__init__(self, *args)
13923 self.field = GEOM._objref_GEOM_Field
13926 ## Returns the shape the field lies on
13927 def getShape(self):
13928 "Returns the shape the field lies on"
13929 return self.field.GetShape(self)
13931 ## Returns the field name
13933 "Returns the field name"
13934 return self.field.GetName(self)
13936 ## Returns type of field data as integer [0-3]
13938 "Returns type of field data"
13939 return EnumToLong(self.field.GetDataType(self))
13941 ## Returns type of field data:
13942 # one of GEOM.FDT_Bool, GEOM.FDT_Int, GEOM.FDT_Double, GEOM.FDT_String
13943 def getTypeEnum(self):
13944 "Returns type of field data"
13945 return self.field.GetDataType(self)
13947 ## Returns dimension of the shape the field lies on:
13948 # 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape
13949 def getDimension(self):
13950 """Returns dimension of the shape the field lies on:
13951 0 - VERTEX, 1 - EDGE, 2 - FACE, 3 - SOLID, -1 - whole shape"""
13952 return self.field.GetDimension(self)
13954 ## Returns names of components
13955 def getComponents(self):
13956 "Returns names of components"
13957 return self.field.GetComponents(self)
13959 ## Adds a time step to the field
13960 # @param step the time step number further used as the step identifier
13961 # @param stamp the time step time
13962 # @param values the values of the time step
13963 def addStep(self, step, stamp, values):
13964 "Adds a time step to the field"
13965 stp = self.field.AddStep( self, step, stamp )
13967 raise RuntimeError("Field.addStep() : Error: step %s already exists in this field"%step)
13969 geom._autoPublish( stp, "", "Step %s, %s"%(step,stamp))
13970 self.setValues( step, values )
13973 ## Remove a time step from the field
13974 def removeStep(self,step):
13975 "Remove a time step from the field"
13978 stepObj = self.field.GetStep( self, step )
13980 stepSO = geom.myStudy.FindObjectID( stepObj.GetStudyEntry() )
13983 #traceback.print_exc()
13985 self.field.RemoveStep( self, step )
13987 geom.myBuilder.RemoveObjectWithChildren( stepSO )
13990 ## Returns number of time steps in the field
13991 def countSteps(self):
13992 "Returns number of time steps in the field"
13993 return self.field.CountSteps(self)
13995 ## Returns a list of time step IDs in the field
13996 def getSteps(self):
13997 "Returns a list of time step IDs in the field"
13998 return self.field.GetSteps(self)
14000 ## Returns a time step by its ID
14001 def getStep(self,step):
14002 "Returns a time step by its ID"
14003 stp = self.field.GetStep(self, step)
14005 raise RuntimeError("Step %s is missing from this field"%step)
14008 ## Returns the time of the field step
14009 def getStamp(self,step):
14010 "Returns the time of the field step"
14011 return self.getStep(step).GetStamp()
14013 ## Changes the time of the field step
14014 def setStamp(self, step, stamp):
14015 "Changes the time of the field step"
14016 return self.getStep(step).SetStamp(stamp)
14018 ## Returns values of the field step
14019 def getValues(self, step):
14020 "Returns values of the field step"
14021 return self.getStep(step).GetValues()
14023 ## Changes values of the field step
14024 def setValues(self, step, values):
14025 "Changes values of the field step"
14026 stp = self.getStep(step)
14027 errBeg = "Field.setValues(values) : Error: "
14029 ok = stp.SetValues( values )
14030 except Exception as e:
14032 if excStr.find("WrongPythonType") > 0:
14033 raise RuntimeError(errBeg +\
14034 "wrong type of values, %s values are expected"%str(self.getTypeEnum())[4:])
14035 raise RuntimeError(errBeg + str(e))
14037 nbOK = self.field.GetArraySize(self)
14040 raise RuntimeError(errBeg + "len(values) must be %s but not %s"%(nbOK,nbKO))
14042 raise RuntimeError(errBeg + "failed")
14045 pass # end of class geomField
14047 # Register the new proxy for GEOM_Field
14048 omniORB.registerObjref(GEOM._objref_GEOM_Field._NP_RepositoryId, geomField)
14051 ## Create a new geomBuilder instance.The geomBuilder class provides the Python
14052 # interface to GEOM operations.
14057 # salome.salome_init()
14058 # from salome.geom import geomBuilder
14059 # geompy = geomBuilder.New()
14061 # @param instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14062 # @return geomBuilder instance
14063 def New( instance=None):
14065 Create a new geomBuilder instance.The geomBuilder class provides the Python
14066 interface to GEOM operations.
14070 salome.salome_init()
14071 from salome.geom import geomBuilder
14072 geompy = geomBuilder.New()
14075 instance CORBA proxy of GEOM Engine. If None, the default Engine is used.
14077 geomBuilder instance
14079 #print "New geomBuilder ", study, instance
14083 if instance and isinstance( instance, SALOMEDS._objref_Study ):
14085 sys.stderr.write("Warning: 'study' argument is no more needed in geomBuilder.New(). Consider updating your script!!!\n\n")
14090 geom = geomBuilder()
14091 assert isinstance(geom,geomBuilder), "Geom engine class is %s but should be geomBuilder.geomBuilder. Import geomBuilder before creating the instance."%geom.__class__
14096 # Register methods from the plug-ins in the geomBuilder class
14097 plugins_var = os.environ.get( "GEOM_PluginsList" )
14100 if plugins_var is not None:
14101 plugins = plugins_var.split( ":" )
14102 plugins=[x for x in plugins if len(x)>0]
14103 if plugins is not None:
14104 for pluginName in plugins:
14105 pluginBuilderName = pluginName + "Builder"
14107 exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
14108 except Exception as e:
14109 from salome_utils import verbose
14110 print("Exception while loading %s: %s" % ( pluginBuilderName, e ))
14112 exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
14113 plugin = eval( pluginBuilderName )
14115 # add methods from plugin module to the geomBuilder class
14116 for k in dir( plugin ):
14117 if k[0] == '_': continue
14118 method = getattr( plugin, k )
14119 if type( method ).__name__ == 'function':
14120 if not hasattr( geomBuilder, k ):
14121 setattr( geomBuilder, k, method )