1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2012 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.
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
23 # Author : Paul RASCLE, EDF
28 \brief Module geompyDC
32 ## @defgroup l1_publish_data Publishing results in SALOME study
37 ## By default, all functions of geompy.py Python interface do not publish
38 ## resulting geometrical objects. This can be done in the Python script
39 ## by means of geompy.addToStudy() or geompy.addToStudyInFather()
42 ## However, it is possible to publish result data in the study
43 ## automatically. For this, almost each function of geompy.py module has
44 ## an additional @a theName parameter (@c None by default).
45 ## As soon as non-empty string value is passed to this parameter,
46 ## the result object is published in the study automatically.
51 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
52 ## geompy.addToStudy(box, "box") # explicit publishing
55 ## can be replaced by one-line instruction
58 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
64 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
67 ## Note, that some functions produce more than one geometrical objects. For example,
68 ## geompy.GetNonBlocks() function returns two objects: group of all non-hexa solids and group of
69 ## all non-quad faces. For such functions it is possible to specify separate names for results.
74 ## # create and publish cylinder
75 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
76 ## # get non blocks from cylinder
77 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
80 ## Above example will publish both result compounds (first with non-hexa solids and
81 ## second with non-quad faces) as two items, both named "nonblock".
82 ## However, if second command is invoked as
85 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
88 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
90 ## Automatic publication of all results can be also enabled/disabled by means of the function
91 ## geompy.addToStudyAuto(). The automatic publishing is managed by the numeric parameter passed
93 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
94 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
95 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
96 ## value passed as parameter has the same effect.
97 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
98 ## maximum number of sub-shapes allowed for publishing is set to specified value.
100 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
101 ## to the functions creating objects, instead default names will be used. However, you
102 ## can always change the behavior, by passing explicit name to the @a theName parameter
103 ## and it will be used instead default one.
104 ## The publishing of the collections of objects will be done according to the above
105 ## mentioned rules (maximum allowed number of sub-shapes).
110 ## geompy.addToStudyAuto() # enable automatic publication
111 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
112 ## # the box is created and published in the study with default name
113 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
114 ## vertices = geompy.SubShapeAll(box, geompy.ShapeType['VERTEX'])
115 ## # only 5 first vertices will be published, with default names
116 ## print len(vertices)
117 ## # note, that result value still containes all 8 vertices
118 ## geompy.addToStudyAuto(-1) # disable automatic publication
121 ## This feature can be used, for example, for debugging purposes.
124 ## - Use automatic publication feature with caution. When it is enabled, any function of geompy.py module
125 ## publishes the results in the study, that can lead to the huge size of the study data tree.
126 ## For example, repeating call of geompy.SubShapeAll() command on the same main shape each time will
127 ## publish all child objects, that will lead to a lot of duplicated items in the study.
128 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
129 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
130 ## - Not that some functions of geompy.py module do not have @theName parameter (and, thus, do not support
131 ## automatic publication). For example, some transformation operations like geompy.TranslateDXDYDZ().
132 ## Refer to the documentation to check if some function has such possibility.
137 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
139 ## @defgroup l1_geompyDC_purpose All package methods, grouped by their purpose
141 ## @defgroup l2_import_export Importing/exporting geometrical objects
142 ## @defgroup l2_creating Creating geometrical objects
144 ## @defgroup l3_basic_go Creating Basic Geometric Objects
146 ## @defgroup l4_curves Creating Curves
149 ## @defgroup l3_3d_primitives Creating 3D Primitives
150 ## @defgroup l3_complex Creating Complex Objects
151 ## @defgroup l3_groups Working with groups
152 ## @defgroup l3_blocks Building by blocks
154 ## @defgroup l4_blocks_measure Check and Improve
157 ## @defgroup l3_sketcher Sketcher
158 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
160 ## @defgroup l4_decompose Decompose objects
161 ## @defgroup l4_decompose_d Decompose objects deprecated methods
162 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
163 ## @defgroup l4_obtain Access to sub-shapes by a criteria
164 ## @defgroup l4_advanced Advanced objects creation functions
169 ## @defgroup l2_transforming Transforming geometrical objects
171 ## @defgroup l3_basic_op Basic Operations
172 ## @defgroup l3_boolean Boolean Operations
173 ## @defgroup l3_transform Transformation Operations
174 ## @defgroup l3_transform_d Transformation Operations deprecated methods
175 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
176 ## @defgroup l3_blocks_op Blocks Operations
177 ## @defgroup l3_healing Repairing Operations
178 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
181 ## @defgroup l2_measure Using measurement tools
185 # initialize SALOME session in try/except block
186 # to avoid problems in some cases, e.g. when generating documentation
194 from salome_notebook import *
200 from gsketcher import Sketcher3D
202 ## Enumeration ShapeType as a dictionary. \n
203 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
204 # @ingroup l1_geompyDC_auxiliary
205 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
208 def _toListOfNames(_names, _size=-1):
211 if type(_names) in [types.ListType, types.TupleType]:
212 for i in _names: l.append(i)
215 if l and len(l) < _size:
216 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
219 ## Raise an Error, containing the Method_name, if Operation is Failed
220 ## @ingroup l1_geompyDC_auxiliary
221 def RaiseIfFailed (Method_name, Operation):
222 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
223 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
225 ## Return list of variables value from salome notebook
226 ## @ingroup l1_geompyDC_auxiliary
227 def ParseParameters(*parameters):
230 for parameter in parameters:
231 if isinstance(parameter, list):
232 lResults = ParseParameters(*parameter)
233 if len(lResults) > 0:
234 Result.append(lResults[:-1])
235 StringResult += lResults[-1].split(":")
239 if isinstance(parameter,str):
240 if notebook.isVariable(parameter):
241 Result.append(notebook.get(parameter))
243 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
246 Result.append(parameter)
248 StringResult.append(str(parameter))
252 Result.append(":".join(StringResult))
254 Result = ":".join(StringResult)
257 ## Return list of variables value from salome notebook
258 ## @ingroup l1_geompyDC_auxiliary
262 for parameter in list:
263 if isinstance(parameter,str) and notebook.isVariable(parameter):
264 Result.append(str(notebook.get(parameter)))
267 Result.append(str(parameter))
270 StringResult = StringResult + str(parameter)
271 StringResult = StringResult + ":"
273 StringResult = StringResult[:len(StringResult)-1]
274 return Result, StringResult
276 ## Return list of variables value from salome notebook
277 ## @ingroup l1_geompyDC_auxiliary
278 def ParseSketcherCommand(command):
281 sections = command.split(":")
282 for section in sections:
283 parameters = section.split(" ")
285 for parameter in parameters:
286 if paramIndex > 1 and parameter.find("'") != -1:
287 parameter = parameter.replace("'","")
288 if notebook.isVariable(parameter):
289 Result = Result + str(notebook.get(parameter)) + " "
292 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
296 Result = Result + str(parameter) + " "
299 StringResult = StringResult + parameter
300 StringResult = StringResult + ":"
302 paramIndex = paramIndex + 1
304 Result = Result[:len(Result)-1] + ":"
306 Result = Result[:len(Result)-1]
307 return Result, StringResult
309 ## Helper function which can be used to pack the passed string to the byte data.
310 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
311 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
314 ## val = PackData("10001110") # val = 0xAE
315 ## val = PackData("1") # val = 0x80
317 ## @param data unpacked data - a string containing '1' and '0' symbols
318 ## @return data packed to the byte stream
319 ## @ingroup l1_geompyDC_auxiliary
322 Helper function which can be used to pack the passed string to the byte data.
323 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
324 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
327 data unpacked data - a string containing '1' and '0' symbols
330 data packed to the byte stream
333 val = PackData("10001110") # val = 0xAE
334 val = PackData("1") # val = 0x80
337 if len(data)%8: bytes += 1
339 for b in range(bytes):
340 d = data[b*8:(b+1)*8]
345 if d[i] == "1": val += 1
347 raise "Invalid symbol %s" % d[i]
354 ## Read bitmap texture from the text file.
355 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
356 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
357 ## The function returns width and height of the pixmap in pixels and byte stream representing
358 ## texture bitmap itself.
360 ## This function can be used to read the texture to the byte stream in order to pass it to
361 ## the AddTexture() function of geompyDC class.
365 ## geompy = geompyDC.geomInstance(salome.myStudy)
366 ## texture = geompy.readtexture('mytexture.dat')
367 ## texture = geompy.AddTexture(*texture)
368 ## obj.SetMarkerTexture(texture)
370 ## @param fname texture file name
371 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
372 ## @ingroup l1_geompyDC_auxiliary
373 def ReadTexture(fname):
375 Read bitmap texture from the text file.
376 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
377 A zero symbol ('0') represents transparent pixel of the texture bitmap.
378 The function returns width and height of the pixmap in pixels and byte stream representing
379 texture bitmap itself.
380 This function can be used to read the texture to the byte stream in order to pass it to
381 the AddTexture() function of geompyDC class.
384 fname texture file name
387 sequence of tree values: texture's width, height in pixels and its byte stream
391 geompy = geompyDC.geomInstance(salome.myStudy)
392 texture = geompy.readtexture('mytexture.dat')
393 texture = geompy.AddTexture(*texture)
394 obj.SetMarkerTexture(texture)
398 lines = [ l.strip() for l in f.readlines()]
401 if lines: maxlen = max([len(x) for x in lines])
403 if maxlen%8: lenbytes += 1
407 lenline = (len(line)/8+1)*8
410 lenline = (len(line)/8)*8
412 for i in range(lenline/8):
415 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
418 bytedata += PackData(byte)
420 for i in range(lenline/8, lenbytes):
421 bytedata += PackData("0")
423 return lenbytes*8, len(lines), bytedata
428 ## Returns a long value from enumeration type
429 # Can be used for CORBA enumerator types like GEOM.shape_type
430 # @param theItem enumeration type
431 # @ingroup l1_geompyDC_auxiliary
432 def EnumToLong(theItem):
434 Returns a long value from enumeration type
435 Can be used for CORBA enumerator types like geompyDC.ShapeType
438 theItem enumeration type
441 if hasattr(theItem, "_v"): ret = theItem._v
444 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
445 # and a list of parameters, describing the shape.
446 # List of parameters, describing the shape:
447 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
448 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
450 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
452 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
454 # - SPHERE: [xc yc zc R]
455 # - CYLINDER: [xb yb zb dx dy dz R H]
456 # - BOX: [xc yc zc ax ay az]
457 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
458 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
459 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
460 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
461 # - SOLID: [nb_faces nb_edges nb_vertices]
463 # - SPHERE2D: [xc yc zc R]
464 # - CYLINDER2D: [xb yb zb dx dy dz R H]
465 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
466 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
467 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
468 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
469 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
470 # - PLANE: [xo yo zo dx dy dz]
471 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
472 # - FACE: [nb_edges nb_vertices]
474 # - CIRCLE: [xc yc zc dx dy dz R]
475 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
476 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
477 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
478 # - LINE: [xo yo zo dx dy dz]
479 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
480 # - EDGE: [nb_vertices]
483 # @ingroup l1_geompyDC_auxiliary
484 kind = GEOM.GEOM_IKindOfShape
486 ## Information about closed/unclosed state of shell or wire
487 # @ingroup l1_geompyDC_auxiliary
490 Information about closed/unclosed state of shell or wire
496 # Warning: geom is a singleton
502 class geompyDC(object, GEOM._objref_GEOM_Gen):
509 print "__new__ ", engine, geom, doLcc, created
511 # geom engine is either retrieved from engine, or created
513 # Following test avoids a recursive loop
516 # geom engine not created: existing engine found
518 if doLcc and not created:
521 # FindOrLoadComponent called:
522 # 1. CORBA resolution of server
523 # 2. the __new__ method is called again
524 print "FindOrLoadComponent ", engine, geom, doLcc, created
525 geom = lcc.FindOrLoadComponent( "FactoryServer", "GEOM" )
527 # FindOrLoadComponent not called
529 # geompyDC instance is created from lcc.FindOrLoadComponent
531 print "super ", engine, geom, doLcc, created
532 geom = super(geompyDC,cls).__new__(cls)
534 # geom engine not created: existing engine found
535 print "existing ", engine, geom, doLcc, created
544 #print "-------- geompyDC __init__ --- ", created, self
545 GEOM._objref_GEOM_Gen.__init__(self)
546 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
547 self.myBuilder = None
566 ## @addtogroup l1_geompyDC_auxiliary
567 ## Process object publication in the study, as follows:
568 # - if @a theName is specified (not None), the object is published in the study
569 # with this name, not taking into account "auto-publishing" option;
570 # - if @a theName is NOT specified, the object is published in the study
571 # (using default name, which can be customized using @a theDefaultName parameter)
572 # only if auto-publishing is switched on.
574 # @param theObj object, a subject for publishing
575 # @param theName object name for study
576 # @param theDefaultName default name for the auto-publishing
578 # @sa addToStudyAuto()
579 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
581 def _item_name(_names, _defname, _idx=-1):
582 if not _names: _names = _defname
583 if type(_names) in [types.ListType, types.TupleType]:
585 if _idx >= len(_names) or not _names[_idx]:
586 if type(_defname) not in [types.ListType, types.TupleType]:
587 _name = "%s_%d"%(_defname, _idx+1)
588 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
589 _name = _defname[_idx]
591 _name = "%noname_%d"%(dn, _idx+1)
597 # must be wrong usage
602 _name = "%s_%d"%(_names, _idx+1)
610 if not theName and not self.myMaxNbSubShapesAllowed:
611 return # nothing to do: auto-publishing is disabled
612 if not theName and not theDefaultName:
613 return # neither theName nor theDefaultName is given
615 if type(theObj) in [types.ListType, types.TupleType]:
616 # list of objects is being published
619 if not obj: continue # bad object
620 ###if obj.GetStudyEntry(): continue # already published
621 name = _item_name(theName, theDefaultName, idx)
622 if obj.IsMainShape() or not obj.GetMainShape().GetStudyEntry():
623 self.addToStudy(obj, name) # "%s_%d"%(aName, idx)
625 self.addToStudyInFather(obj.GetMainShape(), obj, name) # "%s_%d"%(aName, idx)
628 if not theName and idx == self.myMaxNbSubShapesAllowed: break
632 # single object is published
633 ###if theObj.GetStudyEntry(): return # already published
634 name = _item_name(theName, theDefaultName)
635 if theObj.IsMainShape():
636 self.addToStudy(theObj, name)
638 self.addToStudyInFather(theObj.GetMainShape(), theObj, name)
643 ## @addtogroup l1_geompy_auxiliary
645 def init_geom(self,theStudy):
646 self.myStudy = theStudy
647 self.myStudyId = self.myStudy._get_StudyId()
648 self.myBuilder = self.myStudy.NewBuilder()
649 self.father = self.myStudy.FindComponent("GEOM")
650 if self.father is None:
651 self.father = self.myBuilder.NewComponent("GEOM")
652 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
653 FName = A1._narrow(SALOMEDS.AttributeName)
654 FName.SetValue("Geometry")
655 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
656 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
657 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
658 self.myBuilder.DefineComponentInstance(self.father,self)
660 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
661 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
662 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
663 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
664 self.HealOp = self.GetIHealingOperations (self.myStudyId)
665 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
666 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
667 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
668 self.LocalOp = self.GetILocalOperations (self.myStudyId)
669 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
670 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
671 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
672 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
675 ## Enable / disable results auto-publishing
677 # The automatic publishing is managed in the following way:
678 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
679 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
680 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
681 # value passed as parameter has the same effect.
682 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
683 # maximum number of sub-shapes allowed for publishing is set to specified value.
685 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
686 # @ingroup l1_publish_data
687 def addToStudyAuto(self, maxNbSubShapes=-1):
689 Enable / disable results auto-publishing
691 The automatic publishing is managed in the following way:
692 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
693 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
694 maximum number of sub-shapes allowed for publishing is unlimited; any negative
695 value passed as parameter has the same effect.
696 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
697 maximum number of sub-shapes allowed for publishing is set to this value.
700 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
703 geompy.addToStudyAuto() # enable auto-publishing
704 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
705 geompy.addToStudyAuto(0) # disable auto-publishing
707 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
710 ## Dump component to the Python script
711 # This method overrides IDL function to allow default values for the parameters.
712 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
714 Dump component to the Python script
715 This method overrides IDL function to allow default values for the parameters.
717 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
719 ## Get name for sub-shape aSubObj of shape aMainObj
721 # @ref swig_SubShapeName "Example"
722 def SubShapeName(self,aSubObj, aMainObj):
724 Get name for sub-shape aSubObj of shape aMainObj
726 # Example: see GEOM_TestAll.py
728 #aSubId = orb.object_to_string(aSubObj)
729 #aMainId = orb.object_to_string(aMainObj)
730 #index = gg.getIndexTopology(aSubId, aMainId)
731 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
732 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
733 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
736 ## Publish in study aShape with name aName
738 # \param aShape the shape to be published
739 # \param aName the name for the shape
740 # \param doRestoreSubShapes if True, finds and publishes also
741 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
742 # and published sub-shapes of arguments
743 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
744 # these arguments description
745 # \return study entry of the published shape in form of string
747 # @ingroup l1_publish_data
748 # @ref swig_all_addtostudy "Example"
749 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
750 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
752 Publish in study aShape with name aName
755 aShape the shape to be published
756 aName the name for the shape
757 doRestoreSubShapes if True, finds and publishes also
758 sub-shapes of aShape, corresponding to its arguments
759 and published sub-shapes of arguments
760 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
761 these arguments description
764 study entry of the published shape in form of string
767 id_block1 = geompy.addToStudy(Block1, "Block 1")
769 # Example: see GEOM_TestAll.py
771 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
772 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
773 if doRestoreSubShapes:
774 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
775 theFindMethod, theInheritFirstArg, True )
777 print "addToStudy() failed"
779 return aShape.GetStudyEntry()
781 ## Publish in study aShape with name aName as sub-object of previously published aFather
782 # \param aFather previously published object
783 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
784 # \param aName the name for the shape
786 # \return study entry of the published shape in form of string
788 # @ingroup l1_publish_data
789 # @ref swig_all_addtostudyInFather "Example"
790 def addToStudyInFather(self, aFather, aShape, aName):
792 Publish in study aShape with name aName as sub-object of previously published aFather
795 aFather previously published object
796 aShape the shape to be published as sub-object of aFather
797 aName the name for the shape
800 study entry of the published shape in form of string
802 # Example: see GEOM_TestAll.py
804 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
805 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
807 print "addToStudyInFather() failed"
809 return aShape.GetStudyEntry()
811 ## Unpublish object in study
813 # \param obj the object to be unpublished
814 def hideInStudy(self, obj):
816 Unpublish object in study
819 obj the object to be unpublished
821 ior = salome.orb.object_to_string(obj)
822 aSObject = self.myStudy.FindObjectIOR(ior)
823 if aSObject is not None:
824 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
825 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
826 drwAttribute.SetDrawable(False)
829 # end of l1_geompyDC_auxiliary
832 ## @addtogroup l3_restore_ss
835 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
836 # To be used from python scripts out of addToStudy() (non-default usage)
837 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
838 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
839 # If this list is empty, all operation arguments will be published
840 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
841 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
842 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
843 # Do not publish sub-shapes in place of arguments, but only
844 # in place of sub-shapes of the first argument,
845 # because the whole shape corresponds to the first argument.
846 # Mainly to be used after transformations, but it also can be
847 # usefull after partition with one object shape, and some other
848 # operations, where only the first argument has to be considered.
849 # If theObject has only one argument shape, this flag is automatically
850 # considered as True, not regarding really passed value.
851 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
852 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
853 # \return list of published sub-shapes
855 # @ref tui_restore_prs_params "Example"
856 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
857 theInheritFirstArg=False, theAddPrefix=True):
859 Publish sub-shapes, standing for arguments and sub-shapes of arguments
860 To be used from python scripts out of geompy.addToStudy (non-default usage)
863 theObject published GEOM.GEOM_Object, arguments of which will be published
864 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
865 If this list is empty, all operation arguments will be published
866 theFindMethod method to search sub-shapes, corresponding to arguments and
867 their sub-shapes. Value from enumeration GEOM.find_shape_method.
868 theInheritFirstArg set properties of the first argument for theObject.
869 Do not publish sub-shapes in place of arguments, but only
870 in place of sub-shapes of the first argument,
871 because the whole shape corresponds to the first argument.
872 Mainly to be used after transformations, but it also can be
873 usefull after partition with one object shape, and some other
874 operations, where only the first argument has to be considered.
875 If theObject has only one argument shape, this flag is automatically
876 considered as True, not regarding really passed value.
877 theAddPrefix add prefix "from_" to names of restored sub-shapes,
878 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
880 list of published sub-shapes
882 # Example: see GEOM_TestAll.py
883 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
884 theFindMethod, theInheritFirstArg, theAddPrefix)
886 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
887 # To be used from python scripts out of addToStudy() (non-default usage)
888 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
889 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
890 # If this list is empty, all operation arguments will be published
891 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
892 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
893 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
894 # Do not publish sub-shapes in place of arguments, but only
895 # in place of sub-shapes of the first argument,
896 # because the whole shape corresponds to the first argument.
897 # Mainly to be used after transformations, but it also can be
898 # usefull after partition with one object shape, and some other
899 # operations, where only the first argument has to be considered.
900 # If theObject has only one argument shape, this flag is automatically
901 # considered as True, not regarding really passed value.
902 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
903 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
904 # \return list of published sub-shapes
906 # @ref tui_restore_prs_params "Example"
907 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
908 theInheritFirstArg=False, theAddPrefix=True):
910 Publish sub-shapes, standing for arguments and sub-shapes of arguments
911 To be used from python scripts out of geompy.addToStudy() (non-default usage)
914 theObject published GEOM.GEOM_Object, arguments of which will be published
915 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
916 If this list is empty, all operation arguments will be published
917 theFindMethod method to search sub-shapes, corresponding to arguments and
918 their sub-shapes. Value from enumeration GEOM::find_shape_method.
919 theInheritFirstArg set properties of the first argument for theObject.
920 Do not publish sub-shapes in place of arguments, but only
921 in place of sub-shapes of the first argument,
922 because the whole shape corresponds to the first argument.
923 Mainly to be used after transformations, but it also can be
924 usefull after partition with one object shape, and some other
925 operations, where only the first argument has to be considered.
926 If theObject has only one argument shape, this flag is automatically
927 considered as True, not regarding really passed value.
928 theAddPrefix add prefix "from_" to names of restored sub-shapes,
929 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
932 list of published sub-shapes
934 # Example: see GEOM_TestAll.py
935 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
936 theFindMethod, theInheritFirstArg, theAddPrefix)
938 # end of l3_restore_ss
941 ## @addtogroup l3_basic_go
944 ## Create point by three coordinates.
945 # @param theX The X coordinate of the point.
946 # @param theY The Y coordinate of the point.
947 # @param theZ The Z coordinate of the point.
948 # @param theName Object name; when specified, this parameter is used
949 # for result publication in the study. Otherwise, if automatic
950 # publication is switched on, default value is used for result name.
952 # @return New GEOM.GEOM_Object, containing the created point.
954 # @ref tui_creation_point "Example"
955 def MakeVertex(self, theX, theY, theZ, theName=None):
957 Create point by three coordinates.
960 theX The X coordinate of the point.
961 theY The Y coordinate of the point.
962 theZ The Z coordinate of the point.
963 theName Object name; when specified, this parameter is used
964 for result publication in the study. Otherwise, if automatic
965 publication is switched on, default value is used for result name.
968 New GEOM.GEOM_Object, containing the created point.
970 # Example: see GEOM_TestAll.py
971 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
972 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
973 RaiseIfFailed("MakePointXYZ", self.BasicOp)
974 anObj.SetParameters(Parameters)
975 self._autoPublish(anObj, theName, "vertex")
978 ## Create a point, distant from the referenced point
979 # on the given distances along the coordinate axes.
980 # @param theReference The referenced point.
981 # @param theX Displacement from the referenced point along OX axis.
982 # @param theY Displacement from the referenced point along OY axis.
983 # @param theZ Displacement from the referenced point along OZ axis.
984 # @param theName Object name; when specified, this parameter is used
985 # for result publication in the study. Otherwise, if automatic
986 # publication is switched on, default value is used for result name.
988 # @return New GEOM.GEOM_Object, containing the created point.
990 # @ref tui_creation_point "Example"
991 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
993 Create a point, distant from the referenced point
994 on the given distances along the coordinate axes.
997 theReference The referenced point.
998 theX Displacement from the referenced point along OX axis.
999 theY Displacement from the referenced point along OY axis.
1000 theZ Displacement from the referenced point along OZ axis.
1001 theName Object name; when specified, this parameter is used
1002 for result publication in the study. Otherwise, if automatic
1003 publication is switched on, default value is used for result name.
1006 New GEOM.GEOM_Object, containing the created point.
1008 # Example: see GEOM_TestAll.py
1009 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
1010 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
1011 RaiseIfFailed("MakePointWithReference", self.BasicOp)
1012 anObj.SetParameters(Parameters)
1013 self._autoPublish(anObj, theName, "vertex")
1016 ## Create a point, corresponding to the given parameter on the given curve.
1017 # @param theRefCurve The referenced curve.
1018 # @param theParameter Value of parameter on the referenced curve.
1019 # @param theName Object name; when specified, this parameter is used
1020 # for result publication in the study. Otherwise, if automatic
1021 # publication is switched on, default value is used for result name.
1023 # @return New GEOM.GEOM_Object, containing the created point.
1025 # @ref tui_creation_point "Example"
1026 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
1028 Create a point, corresponding to the given parameter on the given curve.
1031 theRefCurve The referenced curve.
1032 theParameter Value of parameter on the referenced curve.
1033 theName Object name; when specified, this parameter is used
1034 for result publication in the study. Otherwise, if automatic
1035 publication is switched on, default value is used for result name.
1038 New GEOM.GEOM_Object, containing the created point.
1041 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
1043 # Example: see GEOM_TestAll.py
1044 theParameter, Parameters = ParseParameters(theParameter)
1045 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
1046 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
1047 anObj.SetParameters(Parameters)
1048 self._autoPublish(anObj, theName, "vertex")
1051 ## Create a point by projection give coordinates on the given curve
1052 # @param theRefCurve The referenced curve.
1053 # @param theX X-coordinate in 3D space
1054 # @param theY Y-coordinate in 3D space
1055 # @param theZ Z-coordinate in 3D space
1056 # @param theName Object name; when specified, this parameter is used
1057 # for result publication in the study. Otherwise, if automatic
1058 # publication is switched on, default value is used for result name.
1060 # @return New GEOM.GEOM_Object, containing the created point.
1062 # @ref tui_creation_point "Example"
1063 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1065 Create a point by projection give coordinates on the given curve
1068 theRefCurve The referenced curve.
1069 theX X-coordinate in 3D space
1070 theY Y-coordinate in 3D space
1071 theZ Z-coordinate in 3D space
1072 theName Object name; when specified, this parameter is used
1073 for result publication in the study. Otherwise, if automatic
1074 publication is switched on, default value is used for result name.
1077 New GEOM.GEOM_Object, containing the created point.
1080 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1082 # Example: see GEOM_TestAll.py
1083 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1084 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1085 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1086 anObj.SetParameters(Parameters)
1087 self._autoPublish(anObj, theName, "vertex")
1090 ## Create a point, corresponding to the given length on the given curve.
1091 # @param theRefCurve The referenced curve.
1092 # @param theLength Length on the referenced curve. It can be negative.
1093 # @param theStartPoint Point allowing to choose the direction for the calculation
1094 # of the length. If None, start from the first point of theRefCurve.
1095 # @param theName Object name; when specified, this parameter is used
1096 # for result publication in the study. Otherwise, if automatic
1097 # publication is switched on, default value is used for result name.
1099 # @return New GEOM.GEOM_Object, containing the created point.
1101 # @ref tui_creation_point "Example"
1102 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1104 Create a point, corresponding to the given length on the given curve.
1107 theRefCurve The referenced curve.
1108 theLength Length on the referenced curve. It can be negative.
1109 theStartPoint Point allowing to choose the direction for the calculation
1110 of the length. If None, start from the first point of theRefCurve.
1111 theName Object name; when specified, this parameter is used
1112 for result publication in the study. Otherwise, if automatic
1113 publication is switched on, default value is used for result name.
1116 New GEOM.GEOM_Object, containing the created point.
1118 # Example: see GEOM_TestAll.py
1119 theLength, Parameters = ParseParameters(theLength)
1120 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1121 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1122 anObj.SetParameters(Parameters)
1123 self._autoPublish(anObj, theName, "vertex")
1126 ## Create a point, corresponding to the given parameters on the
1128 # @param theRefSurf The referenced surface.
1129 # @param theUParameter Value of U-parameter on the referenced surface.
1130 # @param theVParameter Value of V-parameter on the referenced surface.
1131 # @param theName Object name; when specified, this parameter is used
1132 # for result publication in the study. Otherwise, if automatic
1133 # publication is switched on, default value is used for result name.
1135 # @return New GEOM.GEOM_Object, containing the created point.
1137 # @ref swig_MakeVertexOnSurface "Example"
1138 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1140 Create a point, corresponding to the given parameters on the
1144 theRefSurf The referenced surface.
1145 theUParameter Value of U-parameter on the referenced surface.
1146 theVParameter Value of V-parameter on the referenced surface.
1147 theName Object name; when specified, this parameter is used
1148 for result publication in the study. Otherwise, if automatic
1149 publication is switched on, default value is used for result name.
1152 New GEOM.GEOM_Object, containing the created point.
1155 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1157 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1158 # Example: see GEOM_TestAll.py
1159 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1160 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1161 anObj.SetParameters(Parameters);
1162 self._autoPublish(anObj, theName, "vertex")
1165 ## Create a point by projection give coordinates on the given surface
1166 # @param theRefSurf The referenced surface.
1167 # @param theX X-coordinate in 3D space
1168 # @param theY Y-coordinate in 3D space
1169 # @param theZ Z-coordinate in 3D space
1170 # @param theName Object name; when specified, this parameter is used
1171 # for result publication in the study. Otherwise, if automatic
1172 # publication is switched on, default value is used for result name.
1174 # @return New GEOM.GEOM_Object, containing the created point.
1176 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1177 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1179 Create a point by projection give coordinates on the given surface
1182 theRefSurf The referenced surface.
1183 theX X-coordinate in 3D space
1184 theY Y-coordinate in 3D space
1185 theZ Z-coordinate in 3D space
1186 theName Object name; when specified, this parameter is used
1187 for result publication in the study. Otherwise, if automatic
1188 publication is switched on, default value is used for result name.
1191 New GEOM.GEOM_Object, containing the created point.
1194 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1196 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1197 # Example: see GEOM_TestAll.py
1198 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1199 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1200 anObj.SetParameters(Parameters);
1201 self._autoPublish(anObj, theName, "vertex")
1204 ## Create a point, which lays on the given face.
1205 # The point will lay in arbitrary place of the face.
1206 # The only condition on it is a non-zero distance to the face boundary.
1207 # Such point can be used to uniquely identify the face inside any
1208 # shape in case, when the shape does not contain overlapped faces.
1209 # @param theFace The referenced face.
1210 # @param theName Object name; when specified, this parameter is used
1211 # for result publication in the study. Otherwise, if automatic
1212 # publication is switched on, default value is used for result name.
1214 # @return New GEOM.GEOM_Object, containing the created point.
1216 # @ref swig_MakeVertexInsideFace "Example"
1217 def MakeVertexInsideFace (self, theFace, theName=None):
1219 Create a point, which lays on the given face.
1220 The point will lay in arbitrary place of the face.
1221 The only condition on it is a non-zero distance to the face boundary.
1222 Such point can be used to uniquely identify the face inside any
1223 shape in case, when the shape does not contain overlapped faces.
1226 theFace The referenced face.
1227 theName Object name; when specified, this parameter is used
1228 for result publication in the study. Otherwise, if automatic
1229 publication is switched on, default value is used for result name.
1232 New GEOM.GEOM_Object, containing the created point.
1235 p_on_face = geompy.MakeVertexInsideFace(Face)
1237 # Example: see GEOM_TestAll.py
1238 anObj = self.BasicOp.MakePointOnFace(theFace)
1239 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1240 self._autoPublish(anObj, theName, "vertex")
1243 ## Create a point on intersection of two lines.
1244 # @param theRefLine1, theRefLine2 The referenced lines.
1245 # @param theName Object name; when specified, this parameter is used
1246 # for result publication in the study. Otherwise, if automatic
1247 # publication is switched on, default value is used for result name.
1249 # @return New GEOM.GEOM_Object, containing the created point.
1251 # @ref swig_MakeVertexOnLinesIntersection "Example"
1252 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1254 Create a point on intersection of two lines.
1257 theRefLine1, theRefLine2 The referenced lines.
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.
1265 # Example: see GEOM_TestAll.py
1266 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1267 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1268 self._autoPublish(anObj, theName, "vertex")
1271 ## Create a tangent, corresponding to the given parameter on the given curve.
1272 # @param theRefCurve The referenced curve.
1273 # @param theParameter Value of parameter on the referenced curve.
1274 # @param theName Object name; when specified, this parameter is used
1275 # for result publication in the study. Otherwise, if automatic
1276 # publication is switched on, default value is used for result name.
1278 # @return New GEOM.GEOM_Object, containing the created tangent.
1280 # @ref swig_MakeTangentOnCurve "Example"
1281 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1283 Create a tangent, corresponding to the given parameter on the given curve.
1286 theRefCurve The referenced curve.
1287 theParameter Value of parameter on the referenced curve.
1288 theName Object name; when specified, this parameter is used
1289 for result publication in the study. Otherwise, if automatic
1290 publication is switched on, default value is used for result name.
1293 New GEOM.GEOM_Object, containing the created tangent.
1296 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1298 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1299 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1300 self._autoPublish(anObj, theName, "tangent")
1303 ## Create a tangent plane, corresponding to the given parameter on the given face.
1304 # @param theFace The face for which tangent plane should be built.
1305 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1306 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1307 # @param theTrimSize the size of plane.
1308 # @param theName Object name; when specified, this parameter is used
1309 # for result publication in the study. Otherwise, if automatic
1310 # publication is switched on, default value is used for result name.
1312 # @return New GEOM.GEOM_Object, containing the created tangent.
1314 # @ref swig_MakeTangentPlaneOnFace "Example"
1315 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1317 Create a tangent plane, corresponding to the given parameter on the given face.
1320 theFace The face for which tangent plane should be built.
1321 theParameterV vertical value of the center point (0.0 - 1.0).
1322 theParameterU horisontal value of the center point (0.0 - 1.0).
1323 theTrimSize the size of plane.
1324 theName Object name; when specified, this parameter is used
1325 for result publication in the study. Otherwise, if automatic
1326 publication is switched on, default value is used for result name.
1329 New GEOM.GEOM_Object, containing the created tangent.
1332 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1334 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1335 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1336 self._autoPublish(anObj, theName, "tangent")
1339 ## Create a vector with the given components.
1340 # @param theDX X component of the vector.
1341 # @param theDY Y component of the vector.
1342 # @param theDZ Z component of the vector.
1343 # @param theName Object name; when specified, this parameter is used
1344 # for result publication in the study. Otherwise, if automatic
1345 # publication is switched on, default value is used for result name.
1347 # @return New GEOM.GEOM_Object, containing the created vector.
1349 # @ref tui_creation_vector "Example"
1350 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1352 Create a vector with the given components.
1355 theDX X component of the vector.
1356 theDY Y component of the vector.
1357 theDZ Z component of the vector.
1358 theName Object name; when specified, this parameter is used
1359 for result publication in the study. Otherwise, if automatic
1360 publication is switched on, default value is used for result name.
1363 New GEOM.GEOM_Object, containing the created vector.
1365 # Example: see GEOM_TestAll.py
1366 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1367 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1368 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1369 anObj.SetParameters(Parameters)
1370 self._autoPublish(anObj, theName, "vector")
1373 ## Create a vector between two points.
1374 # @param thePnt1 Start point for the vector.
1375 # @param thePnt2 End point for the vector.
1376 # @param theName Object name; when specified, this parameter is used
1377 # for result publication in the study. Otherwise, if automatic
1378 # publication is switched on, default value is used for result name.
1380 # @return New GEOM.GEOM_Object, containing the created vector.
1382 # @ref tui_creation_vector "Example"
1383 def MakeVector(self, thePnt1, thePnt2, theName=None):
1385 Create a vector between two points.
1388 thePnt1 Start point for the vector.
1389 thePnt2 End point for the vector.
1390 theName Object name; when specified, this parameter is used
1391 for result publication in the study. Otherwise, if automatic
1392 publication is switched on, default value is used for result name.
1395 New GEOM.GEOM_Object, containing the created vector.
1397 # Example: see GEOM_TestAll.py
1398 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1399 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1400 self._autoPublish(anObj, theName, "vector")
1403 ## Create a line, passing through the given point
1404 # and parrallel to the given direction
1405 # @param thePnt Point. The resulting line will pass through it.
1406 # @param theDir Direction. The resulting line will be parallel to it.
1407 # @param theName Object name; when specified, this parameter is used
1408 # for result publication in the study. Otherwise, if automatic
1409 # publication is switched on, default value is used for result name.
1411 # @return New GEOM.GEOM_Object, containing the created line.
1413 # @ref tui_creation_line "Example"
1414 def MakeLine(self, thePnt, theDir, theName=None):
1416 Create a line, passing through the given point
1417 and parrallel to the given direction
1420 thePnt Point. The resulting line will pass through it.
1421 theDir Direction. The resulting line will be parallel to it.
1422 theName Object name; when specified, this parameter is used
1423 for result publication in the study. Otherwise, if automatic
1424 publication is switched on, default value is used for result name.
1427 New GEOM.GEOM_Object, containing the created line.
1429 # Example: see GEOM_TestAll.py
1430 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1431 RaiseIfFailed("MakeLine", self.BasicOp)
1432 self._autoPublish(anObj, theName, "line")
1435 ## Create a line, passing through the given points
1436 # @param thePnt1 First of two points, defining the line.
1437 # @param thePnt2 Second of two points, defining the line.
1438 # @param theName Object name; when specified, this parameter is used
1439 # for result publication in the study. Otherwise, if automatic
1440 # publication is switched on, default value is used for result name.
1442 # @return New GEOM.GEOM_Object, containing the created line.
1444 # @ref tui_creation_line "Example"
1445 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1447 Create a line, passing through the given points
1450 thePnt1 First of two points, defining the line.
1451 thePnt2 Second of two points, defining the line.
1452 theName Object name; when specified, this parameter is used
1453 for result publication in the study. Otherwise, if automatic
1454 publication is switched on, default value is used for result name.
1457 New GEOM.GEOM_Object, containing the created line.
1459 # Example: see GEOM_TestAll.py
1460 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1461 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1462 self._autoPublish(anObj, theName, "line")
1465 ## Create a line on two faces intersection.
1466 # @param theFace1 First of two faces, defining the line.
1467 # @param theFace2 Second of two faces, defining the line.
1468 # @param theName Object name; when specified, this parameter is used
1469 # for result publication in the study. Otherwise, if automatic
1470 # publication is switched on, default value is used for result name.
1472 # @return New GEOM.GEOM_Object, containing the created line.
1474 # @ref swig_MakeLineTwoFaces "Example"
1475 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1477 Create a line on two faces intersection.
1480 theFace1 First of two faces, defining the line.
1481 theFace2 Second of two faces, defining the line.
1482 theName Object name; when specified, this parameter is used
1483 for result publication in the study. Otherwise, if automatic
1484 publication is switched on, default value is used for result name.
1487 New GEOM.GEOM_Object, containing the created line.
1489 # Example: see GEOM_TestAll.py
1490 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1491 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1492 self._autoPublish(anObj, theName, "line")
1495 ## Create a plane, passing through the given point
1496 # and normal to the given vector.
1497 # @param thePnt Point, the plane has to pass through.
1498 # @param theVec Vector, defining the plane normal direction.
1499 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1500 # @param theName Object name; when specified, this parameter is used
1501 # for result publication in the study. Otherwise, if automatic
1502 # publication is switched on, default value is used for result name.
1504 # @return New GEOM.GEOM_Object, containing the created plane.
1506 # @ref tui_creation_plane "Example"
1507 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1509 Create a plane, passing through the given point
1510 and normal to the given vector.
1513 thePnt Point, the plane has to pass through.
1514 theVec Vector, defining the plane normal direction.
1515 theTrimSize Half size of a side of quadrangle face, representing the plane.
1516 theName Object name; when specified, this parameter is used
1517 for result publication in the study. Otherwise, if automatic
1518 publication is switched on, default value is used for result name.
1521 New GEOM.GEOM_Object, containing the created plane.
1523 # Example: see GEOM_TestAll.py
1524 theTrimSize, Parameters = ParseParameters(theTrimSize);
1525 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1526 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1527 anObj.SetParameters(Parameters)
1528 self._autoPublish(anObj, theName, "plane")
1531 ## Create a plane, passing through the three given points
1532 # @param thePnt1 First of three points, defining the plane.
1533 # @param thePnt2 Second of three points, defining the plane.
1534 # @param thePnt3 Fird of three points, defining the plane.
1535 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1536 # @param theName Object name; when specified, this parameter is used
1537 # for result publication in the study. Otherwise, if automatic
1538 # publication is switched on, default value is used for result name.
1540 # @return New GEOM.GEOM_Object, containing the created plane.
1542 # @ref tui_creation_plane "Example"
1543 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1545 Create a plane, passing through the three given points
1548 thePnt1 First of three points, defining the plane.
1549 thePnt2 Second of three points, defining the plane.
1550 thePnt3 Fird of three points, defining the plane.
1551 theTrimSize Half size of a side of quadrangle face, representing the plane.
1552 theName Object name; when specified, this parameter is used
1553 for result publication in the study. Otherwise, if automatic
1554 publication is switched on, default value is used for result name.
1557 New GEOM.GEOM_Object, containing the created plane.
1559 # Example: see GEOM_TestAll.py
1560 theTrimSize, Parameters = ParseParameters(theTrimSize);
1561 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1562 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1563 anObj.SetParameters(Parameters)
1564 self._autoPublish(anObj, theName, "plane")
1567 ## Create a plane, similar to the existing one, but with another size of representing face.
1568 # @param theFace Referenced plane or LCS(Marker).
1569 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1570 # @param theName Object name; when specified, this parameter is used
1571 # for result publication in the study. Otherwise, if automatic
1572 # publication is switched on, default value is used for result name.
1574 # @return New GEOM.GEOM_Object, containing the created plane.
1576 # @ref tui_creation_plane "Example"
1577 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1579 Create a plane, similar to the existing one, but with another size of representing face.
1582 theFace Referenced plane or LCS(Marker).
1583 theTrimSize New half size of a side of quadrangle face, representing the plane.
1584 theName Object name; when specified, this parameter is used
1585 for result publication in the study. Otherwise, if automatic
1586 publication is switched on, default value is used for result name.
1589 New GEOM.GEOM_Object, containing the created plane.
1591 # Example: see GEOM_TestAll.py
1592 theTrimSize, Parameters = ParseParameters(theTrimSize);
1593 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1594 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1595 anObj.SetParameters(Parameters)
1596 self._autoPublish(anObj, theName, "plane")
1599 ## Create a plane, passing through the 2 vectors
1600 # with center in a start point of the first vector.
1601 # @param theVec1 Vector, defining center point and plane direction.
1602 # @param theVec2 Vector, defining the plane normal direction.
1603 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1604 # @param theName Object name; when specified, this parameter is used
1605 # for result publication in the study. Otherwise, if automatic
1606 # publication is switched on, default value is used for result name.
1608 # @return New GEOM.GEOM_Object, containing the created plane.
1610 # @ref tui_creation_plane "Example"
1611 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1613 Create a plane, passing through the 2 vectors
1614 with center in a start point of the first vector.
1617 theVec1 Vector, defining center point and plane direction.
1618 theVec2 Vector, defining the plane normal direction.
1619 theTrimSize Half size of a side of quadrangle face, representing the plane.
1620 theName Object name; when specified, this parameter is used
1621 for result publication in the study. Otherwise, if automatic
1622 publication is switched on, default value is used for result name.
1625 New GEOM.GEOM_Object, containing the created plane.
1627 # Example: see GEOM_TestAll.py
1628 theTrimSize, Parameters = ParseParameters(theTrimSize);
1629 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1630 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1631 anObj.SetParameters(Parameters)
1632 self._autoPublish(anObj, theName, "plane")
1635 ## Create a plane, based on a Local coordinate system.
1636 # @param theLCS coordinate system, defining plane.
1637 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1638 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1639 # @param theName Object name; when specified, this parameter is used
1640 # for result publication in the study. Otherwise, if automatic
1641 # publication is switched on, default value is used for result name.
1643 # @return New GEOM.GEOM_Object, containing the created plane.
1645 # @ref tui_creation_plane "Example"
1646 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1648 Create a plane, based on a Local coordinate system.
1651 theLCS coordinate system, defining plane.
1652 theTrimSize Half size of a side of quadrangle face, representing the plane.
1653 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1654 theName Object name; when specified, this parameter is used
1655 for result publication in the study. Otherwise, if automatic
1656 publication is switched on, default value is used for result name.
1659 New GEOM.GEOM_Object, containing the created plane.
1661 # Example: see GEOM_TestAll.py
1662 theTrimSize, Parameters = ParseParameters(theTrimSize);
1663 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1664 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1665 anObj.SetParameters(Parameters)
1666 self._autoPublish(anObj, theName, "plane")
1669 ## Create a local coordinate system.
1670 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1671 # @param XDX,XDY,XDZ Three components of OX direction
1672 # @param YDX,YDY,YDZ Three components of OY direction
1673 # @param theName Object name; when specified, this parameter is used
1674 # for result publication in the study. Otherwise, if automatic
1675 # publication is switched on, default value is used for result name.
1677 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1679 # @ref swig_MakeMarker "Example"
1680 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1682 Create a local coordinate system.
1685 OX,OY,OZ Three coordinates of coordinate system origin.
1686 XDX,XDY,XDZ Three components of OX direction
1687 YDX,YDY,YDZ Three components of OY direction
1688 theName Object name; when specified, this parameter is used
1689 for result publication in the study. Otherwise, if automatic
1690 publication is switched on, default value is used for result name.
1693 New GEOM.GEOM_Object, containing the created coordinate system.
1695 # Example: see GEOM_TestAll.py
1696 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1697 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1698 RaiseIfFailed("MakeMarker", self.BasicOp)
1699 anObj.SetParameters(Parameters)
1700 self._autoPublish(anObj, theName, "lcs")
1703 ## Create a local coordinate system from shape.
1704 # @param theShape The initial shape to detect the coordinate system.
1705 # @param theName Object name; when specified, this parameter is used
1706 # for result publication in the study. Otherwise, if automatic
1707 # publication is switched on, default value is used for result name.
1709 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1711 # @ref tui_creation_lcs "Example"
1712 def MakeMarkerFromShape(self, theShape, theName=None):
1714 Create a local coordinate system from shape.
1717 theShape The initial shape to detect the coordinate system.
1718 theName Object name; when specified, this parameter is used
1719 for result publication in the study. Otherwise, if automatic
1720 publication is switched on, default value is used for result name.
1723 New GEOM.GEOM_Object, containing the created coordinate system.
1725 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1726 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1727 self._autoPublish(anObj, theName, "lcs")
1730 ## Create a local coordinate system from point and two vectors.
1731 # @param theOrigin Point of coordinate system origin.
1732 # @param theXVec Vector of X direction
1733 # @param theYVec Vector of Y direction
1734 # @param theName Object name; when specified, this parameter is used
1735 # for result publication in the study. Otherwise, if automatic
1736 # publication is switched on, default value is used for result name.
1738 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1740 # @ref tui_creation_lcs "Example"
1741 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1743 Create a local coordinate system from point and two vectors.
1746 theOrigin Point of coordinate system origin.
1747 theXVec Vector of X direction
1748 theYVec Vector of Y direction
1749 theName Object name; when specified, this parameter is used
1750 for result publication in the study. Otherwise, if automatic
1751 publication is switched on, default value is used for result name.
1754 New GEOM.GEOM_Object, containing the created coordinate system.
1757 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1758 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1759 self._autoPublish(anObj, theName, "lcs")
1762 # end of l3_basic_go
1765 ## @addtogroup l4_curves
1768 ## Create an arc of circle, passing through three given points.
1769 # @param thePnt1 Start point of the arc.
1770 # @param thePnt2 Middle point of the arc.
1771 # @param thePnt3 End point of the arc.
1772 # @param theName Object name; when specified, this parameter is used
1773 # for result publication in the study. Otherwise, if automatic
1774 # publication is switched on, default value is used for result name.
1776 # @return New GEOM.GEOM_Object, containing the created arc.
1778 # @ref swig_MakeArc "Example"
1779 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1781 Create an arc of circle, passing through three given points.
1784 thePnt1 Start point of the arc.
1785 thePnt2 Middle point of the arc.
1786 thePnt3 End point of the arc.
1787 theName Object name; when specified, this parameter is used
1788 for result publication in the study. Otherwise, if automatic
1789 publication is switched on, default value is used for result name.
1792 New GEOM.GEOM_Object, containing the created arc.
1794 # Example: see GEOM_TestAll.py
1795 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1796 RaiseIfFailed("MakeArc", self.CurvesOp)
1797 self._autoPublish(anObj, theName, "arc")
1800 ## Create an arc of circle from a center and 2 points.
1801 # @param thePnt1 Center of the arc
1802 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1803 # @param thePnt3 End point of the arc (Gives also a direction)
1804 # @param theSense Orientation of the arc
1805 # @param theName Object name; when specified, this parameter is used
1806 # for result publication in the study. Otherwise, if automatic
1807 # publication is switched on, default value is used for result name.
1809 # @return New GEOM.GEOM_Object, containing the created arc.
1811 # @ref swig_MakeArc "Example"
1812 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1814 Create an arc of circle from a center and 2 points.
1817 thePnt1 Center of the arc
1818 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1819 thePnt3 End point of the arc (Gives also a direction)
1820 theSense Orientation of the arc
1821 theName Object name; when specified, this parameter is used
1822 for result publication in the study. Otherwise, if automatic
1823 publication is switched on, default value is used for result name.
1826 New GEOM.GEOM_Object, containing the created arc.
1828 # Example: see GEOM_TestAll.py
1829 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1830 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1831 self._autoPublish(anObj, theName, "arc")
1834 ## Create an arc of ellipse, of center and two points.
1835 # @param theCenter Center of the arc.
1836 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1837 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1838 # @param theName Object name; when specified, this parameter is used
1839 # for result publication in the study. Otherwise, if automatic
1840 # publication is switched on, default value is used for result name.
1842 # @return New GEOM.GEOM_Object, containing the created arc.
1844 # @ref swig_MakeArc "Example"
1845 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1847 Create an arc of ellipse, of center and two points.
1850 theCenter Center of the arc.
1851 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1852 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1853 theName Object name; when specified, this parameter is used
1854 for result publication in the study. Otherwise, if automatic
1855 publication is switched on, default value is used for result name.
1858 New GEOM.GEOM_Object, containing the created arc.
1860 # Example: see GEOM_TestAll.py
1861 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1862 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1863 self._autoPublish(anObj, theName, "arc")
1866 ## Create a circle with given center, normal vector and radius.
1867 # @param thePnt Circle center.
1868 # @param theVec Vector, normal to the plane of the circle.
1869 # @param theR Circle radius.
1870 # @param theName Object name; when specified, this parameter is used
1871 # for result publication in the study. Otherwise, if automatic
1872 # publication is switched on, default value is used for result name.
1874 # @return New GEOM.GEOM_Object, containing the created circle.
1876 # @ref tui_creation_circle "Example"
1877 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1879 Create a circle with given center, normal vector and radius.
1882 thePnt Circle center.
1883 theVec Vector, normal to the plane of the circle.
1885 theName Object name; when specified, this parameter is used
1886 for result publication in the study. Otherwise, if automatic
1887 publication is switched on, default value is used for result name.
1890 New GEOM.GEOM_Object, containing the created circle.
1892 # Example: see GEOM_TestAll.py
1893 theR, Parameters = ParseParameters(theR)
1894 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1895 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1896 anObj.SetParameters(Parameters)
1897 self._autoPublish(anObj, theName, "circle")
1900 ## Create a circle with given radius.
1901 # Center of the circle will be in the origin of global
1902 # coordinate system and normal vector will be codirected with Z axis
1903 # @param theR Circle radius.
1904 # @param theName Object name; when specified, this parameter is used
1905 # for result publication in the study. Otherwise, if automatic
1906 # publication is switched on, default value is used for result name.
1908 # @return New GEOM.GEOM_Object, containing the created circle.
1909 def MakeCircleR(self, theR, theName=None):
1911 Create a circle with given radius.
1912 Center of the circle will be in the origin of global
1913 coordinate system and normal vector will be codirected with Z axis
1917 theName Object name; when specified, this parameter is used
1918 for result publication in the study. Otherwise, if automatic
1919 publication is switched on, default value is used for result name.
1922 New GEOM.GEOM_Object, containing the created circle.
1924 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1925 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1926 self._autoPublish(anObj, theName, "circle")
1929 ## Create a circle, passing through three given points
1930 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1931 # @param theName Object name; when specified, this parameter is used
1932 # for result publication in the study. Otherwise, if automatic
1933 # publication is switched on, default value is used for result name.
1935 # @return New GEOM.GEOM_Object, containing the created circle.
1937 # @ref tui_creation_circle "Example"
1938 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1940 Create a circle, passing through three given points
1943 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1944 theName Object name; when specified, this parameter is used
1945 for result publication in the study. Otherwise, if automatic
1946 publication is switched on, default value is used for result name.
1949 New GEOM.GEOM_Object, containing the created circle.
1951 # Example: see GEOM_TestAll.py
1952 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1953 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1954 self._autoPublish(anObj, theName, "circle")
1957 ## Create a circle, with given point1 as center,
1958 # passing through the point2 as radius and laying in the plane,
1959 # defined by all three given points.
1960 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1961 # @param theName Object name; when specified, this parameter is used
1962 # for result publication in the study. Otherwise, if automatic
1963 # publication is switched on, default value is used for result name.
1965 # @return New GEOM.GEOM_Object, containing the created circle.
1967 # @ref swig_MakeCircle "Example"
1968 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1970 Create a circle, with given point1 as center,
1971 passing through the point2 as radius and laying in the plane,
1972 defined by all three given points.
1975 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1976 theName Object name; when specified, this parameter is used
1977 for result publication in the study. Otherwise, if automatic
1978 publication is switched on, default value is used for result name.
1981 New GEOM.GEOM_Object, containing the created circle.
1983 # Example: see GEOM_example6.py
1984 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1985 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1986 self._autoPublish(anObj, theName, "circle")
1989 ## Create an ellipse with given center, normal vector and radiuses.
1990 # @param thePnt Ellipse center.
1991 # @param theVec Vector, normal to the plane of the ellipse.
1992 # @param theRMajor Major ellipse radius.
1993 # @param theRMinor Minor ellipse radius.
1994 # @param theVecMaj Vector, direction of the ellipse's main axis.
1995 # @param theName Object name; when specified, this parameter is used
1996 # for result publication in the study. Otherwise, if automatic
1997 # publication is switched on, default value is used for result name.
1999 # @return New GEOM.GEOM_Object, containing the created ellipse.
2001 # @ref tui_creation_ellipse "Example"
2002 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
2004 Create an ellipse with given center, normal vector and radiuses.
2007 thePnt Ellipse center.
2008 theVec Vector, normal to the plane of the ellipse.
2009 theRMajor Major ellipse radius.
2010 theRMinor Minor ellipse radius.
2011 theVecMaj Vector, direction of the ellipse's main axis.
2012 theName Object name; when specified, this parameter is used
2013 for result publication in the study. Otherwise, if automatic
2014 publication is switched on, default value is used for result name.
2017 New GEOM.GEOM_Object, containing the created ellipse.
2019 # Example: see GEOM_TestAll.py
2020 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
2021 if theVecMaj is not None:
2022 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
2024 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
2026 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2027 anObj.SetParameters(Parameters)
2028 self._autoPublish(anObj, theName, "ellipse")
2031 ## Create an ellipse with given radiuses.
2032 # Center of the ellipse will be in the origin of global
2033 # coordinate system and normal vector will be codirected with Z axis
2034 # @param theRMajor Major ellipse radius.
2035 # @param theRMinor Minor ellipse radius.
2036 # @param 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.
2040 # @return New GEOM.GEOM_Object, containing the created ellipse.
2041 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
2043 Create an ellipse with given radiuses.
2044 Center of the ellipse will be in the origin of global
2045 coordinate system and normal vector will be codirected with Z axis
2048 theRMajor Major ellipse radius.
2049 theRMinor Minor ellipse radius.
2050 theName Object name; when specified, this parameter is used
2051 for result publication in the study. Otherwise, if automatic
2052 publication is switched on, default value is used for result name.
2055 New GEOM.GEOM_Object, containing the created ellipse.
2057 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2058 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2059 self._autoPublish(anObj, theName, "ellipse")
2062 ## Create a polyline on the set of points.
2063 # @param thePoints Sequence of points for the polyline.
2064 # @param theIsClosed If True, build a closed wire.
2065 # @param theName Object name; when specified, this parameter is used
2066 # for result publication in the study. Otherwise, if automatic
2067 # publication is switched on, default value is used for result name.
2069 # @return New GEOM.GEOM_Object, containing the created polyline.
2071 # @ref tui_creation_curve "Example"
2072 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2074 Create a polyline on the set of points.
2077 thePoints Sequence of points for the polyline.
2078 theIsClosed If True, build a closed wire.
2079 theName Object name; when specified, this parameter is used
2080 for result publication in the study. Otherwise, if automatic
2081 publication is switched on, default value is used for result name.
2084 New GEOM.GEOM_Object, containing the created polyline.
2086 # Example: see GEOM_TestAll.py
2087 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2088 RaiseIfFailed("MakePolyline", self.CurvesOp)
2089 self._autoPublish(anObj, theName, "polyline")
2092 ## Create bezier curve on the set of points.
2093 # @param thePoints Sequence of points for the bezier curve.
2094 # @param theIsClosed If True, build a closed curve.
2095 # @param theName Object name; when specified, this parameter is used
2096 # for result publication in the study. Otherwise, if automatic
2097 # publication is switched on, default value is used for result name.
2099 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2101 # @ref tui_creation_curve "Example"
2102 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2104 Create bezier curve on the set of points.
2107 thePoints Sequence of points for the bezier curve.
2108 theIsClosed If True, build a closed curve.
2109 theName Object name; when specified, this parameter is used
2110 for result publication in the study. Otherwise, if automatic
2111 publication is switched on, default value is used for result name.
2114 New GEOM.GEOM_Object, containing the created bezier curve.
2116 # Example: see GEOM_TestAll.py
2117 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2118 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2119 self._autoPublish(anObj, theName, "bezier")
2122 ## Create B-Spline curve on the set of points.
2123 # @param thePoints Sequence of points for the B-Spline curve.
2124 # @param theIsClosed If True, build a closed curve.
2125 # @param theDoReordering If TRUE, the algo does not follow the order of
2126 # \a thePoints but searches for the closest vertex.
2127 # @param theName Object name; when specified, this parameter is used
2128 # for result publication in the study. Otherwise, if automatic
2129 # publication is switched on, default value is used for result name.
2131 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2133 # @ref tui_creation_curve "Example"
2134 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2136 Create B-Spline curve on the set of points.
2139 thePoints Sequence of points for the B-Spline curve.
2140 theIsClosed If True, build a closed curve.
2141 theDoReordering If True, the algo does not follow the order of
2142 thePoints but searches for the closest vertex.
2143 theName Object name; when specified, this parameter is used
2144 for result publication in the study. Otherwise, if automatic
2145 publication is switched on, default value is used for result name.
2148 New GEOM.GEOM_Object, containing the created B-Spline curve.
2150 # Example: see GEOM_TestAll.py
2151 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2152 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2153 self._autoPublish(anObj, theName, "bspline")
2156 ## Create B-Spline curve on the set of points.
2157 # @param thePoints Sequence of points for the B-Spline curve.
2158 # @param theFirstVec Vector object, defining the curve direction at its first point.
2159 # @param theLastVec Vector object, defining the curve direction at its last point.
2160 # @param theName Object name; when specified, this parameter is used
2161 # for result publication in the study. Otherwise, if automatic
2162 # publication is switched on, default value is used for result name.
2164 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2166 # @ref tui_creation_curve "Example"
2167 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2169 Create B-Spline curve on the set of points.
2172 thePoints Sequence of points for the B-Spline curve.
2173 theFirstVec Vector object, defining the curve direction at its first point.
2174 theLastVec Vector object, defining the curve direction at its last point.
2175 theName Object name; when specified, this parameter is used
2176 for result publication in the study. Otherwise, if automatic
2177 publication is switched on, default value is used for result name.
2180 New GEOM.GEOM_Object, containing the created B-Spline curve.
2182 # Example: see GEOM_TestAll.py
2183 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2184 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2185 self._autoPublish(anObj, theName, "bspline")
2188 ## Creates a curve using the parametric definition of the basic points.
2189 # @param thexExpr parametric equation of the coordinates X.
2190 # @param theyExpr parametric equation of the coordinates Y.
2191 # @param thezExpr parametric equation of the coordinates Z.
2192 # @param theParamMin the minimal value of the parameter.
2193 # @param theParamMax the maximum value of the parameter.
2194 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2195 # @param theCurveType the type of the curve.
2196 # @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.
2197 # @param theName Object name; when specified, this parameter is used
2198 # for result publication in the study. Otherwise, if automatic
2199 # publication is switched on, default value is used for result name.
2201 # @return New GEOM.GEOM_Object, containing the created curve.
2203 # @ref tui_creation_curve "Example"
2204 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2205 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2207 Creates a curve using the parametric definition of the basic points.
2210 thexExpr parametric equation of the coordinates X.
2211 theyExpr parametric equation of the coordinates Y.
2212 thezExpr parametric equation of the coordinates Z.
2213 theParamMin the minimal value of the parameter.
2214 theParamMax the maximum value of the parameter.
2215 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2216 theCurveType the type of the curve.
2217 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2218 method is used which can lead to a bug.
2219 theName Object name; when specified, this parameter is used
2220 for result publication in the study. Otherwise, if automatic
2221 publication is switched on, default value is used for result name.
2224 New GEOM.GEOM_Object, containing the created curve.
2226 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2228 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2230 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2231 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2232 anObj.SetParameters(Parameters)
2233 self._autoPublish(anObj, theName, "curve")
2239 ## @addtogroup l3_sketcher
2242 ## Create a sketcher (wire or face), following the textual description,
2243 # passed through <VAR>theCommand</VAR> argument. \n
2244 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2245 # Format of the description string have to be the following:
2247 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2250 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2252 # - "R angle" : Set the direction by angle
2253 # - "D dx dy" : Set the direction by DX & DY
2256 # - "TT x y" : Create segment by point at X & Y
2257 # - "T dx dy" : Create segment by point with DX & DY
2258 # - "L length" : Create segment by direction & Length
2259 # - "IX x" : Create segment by direction & Intersect. X
2260 # - "IY y" : Create segment by direction & Intersect. Y
2263 # - "C radius length" : Create arc by direction, radius and length(in degree)
2264 # - "AA x y": Create arc by point at X & Y
2265 # - "A dx dy" : Create arc by point with DX & DY
2266 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2267 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2268 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2269 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2272 # - "WW" : Close Wire (to finish)
2273 # - "WF" : Close Wire and build face (to finish)
2276 # - Flag1 (= reverse) is 0 or 2 ...
2277 # - if 0 the drawn arc is the one of lower angle (< Pi)
2278 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2281 # - Flag2 (= control tolerance) is 0 or 1 ...
2282 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2283 # - if 1 the wire is built only if the end point is on the arc
2284 # with a tolerance of 10^-7 on the distance else the creation fails
2286 # @param theCommand String, defining the sketcher in local
2287 # coordinates of the working plane.
2288 # @param theWorkingPlane Nine double values, defining origin,
2289 # OZ and OX directions of the working plane.
2290 # @param theName Object name; when specified, this parameter is used
2291 # for result publication in the study. Otherwise, if automatic
2292 # publication is switched on, default value is used for result name.
2294 # @return New GEOM.GEOM_Object, containing the created wire.
2296 # @ref tui_sketcher_page "Example"
2297 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2299 Create a sketcher (wire or face), following the textual description, passed
2300 through theCommand argument.
2301 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2302 Format of the description string have to be the following:
2303 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2305 - x1, y1 are coordinates of the first sketcher point (zero by default),
2307 - "R angle" : Set the direction by angle
2308 - "D dx dy" : Set the direction by DX & DY
2310 - "TT x y" : Create segment by point at X & Y
2311 - "T dx dy" : Create segment by point with DX & DY
2312 - "L length" : Create segment by direction & Length
2313 - "IX x" : Create segment by direction & Intersect. X
2314 - "IY y" : Create segment by direction & Intersect. Y
2316 - "C radius length" : Create arc by direction, radius and length(in degree)
2317 - "AA x y": Create arc by point at X & Y
2318 - "A dx dy" : Create arc by point with DX & DY
2319 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2320 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2321 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2322 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2324 - "WW" : Close Wire (to finish)
2325 - "WF" : Close Wire and build face (to finish)
2327 - Flag1 (= reverse) is 0 or 2 ...
2328 - if 0 the drawn arc is the one of lower angle (< Pi)
2329 - if 2 the drawn arc ius the one of greater angle (> Pi)
2331 - Flag2 (= control tolerance) is 0 or 1 ...
2332 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2333 - if 1 the wire is built only if the end point is on the arc
2334 with a tolerance of 10^-7 on the distance else the creation fails
2337 theCommand String, defining the sketcher in local
2338 coordinates of the working plane.
2339 theWorkingPlane Nine double values, defining origin,
2340 OZ and OX directions of the working plane.
2341 theName Object name; when specified, this parameter is used
2342 for result publication in the study. Otherwise, if automatic
2343 publication is switched on, default value is used for result name.
2346 New GEOM.GEOM_Object, containing the created wire.
2348 # Example: see GEOM_TestAll.py
2349 theCommand,Parameters = ParseSketcherCommand(theCommand)
2350 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2351 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2352 anObj.SetParameters(Parameters)
2353 self._autoPublish(anObj, theName, "wire")
2356 ## Create a sketcher (wire or face), following the textual description,
2357 # passed through <VAR>theCommand</VAR> argument. \n
2358 # For format of the description string see MakeSketcher() method.\n
2359 # @param theCommand String, defining the sketcher in local
2360 # coordinates of the working plane.
2361 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2362 # @param theName Object name; when specified, this parameter is used
2363 # for result publication in the study. Otherwise, if automatic
2364 # publication is switched on, default value is used for result name.
2366 # @return New GEOM.GEOM_Object, containing the created wire.
2368 # @ref tui_sketcher_page "Example"
2369 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2371 Create a sketcher (wire or face), following the textual description,
2372 passed through theCommand argument.
2373 For format of the description string see geompy.MakeSketcher() method.
2376 theCommand String, defining the sketcher in local
2377 coordinates of the working plane.
2378 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2379 theName Object name; when specified, this parameter is used
2380 for result publication in the study. Otherwise, if automatic
2381 publication is switched on, default value is used for result name.
2384 New GEOM.GEOM_Object, containing the created wire.
2386 theCommand,Parameters = ParseSketcherCommand(theCommand)
2387 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2388 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2389 anObj.SetParameters(Parameters)
2390 self._autoPublish(anObj, theName, "wire")
2393 ## Create a sketcher wire, following the numerical description,
2394 # passed through <VAR>theCoordinates</VAR> argument. \n
2395 # @param theCoordinates double values, defining points to create a wire,
2397 # @param theName Object name; when specified, this parameter is used
2398 # for result publication in the study. Otherwise, if automatic
2399 # publication is switched on, default value is used for result name.
2401 # @return New GEOM.GEOM_Object, containing the created wire.
2403 # @ref tui_3dsketcher_page "Example"
2404 def Make3DSketcher(self, theCoordinates, theName=None):
2406 Create a sketcher wire, following the numerical description,
2407 passed through theCoordinates argument.
2410 theCoordinates double values, defining points to create a wire,
2412 theName Object name; when specified, this parameter is used
2413 for result publication in the study. Otherwise, if automatic
2414 publication is switched on, default value is used for result name.
2417 New GEOM_Object, containing the created wire.
2419 theCoordinates,Parameters = ParseParameters(theCoordinates)
2420 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2421 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2422 anObj.SetParameters(Parameters)
2423 self._autoPublish(anObj, theName, "wire")
2426 ## Obtain a 3D sketcher interface
2427 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2429 # @ref tui_3dsketcher_page "Example"
2430 def Sketcher3D (self):
2432 Obtain a 3D sketcher interface.
2435 sk = geompy.Sketcher3D()
2436 sk.addPointsAbsolute(0,0,0, 70,0,0)
2437 sk.addPointsRelative(0, 0, 130)
2438 sk.addPointAnglesLength("OXY", 50, 0, 100)
2439 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2441 a3D_Sketcher_1 = sk.wire()
2443 sk = Sketcher3D (self)
2446 # end of l3_sketcher
2449 ## @addtogroup l3_3d_primitives
2452 ## Create a box by coordinates of two opposite vertices.
2454 # @param x1,y1,z1 double values, defining first point it.
2455 # @param x2,y2,z2 double values, defining first point it.
2456 # @param theName Object name; when specified, this parameter is used
2457 # for result publication in the study. Otherwise, if automatic
2458 # publication is switched on, default value is used for result name.
2460 # @return New GEOM.GEOM_Object, containing the created box.
2462 # @ref tui_creation_box "Example"
2463 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2465 Create a box by coordinates of two opposite vertices.
2468 x1,y1,z1 double values, defining first point.
2469 x2,y2,z2 double values, defining second point.
2470 theName Object name; when specified, this parameter is used
2471 for result publication in the study. Otherwise, if automatic
2472 publication is switched on, default value is used for result name.
2475 New GEOM.GEOM_Object, containing the created box.
2477 # Example: see GEOM_TestAll.py
2478 pnt1 = self.MakeVertex(x1,y1,z1)
2479 pnt2 = self.MakeVertex(x2,y2,z2)
2480 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2481 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2483 ## Create a box with specified dimensions along the coordinate axes
2484 # and with edges, parallel to the coordinate axes.
2485 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2486 # @param theDX Length of Box edges, parallel to OX axis.
2487 # @param theDY Length of Box edges, parallel to OY axis.
2488 # @param theDZ Length of Box edges, parallel to OZ axis.
2489 # @param theName Object name; when specified, this parameter is used
2490 # for result publication in the study. Otherwise, if automatic
2491 # publication is switched on, default value is used for result name.
2493 # @return New GEOM.GEOM_Object, containing the created box.
2495 # @ref tui_creation_box "Example"
2496 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2498 Create a box with specified dimensions along the coordinate axes
2499 and with edges, parallel to the coordinate axes.
2500 Center of the box will be at point (DX/2, DY/2, DZ/2).
2503 theDX Length of Box edges, parallel to OX axis.
2504 theDY Length of Box edges, parallel to OY axis.
2505 theDZ Length of Box edges, parallel to OZ axis.
2506 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.
2511 New GEOM.GEOM_Object, containing the created box.
2513 # Example: see GEOM_TestAll.py
2514 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2515 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2516 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2517 anObj.SetParameters(Parameters)
2518 self._autoPublish(anObj, theName, "box")
2521 ## Create a box with two specified opposite vertices,
2522 # and with edges, parallel to the coordinate axes
2523 # @param thePnt1 First of two opposite vertices.
2524 # @param thePnt2 Second of two opposite vertices.
2525 # @param 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.
2529 # @return New GEOM.GEOM_Object, containing the created box.
2531 # @ref tui_creation_box "Example"
2532 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2534 Create a box with two specified opposite vertices,
2535 and with edges, parallel to the coordinate axes
2538 thePnt1 First of two opposite vertices.
2539 thePnt2 Second of two opposite vertices.
2540 theName Object name; when specified, this parameter is used
2541 for result publication in the study. Otherwise, if automatic
2542 publication is switched on, default value is used for result name.
2545 New GEOM.GEOM_Object, containing the created box.
2547 # Example: see GEOM_TestAll.py
2548 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2549 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2550 self._autoPublish(anObj, theName, "box")
2553 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2554 # @param theH height of Face.
2555 # @param theW width of Face.
2556 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2557 # @param theName Object name; when specified, this parameter is used
2558 # for result publication in the study. Otherwise, if automatic
2559 # publication is switched on, default value is used for result name.
2561 # @return New GEOM.GEOM_Object, containing the created face.
2563 # @ref tui_creation_face "Example"
2564 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2566 Create a face with specified dimensions with edges parallel to coordinate axes.
2569 theH height of Face.
2571 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2572 theName Object name; when specified, this parameter is used
2573 for result publication in the study. Otherwise, if automatic
2574 publication is switched on, default value is used for result name.
2577 New GEOM.GEOM_Object, containing the created face.
2579 # Example: see GEOM_TestAll.py
2580 theH,theW,Parameters = ParseParameters(theH, theW)
2581 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2582 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2583 anObj.SetParameters(Parameters)
2584 self._autoPublish(anObj, theName, "rectangle")
2587 ## Create a face from another plane and two sizes,
2588 # vertical size and horisontal size.
2589 # @param theObj Normale vector to the creating face or
2591 # @param theH Height (vertical size).
2592 # @param theW Width (horisontal size).
2593 # @param theName Object name; when specified, this parameter is used
2594 # for result publication in the study. Otherwise, if automatic
2595 # publication is switched on, default value is used for result name.
2597 # @return New GEOM.GEOM_Object, containing the created face.
2599 # @ref tui_creation_face "Example"
2600 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2602 Create a face from another plane and two sizes,
2603 vertical size and horisontal size.
2606 theObj Normale vector to the creating face or
2608 theH Height (vertical size).
2609 theW Width (horisontal size).
2610 theName Object name; when specified, this parameter is used
2611 for result publication in the study. Otherwise, if automatic
2612 publication is switched on, default value is used for result name.
2615 New GEOM_Object, containing the created face.
2617 # Example: see GEOM_TestAll.py
2618 theH,theW,Parameters = ParseParameters(theH, theW)
2619 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2620 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2621 anObj.SetParameters(Parameters)
2622 self._autoPublish(anObj, theName, "rectangle")
2625 ## Create a disk with given center, normal vector and radius.
2626 # @param thePnt Disk center.
2627 # @param theVec Vector, normal to the plane of the disk.
2628 # @param theR Disk radius.
2629 # @param theName Object name; when specified, this parameter is used
2630 # for result publication in the study. Otherwise, if automatic
2631 # publication is switched on, default value is used for result name.
2633 # @return New GEOM.GEOM_Object, containing the created disk.
2635 # @ref tui_creation_disk "Example"
2636 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2638 Create a disk with given center, normal vector and radius.
2642 theVec Vector, normal to the plane of the disk.
2644 theName Object name; when specified, this parameter is used
2645 for result publication in the study. Otherwise, if automatic
2646 publication is switched on, default value is used for result name.
2649 New GEOM.GEOM_Object, containing the created disk.
2651 # Example: see GEOM_TestAll.py
2652 theR,Parameters = ParseParameters(theR)
2653 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2654 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2655 anObj.SetParameters(Parameters)
2656 self._autoPublish(anObj, theName, "disk")
2659 ## Create a disk, passing through three given points
2660 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2661 # @param theName Object name; when specified, this parameter is used
2662 # for result publication in the study. Otherwise, if automatic
2663 # publication is switched on, default value is used for result name.
2665 # @return New GEOM.GEOM_Object, containing the created disk.
2667 # @ref tui_creation_disk "Example"
2668 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2670 Create a disk, passing through three given points
2673 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2674 theName Object name; when specified, this parameter is used
2675 for result publication in the study. Otherwise, if automatic
2676 publication is switched on, default value is used for result name.
2679 New GEOM.GEOM_Object, containing the created disk.
2681 # Example: see GEOM_TestAll.py
2682 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2683 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2684 self._autoPublish(anObj, theName, "disk")
2687 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2688 # @param theR Radius of Face.
2689 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2690 # @param theName Object name; when specified, this parameter is used
2691 # for result publication in the study. Otherwise, if automatic
2692 # publication is switched on, default value is used for result name.
2694 # @return New GEOM.GEOM_Object, containing the created disk.
2696 # @ref tui_creation_face "Example"
2697 def MakeDiskR(self, theR, theOrientation, theName=None):
2699 Create a disk with specified dimensions along OX-OY coordinate axes.
2702 theR Radius of Face.
2703 theOrientation set the orientation belong axis OXY or OYZ or OZX
2704 theName Object name; when specified, this parameter is used
2705 for result publication in the study. Otherwise, if automatic
2706 publication is switched on, default value is used for result name.
2709 New GEOM.GEOM_Object, containing the created disk.
2712 Disk3 = geompy.MakeDiskR(100., 1)
2714 # Example: see GEOM_TestAll.py
2715 theR,Parameters = ParseParameters(theR)
2716 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2717 RaiseIfFailed("MakeDiskR", self.PrimOp)
2718 anObj.SetParameters(Parameters)
2719 self._autoPublish(anObj, theName, "disk")
2722 ## Create a cylinder with given base point, axis, radius and height.
2723 # @param thePnt Central point of cylinder base.
2724 # @param theAxis Cylinder axis.
2725 # @param theR Cylinder radius.
2726 # @param theH Cylinder height.
2727 # @param theName Object name; when specified, this parameter is used
2728 # for result publication in the study. Otherwise, if automatic
2729 # publication is switched on, default value is used for result name.
2731 # @return New GEOM.GEOM_Object, containing the created cylinder.
2733 # @ref tui_creation_cylinder "Example"
2734 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2736 Create a cylinder with given base point, axis, radius and height.
2739 thePnt Central point of cylinder base.
2740 theAxis Cylinder axis.
2741 theR Cylinder radius.
2742 theH Cylinder height.
2743 theName Object name; when specified, this parameter is used
2744 for result publication in the study. Otherwise, if automatic
2745 publication is switched on, default value is used for result name.
2748 New GEOM.GEOM_Object, containing the created cylinder.
2750 # Example: see GEOM_TestAll.py
2751 theR,theH,Parameters = ParseParameters(theR, theH)
2752 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2753 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2754 anObj.SetParameters(Parameters)
2755 self._autoPublish(anObj, theName, "cylinder")
2758 ## Create a cylinder with given radius and height at
2759 # the origin of coordinate system. Axis of the cylinder
2760 # will be collinear to the OZ axis of the coordinate system.
2761 # @param theR Cylinder radius.
2762 # @param theH Cylinder height.
2763 # @param theName Object name; when specified, this parameter is used
2764 # for result publication in the study. Otherwise, if automatic
2765 # publication is switched on, default value is used for result name.
2767 # @return New GEOM.GEOM_Object, containing the created cylinder.
2769 # @ref tui_creation_cylinder "Example"
2770 def MakeCylinderRH(self, theR, theH, theName=None):
2772 Create a cylinder with given radius and height at
2773 the origin of coordinate system. Axis of the cylinder
2774 will be collinear to the OZ axis of the coordinate system.
2777 theR Cylinder radius.
2778 theH Cylinder height.
2779 theName Object name; when specified, this parameter is used
2780 for result publication in the study. Otherwise, if automatic
2781 publication is switched on, default value is used for result name.
2784 New GEOM.GEOM_Object, containing the created cylinder.
2786 # Example: see GEOM_TestAll.py
2787 theR,theH,Parameters = ParseParameters(theR, theH)
2788 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2789 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2790 anObj.SetParameters(Parameters)
2791 self._autoPublish(anObj, theName, "cylinder")
2794 ## Create a sphere with given center and radius.
2795 # @param thePnt Sphere center.
2796 # @param theR Sphere radius.
2797 # @param theName Object name; when specified, this parameter is used
2798 # for result publication in the study. Otherwise, if automatic
2799 # publication is switched on, default value is used for result name.
2801 # @return New GEOM.GEOM_Object, containing the created sphere.
2803 # @ref tui_creation_sphere "Example"
2804 def MakeSpherePntR(self, thePnt, theR, theName=None):
2806 Create a sphere with given center and radius.
2809 thePnt Sphere center.
2811 theName Object name; when specified, this parameter is used
2812 for result publication in the study. Otherwise, if automatic
2813 publication is switched on, default value is used for result name.
2816 New GEOM.GEOM_Object, containing the created sphere.
2818 # Example: see GEOM_TestAll.py
2819 theR,Parameters = ParseParameters(theR)
2820 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2821 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2822 anObj.SetParameters(Parameters)
2823 self._autoPublish(anObj, theName, "sphere")
2826 ## Create a sphere with given center and radius.
2827 # @param x,y,z Coordinates of sphere center.
2828 # @param theR Sphere radius.
2829 # @param theName Object name; when specified, this parameter is used
2830 # for result publication in the study. Otherwise, if automatic
2831 # publication is switched on, default value is used for result name.
2833 # @return New GEOM.GEOM_Object, containing the created sphere.
2835 # @ref tui_creation_sphere "Example"
2836 def MakeSphere(self, x, y, z, theR, theName=None):
2838 Create a sphere with given center and radius.
2841 x,y,z Coordinates of sphere center.
2843 theName Object name; when specified, this parameter is used
2844 for result publication in the study. Otherwise, if automatic
2845 publication is switched on, default value is used for result name.
2848 New GEOM.GEOM_Object, containing the created sphere.
2850 # Example: see GEOM_TestAll.py
2851 point = self.MakeVertex(x, y, z)
2852 # note: auto-publishing is done in self.MakeSpherePntR()
2853 anObj = self.MakeSpherePntR(point, theR, theName)
2856 ## Create a sphere with given radius at the origin of coordinate system.
2857 # @param theR Sphere radius.
2858 # @param theName Object name; when specified, this parameter is used
2859 # for result publication in the study. Otherwise, if automatic
2860 # publication is switched on, default value is used for result name.
2862 # @return New GEOM.GEOM_Object, containing the created sphere.
2864 # @ref tui_creation_sphere "Example"
2865 def MakeSphereR(self, theR, theName=None):
2867 Create a sphere with given radius at the origin of coordinate system.
2871 theName Object name; when specified, this parameter is used
2872 for result publication in the study. Otherwise, if automatic
2873 publication is switched on, default value is used for result name.
2876 New GEOM.GEOM_Object, containing the created sphere.
2878 # Example: see GEOM_TestAll.py
2879 theR,Parameters = ParseParameters(theR)
2880 anObj = self.PrimOp.MakeSphereR(theR)
2881 RaiseIfFailed("MakeSphereR", self.PrimOp)
2882 anObj.SetParameters(Parameters)
2883 self._autoPublish(anObj, theName, "sphere")
2886 ## Create a cone with given base point, axis, height and radiuses.
2887 # @param thePnt Central point of the first cone base.
2888 # @param theAxis Cone axis.
2889 # @param theR1 Radius of the first cone base.
2890 # @param theR2 Radius of the second cone base.
2891 # \note If both radiuses are non-zero, the cone will be truncated.
2892 # \note If the radiuses are equal, a cylinder will be created instead.
2893 # @param theH Cone height.
2894 # @param theName Object name; when specified, this parameter is used
2895 # for result publication in the study. Otherwise, if automatic
2896 # publication is switched on, default value is used for result name.
2898 # @return New GEOM.GEOM_Object, containing the created cone.
2900 # @ref tui_creation_cone "Example"
2901 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2903 Create a cone with given base point, axis, height and radiuses.
2906 thePnt Central point of the first cone base.
2908 theR1 Radius of the first cone base.
2909 theR2 Radius of the second cone base.
2911 theName Object name; when specified, this parameter is used
2912 for result publication in the study. Otherwise, if automatic
2913 publication is switched on, default value is used for result name.
2916 If both radiuses are non-zero, the cone will be truncated.
2917 If the radiuses are equal, a cylinder will be created instead.
2920 New GEOM.GEOM_Object, containing the created cone.
2922 # Example: see GEOM_TestAll.py
2923 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2924 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2925 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2926 anObj.SetParameters(Parameters)
2927 self._autoPublish(anObj, theName, "cone")
2930 ## Create a cone with given height and radiuses at
2931 # the origin of coordinate system. Axis of the cone will
2932 # be collinear to the OZ axis of the coordinate system.
2933 # @param theR1 Radius of the first cone base.
2934 # @param theR2 Radius of the second cone base.
2935 # \note If both radiuses are non-zero, the cone will be truncated.
2936 # \note If the radiuses are equal, a cylinder will be created instead.
2937 # @param theH Cone height.
2938 # @param theName Object name; when specified, this parameter is used
2939 # for result publication in the study. Otherwise, if automatic
2940 # publication is switched on, default value is used for result name.
2942 # @return New GEOM.GEOM_Object, containing the created cone.
2944 # @ref tui_creation_cone "Example"
2945 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
2947 Create a cone with given height and radiuses at
2948 the origin of coordinate system. Axis of the cone will
2949 be collinear to the OZ axis of the coordinate system.
2952 theR1 Radius of the first cone base.
2953 theR2 Radius of the second cone base.
2955 theName Object name; when specified, this parameter is used
2956 for result publication in the study. Otherwise, if automatic
2957 publication is switched on, default value is used for result name.
2960 If both radiuses are non-zero, the cone will be truncated.
2961 If the radiuses are equal, a cylinder will be created instead.
2964 New GEOM.GEOM_Object, containing the created cone.
2966 # Example: see GEOM_TestAll.py
2967 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2968 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2969 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2970 anObj.SetParameters(Parameters)
2971 self._autoPublish(anObj, theName, "cone")
2974 ## Create a torus with given center, normal vector and radiuses.
2975 # @param thePnt Torus central point.
2976 # @param theVec Torus axis of symmetry.
2977 # @param theRMajor Torus major radius.
2978 # @param theRMinor Torus minor radius.
2979 # @param theName Object name; when specified, this parameter is used
2980 # for result publication in the study. Otherwise, if automatic
2981 # publication is switched on, default value is used for result name.
2983 # @return New GEOM.GEOM_Object, containing the created torus.
2985 # @ref tui_creation_torus "Example"
2986 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
2988 Create a torus with given center, normal vector and radiuses.
2991 thePnt Torus central point.
2992 theVec Torus axis of symmetry.
2993 theRMajor Torus major radius.
2994 theRMinor Torus minor radius.
2995 theName Object name; when specified, this parameter is used
2996 for result publication in the study. Otherwise, if automatic
2997 publication is switched on, default value is used for result name.
3000 New GEOM.GEOM_Object, containing the created torus.
3002 # Example: see GEOM_TestAll.py
3003 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3004 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
3005 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
3006 anObj.SetParameters(Parameters)
3007 self._autoPublish(anObj, theName, "torus")
3010 ## Create a torus with given radiuses at the origin of coordinate system.
3011 # @param theRMajor Torus major radius.
3012 # @param theRMinor Torus minor radius.
3013 # @param theName Object name; when specified, this parameter is used
3014 # for result publication in the study. Otherwise, if automatic
3015 # publication is switched on, default value is used for result name.
3017 # @return New GEOM.GEOM_Object, containing the created torus.
3019 # @ref tui_creation_torus "Example"
3020 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
3022 Create a torus with given radiuses at the origin of coordinate system.
3025 theRMajor Torus major radius.
3026 theRMinor Torus minor radius.
3027 theName Object name; when specified, this parameter is used
3028 for result publication in the study. Otherwise, if automatic
3029 publication is switched on, default value is used for result name.
3032 New GEOM.GEOM_Object, containing the created torus.
3034 # Example: see GEOM_TestAll.py
3035 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
3036 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
3037 RaiseIfFailed("MakeTorusRR", self.PrimOp)
3038 anObj.SetParameters(Parameters)
3039 self._autoPublish(anObj, theName, "torus")
3042 # end of l3_3d_primitives
3045 ## @addtogroup l3_complex
3048 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3049 # @param theBase Base shape to be extruded.
3050 # @param thePoint1 First end of extrusion vector.
3051 # @param thePoint2 Second end of extrusion vector.
3052 # @param theScaleFactor Use it to make prism with scaled second base.
3053 # Nagative value means not scaled second base.
3054 # @param theName Object name; when specified, this parameter is used
3055 # for result publication in the study. Otherwise, if automatic
3056 # publication is switched on, default value is used for result name.
3058 # @return New GEOM.GEOM_Object, containing the created prism.
3060 # @ref tui_creation_prism "Example"
3061 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3063 Create a shape by extrusion of the base shape along a vector, defined by two points.
3066 theBase Base shape to be extruded.
3067 thePoint1 First end of extrusion vector.
3068 thePoint2 Second end of extrusion vector.
3069 theScaleFactor Use it to make prism with scaled second base.
3070 Nagative value means not scaled second base.
3071 theName Object name; when specified, this parameter is used
3072 for result publication in the study. Otherwise, if automatic
3073 publication is switched on, default value is used for result name.
3076 New GEOM.GEOM_Object, containing the created prism.
3078 # Example: see GEOM_TestAll.py
3081 if theScaleFactor > 0:
3082 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3083 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3085 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3086 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3087 anObj.SetParameters(Parameters)
3088 self._autoPublish(anObj, theName, "prism")
3091 ## Create a shape by extrusion of the base shape along a
3092 # vector, defined by two points, in 2 Ways (forward/backward).
3093 # @param theBase Base shape to be extruded.
3094 # @param thePoint1 First end of extrusion vector.
3095 # @param thePoint2 Second end of extrusion vector.
3096 # @param theName Object name; when specified, this parameter is used
3097 # for result publication in the study. Otherwise, if automatic
3098 # publication is switched on, default value is used for result name.
3100 # @return New GEOM.GEOM_Object, containing the created prism.
3102 # @ref tui_creation_prism "Example"
3103 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3105 Create a shape by extrusion of the base shape along a
3106 vector, defined by two points, in 2 Ways (forward/backward).
3109 theBase Base shape to be extruded.
3110 thePoint1 First end of extrusion vector.
3111 thePoint2 Second end of extrusion vector.
3112 theName Object name; when specified, this parameter is used
3113 for result publication in the study. Otherwise, if automatic
3114 publication is switched on, default value is used for result name.
3117 New GEOM.GEOM_Object, containing the created prism.
3119 # Example: see GEOM_TestAll.py
3120 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3121 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3122 self._autoPublish(anObj, theName, "prism")
3125 ## Create a shape by extrusion of the base shape along the vector,
3126 # i.e. all the space, transfixed by the base shape during its translation
3127 # along the vector on the given distance.
3128 # @param theBase Base shape to be extruded.
3129 # @param theVec Direction of extrusion.
3130 # @param theH Prism dimension along theVec.
3131 # @param theScaleFactor Use it to make prism with scaled second base.
3132 # Negative value means not scaled second base.
3133 # @param theName Object name; when specified, this parameter is used
3134 # for result publication in the study. Otherwise, if automatic
3135 # publication is switched on, default value is used for result name.
3137 # @return New GEOM.GEOM_Object, containing the created prism.
3139 # @ref tui_creation_prism "Example"
3140 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3142 Create a shape by extrusion of the base shape along the vector,
3143 i.e. all the space, transfixed by the base shape during its translation
3144 along the vector on the given distance.
3147 theBase Base shape to be extruded.
3148 theVec Direction of extrusion.
3149 theH Prism dimension along theVec.
3150 theScaleFactor Use it to make prism with scaled second base.
3151 Negative value means not scaled second base.
3152 theName Object name; when specified, this parameter is used
3153 for result publication in the study. Otherwise, if automatic
3154 publication is switched on, default value is used for result name.
3157 New GEOM.GEOM_Object, containing the created prism.
3159 # Example: see GEOM_TestAll.py
3162 if theScaleFactor > 0:
3163 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3164 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3166 theH,Parameters = ParseParameters(theH)
3167 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3168 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3169 anObj.SetParameters(Parameters)
3170 self._autoPublish(anObj, theName, "prism")
3173 ## Create a shape by extrusion of the base shape along the vector,
3174 # i.e. all the space, transfixed by the base shape during its translation
3175 # along the vector on the given distance in 2 Ways (forward/backward).
3176 # @param theBase Base shape to be extruded.
3177 # @param theVec Direction of extrusion.
3178 # @param theH Prism dimension along theVec in forward direction.
3179 # @param theName Object name; when specified, this parameter is used
3180 # for result publication in the study. Otherwise, if automatic
3181 # publication is switched on, default value is used for result name.
3183 # @return New GEOM.GEOM_Object, containing the created prism.
3185 # @ref tui_creation_prism "Example"
3186 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3188 Create a shape by extrusion of the base shape along the vector,
3189 i.e. all the space, transfixed by the base shape during its translation
3190 along the vector on the given distance in 2 Ways (forward/backward).
3193 theBase Base shape to be extruded.
3194 theVec Direction of extrusion.
3195 theH Prism dimension along theVec in forward direction.
3196 theName Object name; when specified, this parameter is used
3197 for result publication in the study. Otherwise, if automatic
3198 publication is switched on, default value is used for result name.
3201 New GEOM.GEOM_Object, containing the created prism.
3203 # Example: see GEOM_TestAll.py
3204 theH,Parameters = ParseParameters(theH)
3205 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3206 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3207 anObj.SetParameters(Parameters)
3208 self._autoPublish(anObj, theName, "prism")
3211 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3212 # @param theBase Base shape to be extruded.
3213 # @param theDX, theDY, theDZ Directions of extrusion.
3214 # @param theScaleFactor Use it to make prism with scaled second base.
3215 # Nagative value means not scaled second base.
3216 # @param theName Object name; when specified, this parameter is used
3217 # for result publication in the study. Otherwise, if automatic
3218 # publication is switched on, default value is used for result name.
3220 # @return New GEOM.GEOM_Object, containing the created prism.
3222 # @ref tui_creation_prism "Example"
3223 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3225 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3228 theBase Base shape to be extruded.
3229 theDX, theDY, theDZ Directions of extrusion.
3230 theScaleFactor Use it to make prism with scaled second base.
3231 Nagative value means not scaled second base.
3232 theName Object name; when specified, this parameter is used
3233 for result publication in the study. Otherwise, if automatic
3234 publication is switched on, default value is used for result name.
3237 New GEOM.GEOM_Object, containing the created prism.
3239 # Example: see GEOM_TestAll.py
3242 if theScaleFactor > 0:
3243 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3244 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3246 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3247 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3248 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3249 anObj.SetParameters(Parameters)
3250 self._autoPublish(anObj, theName, "prism")
3253 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3254 # i.e. all the space, transfixed by the base shape during its translation
3255 # along the vector on the given distance in 2 Ways (forward/backward).
3256 # @param theBase Base shape to be extruded.
3257 # @param theDX, theDY, theDZ Directions of extrusion.
3258 # @param theName Object name; when specified, this parameter is used
3259 # for result publication in the study. Otherwise, if automatic
3260 # publication is switched on, default value is used for result name.
3262 # @return New GEOM.GEOM_Object, containing the created prism.
3264 # @ref tui_creation_prism "Example"
3265 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3267 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3268 i.e. all the space, transfixed by the base shape during its translation
3269 along the vector on the given distance in 2 Ways (forward/backward).
3272 theBase Base shape to be extruded.
3273 theDX, theDY, theDZ Directions of extrusion.
3274 theName Object name; when specified, this parameter is used
3275 for result publication in the study. Otherwise, if automatic
3276 publication is switched on, default value is used for result name.
3279 New GEOM.GEOM_Object, containing the created prism.
3281 # Example: see GEOM_TestAll.py
3282 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3283 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3284 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3285 anObj.SetParameters(Parameters)
3286 self._autoPublish(anObj, theName, "prism")
3289 ## Create a shape by revolution of the base shape around the axis
3290 # on the given angle, i.e. all the space, transfixed by the base
3291 # shape during its rotation around the axis on the given angle.
3292 # @param theBase Base shape to be rotated.
3293 # @param theAxis Rotation axis.
3294 # @param theAngle Rotation angle in radians.
3295 # @param theName Object name; when specified, this parameter is used
3296 # for result publication in the study. Otherwise, if automatic
3297 # publication is switched on, default value is used for result name.
3299 # @return New GEOM.GEOM_Object, containing the created revolution.
3301 # @ref tui_creation_revolution "Example"
3302 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3304 Create a shape by revolution of the base shape around the axis
3305 on the given angle, i.e. all the space, transfixed by the base
3306 shape during its rotation around the axis on the given angle.
3309 theBase Base shape to be rotated.
3310 theAxis Rotation axis.
3311 theAngle Rotation angle in radians.
3312 theName Object name; when specified, this parameter is used
3313 for result publication in the study. Otherwise, if automatic
3314 publication is switched on, default value is used for result name.
3317 New GEOM.GEOM_Object, containing the created revolution.
3319 # Example: see GEOM_TestAll.py
3320 theAngle,Parameters = ParseParameters(theAngle)
3321 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3322 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3323 anObj.SetParameters(Parameters)
3324 self._autoPublish(anObj, theName, "revolution")
3327 ## Create a shape by revolution of the base shape around the axis
3328 # on the given angle, i.e. all the space, transfixed by the base
3329 # shape during its rotation around the axis on the given angle in
3330 # both directions (forward/backward)
3331 # @param theBase Base shape to be rotated.
3332 # @param theAxis Rotation axis.
3333 # @param theAngle Rotation angle in radians.
3334 # @param theName Object name; when specified, this parameter is used
3335 # for result publication in the study. Otherwise, if automatic
3336 # publication is switched on, default value is used for result name.
3338 # @return New GEOM.GEOM_Object, containing the created revolution.
3340 # @ref tui_creation_revolution "Example"
3341 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3343 Create a shape by revolution of the base shape around the axis
3344 on the given angle, i.e. all the space, transfixed by the base
3345 shape during its rotation around the axis on the given angle in
3346 both directions (forward/backward).
3349 theBase Base shape to be rotated.
3350 theAxis Rotation axis.
3351 theAngle Rotation angle in radians.
3352 theName Object name; when specified, this parameter is used
3353 for result publication in the study. Otherwise, if automatic
3354 publication is switched on, default value is used for result name.
3357 New GEOM.GEOM_Object, containing the created revolution.
3359 theAngle,Parameters = ParseParameters(theAngle)
3360 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3361 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3362 anObj.SetParameters(Parameters)
3363 self._autoPublish(anObj, theName, "revolution")
3366 ## Create a filling from the given compound of contours.
3367 # @param theShape the compound of contours
3368 # @param theMinDeg a minimal degree of BSpline surface to create
3369 # @param theMaxDeg a maximal degree of BSpline surface to create
3370 # @param theTol2D a 2d tolerance to be reached
3371 # @param theTol3D a 3d tolerance to be reached
3372 # @param theNbIter a number of iteration of approximation algorithm
3373 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3374 # @param isApprox if True, BSpline curves are generated in the process
3375 # of surface construction. By default it is False, that means
3376 # the surface is created using given curves. The usage of
3377 # Approximation makes the algorithm work slower, but allows
3378 # building the surface for rather complex cases.
3379 # @param theName Object name; when specified, this parameter is used
3380 # for result publication in the study. Otherwise, if automatic
3381 # publication is switched on, default value is used for result name.
3383 # @return New GEOM.GEOM_Object, containing the created filling surface.
3385 # @ref tui_creation_filling "Example"
3386 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3387 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3389 Create a filling from the given compound of contours.
3392 theShape the compound of contours
3393 theMinDeg a minimal degree of BSpline surface to create
3394 theMaxDeg a maximal degree of BSpline surface to create
3395 theTol2D a 2d tolerance to be reached
3396 theTol3D a 3d tolerance to be reached
3397 theNbIter a number of iteration of approximation algorithm
3398 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3399 isApprox if True, BSpline curves are generated in the process
3400 of surface construction. By default it is False, that means
3401 the surface is created using given curves. The usage of
3402 Approximation makes the algorithm work slower, but allows
3403 building the surface for rather complex cases
3404 theName Object name; when specified, this parameter is used
3405 for result publication in the study. Otherwise, if automatic
3406 publication is switched on, default value is used for result name.
3409 New GEOM.GEOM_Object, containing the created filling surface.
3412 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3414 # Example: see GEOM_TestAll.py
3415 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3416 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3417 theTol2D, theTol3D, theNbIter,
3418 theMethod, isApprox)
3419 RaiseIfFailed("MakeFilling", self.PrimOp)
3420 anObj.SetParameters(Parameters)
3421 self._autoPublish(anObj, theName, "filling")
3425 ## Create a filling from the given compound of contours.
3426 # This method corresponds to MakeFilling with isApprox=True
3427 # @param theShape the compound of contours
3428 # @param theMinDeg a minimal degree of BSpline surface to create
3429 # @param theMaxDeg a maximal degree of BSpline surface to create
3430 # @param theTol3D a 3d tolerance to be reached
3431 # @param theName Object name; when specified, this parameter is used
3432 # for result publication in the study. Otherwise, if automatic
3433 # publication is switched on, default value is used for result name.
3435 # @return New GEOM.GEOM_Object, containing the created filling surface.
3437 # @ref tui_creation_filling "Example"
3438 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3440 Create a filling from the given compound of contours.
3441 This method corresponds to MakeFilling with isApprox=True
3444 theShape the compound of contours
3445 theMinDeg a minimal degree of BSpline surface to create
3446 theMaxDeg a maximal degree of BSpline surface to create
3447 theTol3D a 3d tolerance to be reached
3448 theName Object name; when specified, this parameter is used
3449 for result publication in the study. Otherwise, if automatic
3450 publication is switched on, default value is used for result name.
3453 New GEOM.GEOM_Object, containing the created filling surface.
3456 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3458 # Example: see GEOM_TestAll.py
3459 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3460 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3461 0, theTol3D, 0, GEOM.FOM_Default, True)
3462 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3463 anObj.SetParameters(Parameters)
3464 self._autoPublish(anObj, theName, "filling")
3467 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3468 # @param theSeqSections - set of specified sections.
3469 # @param theModeSolid - mode defining building solid or shell
3470 # @param thePreci - precision 3D used for smoothing
3471 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3472 # @param theName Object name; when specified, this parameter is used
3473 # for result publication in the study. Otherwise, if automatic
3474 # publication is switched on, default value is used for result name.
3476 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3478 # @ref swig_todo "Example"
3479 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3481 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3484 theSeqSections - set of specified sections.
3485 theModeSolid - mode defining building solid or shell
3486 thePreci - precision 3D used for smoothing
3487 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3488 theName Object name; when specified, this parameter is used
3489 for result publication in the study. Otherwise, if automatic
3490 publication is switched on, default value is used for result name.
3493 New GEOM.GEOM_Object, containing the created shell or solid.
3495 # Example: see GEOM_TestAll.py
3496 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3497 RaiseIfFailed("MakeThruSections", self.PrimOp)
3498 self._autoPublish(anObj, theName, "filling")
3501 ## Create a shape by extrusion of the base shape along
3502 # the path shape. The path shape can be a wire or an edge.
3503 # @param theBase Base shape to be extruded.
3504 # @param thePath Path shape to extrude the base shape along it.
3505 # @param theName Object name; when specified, this parameter is used
3506 # for result publication in the study. Otherwise, if automatic
3507 # publication is switched on, default value is used for result name.
3509 # @return New GEOM.GEOM_Object, containing the created pipe.
3511 # @ref tui_creation_pipe "Example"
3512 def MakePipe(self, theBase, thePath, theName=None):
3514 Create a shape by extrusion of the base shape along
3515 the path shape. The path shape can be a wire or an edge.
3518 theBase Base shape to be extruded.
3519 thePath Path shape to extrude the base shape along it.
3520 theName Object name; when specified, this parameter is used
3521 for result publication in the study. Otherwise, if automatic
3522 publication is switched on, default value is used for result name.
3525 New GEOM.GEOM_Object, containing the created pipe.
3527 # Example: see GEOM_TestAll.py
3528 anObj = self.PrimOp.MakePipe(theBase, thePath)
3529 RaiseIfFailed("MakePipe", self.PrimOp)
3530 self._autoPublish(anObj, theName, "pipe")
3533 ## Create a shape by extrusion of the profile shape along
3534 # the path shape. The path shape can be a wire or an edge.
3535 # the several profiles can be specified in the several locations of path.
3536 # @param theSeqBases - list of Bases shape to be extruded.
3537 # @param theLocations - list of locations on the path corresponding
3538 # specified list of the Bases shapes. Number of locations
3539 # should be equal to number of bases or list of locations can be empty.
3540 # @param thePath - Path shape to extrude the base shape along it.
3541 # @param theWithContact - the mode defining that the section is translated to be in
3542 # contact with the spine.
3543 # @param theWithCorrection - defining that the section is rotated to be
3544 # orthogonal to the spine tangent in the correspondent point
3545 # @param theName Object name; when specified, this parameter is used
3546 # for result publication in the study. Otherwise, if automatic
3547 # publication is switched on, default value is used for result name.
3549 # @return New GEOM.GEOM_Object, containing the created pipe.
3551 # @ref tui_creation_pipe_with_diff_sec "Example"
3552 def MakePipeWithDifferentSections(self, theSeqBases,
3553 theLocations, thePath,
3554 theWithContact, theWithCorrection, theName=None):
3556 Create a shape by extrusion of the profile shape along
3557 the path shape. The path shape can be a wire or an edge.
3558 the several profiles can be specified in the several locations of path.
3561 theSeqBases - list of Bases shape to be extruded.
3562 theLocations - list of locations on the path corresponding
3563 specified list of the Bases shapes. Number of locations
3564 should be equal to number of bases or list of locations can be empty.
3565 thePath - Path shape to extrude the base shape along it.
3566 theWithContact - the mode defining that the section is translated to be in
3567 contact with the spine(0/1)
3568 theWithCorrection - defining that the section is rotated to be
3569 orthogonal to the spine tangent in the correspondent point (0/1)
3570 theName Object name; when specified, this parameter is used
3571 for result publication in the study. Otherwise, if automatic
3572 publication is switched on, default value is used for result name.
3575 New GEOM.GEOM_Object, containing the created pipe.
3577 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3578 theLocations, thePath,
3579 theWithContact, theWithCorrection)
3580 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3581 self._autoPublish(anObj, theName, "pipe")
3584 ## Create a shape by extrusion of the profile shape along
3585 # the path shape. The path shape can be a wire or a edge.
3586 # the several profiles can be specified in the several locations of path.
3587 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3588 # shell or face. If number of faces in neighbour sections
3589 # aren't coincided result solid between such sections will
3590 # be created using external boundaries of this shells.
3591 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3592 # This list is used for searching correspondences between
3593 # faces in the sections. Size of this list must be equal
3594 # to size of list of base shapes.
3595 # @param theLocations - list of locations on the path corresponding
3596 # specified list of the Bases shapes. Number of locations
3597 # should be equal to number of bases. First and last
3598 # locations must be coincided with first and last vertexes
3599 # of path correspondingly.
3600 # @param thePath - Path shape to extrude the base shape along it.
3601 # @param theWithContact - the mode defining that the section is translated to be in
3602 # contact with the spine.
3603 # @param theWithCorrection - defining that the section is rotated to be
3604 # orthogonal to the spine tangent in the correspondent point
3605 # @param theName Object name; when specified, this parameter is used
3606 # for result publication in the study. Otherwise, if automatic
3607 # publication is switched on, default value is used for result name.
3609 # @return New GEOM.GEOM_Object, containing the created solids.
3611 # @ref tui_creation_pipe_with_shell_sec "Example"
3612 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3613 theLocations, thePath,
3614 theWithContact, theWithCorrection, theName=None):
3616 Create a shape by extrusion of the profile shape along
3617 the path shape. The path shape can be a wire or a edge.
3618 the several profiles can be specified in the several locations of path.
3621 theSeqBases - list of Bases shape to be extruded. Base shape must be
3622 shell or face. If number of faces in neighbour sections
3623 aren't coincided result solid between such sections will
3624 be created using external boundaries of this shells.
3625 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3626 This list is used for searching correspondences between
3627 faces in the sections. Size of this list must be equal
3628 to size of list of base shapes.
3629 theLocations - list of locations on the path corresponding
3630 specified list of the Bases shapes. Number of locations
3631 should be equal to number of bases. First and last
3632 locations must be coincided with first and last vertexes
3633 of path correspondingly.
3634 thePath - Path shape to extrude the base shape along it.
3635 theWithContact - the mode defining that the section is translated to be in
3636 contact with the spine (0/1)
3637 theWithCorrection - defining that the section is rotated to be
3638 orthogonal to the spine tangent in the correspondent point (0/1)
3639 theName Object name; when specified, this parameter is used
3640 for result publication in the study. Otherwise, if automatic
3641 publication is switched on, default value is used for result name.
3644 New GEOM.GEOM_Object, containing the created solids.
3646 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3647 theLocations, thePath,
3648 theWithContact, theWithCorrection)
3649 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3650 self._autoPublish(anObj, theName, "pipe")
3653 ## Create a shape by extrusion of the profile shape along
3654 # the path shape. This function is used only for debug pipe
3655 # functionality - it is a version of function MakePipeWithShellSections()
3656 # which give a possibility to recieve information about
3657 # creating pipe between each pair of sections step by step.
3658 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3659 theLocations, thePath,
3660 theWithContact, theWithCorrection, theName=None):
3662 Create a shape by extrusion of the profile shape along
3663 the path shape. This function is used only for debug pipe
3664 functionality - it is a version of previous function
3665 geompy.MakePipeWithShellSections() which give a possibility to
3666 recieve information about creating pipe between each pair of
3667 sections step by step.
3670 nbsect = len(theSeqBases)
3671 nbsubsect = len(theSeqSubBases)
3672 #print "nbsect = ",nbsect
3673 for i in range(1,nbsect):
3675 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3676 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3678 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3679 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3680 tmpLocations, thePath,
3681 theWithContact, theWithCorrection)
3682 if self.PrimOp.IsDone() == 0:
3683 print "Problems with pipe creation between ",i," and ",i+1," sections"
3684 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3687 print "Pipe between ",i," and ",i+1," sections is OK"
3692 resc = self.MakeCompound(res)
3693 #resc = self.MakeSewing(res, 0.001)
3694 #print "resc: ",resc
3695 self._autoPublish(resc, theName, "pipe")
3698 ## Create solids between given sections
3699 # @param theSeqBases - list of sections (shell or face).
3700 # @param theLocations - list of corresponding vertexes
3701 # @param theName Object name; when specified, this parameter is used
3702 # for result publication in the study. Otherwise, if automatic
3703 # publication is switched on, default value is used for result name.
3705 # @return New GEOM.GEOM_Object, containing the created solids.
3707 # @ref tui_creation_pipe_without_path "Example"
3708 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3710 Create solids between given sections
3713 theSeqBases - list of sections (shell or face).
3714 theLocations - list of corresponding vertexes
3715 theName Object name; when specified, this parameter is used
3716 for result publication in the study. Otherwise, if automatic
3717 publication is switched on, default value is used for result name.
3720 New GEOM.GEOM_Object, containing the created solids.
3722 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3723 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3724 self._autoPublish(anObj, theName, "pipe")
3727 ## Create a shape by extrusion of the base shape along
3728 # the path shape with constant bi-normal direction along the given vector.
3729 # The path shape can be a wire or an edge.
3730 # @param theBase Base shape to be extruded.
3731 # @param thePath Path shape to extrude the base shape along it.
3732 # @param theVec Vector defines a constant binormal direction to keep the
3733 # same angle beetween the direction and the sections
3734 # along the sweep surface.
3735 # @param 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.
3739 # @return New GEOM.GEOM_Object, containing the created pipe.
3741 # @ref tui_creation_pipe "Example"
3742 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3744 Create a shape by extrusion of the base shape along
3745 the path shape with constant bi-normal direction along the given vector.
3746 The path shape can be a wire or an edge.
3749 theBase Base shape to be extruded.
3750 thePath Path shape to extrude the base shape along it.
3751 theVec Vector defines a constant binormal direction to keep the
3752 same angle beetween the direction and the sections
3753 along the sweep surface.
3754 theName Object name; when specified, this parameter is used
3755 for result publication in the study. Otherwise, if automatic
3756 publication is switched on, default value is used for result name.
3759 New GEOM.GEOM_Object, containing the created pipe.
3761 # Example: see GEOM_TestAll.py
3762 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3763 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3764 self._autoPublish(anObj, theName, "pipe")
3767 ## Build a middle path of a pipe-like shape.
3768 # The path shape can be a wire or an edge.
3769 # @param theShape It can be closed or unclosed pipe-like shell
3770 # or a pipe-like solid.
3771 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3772 # should be wires or faces of theShape.
3773 # @param theName Object name; when specified, this parameter is used
3774 # for result publication in the study. Otherwise, if automatic
3775 # publication is switched on, default value is used for result name.
3777 # @note It is not assumed that exact or approximate copy of theShape
3778 # can be obtained by applying existing Pipe operation on the
3779 # resulting "Path" wire taking theBase1 as the base - it is not
3780 # always possible; though in some particular cases it might work
3781 # it is not guaranteed. Thus, RestorePath function should not be
3782 # considered as an exact reverse operation of the Pipe.
3784 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3785 # source pipe's "path".
3787 # @ref tui_creation_pipe_path "Example"
3788 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3790 Build a middle path of a pipe-like shape.
3791 The path shape can be a wire or an edge.
3794 theShape It can be closed or unclosed pipe-like shell
3795 or a pipe-like solid.
3796 theBase1, theBase2 Two bases of the supposed pipe. This
3797 should be wires or faces of theShape.
3798 theName Object name; when specified, this parameter is used
3799 for result publication in the study. Otherwise, if automatic
3800 publication is switched on, default value is used for result name.
3803 New GEOM_Object, containing an edge or wire that represent
3806 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3807 RaiseIfFailed("RestorePath", self.PrimOp)
3808 self._autoPublish(anObj, theName, "path")
3811 ## Build a middle path of a pipe-like shape.
3812 # The path shape can be a wire or an edge.
3813 # @param theShape It can be closed or unclosed pipe-like shell
3814 # or a pipe-like solid.
3815 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3816 # should be lists of edges of theShape.
3817 # @param theName Object name; when specified, this parameter is used
3818 # for result publication in the study. Otherwise, if automatic
3819 # publication is switched on, default value is used for result name.
3821 # @note It is not assumed that exact or approximate copy of theShape
3822 # can be obtained by applying existing Pipe operation on the
3823 # resulting "Path" wire taking theBase1 as the base - it is not
3824 # always possible; though in some particular cases it might work
3825 # it is not guaranteed. Thus, RestorePath function should not be
3826 # considered as an exact reverse operation of the Pipe.
3828 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3829 # source pipe's "path".
3831 # @ref tui_creation_pipe_path "Example"
3832 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3834 Build a middle path of a pipe-like shape.
3835 The path shape can be a wire or an edge.
3838 theShape It can be closed or unclosed pipe-like shell
3839 or a pipe-like solid.
3840 listEdges1, listEdges2 Two bases of the supposed pipe. This
3841 should be lists of edges of theShape.
3842 theName Object name; when specified, this parameter is used
3843 for result publication in the study. Otherwise, if automatic
3844 publication is switched on, default value is used for result name.
3847 New GEOM_Object, containing an edge or wire that represent
3850 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3851 RaiseIfFailed("RestorePath", self.PrimOp)
3852 self._autoPublish(anObj, theName, "path")
3858 ## @addtogroup l3_advanced
3861 ## Create a linear edge with specified ends.
3862 # @param thePnt1 Point for the first end of edge.
3863 # @param thePnt2 Point for the second end of edge.
3864 # @param theName Object name; when specified, this parameter is used
3865 # for result publication in the study. Otherwise, if automatic
3866 # publication is switched on, default value is used for result name.
3868 # @return New GEOM.GEOM_Object, containing the created edge.
3870 # @ref tui_creation_edge "Example"
3871 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3873 Create a linear edge with specified ends.
3876 thePnt1 Point for the first end of edge.
3877 thePnt2 Point for the second end of edge.
3878 theName Object name; when specified, this parameter is used
3879 for result publication in the study. Otherwise, if automatic
3880 publication is switched on, default value is used for result name.
3883 New GEOM.GEOM_Object, containing the created edge.
3885 # Example: see GEOM_TestAll.py
3886 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3887 RaiseIfFailed("MakeEdge", self.ShapesOp)
3888 self._autoPublish(anObj, theName, "edge")
3891 ## Create a new edge, corresponding to the given length on the given curve.
3892 # @param theRefCurve The referenced curve (edge).
3893 # @param theLength Length on the referenced curve. It can be negative.
3894 # @param theStartPoint Any point can be selected for it, the new edge will begin
3895 # at the end of \a theRefCurve, close to the selected point.
3896 # If None, start from the first point of \a theRefCurve.
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, containing the created edge.
3903 # @ref tui_creation_edge "Example"
3904 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
3906 Create a new edge, corresponding to the given length on the given curve.
3909 theRefCurve The referenced curve (edge).
3910 theLength Length on the referenced curve. It can be negative.
3911 theStartPoint Any point can be selected for it, the new edge will begin
3912 at the end of theRefCurve, close to the selected point.
3913 If None, start from the first point of theRefCurve.
3914 theName Object name; when specified, this parameter is used
3915 for result publication in the study. Otherwise, if automatic
3916 publication is switched on, default value is used for result name.
3919 New GEOM.GEOM_Object, containing the created edge.
3921 # Example: see GEOM_TestAll.py
3922 theLength, Parameters = ParseParameters(theLength)
3923 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
3924 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
3925 anObj.SetParameters(Parameters)
3926 self._autoPublish(anObj, theName, "edge")
3929 ## Create an edge from specified wire.
3930 # @param theWire source Wire
3931 # @param theLinearTolerance linear tolerance value (default = 1e-07)
3932 # @param theAngularTolerance angular tolerance value (default = 1e-12)
3933 # @param theName Object name; when specified, this parameter is used
3934 # for result publication in the study. Otherwise, if automatic
3935 # publication is switched on, default value is used for result name.
3937 # @return New GEOM.GEOM_Object, containing the created edge.
3939 # @ref tui_creation_edge "Example"
3940 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
3942 Create an edge from specified wire.
3946 theLinearTolerance linear tolerance value (default = 1e-07)
3947 theAngularTolerance angular tolerance value (default = 1e-12)
3948 theName Object name; when specified, this parameter is used
3949 for result publication in the study. Otherwise, if automatic
3950 publication is switched on, default value is used for result name.
3953 New GEOM.GEOM_Object, containing the created edge.
3955 # Example: see GEOM_TestAll.py
3956 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
3957 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
3958 self._autoPublish(anObj, theName, "edge")
3961 ## Create a wire from the set of edges and wires.
3962 # @param theEdgesAndWires List of edges and/or wires.
3963 # @param theTolerance Maximum distance between vertices, that will be merged.
3964 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
3965 # @param theName Object name; when specified, this parameter is used
3966 # for result publication in the study. Otherwise, if automatic
3967 # publication is switched on, default value is used for result name.
3969 # @return New GEOM.GEOM_Object, containing the created wire.
3971 # @ref tui_creation_wire "Example"
3972 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
3974 Create a wire from the set of edges and wires.
3977 theEdgesAndWires List of edges and/or wires.
3978 theTolerance Maximum distance between vertices, that will be merged.
3979 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
3980 theName Object name; when specified, this parameter is used
3981 for result publication in the study. Otherwise, if automatic
3982 publication is switched on, default value is used for result name.
3985 New GEOM.GEOM_Object, containing the created wire.
3987 # Example: see GEOM_TestAll.py
3988 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
3989 RaiseIfFailed("MakeWire", self.ShapesOp)
3990 self._autoPublish(anObj, theName, "wire")
3993 ## Create a face on the given wire.
3994 # @param theWire closed Wire or Edge to build the face on.
3995 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
3996 # If the tolerance of the obtained planar face is less
3997 # than 1e-06, this face will be returned, otherwise the
3998 # algorithm tries to build any suitable face on the given
3999 # wire and prints a warning message.
4000 # @param theName Object name; when specified, this parameter is used
4001 # for result publication in the study. Otherwise, if automatic
4002 # publication is switched on, default value is used for result name.
4004 # @return New GEOM.GEOM_Object, containing the created face.
4006 # @ref tui_creation_face "Example"
4007 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4009 Create a face on the given wire.
4012 theWire closed Wire or Edge to build the face on.
4013 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4014 If the tolerance of the obtained planar face is less
4015 than 1e-06, this face will be returned, otherwise the
4016 algorithm tries to build any suitable face on the given
4017 wire and prints a warning message.
4018 theName Object name; when specified, this parameter is used
4019 for result publication in the study. Otherwise, if automatic
4020 publication is switched on, default value is used for result name.
4023 New GEOM.GEOM_Object, containing the created face.
4025 # Example: see GEOM_TestAll.py
4026 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4027 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4028 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4030 RaiseIfFailed("MakeFace", self.ShapesOp)
4031 self._autoPublish(anObj, theName, "face")
4034 ## Create a face on the given wires set.
4035 # @param theWires List of closed wires or edges to build the face on.
4036 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4037 # If the tolerance of the obtained planar face is less
4038 # than 1e-06, this face will be returned, otherwise the
4039 # algorithm tries to build any suitable face on the given
4040 # wire and prints a warning message.
4041 # @param theName Object name; when specified, this parameter is used
4042 # for result publication in the study. Otherwise, if automatic
4043 # publication is switched on, default value is used for result name.
4045 # @return New GEOM.GEOM_Object, containing the created face.
4047 # @ref tui_creation_face "Example"
4048 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4050 Create a face on the given wires set.
4053 theWires List of closed wires or edges to build the face on.
4054 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4055 If the tolerance of the obtained planar face is less
4056 than 1e-06, this face will be returned, otherwise the
4057 algorithm tries to build any suitable face on the given
4058 wire and prints a warning message.
4059 theName Object name; when specified, this parameter is used
4060 for result publication in the study. Otherwise, if automatic
4061 publication is switched on, default value is used for result name.
4064 New GEOM.GEOM_Object, containing the created face.
4066 # Example: see GEOM_TestAll.py
4067 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4068 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4069 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4071 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4072 self._autoPublish(anObj, theName, "face")
4075 ## See MakeFaceWires() method for details.
4077 # @ref tui_creation_face "Example 1"
4078 # \n @ref swig_MakeFaces "Example 2"
4079 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4081 See geompy.MakeFaceWires() method for details.
4083 # Example: see GEOM_TestOthers.py
4084 # note: auto-publishing is done in self.MakeFaceWires()
4085 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4088 ## Create a shell from the set of faces and shells.
4089 # @param theFacesAndShells List of faces and/or shells.
4090 # @param theName Object name; when specified, this parameter is used
4091 # for result publication in the study. Otherwise, if automatic
4092 # publication is switched on, default value is used for result name.
4094 # @return New GEOM.GEOM_Object, containing the created shell.
4096 # @ref tui_creation_shell "Example"
4097 def MakeShell(self, theFacesAndShells, theName=None):
4099 Create a shell from the set of faces and shells.
4102 theFacesAndShells List of faces and/or shells.
4103 theName Object name; when specified, this parameter is used
4104 for result publication in the study. Otherwise, if automatic
4105 publication is switched on, default value is used for result name.
4108 New GEOM.GEOM_Object, containing the created shell.
4110 # Example: see GEOM_TestAll.py
4111 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4112 RaiseIfFailed("MakeShell", self.ShapesOp)
4113 self._autoPublish(anObj, theName, "shell")
4116 ## Create a solid, bounded by the given shells.
4117 # @param theShells Sequence of bounding shells.
4118 # @param theName Object name; when specified, this parameter is used
4119 # for result publication in the study. Otherwise, if automatic
4120 # publication is switched on, default value is used for result name.
4122 # @return New GEOM.GEOM_Object, containing the created solid.
4124 # @ref tui_creation_solid "Example"
4125 def MakeSolid(self, theShells, theName=None):
4127 Create a solid, bounded by the given shells.
4130 theShells Sequence of bounding shells.
4131 theName Object name; when specified, this parameter is used
4132 for result publication in the study. Otherwise, if automatic
4133 publication is switched on, default value is used for result name.
4136 New GEOM.GEOM_Object, containing the created solid.
4138 # Example: see GEOM_TestAll.py
4139 if len(theShells) == 1:
4140 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4142 # raise RuntimeError, "MakeSolidShells : " + descr
4143 if descr == "WRN_SHAPE_UNCLOSED":
4144 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4145 anObj = self.ShapesOp.MakeSolidShells(theShells)
4146 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4147 self._autoPublish(anObj, theName, "solid")
4150 ## Create a compound of the given shapes.
4151 # @param theShapes List of shapes to put in compound.
4152 # @param theName Object name; when specified, this parameter is used
4153 # for result publication in the study. Otherwise, if automatic
4154 # publication is switched on, default value is used for result name.
4156 # @return New GEOM.GEOM_Object, containing the created compound.
4158 # @ref tui_creation_compound "Example"
4159 def MakeCompound(self, theShapes, theName=None):
4161 Create a compound of the given shapes.
4164 theShapes List of shapes to put in compound.
4165 theName Object name; when specified, this parameter is used
4166 for result publication in the study. Otherwise, if automatic
4167 publication is switched on, default value is used for result name.
4170 New GEOM.GEOM_Object, containing the created compound.
4172 # Example: see GEOM_TestAll.py
4173 anObj = self.ShapesOp.MakeCompound(theShapes)
4174 RaiseIfFailed("MakeCompound", self.ShapesOp)
4175 self._autoPublish(anObj, theName, "compound")
4178 # end of l3_advanced
4181 ## @addtogroup l2_measure
4184 ## Gives quantity of faces in the given shape.
4185 # @param theShape Shape to count faces of.
4186 # @return Quantity of faces.
4188 # @ref swig_NumberOf "Example"
4189 def NumberOfFaces(self, theShape):
4191 Gives quantity of faces in the given shape.
4194 theShape Shape to count faces of.
4199 # Example: see GEOM_TestOthers.py
4200 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4201 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4204 ## Gives quantity of edges in the given shape.
4205 # @param theShape Shape to count edges of.
4206 # @return Quantity of edges.
4208 # @ref swig_NumberOf "Example"
4209 def NumberOfEdges(self, theShape):
4211 Gives quantity of edges in the given shape.
4214 theShape Shape to count edges of.
4219 # Example: see GEOM_TestOthers.py
4220 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4221 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4224 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4225 # @param theShape Shape to count sub-shapes of.
4226 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4227 # @return Quantity of sub-shapes of given type.
4229 # @ref swig_NumberOf "Example"
4230 def NumberOfSubShapes(self, theShape, theShapeType):
4232 Gives quantity of sub-shapes of type theShapeType in the given shape.
4235 theShape Shape to count sub-shapes of.
4236 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4239 Quantity of sub-shapes of given type.
4241 # Example: see GEOM_TestOthers.py
4242 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4243 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4246 ## Gives quantity of solids in the given shape.
4247 # @param theShape Shape to count solids in.
4248 # @return Quantity of solids.
4250 # @ref swig_NumberOf "Example"
4251 def NumberOfSolids(self, theShape):
4253 Gives quantity of solids in the given shape.
4256 theShape Shape to count solids in.
4261 # Example: see GEOM_TestOthers.py
4262 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
4263 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4269 ## @addtogroup l3_healing
4272 ## Reverses an orientation the given shape.
4273 # @param theShape Shape to be reversed.
4274 # @param theName Object name; when specified, this parameter is used
4275 # for result publication in the study. Otherwise, if automatic
4276 # publication is switched on, default value is used for result name.
4278 # @return The reversed copy of theShape.
4280 # @ref swig_ChangeOrientation "Example"
4281 def ChangeOrientation(self, theShape, theName=None):
4283 Reverses an orientation the given shape.
4286 theShape Shape to be reversed.
4287 theName Object name; when specified, this parameter is used
4288 for result publication in the study. Otherwise, if automatic
4289 publication is switched on, default value is used for result name.
4292 The reversed copy of theShape.
4294 # Example: see GEOM_TestAll.py
4295 anObj = self.ShapesOp.ChangeOrientation(theShape)
4296 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4297 self._autoPublish(anObj, theName, "reversed")
4300 ## See ChangeOrientation() method for details.
4302 # @ref swig_OrientationChange "Example"
4303 def OrientationChange(self, theShape, theName=None):
4305 See geompy.ChangeOrientation method for details.
4307 # Example: see GEOM_TestOthers.py
4308 # note: auto-publishing is done in self.ChangeOrientation()
4309 anObj = self.ChangeOrientation(theShape, theName)
4315 ## @addtogroup l4_obtain
4318 ## Retrieve all free faces from the given shape.
4319 # Free face is a face, which is not shared between two shells of the shape.
4320 # @param theShape Shape to find free faces in.
4321 # @return List of IDs of all free faces, contained in theShape.
4323 # @ref tui_measurement_tools_page "Example"
4324 def GetFreeFacesIDs(self,theShape):
4326 Retrieve all free faces from the given shape.
4327 Free face is a face, which is not shared between two shells of the shape.
4330 theShape Shape to find free faces in.
4333 List of IDs of all free faces, contained in theShape.
4335 # Example: see GEOM_TestOthers.py
4336 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4337 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4340 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4341 # @param theShape1 Shape to find sub-shapes in.
4342 # @param theShape2 Shape to find shared sub-shapes with.
4343 # @param theShapeType Type of sub-shapes to be retrieved.
4344 # @param theName Object name; when specified, this parameter is used
4345 # for result publication in the study. Otherwise, if automatic
4346 # publication is switched on, default value is used for result name.
4348 # @return List of sub-shapes of theShape1, shared with theShape2.
4350 # @ref swig_GetSharedShapes "Example"
4351 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4353 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4356 theShape1 Shape to find sub-shapes in.
4357 theShape2 Shape to find shared sub-shapes with.
4358 theShapeType Type of sub-shapes to be retrieved.
4359 theName Object name; when specified, this parameter is used
4360 for result publication in the study. Otherwise, if automatic
4361 publication is switched on, default value is used for result name.
4364 List of sub-shapes of theShape1, shared with theShape2.
4366 # Example: see GEOM_TestOthers.py
4367 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4368 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4369 self._autoPublish(aList, theName, "shared")
4372 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4373 # @param theShapes Shapes to find common sub-shapes of.
4374 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4375 # @param theName Object name; when specified, this parameter is used
4376 # for result publication in the study. Otherwise, if automatic
4377 # publication is switched on, default value is used for result name.
4379 # @return List of objects, that are sub-shapes of all given shapes.
4381 # @ref swig_GetSharedShapes "Example"
4382 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4384 Get all sub-shapes, shared by all shapes in the list theShapes.
4387 theShapes Shapes to find common sub-shapes of.
4388 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4389 theName Object name; when specified, this parameter is used
4390 for result publication in the study. Otherwise, if automatic
4391 publication is switched on, default value is used for result name.
4394 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4396 # Example: see GEOM_TestOthers.py
4397 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4398 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4399 self._autoPublish(aList, theName, "shared")
4402 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4403 # situated relatively the specified plane by the certain way,
4404 # defined through <VAR>theState</VAR> parameter.
4405 # @param theShape Shape to find sub-shapes of.
4406 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4407 # @param theAx1 Vector (or line, or linear edge), specifying normal
4408 # direction and location of the plane to find shapes on.
4409 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4410 # @param theName Object name; when specified, this parameter is used
4411 # for result publication in the study. Otherwise, if automatic
4412 # publication is switched on, default value is used for result name.
4414 # @return List of all found sub-shapes.
4416 # @ref swig_GetShapesOnPlane "Example"
4417 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4419 Find in theShape all sub-shapes of type theShapeType,
4420 situated relatively the specified plane by the certain way,
4421 defined through theState parameter.
4424 theShape Shape to find sub-shapes of.
4425 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4426 theAx1 Vector (or line, or linear edge), specifying normal
4427 direction and location of the plane to find shapes on.
4428 theState The state of the sub-shapes to find (see GEOM::shape_state)
4429 theName Object name; when specified, this parameter is used
4430 for result publication in the study. Otherwise, if automatic
4431 publication is switched on, default value is used for result name.
4434 List of all found sub-shapes.
4436 # Example: see GEOM_TestOthers.py
4437 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4438 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4439 self._autoPublish(aList, theName, "shapeOnPlane")
4442 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4443 # situated relatively the specified plane by the certain way,
4444 # defined through <VAR>theState</VAR> parameter.
4445 # @param theShape Shape to find sub-shapes of.
4446 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4447 # @param theAx1 Vector (or line, or linear edge), specifying normal
4448 # direction and location of the plane to find shapes on.
4449 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4451 # @return List of all found sub-shapes indices.
4453 # @ref swig_GetShapesOnPlaneIDs "Example"
4454 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4456 Find in theShape all sub-shapes of type theShapeType,
4457 situated relatively the specified plane by the certain way,
4458 defined through theState parameter.
4461 theShape Shape to find sub-shapes of.
4462 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4463 theAx1 Vector (or line, or linear edge), specifying normal
4464 direction and location of the plane to find shapes on.
4465 theState The state of the sub-shapes to find (see GEOM::shape_state)
4468 List of all found sub-shapes indices.
4470 # Example: see GEOM_TestOthers.py
4471 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4472 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4475 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4476 # situated relatively the specified plane by the certain way,
4477 # defined through <VAR>theState</VAR> parameter.
4478 # @param theShape Shape to find sub-shapes of.
4479 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4480 # @param theAx1 Vector (or line, or linear edge), specifying normal
4481 # direction of the plane to find shapes on.
4482 # @param thePnt Point specifying location of the plane to find shapes on.
4483 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4484 # @param theName Object name; when specified, this parameter is used
4485 # for result publication in the study. Otherwise, if automatic
4486 # publication is switched on, default value is used for result name.
4488 # @return List of all found sub-shapes.
4490 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4491 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4493 Find in theShape all sub-shapes of type theShapeType,
4494 situated relatively the specified plane by the certain way,
4495 defined through theState parameter.
4498 theShape Shape to find sub-shapes of.
4499 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4500 theAx1 Vector (or line, or linear edge), specifying normal
4501 direction and location of the plane to find shapes on.
4502 thePnt Point specifying location of the plane to find shapes on.
4503 theState The state of the sub-shapes to find (see GEOM::shape_state)
4504 theName Object name; when specified, this parameter is used
4505 for result publication in the study. Otherwise, if automatic
4506 publication is switched on, default value is used for result name.
4509 List of all found sub-shapes.
4511 # Example: see GEOM_TestOthers.py
4512 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4513 theAx1, thePnt, theState)
4514 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4515 self._autoPublish(aList, theName, "shapeOnPlane")
4518 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4519 # situated relatively the specified plane by the certain way,
4520 # defined through <VAR>theState</VAR> parameter.
4521 # @param theShape Shape to find sub-shapes of.
4522 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4523 # @param theAx1 Vector (or line, or linear edge), specifying normal
4524 # direction of the plane to find shapes on.
4525 # @param thePnt Point specifying location of the plane to find shapes on.
4526 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4528 # @return List of all found sub-shapes indices.
4530 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4531 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4533 Find in theShape all sub-shapes of type theShapeType,
4534 situated relatively the specified plane by the certain way,
4535 defined through theState parameter.
4538 theShape Shape to find sub-shapes of.
4539 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4540 theAx1 Vector (or line, or linear edge), specifying normal
4541 direction and location of the plane to find shapes on.
4542 thePnt Point specifying location of the plane to find shapes on.
4543 theState The state of the sub-shapes to find (see GEOM::shape_state)
4546 List of all found sub-shapes indices.
4548 # Example: see GEOM_TestOthers.py
4549 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4550 theAx1, thePnt, theState)
4551 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4554 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4555 # the specified cylinder by the certain way, defined through \a theState parameter.
4556 # @param theShape Shape to find sub-shapes of.
4557 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4558 # @param theAxis Vector (or line, or linear edge), specifying
4559 # axis of the cylinder to find shapes on.
4560 # @param theRadius Radius of the cylinder to find shapes on.
4561 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4562 # @param theName Object name; when specified, this parameter is used
4563 # for result publication in the study. Otherwise, if automatic
4564 # publication is switched on, default value is used for result name.
4566 # @return List of all found sub-shapes.
4568 # @ref swig_GetShapesOnCylinder "Example"
4569 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4571 Find in theShape all sub-shapes of type theShapeType, situated relatively
4572 the specified cylinder by the certain way, defined through theState parameter.
4575 theShape Shape to find sub-shapes of.
4576 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4577 theAxis Vector (or line, or linear edge), specifying
4578 axis of the cylinder to find shapes on.
4579 theRadius Radius of the cylinder to find shapes on.
4580 theState The state of the sub-shapes to find (see GEOM::shape_state)
4581 theName Object name; when specified, this parameter is used
4582 for result publication in the study. Otherwise, if automatic
4583 publication is switched on, default value is used for result name.
4586 List of all found sub-shapes.
4588 # Example: see GEOM_TestOthers.py
4589 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4590 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4591 self._autoPublish(aList, theName, "shapeOnCylinder")
4594 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4595 # the specified cylinder by the certain way, defined through \a theState parameter.
4596 # @param theShape Shape to find sub-shapes of.
4597 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4598 # @param theAxis Vector (or line, or linear edge), specifying
4599 # axis of the cylinder to find shapes on.
4600 # @param theRadius Radius of the cylinder to find shapes on.
4601 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4603 # @return List of all found sub-shapes indices.
4605 # @ref swig_GetShapesOnCylinderIDs "Example"
4606 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4608 Find in theShape all sub-shapes of type theShapeType, situated relatively
4609 the specified cylinder by the certain way, defined through theState parameter.
4612 theShape Shape to find sub-shapes of.
4613 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4614 theAxis Vector (or line, or linear edge), specifying
4615 axis of the cylinder to find shapes on.
4616 theRadius Radius of the cylinder to find shapes on.
4617 theState The state of the sub-shapes to find (see GEOM::shape_state)
4620 List of all found sub-shapes indices.
4622 # Example: see GEOM_TestOthers.py
4623 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4624 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4627 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4628 # the specified cylinder by the certain way, defined through \a theState parameter.
4629 # @param theShape Shape to find sub-shapes of.
4630 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4631 # @param theAxis Vector (or line, or linear edge), specifying
4632 # axis of the cylinder to find shapes on.
4633 # @param thePnt Point specifying location of the bottom of the cylinder.
4634 # @param theRadius Radius of the cylinder to find shapes on.
4635 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4636 # @param theName Object name; when specified, this parameter is used
4637 # for result publication in the study. Otherwise, if automatic
4638 # publication is switched on, default value is used for result name.
4640 # @return List of all found sub-shapes.
4642 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4643 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4645 Find in theShape all sub-shapes of type theShapeType, situated relatively
4646 the specified cylinder by the certain way, defined through theState parameter.
4649 theShape Shape to find sub-shapes of.
4650 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4651 theAxis Vector (or line, or linear edge), specifying
4652 axis of the cylinder to find shapes on.
4653 theRadius Radius of the cylinder to find shapes on.
4654 theState The state of the sub-shapes to find (see GEOM::shape_state)
4655 theName Object name; when specified, this parameter is used
4656 for result publication in the study. Otherwise, if automatic
4657 publication is switched on, default value is used for result name.
4660 List of all found sub-shapes.
4662 # Example: see GEOM_TestOthers.py
4663 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4664 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4665 self._autoPublish(aList, theName, "shapeOnCylinder")
4668 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4669 # the specified cylinder by the certain way, defined through \a theState parameter.
4670 # @param theShape Shape to find sub-shapes of.
4671 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4672 # @param theAxis Vector (or line, or linear edge), specifying
4673 # axis of the cylinder to find shapes on.
4674 # @param thePnt Point specifying location of the bottom of the cylinder.
4675 # @param theRadius Radius of the cylinder to find shapes on.
4676 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4678 # @return List of all found sub-shapes indices
4680 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4681 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4683 Find in theShape all sub-shapes of type theShapeType, situated relatively
4684 the specified cylinder by the certain way, defined through theState parameter.
4687 theShape Shape to find sub-shapes of.
4688 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4689 theAxis Vector (or line, or linear edge), specifying
4690 axis of the cylinder to find shapes on.
4691 theRadius Radius of the cylinder to find shapes on.
4692 theState The state of the sub-shapes to find (see GEOM::shape_state)
4695 List of all found sub-shapes indices.
4697 # Example: see GEOM_TestOthers.py
4698 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4699 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4702 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4703 # the specified sphere by the certain way, defined through \a theState parameter.
4704 # @param theShape Shape to find sub-shapes of.
4705 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4706 # @param theCenter Point, specifying center of the sphere to find shapes on.
4707 # @param theRadius Radius of the sphere to find shapes on.
4708 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4709 # @param theName Object name; when specified, this parameter is used
4710 # for result publication in the study. Otherwise, if automatic
4711 # publication is switched on, default value is used for result name.
4713 # @return List of all found sub-shapes.
4715 # @ref swig_GetShapesOnSphere "Example"
4716 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4718 Find in theShape all sub-shapes of type theShapeType, situated relatively
4719 the specified sphere by the certain way, defined through theState parameter.
4722 theShape Shape to find sub-shapes of.
4723 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4724 theCenter Point, specifying center of the sphere to find shapes on.
4725 theRadius Radius of the sphere to find shapes on.
4726 theState The state of the sub-shapes to find (see GEOM::shape_state)
4727 theName Object name; when specified, this parameter is used
4728 for result publication in the study. Otherwise, if automatic
4729 publication is switched on, default value is used for result name.
4732 List of all found sub-shapes.
4734 # Example: see GEOM_TestOthers.py
4735 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4736 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4737 self._autoPublish(aList, theName, "shapeOnSphere")
4740 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4741 # the specified sphere by the certain way, defined through \a theState parameter.
4742 # @param theShape Shape to find sub-shapes of.
4743 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4744 # @param theCenter Point, specifying center of the sphere to find shapes on.
4745 # @param theRadius Radius of the sphere to find shapes on.
4746 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4748 # @return List of all found sub-shapes indices.
4750 # @ref swig_GetShapesOnSphereIDs "Example"
4751 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4753 Find in theShape all sub-shapes of type theShapeType, situated relatively
4754 the specified sphere by the certain way, defined through theState parameter.
4757 theShape Shape to find sub-shapes of.
4758 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4759 theCenter Point, specifying center of the sphere to find shapes on.
4760 theRadius Radius of the sphere to find shapes on.
4761 theState The state of the sub-shapes to find (see GEOM::shape_state)
4764 List of all found sub-shapes indices.
4766 # Example: see GEOM_TestOthers.py
4767 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4768 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4771 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4772 # the specified quadrangle by the certain way, defined through \a theState parameter.
4773 # @param theShape Shape to find sub-shapes of.
4774 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4775 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4776 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4777 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4778 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4779 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4780 # @param theName Object name; when specified, this parameter is used
4781 # for result publication in the study. Otherwise, if automatic
4782 # publication is switched on, default value is used for result name.
4784 # @return List of all found sub-shapes.
4786 # @ref swig_GetShapesOnQuadrangle "Example"
4787 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4788 theTopLeftPoint, theTopRigthPoint,
4789 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4791 Find in theShape all sub-shapes of type theShapeType, situated relatively
4792 the specified quadrangle by the certain way, defined through theState parameter.
4795 theShape Shape to find sub-shapes of.
4796 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4797 theTopLeftPoint Point, specifying top left corner of a quadrangle
4798 theTopRigthPoint Point, specifying top right corner of a quadrangle
4799 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4800 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4801 theState The state of the sub-shapes to find (see GEOM::shape_state)
4802 theName Object name; when specified, this parameter is used
4803 for result publication in the study. Otherwise, if automatic
4804 publication is switched on, default value is used for result name.
4807 List of all found sub-shapes.
4809 # Example: see GEOM_TestOthers.py
4810 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4811 theTopLeftPoint, theTopRigthPoint,
4812 theBottomLeftPoint, theBottomRigthPoint, theState)
4813 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4814 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4817 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4818 # the specified quadrangle by the certain way, defined through \a theState parameter.
4819 # @param theShape Shape to find sub-shapes of.
4820 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4821 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4822 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4823 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4824 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4825 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4827 # @return List of all found sub-shapes indices.
4829 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4830 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4831 theTopLeftPoint, theTopRigthPoint,
4832 theBottomLeftPoint, theBottomRigthPoint, theState):
4834 Find in theShape all sub-shapes of type theShapeType, situated relatively
4835 the specified quadrangle by the certain way, defined through theState parameter.
4838 theShape Shape to find sub-shapes of.
4839 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4840 theTopLeftPoint Point, specifying top left corner of a quadrangle
4841 theTopRigthPoint Point, specifying top right corner of a quadrangle
4842 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4843 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4844 theState The state of the sub-shapes to find (see GEOM::shape_state)
4847 List of all found sub-shapes indices.
4850 # Example: see GEOM_TestOthers.py
4851 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4852 theTopLeftPoint, theTopRigthPoint,
4853 theBottomLeftPoint, theBottomRigthPoint, theState)
4854 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4857 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4858 # the specified \a theBox by the certain way, defined through \a theState parameter.
4859 # @param theBox Shape for relative comparing.
4860 # @param theShape Shape to find sub-shapes of.
4861 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4862 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4863 # @param theName Object name; when specified, this parameter is used
4864 # for result publication in the study. Otherwise, if automatic
4865 # publication is switched on, default value is used for result name.
4867 # @return List of all found sub-shapes.
4869 # @ref swig_GetShapesOnBox "Example"
4870 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4872 Find in theShape all sub-shapes of type theShapeType, situated relatively
4873 the specified theBox by the certain way, defined through theState parameter.
4876 theBox Shape for relative comparing.
4877 theShape Shape to find sub-shapes of.
4878 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4879 theState The state of the sub-shapes to find (see GEOM::shape_state)
4880 theName Object name; when specified, this parameter is used
4881 for result publication in the study. Otherwise, if automatic
4882 publication is switched on, default value is used for result name.
4885 List of all found sub-shapes.
4887 # Example: see GEOM_TestOthers.py
4888 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
4889 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
4890 self._autoPublish(aList, theName, "shapeOnBox")
4893 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4894 # the specified \a theBox by the certain way, defined through \a theState parameter.
4895 # @param theBox Shape for relative comparing.
4896 # @param theShape Shape to find sub-shapes of.
4897 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4898 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4900 # @return List of all found sub-shapes indices.
4902 # @ref swig_GetShapesOnBoxIDs "Example"
4903 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
4905 Find in theShape all sub-shapes of type theShapeType, situated relatively
4906 the specified theBox by the certain way, defined through theState parameter.
4909 theBox Shape for relative comparing.
4910 theShape Shape to find sub-shapes of.
4911 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4912 theState The state of the sub-shapes to find (see GEOM::shape_state)
4915 List of all found sub-shapes indices.
4917 # Example: see GEOM_TestOthers.py
4918 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
4919 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
4922 ## Find in \a theShape all sub-shapes of type \a theShapeType,
4923 # situated relatively the specified \a theCheckShape by the
4924 # certain way, defined through \a theState parameter.
4925 # @param theCheckShape Shape for relative comparing. It must be a solid.
4926 # @param theShape Shape to find sub-shapes of.
4927 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4928 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4929 # @param theName Object name; when specified, this parameter is used
4930 # for result publication in the study. Otherwise, if automatic
4931 # publication is switched on, default value is used for result name.
4933 # @return List of all found sub-shapes.
4935 # @ref swig_GetShapesOnShape "Example"
4936 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
4938 Find in theShape all sub-shapes of type theShapeType,
4939 situated relatively the specified theCheckShape by the
4940 certain way, defined through theState parameter.
4943 theCheckShape Shape for relative comparing. It must be a solid.
4944 theShape Shape to find sub-shapes of.
4945 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4946 theState The state of the sub-shapes to find (see GEOM::shape_state)
4947 theName Object name; when specified, this parameter is used
4948 for result publication in the study. Otherwise, if automatic
4949 publication is switched on, default value is used for result name.
4952 List of all found sub-shapes.
4954 # Example: see GEOM_TestOthers.py
4955 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
4956 theShapeType, theState)
4957 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
4958 self._autoPublish(aList, theName, "shapeOnShape")
4961 ## Find in \a theShape all sub-shapes of type \a theShapeType,
4962 # situated relatively the specified \a theCheckShape by the
4963 # certain way, defined through \a theState parameter.
4964 # @param theCheckShape Shape for relative comparing. It must be a solid.
4965 # @param theShape Shape to find sub-shapes of.
4966 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4967 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4968 # @param theName Object name; when specified, this parameter is used
4969 # for result publication in the study. Otherwise, if automatic
4970 # publication is switched on, default value is used for result name.
4972 # @return All found sub-shapes as compound.
4974 # @ref swig_GetShapesOnShapeAsCompound "Example"
4975 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
4977 Find in theShape all sub-shapes of type theShapeType,
4978 situated relatively the specified theCheckShape by the
4979 certain way, defined through theState parameter.
4982 theCheckShape Shape for relative comparing. It must be a solid.
4983 theShape Shape to find sub-shapes of.
4984 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4985 theState The state of the sub-shapes to find (see GEOM::shape_state)
4986 theName Object name; when specified, this parameter is used
4987 for result publication in the study. Otherwise, if automatic
4988 publication is switched on, default value is used for result name.
4991 All found sub-shapes as compound.
4993 # Example: see GEOM_TestOthers.py
4994 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
4995 theShapeType, theState)
4996 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
4997 self._autoPublish(anObj, theName, "shapeOnShape")
5000 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5001 # situated relatively the specified \a theCheckShape by the
5002 # certain way, defined through \a theState parameter.
5003 # @param theCheckShape Shape for relative comparing. It must be a solid.
5004 # @param theShape Shape to find sub-shapes of.
5005 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5006 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5008 # @return List of all found sub-shapes indices.
5010 # @ref swig_GetShapesOnShapeIDs "Example"
5011 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5013 Find in theShape all sub-shapes of type theShapeType,
5014 situated relatively the specified theCheckShape by the
5015 certain way, defined through theState parameter.
5018 theCheckShape Shape for relative comparing. It must be a solid.
5019 theShape Shape to find sub-shapes of.
5020 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5021 theState The state of the sub-shapes to find (see GEOM::shape_state)
5024 List of all found sub-shapes indices.
5026 # Example: see GEOM_TestOthers.py
5027 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5028 theShapeType, theState)
5029 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5032 ## Get sub-shape(s) of theShapeWhere, which are
5033 # coincident with \a theShapeWhat or could be a part of it.
5034 # @param theShapeWhere Shape to find sub-shapes of.
5035 # @param theShapeWhat Shape, specifying what to find.
5036 # @param isNewImplementation implementation of GetInPlace functionality
5037 # (default = False, old alghorithm based on shape properties)
5038 # @param theName Object name; when specified, this parameter is used
5039 # for result publication in the study. Otherwise, if automatic
5040 # publication is switched on, default value is used for result name.
5042 # @return Group of all found sub-shapes or a single found sub-shape.
5044 # @note This function has a restriction on argument shapes.
5045 # If \a theShapeWhere has curved parts with significantly
5046 # outstanding centres (i.e. the mass centre of a part is closer to
5047 # \a theShapeWhat than to the part), such parts will not be found.
5048 # @image html get_in_place_lost_part.png
5050 # @ref swig_GetInPlace "Example"
5051 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5053 Get sub-shape(s) of theShapeWhere, which are
5054 coincident with theShapeWhat or could be a part of it.
5057 theShapeWhere Shape to find sub-shapes of.
5058 theShapeWhat Shape, specifying what to find.
5059 isNewImplementation Implementation of GetInPlace functionality
5060 (default = False, old alghorithm based on shape properties)
5061 theName Object name; when specified, this parameter is used
5062 for result publication in the study. Otherwise, if automatic
5063 publication is switched on, default value is used for result name.
5066 Group of all found sub-shapes or a single found sub-shape.
5070 This function has a restriction on argument shapes.
5071 If theShapeWhere has curved parts with significantly
5072 outstanding centres (i.e. the mass centre of a part is closer to
5073 theShapeWhat than to the part), such parts will not be found.
5075 # Example: see GEOM_TestOthers.py
5077 if isNewImplementation:
5078 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5080 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5082 RaiseIfFailed("GetInPlace", self.ShapesOp)
5083 self._autoPublish(anObj, theName, "inplace")
5086 ## Get sub-shape(s) of \a theShapeWhere, which are
5087 # coincident with \a theShapeWhat or could be a part of it.
5089 # Implementation of this method is based on a saved history of an operation,
5090 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5091 # arguments (an argument shape or a sub-shape of an argument shape).
5092 # The operation could be the Partition or one of boolean operations,
5093 # performed on simple shapes (not on compounds).
5095 # @param theShapeWhere Shape to find sub-shapes of.
5096 # @param theShapeWhat Shape, specifying what to find (must be in the
5097 # building history of the ShapeWhere).
5098 # @param theName Object name; when specified, this parameter is used
5099 # for result publication in the study. Otherwise, if automatic
5100 # publication is switched on, default value is used for result name.
5102 # @return Group of all found sub-shapes or a single found sub-shape.
5104 # @ref swig_GetInPlace "Example"
5105 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5107 Implementation of this method is based on a saved history of an operation,
5108 produced theShapeWhere. The theShapeWhat must be among this operation's
5109 arguments (an argument shape or a sub-shape of an argument shape).
5110 The operation could be the Partition or one of boolean operations,
5111 performed on simple shapes (not on compounds).
5114 theShapeWhere Shape to find sub-shapes of.
5115 theShapeWhat Shape, specifying what to find (must be in the
5116 building history of the ShapeWhere).
5117 theName Object name; when specified, this parameter is used
5118 for result publication in the study. Otherwise, if automatic
5119 publication is switched on, default value is used for result name.
5122 Group of all found sub-shapes or a single found sub-shape.
5124 # Example: see GEOM_TestOthers.py
5125 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5126 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5127 self._autoPublish(anObj, theName, "inplace")
5130 ## Get sub-shape of theShapeWhere, which is
5131 # equal to \a theShapeWhat.
5132 # @param theShapeWhere Shape to find sub-shape of.
5133 # @param theShapeWhat Shape, specifying what to find.
5134 # @param theName Object name; when specified, this parameter is used
5135 # for result publication in the study. Otherwise, if automatic
5136 # publication is switched on, default value is used for result name.
5138 # @return New GEOM.GEOM_Object for found sub-shape.
5140 # @ref swig_GetSame "Example"
5141 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5143 Get sub-shape of theShapeWhere, which is
5144 equal to theShapeWhat.
5147 theShapeWhere Shape to find sub-shape of.
5148 theShapeWhat Shape, specifying what to find.
5149 theName Object name; when specified, this parameter is used
5150 for result publication in the study. Otherwise, if automatic
5151 publication is switched on, default value is used for result name.
5154 New GEOM.GEOM_Object for found sub-shape.
5156 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5157 RaiseIfFailed("GetSame", self.ShapesOp)
5158 self._autoPublish(anObj, theName, "sameShape")
5162 ## Get sub-shape indices of theShapeWhere, which is
5163 # equal to \a theShapeWhat.
5164 # @param theShapeWhere Shape to find sub-shape of.
5165 # @param theShapeWhat Shape, specifying what to find.
5166 # @return List of all found sub-shapes indices.
5168 # @ref swig_GetSame "Example"
5169 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5171 Get sub-shape indices of theShapeWhere, which is
5172 equal to theShapeWhat.
5175 theShapeWhere Shape to find sub-shape of.
5176 theShapeWhat Shape, specifying what to find.
5179 List of all found sub-shapes indices.
5181 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5182 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5189 ## @addtogroup l4_access
5192 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5193 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5194 # @param aShape Shape to get sub-shape of.
5195 # @param ListOfID List of sub-shapes indices.
5196 # @param theName Object name; when specified, this parameter is used
5197 # for result publication in the study. Otherwise, if automatic
5198 # publication is switched on, default value is used for result name.
5200 # @return Found sub-shape.
5202 # @ref swig_all_decompose "Example"
5203 def GetSubShape(self, aShape, ListOfID, theName=None):
5205 Obtain a composite sub-shape of aShape, composed from sub-shapes
5206 of aShape, selected by their unique IDs inside aShape
5209 aShape Shape to get sub-shape of.
5210 ListOfID List of sub-shapes indices.
5211 theName Object name; when specified, this parameter is used
5212 for result publication in the study. Otherwise, if automatic
5213 publication is switched on, default value is used for result name.
5218 # Example: see GEOM_TestAll.py
5219 anObj = self.AddSubShape(aShape,ListOfID)
5220 self._autoPublish(anObj, theName, "subshape")
5223 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5224 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5225 # @param aShape Shape to get sub-shape of.
5226 # @param aSubShape Sub-shapes of aShape.
5227 # @return ID of found sub-shape.
5229 # @ref swig_all_decompose "Example"
5230 def GetSubShapeID(self, aShape, aSubShape):
5232 Obtain unique ID of sub-shape aSubShape inside aShape
5233 of aShape, selected by their unique IDs inside aShape
5236 aShape Shape to get sub-shape of.
5237 aSubShape Sub-shapes of aShape.
5240 ID of found sub-shape.
5242 # Example: see GEOM_TestAll.py
5243 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5244 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5247 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5248 # This function is provided for performance purpose. The complexity is O(n) with n
5249 # the number of subobjects of aShape
5250 # @param aShape Shape to get sub-shape of.
5251 # @param aSubShapes Sub-shapes of aShape.
5252 # @return list of IDs of found sub-shapes.
5254 # @ref swig_all_decompose "Example"
5255 def GetSubShapesIDs(self, aShape, aSubShapes):
5257 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5258 This function is provided for performance purpose. The complexity is O(n) with n
5259 the number of subobjects of aShape
5262 aShape Shape to get sub-shape of.
5263 aSubShapes Sub-shapes of aShape.
5266 List of IDs of found sub-shape.
5268 # Example: see GEOM_TestAll.py
5269 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5270 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5276 ## @addtogroup l4_decompose
5279 ## Get all sub-shapes and groups of \a theShape,
5280 # that were created already by any other methods.
5281 # @param theShape Any shape.
5282 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5283 # returned, else all found sub-shapes and groups.
5284 # @return List of existing sub-objects of \a theShape.
5286 # @ref swig_all_decompose "Example"
5287 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5289 Get all sub-shapes and groups of theShape,
5290 that were created already by any other methods.
5294 theGroupsOnly If this parameter is TRUE, only groups will be
5295 returned, else all found sub-shapes and groups.
5298 List of existing sub-objects of theShape.
5300 # Example: see GEOM_TestAll.py
5301 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5302 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5305 ## Get all groups of \a theShape,
5306 # that were created already by any other methods.
5307 # @param theShape Any shape.
5308 # @return List of existing groups of \a theShape.
5310 # @ref swig_all_decompose "Example"
5311 def GetGroups(self, theShape):
5313 Get all groups of theShape,
5314 that were created already by any other methods.
5320 List of existing groups of theShape.
5322 # Example: see GEOM_TestAll.py
5323 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5324 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5327 ## Explode a shape on sub-shapes of a given type.
5328 # If the shape itself matches the type, it is also returned.
5329 # @param aShape Shape to be exploded.
5330 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5331 # @param theName Object name; when specified, this parameter is used
5332 # for result publication in the study. Otherwise, if automatic
5333 # publication is switched on, default value is used for result name.
5335 # @return List of sub-shapes of type theShapeType, contained in theShape.
5337 # @ref swig_all_decompose "Example"
5338 def SubShapeAll(self, aShape, aType, theName=None):
5340 Explode a shape on sub-shapes of a given type.
5341 If the shape itself matches the type, it is also returned.
5344 aShape Shape to be exploded.
5345 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5346 theName Object name; when specified, this parameter is used
5347 for result publication in the study. Otherwise, if automatic
5348 publication is switched on, default value is used for result name.
5351 List of sub-shapes of type theShapeType, contained in theShape.
5353 # Example: see GEOM_TestAll.py
5354 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5355 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5356 self._autoPublish(ListObj, theName, "subshape")
5359 ## Explode a shape on sub-shapes of a given type.
5360 # @param aShape Shape to be exploded.
5361 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5362 # @return List of IDs of sub-shapes.
5364 # @ref swig_all_decompose "Example"
5365 def SubShapeAllIDs(self, aShape, aType):
5367 Explode a shape on sub-shapes of a given type.
5370 aShape Shape to be exploded (see geompy.ShapeType)
5371 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5374 List of IDs of sub-shapes.
5376 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5377 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5380 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5381 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
5382 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5383 # @param aShape Shape to get sub-shape of.
5384 # @param ListOfInd List of sub-shapes indices.
5385 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5386 # @param theName Object name; when specified, this parameter is used
5387 # for result publication in the study. Otherwise, if automatic
5388 # publication is switched on, default value is used for result name.
5390 # @return A compound of sub-shapes of aShape.
5392 # @ref swig_all_decompose "Example"
5393 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5395 Obtain a compound of sub-shapes of aShape,
5396 selected by they indices in list of all sub-shapes of type aType.
5397 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5400 aShape Shape to get sub-shape of.
5401 ListOfID List of sub-shapes indices.
5402 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5403 theName Object name; when specified, this parameter is used
5404 for result publication in the study. Otherwise, if automatic
5405 publication is switched on, default value is used for result name.
5408 A compound of sub-shapes of aShape.
5410 # Example: see GEOM_TestAll.py
5412 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5413 for ind in ListOfInd:
5414 ListOfIDs.append(AllShapeIDsList[ind - 1])
5415 # note: auto-publishing is done in self.GetSubShape()
5416 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5419 ## Explode a shape on sub-shapes of a given type.
5420 # Sub-shapes will be sorted by coordinates of their gravity centers.
5421 # If the shape itself matches the type, it is also returned.
5422 # @param aShape Shape to be exploded.
5423 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5424 # @param theName Object name; when specified, this parameter is used
5425 # for result publication in the study. Otherwise, if automatic
5426 # publication is switched on, default value is used for result name.
5428 # @return List of sub-shapes of type theShapeType, contained in theShape.
5430 # @ref swig_SubShapeAllSorted "Example"
5431 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5433 Explode a shape on sub-shapes of a given type.
5434 Sub-shapes will be sorted by coordinates of their gravity centers.
5435 If the shape itself matches the type, it is also returned.
5438 aShape Shape to be exploded.
5439 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5440 theName Object name; when specified, this parameter is used
5441 for result publication in the study. Otherwise, if automatic
5442 publication is switched on, default value is used for result name.
5445 List of sub-shapes of type theShapeType, contained in theShape.
5447 # Example: see GEOM_TestAll.py
5448 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5449 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5450 self._autoPublish(ListObj, theName, "subshape")
5453 ## Explode a shape on sub-shapes of a given type.
5454 # Sub-shapes will be sorted by coordinates of their gravity centers.
5455 # @param aShape Shape to be exploded.
5456 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5457 # @return List of IDs of sub-shapes.
5459 # @ref swig_all_decompose "Example"
5460 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5462 Explode a shape on sub-shapes of a given type.
5463 Sub-shapes will be sorted by coordinates of their gravity centers.
5466 aShape Shape to be exploded.
5467 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5470 List of IDs of sub-shapes.
5472 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5473 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5476 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5477 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5478 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5479 # @param aShape Shape to get sub-shape of.
5480 # @param ListOfInd List of sub-shapes indices.
5481 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5482 # @param theName Object name; when specified, this parameter is used
5483 # for result publication in the study. Otherwise, if automatic
5484 # publication is switched on, default value is used for result name.
5486 # @return A compound of sub-shapes of aShape.
5488 # @ref swig_all_decompose "Example"
5489 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5491 Obtain a compound of sub-shapes of aShape,
5492 selected by they indices in sorted list of all sub-shapes of type aType.
5493 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5496 aShape Shape to get sub-shape of.
5497 ListOfID List of sub-shapes indices.
5498 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5499 theName Object name; when specified, this parameter is used
5500 for result publication in the study. Otherwise, if automatic
5501 publication is switched on, default value is used for result name.
5504 A compound of sub-shapes of aShape.
5506 # Example: see GEOM_TestAll.py
5508 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5509 for ind in ListOfInd:
5510 ListOfIDs.append(AllShapeIDsList[ind - 1])
5511 # note: auto-publishing is done in self.GetSubShape()
5512 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5515 ## Extract shapes (excluding the main shape) of given type.
5516 # @param aShape The shape.
5517 # @param aType The shape type (see ShapeType())
5518 # @param isSorted Boolean flag to switch sorting on/off.
5519 # @param theName Object name; when specified, this parameter is used
5520 # for result publication in the study. Otherwise, if automatic
5521 # publication is switched on, default value is used for result name.
5523 # @return List of sub-shapes of type aType, contained in aShape.
5525 # @ref swig_FilletChamfer "Example"
5526 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5528 Extract shapes (excluding the main shape) of given type.
5532 aType The shape type (see geompy.ShapeType)
5533 isSorted Boolean flag to switch sorting on/off.
5534 theName Object name; when specified, this parameter is used
5535 for result publication in the study. Otherwise, if automatic
5536 publication is switched on, default value is used for result name.
5539 List of sub-shapes of type aType, contained in aShape.
5541 # Example: see GEOM_TestAll.py
5542 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5543 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5544 self._autoPublish(ListObj, theName, "subshape")
5547 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5548 # @param aShape Main shape.
5549 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5550 # @param 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.
5553 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5555 # @ref swig_all_decompose "Example"
5556 def SubShapes(self, aShape, anIDs, theName=None):
5558 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5562 anIDs List of unique IDs of sub-shapes inside theMainShape.
5563 theName Object name; when specified, this parameter is used
5564 for result publication in the study. Otherwise, if automatic
5565 publication is switched on, default value is used for result name.
5568 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5570 # Example: see GEOM_TestAll.py
5571 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5572 RaiseIfFailed("SubShapes", self.ShapesOp)
5573 self._autoPublish(ListObj, theName, "subshape")
5576 # end of l4_decompose
5579 ## @addtogroup l4_decompose_d
5582 ## Deprecated method
5583 # It works like SubShapeAllSortedCentres(), but wrongly
5584 # defines centres of faces, shells and solids.
5585 def SubShapeAllSorted(self, aShape, aType, theName=None):
5588 It works like geompy.SubShapeAllSortedCentres, but wrongly
5589 defines centres of faces, shells and solids.
5591 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5592 RaiseIfFailed("MakeExplode", self.ShapesOp)
5593 self._autoPublish(ListObj, theName, "subshape")
5596 ## Deprecated method
5597 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5598 # defines centres of faces, shells and solids.
5599 def SubShapeAllSortedIDs(self, aShape, aType):
5602 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5603 defines centres of faces, shells and solids.
5605 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5606 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5609 ## Deprecated method
5610 # It works like SubShapeSortedCentres(), but has a bug
5611 # (wrongly defines centres of faces, shells and solids).
5612 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5615 It works like geompy.SubShapeSortedCentres, but has a bug
5616 (wrongly defines centres of faces, shells and solids).
5619 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5620 for ind in ListOfInd:
5621 ListOfIDs.append(AllShapeIDsList[ind - 1])
5622 # note: auto-publishing is done in self.GetSubShape()
5623 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5626 # end of l4_decompose_d
5629 ## @addtogroup l3_healing
5632 ## Apply a sequence of Shape Healing operators to the given object.
5633 # @param theShape Shape to be processed.
5634 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5635 # @param theParameters List of names of parameters
5636 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5637 # @param theValues List of values of parameters, in the same order
5638 # as parameters are listed in <VAR>theParameters</VAR> list.
5639 # @param theName Object name; when specified, this parameter is used
5640 # for result publication in the study. Otherwise, if automatic
5641 # publication is switched on, default value is used for result name.
5643 # <b> Operators and Parameters: </b> \n
5645 # * \b FixShape - corrects invalid shapes. \n
5646 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5647 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5649 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5650 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5651 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5652 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5654 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5655 # surfaces in segments using a certain angle. \n
5656 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5657 # if Angle=180, four if Angle=90, etc). \n
5658 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5660 # * \b SplitClosedFaces - splits closed faces in segments.
5661 # The number of segments depends on the number of splitting points.\n
5662 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5664 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5665 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5666 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5667 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5668 # This and the previous parameters can take the following values:\n
5669 # \b Parametric \b Continuity \n
5670 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5671 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5672 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5673 # ruling out sharp edges).\n
5674 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5675 # are of the same magnitude).\n
5676 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5677 # or surfaces (d/du C(u)) are the same at junction. \n
5678 # \b Geometric \b Continuity \n
5679 # \b G1: first derivatives are proportional at junction.\n
5680 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5681 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5682 # \b G2: first and second derivatives are proportional at junction.
5683 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5684 # continuity requires that the underlying parameterization was continuous as well.
5685 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5687 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5688 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5689 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5690 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5691 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5692 # with the specified parameters.\n
5693 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5694 # with the specified parameters.\n
5695 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5696 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5697 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5698 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5700 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5701 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5702 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5703 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5704 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5706 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5707 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5710 # @return New GEOM.GEOM_Object, containing processed shape.
5712 # \n @ref tui_shape_processing "Example"
5713 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5715 Apply a sequence of Shape Healing operators to the given object.
5718 theShape Shape to be processed.
5719 theValues List of values of parameters, in the same order
5720 as parameters are listed in theParameters list.
5721 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5722 theParameters List of names of parameters
5723 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5724 theName Object name; when specified, this parameter is used
5725 for result publication in the study. Otherwise, if automatic
5726 publication is switched on, default value is used for result name.
5728 Operators and Parameters:
5730 * FixShape - corrects invalid shapes.
5731 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5732 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5733 * FixFaceSize - removes small faces, such as spots and strips.
5734 * FixFaceSize.Tolerance - defines minimum possible face size.
5735 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5736 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5737 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5738 in segments using a certain angle.
5739 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5740 if Angle=180, four if Angle=90, etc).
5741 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5742 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5744 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5745 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5746 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5747 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5748 * SplitContinuity.CurveContinuity - required continuity for curves.
5749 This and the previous parameters can take the following values:
5751 Parametric Continuity:
5752 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5753 coincidental. The curves or surfaces may still meet at an angle,
5754 giving rise to a sharp corner or edge).
5755 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5756 are parallel, ruling out sharp edges).
5757 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5758 or surfaces are of the same magnitude).
5759 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5760 curves or surfaces (d/du C(u)) are the same at junction.
5762 Geometric Continuity:
5763 G1: first derivatives are proportional at junction.
5764 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5765 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5766 G2: first and second derivatives are proportional at junction. As the names imply,
5767 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5768 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5769 geometric continuity of order n, but not vice-versa.
5770 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5771 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5772 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5773 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5774 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5775 the specified parameters.
5776 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5777 the specified parameters.
5778 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5779 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5780 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5781 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5782 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5783 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5784 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5785 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5786 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5787 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5788 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5791 New GEOM.GEOM_Object, containing processed shape.
5793 Note: For more information look through SALOME Geometry User's Guide->
5794 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5796 # Example: see GEOM_TestHealing.py
5797 theValues,Parameters = ParseList(theValues)
5798 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5799 # To avoid script failure in case of good argument shape
5800 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5802 RaiseIfFailed("ProcessShape", self.HealOp)
5803 for string in (theOperators + theParameters):
5804 Parameters = ":" + Parameters
5806 anObj.SetParameters(Parameters)
5807 self._autoPublish(anObj, theName, "healed")
5810 ## Remove faces from the given object (shape).
5811 # @param theObject Shape to be processed.
5812 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5813 # removes ALL faces of the given object.
5814 # @param theName Object name; when specified, this parameter is used
5815 # for result publication in the study. Otherwise, if automatic
5816 # publication is switched on, default value is used for result name.
5818 # @return New GEOM.GEOM_Object, containing processed shape.
5820 # @ref tui_suppress_faces "Example"
5821 def SuppressFaces(self, theObject, theFaces, theName=None):
5823 Remove faces from the given object (shape).
5826 theObject Shape to be processed.
5827 theFaces Indices of faces to be removed, if EMPTY then the method
5828 removes ALL faces of the given object.
5829 theName Object name; when specified, this parameter is used
5830 for result publication in the study. Otherwise, if automatic
5831 publication is switched on, default value is used for result name.
5834 New GEOM.GEOM_Object, containing processed shape.
5836 # Example: see GEOM_TestHealing.py
5837 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5838 RaiseIfFailed("SuppressFaces", self.HealOp)
5839 self._autoPublish(anObj, theName, "suppressFaces")
5842 ## Sewing of some shapes into single shape.
5843 # @param ListShape Shapes to be processed.
5844 # @param theTolerance Required tolerance value.
5845 # @param theName Object name; when specified, this parameter is used
5846 # for result publication in the study. Otherwise, if automatic
5847 # publication is switched on, default value is used for result name.
5849 # @return New GEOM.GEOM_Object, containing processed shape.
5851 # @ref tui_sewing "Example"
5852 def MakeSewing(self, ListShape, theTolerance, theName=None):
5854 Sewing of some shapes into single shape.
5857 ListShape Shapes to be processed.
5858 theTolerance Required tolerance value.
5859 theName Object name; when specified, this parameter is used
5860 for result publication in the study. Otherwise, if automatic
5861 publication is switched on, default value is used for result name.
5864 New GEOM.GEOM_Object, containing processed shape.
5866 # Example: see GEOM_TestHealing.py
5867 comp = self.MakeCompound(ListShape)
5868 # note: auto-publishing is done in self.Sew()
5869 anObj = self.Sew(comp, theTolerance, theName)
5872 ## Sewing of the given object.
5873 # @param theObject Shape to be processed.
5874 # @param theTolerance Required tolerance value.
5875 # @param theName Object name; when specified, this parameter is used
5876 # for result publication in the study. Otherwise, if automatic
5877 # publication is switched on, default value is used for result name.
5879 # @return New GEOM.GEOM_Object, containing processed shape.
5880 def Sew(self, theObject, theTolerance, theName=None):
5882 Sewing of the given object.
5885 theObject Shape to be processed.
5886 theTolerance Required tolerance value.
5887 theName Object name; when specified, this parameter is used
5888 for result publication in the study. Otherwise, if automatic
5889 publication is switched on, default value is used for result name.
5892 New GEOM.GEOM_Object, containing processed shape.
5894 # Example: see MakeSewing() above
5895 theTolerance,Parameters = ParseParameters(theTolerance)
5896 anObj = self.HealOp.Sew(theObject, theTolerance)
5897 RaiseIfFailed("Sew", self.HealOp)
5898 anObj.SetParameters(Parameters)
5899 self._autoPublish(anObj, theName, "sewed")
5902 ## Remove internal wires and edges from the given object (face).
5903 # @param theObject Shape to be processed.
5904 # @param theWires Indices of wires to be removed, if EMPTY then the method
5905 # removes ALL internal wires of the given object.
5906 # @param theName Object name; when specified, this parameter is used
5907 # for result publication in the study. Otherwise, if automatic
5908 # publication is switched on, default value is used for result name.
5910 # @return New GEOM.GEOM_Object, containing processed shape.
5912 # @ref tui_suppress_internal_wires "Example"
5913 def SuppressInternalWires(self, theObject, theWires, theName=None):
5915 Remove internal wires and edges from the given object (face).
5918 theObject Shape to be processed.
5919 theWires Indices of wires to be removed, if EMPTY then the method
5920 removes ALL internal wires of the given object.
5921 theName Object name; when specified, this parameter is used
5922 for result publication in the study. Otherwise, if automatic
5923 publication is switched on, default value is used for result name.
5926 New GEOM.GEOM_Object, containing processed shape.
5928 # Example: see GEOM_TestHealing.py
5929 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
5930 RaiseIfFailed("RemoveIntWires", self.HealOp)
5931 self._autoPublish(anObj, theName, "suppressWires")
5934 ## Remove internal closed contours (holes) from the given object.
5935 # @param theObject Shape to be processed.
5936 # @param theWires Indices of wires to be removed, if EMPTY then the method
5937 # removes ALL internal holes of the given object
5938 # @param theName Object name; when specified, this parameter is used
5939 # for result publication in the study. Otherwise, if automatic
5940 # publication is switched on, default value is used for result name.
5942 # @return New GEOM.GEOM_Object, containing processed shape.
5944 # @ref tui_suppress_holes "Example"
5945 def SuppressHoles(self, theObject, theWires, theName=None):
5947 Remove internal closed contours (holes) from the given object.
5950 theObject Shape to be processed.
5951 theWires Indices of wires to be removed, if EMPTY then the method
5952 removes ALL internal holes of the given object
5953 theName Object name; when specified, this parameter is used
5954 for result publication in the study. Otherwise, if automatic
5955 publication is switched on, default value is used for result name.
5958 New GEOM.GEOM_Object, containing processed shape.
5960 # Example: see GEOM_TestHealing.py
5961 anObj = self.HealOp.FillHoles(theObject, theWires)
5962 RaiseIfFailed("FillHoles", self.HealOp)
5963 self._autoPublish(anObj, theName, "suppressHoles")
5966 ## Close an open wire.
5967 # @param theObject Shape to be processed.
5968 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
5969 # if [ ], then <VAR>theObject</VAR> itself is a wire.
5970 # @param isCommonVertex If True : closure by creation of a common vertex,
5971 # If False : closure by creation of an edge between ends.
5972 # @param theName Object name; when specified, this parameter is used
5973 # for result publication in the study. Otherwise, if automatic
5974 # publication is switched on, default value is used for result name.
5976 # @return New GEOM.GEOM_Object, containing processed shape.
5978 # @ref tui_close_contour "Example"
5979 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
5984 theObject Shape to be processed.
5985 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
5986 if [ ], then theObject itself is a wire.
5987 isCommonVertex If True : closure by creation of a common vertex,
5988 If False : closure by creation of an edge between ends.
5989 theName Object name; when specified, this parameter is used
5990 for result publication in the study. Otherwise, if automatic
5991 publication is switched on, default value is used for result name.
5994 New GEOM.GEOM_Object, containing processed shape.
5996 # Example: see GEOM_TestHealing.py
5997 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
5998 RaiseIfFailed("CloseContour", self.HealOp)
5999 self._autoPublish(anObj, theName, "closeContour")
6002 ## Addition of a point to a given edge object.
6003 # @param theObject Shape to be processed.
6004 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6005 # if -1, then theObject itself is the edge.
6006 # @param theValue Value of parameter on edge or length parameter,
6007 # depending on \a isByParameter.
6008 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6009 # if FALSE : \a theValue is treated as a length parameter [0..1]
6010 # @param theName Object name; when specified, this parameter is used
6011 # for result publication in the study. Otherwise, if automatic
6012 # publication is switched on, default value is used for result name.
6014 # @return New GEOM.GEOM_Object, containing processed shape.
6016 # @ref tui_add_point_on_edge "Example"
6017 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6019 Addition of a point to a given edge object.
6022 theObject Shape to be processed.
6023 theEdgeIndex Index of edge to be divided within theObject's shape,
6024 if -1, then theObject itself is the edge.
6025 theValue Value of parameter on edge or length parameter,
6026 depending on isByParameter.
6027 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6028 if FALSE : theValue is treated as a length parameter [0..1]
6029 theName Object name; when specified, this parameter is used
6030 for result publication in the study. Otherwise, if automatic
6031 publication is switched on, default value is used for result name.
6034 New GEOM.GEOM_Object, containing processed shape.
6036 # Example: see GEOM_TestHealing.py
6037 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6038 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6039 RaiseIfFailed("DivideEdge", self.HealOp)
6040 anObj.SetParameters(Parameters)
6041 self._autoPublish(anObj, theName, "divideEdge")
6044 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6045 # @param theWire Wire to minimize the number of C1 continuous edges in.
6046 # @param theVertices A list of vertices to suppress. If the list
6047 # is empty, all vertices in a wire will be assumed.
6048 # @param theName Object name; when specified, this parameter is used
6049 # for result publication in the study. Otherwise, if automatic
6050 # publication is switched on, default value is used for result name.
6052 # @return New GEOM.GEOM_Object with modified wire.
6054 # @ref tui_fuse_collinear_edges "Example"
6055 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6057 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6060 theWire Wire to minimize the number of C1 continuous edges in.
6061 theVertices A list of vertices to suppress. If the list
6062 is empty, all vertices in a wire will be assumed.
6063 theName Object name; when specified, this parameter is used
6064 for result publication in the study. Otherwise, if automatic
6065 publication is switched on, default value is used for result name.
6068 New GEOM.GEOM_Object with modified wire.
6070 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6071 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6072 self._autoPublish(anObj, theName, "fuseEdges")
6075 ## Change orientation of the given object. Updates given shape.
6076 # @param theObject Shape to be processed.
6077 # @return Updated <var>theObject</var>
6079 # @ref swig_todo "Example"
6080 def ChangeOrientationShell(self,theObject):
6082 Change orientation of the given object. Updates given shape.
6085 theObject Shape to be processed.
6090 theObject = self.HealOp.ChangeOrientation(theObject)
6091 RaiseIfFailed("ChangeOrientation", self.HealOp)
6094 ## Change orientation of the given object.
6095 # @param theObject Shape to be processed.
6096 # @param theName Object name; when specified, this parameter is used
6097 # for result publication in the study. Otherwise, if automatic
6098 # publication is switched on, default value is used for result name.
6100 # @return New GEOM.GEOM_Object, containing processed shape.
6102 # @ref swig_todo "Example"
6103 def ChangeOrientationShellCopy(self, theObject, theName=None):
6105 Change orientation of the given object.
6108 theObject Shape to be processed.
6109 theName Object name; when specified, this parameter is used
6110 for result publication in the study. Otherwise, if automatic
6111 publication is switched on, default value is used for result name.
6114 New GEOM.GEOM_Object, containing processed shape.
6116 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6117 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6118 self._autoPublish(anObj, theName, "reversed")
6121 ## Try to limit tolerance of the given object by value \a theTolerance.
6122 # @param theObject Shape to be processed.
6123 # @param theTolerance Required tolerance value.
6124 # @param theName Object name; when specified, this parameter is used
6125 # for result publication in the study. Otherwise, if automatic
6126 # publication is switched on, default value is used for result name.
6128 # @return New GEOM.GEOM_Object, containing processed shape.
6130 # @ref tui_limit_tolerance "Example"
6131 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6133 Try to limit tolerance of the given object by value theTolerance.
6136 theObject Shape to be processed.
6137 theTolerance Required tolerance value.
6138 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.
6143 New GEOM.GEOM_Object, containing processed shape.
6145 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6146 RaiseIfFailed("LimitTolerance", self.HealOp)
6147 self._autoPublish(anObj, theName, "limitTolerance")
6150 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6151 # that constitute a free boundary of the given shape.
6152 # @param theObject Shape to get free boundary of.
6153 # @param theName Object name; when specified, this parameter is used
6154 # for result publication in the study. Otherwise, if automatic
6155 # publication is switched on, default value is used for result name.
6157 # @return [\a status, \a theClosedWires, \a theOpenWires]
6158 # \n \a status: FALSE, if an error(s) occured during the method execution.
6159 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6160 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6162 # @ref tui_measurement_tools_page "Example"
6163 def GetFreeBoundary(self, theObject, theName=None):
6165 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6166 that constitute a free boundary of the given shape.
6169 theObject Shape to get free boundary of.
6170 theName Object name; when specified, this parameter is used
6171 for result publication in the study. Otherwise, if automatic
6172 publication is switched on, default value is used for result name.
6175 [status, theClosedWires, theOpenWires]
6176 status: FALSE, if an error(s) occured during the method execution.
6177 theClosedWires: Closed wires on the free boundary of the given shape.
6178 theOpenWires: Open wires on the free boundary of the given shape.
6180 # Example: see GEOM_TestHealing.py
6181 anObj = self.HealOp.GetFreeBoundary(theObject)
6182 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6183 self._autoPublish(anObj[1], theName, "closedWire")
6184 self._autoPublish(anObj[2], theName, "openWire")
6187 ## Replace coincident faces in theShape by one face.
6188 # @param theShape Initial shape.
6189 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6190 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6191 # otherwise all initial shapes.
6192 # @param theName Object name; when specified, this parameter is used
6193 # for result publication in the study. Otherwise, if automatic
6194 # publication is switched on, default value is used for result name.
6196 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6198 # @ref tui_glue_faces "Example"
6199 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6201 Replace coincident faces in theShape by one face.
6204 theShape Initial shape.
6205 theTolerance Maximum distance between faces, which can be considered as coincident.
6206 doKeepNonSolids If FALSE, only solids will present in the result,
6207 otherwise all initial shapes.
6208 theName Object name; when specified, this parameter is used
6209 for result publication in the study. Otherwise, if automatic
6210 publication is switched on, default value is used for result name.
6213 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6215 # Example: see GEOM_Spanner.py
6216 theTolerance,Parameters = ParseParameters(theTolerance)
6217 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6219 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6220 anObj.SetParameters(Parameters)
6221 self._autoPublish(anObj, theName, "glueFaces")
6224 ## Find coincident faces in theShape for possible gluing.
6225 # @param theShape Initial shape.
6226 # @param theTolerance Maximum distance between faces,
6227 # which can be considered as coincident.
6228 # @param theName Object name; when specified, this parameter is used
6229 # for result publication in the study. Otherwise, if automatic
6230 # publication is switched on, default value is used for result name.
6232 # @return GEOM.ListOfGO
6234 # @ref tui_glue_faces "Example"
6235 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6237 Find coincident faces in theShape for possible gluing.
6240 theShape Initial shape.
6241 theTolerance Maximum distance between faces,
6242 which can be considered as coincident.
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.
6250 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6251 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6252 self._autoPublish(anObj, theName, "facesToGlue")
6255 ## Replace coincident faces in theShape by one face
6256 # in compliance with given list of faces
6257 # @param theShape Initial shape.
6258 # @param theTolerance Maximum distance between faces,
6259 # which can be considered as coincident.
6260 # @param theFaces List of faces for gluing.
6261 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6262 # otherwise all initial shapes.
6263 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6264 # will be glued, otherwise only the edges,
6265 # belonging to <VAR>theFaces</VAR>.
6266 # @param theName Object name; when specified, this parameter is used
6267 # for result publication in the study. Otherwise, if automatic
6268 # publication is switched on, default value is used for result name.
6270 # @return New GEOM.GEOM_Object, containing a copy of theShape
6271 # without some faces.
6273 # @ref tui_glue_faces "Example"
6274 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6275 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6277 Replace coincident faces in theShape by one face
6278 in compliance with given list of faces
6281 theShape Initial shape.
6282 theTolerance Maximum distance between faces,
6283 which can be considered as coincident.
6284 theFaces List of faces for gluing.
6285 doKeepNonSolids If FALSE, only solids will present in the result,
6286 otherwise all initial shapes.
6287 doGlueAllEdges If TRUE, all coincident edges of theShape
6288 will be glued, otherwise only the edges,
6289 belonging to theFaces.
6290 theName Object name; when specified, this parameter is used
6291 for result publication in the study. Otherwise, if automatic
6292 publication is switched on, default value is used for result name.
6295 New GEOM.GEOM_Object, containing a copy of theShape
6298 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6299 doKeepNonSolids, doGlueAllEdges)
6301 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6302 self._autoPublish(anObj, theName, "glueFaces")
6305 ## Replace coincident edges in theShape by one edge.
6306 # @param theShape Initial shape.
6307 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6308 # @param theName Object name; when specified, this parameter is used
6309 # for result publication in the study. Otherwise, if automatic
6310 # publication is switched on, default value is used for result name.
6312 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6314 # @ref tui_glue_edges "Example"
6315 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6317 Replace coincident edges in theShape by one edge.
6320 theShape Initial shape.
6321 theTolerance Maximum distance between edges, which can be considered as coincident.
6322 theName Object name; when specified, this parameter is used
6323 for result publication in the study. Otherwise, if automatic
6324 publication is switched on, default value is used for result name.
6327 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6329 theTolerance,Parameters = ParseParameters(theTolerance)
6330 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6332 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6333 anObj.SetParameters(Parameters)
6334 self._autoPublish(anObj, theName, "glueEdges")
6337 ## Find coincident edges in theShape for possible gluing.
6338 # @param theShape Initial shape.
6339 # @param theTolerance Maximum distance between edges,
6340 # which can be considered as coincident.
6341 # @param theName Object name; when specified, this parameter is used
6342 # for result publication in the study. Otherwise, if automatic
6343 # publication is switched on, default value is used for result name.
6345 # @return GEOM.ListOfGO
6347 # @ref tui_glue_edges "Example"
6348 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6350 Find coincident edges in theShape for possible gluing.
6353 theShape Initial shape.
6354 theTolerance Maximum distance between edges,
6355 which can be considered as coincident.
6356 theName Object name; when specified, this parameter is used
6357 for result publication in the study. Otherwise, if automatic
6358 publication is switched on, default value is used for result name.
6363 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6364 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6365 self._autoPublish(anObj, theName, "edgesToGlue")
6368 ## Replace coincident edges in theShape by one edge
6369 # in compliance with given list of edges.
6370 # @param theShape Initial shape.
6371 # @param theTolerance Maximum distance between edges,
6372 # which can be considered as coincident.
6373 # @param theEdges List of edges for gluing.
6374 # @param theName Object name; when specified, this parameter is used
6375 # for result publication in the study. Otherwise, if automatic
6376 # publication is switched on, default value is used for result name.
6378 # @return New GEOM.GEOM_Object, containing a copy of theShape
6379 # without some edges.
6381 # @ref tui_glue_edges "Example"
6382 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6384 Replace coincident edges in theShape by one edge
6385 in compliance with given list of edges.
6388 theShape Initial shape.
6389 theTolerance Maximum distance between edges,
6390 which can be considered as coincident.
6391 theEdges List of edges for gluing.
6392 theName Object name; when specified, this parameter is used
6393 for result publication in the study. Otherwise, if automatic
6394 publication is switched on, default value is used for result name.
6397 New GEOM.GEOM_Object, containing a copy of theShape
6400 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6402 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6403 self._autoPublish(anObj, theName, "glueEdges")
6409 ## @addtogroup l3_boolean Boolean Operations
6412 # -----------------------------------------------------------------------------
6413 # Boolean (Common, Cut, Fuse, Section)
6414 # -----------------------------------------------------------------------------
6416 ## Perform one of boolean operations on two given shapes.
6417 # @param theShape1 First argument for boolean operation.
6418 # @param theShape2 Second argument for boolean operation.
6419 # @param theOperation Indicates the operation to be done:\n
6420 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6421 # @param theName Object name; when specified, this parameter is used
6422 # for result publication in the study. Otherwise, if automatic
6423 # publication is switched on, default value is used for result name.
6425 # @return New GEOM.GEOM_Object, containing the result shape.
6427 # @ref tui_fuse "Example"
6428 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6430 Perform one of boolean operations on two given shapes.
6433 theShape1 First argument for boolean operation.
6434 theShape2 Second argument for boolean operation.
6435 theOperation Indicates the operation to be done:
6436 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6437 theName Object name; when specified, this parameter is used
6438 for result publication in the study. Otherwise, if automatic
6439 publication is switched on, default value is used for result name.
6442 New GEOM.GEOM_Object, containing the result shape.
6444 # Example: see GEOM_TestAll.py
6445 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6446 RaiseIfFailed("MakeBoolean", self.BoolOp)
6447 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6448 self._autoPublish(anObj, theName, def_names[theOperation])
6451 ## Perform Common boolean operation on two given shapes.
6452 # @param theShape1 First argument for boolean operation.
6453 # @param theShape2 Second argument for boolean operation.
6454 # @param theName Object name; when specified, this parameter is used
6455 # for result publication in the study. Otherwise, if automatic
6456 # publication is switched on, default value is used for result name.
6458 # @return New GEOM.GEOM_Object, containing the result shape.
6460 # @ref tui_common "Example 1"
6461 # \n @ref swig_MakeCommon "Example 2"
6462 def MakeCommon(self, theShape1, theShape2, theName=None):
6464 Perform Common boolean operation on two given shapes.
6467 theShape1 First argument for boolean operation.
6468 theShape2 Second argument for boolean operation.
6469 theName Object name; when specified, this parameter is used
6470 for result publication in the study. Otherwise, if automatic
6471 publication is switched on, default value is used for result name.
6474 New GEOM.GEOM_Object, containing the result shape.
6476 # Example: see GEOM_TestOthers.py
6477 # note: auto-publishing is done in self.MakeBoolean()
6478 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6480 ## Perform Cut boolean operation on two given shapes.
6481 # @param theShape1 First argument for boolean operation.
6482 # @param theShape2 Second argument for boolean operation.
6483 # @param theName Object name; when specified, this parameter is used
6484 # for result publication in the study. Otherwise, if automatic
6485 # publication is switched on, default value is used for result name.
6487 # @return New GEOM.GEOM_Object, containing the result shape.
6489 # @ref tui_cut "Example 1"
6490 # \n @ref swig_MakeCommon "Example 2"
6491 def MakeCut(self, theShape1, theShape2, theName=None):
6493 Perform Cut boolean operation on two given shapes.
6496 theShape1 First argument for boolean operation.
6497 theShape2 Second argument for boolean operation.
6498 theName Object name; when specified, this parameter is used
6499 for result publication in the study. Otherwise, if automatic
6500 publication is switched on, default value is used for result name.
6503 New GEOM.GEOM_Object, containing the result shape.
6506 # Example: see GEOM_TestOthers.py
6507 # note: auto-publishing is done in self.MakeBoolean()
6508 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6510 ## Perform Fuse boolean operation on two given shapes.
6511 # @param theShape1 First argument for boolean operation.
6512 # @param theShape2 Second argument for boolean operation.
6513 # @param theName Object name; when specified, this parameter is used
6514 # for result publication in the study. Otherwise, if automatic
6515 # publication is switched on, default value is used for result name.
6517 # @return New GEOM.GEOM_Object, containing the result shape.
6519 # @ref tui_fuse "Example 1"
6520 # \n @ref swig_MakeCommon "Example 2"
6521 def MakeFuse(self, theShape1, theShape2, theName=None):
6523 Perform Fuse boolean operation on two given shapes.
6526 theShape1 First argument for boolean operation.
6527 theShape2 Second argument for boolean operation.
6528 theName Object name; when specified, this parameter is used
6529 for result publication in the study. Otherwise, if automatic
6530 publication is switched on, default value is used for result name.
6533 New GEOM.GEOM_Object, containing the result shape.
6536 # Example: see GEOM_TestOthers.py
6537 # note: auto-publishing is done in self.MakeBoolean()
6538 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6540 ## Perform Section boolean operation on two given shapes.
6541 # @param theShape1 First argument for boolean operation.
6542 # @param theShape2 Second argument for boolean operation.
6543 # @param theName Object name; when specified, this parameter is used
6544 # for result publication in the study. Otherwise, if automatic
6545 # publication is switched on, default value is used for result name.
6547 # @return New GEOM.GEOM_Object, containing the result shape.
6549 # @ref tui_section "Example 1"
6550 # \n @ref swig_MakeCommon "Example 2"
6551 def MakeSection(self, theShape1, theShape2, theName=None):
6553 Perform Section boolean operation on two given shapes.
6556 theShape1 First argument for boolean operation.
6557 theShape2 Second argument for boolean operation.
6558 theName Object name; when specified, this parameter is used
6559 for result publication in the study. Otherwise, if automatic
6560 publication is switched on, default value is used for result name.
6563 New GEOM.GEOM_Object, containing the result shape.
6566 # Example: see GEOM_TestOthers.py
6567 # note: auto-publishing is done in self.MakeBoolean()
6568 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6573 ## @addtogroup l3_basic_op
6576 ## Perform partition operation.
6577 # @param ListShapes Shapes to be intersected.
6578 # @param ListTools Shapes to intersect theShapes.
6579 # @param Limit Type of resulting shapes (see ShapeType()).\n
6580 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6581 # type will be detected automatically.
6582 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6583 # target type (equal to Limit) are kept in the result,
6584 # else standalone shapes of lower dimension
6585 # are kept also (if they exist).
6586 # @param theName Object name; when specified, this parameter is used
6587 # for result publication in the study. Otherwise, if automatic
6588 # publication is switched on, default value is used for result name.
6590 # @note Each compound from ListShapes and ListTools will be exploded
6591 # in order to avoid possible intersection between shapes from this compound.
6593 # After implementation new version of PartitionAlgo (October 2006)
6594 # other parameters are ignored by current functionality. They are kept
6595 # in this function only for support old versions.
6596 # @param ListKeepInside Shapes, outside which the results will be deleted.
6597 # Each shape from theKeepInside must belong to theShapes also.
6598 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6599 # Each shape from theRemoveInside must belong to theShapes also.
6600 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6601 # @param ListMaterials Material indices for each shape. Make sence,
6602 # only if theRemoveWebs is TRUE.
6604 # @return New GEOM.GEOM_Object, containing the result shapes.
6606 # @ref tui_partition "Example"
6607 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6608 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6609 KeepNonlimitShapes=0, theName=None):
6611 Perform partition operation.
6614 ListShapes Shapes to be intersected.
6615 ListTools Shapes to intersect theShapes.
6616 Limit Type of resulting shapes (see geompy.ShapeType)
6617 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6618 type will be detected automatically.
6619 KeepNonlimitShapes if this parameter == 0, then only shapes of
6620 target type (equal to Limit) are kept in the result,
6621 else standalone shapes of lower dimension
6622 are kept also (if they exist).
6623 theName Object name; when specified, this parameter is used
6624 for result publication in the study. Otherwise, if automatic
6625 publication is switched on, default value is used for result name.
6627 Each compound from ListShapes and ListTools will be exploded
6628 in order to avoid possible intersection between shapes from
6631 After implementation new version of PartitionAlgo (October 2006) other
6632 parameters are ignored by current functionality. They are kept in this
6633 function only for support old versions.
6636 ListKeepInside Shapes, outside which the results will be deleted.
6637 Each shape from theKeepInside must belong to theShapes also.
6638 ListRemoveInside Shapes, inside which the results will be deleted.
6639 Each shape from theRemoveInside must belong to theShapes also.
6640 RemoveWebs If TRUE, perform Glue 3D algorithm.
6641 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6644 New GEOM.GEOM_Object, containing the result shapes.
6646 # Example: see GEOM_TestAll.py
6647 if Limit == ShapeType["AUTO"]:
6648 # automatic detection of the most appropriate shape limit type
6650 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6651 Limit = EnumToLong(lim)
6653 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6654 ListKeepInside, ListRemoveInside,
6655 Limit, RemoveWebs, ListMaterials,
6656 KeepNonlimitShapes);
6657 RaiseIfFailed("MakePartition", self.BoolOp)
6658 self._autoPublish(anObj, theName, "partition")
6661 ## Perform partition operation.
6662 # This method may be useful if it is needed to make a partition for
6663 # compound contains nonintersected shapes. Performance will be better
6664 # since intersection between shapes from compound is not performed.
6666 # Description of all parameters as in previous method MakePartition()
6668 # @note Passed compounds (via ListShapes or via ListTools)
6669 # have to consist of nonintersecting shapes.
6671 # @return New GEOM.GEOM_Object, containing the result shapes.
6673 # @ref swig_todo "Example"
6674 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6675 ListKeepInside=[], ListRemoveInside=[],
6676 Limit=ShapeType["AUTO"], RemoveWebs=0,
6677 ListMaterials=[], KeepNonlimitShapes=0,
6680 Perform partition operation.
6681 This method may be useful if it is needed to make a partition for
6682 compound contains nonintersected shapes. Performance will be better
6683 since intersection between shapes from compound is not performed.
6686 Description of all parameters as in method geompy.MakePartition
6689 Passed compounds (via ListShapes or via ListTools)
6690 have to consist of nonintersecting shapes.
6693 New GEOM.GEOM_Object, containing the result shapes.
6695 if Limit == ShapeType["AUTO"]:
6696 # automatic detection of the most appropriate shape limit type
6698 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6699 Limit = EnumToLong(lim)
6701 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6702 ListKeepInside, ListRemoveInside,
6703 Limit, RemoveWebs, ListMaterials,
6704 KeepNonlimitShapes);
6705 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6706 self._autoPublish(anObj, theName, "partition")
6709 ## See method MakePartition() for more information.
6711 # @ref tui_partition "Example 1"
6712 # \n @ref swig_Partition "Example 2"
6713 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6714 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6715 KeepNonlimitShapes=0, theName=None):
6717 See method geompy.MakePartition for more information.
6719 # Example: see GEOM_TestOthers.py
6720 # note: auto-publishing is done in self.MakePartition()
6721 anObj = self.MakePartition(ListShapes, ListTools,
6722 ListKeepInside, ListRemoveInside,
6723 Limit, RemoveWebs, ListMaterials,
6724 KeepNonlimitShapes, theName);
6727 ## Perform partition of the Shape with the Plane
6728 # @param theShape Shape to be intersected.
6729 # @param thePlane Tool shape, to intersect theShape.
6730 # @param theName Object name; when specified, this parameter is used
6731 # for result publication in the study. Otherwise, if automatic
6732 # publication is switched on, default value is used for result name.
6734 # @return New GEOM.GEOM_Object, containing the result shape.
6736 # @ref tui_partition "Example"
6737 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6739 Perform partition of the Shape with the Plane
6742 theShape Shape to be intersected.
6743 thePlane Tool shape, to intersect theShape.
6744 theName Object name; when specified, this parameter is used
6745 for result publication in the study. Otherwise, if automatic
6746 publication is switched on, default value is used for result name.
6749 New GEOM.GEOM_Object, containing the result shape.
6751 # Example: see GEOM_TestAll.py
6752 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
6753 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
6754 self._autoPublish(anObj, theName, "partition")
6757 # end of l3_basic_op
6760 ## @addtogroup l3_transform
6763 ## Translate the given object along the vector, specified
6764 # by its end points.
6765 # @param theObject The object to be translated.
6766 # @param thePoint1 Start point of translation vector.
6767 # @param thePoint2 End point of translation vector.
6768 # @param theCopy Flag used to translate object itself or create a copy.
6769 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6770 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6771 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
6773 Translate the given object along the vector, specified by its end points.
6776 theObject The object to be translated.
6777 thePoint1 Start point of translation vector.
6778 thePoint2 End point of translation vector.
6779 theCopy Flag used to translate object itself or create a copy.
6782 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6783 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6786 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6788 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
6789 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
6792 ## Translate the given object along the vector, specified
6793 # by its end points, creating its copy before the translation.
6794 # @param theObject The object to be translated.
6795 # @param thePoint1 Start point of translation vector.
6796 # @param thePoint2 End point of translation vector.
6797 # @param theName Object name; when specified, this parameter is used
6798 # for result publication in the study. Otherwise, if automatic
6799 # publication is switched on, default value is used for result name.
6801 # @return New GEOM.GEOM_Object, containing the translated object.
6803 # @ref tui_translation "Example 1"
6804 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
6805 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
6807 Translate the given object along the vector, specified
6808 by its end points, creating its copy before the translation.
6811 theObject The object to be translated.
6812 thePoint1 Start point of translation vector.
6813 thePoint2 End point of translation vector.
6814 theName Object name; when specified, this parameter is used
6815 for result publication in the study. Otherwise, if automatic
6816 publication is switched on, default value is used for result name.
6819 New GEOM.GEOM_Object, containing the translated object.
6821 # Example: see GEOM_TestAll.py
6822 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6823 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
6824 self._autoPublish(anObj, theName, "translated")
6827 ## Translate the given object along the vector, specified by its components.
6828 # @param theObject The object to be translated.
6829 # @param theDX,theDY,theDZ Components of translation vector.
6830 # @param theCopy Flag used to translate object itself or create a copy.
6831 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6832 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6834 # @ref tui_translation "Example"
6835 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
6837 Translate the given object along the vector, specified by its components.
6840 theObject The object to be translated.
6841 theDX,theDY,theDZ Components of translation vector.
6842 theCopy Flag used to translate object itself or create a copy.
6845 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6846 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6848 # Example: see GEOM_TestAll.py
6849 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
6851 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
6853 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
6854 anObj.SetParameters(Parameters)
6855 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
6858 ## Translate the given object along the vector, specified
6859 # by its components, creating its copy before the translation.
6860 # @param theObject The object to be translated.
6861 # @param theDX,theDY,theDZ Components of translation vector.
6862 # @param theName Object name; when specified, this parameter is used
6863 # for result publication in the study. Otherwise, if automatic
6864 # publication is switched on, default value is used for result name.
6866 # @return New GEOM.GEOM_Object, containing the translated object.
6868 # @ref tui_translation "Example"
6869 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
6871 Translate the given object along the vector, specified
6872 by its components, creating its copy before the translation.
6875 theObject The object to be translated.
6876 theDX,theDY,theDZ Components of translation vector.
6877 theName Object name; when specified, this parameter is used
6878 for result publication in the study. Otherwise, if automatic
6879 publication is switched on, default value is used for result name.
6882 New GEOM.GEOM_Object, containing the translated object.
6884 # Example: see GEOM_TestAll.py
6885 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
6886 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
6887 anObj.SetParameters(Parameters)
6888 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
6889 self._autoPublish(anObj, theName, "translated")
6892 ## Translate the given object along the given vector.
6893 # @param theObject The object to be translated.
6894 # @param theVector The translation vector.
6895 # @param theCopy Flag used to translate object itself or create a copy.
6896 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6897 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6898 def TranslateVector(self, theObject, theVector, theCopy=False):
6900 Translate the given object along the given vector.
6903 theObject The object to be translated.
6904 theVector The translation vector.
6905 theCopy Flag used to translate object itself or create a copy.
6908 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6909 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6912 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
6914 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
6915 RaiseIfFailed("TranslateVector", self.TrsfOp)
6918 ## Translate the given object along the given vector,
6919 # creating its copy before the translation.
6920 # @param theObject The object to be translated.
6921 # @param theVector The translation vector.
6922 # @param theName Object name; when specified, this parameter is used
6923 # for result publication in the study. Otherwise, if automatic
6924 # publication is switched on, default value is used for result name.
6926 # @return New GEOM.GEOM_Object, containing the translated object.
6928 # @ref tui_translation "Example"
6929 def MakeTranslationVector(self, theObject, theVector, theName=None):
6931 Translate the given object along the given vector,
6932 creating its copy before the translation.
6935 theObject The object to be translated.
6936 theVector The translation vector.
6937 theName Object name; when specified, this parameter is used
6938 for result publication in the study. Otherwise, if automatic
6939 publication is switched on, default value is used for result name.
6942 New GEOM.GEOM_Object, containing the translated object.
6944 # Example: see GEOM_TestAll.py
6945 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
6946 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
6947 self._autoPublish(anObj, theName, "translated")
6950 ## Translate the given object along the given vector on given distance.
6951 # @param theObject The object to be translated.
6952 # @param theVector The translation vector.
6953 # @param theDistance The translation distance.
6954 # @param theCopy Flag used to translate object itself or create a copy.
6955 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6956 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6958 # @ref tui_translation "Example"
6959 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
6961 Translate the given object along the given vector on given distance.
6964 theObject The object to be translated.
6965 theVector The translation vector.
6966 theDistance The translation distance.
6967 theCopy Flag used to translate object itself or create a copy.
6970 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6971 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6973 # Example: see GEOM_TestAll.py
6974 theDistance,Parameters = ParseParameters(theDistance)
6975 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
6976 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
6977 anObj.SetParameters(Parameters)
6980 ## Translate the given object along the given vector on given distance,
6981 # creating its copy before the translation.
6982 # @param theObject The object to be translated.
6983 # @param theVector The translation vector.
6984 # @param theDistance The translation distance.
6985 # @param theName Object name; when specified, this parameter is used
6986 # for result publication in the study. Otherwise, if automatic
6987 # publication is switched on, default value is used for result name.
6989 # @return New GEOM.GEOM_Object, containing the translated object.
6991 # @ref tui_translation "Example"
6992 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
6994 Translate the given object along the given vector on given distance,
6995 creating its copy before the translation.
6998 theObject The object to be translated.
6999 theVector The translation vector.
7000 theDistance The translation distance.
7001 theName Object name; when specified, this parameter is used
7002 for result publication in the study. Otherwise, if automatic
7003 publication is switched on, default value is used for result name.
7006 New GEOM.GEOM_Object, containing the translated object.
7008 # Example: see GEOM_TestAll.py
7009 theDistance,Parameters = ParseParameters(theDistance)
7010 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7011 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7012 anObj.SetParameters(Parameters)
7013 self._autoPublish(anObj, theName, "translated")
7016 ## Rotate the given object around the given axis on the given angle.
7017 # @param theObject The object to be rotated.
7018 # @param theAxis Rotation axis.
7019 # @param theAngle Rotation angle in radians.
7020 # @param theCopy Flag used to rotate object itself or create a copy.
7022 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7023 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7025 # @ref tui_rotation "Example"
7026 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7028 Rotate the given object around the given axis on the given angle.
7031 theObject The object to be rotated.
7032 theAxis Rotation axis.
7033 theAngle Rotation angle in radians.
7034 theCopy Flag used to rotate object itself or create a copy.
7037 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7038 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7040 # Example: see GEOM_TestAll.py
7042 if isinstance(theAngle,str):
7044 theAngle, Parameters = ParseParameters(theAngle)
7046 theAngle = theAngle*math.pi/180.0
7048 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7050 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7051 RaiseIfFailed("Rotate", self.TrsfOp)
7052 anObj.SetParameters(Parameters)
7055 ## Rotate the given object around the given axis
7056 # on the given angle, creating its copy before the rotatation.
7057 # @param theObject The object to be rotated.
7058 # @param theAxis Rotation axis.
7059 # @param theAngle Rotation angle in radians.
7060 # @param theName Object name; when specified, this parameter is used
7061 # for result publication in the study. Otherwise, if automatic
7062 # publication is switched on, default value is used for result name.
7064 # @return New GEOM.GEOM_Object, containing the rotated object.
7066 # @ref tui_rotation "Example"
7067 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7069 Rotate the given object around the given axis
7070 on the given angle, creating its copy before the rotatation.
7073 theObject The object to be rotated.
7074 theAxis Rotation axis.
7075 theAngle Rotation angle in radians.
7076 theName Object name; when specified, this parameter is used
7077 for result publication in the study. Otherwise, if automatic
7078 publication is switched on, default value is used for result name.
7081 New GEOM.GEOM_Object, containing the rotated object.
7083 # Example: see GEOM_TestAll.py
7085 if isinstance(theAngle,str):
7087 theAngle, Parameters = ParseParameters(theAngle)
7089 theAngle = theAngle*math.pi/180.0
7090 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7091 RaiseIfFailed("RotateCopy", self.TrsfOp)
7092 anObj.SetParameters(Parameters)
7093 self._autoPublish(anObj, theName, "rotated")
7096 ## Rotate given object around vector perpendicular to plane
7097 # containing three points.
7098 # @param theObject The object to be rotated.
7099 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7100 # containing the three points.
7101 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7102 # @param theCopy Flag used to rotate object itself or create a copy.
7103 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7104 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7105 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7107 Rotate given object around vector perpendicular to plane
7108 containing three points.
7111 theObject The object to be rotated.
7112 theCentPoint central point the axis is the vector perpendicular to the plane
7113 containing the three points.
7114 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7115 theCopy Flag used to rotate object itself or create a copy.
7118 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7119 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7122 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7124 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7125 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7128 ## Rotate given object around vector perpendicular to plane
7129 # containing three points, creating its copy before the rotatation.
7130 # @param theObject The object to be rotated.
7131 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7132 # containing the three points.
7133 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7134 # @param theName Object name; when specified, this parameter is used
7135 # for result publication in the study. Otherwise, if automatic
7136 # publication is switched on, default value is used for result name.
7138 # @return New GEOM.GEOM_Object, containing the rotated object.
7140 # @ref tui_rotation "Example"
7141 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7143 Rotate given object around vector perpendicular to plane
7144 containing three points, creating its copy before the rotatation.
7147 theObject The object to be rotated.
7148 theCentPoint central point the axis is the vector perpendicular to the plane
7149 containing the three points.
7150 thePoint1,thePoint2 in a perpendicular plane of the axis.
7151 theName Object name; when specified, this parameter is used
7152 for result publication in the study. Otherwise, if automatic
7153 publication is switched on, default value is used for result name.
7156 New GEOM.GEOM_Object, containing the rotated object.
7158 # Example: see GEOM_TestAll.py
7159 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7160 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7161 self._autoPublish(anObj, theName, "rotated")
7164 ## Scale the given object by the specified factor.
7165 # @param theObject The object to be scaled.
7166 # @param thePoint Center point for scaling.
7167 # Passing None for it means scaling relatively the origin of global CS.
7168 # @param theFactor Scaling factor value.
7169 # @param theCopy Flag used to scale object itself or create a copy.
7170 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7171 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7172 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7174 Scale the given object by the specified factor.
7177 theObject The object to be scaled.
7178 thePoint Center point for scaling.
7179 Passing None for it means scaling relatively the origin of global CS.
7180 theFactor Scaling factor value.
7181 theCopy Flag used to scale object itself or create a copy.
7184 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7185 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7187 # Example: see GEOM_TestAll.py
7188 theFactor, Parameters = ParseParameters(theFactor)
7190 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7192 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7193 RaiseIfFailed("Scale", self.TrsfOp)
7194 anObj.SetParameters(Parameters)
7197 ## Scale the given object by the factor, creating its copy before the scaling.
7198 # @param theObject The object to be scaled.
7199 # @param thePoint Center point for scaling.
7200 # Passing None for it means scaling relatively the origin of global CS.
7201 # @param theFactor Scaling factor value.
7202 # @param theName Object name; when specified, this parameter is used
7203 # for result publication in the study. Otherwise, if automatic
7204 # publication is switched on, default value is used for result name.
7206 # @return New GEOM.GEOM_Object, containing the scaled shape.
7208 # @ref tui_scale "Example"
7209 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7211 Scale the given object by the factor, creating its copy before the scaling.
7214 theObject The object to be scaled.
7215 thePoint Center point for scaling.
7216 Passing None for it means scaling relatively the origin of global CS.
7217 theFactor Scaling factor value.
7218 theName Object name; when specified, this parameter is used
7219 for result publication in the study. Otherwise, if automatic
7220 publication is switched on, default value is used for result name.
7223 New GEOM.GEOM_Object, containing the scaled shape.
7225 # Example: see GEOM_TestAll.py
7226 theFactor, Parameters = ParseParameters(theFactor)
7227 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7228 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7229 anObj.SetParameters(Parameters)
7230 self._autoPublish(anObj, theName, "scaled")
7233 ## Scale the given object by different factors along coordinate axes.
7234 # @param theObject The object to be scaled.
7235 # @param thePoint Center point for scaling.
7236 # Passing None for it means scaling relatively the origin of global CS.
7237 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7238 # @param theCopy Flag used to scale object itself or create a copy.
7239 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7240 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7241 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7243 Scale the given object by different factors along coordinate axes.
7246 theObject The object to be scaled.
7247 thePoint Center point for scaling.
7248 Passing None for it means scaling relatively the origin of global CS.
7249 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7250 theCopy Flag used to scale object itself or create a copy.
7253 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7254 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7256 # Example: see GEOM_TestAll.py
7257 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7259 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7260 theFactorX, theFactorY, theFactorZ)
7262 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7263 theFactorX, theFactorY, theFactorZ)
7264 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7265 anObj.SetParameters(Parameters)
7268 ## Scale the given object by different factors along coordinate axes,
7269 # creating its copy before the scaling.
7270 # @param theObject The object to be scaled.
7271 # @param thePoint Center point for scaling.
7272 # Passing None for it means scaling relatively the origin of global CS.
7273 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7274 # @param theName Object name; when specified, this parameter is used
7275 # for result publication in the study. Otherwise, if automatic
7276 # publication is switched on, default value is used for result name.
7278 # @return New GEOM.GEOM_Object, containing the scaled shape.
7280 # @ref swig_scale "Example"
7281 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7283 Scale the given object by different factors along coordinate axes,
7284 creating its copy before the scaling.
7287 theObject The object to be scaled.
7288 thePoint Center point for scaling.
7289 Passing None for it means scaling relatively the origin of global CS.
7290 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7291 theName Object name; when specified, this parameter is used
7292 for result publication in the study. Otherwise, if automatic
7293 publication is switched on, default value is used for result name.
7296 New GEOM.GEOM_Object, containing the scaled shape.
7298 # Example: see GEOM_TestAll.py
7299 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7300 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7301 theFactorX, theFactorY, theFactorZ)
7302 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7303 anObj.SetParameters(Parameters)
7304 self._autoPublish(anObj, theName, "scaled")
7307 ## Mirror an object relatively the given plane.
7308 # @param theObject The object to be mirrored.
7309 # @param thePlane Plane of symmetry.
7310 # @param theCopy Flag used to mirror object itself or create a copy.
7311 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7312 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7313 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7315 Mirror an object relatively the given plane.
7318 theObject The object to be mirrored.
7319 thePlane Plane of symmetry.
7320 theCopy Flag used to mirror object itself or create a copy.
7323 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7324 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7327 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7329 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7330 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7333 ## Create an object, symmetrical
7334 # to the given one relatively the given plane.
7335 # @param theObject The object to be mirrored.
7336 # @param thePlane Plane of symmetry.
7337 # @param theName Object name; when specified, this parameter is used
7338 # for result publication in the study. Otherwise, if automatic
7339 # publication is switched on, default value is used for result name.
7341 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7343 # @ref tui_mirror "Example"
7344 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7346 Create an object, symmetrical to the given one relatively the given plane.
7349 theObject The object to be mirrored.
7350 thePlane Plane of symmetry.
7351 theName Object name; when specified, this parameter is used
7352 for result publication in the study. Otherwise, if automatic
7353 publication is switched on, default value is used for result name.
7356 New GEOM.GEOM_Object, containing the mirrored shape.
7358 # Example: see GEOM_TestAll.py
7359 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7360 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7361 self._autoPublish(anObj, theName, "mirrored")
7364 ## Mirror an object relatively the given axis.
7365 # @param theObject The object to be mirrored.
7366 # @param theAxis Axis of symmetry.
7367 # @param theCopy Flag used to mirror object itself or create a copy.
7368 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7369 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7370 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7372 Mirror an object relatively the given axis.
7375 theObject The object to be mirrored.
7376 theAxis Axis of symmetry.
7377 theCopy Flag used to mirror object itself or create a copy.
7380 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7381 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7384 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7386 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7387 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7390 ## Create an object, symmetrical
7391 # to the given one relatively the given axis.
7392 # @param theObject The object to be mirrored.
7393 # @param theAxis Axis of symmetry.
7394 # @param theName Object name; when specified, this parameter is used
7395 # for result publication in the study. Otherwise, if automatic
7396 # publication is switched on, default value is used for result name.
7398 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7400 # @ref tui_mirror "Example"
7401 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7403 Create an object, symmetrical to the given one relatively the given axis.
7406 theObject The object to be mirrored.
7407 theAxis Axis of symmetry.
7408 theName Object name; when specified, this parameter is used
7409 for result publication in the study. Otherwise, if automatic
7410 publication is switched on, default value is used for result name.
7413 New GEOM.GEOM_Object, containing the mirrored shape.
7415 # Example: see GEOM_TestAll.py
7416 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7417 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7418 self._autoPublish(anObj, theName, "mirrored")
7421 ## Mirror an object relatively the given point.
7422 # @param theObject The object to be mirrored.
7423 # @param thePoint Point of symmetry.
7424 # @param theCopy Flag used to mirror object itself or create a copy.
7425 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7426 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7427 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7429 Mirror an object relatively the given point.
7432 theObject The object to be mirrored.
7433 thePoint Point of symmetry.
7434 theCopy Flag used to mirror object itself or create a copy.
7437 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7438 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7440 # Example: see GEOM_TestAll.py
7442 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7444 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7445 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7448 ## Create an object, symmetrical
7449 # to the given one relatively the given point.
7450 # @param theObject The object to be mirrored.
7451 # @param thePoint Point of symmetry.
7452 # @param theName Object name; when specified, this parameter is used
7453 # for result publication in the study. Otherwise, if automatic
7454 # publication is switched on, default value is used for result name.
7456 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7458 # @ref tui_mirror "Example"
7459 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7461 Create an object, symmetrical
7462 to the given one relatively the given point.
7465 theObject The object to be mirrored.
7466 thePoint Point of symmetry.
7467 theName Object name; when specified, this parameter is used
7468 for result publication in the study. Otherwise, if automatic
7469 publication is switched on, default value is used for result name.
7472 New GEOM.GEOM_Object, containing the mirrored shape.
7474 # Example: see GEOM_TestAll.py
7475 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7476 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7477 self._autoPublish(anObj, theName, "mirrored")
7480 ## Modify the location of the given object.
7481 # @param theObject The object to be displaced.
7482 # @param theStartLCS Coordinate system to perform displacement from it.\n
7483 # If \a theStartLCS is NULL, displacement
7484 # will be performed from global CS.\n
7485 # If \a theObject itself is used as \a theStartLCS,
7486 # its location will be changed to \a theEndLCS.
7487 # @param theEndLCS Coordinate system to perform displacement to it.
7488 # @param theCopy Flag used to displace object itself or create a copy.
7489 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7490 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7491 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7493 Modify the Location of the given object by LCS, creating its copy before the setting.
7496 theObject The object to be displaced.
7497 theStartLCS Coordinate system to perform displacement from it.
7498 If theStartLCS is NULL, displacement
7499 will be performed from global CS.
7500 If theObject itself is used as theStartLCS,
7501 its location will be changed to theEndLCS.
7502 theEndLCS Coordinate system to perform displacement to it.
7503 theCopy Flag used to displace object itself or create a copy.
7506 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7507 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7509 # Example: see GEOM_TestAll.py
7511 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7513 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7514 RaiseIfFailed("Displace", self.TrsfOp)
7517 ## Modify the Location of the given object by LCS,
7518 # creating its copy before the setting.
7519 # @param theObject The object to be displaced.
7520 # @param theStartLCS Coordinate system to perform displacement from it.\n
7521 # If \a theStartLCS is NULL, displacement
7522 # will be performed from global CS.\n
7523 # If \a theObject itself is used as \a theStartLCS,
7524 # its location will be changed to \a theEndLCS.
7525 # @param theEndLCS Coordinate system to perform displacement to it.
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 the displaced shape.
7532 # @ref tui_modify_location "Example"
7533 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7535 Modify the Location of the given object by LCS, creating its copy before the setting.
7538 theObject The object to be displaced.
7539 theStartLCS Coordinate system to perform displacement from it.
7540 If theStartLCS is NULL, displacement
7541 will be performed from global CS.
7542 If theObject itself is used as theStartLCS,
7543 its location will be changed to theEndLCS.
7544 theEndLCS Coordinate system to perform displacement to it.
7545 theName Object name; when specified, this parameter is used
7546 for result publication in the study. Otherwise, if automatic
7547 publication is switched on, default value is used for result name.
7550 New GEOM.GEOM_Object, containing the displaced shape.
7553 # create local coordinate systems
7554 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7555 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7556 # modify the location of the given object
7557 position = geompy.MakePosition(cylinder, cs1, cs2)
7559 # Example: see GEOM_TestAll.py
7560 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7561 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7562 self._autoPublish(anObj, theName, "displaced")
7565 ## Modify the Location of the given object by Path.
7566 # @param theObject The object to be displaced.
7567 # @param thePath Wire or Edge along that the object will be translated.
7568 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7569 # @param theCopy is to create a copy objects if true.
7570 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7571 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7572 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7574 # @ref tui_modify_location "Example"
7575 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7577 Modify the Location of the given object by Path.
7580 theObject The object to be displaced.
7581 thePath Wire or Edge along that the object will be translated.
7582 theDistance progress of Path (0 = start location, 1 = end of path location).
7583 theCopy is to create a copy objects if true.
7584 theReverse 0 - for usual direction, 1 - to reverse path direction.
7587 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7588 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7591 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7593 # Example: see GEOM_TestAll.py
7594 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7595 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7598 ## Modify the Location of the given object by Path, creating its copy before the operation.
7599 # @param theObject The object to be displaced.
7600 # @param thePath Wire or Edge along that the object will be translated.
7601 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7602 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7603 # @param theName Object name; when specified, this parameter is used
7604 # for result publication in the study. Otherwise, if automatic
7605 # publication is switched on, default value is used for result name.
7607 # @return New GEOM.GEOM_Object, containing the displaced shape.
7608 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7610 Modify the Location of the given object by Path, creating its copy before the operation.
7613 theObject The object to be displaced.
7614 thePath Wire or Edge along that the object will be translated.
7615 theDistance progress of Path (0 = start location, 1 = end of path location).
7616 theReverse 0 - for usual direction, 1 - to reverse path direction.
7617 theName Object name; when specified, this parameter is used
7618 for result publication in the study. Otherwise, if automatic
7619 publication is switched on, default value is used for result name.
7622 New GEOM.GEOM_Object, containing the displaced shape.
7624 # Example: see GEOM_TestAll.py
7625 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7626 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7627 self._autoPublish(anObj, theName, "displaced")
7630 ## Offset given shape.
7631 # @param theObject The base object for the offset.
7632 # @param theOffset Offset value.
7633 # @param theCopy Flag used to offset object itself or create a copy.
7634 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7635 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7636 def Offset(self, theObject, theOffset, theCopy=False):
7641 theObject The base object for the offset.
7642 theOffset Offset value.
7643 theCopy Flag used to offset object itself or create a copy.
7646 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7647 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7649 theOffset, Parameters = ParseParameters(theOffset)
7651 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7653 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7654 RaiseIfFailed("Offset", self.TrsfOp)
7655 anObj.SetParameters(Parameters)
7658 ## Create new object as offset of the given one.
7659 # @param theObject The base object for the offset.
7660 # @param theOffset Offset value.
7661 # @param theName Object name; when specified, this parameter is used
7662 # for result publication in the study. Otherwise, if automatic
7663 # publication is switched on, default value is used for result name.
7665 # @return New GEOM.GEOM_Object, containing the offset object.
7667 # @ref tui_offset "Example"
7668 def MakeOffset(self, theObject, theOffset, theName=None):
7670 Create new object as offset of the given one.
7673 theObject The base object for the offset.
7674 theOffset Offset value.
7675 theName Object name; when specified, this parameter is used
7676 for result publication in the study. Otherwise, if automatic
7677 publication is switched on, default value is used for result name.
7680 New GEOM.GEOM_Object, containing the offset object.
7683 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7684 # create a new object as offset of the given object
7685 offset = geompy.MakeOffset(box, 70.)
7687 # Example: see GEOM_TestAll.py
7688 theOffset, Parameters = ParseParameters(theOffset)
7689 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7690 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7691 anObj.SetParameters(Parameters)
7692 self._autoPublish(anObj, theName, "offset")
7695 ## Create new object as projection of the given one on a 2D surface.
7696 # @param theSource The source object for the projection. It can be a point, edge or wire.
7697 # @param theTarget The target object. It can be planar or cylindrical face.
7698 # @param theName Object name; when specified, this parameter is used
7699 # for result publication in the study. Otherwise, if automatic
7700 # publication is switched on, default value is used for result name.
7702 # @return New GEOM.GEOM_Object, containing the projection.
7704 # @ref tui_projection "Example"
7705 def MakeProjection(self, theSource, theTarget, theName=None):
7707 Create new object as projection of the given one on a 2D surface.
7710 theSource The source object for the projection. It can be a point, edge or wire.
7711 theTarget The target object. It can be planar or cylindrical face.
7712 theName Object name; when specified, this parameter is used
7713 for result publication in the study. Otherwise, if automatic
7714 publication is switched on, default value is used for result name.
7717 New GEOM.GEOM_Object, containing the projection.
7719 # Example: see GEOM_TestAll.py
7720 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7721 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7722 self._autoPublish(anObj, theName, "projection")
7725 # -----------------------------------------------------------------------------
7727 # -----------------------------------------------------------------------------
7729 ## Translate the given object along the given vector a given number times
7730 # @param theObject The object to be translated.
7731 # @param theVector Direction of the translation. DX if None.
7732 # @param theStep Distance to translate on.
7733 # @param theNbTimes Quantity of translations to be done.
7734 # @param theName Object name; when specified, this parameter is used
7735 # for result publication in the study. Otherwise, if automatic
7736 # publication is switched on, default value is used for result name.
7738 # @return New GEOM.GEOM_Object, containing compound of all
7739 # the shapes, obtained after each translation.
7741 # @ref tui_multi_translation "Example"
7742 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7744 Translate the given object along the given vector a given number times
7747 theObject The object to be translated.
7748 theVector Direction of the translation. DX if None.
7749 theStep Distance to translate on.
7750 theNbTimes Quantity of translations to be done.
7751 theName Object name; when specified, this parameter is used
7752 for result publication in the study. Otherwise, if automatic
7753 publication is switched on, default value is used for result name.
7756 New GEOM.GEOM_Object, containing compound of all
7757 the shapes, obtained after each translation.
7760 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
7762 # Example: see GEOM_TestAll.py
7763 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
7764 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
7765 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
7766 anObj.SetParameters(Parameters)
7767 self._autoPublish(anObj, theName, "multitranslation")
7770 ## Conseqently apply two specified translations to theObject specified number of times.
7771 # @param theObject The object to be translated.
7772 # @param theVector1 Direction of the first translation. DX if None.
7773 # @param theStep1 Step of the first translation.
7774 # @param theNbTimes1 Quantity of translations to be done along theVector1.
7775 # @param theVector2 Direction of the second translation. DY if None.
7776 # @param theStep2 Step of the second translation.
7777 # @param theNbTimes2 Quantity of translations to be done along theVector2.
7778 # @param theName Object name; when specified, this parameter is used
7779 # for result publication in the study. Otherwise, if automatic
7780 # publication is switched on, default value is used for result name.
7782 # @return New GEOM.GEOM_Object, containing compound of all
7783 # the shapes, obtained after each translation.
7785 # @ref tui_multi_translation "Example"
7786 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
7787 theVector2, theStep2, theNbTimes2, theName=None):
7789 Conseqently apply two specified translations to theObject specified number of times.
7792 theObject The object to be translated.
7793 theVector1 Direction of the first translation. DX if None.
7794 theStep1 Step of the first translation.
7795 theNbTimes1 Quantity of translations to be done along theVector1.
7796 theVector2 Direction of the second translation. DY if None.
7797 theStep2 Step of the second translation.
7798 theNbTimes2 Quantity of translations to be done along theVector2.
7799 theName Object name; when specified, this parameter is used
7800 for result publication in the study. Otherwise, if automatic
7801 publication is switched on, default value is used for result name.
7804 New GEOM.GEOM_Object, containing compound of all
7805 the shapes, obtained after each translation.
7808 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
7810 # Example: see GEOM_TestAll.py
7811 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
7812 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
7813 theVector2, theStep2, theNbTimes2)
7814 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
7815 anObj.SetParameters(Parameters)
7816 self._autoPublish(anObj, theName, "multitranslation")
7819 ## Rotate the given object around the given axis a given number times.
7820 # Rotation angle will be 2*PI/theNbTimes.
7821 # @param theObject The object to be rotated.
7822 # @param theAxis The rotation axis. DZ if None.
7823 # @param theNbTimes Quantity of rotations to be done.
7824 # @param theName Object name; when specified, this parameter is used
7825 # for result publication in the study. Otherwise, if automatic
7826 # publication is switched on, default value is used for result name.
7828 # @return New GEOM.GEOM_Object, containing compound of all the
7829 # shapes, obtained after each rotation.
7831 # @ref tui_multi_rotation "Example"
7832 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
7834 Rotate the given object around the given axis a given number times.
7835 Rotation angle will be 2*PI/theNbTimes.
7838 theObject The object to be rotated.
7839 theAxis The rotation axis. DZ if None.
7840 theNbTimes Quantity of rotations to be done.
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 New GEOM.GEOM_Object, containing compound of all the
7847 shapes, obtained after each rotation.
7850 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
7852 # Example: see GEOM_TestAll.py
7853 theNbTimes, Parameters = ParseParameters(theNbTimes)
7854 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
7855 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
7856 anObj.SetParameters(Parameters)
7857 self._autoPublish(anObj, theName, "multirotation")
7860 ## Rotate the given object around the given axis
7861 # a given number times on the given angle.
7862 # @param theObject The object to be rotated.
7863 # @param theAxis The rotation axis. DZ if None.
7864 # @param theAngleStep Rotation angle in radians.
7865 # @param theNbTimes Quantity of rotations to be done.
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 # @return New GEOM.GEOM_Object, containing compound of all the
7871 # shapes, obtained after each rotation.
7873 # @ref tui_multi_rotation "Example"
7874 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
7876 Rotate the given object around the given axis
7877 a given number times on the given angle.
7880 theObject The object to be rotated.
7881 theAxis The rotation axis. DZ if None.
7882 theAngleStep Rotation angle in radians.
7883 theNbTimes Quantity of rotations to be done.
7884 theName Object name; when specified, this parameter is used
7885 for result publication in the study. Otherwise, if automatic
7886 publication is switched on, default value is used for result name.
7889 New GEOM.GEOM_Object, containing compound of all the
7890 shapes, obtained after each rotation.
7893 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
7895 # Example: see GEOM_TestAll.py
7896 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
7897 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
7898 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
7899 anObj.SetParameters(Parameters)
7900 self._autoPublish(anObj, theName, "multirotation")
7903 ## Rotate the given object around the given axis a given
7904 # number times and multi-translate each rotation result.
7905 # Rotation angle will be 2*PI/theNbTimes1.
7906 # Translation direction passes through center of gravity
7907 # of rotated shape and its projection on the rotation axis.
7908 # @param theObject The object to be rotated.
7909 # @param theAxis Rotation axis. DZ if None.
7910 # @param theNbTimes1 Quantity of rotations to be done.
7911 # @param theRadialStep Translation distance.
7912 # @param theNbTimes2 Quantity of translations to be done.
7913 # @param theName Object name; when specified, this parameter is used
7914 # for result publication in the study. Otherwise, if automatic
7915 # publication is switched on, default value is used for result name.
7917 # @return New GEOM.GEOM_Object, containing compound of all the
7918 # shapes, obtained after each transformation.
7920 # @ref tui_multi_rotation "Example"
7921 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
7923 Rotate the given object around the
7924 given axis on the given angle a given number
7925 times and multi-translate each rotation result.
7926 Translation direction passes through center of gravity
7927 of rotated shape and its projection on the rotation axis.
7930 theObject The object to be rotated.
7931 theAxis Rotation axis. DZ if None.
7932 theNbTimes1 Quantity of rotations to be done.
7933 theRadialStep Translation distance.
7934 theNbTimes2 Quantity of translations to be done.
7935 theName Object name; when specified, this parameter is used
7936 for result publication in the study. Otherwise, if automatic
7937 publication is switched on, default value is used for result name.
7940 New GEOM.GEOM_Object, containing compound of all the
7941 shapes, obtained after each transformation.
7944 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
7946 # Example: see GEOM_TestAll.py
7947 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
7948 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
7949 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
7950 anObj.SetParameters(Parameters)
7951 self._autoPublish(anObj, theName, "multirotation")
7954 ## Rotate the given object around the
7955 # given axis on the given angle a given number
7956 # times and multi-translate each rotation result.
7957 # Translation direction passes through center of gravity
7958 # of rotated shape and its projection on the rotation axis.
7959 # @param theObject The object to be rotated.
7960 # @param theAxis Rotation axis. DZ if None.
7961 # @param theAngleStep Rotation angle in radians.
7962 # @param theNbTimes1 Quantity of rotations to be done.
7963 # @param theRadialStep Translation distance.
7964 # @param theNbTimes2 Quantity of translations to be done.
7965 # @param theName Object name; when specified, this parameter is used
7966 # for result publication in the study. Otherwise, if automatic
7967 # publication is switched on, default value is used for result name.
7969 # @return New GEOM.GEOM_Object, containing compound of all the
7970 # shapes, obtained after each transformation.
7972 # @ref tui_multi_rotation "Example"
7973 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
7975 Rotate the given object around the
7976 given axis on the given angle a given number
7977 times and multi-translate each rotation result.
7978 Translation direction passes through center of gravity
7979 of rotated shape and its projection on the rotation axis.
7982 theObject The object to be rotated.
7983 theAxis Rotation axis. DZ if None.
7984 theAngleStep Rotation angle in radians.
7985 theNbTimes1 Quantity of rotations to be done.
7986 theRadialStep Translation distance.
7987 theNbTimes2 Quantity of translations to be done.
7988 theName Object name; when specified, this parameter is used
7989 for result publication in the study. Otherwise, if automatic
7990 publication is switched on, default value is used for result name.
7993 New GEOM.GEOM_Object, containing compound of all the
7994 shapes, obtained after each transformation.
7997 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
7999 # Example: see GEOM_TestAll.py
8000 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8001 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8002 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8003 anObj.SetParameters(Parameters)
8004 self._autoPublish(anObj, theName, "multirotation")
8007 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8009 # @ref swig_MakeMultiRotation "Example"
8010 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8012 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8015 pz = geompy.MakeVertex(0, 0, 100)
8016 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8017 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8019 # Example: see GEOM_TestOthers.py
8020 aVec = self.MakeLine(aPoint,aDir)
8021 # note: auto-publishing is done in self.MultiRotate1D()
8022 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8025 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8027 # @ref swig_MakeMultiRotation "Example"
8028 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8030 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8033 pz = geompy.MakeVertex(0, 0, 100)
8034 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8035 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8037 # Example: see GEOM_TestOthers.py
8038 aVec = self.MakeLine(aPoint,aDir)
8039 # note: auto-publishing is done in self.MultiRotate1D()
8040 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8043 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8045 # @ref swig_MakeMultiRotation "Example"
8046 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8048 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8051 pz = geompy.MakeVertex(0, 0, 100)
8052 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8053 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8055 # Example: see GEOM_TestOthers.py
8056 aVec = self.MakeLine(aPoint,aDir)
8057 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8058 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8061 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8063 # @ref swig_MakeMultiRotation "Example"
8064 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8066 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8069 pz = geompy.MakeVertex(0, 0, 100)
8070 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8071 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8073 # Example: see GEOM_TestOthers.py
8074 aVec = self.MakeLine(aPoint,aDir)
8075 # note: auto-publishing is done in self.MultiRotate2D()
8076 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8079 # end of l3_transform
8082 ## @addtogroup l3_transform_d
8085 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8086 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8088 Deprecated method. Use MultiRotate1DNbTimes instead.
8090 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8091 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8093 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8094 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8095 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8097 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8098 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8101 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8103 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8104 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8105 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8106 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8107 anObj.SetParameters(Parameters)
8108 self._autoPublish(anObj, theName, "multirotation")
8111 ## The same, as MultiRotate1D(), but axis is given by direction and point
8112 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8113 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8115 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8116 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8119 pz = geompy.MakeVertex(0, 0, 100)
8120 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8121 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8123 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8124 aVec = self.MakeLine(aPoint,aDir)
8125 # note: auto-publishing is done in self.MultiRotate1D()
8126 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8129 ## The same, as MultiRotate2D(), but axis is given by direction and point
8130 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8131 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8133 The same, as MultiRotate2D(), but axis is given by direction and point
8134 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8137 pz = geompy.MakeVertex(0, 0, 100)
8138 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8139 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8141 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8142 aVec = self.MakeLine(aPoint,aDir)
8143 # note: auto-publishing is done in self.MultiRotate2D()
8144 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8147 # end of l3_transform_d
8150 ## @addtogroup l3_local
8153 ## Perform a fillet on all edges of the given shape.
8154 # @param theShape Shape, to perform fillet on.
8155 # @param theR Fillet radius.
8156 # @param theName Object name; when specified, this parameter is used
8157 # for result publication in the study. Otherwise, if automatic
8158 # publication is switched on, default value is used for result name.
8160 # @return New GEOM.GEOM_Object, containing the result shape.
8162 # @ref tui_fillet "Example 1"
8163 # \n @ref swig_MakeFilletAll "Example 2"
8164 def MakeFilletAll(self, theShape, theR, theName=None):
8166 Perform a fillet on all edges of the given shape.
8169 theShape Shape, to perform fillet on.
8171 theName Object name; when specified, this parameter is used
8172 for result publication in the study. Otherwise, if automatic
8173 publication is switched on, default value is used for result name.
8176 New GEOM.GEOM_Object, containing the result shape.
8179 filletall = geompy.MakeFilletAll(prism, 10.)
8181 # Example: see GEOM_TestOthers.py
8182 theR,Parameters = ParseParameters(theR)
8183 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8184 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8185 anObj.SetParameters(Parameters)
8186 self._autoPublish(anObj, theName, "fillet")
8189 ## Perform a fillet on the specified edges/faces of the given shape
8190 # @param theShape Shape, to perform fillet on.
8191 # @param theR Fillet radius.
8192 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8193 # @param theListShapes Global indices of edges/faces to perform fillet on.
8194 # @param theName Object name; when specified, this parameter is used
8195 # for result publication in the study. Otherwise, if automatic
8196 # publication is switched on, default value is used for result name.
8198 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8200 # @return New GEOM.GEOM_Object, containing the result shape.
8202 # @ref tui_fillet "Example"
8203 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8205 Perform a fillet on the specified edges/faces of the given shape
8208 theShape Shape, to perform fillet on.
8210 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8211 theListShapes Global indices of edges/faces to perform fillet on.
8212 theName Object name; when specified, this parameter is used
8213 for result publication in the study. Otherwise, if automatic
8214 publication is switched on, default value is used for result name.
8217 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8220 New GEOM.GEOM_Object, containing the result shape.
8223 # get the list of IDs (IDList) for the fillet
8224 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8226 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8227 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8228 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8229 # make a fillet on the specified edges of the given shape
8230 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8232 # Example: see GEOM_TestAll.py
8233 theR,Parameters = ParseParameters(theR)
8235 if theShapeType == ShapeType["EDGE"]:
8236 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8237 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8239 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8240 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8241 anObj.SetParameters(Parameters)
8242 self._autoPublish(anObj, theName, "fillet")
8245 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8246 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8248 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8251 # get the list of IDs (IDList) for the fillet
8252 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8254 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8255 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8256 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8257 # make a fillet on the specified edges of the given shape
8258 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8260 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8262 if theShapeType == ShapeType["EDGE"]:
8263 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8264 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8266 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8267 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8268 anObj.SetParameters(Parameters)
8269 self._autoPublish(anObj, theName, "fillet")
8272 ## Perform a fillet on the specified edges of the given shape
8273 # @param theShape Wire Shape to perform fillet on.
8274 # @param theR Fillet radius.
8275 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8276 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8277 # \note The list of vertices could be empty,
8278 # in this case fillet will done done at all vertices in wire
8279 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8280 # by the length of the edges, nearest to the fillet vertex.
8281 # But sometimes the next edge is C1 continuous with the one, nearest to
8282 # the fillet point, and such two (or more) edges can be united to allow
8283 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8284 # thus ignoring the secant vertex (vertices).
8285 # @param theName Object name; when specified, this parameter is used
8286 # for result publication in the study. Otherwise, if automatic
8287 # publication is switched on, default value is used for result name.
8289 # @return New GEOM.GEOM_Object, containing the result shape.
8291 # @ref tui_fillet2d "Example"
8292 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8294 Perform a fillet on the specified edges of the given shape
8297 theShape Wire Shape to perform fillet on.
8299 theListOfVertexes Global indices of vertexes to perform fillet on.
8300 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8301 by the length of the edges, nearest to the fillet vertex.
8302 But sometimes the next edge is C1 continuous with the one, nearest to
8303 the fillet point, and such two (or more) edges can be united to allow
8304 bigger radius. Set this flag to TRUE to allow collinear edges union,
8305 thus ignoring the secant vertex (vertices).
8306 theName Object name; when specified, this parameter is used
8307 for result publication in the study. Otherwise, if automatic
8308 publication is switched on, default value is used for result name.
8310 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8312 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8315 New GEOM.GEOM_Object, containing the result shape.
8319 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8320 # make fillet at given wire vertices with giver radius
8321 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8323 # Example: see GEOM_TestAll.py
8324 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8325 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8326 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8327 anObj.SetParameters(Parameters)
8328 self._autoPublish(anObj, theName, "fillet")
8331 ## Perform a fillet at the specified vertices of the given face/shell.
8332 # @param theShape Face or Shell shape to perform fillet on.
8333 # @param theR Fillet radius.
8334 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8335 # @param theName Object name; when specified, this parameter is used
8336 # for result publication in the study. Otherwise, if automatic
8337 # publication is switched on, default value is used for result name.
8339 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8341 # @return New GEOM.GEOM_Object, containing the result shape.
8343 # @ref tui_fillet2d "Example"
8344 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8346 Perform a fillet at the specified vertices of the given face/shell.
8349 theShape Face or Shell shape to perform fillet on.
8351 theListOfVertexes Global indices of vertexes to perform fillet on.
8352 theName Object name; when specified, this parameter is used
8353 for result publication in the study. Otherwise, if automatic
8354 publication is switched on, default value is used for result name.
8356 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8359 New GEOM.GEOM_Object, containing the result shape.
8362 face = geompy.MakeFaceHW(100, 100, 1)
8363 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8365 # Example: see GEOM_TestAll.py
8366 theR,Parameters = ParseParameters(theR)
8367 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8368 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8369 anObj.SetParameters(Parameters)
8370 self._autoPublish(anObj, theName, "fillet")
8373 ## Perform a symmetric chamfer on all edges of the given shape.
8374 # @param theShape Shape, to perform chamfer on.
8375 # @param theD Chamfer size along each face.
8376 # @param theName Object name; when specified, this parameter is used
8377 # for result publication in the study. Otherwise, if automatic
8378 # publication is switched on, default value is used for result name.
8380 # @return New GEOM.GEOM_Object, containing the result shape.
8382 # @ref tui_chamfer "Example 1"
8383 # \n @ref swig_MakeChamferAll "Example 2"
8384 def MakeChamferAll(self, theShape, theD, theName=None):
8386 Perform a symmetric chamfer on all edges of the given shape.
8389 theShape Shape, to perform chamfer on.
8390 theD Chamfer size along each face.
8391 theName Object name; when specified, this parameter is used
8392 for result publication in the study. Otherwise, if automatic
8393 publication is switched on, default value is used for result name.
8396 New GEOM.GEOM_Object, containing the result shape.
8399 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8401 # Example: see GEOM_TestOthers.py
8402 theD,Parameters = ParseParameters(theD)
8403 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8404 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8405 anObj.SetParameters(Parameters)
8406 self._autoPublish(anObj, theName, "chamfer")
8409 ## Perform a chamfer on edges, common to the specified faces,
8410 # with distance D1 on the Face1
8411 # @param theShape Shape, to perform chamfer on.
8412 # @param theD1 Chamfer size along \a theFace1.
8413 # @param theD2 Chamfer size along \a theFace2.
8414 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8415 # @param theName Object name; when specified, this parameter is used
8416 # for result publication in the study. Otherwise, if automatic
8417 # publication is switched on, default value is used for result name.
8419 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8421 # @return New GEOM.GEOM_Object, containing the result shape.
8423 # @ref tui_chamfer "Example"
8424 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8426 Perform a chamfer on edges, common to the specified faces,
8427 with distance D1 on the Face1
8430 theShape Shape, to perform chamfer on.
8431 theD1 Chamfer size along theFace1.
8432 theD2 Chamfer size along theFace2.
8433 theFace1,theFace2 Global indices of two faces of theShape.
8434 theName Object name; when specified, this parameter is used
8435 for result publication in the study. Otherwise, if automatic
8436 publication is switched on, default value is used for result name.
8439 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8442 New GEOM.GEOM_Object, containing the result shape.
8445 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8446 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8447 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8448 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8450 # Example: see GEOM_TestAll.py
8451 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8452 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8453 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8454 anObj.SetParameters(Parameters)
8455 self._autoPublish(anObj, theName, "chamfer")
8458 ## Perform a chamfer on edges
8459 # @param theShape Shape, to perform chamfer on.
8460 # @param theD Chamfer length
8461 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8462 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8463 # @param theName Object name; when specified, this parameter is used
8464 # for result publication in the study. Otherwise, if automatic
8465 # publication is switched on, default value is used for result name.
8467 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8469 # @return New GEOM.GEOM_Object, containing the result shape.
8470 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8472 Perform a chamfer on edges
8475 theShape Shape, to perform chamfer on.
8476 theD1 Chamfer size along theFace1.
8477 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8478 theFace1,theFace2 Global indices of two faces of theShape.
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 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8487 New GEOM.GEOM_Object, containing the result shape.
8490 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8491 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8492 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8494 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8497 if isinstance(theAngle,str):
8499 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8501 theAngle = theAngle*math.pi/180.0
8502 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8503 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8504 anObj.SetParameters(Parameters)
8505 self._autoPublish(anObj, theName, "chamfer")
8508 ## Perform a chamfer on all edges of the specified faces,
8509 # with distance D1 on the first specified face (if several for one edge)
8510 # @param theShape Shape, to perform chamfer on.
8511 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8512 # connected to the edge, are in \a theFaces, \a theD1
8513 # will be get along face, which is nearer to \a theFaces beginning.
8514 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8515 # @param theFaces Sequence of global indices of faces of \a theShape.
8516 # @param theName Object name; when specified, this parameter is used
8517 # for result publication in the study. Otherwise, if automatic
8518 # publication is switched on, default value is used for result name.
8520 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8522 # @return New GEOM.GEOM_Object, containing the result shape.
8524 # @ref tui_chamfer "Example"
8525 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8527 Perform a chamfer on all edges of the specified faces,
8528 with distance D1 on the first specified face (if several for one edge)
8531 theShape Shape, to perform chamfer on.
8532 theD1 Chamfer size along face from theFaces. If both faces,
8533 connected to the edge, are in theFaces, theD1
8534 will be get along face, which is nearer to theFaces beginning.
8535 theD2 Chamfer size along another of two faces, connected to the edge.
8536 theFaces Sequence of global indices of faces of theShape.
8537 theName Object name; when specified, this parameter is used
8538 for result publication in the study. Otherwise, if automatic
8539 publication is switched on, default value is used for result name.
8541 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8544 New GEOM.GEOM_Object, containing the result shape.
8546 # Example: see GEOM_TestAll.py
8547 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8548 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8549 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8550 anObj.SetParameters(Parameters)
8551 self._autoPublish(anObj, theName, "chamfer")
8554 ## The Same that MakeChamferFaces() but with params theD is chamfer lenght and
8555 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8557 # @ref swig_FilletChamfer "Example"
8558 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8560 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8561 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8564 if isinstance(theAngle,str):
8566 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8568 theAngle = theAngle*math.pi/180.0
8569 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8570 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8571 anObj.SetParameters(Parameters)
8572 self._autoPublish(anObj, theName, "chamfer")
8575 ## Perform a chamfer on edges,
8576 # with distance D1 on the first specified face (if several for one edge)
8577 # @param theShape Shape, to perform chamfer on.
8578 # @param theD1,theD2 Chamfer size
8579 # @param theEdges Sequence of edges of \a theShape.
8580 # @param theName Object name; when specified, this parameter is used
8581 # for result publication in the study. Otherwise, if automatic
8582 # publication is switched on, default value is used for result name.
8584 # @return New GEOM.GEOM_Object, containing the result shape.
8586 # @ref swig_FilletChamfer "Example"
8587 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8589 Perform a chamfer on edges,
8590 with distance D1 on the first specified face (if several for one edge)
8593 theShape Shape, to perform chamfer on.
8594 theD1,theD2 Chamfer size
8595 theEdges Sequence of edges of theShape.
8596 theName Object name; when specified, this parameter is used
8597 for result publication in the study. Otherwise, if automatic
8598 publication is switched on, default value is used for result name.
8601 New GEOM.GEOM_Object, containing the result shape.
8603 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8604 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8605 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8606 anObj.SetParameters(Parameters)
8607 self._autoPublish(anObj, theName, "chamfer")
8610 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8611 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8612 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8614 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8615 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8618 if isinstance(theAngle,str):
8620 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8622 theAngle = theAngle*math.pi/180.0
8623 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8624 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8625 anObj.SetParameters(Parameters)
8626 self._autoPublish(anObj, theName, "chamfer")
8629 ## @sa MakeChamferEdge(), MakeChamferFaces()
8631 # @ref swig_MakeChamfer "Example"
8632 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8634 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8636 # Example: see GEOM_TestOthers.py
8638 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8639 if aShapeType == ShapeType["EDGE"]:
8640 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8642 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8645 ## Remove material from a solid by extrusion of the base shape on the given distance.
8646 # @param theInit Shape to remove material from. It must be a solid or
8647 # a compound made of a single solid.
8648 # @param theBase Closed edge or wire defining the base shape to be extruded.
8649 # @param theH Prism dimension along the normal to theBase
8650 # @param theAngle Draft angle in degrees.
8651 # @param theName Object name; when specified, this parameter is used
8652 # for result publication in the study. Otherwise, if automatic
8653 # publication is switched on, default value is used for result name.
8655 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8657 # @ref tui_creation_prism "Example"
8658 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8660 Add material to a solid by extrusion of the base shape on the given distance.
8663 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8664 theBase Closed edge or wire defining the base shape to be extruded.
8665 theH Prism dimension along the normal to theBase
8666 theAngle Draft angle in degrees.
8667 theName Object name; when specified, this parameter is used
8668 for result publication in the study. Otherwise, if automatic
8669 publication is switched on, default value is used for result name.
8672 New GEOM.GEOM_Object, containing the initial shape with removed material.
8674 # Example: see GEOM_TestAll.py
8675 #theH,Parameters = ParseParameters(theH)
8676 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8677 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8678 #anObj.SetParameters(Parameters)
8679 self._autoPublish(anObj, theName, "extrudedCut")
8682 ## Add material to a solid by extrusion of the base shape on the given distance.
8683 # @param theInit Shape to add material to. It must be a solid or
8684 # a compound made of a single solid.
8685 # @param theBase Closed edge or wire defining the base shape to be extruded.
8686 # @param theH Prism dimension along the normal to theBase
8687 # @param theAngle Draft angle in degrees.
8688 # @param theName Object name; when specified, this parameter is used
8689 # for result publication in the study. Otherwise, if automatic
8690 # publication is switched on, default value is used for result name.
8692 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8694 # @ref tui_creation_prism "Example"
8695 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8697 Add material to a solid by extrusion of the base shape on the given distance.
8700 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8701 theBase Closed edge or wire defining the base shape to be extruded.
8702 theH Prism dimension along the normal to theBase
8703 theAngle Draft angle in degrees.
8704 theName Object name; when specified, this parameter is used
8705 for result publication in the study. Otherwise, if automatic
8706 publication is switched on, default value is used for result name.
8709 New GEOM.GEOM_Object, containing the initial shape with added material.
8711 # Example: see GEOM_TestAll.py
8712 #theH,Parameters = ParseParameters(theH)
8713 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8714 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8715 #anObj.SetParameters(Parameters)
8716 self._autoPublish(anObj, theName, "extrudedBoss")
8722 ## @addtogroup l3_basic_op
8725 ## Perform an Archimde operation on the given shape with given parameters.
8726 # The object presenting the resulting face is returned.
8727 # @param theShape Shape to be put in water.
8728 # @param theWeight Weight og the shape.
8729 # @param theWaterDensity Density of the water.
8730 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8731 # @param theName Object name; when specified, this parameter is used
8732 # for result publication in the study. Otherwise, if automatic
8733 # publication is switched on, default value is used for result name.
8735 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8736 # by a plane, corresponding to water level.
8738 # @ref tui_archimede "Example"
8739 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8741 Perform an Archimde operation on the given shape with given parameters.
8742 The object presenting the resulting face is returned.
8745 theShape Shape to be put in water.
8746 theWeight Weight og the shape.
8747 theWaterDensity Density of the water.
8748 theMeshDeflection Deflection of the mesh, using to compute the section.
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 a section of theShape
8755 by a plane, corresponding to water level.
8757 # Example: see GEOM_TestAll.py
8758 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
8759 theWeight,theWaterDensity,theMeshDeflection)
8760 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
8761 RaiseIfFailed("MakeArchimede", self.LocalOp)
8762 anObj.SetParameters(Parameters)
8763 self._autoPublish(anObj, theName, "archimede")
8766 # end of l3_basic_op
8769 ## @addtogroup l2_measure
8772 ## Get point coordinates
8775 # @ref tui_measurement_tools_page "Example"
8776 def PointCoordinates(self,Point):
8778 Get point coordinates
8783 # Example: see GEOM_TestMeasures.py
8784 aTuple = self.MeasuOp.PointCoordinates(Point)
8785 RaiseIfFailed("PointCoordinates", self.MeasuOp)
8788 ## Get vector coordinates
8791 # @ref tui_measurement_tools_page "Example"
8792 def VectorCoordinates(self,Vector):
8794 Get vector coordinates
8800 p1=self.GetFirstVertex(Vector)
8801 p2=self.GetLastVertex(Vector)
8803 X1=self.PointCoordinates(p1)
8804 X2=self.PointCoordinates(p2)
8806 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
8809 ## Compute cross product
8810 # @return vector w=u^v
8812 # @ref tui_measurement_tools_page "Example"
8813 def CrossProduct(self, Vector1, Vector2):
8815 Compute cross product
8817 Returns: vector w=u^v
8819 u=self.VectorCoordinates(Vector1)
8820 v=self.VectorCoordinates(Vector2)
8821 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])
8825 ## Compute cross product
8826 # @return dot product p=u.v
8828 # @ref tui_measurement_tools_page "Example"
8829 def DotProduct(self, Vector1, Vector2):
8831 Compute cross product
8833 Returns: dot product p=u.v
8835 u=self.VectorCoordinates(Vector1)
8836 v=self.VectorCoordinates(Vector2)
8837 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
8842 ## Get summarized length of all wires,
8843 # area of surface and volume of the given shape.
8844 # @param theShape Shape to define properties of.
8845 # @return [theLength, theSurfArea, theVolume]\n
8846 # theLength: Summarized length of all wires of the given shape.\n
8847 # theSurfArea: Area of surface of the given shape.\n
8848 # theVolume: Volume of the given shape.
8850 # @ref tui_measurement_tools_page "Example"
8851 def BasicProperties(self,theShape):
8853 Get summarized length of all wires,
8854 area of surface and volume of the given shape.
8857 theShape Shape to define properties of.
8860 [theLength, theSurfArea, theVolume]
8861 theLength: Summarized length of all wires of the given shape.
8862 theSurfArea: Area of surface of the given shape.
8863 theVolume: Volume of the given shape.
8865 # Example: see GEOM_TestMeasures.py
8866 aTuple = self.MeasuOp.GetBasicProperties(theShape)
8867 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
8870 ## Get parameters of bounding box of the given shape
8871 # @param theShape Shape to obtain bounding box of.
8872 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
8873 # Xmin,Xmax: Limits of shape along OX axis.
8874 # Ymin,Ymax: Limits of shape along OY axis.
8875 # Zmin,Zmax: Limits of shape along OZ axis.
8877 # @ref tui_measurement_tools_page "Example"
8878 def BoundingBox (self, theShape):
8880 Get parameters of bounding box of the given shape
8883 theShape Shape to obtain bounding box of.
8886 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
8887 Xmin,Xmax: Limits of shape along OX axis.
8888 Ymin,Ymax: Limits of shape along OY axis.
8889 Zmin,Zmax: Limits of shape along OZ axis.
8891 # Example: see GEOM_TestMeasures.py
8892 aTuple = self.MeasuOp.GetBoundingBox(theShape)
8893 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
8896 ## Get bounding box of the given shape
8897 # @param theShape Shape to obtain bounding box of.
8898 # @param theName Object name; when specified, this parameter is used
8899 # for result publication in the study. Otherwise, if automatic
8900 # publication is switched on, default value is used for result name.
8902 # @return New GEOM.GEOM_Object, containing the created box.
8904 # @ref tui_measurement_tools_page "Example"
8905 def MakeBoundingBox (self, theShape, theName=None):
8907 Get bounding box of the given shape
8910 theShape Shape to obtain bounding box of.
8911 theName Object name; when specified, this parameter is used
8912 for result publication in the study. Otherwise, if automatic
8913 publication is switched on, default value is used for result name.
8916 New GEOM.GEOM_Object, containing the created box.
8918 # Example: see GEOM_TestMeasures.py
8919 anObj = self.MeasuOp.MakeBoundingBox(theShape)
8920 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
8921 self._autoPublish(anObj, theName, "bndbox")
8924 ## Get inertia matrix and moments of inertia of theShape.
8925 # @param theShape Shape to calculate inertia of.
8926 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
8927 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
8928 # Ix,Iy,Iz: Moments of inertia of the given shape.
8930 # @ref tui_measurement_tools_page "Example"
8931 def Inertia(self,theShape):
8933 Get inertia matrix and moments of inertia of theShape.
8936 theShape Shape to calculate inertia of.
8939 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
8940 I(1-3)(1-3): Components of the inertia matrix of the given shape.
8941 Ix,Iy,Iz: Moments of inertia of the given shape.
8943 # Example: see GEOM_TestMeasures.py
8944 aTuple = self.MeasuOp.GetInertia(theShape)
8945 RaiseIfFailed("GetInertia", self.MeasuOp)
8948 ## Get if coords are included in the shape (ST_IN or ST_ON)
8949 # @param theShape Shape
8950 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
8951 # @param tolerance to be used (default is 1.0e-7)
8952 # @return list_of_boolean = [res1, res2, ...]
8953 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
8955 Get if coords are included in the shape (ST_IN or ST_ON)
8959 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
8960 tolerance to be used (default is 1.0e-7)
8963 list_of_boolean = [res1, res2, ...]
8965 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
8967 ## Get minimal distance between the given shapes.
8968 # @param theShape1,theShape2 Shapes to find minimal distance between.
8969 # @return Value of the minimal distance between the given shapes.
8971 # @ref tui_measurement_tools_page "Example"
8972 def MinDistance(self, theShape1, theShape2):
8974 Get minimal distance between the given shapes.
8977 theShape1,theShape2 Shapes to find minimal distance between.
8980 Value of the minimal distance between the given shapes.
8982 # Example: see GEOM_TestMeasures.py
8983 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
8984 RaiseIfFailed("GetMinDistance", self.MeasuOp)
8987 ## Get minimal distance between the given shapes.
8988 # @param theShape1,theShape2 Shapes to find minimal distance between.
8989 # @return Value of the minimal distance between the given shapes, in form of list
8990 # [Distance, DX, DY, DZ].
8992 # @ref swig_all_measure "Example"
8993 def MinDistanceComponents(self, theShape1, theShape2):
8995 Get minimal distance between the given shapes.
8998 theShape1,theShape2 Shapes to find minimal distance between.
9001 Value of the minimal distance between the given shapes, in form of list
9002 [Distance, DX, DY, DZ]
9004 # Example: see GEOM_TestMeasures.py
9005 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9006 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9007 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9010 ## Get closest points of the given shapes.
9011 # @param theShape1,theShape2 Shapes to find closest points of.
9012 # @return The number of found solutions (-1 in case of infinite number of
9013 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9015 # @ref tui_measurement_tools_page "Example"
9016 def ClosestPoints (self, theShape1, theShape2):
9018 Get closest points of the given shapes.
9021 theShape1,theShape2 Shapes to find closest points of.
9024 The number of found solutions (-1 in case of infinite number of
9025 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9027 # Example: see GEOM_TestMeasures.py
9028 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9029 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9032 ## Get angle between the given shapes in degrees.
9033 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9034 # @note If both arguments are vectors, the angle is computed in accordance
9035 # with their orientations, otherwise the minimum angle is computed.
9036 # @return Value of the angle between the given shapes in degrees.
9038 # @ref tui_measurement_tools_page "Example"
9039 def GetAngle(self, theShape1, theShape2):
9041 Get angle between the given shapes in degrees.
9044 theShape1,theShape2 Lines or linear edges to find angle between.
9047 If both arguments are vectors, the angle is computed in accordance
9048 with their orientations, otherwise the minimum angle is computed.
9051 Value of the angle between the given shapes in degrees.
9053 # Example: see GEOM_TestMeasures.py
9054 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9055 RaiseIfFailed("GetAngle", self.MeasuOp)
9058 ## Get angle between the given shapes in radians.
9059 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9060 # @note If both arguments are vectors, the angle is computed in accordance
9061 # with their orientations, otherwise the minimum angle is computed.
9062 # @return Value of the angle between the given shapes in radians.
9064 # @ref tui_measurement_tools_page "Example"
9065 def GetAngleRadians(self, theShape1, theShape2):
9067 Get angle between the given shapes in radians.
9070 theShape1,theShape2 Lines or linear edges to find angle between.
9074 If both arguments are vectors, the angle is computed in accordance
9075 with their orientations, otherwise the minimum angle is computed.
9078 Value of the angle between the given shapes in radians.
9080 # Example: see GEOM_TestMeasures.py
9081 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9082 RaiseIfFailed("GetAngle", self.MeasuOp)
9085 ## Get angle between the given vectors in degrees.
9086 # @param theShape1,theShape2 Vectors to find angle between.
9087 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9088 # if False, the opposite vector to the normal vector is used.
9089 # @return Value of the angle between the given vectors in degrees.
9091 # @ref tui_measurement_tools_page "Example"
9092 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9094 Get angle between the given vectors in degrees.
9097 theShape1,theShape2 Vectors to find angle between.
9098 theFlag If True, the normal vector is defined by the two vectors cross,
9099 if False, the opposite vector to the normal vector is used.
9102 Value of the angle between the given vectors in degrees.
9104 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9106 anAngle = 360. - anAngle
9107 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9110 ## The same as GetAngleVectors, but the result is in radians.
9111 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9113 Get angle between the given vectors in radians.
9116 theShape1,theShape2 Vectors to find angle between.
9117 theFlag If True, the normal vector is defined by the two vectors cross,
9118 if False, the opposite vector to the normal vector is used.
9121 Value of the angle between the given vectors in radians.
9123 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9126 ## @name Curve Curvature Measurement
9127 # Methods for receiving radius of curvature of curves
9128 # in the given point
9131 ## Measure curvature of a curve at a point, set by parameter.
9132 # @param theCurve a curve.
9133 # @param theParam parameter.
9134 # @return radius of curvature of \a theCurve.
9136 # @ref swig_todo "Example"
9137 def CurveCurvatureByParam(self, theCurve, theParam):
9139 Measure curvature of a curve at a point, set by parameter.
9146 radius of curvature of theCurve.
9148 # Example: see GEOM_TestMeasures.py
9149 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9150 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9153 ## Measure curvature of a curve at a point.
9154 # @param theCurve a curve.
9155 # @param thePoint given point.
9156 # @return radius of curvature of \a theCurve.
9158 # @ref swig_todo "Example"
9159 def CurveCurvatureByPoint(self, theCurve, thePoint):
9161 Measure curvature of a curve at a point.
9165 thePoint given point.
9168 radius of curvature of theCurve.
9170 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9171 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9175 ## @name Surface Curvature Measurement
9176 # Methods for receiving max and min radius of curvature of surfaces
9177 # in the given point
9180 ## Measure max radius of curvature of surface.
9181 # @param theSurf the given surface.
9182 # @param theUParam Value of U-parameter on the referenced surface.
9183 # @param theVParam Value of V-parameter on the referenced surface.
9184 # @return max radius of curvature of theSurf.
9186 ## @ref swig_todo "Example"
9187 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9189 Measure max radius of curvature of surface.
9192 theSurf the given surface.
9193 theUParam Value of U-parameter on the referenced surface.
9194 theVParam Value of V-parameter on the referenced surface.
9197 max radius of curvature of theSurf.
9199 # Example: see GEOM_TestMeasures.py
9200 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9201 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9204 ## Measure max radius of curvature of surface in the given point
9205 # @param theSurf the given surface.
9206 # @param thePoint given point.
9207 # @return max radius of curvature of theSurf.
9209 ## @ref swig_todo "Example"
9210 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9212 Measure max radius of curvature of surface in the given point.
9215 theSurf the given surface.
9216 thePoint given point.
9219 max radius of curvature of theSurf.
9221 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9222 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9225 ## Measure min radius of curvature of surface.
9226 # @param theSurf the given surface.
9227 # @param theUParam Value of U-parameter on the referenced surface.
9228 # @param theVParam Value of V-parameter on the referenced surface.
9229 # @return min radius of curvature of theSurf.
9231 ## @ref swig_todo "Example"
9232 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9234 Measure min radius of curvature of surface.
9237 theSurf the given surface.
9238 theUParam Value of U-parameter on the referenced surface.
9239 theVParam Value of V-parameter on the referenced surface.
9242 Min radius of curvature of theSurf.
9244 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9245 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9248 ## Measure min radius of curvature of surface in the given point
9249 # @param theSurf the given surface.
9250 # @param thePoint given point.
9251 # @return min radius of curvature of theSurf.
9253 ## @ref swig_todo "Example"
9254 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9256 Measure min radius of curvature of surface in the given point.
9259 theSurf the given surface.
9260 thePoint given point.
9263 Min radius of curvature of theSurf.
9265 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9266 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9270 ## Get min and max tolerances of sub-shapes of theShape
9271 # @param theShape Shape, to get tolerances of.
9272 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9273 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9274 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9275 # VertMin,VertMax: Min and max tolerances of the vertices.
9277 # @ref tui_measurement_tools_page "Example"
9278 def Tolerance(self,theShape):
9280 Get min and max tolerances of sub-shapes of theShape
9283 theShape Shape, to get tolerances of.
9286 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9287 FaceMin,FaceMax: Min and max tolerances of the faces.
9288 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9289 VertMin,VertMax: Min and max tolerances of the vertices.
9291 # Example: see GEOM_TestMeasures.py
9292 aTuple = self.MeasuOp.GetTolerance(theShape)
9293 RaiseIfFailed("GetTolerance", self.MeasuOp)
9296 ## Obtain description of the given shape (number of sub-shapes of each type)
9297 # @param theShape Shape to be described.
9298 # @return Description of the given shape.
9300 # @ref tui_measurement_tools_page "Example"
9301 def WhatIs(self,theShape):
9303 Obtain description of the given shape (number of sub-shapes of each type)
9306 theShape Shape to be described.
9309 Description of the given shape.
9311 # Example: see GEOM_TestMeasures.py
9312 aDescr = self.MeasuOp.WhatIs(theShape)
9313 RaiseIfFailed("WhatIs", self.MeasuOp)
9316 ## Obtain quantity of shapes of the given type in \a theShape.
9317 # If \a theShape is of type \a theType, it is also counted.
9318 # @param theShape Shape to be described.
9319 # @param theType the given ShapeType().
9320 # @return Quantity of shapes of type \a theType in \a theShape.
9322 # @ref tui_measurement_tools_page "Example"
9323 def NbShapes (self, theShape, theType):
9325 Obtain quantity of shapes of the given type in theShape.
9326 If theShape is of type theType, it is also counted.
9329 theShape Shape to be described.
9330 theType the given geompy.ShapeType
9333 Quantity of shapes of type theType in theShape.
9335 # Example: see GEOM_TestMeasures.py
9336 listSh = self.SubShapeAllIDs(theShape, theType)
9338 t = EnumToLong(theShape.GetShapeType())
9339 theType = EnumToLong(theType)
9345 ## Obtain quantity of shapes of each type in \a theShape.
9346 # The \a theShape is also counted.
9347 # @param theShape Shape to be described.
9348 # @return Dictionary of ShapeType() with bound quantities of shapes.
9350 # @ref tui_measurement_tools_page "Example"
9351 def ShapeInfo (self, theShape):
9353 Obtain quantity of shapes of each type in theShape.
9354 The theShape is also counted.
9357 theShape Shape to be described.
9360 Dictionary of geompy.ShapeType with bound quantities of shapes.
9362 # Example: see GEOM_TestMeasures.py
9364 for typeSh in ShapeType:
9365 if typeSh in ( "AUTO", "SHAPE" ): continue
9366 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
9368 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
9375 ## Get a point, situated at the centre of mass of theShape.
9376 # @param theShape Shape to define centre of mass of.
9377 # @param theName Object name; when specified, this parameter is used
9378 # for result publication in the study. Otherwise, if automatic
9379 # publication is switched on, default value is used for result name.
9381 # @return New GEOM.GEOM_Object, containing the created point.
9383 # @ref tui_measurement_tools_page "Example"
9384 def MakeCDG(self, theShape, theName=None):
9386 Get a point, situated at the centre of mass of theShape.
9389 theShape Shape to define centre of mass of.
9390 theName Object name; when specified, this parameter is used
9391 for result publication in the study. Otherwise, if automatic
9392 publication is switched on, default value is used for result name.
9395 New GEOM.GEOM_Object, containing the created point.
9397 # Example: see GEOM_TestMeasures.py
9398 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9399 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9400 self._autoPublish(anObj, theName, "centerOfMass")
9403 ## Get a vertex sub-shape by index depended with orientation.
9404 # @param theShape Shape to find sub-shape.
9405 # @param theIndex Index to find vertex by this index (starting from zero)
9406 # @param theName Object name; when specified, this parameter is used
9407 # for result publication in the study. Otherwise, if automatic
9408 # publication is switched on, default value is used for result name.
9410 # @return New GEOM.GEOM_Object, containing the created vertex.
9412 # @ref tui_measurement_tools_page "Example"
9413 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9415 Get a vertex sub-shape by index depended with orientation.
9418 theShape Shape to find sub-shape.
9419 theIndex Index to find vertex by this index (starting from zero)
9420 theName Object name; when specified, this parameter is used
9421 for result publication in the study. Otherwise, if automatic
9422 publication is switched on, default value is used for result name.
9425 New GEOM.GEOM_Object, containing the created vertex.
9427 # Example: see GEOM_TestMeasures.py
9428 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9429 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9430 self._autoPublish(anObj, theName, "vertex")
9433 ## Get the first vertex of wire/edge depended orientation.
9434 # @param theShape Shape to find first vertex.
9435 # @param theName Object name; when specified, this parameter is used
9436 # for result publication in the study. Otherwise, if automatic
9437 # publication is switched on, default value is used for result name.
9439 # @return New GEOM.GEOM_Object, containing the created vertex.
9441 # @ref tui_measurement_tools_page "Example"
9442 def GetFirstVertex(self, theShape, theName=None):
9444 Get the first vertex of wire/edge depended orientation.
9447 theShape Shape to find first vertex.
9448 theName Object name; when specified, this parameter is used
9449 for result publication in the study. Otherwise, if automatic
9450 publication is switched on, default value is used for result name.
9453 New GEOM.GEOM_Object, containing the created vertex.
9455 # Example: see GEOM_TestMeasures.py
9456 # note: auto-publishing is done in self.GetVertexByIndex()
9457 anObj = self.GetVertexByIndex(theShape, 0, theName)
9458 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9461 ## Get the last vertex of wire/edge depended orientation.
9462 # @param theShape Shape to find last vertex.
9463 # @param theName Object name; when specified, this parameter is used
9464 # for result publication in the study. Otherwise, if automatic
9465 # publication is switched on, default value is used for result name.
9467 # @return New GEOM.GEOM_Object, containing the created vertex.
9469 # @ref tui_measurement_tools_page "Example"
9470 def GetLastVertex(self, theShape, theName=None):
9472 Get the last vertex of wire/edge depended orientation.
9475 theShape Shape to find last vertex.
9476 theName Object name; when specified, this parameter is used
9477 for result publication in the study. Otherwise, if automatic
9478 publication is switched on, default value is used for result name.
9481 New GEOM.GEOM_Object, containing the created vertex.
9483 # Example: see GEOM_TestMeasures.py
9484 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
9485 # note: auto-publishing is done in self.GetVertexByIndex()
9486 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9487 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9490 ## Get a normale to the given face. If the point is not given,
9491 # the normale is calculated at the center of mass.
9492 # @param theFace Face to define normale of.
9493 # @param theOptionalPoint Point to compute the normale at.
9494 # @param theName Object name; when specified, this parameter is used
9495 # for result publication in the study. Otherwise, if automatic
9496 # publication is switched on, default value is used for result name.
9498 # @return New GEOM.GEOM_Object, containing the created vector.
9500 # @ref swig_todo "Example"
9501 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9503 Get a normale to the given face. If the point is not given,
9504 the normale is calculated at the center of mass.
9507 theFace Face to define normale of.
9508 theOptionalPoint Point to compute the normale at.
9509 theName Object name; when specified, this parameter is used
9510 for result publication in the study. Otherwise, if automatic
9511 publication is switched on, default value is used for result name.
9514 New GEOM.GEOM_Object, containing the created vector.
9516 # Example: see GEOM_TestMeasures.py
9517 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9518 RaiseIfFailed("GetNormal", self.MeasuOp)
9519 self._autoPublish(anObj, theName, "normal")
9522 ## Check a topology of the given shape.
9523 # @param theShape Shape to check validity of.
9524 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9525 # if TRUE, the shape's geometry will be checked also.
9526 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9527 # of problem is printed.
9528 # if TRUE and if theShape is invalid, the description
9529 # of problem is also returned.
9530 # @return TRUE, if the shape "seems to be valid".
9532 # @ref tui_measurement_tools_page "Example"
9533 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9535 Check a topology of the given shape.
9538 theShape Shape to check validity of.
9539 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9540 if TRUE, the shape's geometry will be checked also.
9541 theReturnStatus If FALSE and if theShape is invalid, a description
9542 of problem is printed.
9543 if TRUE and if theShape is invalid, the description
9544 of problem is returned.
9547 TRUE, if the shape "seems to be valid".
9548 If theShape is invalid, prints a description of problem.
9549 This description can also be returned.
9551 # Example: see GEOM_TestMeasures.py
9553 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9554 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9556 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9557 RaiseIfFailed("CheckShape", self.MeasuOp)
9559 if theReturnStatus == 0:
9561 if theReturnStatus == 1:
9562 return (IsValid, Status)
9565 ## Detect self-intersections in the given shape.
9566 # @param theShape Shape to check.
9567 # @return TRUE, if the shape contains no self-intersections.
9569 # @ref tui_measurement_tools_page "Example"
9570 def CheckSelfIntersections(self, theShape):
9572 Detect self-intersections in the given shape.
9575 theShape Shape to check.
9578 TRUE, if the shape contains no self-intersections.
9580 # Example: see GEOM_TestMeasures.py
9581 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9582 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9585 ## Get position (LCS) of theShape.
9587 # Origin of the LCS is situated at the shape's center of mass.
9588 # Axes of the LCS are obtained from shape's location or,
9589 # if the shape is a planar face, from position of its plane.
9591 # @param theShape Shape to calculate position of.
9592 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9593 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9594 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9595 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9597 # @ref swig_todo "Example"
9598 def GetPosition(self,theShape):
9600 Get position (LCS) of theShape.
9601 Origin of the LCS is situated at the shape's center of mass.
9602 Axes of the LCS are obtained from shape's location or,
9603 if the shape is a planar face, from position of its plane.
9606 theShape Shape to calculate position of.
9609 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9610 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9611 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9612 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9614 # Example: see GEOM_TestMeasures.py
9615 aTuple = self.MeasuOp.GetPosition(theShape)
9616 RaiseIfFailed("GetPosition", self.MeasuOp)
9619 ## Get kind of theShape.
9621 # @param theShape Shape to get a kind of.
9622 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9623 # and a list of parameters, describing the shape.
9624 # @note Concrete meaning of each value, returned via \a theIntegers
9625 # or \a theDoubles list depends on the kind() of the shape.
9627 # @ref swig_todo "Example"
9628 def KindOfShape(self,theShape):
9630 Get kind of theShape.
9633 theShape Shape to get a kind of.
9636 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9637 and a list of parameters, describing the shape.
9639 Concrete meaning of each value, returned via theIntegers
9640 or theDoubles list depends on the geompy.kind of the shape
9642 # Example: see GEOM_TestMeasures.py
9643 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9644 RaiseIfFailed("KindOfShape", self.MeasuOp)
9646 aKind = aRoughTuple[0]
9647 anInts = aRoughTuple[1]
9648 aDbls = aRoughTuple[2]
9650 # Now there is no exception from this rule:
9651 aKindTuple = [aKind] + aDbls + anInts
9653 # If they are we will regroup parameters for such kind of shape.
9655 #if aKind == kind.SOME_KIND:
9656 # # SOME_KIND int int double int double double
9657 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9664 ## @addtogroup l2_import_export
9667 ## Import a shape from the BREP or IGES or STEP file
9668 # (depends on given format) with given name.
9669 # @param theFileName The file, containing the shape.
9670 # @param theFormatName Specify format for the file reading.
9671 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9672 # If format 'IGES_SCALE' is used instead of 'IGES' or
9673 # format 'STEP_SCALE' is used instead of 'STEP',
9674 # length unit will be set to 'meter' and result model will be scaled.
9675 # @param theName Object name; when specified, this parameter is used
9676 # for result publication in the study. Otherwise, if automatic
9677 # publication is switched on, default value is used for result name.
9679 # @return New GEOM.GEOM_Object, containing the imported shape.
9681 # @ref swig_Import_Export "Example"
9682 def ImportFile(self, theFileName, theFormatName, theName=None):
9684 Import a shape from the BREP or IGES or STEP file
9685 (depends on given format) with given name.
9688 theFileName The file, containing the shape.
9689 theFormatName Specify format for the file reading.
9690 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9691 If format 'IGES_SCALE' is used instead of 'IGES' or
9692 format 'STEP_SCALE' is used instead of 'STEP',
9693 length unit will be set to 'meter' and result model will be scaled.
9694 theName Object name; when specified, this parameter is used
9695 for result publication in the study. Otherwise, if automatic
9696 publication is switched on, default value is used for result name.
9699 New GEOM.GEOM_Object, containing the imported shape.
9701 # Example: see GEOM_TestOthers.py
9702 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9703 RaiseIfFailed("ImportFile", self.InsertOp)
9704 self._autoPublish(anObj, theName, "imported")
9707 ## Deprecated analog of ImportFile()
9708 def Import(self, theFileName, theFormatName, theName=None):
9710 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9712 print "WARNING: Function Import is deprecated, use ImportFile instead"
9713 # note: auto-publishing is done in self.ImportFile()
9714 return self.ImportFile(theFileName, theFormatName, theName)
9716 ## Shortcut to ImportFile() for BREP format.
9717 # Import a shape from the BREP file with given name.
9718 # @param theFileName The file, containing the shape.
9719 # @param 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.
9723 # @return New GEOM.GEOM_Object, containing the imported shape.
9725 # @ref swig_Import_Export "Example"
9726 def ImportBREP(self, theFileName, theName=None):
9728 geompy.ImportFile(...) function for BREP format
9729 Import a shape from the BREP file with given name.
9732 theFileName The file, containing the shape.
9733 theName Object name; when specified, this parameter is used
9734 for result publication in the study. Otherwise, if automatic
9735 publication is switched on, default value is used for result name.
9738 New GEOM.GEOM_Object, containing the imported shape.
9740 # Example: see GEOM_TestOthers.py
9741 # note: auto-publishing is done in self.ImportFile()
9742 return self.ImportFile(theFileName, "BREP", theName)
9744 ## Shortcut to ImportFile() for IGES format
9745 # Import a shape from the IGES file with given name.
9746 # @param theFileName The file, containing the shape.
9747 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9748 # and result model will be scaled, if its units are not meters.
9749 # If False (default), file length units will be taken into account.
9750 # @param theName Object name; when specified, this parameter is used
9751 # for result publication in the study. Otherwise, if automatic
9752 # publication is switched on, default value is used for result name.
9754 # @return New GEOM.GEOM_Object, containing the imported shape.
9756 # @ref swig_Import_Export "Example"
9757 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
9759 geompy.ImportFile(...) function for IGES format
9762 theFileName The file, containing the shape.
9763 ignoreUnits If True, file length units will be ignored (set to 'meter')
9764 and result model will be scaled, if its units are not meters.
9765 If False (default), file length units will be taken into account.
9766 theName Object name; when specified, this parameter is used
9767 for result publication in the study. Otherwise, if automatic
9768 publication is switched on, default value is used for result name.
9771 New GEOM.GEOM_Object, containing the imported shape.
9773 # Example: see GEOM_TestOthers.py
9774 # note: auto-publishing is done in self.ImportFile()
9776 return self.ImportFile(theFileName, "IGES_SCALE", theName)
9777 return self.ImportFile(theFileName, "IGES", theName)
9779 ## Return length unit from given IGES file
9780 # @param theFileName The file, containing the shape.
9781 # @return String, containing the units name.
9783 # @ref swig_Import_Export "Example"
9784 def GetIGESUnit(self, theFileName):
9786 Return length units from given IGES file
9789 theFileName The file, containing the shape.
9792 String, containing the units name.
9794 # Example: see GEOM_TestOthers.py
9795 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
9798 ## Shortcut to ImportFile() for STEP format
9799 # Import a shape from the STEP file with given name.
9800 # @param theFileName The file, containing the shape.
9801 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9802 # and result model will be scaled, if its units are not meters.
9803 # If False (default), file length units will be taken into account.
9804 # @param theName Object name; when specified, this parameter is used
9805 # for result publication in the study. Otherwise, if automatic
9806 # publication is switched on, default value is used for result name.
9808 # @return New GEOM.GEOM_Object, containing the imported shape.
9810 # @ref swig_Import_Export "Example"
9811 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
9813 geompy.ImportFile(...) function for STEP format
9816 theFileName The file, containing the shape.
9817 ignoreUnits If True, file length units will be ignored (set to 'meter')
9818 and result model will be scaled, if its units are not meters.
9819 If False (default), file length units will be taken into account.
9820 theName Object name; when specified, this parameter is used
9821 for result publication in the study. Otherwise, if automatic
9822 publication is switched on, default value is used for result name.
9825 New GEOM.GEOM_Object, containing the imported shape.
9827 # Example: see GEOM_TestOthers.py
9828 # note: auto-publishing is done in self.ImportFile()
9830 return self.ImportFile(theFileName, "STEP_SCALE", theName)
9831 return self.ImportFile(theFileName, "STEP", theName)
9833 ## Return length unit from given IGES or STEP file
9834 # @param theFileName The file, containing the shape.
9835 # @return String, containing the units name.
9837 # @ref swig_Import_Export "Example"
9838 def GetSTEPUnit(self, theFileName):
9840 Return length units from given STEP file
9843 theFileName The file, containing the shape.
9846 String, containing the units name.
9848 # Example: see GEOM_TestOthers.py
9849 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
9852 ## Read a shape from the binary stream, containing its bounding representation (BRep).
9853 # @note This method will not be dumped to the python script by DumpStudy functionality.
9854 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
9855 # @param theStream The BRep binary stream.
9856 # @param theName Object name; when specified, this parameter is used
9857 # for result publication in the study. Otherwise, if automatic
9858 # publication is switched on, default value is used for result name.
9860 # @return New GEOM_Object, containing the shape, read from theStream.
9862 # @ref swig_Import_Export "Example"
9863 def RestoreShape (self, theStream, theName=None):
9865 Read a shape from the binary stream, containing its bounding representation (BRep).
9868 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
9871 theStream The BRep binary stream.
9872 theName Object name; when specified, this parameter is used
9873 for result publication in the study. Otherwise, if automatic
9874 publication is switched on, default value is used for result name.
9877 New GEOM_Object, containing the shape, read from theStream.
9879 # Example: see GEOM_TestOthers.py
9880 anObj = self.InsertOp.RestoreShape(theStream)
9881 RaiseIfFailed("RestoreShape", self.InsertOp)
9882 self._autoPublish(anObj, theName, "restored")
9885 ## Export the given shape into a file with given name.
9886 # @param theObject Shape to be stored in the file.
9887 # @param theFileName Name of the file to store the given shape in.
9888 # @param theFormatName Specify format for the shape storage.
9889 # Available formats can be obtained with
9890 # geompy.InsertOp.ExportTranslators()[0] method.
9892 # @ref swig_Import_Export "Example"
9893 def Export(self, theObject, theFileName, theFormatName):
9895 Export the given shape into a file with given name.
9898 theObject Shape to be stored in the file.
9899 theFileName Name of the file to store the given shape in.
9900 theFormatName Specify format for the shape storage.
9901 Available formats can be obtained with
9902 geompy.InsertOp.ExportTranslators()[0] method.
9904 # Example: see GEOM_TestOthers.py
9905 self.InsertOp.Export(theObject, theFileName, theFormatName)
9906 if self.InsertOp.IsDone() == 0:
9907 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
9911 ## Shortcut to Export() for BREP format
9913 # @ref swig_Import_Export "Example"
9914 def ExportBREP(self,theObject, theFileName):
9916 geompy.Export(...) function for BREP format
9918 # Example: see GEOM_TestOthers.py
9919 return self.Export(theObject, theFileName, "BREP")
9921 ## Shortcut to Export() for IGES format
9923 # @ref swig_Import_Export "Example"
9924 def ExportIGES(self,theObject, theFileName):
9926 geompy.Export(...) function for IGES format
9928 # Example: see GEOM_TestOthers.py
9929 return self.Export(theObject, theFileName, "IGES")
9931 ## Shortcut to Export() for STEP format
9933 # @ref swig_Import_Export "Example"
9934 def ExportSTEP(self,theObject, theFileName):
9936 geompy.Export(...) function for STEP format
9938 # Example: see GEOM_TestOthers.py
9939 return self.Export(theObject, theFileName, "STEP")
9941 # end of l2_import_export
9944 ## @addtogroup l3_blocks
9947 ## Create a quadrangle face from four edges. Order of Edges is not
9948 # important. It is not necessary that edges share the same vertex.
9949 # @param E1,E2,E3,E4 Edges for the face bound.
9950 # @param theName Object name; when specified, this parameter is used
9951 # for result publication in the study. Otherwise, if automatic
9952 # publication is switched on, default value is used for result name.
9954 # @return New GEOM.GEOM_Object, containing the created face.
9956 # @ref tui_building_by_blocks_page "Example"
9957 def MakeQuad(self, E1, E2, E3, E4, theName=None):
9959 Create a quadrangle face from four edges. Order of Edges is not
9960 important. It is not necessary that edges share the same vertex.
9963 E1,E2,E3,E4 Edges for the face bound.
9964 theName Object name; when specified, this parameter is used
9965 for result publication in the study. Otherwise, if automatic
9966 publication is switched on, default value is used for result name.
9969 New GEOM.GEOM_Object, containing the created face.
9972 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
9974 # Example: see GEOM_Spanner.py
9975 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
9976 RaiseIfFailed("MakeQuad", self.BlocksOp)
9977 self._autoPublish(anObj, theName, "quad")
9980 ## Create a quadrangle face on two edges.
9981 # The missing edges will be built by creating the shortest ones.
9982 # @param E1,E2 Two opposite edges for the face.
9983 # @param theName Object name; when specified, this parameter is used
9984 # for result publication in the study. Otherwise, if automatic
9985 # publication is switched on, default value is used for result name.
9987 # @return New GEOM.GEOM_Object, containing the created face.
9989 # @ref tui_building_by_blocks_page "Example"
9990 def MakeQuad2Edges(self, E1, E2, theName=None):
9992 Create a quadrangle face on two edges.
9993 The missing edges will be built by creating the shortest ones.
9996 E1,E2 Two opposite edges for the face.
9997 theName Object name; when specified, this parameter is used
9998 for result publication in the study. Otherwise, if automatic
9999 publication is switched on, default value is used for result name.
10002 New GEOM.GEOM_Object, containing the created face.
10006 p1 = geompy.MakeVertex( 0., 0., 0.)
10007 p2 = geompy.MakeVertex(150., 30., 0.)
10008 p3 = geompy.MakeVertex( 0., 120., 50.)
10009 p4 = geompy.MakeVertex( 0., 40., 70.)
10011 edge1 = geompy.MakeEdge(p1, p2)
10012 edge2 = geompy.MakeEdge(p3, p4)
10013 # create a quadrangle face from two edges
10014 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10016 # Example: see GEOM_Spanner.py
10017 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10018 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10019 self._autoPublish(anObj, theName, "quad")
10022 ## Create a quadrangle face with specified corners.
10023 # The missing edges will be built by creating the shortest ones.
10024 # @param V1,V2,V3,V4 Corner vertices for the face.
10025 # @param theName Object name; when specified, this parameter is used
10026 # for result publication in the study. Otherwise, if automatic
10027 # publication is switched on, default value is used for result name.
10029 # @return New GEOM.GEOM_Object, containing the created face.
10031 # @ref tui_building_by_blocks_page "Example 1"
10032 # \n @ref swig_MakeQuad4Vertices "Example 2"
10033 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10035 Create a quadrangle face with specified corners.
10036 The missing edges will be built by creating the shortest ones.
10039 V1,V2,V3,V4 Corner vertices for the face.
10040 theName Object name; when specified, this parameter is used
10041 for result publication in the study. Otherwise, if automatic
10042 publication is switched on, default value is used for result name.
10045 New GEOM.GEOM_Object, containing the created face.
10049 p1 = geompy.MakeVertex( 0., 0., 0.)
10050 p2 = geompy.MakeVertex(150., 30., 0.)
10051 p3 = geompy.MakeVertex( 0., 120., 50.)
10052 p4 = geompy.MakeVertex( 0., 40., 70.)
10053 # create a quadrangle from four points in its corners
10054 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10056 # Example: see GEOM_Spanner.py
10057 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10058 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10059 self._autoPublish(anObj, theName, "quad")
10062 ## Create a hexahedral solid, bounded by the six given faces. Order of
10063 # faces is not important. It is not necessary that Faces share the same edge.
10064 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10065 # @param theName Object name; when specified, this parameter is used
10066 # for result publication in the study. Otherwise, if automatic
10067 # publication is switched on, default value is used for result name.
10069 # @return New GEOM.GEOM_Object, containing the created solid.
10071 # @ref tui_building_by_blocks_page "Example 1"
10072 # \n @ref swig_MakeHexa "Example 2"
10073 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10075 Create a hexahedral solid, bounded by the six given faces. Order of
10076 faces is not important. It is not necessary that Faces share the same edge.
10079 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10080 theName Object name; when specified, this parameter is used
10081 for result publication in the study. Otherwise, if automatic
10082 publication is switched on, default value is used for result name.
10085 New GEOM.GEOM_Object, containing the created solid.
10088 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10090 # Example: see GEOM_Spanner.py
10091 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10092 RaiseIfFailed("MakeHexa", self.BlocksOp)
10093 self._autoPublish(anObj, theName, "hexa")
10096 ## Create a hexahedral solid between two given faces.
10097 # The missing faces will be built by creating the smallest ones.
10098 # @param F1,F2 Two opposite faces for the hexahedral solid.
10099 # @param theName Object name; when specified, this parameter is used
10100 # for result publication in the study. Otherwise, if automatic
10101 # publication is switched on, default value is used for result name.
10103 # @return New GEOM.GEOM_Object, containing the created solid.
10105 # @ref tui_building_by_blocks_page "Example 1"
10106 # \n @ref swig_MakeHexa2Faces "Example 2"
10107 def MakeHexa2Faces(self, F1, F2, theName=None):
10109 Create a hexahedral solid between two given faces.
10110 The missing faces will be built by creating the smallest ones.
10113 F1,F2 Two opposite faces for the hexahedral solid.
10114 theName Object name; when specified, this parameter is used
10115 for result publication in the study. Otherwise, if automatic
10116 publication is switched on, default value is used for result name.
10119 New GEOM.GEOM_Object, containing the created solid.
10122 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10124 # Example: see GEOM_Spanner.py
10125 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10126 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10127 self._autoPublish(anObj, theName, "hexa")
10133 ## @addtogroup l3_blocks_op
10136 ## Get a vertex, found in the given shape by its coordinates.
10137 # @param theShape Block or a compound of blocks.
10138 # @param theX,theY,theZ Coordinates of the sought vertex.
10139 # @param theEpsilon Maximum allowed distance between the resulting
10140 # vertex and point with the given coordinates.
10141 # @param theName Object name; when specified, this parameter is used
10142 # for result publication in the study. Otherwise, if automatic
10143 # publication is switched on, default value is used for result name.
10145 # @return New GEOM.GEOM_Object, containing the found vertex.
10147 # @ref swig_GetPoint "Example"
10148 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10150 Get a vertex, found in the given shape by its coordinates.
10153 theShape Block or a compound of blocks.
10154 theX,theY,theZ Coordinates of the sought vertex.
10155 theEpsilon Maximum allowed distance between the resulting
10156 vertex and point with the given coordinates.
10157 theName Object name; when specified, this parameter is used
10158 for result publication in the study. Otherwise, if automatic
10159 publication is switched on, default value is used for result name.
10162 New GEOM.GEOM_Object, containing the found vertex.
10165 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10167 # Example: see GEOM_TestOthers.py
10168 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10169 RaiseIfFailed("GetPoint", self.BlocksOp)
10170 self._autoPublish(anObj, theName, "vertex")
10173 ## Find a vertex of the given shape, which has minimal distance to the given point.
10174 # @param theShape Any shape.
10175 # @param thePoint Point, close to the desired vertex.
10176 # @param theName Object name; when specified, this parameter is used
10177 # for result publication in the study. Otherwise, if automatic
10178 # publication is switched on, default value is used for result name.
10180 # @return New GEOM.GEOM_Object, containing the found vertex.
10182 # @ref swig_GetVertexNearPoint "Example"
10183 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10185 Find a vertex of the given shape, which has minimal distance to the given point.
10188 theShape Any shape.
10189 thePoint Point, close to the desired vertex.
10190 theName Object name; when specified, this parameter is used
10191 for result publication in the study. Otherwise, if automatic
10192 publication is switched on, default value is used for result name.
10195 New GEOM.GEOM_Object, containing the found vertex.
10198 pmidle = geompy.MakeVertex(50, 0, 50)
10199 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10201 # Example: see GEOM_TestOthers.py
10202 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10203 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10204 self._autoPublish(anObj, theName, "vertex")
10207 ## Get an edge, found in the given shape by two given vertices.
10208 # @param theShape Block or a compound of blocks.
10209 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
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 # @return New GEOM.GEOM_Object, containing the found edge.
10216 # @ref swig_GetEdge "Example"
10217 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10219 Get an edge, found in the given shape by two given vertices.
10222 theShape Block or a compound of blocks.
10223 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10224 theName Object name; when specified, this parameter is used
10225 for result publication in the study. Otherwise, if automatic
10226 publication is switched on, default value is used for result name.
10229 New GEOM.GEOM_Object, containing the found edge.
10231 # Example: see GEOM_Spanner.py
10232 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10233 RaiseIfFailed("GetEdge", self.BlocksOp)
10234 self._autoPublish(anObj, theName, "edge")
10237 ## Find an edge of the given shape, which has minimal distance to the given point.
10238 # @param theShape Block or a compound of blocks.
10239 # @param thePoint Point, close to the desired edge.
10240 # @param theName Object name; when specified, this parameter is used
10241 # for result publication in the study. Otherwise, if automatic
10242 # publication is switched on, default value is used for result name.
10244 # @return New GEOM.GEOM_Object, containing the found edge.
10246 # @ref swig_GetEdgeNearPoint "Example"
10247 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10249 Find an edge of the given shape, which has minimal distance to the given point.
10252 theShape Block or a compound of blocks.
10253 thePoint Point, close to the desired edge.
10254 theName Object name; when specified, this parameter is used
10255 for result publication in the study. Otherwise, if automatic
10256 publication is switched on, default value is used for result name.
10259 New GEOM.GEOM_Object, containing the found edge.
10261 # Example: see GEOM_TestOthers.py
10262 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10263 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10264 self._autoPublish(anObj, theName, "edge")
10267 ## Returns a face, found in the given shape by four given corner vertices.
10268 # @param theShape Block or a compound of blocks.
10269 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10270 # @param theName Object name; when specified, this parameter is used
10271 # for result publication in the study. Otherwise, if automatic
10272 # publication is switched on, default value is used for result name.
10274 # @return New GEOM.GEOM_Object, containing the found face.
10276 # @ref swig_todo "Example"
10277 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10279 Returns a face, found in the given shape by four given corner vertices.
10282 theShape Block or a compound of blocks.
10283 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10284 theName Object name; when specified, this parameter is used
10285 for result publication in the study. Otherwise, if automatic
10286 publication is switched on, default value is used for result name.
10289 New GEOM.GEOM_Object, containing the found face.
10291 # Example: see GEOM_Spanner.py
10292 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10293 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10294 self._autoPublish(anObj, theName, "face")
10297 ## Get a face of block, found in the given shape by two given edges.
10298 # @param theShape Block or a compound of blocks.
10299 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10300 # @param theName Object name; when specified, this parameter is used
10301 # for result publication in the study. Otherwise, if automatic
10302 # publication is switched on, default value is used for result name.
10304 # @return New GEOM.GEOM_Object, containing the found face.
10306 # @ref swig_todo "Example"
10307 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10309 Get a face of block, found in the given shape by two given edges.
10312 theShape Block or a compound of blocks.
10313 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10314 theName Object name; when specified, this parameter is used
10315 for result publication in the study. Otherwise, if automatic
10316 publication is switched on, default value is used for result name.
10319 New GEOM.GEOM_Object, containing the found face.
10321 # Example: see GEOM_Spanner.py
10322 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10323 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10324 self._autoPublish(anObj, theName, "face")
10327 ## Find a face, opposite to the given one in the given block.
10328 # @param theBlock Must be a hexahedral solid.
10329 # @param theFace Face of \a theBlock, opposite to the desired face.
10330 # @param theName Object name; when specified, this parameter is used
10331 # for result publication in the study. Otherwise, if automatic
10332 # publication is switched on, default value is used for result name.
10334 # @return New GEOM.GEOM_Object, containing the found face.
10336 # @ref swig_GetOppositeFace "Example"
10337 def GetOppositeFace(self, theBlock, theFace, theName=None):
10339 Find a face, opposite to the given one in the given block.
10342 theBlock Must be a hexahedral solid.
10343 theFace Face of theBlock, opposite to the desired face.
10344 theName Object name; when specified, this parameter is used
10345 for result publication in the study. Otherwise, if automatic
10346 publication is switched on, default value is used for result name.
10349 New GEOM.GEOM_Object, containing the found face.
10351 # Example: see GEOM_Spanner.py
10352 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10353 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10354 self._autoPublish(anObj, theName, "face")
10357 ## Find a face of the given shape, which has minimal distance to the given point.
10358 # @param theShape Block or a compound of blocks.
10359 # @param thePoint Point, close to the desired face.
10360 # @param theName Object name; when specified, this parameter is used
10361 # for result publication in the study. Otherwise, if automatic
10362 # publication is switched on, default value is used for result name.
10364 # @return New GEOM.GEOM_Object, containing the found face.
10366 # @ref swig_GetFaceNearPoint "Example"
10367 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10369 Find a face of the given shape, which has minimal distance to the given point.
10372 theShape Block or a compound of blocks.
10373 thePoint Point, close to the desired face.
10374 theName Object name; when specified, this parameter is used
10375 for result publication in the study. Otherwise, if automatic
10376 publication is switched on, default value is used for result name.
10379 New GEOM.GEOM_Object, containing the found face.
10381 # Example: see GEOM_Spanner.py
10382 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10383 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10384 self._autoPublish(anObj, theName, "face")
10387 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10388 # @param theBlock Block or a compound of blocks.
10389 # @param theVector Vector, close to the normale of the desired face.
10390 # @param theName Object name; when specified, this parameter is used
10391 # for result publication in the study. Otherwise, if automatic
10392 # publication is switched on, default value is used for result name.
10394 # @return New GEOM.GEOM_Object, containing the found face.
10396 # @ref swig_todo "Example"
10397 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10399 Find a face of block, whose outside normale has minimal angle with the given vector.
10402 theBlock Block or a compound of blocks.
10403 theVector Vector, close to the normale of the desired face.
10404 theName Object name; when specified, this parameter is used
10405 for result publication in the study. Otherwise, if automatic
10406 publication is switched on, default value is used for result name.
10409 New GEOM.GEOM_Object, containing the found face.
10411 # Example: see GEOM_Spanner.py
10412 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10413 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10414 self._autoPublish(anObj, theName, "face")
10417 ## Find all sub-shapes of type \a theShapeType of the given shape,
10418 # which have minimal distance to the given point.
10419 # @param theShape Any shape.
10420 # @param thePoint Point, close to the desired shape.
10421 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10422 # @param theTolerance The tolerance for distances comparison. All shapes
10423 # with distances to the given point in interval
10424 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10425 # @param theName Object name; when specified, this parameter is used
10426 # for result publication in the study. Otherwise, if automatic
10427 # publication is switched on, default value is used for result name.
10429 # @return New GEOM_Object, containing a group of all found shapes.
10431 # @ref swig_GetShapesNearPoint "Example"
10432 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10434 Find all sub-shapes of type theShapeType of the given shape,
10435 which have minimal distance to the given point.
10438 theShape Any shape.
10439 thePoint Point, close to the desired shape.
10440 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10441 theTolerance The tolerance for distances comparison. All shapes
10442 with distances to the given point in interval
10443 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10444 theName Object name; when specified, this parameter is used
10445 for result publication in the study. Otherwise, if automatic
10446 publication is switched on, default value is used for result name.
10449 New GEOM_Object, containing a group of all found shapes.
10451 # Example: see GEOM_TestOthers.py
10452 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10453 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10454 self._autoPublish(anObj, theName, "group")
10457 # end of l3_blocks_op
10460 ## @addtogroup l4_blocks_measure
10463 ## Check, if the compound of blocks is given.
10464 # To be considered as a compound of blocks, the
10465 # given shape must satisfy the following conditions:
10466 # - Each element of the compound should be a Block (6 faces and 12 edges).
10467 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10468 # - The compound should be connexe.
10469 # - The glue between two quadrangle faces should be applied.
10470 # @param theCompound The compound to check.
10471 # @return TRUE, if the given shape is a compound of blocks.
10472 # If theCompound is not valid, prints all discovered errors.
10474 # @ref tui_measurement_tools_page "Example 1"
10475 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10476 def CheckCompoundOfBlocks(self,theCompound):
10478 Check, if the compound of blocks is given.
10479 To be considered as a compound of blocks, the
10480 given shape must satisfy the following conditions:
10481 - Each element of the compound should be a Block (6 faces and 12 edges).
10482 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10483 - The compound should be connexe.
10484 - The glue between two quadrangle faces should be applied.
10487 theCompound The compound to check.
10490 TRUE, if the given shape is a compound of blocks.
10491 If theCompound is not valid, prints all discovered errors.
10493 # Example: see GEOM_Spanner.py
10494 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10495 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10497 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10501 ## Retrieve all non blocks solids and faces from \a theShape.
10502 # @param theShape The shape to explore.
10503 # @param theName Object name; when specified, this parameter is used
10504 # for result publication in the study. Otherwise, if automatic
10505 # publication is switched on, default value is used for result name.
10507 # @return A tuple of two GEOM_Objects. The first object is a group of all
10508 # non block solids (= not 6 faces, or with 6 faces, but with the
10509 # presence of non-quadrangular faces). The second object is a
10510 # group of all non quadrangular faces.
10512 # @ref tui_measurement_tools_page "Example 1"
10513 # \n @ref swig_GetNonBlocks "Example 2"
10514 def GetNonBlocks (self, theShape, theName=None):
10516 Retrieve all non blocks solids and faces from theShape.
10519 theShape The shape to explore.
10520 theName Object name; when specified, this parameter is used
10521 for result publication in the study. Otherwise, if automatic
10522 publication is switched on, default value is used for result name.
10525 A tuple of two GEOM_Objects. The first object is a group of all
10526 non block solids (= not 6 faces, or with 6 faces, but with the
10527 presence of non-quadrangular faces). The second object is a
10528 group of all non quadrangular faces.
10531 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10533 # Example: see GEOM_Spanner.py
10534 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10535 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10536 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10539 ## Remove all seam and degenerated edges from \a theShape.
10540 # Unite faces and edges, sharing one surface. It means that
10541 # this faces must have references to one C++ surface object (handle).
10542 # @param theShape The compound or single solid to remove irregular edges from.
10543 # @param doUnionFaces If True, then unite faces. If False (the default value),
10544 # do not unite faces.
10545 # @param theName Object name; when specified, this parameter is used
10546 # for result publication in the study. Otherwise, if automatic
10547 # publication is switched on, default value is used for result name.
10549 # @return Improved shape.
10551 # @ref swig_RemoveExtraEdges "Example"
10552 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10554 Remove all seam and degenerated edges from theShape.
10555 Unite faces and edges, sharing one surface. It means that
10556 this faces must have references to one C++ surface object (handle).
10559 theShape The compound or single solid to remove irregular edges from.
10560 doUnionFaces If True, then unite faces. If False (the default value),
10561 do not unite faces.
10562 theName Object name; when specified, this parameter is used
10563 for result publication in the study. Otherwise, if automatic
10564 publication is switched on, default value is used for result name.
10569 # Example: see GEOM_TestOthers.py
10570 nbFacesOptimum = -1 # -1 means do not unite faces
10571 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10572 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10573 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10574 self._autoPublish(anObj, theName, "removeExtraEdges")
10577 ## Check, if the given shape is a blocks compound.
10578 # Fix all detected errors.
10579 # \note Single block can be also fixed by this method.
10580 # @param theShape The compound to check and improve.
10581 # @param theName Object name; when specified, this parameter is used
10582 # for result publication in the study. Otherwise, if automatic
10583 # publication is switched on, default value is used for result name.
10585 # @return Improved compound.
10587 # @ref swig_CheckAndImprove "Example"
10588 def CheckAndImprove(self, theShape, theName=None):
10590 Check, if the given shape is a blocks compound.
10591 Fix all detected errors.
10594 Single block can be also fixed by this method.
10597 theShape The compound to check and improve.
10598 theName Object name; when specified, this parameter is used
10599 for result publication in the study. Otherwise, if automatic
10600 publication is switched on, default value is used for result name.
10605 # Example: see GEOM_TestOthers.py
10606 anObj = self.BlocksOp.CheckAndImprove(theShape)
10607 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10608 self._autoPublish(anObj, theName, "improved")
10611 # end of l4_blocks_measure
10614 ## @addtogroup l3_blocks_op
10617 ## Get all the blocks, contained in the given compound.
10618 # @param theCompound The compound to explode.
10619 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10620 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10621 # @param theName Object name; when specified, this parameter is used
10622 # for result publication in the study. Otherwise, if automatic
10623 # publication is switched on, default value is used for result name.
10625 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10627 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10629 # @ref tui_explode_on_blocks "Example 1"
10630 # \n @ref swig_MakeBlockExplode "Example 2"
10631 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10633 Get all the blocks, contained in the given compound.
10636 theCompound The compound to explode.
10637 theMinNbFaces If solid has lower number of faces, it is not a block.
10638 theMaxNbFaces If solid has higher number of faces, it is not a block.
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 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10647 List of GEOM.GEOM_Object, containing the retrieved blocks.
10649 # Example: see GEOM_TestOthers.py
10650 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10651 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10652 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10653 for anObj in aList:
10654 anObj.SetParameters(Parameters)
10656 self._autoPublish(aList, theName, "block")
10659 ## Find block, containing the given point inside its volume or on boundary.
10660 # @param theCompound Compound, to find block in.
10661 # @param thePoint Point, close to the desired block. If the point lays on
10662 # boundary between some blocks, we return block with nearest center.
10663 # @param theName Object name; when specified, this parameter is used
10664 # for result publication in the study. Otherwise, if automatic
10665 # publication is switched on, default value is used for result name.
10667 # @return New GEOM.GEOM_Object, containing the found block.
10669 # @ref swig_todo "Example"
10670 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10672 Find block, containing the given point inside its volume or on boundary.
10675 theCompound Compound, to find block in.
10676 thePoint Point, close to the desired block. If the point lays on
10677 boundary between some blocks, we return block with nearest center.
10678 theName Object name; when specified, this parameter is used
10679 for result publication in the study. Otherwise, if automatic
10680 publication is switched on, default value is used for result name.
10683 New GEOM.GEOM_Object, containing the found block.
10685 # Example: see GEOM_Spanner.py
10686 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10687 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10688 self._autoPublish(anObj, theName, "block")
10691 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10692 # @param theCompound Compound, to find block in.
10693 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10694 # @param theName Object name; when specified, this parameter is used
10695 # for result publication in the study. Otherwise, if automatic
10696 # publication is switched on, default value is used for result name.
10698 # @return New GEOM.GEOM_Object, containing the found block.
10700 # @ref swig_GetBlockByParts "Example"
10701 def GetBlockByParts(self, theCompound, theParts, theName=None):
10703 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10706 theCompound Compound, to find block in.
10707 theParts List of faces and/or edges and/or vertices to be parts of the found block.
10708 theName Object name; when specified, this parameter is used
10709 for result publication in the study. Otherwise, if automatic
10710 publication is switched on, default value is used for result name.
10713 New GEOM_Object, containing the found block.
10715 # Example: see GEOM_TestOthers.py
10716 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
10717 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
10718 self._autoPublish(anObj, theName, "block")
10721 ## Return all blocks, containing all the elements, passed as the parts.
10722 # @param theCompound Compound, to find blocks in.
10723 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10724 # @param theName Object name; when specified, this parameter is used
10725 # for result publication in the study. Otherwise, if automatic
10726 # publication is switched on, default value is used for result name.
10728 # @return List of GEOM.GEOM_Object, containing the found blocks.
10730 # @ref swig_todo "Example"
10731 def GetBlocksByParts(self, theCompound, theParts, theName=None):
10733 Return all blocks, containing all the elements, passed as the parts.
10736 theCompound Compound, to find blocks in.
10737 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10738 theName Object name; when specified, this parameter is used
10739 for result publication in the study. Otherwise, if automatic
10740 publication is switched on, default value is used for result name.
10743 List of GEOM.GEOM_Object, containing the found blocks.
10745 # Example: see GEOM_Spanner.py
10746 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
10747 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
10748 self._autoPublish(aList, theName, "block")
10751 ## Multi-transformate block and glue the result.
10752 # Transformation is defined so, as to superpose direction faces.
10753 # @param Block Hexahedral solid to be multi-transformed.
10754 # @param DirFace1 ID of First direction face.
10755 # @param DirFace2 ID of Second direction face.
10756 # @param NbTimes Quantity of transformations to be done.
10757 # @param theName Object name; when specified, this parameter is used
10758 # for result publication in the study. Otherwise, if automatic
10759 # publication is switched on, default value is used for result name.
10761 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10763 # @return New GEOM.GEOM_Object, containing the result shape.
10765 # @ref tui_multi_transformation "Example"
10766 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
10768 Multi-transformate block and glue the result.
10769 Transformation is defined so, as to superpose direction faces.
10772 Block Hexahedral solid to be multi-transformed.
10773 DirFace1 ID of First direction face.
10774 DirFace2 ID of Second direction face.
10775 NbTimes Quantity of transformations to be done.
10776 theName Object name; when specified, this parameter is used
10777 for result publication in the study. Otherwise, if automatic
10778 publication is switched on, default value is used for result name.
10781 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10784 New GEOM.GEOM_Object, containing the result shape.
10786 # Example: see GEOM_Spanner.py
10787 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
10788 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
10789 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
10790 anObj.SetParameters(Parameters)
10791 self._autoPublish(anObj, theName, "transformed")
10794 ## Multi-transformate block and glue the result.
10795 # @param Block Hexahedral solid to be multi-transformed.
10796 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
10797 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
10798 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
10799 # @param theName Object name; when specified, this parameter is used
10800 # for result publication in the study. Otherwise, if automatic
10801 # publication is switched on, default value is used for result name.
10803 # @return New GEOM.GEOM_Object, containing the result shape.
10805 # @ref tui_multi_transformation "Example"
10806 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
10807 DirFace1V, DirFace2V, NbTimesV, theName=None):
10809 Multi-transformate block and glue the result.
10812 Block Hexahedral solid to be multi-transformed.
10813 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
10814 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
10815 NbTimesU,NbTimesV Quantity of transformations to be done.
10816 theName Object name; when specified, this parameter is used
10817 for result publication in the study. Otherwise, if automatic
10818 publication is switched on, default value is used for result name.
10821 New GEOM.GEOM_Object, containing the result shape.
10823 # Example: see GEOM_Spanner.py
10824 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
10825 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
10826 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
10827 DirFace1V, DirFace2V, NbTimesV)
10828 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
10829 anObj.SetParameters(Parameters)
10830 self._autoPublish(anObj, theName, "transformed")
10833 ## Build all possible propagation groups.
10834 # Propagation group is a set of all edges, opposite to one (main)
10835 # edge of this group directly or through other opposite edges.
10836 # Notion of Opposite Edge make sence only on quadrangle face.
10837 # @param theShape Shape to build propagation groups on.
10838 # @param theName Object name; when specified, this parameter is used
10839 # for result publication in the study. Otherwise, if automatic
10840 # publication is switched on, default value is used for result name.
10842 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
10844 # @ref swig_Propagate "Example"
10845 def Propagate(self, theShape, theName=None):
10847 Build all possible propagation groups.
10848 Propagation group is a set of all edges, opposite to one (main)
10849 edge of this group directly or through other opposite edges.
10850 Notion of Opposite Edge make sence only on quadrangle face.
10853 theShape Shape to build propagation groups on.
10854 theName Object name; when specified, this parameter is used
10855 for result publication in the study. Otherwise, if automatic
10856 publication is switched on, default value is used for result name.
10859 List of GEOM.GEOM_Object, each of them is a propagation group.
10861 # Example: see GEOM_TestOthers.py
10862 listChains = self.BlocksOp.Propagate(theShape)
10863 RaiseIfFailed("Propagate", self.BlocksOp)
10864 self._autoPublish(listChains, theName, "propagate")
10867 # end of l3_blocks_op
10870 ## @addtogroup l3_groups
10873 ## Creates a new group which will store sub-shapes of theMainShape
10874 # @param theMainShape is a GEOM object on which the group is selected
10875 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
10876 # @param theName Object name; when specified, this parameter is used
10877 # for result publication in the study. Otherwise, if automatic
10878 # publication is switched on, default value is used for result name.
10880 # @return a newly created GEOM group (GEOM.GEOM_Object)
10882 # @ref tui_working_with_groups_page "Example 1"
10883 # \n @ref swig_CreateGroup "Example 2"
10884 def CreateGroup(self, theMainShape, theShapeType, theName=None):
10886 Creates a new group which will store sub-shapes of theMainShape
10889 theMainShape is a GEOM object on which the group is selected
10890 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
10891 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
10892 theName Object name; when specified, this parameter is used
10893 for result publication in the study. Otherwise, if automatic
10894 publication is switched on, default value is used for result name.
10897 a newly created GEOM group
10900 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
10903 # Example: see GEOM_TestOthers.py
10904 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
10905 RaiseIfFailed("CreateGroup", self.GroupOp)
10906 self._autoPublish(anObj, theName, "group")
10909 ## Adds a sub-object with ID theSubShapeId to the group
10910 # @param theGroup is a GEOM group to which the new sub-shape is added
10911 # @param theSubShapeID is a sub-shape ID in the main object.
10912 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
10914 # @ref tui_working_with_groups_page "Example"
10915 def AddObject(self,theGroup, theSubShapeID):
10917 Adds a sub-object with ID theSubShapeId to the group
10920 theGroup is a GEOM group to which the new sub-shape is added
10921 theSubShapeID is a sub-shape ID in the main object.
10924 Use method GetSubShapeID() to get an unique ID of the sub-shape
10926 # Example: see GEOM_TestOthers.py
10927 self.GroupOp.AddObject(theGroup, theSubShapeID)
10928 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
10929 RaiseIfFailed("AddObject", self.GroupOp)
10933 ## Removes a sub-object with ID \a theSubShapeId from the group
10934 # @param theGroup is a GEOM group from which the new sub-shape is removed
10935 # @param theSubShapeID is a sub-shape ID in the main object.
10936 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
10938 # @ref tui_working_with_groups_page "Example"
10939 def RemoveObject(self,theGroup, theSubShapeID):
10941 Removes a sub-object with ID theSubShapeId from the group
10944 theGroup is a GEOM group from which the new sub-shape is removed
10945 theSubShapeID is a sub-shape ID in the main object.
10948 Use method GetSubShapeID() to get an unique ID of the sub-shape
10950 # Example: see GEOM_TestOthers.py
10951 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
10952 RaiseIfFailed("RemoveObject", self.GroupOp)
10955 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10956 # @param theGroup is a GEOM group to which the new sub-shapes are added.
10957 # @param theSubShapes is a list of sub-shapes to be added.
10959 # @ref tui_working_with_groups_page "Example"
10960 def UnionList (self,theGroup, theSubShapes):
10962 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10965 theGroup is a GEOM group to which the new sub-shapes are added.
10966 theSubShapes is a list of sub-shapes to be added.
10968 # Example: see GEOM_TestOthers.py
10969 self.GroupOp.UnionList(theGroup, theSubShapes)
10970 RaiseIfFailed("UnionList", self.GroupOp)
10973 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10974 # @param theGroup is a GEOM group to which the new sub-shapes are added.
10975 # @param theSubShapes is a list of indices of sub-shapes to be added.
10977 # @ref swig_UnionIDs "Example"
10978 def UnionIDs(self,theGroup, theSubShapes):
10980 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10983 theGroup is a GEOM group to which the new sub-shapes are added.
10984 theSubShapes is a list of indices of sub-shapes to be added.
10986 # Example: see GEOM_TestOthers.py
10987 self.GroupOp.UnionIDs(theGroup, theSubShapes)
10988 RaiseIfFailed("UnionIDs", self.GroupOp)
10991 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
10992 # @param theGroup is a GEOM group from which the sub-shapes are removed.
10993 # @param theSubShapes is a list of sub-shapes to be removed.
10995 # @ref tui_working_with_groups_page "Example"
10996 def DifferenceList (self,theGroup, theSubShapes):
10998 Removes from the group all the given shapes. No errors, if some shapes are not included.
11001 theGroup is a GEOM group from which the sub-shapes are removed.
11002 theSubShapes is a list of sub-shapes to be removed.
11004 # Example: see GEOM_TestOthers.py
11005 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11006 RaiseIfFailed("DifferenceList", self.GroupOp)
11009 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11010 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11011 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11013 # @ref swig_DifferenceIDs "Example"
11014 def DifferenceIDs(self,theGroup, theSubShapes):
11016 Removes from the group all the given shapes. No errors, if some shapes are not included.
11019 theGroup is a GEOM group from which the sub-shapes are removed.
11020 theSubShapes is a list of indices of sub-shapes to be removed.
11022 # Example: see GEOM_TestOthers.py
11023 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11024 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11027 ## Union of two groups.
11028 # New group is created. It will contain all entities
11029 # which are present in groups theGroup1 and theGroup2.
11030 # @param theGroup1, theGroup2 are the initial GEOM groups
11031 # to create the united group from.
11032 # @param theName Object name; when specified, this parameter is used
11033 # for result publication in the study. Otherwise, if automatic
11034 # publication is switched on, default value is used for result name.
11036 # @return a newly created GEOM group.
11038 # @ref tui_union_groups_anchor "Example"
11039 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11041 Union of two groups.
11042 New group is created. It will contain all entities
11043 which are present in groups theGroup1 and theGroup2.
11046 theGroup1, theGroup2 are the initial GEOM groups
11047 to create the united group from.
11048 theName Object name; when specified, this parameter is used
11049 for result publication in the study. Otherwise, if automatic
11050 publication is switched on, default value is used for result name.
11053 a newly created GEOM group.
11055 # Example: see GEOM_TestOthers.py
11056 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11057 RaiseIfFailed("UnionGroups", self.GroupOp)
11058 self._autoPublish(aGroup, theName, "group")
11061 ## Intersection of two groups.
11062 # New group is created. It will contain only those entities
11063 # which are present in both groups theGroup1 and theGroup2.
11064 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11065 # @param theName Object name; when specified, this parameter is used
11066 # for result publication in the study. Otherwise, if automatic
11067 # publication is switched on, default value is used for result name.
11069 # @return a newly created GEOM group.
11071 # @ref tui_intersect_groups_anchor "Example"
11072 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11074 Intersection of two groups.
11075 New group is created. It will contain only those entities
11076 which are present in both groups theGroup1 and theGroup2.
11079 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11080 theName Object name; when specified, this parameter is used
11081 for result publication in the study. Otherwise, if automatic
11082 publication is switched on, default value is used for result name.
11085 a newly created GEOM group.
11087 # Example: see GEOM_TestOthers.py
11088 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11089 RaiseIfFailed("IntersectGroups", self.GroupOp)
11090 self._autoPublish(aGroup, theName, "group")
11093 ## Cut of two groups.
11094 # New group is created. It will contain entities which are
11095 # present in group theGroup1 but are not present in group theGroup2.
11096 # @param theGroup1 is a GEOM group to include elements of.
11097 # @param theGroup2 is a GEOM group to exclude elements of.
11098 # @param theName Object name; when specified, this parameter is used
11099 # for result publication in the study. Otherwise, if automatic
11100 # publication is switched on, default value is used for result name.
11102 # @return a newly created GEOM group.
11104 # @ref tui_cut_groups_anchor "Example"
11105 def CutGroups (self, theGroup1, theGroup2, theName=None):
11108 New group is created. It will contain entities which are
11109 present in group theGroup1 but are not present in group theGroup2.
11112 theGroup1 is a GEOM group to include elements of.
11113 theGroup2 is a GEOM group to exclude elements of.
11114 theName Object name; when specified, this parameter is used
11115 for result publication in the study. Otherwise, if automatic
11116 publication is switched on, default value is used for result name.
11119 a newly created GEOM group.
11121 # Example: see GEOM_TestOthers.py
11122 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11123 RaiseIfFailed("CutGroups", self.GroupOp)
11124 self._autoPublish(aGroup, theName, "group")
11127 ## Union of list of groups.
11128 # New group is created. It will contain all entities that are
11129 # present in groups listed in theGList.
11130 # @param theGList is a list of GEOM groups to create the united group from.
11131 # @param theName Object name; when specified, this parameter is used
11132 # for result publication in the study. Otherwise, if automatic
11133 # publication is switched on, default value is used for result name.
11135 # @return a newly created GEOM group.
11137 # @ref tui_union_groups_anchor "Example"
11138 def UnionListOfGroups (self, theGList, theName=None):
11140 Union of list of groups.
11141 New group is created. It will contain all entities that are
11142 present in groups listed in theGList.
11145 theGList is a list of GEOM groups to create the united group from.
11146 theName Object name; when specified, this parameter is used
11147 for result publication in the study. Otherwise, if automatic
11148 publication is switched on, default value is used for result name.
11151 a newly created GEOM group.
11153 # Example: see GEOM_TestOthers.py
11154 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11155 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11156 self._autoPublish(aGroup, theName, "group")
11159 ## Cut of lists of groups.
11160 # New group is created. It will contain only entities
11161 # which are present in groups listed in theGList1 but
11162 # are not present in groups from theGList2.
11163 # @param theGList1 is a list of GEOM groups to include elements of.
11164 # @param theGList2 is a list of GEOM groups to exclude elements of.
11165 # @param theName Object name; when specified, this parameter is used
11166 # for result publication in the study. Otherwise, if automatic
11167 # publication is switched on, default value is used for result name.
11169 # @return a newly created GEOM group.
11171 # @ref tui_intersect_groups_anchor "Example"
11172 def IntersectListOfGroups (self, theGList, theName=None):
11174 Cut of lists of groups.
11175 New group is created. It will contain only entities
11176 which are present in groups listed in theGList1 but
11177 are not present in groups from theGList2.
11180 theGList1 is a list of GEOM groups to include elements of.
11181 theGList2 is a list of GEOM groups to exclude elements of.
11182 theName Object name; when specified, this parameter is used
11183 for result publication in the study. Otherwise, if automatic
11184 publication is switched on, default value is used for result name.
11187 a newly created GEOM group.
11189 # Example: see GEOM_TestOthers.py
11190 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11191 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11192 self._autoPublish(aGroup, theName, "group")
11195 ## Cut of lists of groups.
11196 # New group is created. It will contain only entities
11197 # which are present in groups listed in theGList1 but
11198 # are not present in groups from theGList2.
11199 # @param theGList1 is a list of GEOM groups to include elements of.
11200 # @param theGList2 is a list of GEOM groups to exclude elements of.
11201 # @param theName Object name; when specified, this parameter is used
11202 # for result publication in the study. Otherwise, if automatic
11203 # publication is switched on, default value is used for result name.
11205 # @return a newly created GEOM group.
11207 # @ref tui_cut_groups_anchor "Example"
11208 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11210 Cut of lists of groups.
11211 New group is created. It will contain only entities
11212 which are present in groups listed in theGList1 but
11213 are not present in groups from theGList2.
11216 theGList1 is a list of GEOM groups to include elements of.
11217 theGList2 is a list of GEOM groups to exclude elements of.
11218 theName Object name; when specified, this parameter is used
11219 for result publication in the study. Otherwise, if automatic
11220 publication is switched on, default value is used for result name.
11223 a newly created GEOM group.
11225 # Example: see GEOM_TestOthers.py
11226 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11227 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11228 self._autoPublish(aGroup, theName, "group")
11231 ## Returns a list of sub-objects ID stored in the group
11232 # @param theGroup is a GEOM group for which a list of IDs is requested
11234 # @ref swig_GetObjectIDs "Example"
11235 def GetObjectIDs(self,theGroup):
11237 Returns a list of sub-objects ID stored in the group
11240 theGroup is a GEOM group for which a list of IDs is requested
11242 # Example: see GEOM_TestOthers.py
11243 ListIDs = self.GroupOp.GetObjects(theGroup)
11244 RaiseIfFailed("GetObjects", self.GroupOp)
11247 ## Returns a type of sub-objects stored in the group
11248 # @param theGroup is a GEOM group which type is returned.
11250 # @ref swig_GetType "Example"
11251 def GetType(self,theGroup):
11253 Returns a type of sub-objects stored in the group
11256 theGroup is a GEOM group which type is returned.
11258 # Example: see GEOM_TestOthers.py
11259 aType = self.GroupOp.GetType(theGroup)
11260 RaiseIfFailed("GetType", self.GroupOp)
11263 ## Convert a type of geom object from id to string value
11264 # @param theId is a GEOM obect type id.
11265 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11266 # @ref swig_GetType "Example"
11267 def ShapeIdToType(self, theId):
11269 Convert a type of geom object from id to string value
11272 theId is a GEOM obect type id.
11275 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11302 return "REVOLUTION"
11350 return "FREE_BOUNDS"
11358 return "THRUSECTIONS"
11360 return "COMPOUNDFILTER"
11362 return "SHAPES_ON_SHAPE"
11364 return "ELLIPSE_ARC"
11366 return "3DSKETCHER"
11372 return "PIPETSHAPE"
11373 return "Shape Id not exist."
11375 ## Returns a main shape associated with the group
11376 # @param theGroup is a GEOM group for which a main shape object is requested
11377 # @return a GEOM object which is a main shape for theGroup
11379 # @ref swig_GetMainShape "Example"
11380 def GetMainShape(self,theGroup):
11382 Returns a main shape associated with the group
11385 theGroup is a GEOM group for which a main shape object is requested
11388 a GEOM object which is a main shape for theGroup
11390 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11392 # Example: see GEOM_TestOthers.py
11393 anObj = self.GroupOp.GetMainShape(theGroup)
11394 RaiseIfFailed("GetMainShape", self.GroupOp)
11397 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11398 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11399 # @param theShape given shape (see GEOM.GEOM_Object)
11400 # @param min_length minimum length of edges of theShape
11401 # @param max_length maximum length of edges of theShape
11402 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11403 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11404 # @param theName Object name; when specified, this parameter is used
11405 # for result publication in the study. Otherwise, if automatic
11406 # publication is switched on, default value is used for result name.
11408 # @return a newly created GEOM group of edges
11410 # @@ref swig_todo "Example"
11411 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11413 Create group of edges of theShape, whose length is in range [min_length, max_length].
11414 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11417 theShape given shape
11418 min_length minimum length of edges of theShape
11419 max_length maximum length of edges of theShape
11420 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11421 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11422 theName Object name; when specified, this parameter is used
11423 for result publication in the study. Otherwise, if automatic
11424 publication is switched on, default value is used for result name.
11427 a newly created GEOM group of edges.
11429 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
11430 edges_in_range = []
11432 Props = self.BasicProperties(edge)
11433 if min_length <= Props[0] and Props[0] <= max_length:
11434 if (not include_min) and (min_length == Props[0]):
11437 if (not include_max) and (Props[0] == max_length):
11440 edges_in_range.append(edge)
11442 if len(edges_in_range) <= 0:
11443 print "No edges found by given criteria"
11446 # note: auto-publishing is done in self.CreateGroup()
11447 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"], theName)
11448 self.UnionList(group_edges, edges_in_range)
11452 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11453 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11454 # @param min_length minimum length of edges of selected shape
11455 # @param max_length maximum length of edges of selected shape
11456 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11457 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11458 # @return a newly created GEOM group of edges
11459 # @ref swig_todo "Example"
11460 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11462 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11463 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11466 min_length minimum length of edges of selected shape
11467 max_length maximum length of edges of selected shape
11468 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11469 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11472 a newly created GEOM group of edges.
11474 nb_selected = sg.SelectedCount()
11475 if nb_selected < 1:
11476 print "Select a shape before calling this function, please."
11478 if nb_selected > 1:
11479 print "Only one shape must be selected"
11482 id_shape = sg.getSelected(0)
11483 shape = IDToObject( id_shape )
11485 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11489 if include_min: left_str = " <= "
11490 if include_max: right_str = " <= "
11492 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11493 + left_str + "length" + right_str + `max_length`)
11495 sg.updateObjBrowser(1)
11502 ## @addtogroup l4_advanced
11505 ## Create a T-shape object with specified caracteristics for the main
11506 # and the incident pipes (radius, width, half-length).
11507 # The extremities of the main pipe are located on junctions points P1 and P2.
11508 # The extremity of the incident pipe is located on junction point P3.
11509 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11510 # the main plane of the T-shape is XOY.
11511 # @param theR1 Internal radius of main pipe
11512 # @param theW1 Width of main pipe
11513 # @param theL1 Half-length of main pipe
11514 # @param theR2 Internal radius of incident pipe (R2 < R1)
11515 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11516 # @param theL2 Half-length of incident pipe
11517 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11518 # @param theP1 1st junction point of main pipe
11519 # @param theP2 2nd junction point of main pipe
11520 # @param theP3 Junction point of incident pipe
11521 # @param theName Object name; when specified, this parameter is used
11522 # for result publication in the study. Otherwise, if automatic
11523 # publication is switched on, default value is used for result name.
11525 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11527 # @ref tui_creation_pipetshape "Example"
11528 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None, theName=None):
11530 Create a T-shape object with specified caracteristics for the main
11531 and the incident pipes (radius, width, half-length).
11532 The extremities of the main pipe are located on junctions points P1 and P2.
11533 The extremity of the incident pipe is located on junction point P3.
11534 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11535 the main plane of the T-shape is XOY.
11538 theR1 Internal radius of main pipe
11539 theW1 Width of main pipe
11540 theL1 Half-length of main pipe
11541 theR2 Internal radius of incident pipe (R2 < R1)
11542 theW2 Width of incident pipe (R2+W2 < R1+W1)
11543 theL2 Half-length of incident pipe
11544 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11545 theP1 1st junction point of main pipe
11546 theP2 2nd junction point of main pipe
11547 theP3 Junction point of incident pipe
11548 theName Object name; when specified, this parameter is used
11549 for result publication in the study. Otherwise, if automatic
11550 publication is switched on, default value is used for result name.
11553 List of GEOM_Object, containing the created shape and propagation groups.
11556 # create PipeTShape object
11557 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11558 # create PipeTShape object with position
11559 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11561 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
11562 if (theP1 and theP2 and theP3):
11563 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
11565 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
11566 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11567 if Parameters: anObj[0].SetParameters(Parameters)
11568 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11569 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11572 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11573 # and the incident pipes (radius, width, half-length). The chamfer is
11574 # created on the junction of the pipes.
11575 # The extremities of the main pipe are located on junctions points P1 and P2.
11576 # The extremity of the incident pipe is located on junction point P3.
11577 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11578 # the main plane of the T-shape is XOY.
11579 # @param theR1 Internal radius of main pipe
11580 # @param theW1 Width of main pipe
11581 # @param theL1 Half-length of main pipe
11582 # @param theR2 Internal radius of incident pipe (R2 < R1)
11583 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11584 # @param theL2 Half-length of incident pipe
11585 # @param theH Height of the chamfer.
11586 # @param theW Width of the chamfer.
11587 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11588 # @param theP1 1st junction point of main pipe
11589 # @param theP2 2nd junction point of main pipe
11590 # @param theP3 Junction point of incident pipe
11591 # @param theName Object name; when specified, this parameter is used
11592 # for result publication in the study. Otherwise, if automatic
11593 # publication is switched on, default value is used for result name.
11595 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11597 # @ref tui_creation_pipetshape "Example"
11598 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None, theName=None):
11600 Create a T-shape object with chamfer and with specified caracteristics for the main
11601 and the incident pipes (radius, width, half-length). The chamfer is
11602 created on the junction of the pipes.
11603 The extremities of the main pipe are located on junctions points P1 and P2.
11604 The extremity of the incident pipe is located on junction point P3.
11605 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11606 the main plane of the T-shape is XOY.
11609 theR1 Internal radius of main pipe
11610 theW1 Width of main pipe
11611 theL1 Half-length of main pipe
11612 theR2 Internal radius of incident pipe (R2 < R1)
11613 theW2 Width of incident pipe (R2+W2 < R1+W1)
11614 theL2 Half-length of incident pipe
11615 theH Height of the chamfer.
11616 theW Width of the chamfer.
11617 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11618 theP1 1st junction point of main pipe
11619 theP2 2nd junction point of main pipe
11620 theP3 Junction point of incident pipe
11621 theName Object name; when specified, this parameter is used
11622 for result publication in the study. Otherwise, if automatic
11623 publication is switched on, default value is used for result name.
11626 List of GEOM_Object, containing the created shape and propagation groups.
11629 # create PipeTShape with chamfer object
11630 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
11631 # create PipeTShape with chamfer object with position
11632 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
11634 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
11635 if (theP1 and theP2 and theP3):
11636 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
11638 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
11639 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
11640 if Parameters: anObj[0].SetParameters(Parameters)
11641 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11642 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11645 ## Create a T-shape object with fillet and with specified caracteristics for the main
11646 # and the incident pipes (radius, width, half-length). The fillet is
11647 # created on the junction of the pipes.
11648 # The extremities of the main pipe are located on junctions points P1 and P2.
11649 # The extremity of the incident pipe is located on junction point P3.
11650 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11651 # the main plane of the T-shape is XOY.
11652 # @param theR1 Internal radius of main pipe
11653 # @param theW1 Width of main pipe
11654 # @param theL1 Half-length of main pipe
11655 # @param theR2 Internal radius of incident pipe (R2 < R1)
11656 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11657 # @param theL2 Half-length of incident pipe
11658 # @param theRF Radius of curvature of fillet.
11659 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11660 # @param theP1 1st junction point of main pipe
11661 # @param theP2 2nd junction point of main pipe
11662 # @param theP3 Junction point of incident pipe
11663 # @param theName Object name; when specified, this parameter is used
11664 # for result publication in the study. Otherwise, if automatic
11665 # publication is switched on, default value is used for result name.
11667 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11669 # @ref tui_creation_pipetshape "Example"
11670 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None, theName=None):
11672 Create a T-shape object with fillet and with specified caracteristics for the main
11673 and the incident pipes (radius, width, half-length). The fillet is
11674 created on the junction of the pipes.
11675 The extremities of the main pipe are located on junctions points P1 and P2.
11676 The extremity of the incident pipe is located on junction point P3.
11679 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11680 the main plane of the T-shape is XOY.
11681 theR1 Internal radius of main pipe
11682 theW1 Width of main pipe
11683 heL1 Half-length of main pipe
11684 theR2 Internal radius of incident pipe (R2 < R1)
11685 theW2 Width of incident pipe (R2+W2 < R1+W1)
11686 theL2 Half-length of incident pipe
11687 theRF Radius of curvature of fillet.
11688 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11689 theP1 1st junction point of main pipe
11690 theP2 2nd junction point of main pipe
11691 theP3 Junction point of incident pipe
11692 theName Object name; when specified, this parameter is used
11693 for result publication in the study. Otherwise, if automatic
11694 publication is switched on, default value is used for result name.
11697 List of GEOM_Object, containing the created shape and propagation groups.
11700 # create PipeTShape with fillet object
11701 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
11702 # create PipeTShape with fillet object with position
11703 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
11706 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
11707 if (theP1 and theP2 and theP3):
11708 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
11710 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
11711 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
11712 if Parameters: anObj[0].SetParameters(Parameters)
11713 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11714 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11717 ## This function allows creating a disk already divided into blocks. It
11718 # can be used to create divided pipes for later meshing in hexaedra.
11719 # @param theR Radius of the disk
11720 # @param theOrientation Orientation of the plane on which the disk will be built
11721 # 1 = XOY, 2 = OYZ, 3 = OZX
11722 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11723 # @param theName Object name; when specified, this parameter is used
11724 # for result publication in the study. Otherwise, if automatic
11725 # publication is switched on, default value is used for result name.
11727 # @return New GEOM_Object, containing the created shape.
11729 # @ref tui_creation_divideddisk "Example"
11730 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
11732 Creates a disk, divided into blocks. It can be used to create divided pipes
11733 for later meshing in hexaedra.
11736 theR Radius of the disk
11737 theOrientation Orientation of the plane on which the disk will be built:
11738 1 = XOY, 2 = OYZ, 3 = OZX
11739 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11740 theName Object name; when specified, this parameter is used
11741 for result publication in the study. Otherwise, if automatic
11742 publication is switched on, default value is used for result name.
11745 New GEOM_Object, containing the created shape.
11747 theR, Parameters = ParseParameters(theR)
11748 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
11749 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
11750 if Parameters: anObj.SetParameters(Parameters)
11751 self._autoPublish(anObj, theName, "dividedDisk")
11754 ## This function allows creating a disk already divided into blocks. It
11755 # can be used to create divided pipes for later meshing in hexaedra.
11756 # @param theCenter Center of the disk
11757 # @param theVector Normal vector to the plane of the created disk
11758 # @param theRadius Radius of the disk
11759 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11760 # @param theName Object name; when specified, this parameter is used
11761 # for result publication in the study. Otherwise, if automatic
11762 # publication is switched on, default value is used for result name.
11764 # @return New GEOM_Object, containing the created shape.
11766 # @ref tui_creation_divideddisk "Example"
11767 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
11769 Creates a disk already divided into blocks. It can be used to create divided pipes
11770 for later meshing in hexaedra.
11773 theCenter Center of the disk
11774 theVector Normal vector to the plane of the created disk
11775 theRadius Radius of the disk
11776 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11777 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.
11782 New GEOM_Object, containing the created shape.
11784 theRadius, Parameters = ParseParameters(theRadius)
11785 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
11786 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
11787 if Parameters: anObj.SetParameters(Parameters)
11788 self._autoPublish(anObj, theName, "dividedDisk")
11791 ## Builds a cylinder prepared for hexa meshes
11792 # @param theR Radius of the cylinder
11793 # @param theH Height of the cylinder
11794 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11795 # @param theName Object name; when specified, this parameter is used
11796 # for result publication in the study. Otherwise, if automatic
11797 # publication is switched on, default value is used for result name.
11799 # @return New GEOM_Object, containing the created shape.
11801 # @ref tui_creation_dividedcylinder "Example"
11802 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
11804 Builds a cylinder prepared for hexa meshes
11807 theR Radius of the cylinder
11808 theH Height of the cylinder
11809 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11810 theName Object name; when specified, this parameter is used
11811 for result publication in the study. Otherwise, if automatic
11812 publication is switched on, default value is used for result name.
11815 New GEOM_Object, containing the created shape.
11817 theR, theH, Parameters = ParseParameters(theR, theH)
11818 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
11819 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
11820 if Parameters: anObj.SetParameters(Parameters)
11821 self._autoPublish(anObj, theName, "dividedCylinder")
11824 #@@ insert new functions before this line @@ do not remove this line @@#
11826 # end of l4_advanced
11829 ## Create a copy of the given object
11831 # @param theOriginal geometry object for copy
11832 # @return unique object identifier
11833 # @ingroup l1_geompyDC_auxiliary
11834 # @param theName Object name; when specified, this parameter is used
11835 # for result publication in the study. Otherwise, if automatic
11836 # publication is switched on, default value is used for result name.
11838 # @return New GEOM_Object, containing the copied shape.
11840 # @ingroup l1_geompy_auxiliary
11841 # @ref swig_MakeCopy "Example"
11842 def MakeCopy(self, theOriginal, theName=None):
11844 Create a copy of the given object
11847 theOriginal geometry object for copy
11848 theName Object name; when specified, this parameter is used
11849 for result publication in the study. Otherwise, if automatic
11850 publication is switched on, default value is used for result name.
11853 New GEOM_Object, containing the copied shape.
11855 Example of usage: Copy = geompy.MakeCopy(Box)
11857 # Example: see GEOM_TestAll.py
11858 anObj = self.InsertOp.MakeCopy(theOriginal)
11859 RaiseIfFailed("MakeCopy", self.InsertOp)
11860 self._autoPublish(anObj, theName, "copy")
11863 ## Add Path to load python scripts from
11864 # @param Path a path to load python scripts from
11865 # @ingroup l1_geompyDC_auxiliary
11866 def addPath(self,Path):
11868 Add Path to load python scripts from
11871 Path a path to load python scripts from
11873 if (sys.path.count(Path) < 1):
11874 sys.path.append(Path)
11878 ## Load marker texture from the file
11879 # @param Path a path to the texture file
11880 # @return unique texture identifier
11881 # @ingroup l1_geompyDC_auxiliary
11882 def LoadTexture(self, Path):
11884 Load marker texture from the file
11887 Path a path to the texture file
11890 unique texture identifier
11892 # Example: see GEOM_TestAll.py
11893 ID = self.InsertOp.LoadTexture(Path)
11894 RaiseIfFailed("LoadTexture", self.InsertOp)
11897 ## Get internal name of the object based on its study entry
11898 # @note This method does not provide an unique identifier of the geometry object.
11899 # @note This is internal function of GEOM component, though it can be used outside it for
11900 # appropriate reason (e.g. for identification of geometry object).
11901 # @param obj geometry object
11902 # @return unique object identifier
11903 # @ingroup l1_geompyDC_auxiliary
11904 def getObjectID(self, obj):
11906 Get internal name of the object based on its study entry.
11907 Note: this method does not provide an unique identifier of the geometry object.
11908 It is an internal function of GEOM component, though it can be used outside GEOM for
11909 appropriate reason (e.g. for identification of geometry object).
11912 obj geometry object
11915 unique object identifier
11918 entry = salome.ObjectToID(obj)
11919 if entry is not None:
11920 lst = entry.split(":")
11922 ID = lst[-1] # -1 means last item in the list
11923 return "GEOM_" + ID
11928 ## Add marker texture. @a Width and @a Height parameters
11929 # specify width and height of the texture in pixels.
11930 # If @a RowData is @c True, @a Texture parameter should represent texture data
11931 # packed into the byte array. If @a RowData is @c False (default), @a Texture
11932 # parameter should be unpacked string, in which '1' symbols represent opaque
11933 # pixels and '0' represent transparent pixels of the texture bitmap.
11935 # @param Width texture width in pixels
11936 # @param Height texture height in pixels
11937 # @param Texture texture data
11938 # @param RowData if @c True, @a Texture data are packed in the byte stream
11939 # @return unique texture identifier
11940 # @ingroup l1_geompyDC_auxiliary
11941 def AddTexture(self, Width, Height, Texture, RowData=False):
11943 Add marker texture. Width and Height parameters
11944 specify width and height of the texture in pixels.
11945 If RowData is True, Texture parameter should represent texture data
11946 packed into the byte array. If RowData is False (default), Texture
11947 parameter should be unpacked string, in which '1' symbols represent opaque
11948 pixels and '0' represent transparent pixels of the texture bitmap.
11951 Width texture width in pixels
11952 Height texture height in pixels
11953 Texture texture data
11954 RowData if True, Texture data are packed in the byte stream
11957 return unique texture identifier
11959 if not RowData: Texture = PackData(Texture)
11960 ID = self.InsertOp.AddTexture(Width, Height, Texture)
11961 RaiseIfFailed("AddTexture", self.InsertOp)
11965 # Register the new proxy for GEOM_Gen
11966 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)
11968 def geomInstance( study, instance=None):
11969 print "geomInstance ", study, instance
11977 assert isinstance(geom,geompyDC), "Geom engine class is %s but should be geompyDC.geompyDC. Import geompyDC before creating the instance."%geom.__class__
11978 geom.init_geom(study)