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 # Author : Paul RASCLE, EDF
30 ## @defgroup l1_publish_data Publishing results in SALOME study
35 ## By default, all functions of geompy.py Python interface do not publish
36 ## resulting geometrical objects. This can be done in the Python script
37 ## by means of geompy.addToStudy() or geompy.addToStudyInFather()
40 ## However, it is possible to publish result data in the study
41 ## automatically. For this, almost each function of geompy.py module has
42 ## an additional @a theName parameter (@c None by default).
43 ## As soon as non-empty string value is passed to this parameter,
44 ## the result object is published in the study automatically.
49 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100) # box is not published in the study yet
50 ## geompy.addToStudy(box, "box") # explicit publishing
53 ## can be replaced by one-line instruction
56 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, theName="box") # box is published in the study with "box" name
62 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100, "box") # box is published in the study with "box" name
65 ## Note, that some functions produce more than one geometrical objects. For example,
66 ## geompy.GetNonBlocks() function returns two objects: group of all non-hexa solids and group of
67 ## all non-quad faces. For such functions it is possible to specify separate names for results.
72 ## # create and publish cylinder
73 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
74 ## # get non blocks from cylinder
75 ## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
78 ## Above example will publish both result compounds (first with non-hexa solids and
79 ## second with non-quad faces) as two items, both named "nonblock".
80 ## However, if second command is invoked as
83 ## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
86 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
88 ## Automatic publication of all results can be also enabled/disabled by means of the function
89 ## geompy.addToStudyAuto(). The automatic publishing is managed by the numeric parameter passed
91 ## - if @a maxNbSubShapes = 0, automatic publishing is disabled.
92 ## - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
93 ## maximum number of sub-shapes allowed for publishing is unlimited; any negative
94 ## value passed as parameter has the same effect.
95 ## - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
96 ## maximum number of sub-shapes allowed for publishing is set to specified value.
98 ## When automatic publishing is enabled, you even do not need to pass @a theName parameter
99 ## to the functions creating objects, instead default names will be used. However, you
100 ## can always change the behavior, by passing explicit name to the @a theName parameter
101 ## and it will be used instead default one.
102 ## The publishing of the collections of objects will be done according to the above
103 ## mentioned rules (maximum allowed number of sub-shapes).
108 ## geompy.addToStudyAuto() # enable automatic publication
109 ## box = geompy.MakeBoxDXDYDZ(100, 100, 100)
110 ## # the box is created and published in the study with default name
111 ## geompy.addToStudyAuto(5) # set max allowed number of sub-shapes to 5
112 ## vertices = geompy.SubShapeAll(box, geompy.ShapeType['VERTEX'])
113 ## # only 5 first vertices will be published, with default names
114 ## print len(vertices)
115 ## # note, that result value still containes all 8 vertices
116 ## geompy.addToStudyAuto(-1) # disable automatic publication
119 ## This feature can be used, for example, for debugging purposes.
122 ## - Use automatic publication feature with caution. When it is enabled, any function of geompy.py module
123 ## publishes the results in the study, that can lead to the huge size of the study data tree.
124 ## For example, repeating call of geompy.SubShapeAll() command on the same main shape each time will
125 ## publish all child objects, that will lead to a lot of duplicated items in the study.
126 ## - Sub-shapes are automatically published as child items of the parent main shape in the study if main
127 ## shape was also published before. Otherwise, sub-shapes are published as top-level objects.
128 ## - Not that some functions of geompy.py module do not have @theName parameter (and, thus, do not support
129 ## automatic publication). For example, some transformation operations like geompy.TranslateDXDYDZ().
130 ## Refer to the documentation to check if some function has such possibility.
135 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
137 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
139 ## @defgroup l2_import_export Importing/exporting geometrical objects
140 ## @defgroup l2_creating Creating geometrical objects
142 ## @defgroup l3_basic_go Creating Basic Geometric Objects
144 ## @defgroup l4_curves Creating Curves
147 ## @defgroup l3_3d_primitives Creating 3D Primitives
148 ## @defgroup l3_complex Creating Complex Objects
149 ## @defgroup l3_groups Working with groups
150 ## @defgroup l3_blocks Building by blocks
152 ## @defgroup l4_blocks_measure Check and Improve
155 ## @defgroup l3_sketcher Sketcher
156 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
158 ## @defgroup l4_decompose Decompose objects
159 ## @defgroup l4_decompose_d Decompose objects deprecated methods
160 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
161 ## @defgroup l4_obtain Access to sub-shapes by a criteria
162 ## @defgroup l4_advanced Advanced objects creation functions
167 ## @defgroup l2_transforming Transforming geometrical objects
169 ## @defgroup l3_basic_op Basic Operations
170 ## @defgroup l3_boolean Boolean Operations
171 ## @defgroup l3_transform Transformation Operations
172 ## @defgroup l3_transform_d Transformation Operations deprecated methods
173 ## @defgroup l3_local Local Operations (Fillet, Chamfer and other Features)
174 ## @defgroup l3_blocks_op Blocks Operations
175 ## @defgroup l3_healing Repairing Operations
176 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of sub-shapes
179 ## @defgroup l2_measure Using measurement tools
183 # initialize SALOME session in try/except block
184 # to avoid problems in some cases, e.g. when generating documentation
192 from salome_notebook import *
198 from gsketcher import Sketcher3D
200 ## Enumeration ShapeType as a dictionary. \n
201 ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
202 # @ingroup l1_geompy_auxiliary
203 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
206 def _toListOfNames(_names, _size=-1):
209 if type(_names) in [types.ListType, types.TupleType]:
210 for i in _names: l.append(i)
213 if l and len(l) < _size:
214 for i in range(len(l), _size): l.append("%s_%d"%(l[0],i))
217 ## Raise an Error, containing the Method_name, if Operation is Failed
218 ## @ingroup l1_geompy_auxiliary
219 def RaiseIfFailed (Method_name, Operation):
220 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
221 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
223 ## Return list of variables value from salome notebook
224 ## @ingroup l1_geompy_auxiliary
225 def ParseParameters(*parameters):
228 for parameter in parameters:
229 if isinstance(parameter, list):
230 lResults = ParseParameters(*parameter)
231 if len(lResults) > 0:
232 Result.append(lResults[:-1])
233 StringResult += lResults[-1].split(":")
237 if isinstance(parameter,str):
238 if notebook.isVariable(parameter):
239 Result.append(notebook.get(parameter))
241 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
244 Result.append(parameter)
246 StringResult.append(str(parameter))
250 Result.append(":".join(StringResult))
252 Result = ":".join(StringResult)
255 ## Return list of variables value from salome notebook
256 ## @ingroup l1_geompy_auxiliary
260 for parameter in list:
261 if isinstance(parameter,str) and notebook.isVariable(parameter):
262 Result.append(str(notebook.get(parameter)))
265 Result.append(str(parameter))
268 StringResult = StringResult + str(parameter)
269 StringResult = StringResult + ":"
271 StringResult = StringResult[:len(StringResult)-1]
272 return Result, StringResult
274 ## Return list of variables value from salome notebook
275 ## @ingroup l1_geompy_auxiliary
276 def ParseSketcherCommand(command):
279 sections = command.split(":")
280 for section in sections:
281 parameters = section.split(" ")
283 for parameter in parameters:
284 if paramIndex > 1 and parameter.find("'") != -1:
285 parameter = parameter.replace("'","")
286 if notebook.isVariable(parameter):
287 Result = Result + str(notebook.get(parameter)) + " "
290 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
294 Result = Result + str(parameter) + " "
297 StringResult = StringResult + parameter
298 StringResult = StringResult + ":"
300 paramIndex = paramIndex + 1
302 Result = Result[:len(Result)-1] + ":"
304 Result = Result[:len(Result)-1]
305 return Result, StringResult
307 ## Helper function which can be used to pack the passed string to the byte data.
308 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
309 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
312 ## val = PackData("10001110") # val = 0xAE
313 ## val = PackData("1") # val = 0x80
315 ## @param data unpacked data - a string containing '1' and '0' symbols
316 ## @return data packed to the byte stream
317 ## @ingroup l1_geompy_auxiliary
320 Helper function which can be used to pack the passed string to the byte data.
321 Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
322 If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
325 data unpacked data - a string containing '1' and '0' symbols
328 data packed to the byte stream
331 val = PackData("10001110") # val = 0xAE
332 val = PackData("1") # val = 0x80
335 if len(data)%8: bytes += 1
337 for b in range(bytes):
338 d = data[b*8:(b+1)*8]
343 if d[i] == "1": val += 1
345 raise "Invalid symbol %s" % d[i]
352 ## Read bitmap texture from the text file.
353 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
354 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
355 ## The function returns width and height of the pixmap in pixels and byte stream representing
356 ## texture bitmap itself.
358 ## This function can be used to read the texture to the byte stream in order to pass it to
359 ## the AddTexture() function of geompy class.
363 ## geompy.init_geom(salome.myStudy)
364 ## texture = geompy.readtexture('mytexture.dat')
365 ## texture = geompy.AddTexture(*texture)
366 ## obj.SetMarkerTexture(texture)
368 ## @param fname texture file name
369 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
370 ## @ingroup l1_geompy_auxiliary
371 def ReadTexture(fname):
373 Read bitmap texture from the text file.
374 In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
375 A zero symbol ('0') represents transparent pixel of the texture bitmap.
376 The function returns width and height of the pixmap in pixels and byte stream representing
377 texture bitmap itself.
378 This function can be used to read the texture to the byte stream in order to pass it to
379 the AddTexture() function of geompy class.
382 fname texture file name
385 sequence of tree values: texture's width, height in pixels and its byte stream
389 geompy.init_geom(salome.myStudy)
390 texture = geompy.readtexture('mytexture.dat')
391 texture = geompy.AddTexture(*texture)
392 obj.SetMarkerTexture(texture)
396 lines = [ l.strip() for l in f.readlines()]
399 if lines: maxlen = max([len(x) for x in lines])
401 if maxlen%8: lenbytes += 1
405 lenline = (len(line)/8+1)*8
408 lenline = (len(line)/8)*8
410 for i in range(lenline/8):
413 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
416 bytedata += PackData(byte)
418 for i in range(lenline/8, lenbytes):
419 bytedata += PackData("0")
421 return lenbytes*8, len(lines), bytedata
426 ## Returns a long value from enumeration type
427 # Can be used for CORBA enumerator types like GEOM.shape_type
428 # @param theItem enumeration type
429 # @ingroup l1_geompy_auxiliary
430 def EnumToLong(theItem):
432 Returns a long value from enumeration type
433 Can be used for CORBA enumerator types like geompy.ShapeType
436 theItem enumeration type
439 if hasattr(theItem, "_v"): ret = theItem._v
442 ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
443 # and a list of parameters, describing the shape.
444 # List of parameters, describing the shape:
445 # - COMPOUND: [nb_solids nb_faces nb_edges nb_vertices]
446 # - COMPSOLID: [nb_solids nb_faces nb_edges nb_vertices]
448 # - SHELL: [info.CLOSED / info.UNCLOSED nb_faces nb_edges nb_vertices]
450 # - WIRE: [info.CLOSED / info.UNCLOSED nb_edges nb_vertices]
452 # - SPHERE: [xc yc zc R]
453 # - CYLINDER: [xb yb zb dx dy dz R H]
454 # - BOX: [xc yc zc ax ay az]
455 # - ROTATED_BOX: [xc yc zc zx zy zz xx xy xz ax ay az]
456 # - TORUS: [xc yc zc dx dy dz R_1 R_2]
457 # - CONE: [xb yb zb dx dy dz R_1 R_2 H]
458 # - POLYHEDRON: [nb_faces nb_edges nb_vertices]
459 # - SOLID: [nb_faces nb_edges nb_vertices]
461 # - SPHERE2D: [xc yc zc R]
462 # - CYLINDER2D: [xb yb zb dx dy dz R H]
463 # - TORUS2D: [xc yc zc dx dy dz R_1 R_2]
464 # - CONE2D: [xc yc zc dx dy dz R_1 R_2 H]
465 # - DISK_CIRCLE: [xc yc zc dx dy dz R]
466 # - DISK_ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
467 # - POLYGON: [xo yo zo dx dy dz nb_edges nb_vertices]
468 # - PLANE: [xo yo zo dx dy dz]
469 # - PLANAR: [xo yo zo dx dy dz nb_edges nb_vertices]
470 # - FACE: [nb_edges nb_vertices]
472 # - CIRCLE: [xc yc zc dx dy dz R]
473 # - ARC_CIRCLE: [xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2]
474 # - ELLIPSE: [xc yc zc dx dy dz R_1 R_2]
475 # - ARC_ELLIPSE: [xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2]
476 # - LINE: [xo yo zo dx dy dz]
477 # - SEGMENT: [x1 y1 z1 x2 y2 z2]
478 # - EDGE: [nb_vertices]
481 # @ingroup l1_geompy_auxiliary
482 kind = GEOM.GEOM_IKindOfShape
484 ## Information about closed/unclosed state of shell or wire
485 # @ingroup l1_geompy_auxiliary
488 Information about closed/unclosed state of shell or wire
494 class geompyDC(GEOM._objref_GEOM_Gen):
497 GEOM._objref_GEOM_Gen.__init__(self)
498 self.myMaxNbSubShapesAllowed = 0 # auto-publishing is disabled by default
499 self.myBuilder = None
518 ## Process object publication in the study, as follows:
519 # - if @a theName is specified (not None), the object is published in the study
520 # with this name, not taking into account "auto-publishing" option;
521 # - if @a theName is NOT specified, the object is published in the study
522 # (using default name, which can be customized using @a theDefaultName parameter)
523 # only if auto-publishing is switched on.
525 # @param theObj object, a subject for publishing
526 # @param theName object name for study
527 # @param theDefaultName default name for the auto-publishing
529 # @sa addToStudyAuto()
530 def _autoPublish(self, theObj, theName, theDefaultName="noname"):
532 def _item_name(_names, _defname, _idx=-1):
533 if not _names: _names = _defname
534 if type(_names) in [types.ListType, types.TupleType]:
536 if _idx >= len(_names) or not _names[_idx]:
537 if type(_defname) not in [types.ListType, types.TupleType]:
538 _name = "%s_%d"%(_defname, _idx+1)
539 elif len(_defname) > 0 and _idx >= 0 and _idx < len(_defname):
540 _name = _defname[_idx]
542 _name = "%noname_%d"%(dn, _idx+1)
548 # must be wrong usage
553 _name = "%s_%d"%(_names, _idx+1)
561 if not theName and not self.myMaxNbSubShapesAllowed:
562 return # nothing to do: auto-publishing is disabled
563 if not theName and not theDefaultName:
564 return # neither theName nor theDefaultName is given
566 if type(theObj) in [types.ListType, types.TupleType]:
567 # list of objects is being published
570 if not obj: continue # bad object
571 ###if obj.GetStudyEntry(): continue # already published
572 name = _item_name(theName, theDefaultName, idx)
573 if obj.IsMainShape() or not obj.GetMainShape().GetStudyEntry():
574 self.addToStudy(obj, name) # "%s_%d"%(aName, idx)
576 self.addToStudyInFather(obj.GetMainShape(), obj, name) # "%s_%d"%(aName, idx)
579 if not theName and idx == self.myMaxNbSubShapesAllowed: break
583 # single object is published
584 ###if theObj.GetStudyEntry(): return # already published
585 name = _item_name(theName, theDefaultName)
586 if theObj.IsMainShape():
587 self.addToStudy(theObj, name)
589 self.addToStudyInFather(theObj.GetMainShape(), theObj, name)
594 ## @addtogroup l1_geompy_auxiliary
596 def init_geom(self,theStudy):
597 self.myStudy = theStudy
598 self.myStudyId = self.myStudy._get_StudyId()
599 self.myBuilder = self.myStudy.NewBuilder()
600 self.father = self.myStudy.FindComponent("GEOM")
601 if self.father is None:
602 self.father = self.myBuilder.NewComponent("GEOM")
603 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
604 FName = A1._narrow(SALOMEDS.AttributeName)
605 FName.SetValue("Geometry")
606 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
607 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
608 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
609 self.myBuilder.DefineComponentInstance(self.father,self)
611 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
612 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
613 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
614 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
615 self.HealOp = self.GetIHealingOperations (self.myStudyId)
616 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
617 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
618 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
619 self.LocalOp = self.GetILocalOperations (self.myStudyId)
620 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
621 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
622 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
623 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
626 ## Enable / disable results auto-publishing
628 # The automatic publishing is managed in the following way:
629 # - if @a maxNbSubShapes = 0, automatic publishing is disabled.
630 # - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
631 # maximum number of sub-shapes allowed for publishing is unlimited; any negative
632 # value passed as parameter has the same effect.
633 # - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
634 # maximum number of sub-shapes allowed for publishing is set to specified value.
636 # @param maxNbSubShapes maximum number of sub-shapes allowed for publishing.
637 # @ingroup l1_publish_data
638 def addToStudyAuto(self, maxNbSubShapes=-1):
640 Enable / disable results auto-publishing
642 The automatic publishing is managed in the following way:
643 - if @a maxNbSubShapes = 0, automatic publishing is disabled;
644 - if @a maxNbSubShapes = -1 (default), automatic publishing is enabled and
645 maximum number of sub-shapes allowed for publishing is unlimited; any negative
646 value passed as parameter has the same effect.
647 - if @a maxNbSubShapes is any positive value, automatic publishing is enabled and
648 maximum number of sub-shapes allowed for publishing is set to this value.
651 maxNbSubShapes maximum number of sub-shapes allowed for publishing.
654 geompy.addToStudyAuto() # enable auto-publishing
655 geompy.MakeBoxDXDYDZ(100) # box is created and published with default name
656 geompy.addToStudyAuto(0) # disable auto-publishing
658 self.myMaxNbSubShapesAllowed = max(-1, maxNbSubShapes)
661 ## Dump component to the Python script
662 # This method overrides IDL function to allow default values for the parameters.
663 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
665 Dump component to the Python script
666 This method overrides IDL function to allow default values for the parameters.
668 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
670 ## Get name for sub-shape aSubObj of shape aMainObj
672 # @ref swig_SubShapeName "Example"
673 def SubShapeName(self,aSubObj, aMainObj):
675 Get name for sub-shape aSubObj of shape aMainObj
677 # Example: see GEOM_TestAll.py
679 #aSubId = orb.object_to_string(aSubObj)
680 #aMainId = orb.object_to_string(aMainObj)
681 #index = gg.getIndexTopology(aSubId, aMainId)
682 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
683 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
684 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
687 ## Publish in study aShape with name aName
689 # \param aShape the shape to be published
690 # \param aName the name for the shape
691 # \param doRestoreSubShapes if True, finds and publishes also
692 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
693 # and published sub-shapes of arguments
694 # \param theArgs,theFindMethod,theInheritFirstArg see RestoreSubShapes() for
695 # these arguments description
696 # \return study entry of the published shape in form of string
698 # @ingroup l1_publish_data
699 # @ref swig_all_addtostudy "Example"
700 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
701 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
703 Publish in study aShape with name aName
706 aShape the shape to be published
707 aName the name for the shape
708 doRestoreSubShapes if True, finds and publishes also
709 sub-shapes of aShape, corresponding to its arguments
710 and published sub-shapes of arguments
711 theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes() for
712 these arguments description
715 study entry of the published shape in form of string
718 id_block1 = geompy.addToStudy(Block1, "Block 1")
720 # Example: see GEOM_TestAll.py
722 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
723 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
724 if doRestoreSubShapes:
725 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
726 theFindMethod, theInheritFirstArg, True )
728 print "addToStudy() failed"
730 return aShape.GetStudyEntry()
732 ## Publish in study aShape with name aName as sub-object of previously published aFather
733 # \param aFather previously published object
734 # \param aShape the shape to be published as sub-object of <VAR>aFather</VAR>
735 # \param aName the name for the shape
737 # \return study entry of the published shape in form of string
739 # @ingroup l1_publish_data
740 # @ref swig_all_addtostudyInFather "Example"
741 def addToStudyInFather(self, aFather, aShape, aName):
743 Publish in study aShape with name aName as sub-object of previously published aFather
746 aFather previously published object
747 aShape the shape to be published as sub-object of aFather
748 aName the name for the shape
751 study entry of the published shape in form of string
753 # Example: see GEOM_TestAll.py
755 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
756 if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
758 print "addToStudyInFather() failed"
760 return aShape.GetStudyEntry()
762 ## Unpublish object in study
764 # \param obj the object to be unpublished
765 def hideInStudy(self, obj):
767 Unpublish object in study
770 obj the object to be unpublished
772 ior = salome.orb.object_to_string(obj)
773 aSObject = self.myStudy.FindObjectIOR(ior)
774 if aSObject is not None:
775 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
776 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
777 drwAttribute.SetDrawable(False)
780 # end of l1_geompy_auxiliary
783 ## @addtogroup l3_restore_ss
786 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
787 # To be used from python scripts out of addToStudy() (non-default usage)
788 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
789 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
790 # If this list is empty, all operation arguments will be published
791 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
792 # their sub-shapes. Value from enumeration GEOM.find_shape_method.
793 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
794 # Do not publish sub-shapes in place of arguments, but only
795 # in place of sub-shapes of the first argument,
796 # because the whole shape corresponds to the first argument.
797 # Mainly to be used after transformations, but it also can be
798 # usefull after partition with one object shape, and some other
799 # operations, where only the first argument has to be considered.
800 # If theObject has only one argument shape, this flag is automatically
801 # considered as True, not regarding really passed value.
802 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
803 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
804 # \return list of published sub-shapes
806 # @ref tui_restore_prs_params "Example"
807 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
808 theInheritFirstArg=False, theAddPrefix=True):
810 Publish sub-shapes, standing for arguments and sub-shapes of arguments
811 To be used from python scripts out of geompy.addToStudy (non-default usage)
814 theObject published GEOM.GEOM_Object, arguments of which will be published
815 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
816 If this list is empty, all operation arguments will be published
817 theFindMethod method to search sub-shapes, corresponding to arguments and
818 their sub-shapes. Value from enumeration GEOM.find_shape_method.
819 theInheritFirstArg set properties of the first argument for theObject.
820 Do not publish sub-shapes in place of arguments, but only
821 in place of sub-shapes of the first argument,
822 because the whole shape corresponds to the first argument.
823 Mainly to be used after transformations, but it also can be
824 usefull after partition with one object shape, and some other
825 operations, where only the first argument has to be considered.
826 If theObject has only one argument shape, this flag is automatically
827 considered as True, not regarding really passed value.
828 theAddPrefix add prefix "from_" to names of restored sub-shapes,
829 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
831 list of published sub-shapes
833 # Example: see GEOM_TestAll.py
834 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
835 theFindMethod, theInheritFirstArg, theAddPrefix)
837 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
838 # To be used from python scripts out of addToStudy() (non-default usage)
839 # \param theObject published GEOM.GEOM_Object, arguments of which will be published
840 # \param theArgs list of GEOM.GEOM_Object, operation arguments to be published.
841 # If this list is empty, all operation arguments will be published
842 # \param theFindMethod method to search sub-shapes, corresponding to arguments and
843 # their sub-shapes. Value from enumeration GEOM::find_shape_method.
844 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
845 # Do not publish sub-shapes in place of arguments, but only
846 # in place of sub-shapes of the first argument,
847 # because the whole shape corresponds to the first argument.
848 # Mainly to be used after transformations, but it also can be
849 # usefull after partition with one object shape, and some other
850 # operations, where only the first argument has to be considered.
851 # If theObject has only one argument shape, this flag is automatically
852 # considered as True, not regarding really passed value.
853 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
854 # and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
855 # \return list of published sub-shapes
857 # @ref tui_restore_prs_params "Example"
858 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
859 theInheritFirstArg=False, theAddPrefix=True):
861 Publish sub-shapes, standing for arguments and sub-shapes of arguments
862 To be used from python scripts out of geompy.addToStudy() (non-default usage)
865 theObject published GEOM.GEOM_Object, arguments of which will be published
866 theArgs list of GEOM.GEOM_Object, operation arguments to be published.
867 If this list is empty, all operation arguments will be published
868 theFindMethod method to search sub-shapes, corresponding to arguments and
869 their sub-shapes. Value from enumeration GEOM::find_shape_method.
870 theInheritFirstArg set properties of the first argument for theObject.
871 Do not publish sub-shapes in place of arguments, but only
872 in place of sub-shapes of the first argument,
873 because the whole shape corresponds to the first argument.
874 Mainly to be used after transformations, but it also can be
875 usefull after partition with one object shape, and some other
876 operations, where only the first argument has to be considered.
877 If theObject has only one argument shape, this flag is automatically
878 considered as True, not regarding really passed value.
879 theAddPrefix add prefix "from_" to names of restored sub-shapes,
880 and prefix "from_subshapes_of_" to names of partially restored sub-shapes.
883 list of published sub-shapes
885 # Example: see GEOM_TestAll.py
886 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
887 theFindMethod, theInheritFirstArg, theAddPrefix)
889 # end of l3_restore_ss
892 ## @addtogroup l3_basic_go
895 ## Create point by three coordinates.
896 # @param theX The X coordinate of the point.
897 # @param theY The Y coordinate of the point.
898 # @param theZ The Z coordinate of the point.
899 # @param theName Object name; when specified, this parameter is used
900 # for result publication in the study. Otherwise, if automatic
901 # publication is switched on, default value is used for result name.
903 # @return New GEOM.GEOM_Object, containing the created point.
905 # @ref tui_creation_point "Example"
906 def MakeVertex(self, theX, theY, theZ, theName=None):
908 Create point by three coordinates.
911 theX The X coordinate of the point.
912 theY The Y coordinate of the point.
913 theZ The Z coordinate of the point.
914 theName Object name; when specified, this parameter is used
915 for result publication in the study. Otherwise, if automatic
916 publication is switched on, default value is used for result name.
919 New GEOM.GEOM_Object, containing the created point.
921 # Example: see GEOM_TestAll.py
922 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
923 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
924 RaiseIfFailed("MakePointXYZ", self.BasicOp)
925 anObj.SetParameters(Parameters)
926 self._autoPublish(anObj, theName, "vertex")
929 ## Create a point, distant from the referenced point
930 # on the given distances along the coordinate axes.
931 # @param theReference The referenced point.
932 # @param theX Displacement from the referenced point along OX axis.
933 # @param theY Displacement from the referenced point along OY axis.
934 # @param theZ Displacement from the referenced point along OZ axis.
935 # @param theName Object name; when specified, this parameter is used
936 # for result publication in the study. Otherwise, if automatic
937 # publication is switched on, default value is used for result name.
939 # @return New GEOM.GEOM_Object, containing the created point.
941 # @ref tui_creation_point "Example"
942 def MakeVertexWithRef(self, theReference, theX, theY, theZ, theName=None):
944 Create a point, distant from the referenced point
945 on the given distances along the coordinate axes.
948 theReference The referenced point.
949 theX Displacement from the referenced point along OX axis.
950 theY Displacement from the referenced point along OY axis.
951 theZ Displacement from the referenced point along OZ axis.
952 theName Object name; when specified, this parameter is used
953 for result publication in the study. Otherwise, if automatic
954 publication is switched on, default value is used for result name.
957 New GEOM.GEOM_Object, containing the created point.
959 # Example: see GEOM_TestAll.py
960 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
961 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
962 RaiseIfFailed("MakePointWithReference", self.BasicOp)
963 anObj.SetParameters(Parameters)
964 self._autoPublish(anObj, theName, "vertex")
967 ## Create a point, corresponding to the given parameter on the given curve.
968 # @param theRefCurve The referenced curve.
969 # @param theParameter Value of parameter on the referenced curve.
970 # @param theName Object name; when specified, this parameter is used
971 # for result publication in the study. Otherwise, if automatic
972 # publication is switched on, default value is used for result name.
974 # @return New GEOM.GEOM_Object, containing the created point.
976 # @ref tui_creation_point "Example"
977 def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
979 Create a point, corresponding to the given parameter on the given curve.
982 theRefCurve The referenced curve.
983 theParameter Value of parameter on the referenced curve.
984 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.
989 New GEOM.GEOM_Object, containing the created point.
992 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
994 # Example: see GEOM_TestAll.py
995 theParameter, Parameters = ParseParameters(theParameter)
996 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
997 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
998 anObj.SetParameters(Parameters)
999 self._autoPublish(anObj, theName, "vertex")
1002 ## Create a point by projection give coordinates on the given curve
1003 # @param theRefCurve The referenced curve.
1004 # @param theX X-coordinate in 3D space
1005 # @param theY Y-coordinate in 3D space
1006 # @param theZ Z-coordinate in 3D space
1007 # @param theName Object name; when specified, this parameter is used
1008 # for result publication in the study. Otherwise, if automatic
1009 # publication is switched on, default value is used for result name.
1011 # @return New GEOM.GEOM_Object, containing the created point.
1013 # @ref tui_creation_point "Example"
1014 def MakeVertexOnCurveByCoord(self, theRefCurve, theX, theY, theZ, theName=None):
1016 Create a point by projection give coordinates on the given curve
1019 theRefCurve The referenced curve.
1020 theX X-coordinate in 3D space
1021 theY Y-coordinate in 3D space
1022 theZ Z-coordinate in 3D space
1023 theName Object name; when specified, this parameter is used
1024 for result publication in the study. Otherwise, if automatic
1025 publication is switched on, default value is used for result name.
1028 New GEOM.GEOM_Object, containing the created point.
1031 p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
1033 # Example: see GEOM_TestAll.py
1034 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1035 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
1036 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
1037 anObj.SetParameters(Parameters)
1038 self._autoPublish(anObj, theName, "vertex")
1041 ## Create a point, corresponding to the given length on the given curve.
1042 # @param theRefCurve The referenced curve.
1043 # @param theLength Length on the referenced curve. It can be negative.
1044 # @param theStartPoint Point allowing to choose the direction for the calculation
1045 # of the length. If None, start from the first point of theRefCurve.
1046 # @param theName Object name; when specified, this parameter is used
1047 # for result publication in the study. Otherwise, if automatic
1048 # publication is switched on, default value is used for result name.
1050 # @return New GEOM.GEOM_Object, containing the created point.
1052 # @ref tui_creation_point "Example"
1053 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
1055 Create a point, corresponding to the given length on the given curve.
1058 theRefCurve The referenced curve.
1059 theLength Length on the referenced curve. It can be negative.
1060 theStartPoint Point allowing to choose the direction for the calculation
1061 of the length. If None, start from the first point of theRefCurve.
1062 theName Object name; when specified, this parameter is used
1063 for result publication in the study. Otherwise, if automatic
1064 publication is switched on, default value is used for result name.
1067 New GEOM.GEOM_Object, containing the created point.
1069 # Example: see GEOM_TestAll.py
1070 theLength, Parameters = ParseParameters(theLength)
1071 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
1072 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
1073 anObj.SetParameters(Parameters)
1074 self._autoPublish(anObj, theName, "vertex")
1077 ## Create a point, corresponding to the given parameters on the
1079 # @param theRefSurf The referenced surface.
1080 # @param theUParameter Value of U-parameter on the referenced surface.
1081 # @param theVParameter Value of V-parameter on the referenced surface.
1082 # @param theName Object name; when specified, this parameter is used
1083 # for result publication in the study. Otherwise, if automatic
1084 # publication is switched on, default value is used for result name.
1086 # @return New GEOM.GEOM_Object, containing the created point.
1088 # @ref swig_MakeVertexOnSurface "Example"
1089 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter, theName=None):
1091 Create a point, corresponding to the given parameters on the
1095 theRefSurf The referenced surface.
1096 theUParameter Value of U-parameter on the referenced surface.
1097 theVParameter Value of V-parameter on the referenced surface.
1098 theName Object name; when specified, this parameter is used
1099 for result publication in the study. Otherwise, if automatic
1100 publication is switched on, default value is used for result name.
1103 New GEOM.GEOM_Object, containing the created point.
1106 p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8)
1108 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
1109 # Example: see GEOM_TestAll.py
1110 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
1111 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
1112 anObj.SetParameters(Parameters);
1113 self._autoPublish(anObj, theName, "vertex")
1116 ## Create a point by projection give coordinates on the given surface
1117 # @param theRefSurf The referenced surface.
1118 # @param theX X-coordinate in 3D space
1119 # @param theY Y-coordinate in 3D space
1120 # @param theZ Z-coordinate in 3D space
1121 # @param theName Object name; when specified, this parameter is used
1122 # for result publication in the study. Otherwise, if automatic
1123 # publication is switched on, default value is used for result name.
1125 # @return New GEOM.GEOM_Object, containing the created point.
1127 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
1128 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ, theName=None):
1130 Create a point by projection give coordinates on the given surface
1133 theRefSurf The referenced surface.
1134 theX X-coordinate in 3D space
1135 theY Y-coordinate in 3D space
1136 theZ Z-coordinate in 3D space
1137 theName Object name; when specified, this parameter is used
1138 for result publication in the study. Otherwise, if automatic
1139 publication is switched on, default value is used for result name.
1142 New GEOM.GEOM_Object, containing the created point.
1145 p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(Face, 0., 0., 0.)
1147 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
1148 # Example: see GEOM_TestAll.py
1149 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
1150 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
1151 anObj.SetParameters(Parameters);
1152 self._autoPublish(anObj, theName, "vertex")
1155 ## Create a point, which lays on the given face.
1156 # The point will lay in arbitrary place of the face.
1157 # The only condition on it is a non-zero distance to the face boundary.
1158 # Such point can be used to uniquely identify the face inside any
1159 # shape in case, when the shape does not contain overlapped faces.
1160 # @param theFace The referenced face.
1161 # @param theName Object name; when specified, this parameter is used
1162 # for result publication in the study. Otherwise, if automatic
1163 # publication is switched on, default value is used for result name.
1165 # @return New GEOM.GEOM_Object, containing the created point.
1167 # @ref swig_MakeVertexInsideFace "Example"
1168 def MakeVertexInsideFace (self, theFace, theName=None):
1170 Create a point, which lays on the given face.
1171 The point will lay in arbitrary place of the face.
1172 The only condition on it is a non-zero distance to the face boundary.
1173 Such point can be used to uniquely identify the face inside any
1174 shape in case, when the shape does not contain overlapped faces.
1177 theFace The referenced face.
1178 theName Object name; when specified, this parameter is used
1179 for result publication in the study. Otherwise, if automatic
1180 publication is switched on, default value is used for result name.
1183 New GEOM.GEOM_Object, containing the created point.
1186 p_on_face = geompy.MakeVertexInsideFace(Face)
1188 # Example: see GEOM_TestAll.py
1189 anObj = self.BasicOp.MakePointOnFace(theFace)
1190 RaiseIfFailed("MakeVertexInsideFace", self.BasicOp)
1191 self._autoPublish(anObj, theName, "vertex")
1194 ## Create a point on intersection of two lines.
1195 # @param theRefLine1, theRefLine2 The referenced lines.
1196 # @param theName Object name; when specified, this parameter is used
1197 # for result publication in the study. Otherwise, if automatic
1198 # publication is switched on, default value is used for result name.
1200 # @return New GEOM.GEOM_Object, containing the created point.
1202 # @ref swig_MakeVertexOnLinesIntersection "Example"
1203 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2, theName=None):
1205 Create a point on intersection of two lines.
1208 theRefLine1, theRefLine2 The referenced lines.
1209 theName Object name; when specified, this parameter is used
1210 for result publication in the study. Otherwise, if automatic
1211 publication is switched on, default value is used for result name.
1214 New GEOM.GEOM_Object, containing the created point.
1216 # Example: see GEOM_TestAll.py
1217 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
1218 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
1219 self._autoPublish(anObj, theName, "vertex")
1222 ## Create a tangent, corresponding to the given parameter on the given curve.
1223 # @param theRefCurve The referenced curve.
1224 # @param theParameter Value of parameter on the referenced curve.
1225 # @param theName Object name; when specified, this parameter is used
1226 # for result publication in the study. Otherwise, if automatic
1227 # publication is switched on, default value is used for result name.
1229 # @return New GEOM.GEOM_Object, containing the created tangent.
1231 # @ref swig_MakeTangentOnCurve "Example"
1232 def MakeTangentOnCurve(self, theRefCurve, theParameter, theName=None):
1234 Create a tangent, corresponding to the given parameter on the given curve.
1237 theRefCurve The referenced curve.
1238 theParameter Value of parameter on the referenced curve.
1239 theName Object name; when specified, this parameter is used
1240 for result publication in the study. Otherwise, if automatic
1241 publication is switched on, default value is used for result name.
1244 New GEOM.GEOM_Object, containing the created tangent.
1247 tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7)
1249 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
1250 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
1251 self._autoPublish(anObj, theName, "tangent")
1254 ## Create a tangent plane, corresponding to the given parameter on the given face.
1255 # @param theFace The face for which tangent plane should be built.
1256 # @param theParameterV vertical value of the center point (0.0 - 1.0).
1257 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
1258 # @param theTrimSize the size of plane.
1259 # @param theName Object name; when specified, this parameter is used
1260 # for result publication in the study. Otherwise, if automatic
1261 # publication is switched on, default value is used for result name.
1263 # @return New GEOM.GEOM_Object, containing the created tangent.
1265 # @ref swig_MakeTangentPlaneOnFace "Example"
1266 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize, theName=None):
1268 Create a tangent plane, corresponding to the given parameter on the given face.
1271 theFace The face for which tangent plane should be built.
1272 theParameterV vertical value of the center point (0.0 - 1.0).
1273 theParameterU horisontal value of the center point (0.0 - 1.0).
1274 theTrimSize the size of plane.
1275 theName Object name; when specified, this parameter is used
1276 for result publication in the study. Otherwise, if automatic
1277 publication is switched on, default value is used for result name.
1280 New GEOM.GEOM_Object, containing the created tangent.
1283 an_on_face = geompy.MakeTangentPlaneOnFace(tan_extrusion, 0.7, 0.5, 150)
1285 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
1286 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
1287 self._autoPublish(anObj, theName, "tangent")
1290 ## Create a vector with the given components.
1291 # @param theDX X component of the vector.
1292 # @param theDY Y component of the vector.
1293 # @param theDZ Z component of the vector.
1294 # @param theName Object name; when specified, this parameter is used
1295 # for result publication in the study. Otherwise, if automatic
1296 # publication is switched on, default value is used for result name.
1298 # @return New GEOM.GEOM_Object, containing the created vector.
1300 # @ref tui_creation_vector "Example"
1301 def MakeVectorDXDYDZ(self, theDX, theDY, theDZ, theName=None):
1303 Create a vector with the given components.
1306 theDX X component of the vector.
1307 theDY Y component of the vector.
1308 theDZ Z component of the vector.
1309 theName Object name; when specified, this parameter is used
1310 for result publication in the study. Otherwise, if automatic
1311 publication is switched on, default value is used for result name.
1314 New GEOM.GEOM_Object, containing the created vector.
1316 # Example: see GEOM_TestAll.py
1317 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1318 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
1319 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
1320 anObj.SetParameters(Parameters)
1321 self._autoPublish(anObj, theName, "vector")
1324 ## Create a vector between two points.
1325 # @param thePnt1 Start point for the vector.
1326 # @param thePnt2 End point for the vector.
1327 # @param theName Object name; when specified, this parameter is used
1328 # for result publication in the study. Otherwise, if automatic
1329 # publication is switched on, default value is used for result name.
1331 # @return New GEOM.GEOM_Object, containing the created vector.
1333 # @ref tui_creation_vector "Example"
1334 def MakeVector(self, thePnt1, thePnt2, theName=None):
1336 Create a vector between two points.
1339 thePnt1 Start point for the vector.
1340 thePnt2 End point for the vector.
1341 theName Object name; when specified, this parameter is used
1342 for result publication in the study. Otherwise, if automatic
1343 publication is switched on, default value is used for result name.
1346 New GEOM.GEOM_Object, containing the created vector.
1348 # Example: see GEOM_TestAll.py
1349 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
1350 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
1351 self._autoPublish(anObj, theName, "vector")
1354 ## Create a line, passing through the given point
1355 # and parrallel to the given direction
1356 # @param thePnt Point. The resulting line will pass through it.
1357 # @param theDir Direction. The resulting line will be parallel to it.
1358 # @param 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.
1362 # @return New GEOM.GEOM_Object, containing the created line.
1364 # @ref tui_creation_line "Example"
1365 def MakeLine(self, thePnt, theDir, theName=None):
1367 Create a line, passing through the given point
1368 and parrallel to the given direction
1371 thePnt Point. The resulting line will pass through it.
1372 theDir Direction. The resulting line will be parallel to it.
1373 theName Object name; when specified, this parameter is used
1374 for result publication in the study. Otherwise, if automatic
1375 publication is switched on, default value is used for result name.
1378 New GEOM.GEOM_Object, containing the created line.
1380 # Example: see GEOM_TestAll.py
1381 anObj = self.BasicOp.MakeLine(thePnt, theDir)
1382 RaiseIfFailed("MakeLine", self.BasicOp)
1383 self._autoPublish(anObj, theName, "line")
1386 ## Create a line, passing through the given points
1387 # @param thePnt1 First of two points, defining the line.
1388 # @param thePnt2 Second of two points, defining the line.
1389 # @param theName Object name; when specified, this parameter is used
1390 # for result publication in the study. Otherwise, if automatic
1391 # publication is switched on, default value is used for result name.
1393 # @return New GEOM.GEOM_Object, containing the created line.
1395 # @ref tui_creation_line "Example"
1396 def MakeLineTwoPnt(self, thePnt1, thePnt2, theName=None):
1398 Create a line, passing through the given points
1401 thePnt1 First of two points, defining the line.
1402 thePnt2 Second of two points, defining the line.
1403 theName Object name; when specified, this parameter is used
1404 for result publication in the study. Otherwise, if automatic
1405 publication is switched on, default value is used for result name.
1408 New GEOM.GEOM_Object, containing the created line.
1410 # Example: see GEOM_TestAll.py
1411 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
1412 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
1413 self._autoPublish(anObj, theName, "line")
1416 ## Create a line on two faces intersection.
1417 # @param theFace1 First of two faces, defining the line.
1418 # @param theFace2 Second of two faces, defining the line.
1419 # @param theName Object name; when specified, this parameter is used
1420 # for result publication in the study. Otherwise, if automatic
1421 # publication is switched on, default value is used for result name.
1423 # @return New GEOM.GEOM_Object, containing the created line.
1425 # @ref swig_MakeLineTwoFaces "Example"
1426 def MakeLineTwoFaces(self, theFace1, theFace2, theName=None):
1428 Create a line on two faces intersection.
1431 theFace1 First of two faces, defining the line.
1432 theFace2 Second of two faces, defining the line.
1433 theName Object name; when specified, this parameter is used
1434 for result publication in the study. Otherwise, if automatic
1435 publication is switched on, default value is used for result name.
1438 New GEOM.GEOM_Object, containing the created line.
1440 # Example: see GEOM_TestAll.py
1441 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
1442 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
1443 self._autoPublish(anObj, theName, "line")
1446 ## Create a plane, passing through the given point
1447 # and normal to the given vector.
1448 # @param thePnt Point, the plane has to pass through.
1449 # @param theVec Vector, defining the plane normal direction.
1450 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1451 # @param theName Object name; when specified, this parameter is used
1452 # for result publication in the study. Otherwise, if automatic
1453 # publication is switched on, default value is used for result name.
1455 # @return New GEOM.GEOM_Object, containing the created plane.
1457 # @ref tui_creation_plane "Example"
1458 def MakePlane(self, thePnt, theVec, theTrimSize, theName=None):
1460 Create a plane, passing through the given point
1461 and normal to the given vector.
1464 thePnt Point, the plane has to pass through.
1465 theVec Vector, defining the plane normal direction.
1466 theTrimSize Half size of a side of quadrangle face, representing the plane.
1467 theName Object name; when specified, this parameter is used
1468 for result publication in the study. Otherwise, if automatic
1469 publication is switched on, default value is used for result name.
1472 New GEOM.GEOM_Object, containing the created plane.
1474 # Example: see GEOM_TestAll.py
1475 theTrimSize, Parameters = ParseParameters(theTrimSize);
1476 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
1477 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
1478 anObj.SetParameters(Parameters)
1479 self._autoPublish(anObj, theName, "plane")
1482 ## Create a plane, passing through the three given points
1483 # @param thePnt1 First of three points, defining the plane.
1484 # @param thePnt2 Second of three points, defining the plane.
1485 # @param thePnt3 Fird of three points, defining the plane.
1486 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1487 # @param theName Object name; when specified, this parameter is used
1488 # for result publication in the study. Otherwise, if automatic
1489 # publication is switched on, default value is used for result name.
1491 # @return New GEOM.GEOM_Object, containing the created plane.
1493 # @ref tui_creation_plane "Example"
1494 def MakePlaneThreePnt(self, thePnt1, thePnt2, thePnt3, theTrimSize, theName=None):
1496 Create a plane, passing through the three given points
1499 thePnt1 First of three points, defining the plane.
1500 thePnt2 Second of three points, defining the plane.
1501 thePnt3 Fird of three points, defining the plane.
1502 theTrimSize Half size of a side of quadrangle face, representing the plane.
1503 theName Object name; when specified, this parameter is used
1504 for result publication in the study. Otherwise, if automatic
1505 publication is switched on, default value is used for result name.
1508 New GEOM.GEOM_Object, containing the created plane.
1510 # Example: see GEOM_TestAll.py
1511 theTrimSize, Parameters = ParseParameters(theTrimSize);
1512 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
1513 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
1514 anObj.SetParameters(Parameters)
1515 self._autoPublish(anObj, theName, "plane")
1518 ## Create a plane, similar to the existing one, but with another size of representing face.
1519 # @param theFace Referenced plane or LCS(Marker).
1520 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
1521 # @param theName Object name; when specified, this parameter is used
1522 # for result publication in the study. Otherwise, if automatic
1523 # publication is switched on, default value is used for result name.
1525 # @return New GEOM.GEOM_Object, containing the created plane.
1527 # @ref tui_creation_plane "Example"
1528 def MakePlaneFace(self, theFace, theTrimSize, theName=None):
1530 Create a plane, similar to the existing one, but with another size of representing face.
1533 theFace Referenced plane or LCS(Marker).
1534 theTrimSize New half size of a side of quadrangle face, representing the plane.
1535 theName Object name; when specified, this parameter is used
1536 for result publication in the study. Otherwise, if automatic
1537 publication is switched on, default value is used for result name.
1540 New GEOM.GEOM_Object, containing the created plane.
1542 # Example: see GEOM_TestAll.py
1543 theTrimSize, Parameters = ParseParameters(theTrimSize);
1544 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
1545 RaiseIfFailed("MakePlaneFace", self.BasicOp)
1546 anObj.SetParameters(Parameters)
1547 self._autoPublish(anObj, theName, "plane")
1550 ## Create a plane, passing through the 2 vectors
1551 # with center in a start point of the first vector.
1552 # @param theVec1 Vector, defining center point and plane direction.
1553 # @param theVec2 Vector, defining the plane normal direction.
1554 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1555 # @param theName Object name; when specified, this parameter is used
1556 # for result publication in the study. Otherwise, if automatic
1557 # publication is switched on, default value is used for result name.
1559 # @return New GEOM.GEOM_Object, containing the created plane.
1561 # @ref tui_creation_plane "Example"
1562 def MakePlane2Vec(self, theVec1, theVec2, theTrimSize, theName=None):
1564 Create a plane, passing through the 2 vectors
1565 with center in a start point of the first vector.
1568 theVec1 Vector, defining center point and plane direction.
1569 theVec2 Vector, defining the plane normal direction.
1570 theTrimSize Half size of a side of quadrangle face, representing the plane.
1571 theName Object name; when specified, this parameter is used
1572 for result publication in the study. Otherwise, if automatic
1573 publication is switched on, default value is used for result name.
1576 New GEOM.GEOM_Object, containing the created plane.
1578 # Example: see GEOM_TestAll.py
1579 theTrimSize, Parameters = ParseParameters(theTrimSize);
1580 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
1581 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
1582 anObj.SetParameters(Parameters)
1583 self._autoPublish(anObj, theName, "plane")
1586 ## Create a plane, based on a Local coordinate system.
1587 # @param theLCS coordinate system, defining plane.
1588 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
1589 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1590 # @param theName Object name; when specified, this parameter is used
1591 # for result publication in the study. Otherwise, if automatic
1592 # publication is switched on, default value is used for result name.
1594 # @return New GEOM.GEOM_Object, containing the created plane.
1596 # @ref tui_creation_plane "Example"
1597 def MakePlaneLCS(self, theLCS, theTrimSize, theOrientation, theName=None):
1599 Create a plane, based on a Local coordinate system.
1602 theLCS coordinate system, defining plane.
1603 theTrimSize Half size of a side of quadrangle face, representing the plane.
1604 theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
1605 theName Object name; when specified, this parameter is used
1606 for result publication in the study. Otherwise, if automatic
1607 publication is switched on, default value is used for result name.
1610 New GEOM.GEOM_Object, containing the created plane.
1612 # Example: see GEOM_TestAll.py
1613 theTrimSize, Parameters = ParseParameters(theTrimSize);
1614 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
1615 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
1616 anObj.SetParameters(Parameters)
1617 self._autoPublish(anObj, theName, "plane")
1620 ## Create a local coordinate system.
1621 # @param OX,OY,OZ Three coordinates of coordinate system origin.
1622 # @param XDX,XDY,XDZ Three components of OX direction
1623 # @param YDX,YDY,YDZ Three components of OY direction
1624 # @param theName Object name; when specified, this parameter is used
1625 # for result publication in the study. Otherwise, if automatic
1626 # publication is switched on, default value is used for result name.
1628 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1630 # @ref swig_MakeMarker "Example"
1631 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, theName=None):
1633 Create a local coordinate system.
1636 OX,OY,OZ Three coordinates of coordinate system origin.
1637 XDX,XDY,XDZ Three components of OX direction
1638 YDX,YDY,YDZ Three components of OY direction
1639 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.
1644 New GEOM.GEOM_Object, containing the created coordinate system.
1646 # Example: see GEOM_TestAll.py
1647 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
1648 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
1649 RaiseIfFailed("MakeMarker", self.BasicOp)
1650 anObj.SetParameters(Parameters)
1651 self._autoPublish(anObj, theName, "lcs")
1654 ## Create a local coordinate system from shape.
1655 # @param theShape The initial shape to detect the coordinate system.
1656 # @param theName Object name; when specified, this parameter is used
1657 # for result publication in the study. Otherwise, if automatic
1658 # publication is switched on, default value is used for result name.
1660 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1662 # @ref tui_creation_lcs "Example"
1663 def MakeMarkerFromShape(self, theShape, theName=None):
1665 Create a local coordinate system from shape.
1668 theShape The initial shape to detect the coordinate system.
1669 theName Object name; when specified, this parameter is used
1670 for result publication in the study. Otherwise, if automatic
1671 publication is switched on, default value is used for result name.
1674 New GEOM.GEOM_Object, containing the created coordinate system.
1676 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
1677 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
1678 self._autoPublish(anObj, theName, "lcs")
1681 ## Create a local coordinate system from point and two vectors.
1682 # @param theOrigin Point of coordinate system origin.
1683 # @param theXVec Vector of X direction
1684 # @param theYVec Vector of Y direction
1685 # @param theName Object name; when specified, this parameter is used
1686 # for result publication in the study. Otherwise, if automatic
1687 # publication is switched on, default value is used for result name.
1689 # @return New GEOM.GEOM_Object, containing the created coordinate system.
1691 # @ref tui_creation_lcs "Example"
1692 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec, theName=None):
1694 Create a local coordinate system from point and two vectors.
1697 theOrigin Point of coordinate system origin.
1698 theXVec Vector of X direction
1699 theYVec Vector of Y direction
1700 theName Object name; when specified, this parameter is used
1701 for result publication in the study. Otherwise, if automatic
1702 publication is switched on, default value is used for result name.
1705 New GEOM.GEOM_Object, containing the created coordinate system.
1708 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
1709 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
1710 self._autoPublish(anObj, theName, "lcs")
1713 # end of l3_basic_go
1716 ## @addtogroup l4_curves
1719 ## Create an arc of circle, passing through three given points.
1720 # @param thePnt1 Start point of the arc.
1721 # @param thePnt2 Middle point of the arc.
1722 # @param thePnt3 End point of the arc.
1723 # @param theName Object name; when specified, this parameter is used
1724 # for result publication in the study. Otherwise, if automatic
1725 # publication is switched on, default value is used for result name.
1727 # @return New GEOM.GEOM_Object, containing the created arc.
1729 # @ref swig_MakeArc "Example"
1730 def MakeArc(self, thePnt1, thePnt2, thePnt3, theName=None):
1732 Create an arc of circle, passing through three given points.
1735 thePnt1 Start point of the arc.
1736 thePnt2 Middle point of the arc.
1737 thePnt3 End point of the arc.
1738 theName Object name; when specified, this parameter is used
1739 for result publication in the study. Otherwise, if automatic
1740 publication is switched on, default value is used for result name.
1743 New GEOM.GEOM_Object, containing the created arc.
1745 # Example: see GEOM_TestAll.py
1746 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
1747 RaiseIfFailed("MakeArc", self.CurvesOp)
1748 self._autoPublish(anObj, theName, "arc")
1751 ## Create an arc of circle from a center and 2 points.
1752 # @param thePnt1 Center of the arc
1753 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
1754 # @param thePnt3 End point of the arc (Gives also a direction)
1755 # @param theSense Orientation of the arc
1756 # @param theName Object name; when specified, this parameter is used
1757 # for result publication in the study. Otherwise, if automatic
1758 # publication is switched on, default value is used for result name.
1760 # @return New GEOM.GEOM_Object, containing the created arc.
1762 # @ref swig_MakeArc "Example"
1763 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False, theName=None):
1765 Create an arc of circle from a center and 2 points.
1768 thePnt1 Center of the arc
1769 thePnt2 Start point of the arc. (Gives also the radius of the arc)
1770 thePnt3 End point of the arc (Gives also a direction)
1771 theSense Orientation of the arc
1772 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.
1777 New GEOM.GEOM_Object, containing the created arc.
1779 # Example: see GEOM_TestAll.py
1780 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
1781 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
1782 self._autoPublish(anObj, theName, "arc")
1785 ## Create an arc of ellipse, of center and two points.
1786 # @param theCenter Center of the arc.
1787 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1788 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1789 # @param theName Object name; when specified, this parameter is used
1790 # for result publication in the study. Otherwise, if automatic
1791 # publication is switched on, default value is used for result name.
1793 # @return New GEOM.GEOM_Object, containing the created arc.
1795 # @ref swig_MakeArc "Example"
1796 def MakeArcOfEllipse(self, theCenter, thePnt1, thePnt2, theName=None):
1798 Create an arc of ellipse, of center and two points.
1801 theCenter Center of the arc.
1802 thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
1803 thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
1804 theName Object name; when specified, this parameter is used
1805 for result publication in the study. Otherwise, if automatic
1806 publication is switched on, default value is used for result name.
1809 New GEOM.GEOM_Object, containing the created arc.
1811 # Example: see GEOM_TestAll.py
1812 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
1813 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
1814 self._autoPublish(anObj, theName, "arc")
1817 ## Create a circle with given center, normal vector and radius.
1818 # @param thePnt Circle center.
1819 # @param theVec Vector, normal to the plane of the circle.
1820 # @param theR Circle radius.
1821 # @param 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.
1825 # @return New GEOM.GEOM_Object, containing the created circle.
1827 # @ref tui_creation_circle "Example"
1828 def MakeCircle(self, thePnt, theVec, theR, theName=None):
1830 Create a circle with given center, normal vector and radius.
1833 thePnt Circle center.
1834 theVec Vector, normal to the plane of the circle.
1836 theName Object name; when specified, this parameter is used
1837 for result publication in the study. Otherwise, if automatic
1838 publication is switched on, default value is used for result name.
1841 New GEOM.GEOM_Object, containing the created circle.
1843 # Example: see GEOM_TestAll.py
1844 theR, Parameters = ParseParameters(theR)
1845 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
1846 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1847 anObj.SetParameters(Parameters)
1848 self._autoPublish(anObj, theName, "circle")
1851 ## Create a circle with given radius.
1852 # Center of the circle will be in the origin of global
1853 # coordinate system and normal vector will be codirected with Z axis
1854 # @param theR Circle radius.
1855 # @param theName Object name; when specified, this parameter is used
1856 # for result publication in the study. Otherwise, if automatic
1857 # publication is switched on, default value is used for result name.
1859 # @return New GEOM.GEOM_Object, containing the created circle.
1860 def MakeCircleR(self, theR, theName=None):
1862 Create a circle with given radius.
1863 Center of the circle will be in the origin of global
1864 coordinate system and normal vector will be codirected with Z axis
1868 theName Object name; when specified, this parameter is used
1869 for result publication in the study. Otherwise, if automatic
1870 publication is switched on, default value is used for result name.
1873 New GEOM.GEOM_Object, containing the created circle.
1875 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
1876 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
1877 self._autoPublish(anObj, theName, "circle")
1880 ## Create a circle, passing through three given points
1881 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1882 # @param theName Object name; when specified, this parameter is used
1883 # for result publication in the study. Otherwise, if automatic
1884 # publication is switched on, default value is used for result name.
1886 # @return New GEOM.GEOM_Object, containing the created circle.
1888 # @ref tui_creation_circle "Example"
1889 def MakeCircleThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1891 Create a circle, passing through three given points
1894 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1895 theName Object name; when specified, this parameter is used
1896 for result publication in the study. Otherwise, if automatic
1897 publication is switched on, default value is used for result name.
1900 New GEOM.GEOM_Object, containing the created circle.
1902 # Example: see GEOM_TestAll.py
1903 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
1904 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
1905 self._autoPublish(anObj, theName, "circle")
1908 ## Create a circle, with given point1 as center,
1909 # passing through the point2 as radius and laying in the plane,
1910 # defined by all three given points.
1911 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
1912 # @param theName Object name; when specified, this parameter is used
1913 # for result publication in the study. Otherwise, if automatic
1914 # publication is switched on, default value is used for result name.
1916 # @return New GEOM.GEOM_Object, containing the created circle.
1918 # @ref swig_MakeCircle "Example"
1919 def MakeCircleCenter2Pnt(self, thePnt1, thePnt2, thePnt3, theName=None):
1921 Create a circle, with given point1 as center,
1922 passing through the point2 as radius and laying in the plane,
1923 defined by all three given points.
1926 thePnt1,thePnt2,thePnt3 Points, defining the circle.
1927 theName Object name; when specified, this parameter is used
1928 for result publication in the study. Otherwise, if automatic
1929 publication is switched on, default value is used for result name.
1932 New GEOM.GEOM_Object, containing the created circle.
1934 # Example: see GEOM_example6.py
1935 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
1936 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
1937 self._autoPublish(anObj, theName, "circle")
1940 ## Create an ellipse with given center, normal vector and radiuses.
1941 # @param thePnt Ellipse center.
1942 # @param theVec Vector, normal to the plane of the ellipse.
1943 # @param theRMajor Major ellipse radius.
1944 # @param theRMinor Minor ellipse radius.
1945 # @param theVecMaj Vector, direction of the ellipse's main axis.
1946 # @param theName Object name; when specified, this parameter is used
1947 # for result publication in the study. Otherwise, if automatic
1948 # publication is switched on, default value is used for result name.
1950 # @return New GEOM.GEOM_Object, containing the created ellipse.
1952 # @ref tui_creation_ellipse "Example"
1953 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None, theName=None):
1955 Create an ellipse with given center, normal vector and radiuses.
1958 thePnt Ellipse center.
1959 theVec Vector, normal to the plane of the ellipse.
1960 theRMajor Major ellipse radius.
1961 theRMinor Minor ellipse radius.
1962 theVecMaj Vector, direction of the ellipse's main axis.
1963 theName Object name; when specified, this parameter is used
1964 for result publication in the study. Otherwise, if automatic
1965 publication is switched on, default value is used for result name.
1968 New GEOM.GEOM_Object, containing the created ellipse.
1970 # Example: see GEOM_TestAll.py
1971 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
1972 if theVecMaj is not None:
1973 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
1975 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
1977 RaiseIfFailed("MakeEllipse", self.CurvesOp)
1978 anObj.SetParameters(Parameters)
1979 self._autoPublish(anObj, theName, "ellipse")
1982 ## Create an ellipse with given radiuses.
1983 # Center of the ellipse will be in the origin of global
1984 # coordinate system and normal vector will be codirected with Z axis
1985 # @param theRMajor Major ellipse radius.
1986 # @param theRMinor Minor ellipse radius.
1987 # @param theName Object name; when specified, this parameter is used
1988 # for result publication in the study. Otherwise, if automatic
1989 # publication is switched on, default value is used for result name.
1991 # @return New GEOM.GEOM_Object, containing the created ellipse.
1992 def MakeEllipseRR(self, theRMajor, theRMinor, theName=None):
1994 Create an ellipse with given radiuses.
1995 Center of the ellipse will be in the origin of global
1996 coordinate system and normal vector will be codirected with Z axis
1999 theRMajor Major ellipse radius.
2000 theRMinor Minor ellipse radius.
2001 theName Object name; when specified, this parameter is used
2002 for result publication in the study. Otherwise, if automatic
2003 publication is switched on, default value is used for result name.
2006 New GEOM.GEOM_Object, containing the created ellipse.
2008 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
2009 RaiseIfFailed("MakeEllipse", self.CurvesOp)
2010 self._autoPublish(anObj, theName, "ellipse")
2013 ## Create a polyline on the set of points.
2014 # @param thePoints Sequence of points for the polyline.
2015 # @param theIsClosed If True, build a closed wire.
2016 # @param theName Object name; when specified, this parameter is used
2017 # for result publication in the study. Otherwise, if automatic
2018 # publication is switched on, default value is used for result name.
2020 # @return New GEOM.GEOM_Object, containing the created polyline.
2022 # @ref tui_creation_curve "Example"
2023 def MakePolyline(self, thePoints, theIsClosed=False, theName=None):
2025 Create a polyline on the set of points.
2028 thePoints Sequence of points for the polyline.
2029 theIsClosed If True, build a closed wire.
2030 theName Object name; when specified, this parameter is used
2031 for result publication in the study. Otherwise, if automatic
2032 publication is switched on, default value is used for result name.
2035 New GEOM.GEOM_Object, containing the created polyline.
2037 # Example: see GEOM_TestAll.py
2038 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
2039 RaiseIfFailed("MakePolyline", self.CurvesOp)
2040 self._autoPublish(anObj, theName, "polyline")
2043 ## Create bezier curve on the set of points.
2044 # @param thePoints Sequence of points for the bezier curve.
2045 # @param theIsClosed If True, build a closed curve.
2046 # @param theName Object name; when specified, this parameter is used
2047 # for result publication in the study. Otherwise, if automatic
2048 # publication is switched on, default value is used for result name.
2050 # @return New GEOM.GEOM_Object, containing the created bezier curve.
2052 # @ref tui_creation_curve "Example"
2053 def MakeBezier(self, thePoints, theIsClosed=False, theName=None):
2055 Create bezier curve on the set of points.
2058 thePoints Sequence of points for the bezier curve.
2059 theIsClosed If True, build a closed curve.
2060 theName Object name; when specified, this parameter is used
2061 for result publication in the study. Otherwise, if automatic
2062 publication is switched on, default value is used for result name.
2065 New GEOM.GEOM_Object, containing the created bezier curve.
2067 # Example: see GEOM_TestAll.py
2068 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
2069 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
2070 self._autoPublish(anObj, theName, "bezier")
2073 ## Create B-Spline curve on the set of points.
2074 # @param thePoints Sequence of points for the B-Spline curve.
2075 # @param theIsClosed If True, build a closed curve.
2076 # @param theDoReordering If TRUE, the algo does not follow the order of
2077 # \a thePoints but searches for the closest vertex.
2078 # @param theName Object name; when specified, this parameter is used
2079 # for result publication in the study. Otherwise, if automatic
2080 # publication is switched on, default value is used for result name.
2082 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2084 # @ref tui_creation_curve "Example"
2085 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False, theName=None):
2087 Create B-Spline curve on the set of points.
2090 thePoints Sequence of points for the B-Spline curve.
2091 theIsClosed If True, build a closed curve.
2092 theDoReordering If True, the algo does not follow the order of
2093 thePoints but searches for the closest vertex.
2094 theName Object name; when specified, this parameter is used
2095 for result publication in the study. Otherwise, if automatic
2096 publication is switched on, default value is used for result name.
2099 New GEOM.GEOM_Object, containing the created B-Spline curve.
2101 # Example: see GEOM_TestAll.py
2102 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
2103 RaiseIfFailed("MakeInterpol", self.CurvesOp)
2104 self._autoPublish(anObj, theName, "bspline")
2107 ## Create B-Spline curve on the set of points.
2108 # @param thePoints Sequence of points for the B-Spline curve.
2109 # @param theFirstVec Vector object, defining the curve direction at its first point.
2110 # @param theLastVec Vector object, defining the curve direction at its last point.
2111 # @param theName Object name; when specified, this parameter is used
2112 # for result publication in the study. Otherwise, if automatic
2113 # publication is switched on, default value is used for result name.
2115 # @return New GEOM.GEOM_Object, containing the created B-Spline curve.
2117 # @ref tui_creation_curve "Example"
2118 def MakeInterpolWithTangents(self, thePoints, theFirstVec, theLastVec, theName=None):
2120 Create B-Spline curve on the set of points.
2123 thePoints Sequence of points for the B-Spline curve.
2124 theFirstVec Vector object, defining the curve direction at its first point.
2125 theLastVec Vector object, defining the curve direction at its last point.
2126 theName Object name; when specified, this parameter is used
2127 for result publication in the study. Otherwise, if automatic
2128 publication is switched on, default value is used for result name.
2131 New GEOM.GEOM_Object, containing the created B-Spline curve.
2133 # Example: see GEOM_TestAll.py
2134 anObj = self.CurvesOp.MakeSplineInterpolWithTangents(thePoints, theFirstVec, theLastVec)
2135 RaiseIfFailed("MakeInterpolWithTangents", self.CurvesOp)
2136 self._autoPublish(anObj, theName, "bspline")
2139 ## Creates a curve using the parametric definition of the basic points.
2140 # @param thexExpr parametric equation of the coordinates X.
2141 # @param theyExpr parametric equation of the coordinates Y.
2142 # @param thezExpr parametric equation of the coordinates Z.
2143 # @param theParamMin the minimal value of the parameter.
2144 # @param theParamMax the maximum value of the parameter.
2145 # @param theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2146 # @param theCurveType the type of the curve.
2147 # @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.
2148 # @param theName Object name; when specified, this parameter is used
2149 # for result publication in the study. Otherwise, if automatic
2150 # publication is switched on, default value is used for result name.
2152 # @return New GEOM.GEOM_Object, containing the created curve.
2154 # @ref tui_creation_curve "Example"
2155 def MakeCurveParametric(self, thexExpr, theyExpr, thezExpr,
2156 theParamMin, theParamMax, theParamStep, theCurveType, theNewMethod=False, theName=None ):
2158 Creates a curve using the parametric definition of the basic points.
2161 thexExpr parametric equation of the coordinates X.
2162 theyExpr parametric equation of the coordinates Y.
2163 thezExpr parametric equation of the coordinates Z.
2164 theParamMin the minimal value of the parameter.
2165 theParamMax the maximum value of the parameter.
2166 theParamStep the number of steps if theNewMethod = True, else step value of the parameter.
2167 theCurveType the type of the curve.
2168 theNewMethod flag for switching to the new method if the flag is set to false a deprecated
2169 method is used which can lead to a bug.
2170 theName Object name; when specified, this parameter is used
2171 for result publication in the study. Otherwise, if automatic
2172 publication is switched on, default value is used for result name.
2175 New GEOM.GEOM_Object, containing the created curve.
2177 theParamMin,theParamMax,theParamStep,Parameters = ParseParameters(theParamMin,theParamMax,theParamStep)
2179 anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2181 anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
2182 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
2183 anObj.SetParameters(Parameters)
2184 self._autoPublish(anObj, theName, "curve")
2190 ## @addtogroup l3_sketcher
2193 ## Create a sketcher (wire or face), following the textual description,
2194 # passed through <VAR>theCommand</VAR> argument. \n
2195 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
2196 # Format of the description string have to be the following:
2198 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2201 # - x1, y1 are coordinates of the first sketcher point (zero by default),
2203 # - "R angle" : Set the direction by angle
2204 # - "D dx dy" : Set the direction by DX & DY
2207 # - "TT x y" : Create segment by point at X & Y
2208 # - "T dx dy" : Create segment by point with DX & DY
2209 # - "L length" : Create segment by direction & Length
2210 # - "IX x" : Create segment by direction & Intersect. X
2211 # - "IY y" : Create segment by direction & Intersect. Y
2214 # - "C radius length" : Create arc by direction, radius and length(in degree)
2215 # - "AA x y": Create arc by point at X & Y
2216 # - "A dx dy" : Create arc by point with DX & DY
2217 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2218 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2219 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2220 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2223 # - "WW" : Close Wire (to finish)
2224 # - "WF" : Close Wire and build face (to finish)
2227 # - Flag1 (= reverse) is 0 or 2 ...
2228 # - if 0 the drawn arc is the one of lower angle (< Pi)
2229 # - if 2 the drawn arc ius the one of greater angle (> Pi)
2232 # - Flag2 (= control tolerance) is 0 or 1 ...
2233 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2234 # - if 1 the wire is built only if the end point is on the arc
2235 # with a tolerance of 10^-7 on the distance else the creation fails
2237 # @param theCommand String, defining the sketcher in local
2238 # coordinates of the working plane.
2239 # @param theWorkingPlane Nine double values, defining origin,
2240 # OZ and OX directions of the working plane.
2241 # @param theName Object name; when specified, this parameter is used
2242 # for result publication in the study. Otherwise, if automatic
2243 # publication is switched on, default value is used for result name.
2245 # @return New GEOM.GEOM_Object, containing the created wire.
2247 # @ref tui_sketcher_page "Example"
2248 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0], theName=None):
2250 Create a sketcher (wire or face), following the textual description, passed
2251 through theCommand argument.
2252 Edges of the resulting wire or face will be arcs of circles and/or linear segments.
2253 Format of the description string have to be the following:
2254 "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
2256 - x1, y1 are coordinates of the first sketcher point (zero by default),
2258 - "R angle" : Set the direction by angle
2259 - "D dx dy" : Set the direction by DX & DY
2261 - "TT x y" : Create segment by point at X & Y
2262 - "T dx dy" : Create segment by point with DX & DY
2263 - "L length" : Create segment by direction & Length
2264 - "IX x" : Create segment by direction & Intersect. X
2265 - "IY y" : Create segment by direction & Intersect. Y
2267 - "C radius length" : Create arc by direction, radius and length(in degree)
2268 - "AA x y": Create arc by point at X & Y
2269 - "A dx dy" : Create arc by point with DX & DY
2270 - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
2271 - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
2272 - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
2273 - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
2275 - "WW" : Close Wire (to finish)
2276 - "WF" : Close Wire and build face (to finish)
2278 - Flag1 (= reverse) is 0 or 2 ...
2279 - if 0 the drawn arc is the one of lower angle (< Pi)
2280 - if 2 the drawn arc ius the one of greater angle (> Pi)
2282 - Flag2 (= control tolerance) is 0 or 1 ...
2283 - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
2284 - if 1 the wire is built only if the end point is on the arc
2285 with a tolerance of 10^-7 on the distance else the creation fails
2288 theCommand String, defining the sketcher in local
2289 coordinates of the working plane.
2290 theWorkingPlane Nine double values, defining origin,
2291 OZ and OX directions of the working plane.
2292 theName Object name; when specified, this parameter is used
2293 for result publication in the study. Otherwise, if automatic
2294 publication is switched on, default value is used for result name.
2297 New GEOM.GEOM_Object, containing the created wire.
2299 # Example: see GEOM_TestAll.py
2300 theCommand,Parameters = ParseSketcherCommand(theCommand)
2301 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
2302 RaiseIfFailed("MakeSketcher", self.CurvesOp)
2303 anObj.SetParameters(Parameters)
2304 self._autoPublish(anObj, theName, "wire")
2307 ## Create a sketcher (wire or face), following the textual description,
2308 # passed through <VAR>theCommand</VAR> argument. \n
2309 # For format of the description string see MakeSketcher() method.\n
2310 # @param theCommand String, defining the sketcher in local
2311 # coordinates of the working plane.
2312 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2313 # @param theName Object name; when specified, this parameter is used
2314 # for result publication in the study. Otherwise, if automatic
2315 # publication is switched on, default value is used for result name.
2317 # @return New GEOM.GEOM_Object, containing the created wire.
2319 # @ref tui_sketcher_page "Example"
2320 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane, theName=None):
2322 Create a sketcher (wire or face), following the textual description,
2323 passed through theCommand argument.
2324 For format of the description string see geompy.MakeSketcher() method.
2327 theCommand String, defining the sketcher in local
2328 coordinates of the working plane.
2329 theWorkingPlane Planar Face or LCS(Marker) of the working plane.
2330 theName Object name; when specified, this parameter is used
2331 for result publication in the study. Otherwise, if automatic
2332 publication is switched on, default value is used for result name.
2335 New GEOM.GEOM_Object, containing the created wire.
2337 theCommand,Parameters = ParseSketcherCommand(theCommand)
2338 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
2339 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
2340 anObj.SetParameters(Parameters)
2341 self._autoPublish(anObj, theName, "wire")
2344 ## Create a sketcher wire, following the numerical description,
2345 # passed through <VAR>theCoordinates</VAR> argument. \n
2346 # @param theCoordinates double values, defining points to create a wire,
2348 # @param theName Object name; when specified, this parameter is used
2349 # for result publication in the study. Otherwise, if automatic
2350 # publication is switched on, default value is used for result name.
2352 # @return New GEOM.GEOM_Object, containing the created wire.
2354 # @ref tui_3dsketcher_page "Example"
2355 def Make3DSketcher(self, theCoordinates, theName=None):
2357 Create a sketcher wire, following the numerical description,
2358 passed through theCoordinates argument.
2361 theCoordinates double values, defining points to create a wire,
2363 theName Object name; when specified, this parameter is used
2364 for result publication in the study. Otherwise, if automatic
2365 publication is switched on, default value is used for result name.
2368 New GEOM_Object, containing the created wire.
2370 theCoordinates,Parameters = ParseParameters(theCoordinates)
2371 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
2372 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
2373 anObj.SetParameters(Parameters)
2374 self._autoPublish(anObj, theName, "wire")
2377 ## Obtain a 3D sketcher interface
2378 # @return An instance of @ref gsketcher.Sketcher3D "Sketcher3D" interface
2380 # @ref tui_3dsketcher_page "Example"
2381 def Sketcher3D (self):
2383 Obtain a 3D sketcher interface.
2386 sk = geompy.Sketcher3D()
2387 sk.addPointsAbsolute(0,0,0, 70,0,0)
2388 sk.addPointsRelative(0, 0, 130)
2389 sk.addPointAnglesLength("OXY", 50, 0, 100)
2390 sk.addPointAnglesLength("OXZ", 30, 80, 130)
2392 a3D_Sketcher_1 = sk.wire()
2394 sk = Sketcher3D (self)
2397 # end of l3_sketcher
2400 ## @addtogroup l3_3d_primitives
2403 ## Create a box by coordinates of two opposite vertices.
2405 # @param x1,y1,z1 double values, defining first point it.
2406 # @param x2,y2,z2 double values, defining first point it.
2407 # @param theName Object name; when specified, this parameter is used
2408 # for result publication in the study. Otherwise, if automatic
2409 # publication is switched on, default value is used for result name.
2411 # @return New GEOM.GEOM_Object, containing the created box.
2413 # @ref tui_creation_box "Example"
2414 def MakeBox(self, x1, y1, z1, x2, y2, z2, theName=None):
2416 Create a box by coordinates of two opposite vertices.
2419 x1,y1,z1 double values, defining first point.
2420 x2,y2,z2 double values, defining second point.
2421 theName Object name; when specified, this parameter is used
2422 for result publication in the study. Otherwise, if automatic
2423 publication is switched on, default value is used for result name.
2426 New GEOM.GEOM_Object, containing the created box.
2428 # Example: see GEOM_TestAll.py
2429 pnt1 = self.MakeVertex(x1,y1,z1)
2430 pnt2 = self.MakeVertex(x2,y2,z2)
2431 # note: auto-publishing is done in self.MakeBoxTwoPnt()
2432 return self.MakeBoxTwoPnt(pnt1, pnt2, theName)
2434 ## Create a box with specified dimensions along the coordinate axes
2435 # and with edges, parallel to the coordinate axes.
2436 # Center of the box will be at point (DX/2, DY/2, DZ/2).
2437 # @param theDX Length of Box edges, parallel to OX axis.
2438 # @param theDY Length of Box edges, parallel to OY axis.
2439 # @param theDZ Length of Box edges, parallel to OZ axis.
2440 # @param theName Object name; when specified, this parameter is used
2441 # for result publication in the study. Otherwise, if automatic
2442 # publication is switched on, default value is used for result name.
2444 # @return New GEOM.GEOM_Object, containing the created box.
2446 # @ref tui_creation_box "Example"
2447 def MakeBoxDXDYDZ(self, theDX, theDY, theDZ, theName=None):
2449 Create a box with specified dimensions along the coordinate axes
2450 and with edges, parallel to the coordinate axes.
2451 Center of the box will be at point (DX/2, DY/2, DZ/2).
2454 theDX Length of Box edges, parallel to OX axis.
2455 theDY Length of Box edges, parallel to OY axis.
2456 theDZ Length of Box edges, parallel to OZ axis.
2457 theName Object name; when specified, this parameter is used
2458 for result publication in the study. Otherwise, if automatic
2459 publication is switched on, default value is used for result name.
2462 New GEOM.GEOM_Object, containing the created box.
2464 # Example: see GEOM_TestAll.py
2465 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
2466 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
2467 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
2468 anObj.SetParameters(Parameters)
2469 self._autoPublish(anObj, theName, "box")
2472 ## Create a box with two specified opposite vertices,
2473 # and with edges, parallel to the coordinate axes
2474 # @param thePnt1 First of two opposite vertices.
2475 # @param thePnt2 Second of two opposite vertices.
2476 # @param theName Object name; when specified, this parameter is used
2477 # for result publication in the study. Otherwise, if automatic
2478 # publication is switched on, default value is used for result name.
2480 # @return New GEOM.GEOM_Object, containing the created box.
2482 # @ref tui_creation_box "Example"
2483 def MakeBoxTwoPnt(self, thePnt1, thePnt2, theName=None):
2485 Create a box with two specified opposite vertices,
2486 and with edges, parallel to the coordinate axes
2489 thePnt1 First of two opposite vertices.
2490 thePnt2 Second of two opposite vertices.
2491 theName Object name; when specified, this parameter is used
2492 for result publication in the study. Otherwise, if automatic
2493 publication is switched on, default value is used for result name.
2496 New GEOM.GEOM_Object, containing the created box.
2498 # Example: see GEOM_TestAll.py
2499 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
2500 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
2501 self._autoPublish(anObj, theName, "box")
2504 ## Create a face with specified dimensions with edges parallel to coordinate axes.
2505 # @param theH height of Face.
2506 # @param theW width of Face.
2507 # @param theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2508 # @param theName Object name; when specified, this parameter is used
2509 # for result publication in the study. Otherwise, if automatic
2510 # publication is switched on, default value is used for result name.
2512 # @return New GEOM.GEOM_Object, containing the created face.
2514 # @ref tui_creation_face "Example"
2515 def MakeFaceHW(self, theH, theW, theOrientation, theName=None):
2517 Create a face with specified dimensions with edges parallel to coordinate axes.
2520 theH height of Face.
2522 theOrientation face orientation: 1-OXY, 2-OYZ, 3-OZX
2523 theName Object name; when specified, this parameter is used
2524 for result publication in the study. Otherwise, if automatic
2525 publication is switched on, default value is used for result name.
2528 New GEOM.GEOM_Object, containing the created face.
2530 # Example: see GEOM_TestAll.py
2531 theH,theW,Parameters = ParseParameters(theH, theW)
2532 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
2533 RaiseIfFailed("MakeFaceHW", self.PrimOp)
2534 anObj.SetParameters(Parameters)
2535 self._autoPublish(anObj, theName, "rectangle")
2538 ## Create a face from another plane and two sizes,
2539 # vertical size and horisontal size.
2540 # @param theObj Normale vector to the creating face or
2542 # @param theH Height (vertical size).
2543 # @param theW Width (horisontal size).
2544 # @param theName Object name; when specified, this parameter is used
2545 # for result publication in the study. Otherwise, if automatic
2546 # publication is switched on, default value is used for result name.
2548 # @return New GEOM.GEOM_Object, containing the created face.
2550 # @ref tui_creation_face "Example"
2551 def MakeFaceObjHW(self, theObj, theH, theW, theName=None):
2553 Create a face from another plane and two sizes,
2554 vertical size and horisontal size.
2557 theObj Normale vector to the creating face or
2559 theH Height (vertical size).
2560 theW Width (horisontal size).
2561 theName Object name; when specified, this parameter is used
2562 for result publication in the study. Otherwise, if automatic
2563 publication is switched on, default value is used for result name.
2566 New GEOM_Object, containing the created face.
2568 # Example: see GEOM_TestAll.py
2569 theH,theW,Parameters = ParseParameters(theH, theW)
2570 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
2571 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
2572 anObj.SetParameters(Parameters)
2573 self._autoPublish(anObj, theName, "rectangle")
2576 ## Create a disk with given center, normal vector and radius.
2577 # @param thePnt Disk center.
2578 # @param theVec Vector, normal to the plane of the disk.
2579 # @param theR Disk radius.
2580 # @param theName Object name; when specified, this parameter is used
2581 # for result publication in the study. Otherwise, if automatic
2582 # publication is switched on, default value is used for result name.
2584 # @return New GEOM.GEOM_Object, containing the created disk.
2586 # @ref tui_creation_disk "Example"
2587 def MakeDiskPntVecR(self, thePnt, theVec, theR, theName=None):
2589 Create a disk with given center, normal vector and radius.
2593 theVec Vector, normal to the plane of the disk.
2595 theName Object name; when specified, this parameter is used
2596 for result publication in the study. Otherwise, if automatic
2597 publication is switched on, default value is used for result name.
2600 New GEOM.GEOM_Object, containing the created disk.
2602 # Example: see GEOM_TestAll.py
2603 theR,Parameters = ParseParameters(theR)
2604 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
2605 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
2606 anObj.SetParameters(Parameters)
2607 self._autoPublish(anObj, theName, "disk")
2610 ## Create a disk, passing through three given points
2611 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
2612 # @param theName Object name; when specified, this parameter is used
2613 # for result publication in the study. Otherwise, if automatic
2614 # publication is switched on, default value is used for result name.
2616 # @return New GEOM.GEOM_Object, containing the created disk.
2618 # @ref tui_creation_disk "Example"
2619 def MakeDiskThreePnt(self, thePnt1, thePnt2, thePnt3, theName=None):
2621 Create a disk, passing through three given points
2624 thePnt1,thePnt2,thePnt3 Points, defining the disk.
2625 theName Object name; when specified, this parameter is used
2626 for result publication in the study. Otherwise, if automatic
2627 publication is switched on, default value is used for result name.
2630 New GEOM.GEOM_Object, containing the created disk.
2632 # Example: see GEOM_TestAll.py
2633 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
2634 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
2635 self._autoPublish(anObj, theName, "disk")
2638 ## Create a disk with specified dimensions along OX-OY coordinate axes.
2639 # @param theR Radius of Face.
2640 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
2641 # @param theName Object name; when specified, this parameter is used
2642 # for result publication in the study. Otherwise, if automatic
2643 # publication is switched on, default value is used for result name.
2645 # @return New GEOM.GEOM_Object, containing the created disk.
2647 # @ref tui_creation_face "Example"
2648 def MakeDiskR(self, theR, theOrientation, theName=None):
2650 Create a disk with specified dimensions along OX-OY coordinate axes.
2653 theR Radius of Face.
2654 theOrientation set the orientation belong axis OXY or OYZ or OZX
2655 theName Object name; when specified, this parameter is used
2656 for result publication in the study. Otherwise, if automatic
2657 publication is switched on, default value is used for result name.
2660 New GEOM.GEOM_Object, containing the created disk.
2663 Disk3 = geompy.MakeDiskR(100., 1)
2665 # Example: see GEOM_TestAll.py
2666 theR,Parameters = ParseParameters(theR)
2667 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
2668 RaiseIfFailed("MakeDiskR", self.PrimOp)
2669 anObj.SetParameters(Parameters)
2670 self._autoPublish(anObj, theName, "disk")
2673 ## Create a cylinder with given base point, axis, radius and height.
2674 # @param thePnt Central point of cylinder base.
2675 # @param theAxis Cylinder axis.
2676 # @param theR Cylinder radius.
2677 # @param theH Cylinder height.
2678 # @param theName Object name; when specified, this parameter is used
2679 # for result publication in the study. Otherwise, if automatic
2680 # publication is switched on, default value is used for result name.
2682 # @return New GEOM.GEOM_Object, containing the created cylinder.
2684 # @ref tui_creation_cylinder "Example"
2685 def MakeCylinder(self, thePnt, theAxis, theR, theH, theName=None):
2687 Create a cylinder with given base point, axis, radius and height.
2690 thePnt Central point of cylinder base.
2691 theAxis Cylinder axis.
2692 theR Cylinder radius.
2693 theH Cylinder height.
2694 theName Object name; when specified, this parameter is used
2695 for result publication in the study. Otherwise, if automatic
2696 publication is switched on, default value is used for result name.
2699 New GEOM.GEOM_Object, containing the created cylinder.
2701 # Example: see GEOM_TestAll.py
2702 theR,theH,Parameters = ParseParameters(theR, theH)
2703 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
2704 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
2705 anObj.SetParameters(Parameters)
2706 self._autoPublish(anObj, theName, "cylinder")
2709 ## Create a cylinder with given radius and height at
2710 # the origin of coordinate system. Axis of the cylinder
2711 # will be collinear to the OZ axis of the coordinate system.
2712 # @param theR Cylinder radius.
2713 # @param theH Cylinder height.
2714 # @param theName Object name; when specified, this parameter is used
2715 # for result publication in the study. Otherwise, if automatic
2716 # publication is switched on, default value is used for result name.
2718 # @return New GEOM.GEOM_Object, containing the created cylinder.
2720 # @ref tui_creation_cylinder "Example"
2721 def MakeCylinderRH(self, theR, theH, theName=None):
2723 Create a cylinder with given radius and height at
2724 the origin of coordinate system. Axis of the cylinder
2725 will be collinear to the OZ axis of the coordinate system.
2728 theR Cylinder radius.
2729 theH Cylinder height.
2730 theName Object name; when specified, this parameter is used
2731 for result publication in the study. Otherwise, if automatic
2732 publication is switched on, default value is used for result name.
2735 New GEOM.GEOM_Object, containing the created cylinder.
2737 # Example: see GEOM_TestAll.py
2738 theR,theH,Parameters = ParseParameters(theR, theH)
2739 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
2740 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
2741 anObj.SetParameters(Parameters)
2742 self._autoPublish(anObj, theName, "cylinder")
2745 ## Create a sphere with given center and radius.
2746 # @param thePnt Sphere center.
2747 # @param theR Sphere radius.
2748 # @param theName Object name; when specified, this parameter is used
2749 # for result publication in the study. Otherwise, if automatic
2750 # publication is switched on, default value is used for result name.
2752 # @return New GEOM.GEOM_Object, containing the created sphere.
2754 # @ref tui_creation_sphere "Example"
2755 def MakeSpherePntR(self, thePnt, theR, theName=None):
2757 Create a sphere with given center and radius.
2760 thePnt Sphere center.
2762 theName Object name; when specified, this parameter is used
2763 for result publication in the study. Otherwise, if automatic
2764 publication is switched on, default value is used for result name.
2767 New GEOM.GEOM_Object, containing the created sphere.
2769 # Example: see GEOM_TestAll.py
2770 theR,Parameters = ParseParameters(theR)
2771 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
2772 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
2773 anObj.SetParameters(Parameters)
2774 self._autoPublish(anObj, theName, "sphere")
2777 ## Create a sphere with given center and radius.
2778 # @param x,y,z Coordinates of sphere center.
2779 # @param theR Sphere radius.
2780 # @param theName Object name; when specified, this parameter is used
2781 # for result publication in the study. Otherwise, if automatic
2782 # publication is switched on, default value is used for result name.
2784 # @return New GEOM.GEOM_Object, containing the created sphere.
2786 # @ref tui_creation_sphere "Example"
2787 def MakeSphere(self, x, y, z, theR, theName=None):
2789 Create a sphere with given center and radius.
2792 x,y,z Coordinates of sphere center.
2794 theName Object name; when specified, this parameter is used
2795 for result publication in the study. Otherwise, if automatic
2796 publication is switched on, default value is used for result name.
2799 New GEOM.GEOM_Object, containing the created sphere.
2801 # Example: see GEOM_TestAll.py
2802 point = self.MakeVertex(x, y, z)
2803 # note: auto-publishing is done in self.MakeSpherePntR()
2804 anObj = self.MakeSpherePntR(point, theR, theName)
2807 ## Create a sphere with given radius at the origin of coordinate system.
2808 # @param theR Sphere radius.
2809 # @param theName Object name; when specified, this parameter is used
2810 # for result publication in the study. Otherwise, if automatic
2811 # publication is switched on, default value is used for result name.
2813 # @return New GEOM.GEOM_Object, containing the created sphere.
2815 # @ref tui_creation_sphere "Example"
2816 def MakeSphereR(self, theR, theName=None):
2818 Create a sphere with given radius at the origin of coordinate system.
2822 theName Object name; when specified, this parameter is used
2823 for result publication in the study. Otherwise, if automatic
2824 publication is switched on, default value is used for result name.
2827 New GEOM.GEOM_Object, containing the created sphere.
2829 # Example: see GEOM_TestAll.py
2830 theR,Parameters = ParseParameters(theR)
2831 anObj = self.PrimOp.MakeSphereR(theR)
2832 RaiseIfFailed("MakeSphereR", self.PrimOp)
2833 anObj.SetParameters(Parameters)
2834 self._autoPublish(anObj, theName, "sphere")
2837 ## Create a cone with given base point, axis, height and radiuses.
2838 # @param thePnt Central point of the first cone base.
2839 # @param theAxis Cone axis.
2840 # @param theR1 Radius of the first cone base.
2841 # @param theR2 Radius of the second cone base.
2842 # \note If both radiuses are non-zero, the cone will be truncated.
2843 # \note If the radiuses are equal, a cylinder will be created instead.
2844 # @param theH Cone height.
2845 # @param theName Object name; when specified, this parameter is used
2846 # for result publication in the study. Otherwise, if automatic
2847 # publication is switched on, default value is used for result name.
2849 # @return New GEOM.GEOM_Object, containing the created cone.
2851 # @ref tui_creation_cone "Example"
2852 def MakeCone(self, thePnt, theAxis, theR1, theR2, theH, theName=None):
2854 Create a cone with given base point, axis, height and radiuses.
2857 thePnt Central point of the first cone base.
2859 theR1 Radius of the first cone base.
2860 theR2 Radius of the second cone base.
2862 theName Object name; when specified, this parameter is used
2863 for result publication in the study. Otherwise, if automatic
2864 publication is switched on, default value is used for result name.
2867 If both radiuses are non-zero, the cone will be truncated.
2868 If the radiuses are equal, a cylinder will be created instead.
2871 New GEOM.GEOM_Object, containing the created cone.
2873 # Example: see GEOM_TestAll.py
2874 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2875 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
2876 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
2877 anObj.SetParameters(Parameters)
2878 self._autoPublish(anObj, theName, "cone")
2881 ## Create a cone with given height and radiuses at
2882 # the origin of coordinate system. Axis of the cone will
2883 # be collinear to the OZ axis of the coordinate system.
2884 # @param theR1 Radius of the first cone base.
2885 # @param theR2 Radius of the second cone base.
2886 # \note If both radiuses are non-zero, the cone will be truncated.
2887 # \note If the radiuses are equal, a cylinder will be created instead.
2888 # @param theH Cone height.
2889 # @param theName Object name; when specified, this parameter is used
2890 # for result publication in the study. Otherwise, if automatic
2891 # publication is switched on, default value is used for result name.
2893 # @return New GEOM.GEOM_Object, containing the created cone.
2895 # @ref tui_creation_cone "Example"
2896 def MakeConeR1R2H(self, theR1, theR2, theH, theName=None):
2898 Create a cone with given height and radiuses at
2899 the origin of coordinate system. Axis of the cone will
2900 be collinear to the OZ axis of the coordinate system.
2903 theR1 Radius of the first cone base.
2904 theR2 Radius of the second cone base.
2906 theName Object name; when specified, this parameter is used
2907 for result publication in the study. Otherwise, if automatic
2908 publication is switched on, default value is used for result name.
2911 If both radiuses are non-zero, the cone will be truncated.
2912 If the radiuses are equal, a cylinder will be created instead.
2915 New GEOM.GEOM_Object, containing the created cone.
2917 # Example: see GEOM_TestAll.py
2918 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
2919 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
2920 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
2921 anObj.SetParameters(Parameters)
2922 self._autoPublish(anObj, theName, "cone")
2925 ## Create a torus with given center, normal vector and radiuses.
2926 # @param thePnt Torus central point.
2927 # @param theVec Torus axis of symmetry.
2928 # @param theRMajor Torus major radius.
2929 # @param theRMinor Torus minor radius.
2930 # @param theName Object name; when specified, this parameter is used
2931 # for result publication in the study. Otherwise, if automatic
2932 # publication is switched on, default value is used for result name.
2934 # @return New GEOM.GEOM_Object, containing the created torus.
2936 # @ref tui_creation_torus "Example"
2937 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor, theName=None):
2939 Create a torus with given center, normal vector and radiuses.
2942 thePnt Torus central point.
2943 theVec Torus axis of symmetry.
2944 theRMajor Torus major radius.
2945 theRMinor Torus minor radius.
2946 theName Object name; when specified, this parameter is used
2947 for result publication in the study. Otherwise, if automatic
2948 publication is switched on, default value is used for result name.
2951 New GEOM.GEOM_Object, containing the created torus.
2953 # Example: see GEOM_TestAll.py
2954 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2955 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
2956 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
2957 anObj.SetParameters(Parameters)
2958 self._autoPublish(anObj, theName, "torus")
2961 ## Create a torus with given radiuses at the origin of coordinate system.
2962 # @param theRMajor Torus major radius.
2963 # @param theRMinor Torus minor radius.
2964 # @param theName Object name; when specified, this parameter is used
2965 # for result publication in the study. Otherwise, if automatic
2966 # publication is switched on, default value is used for result name.
2968 # @return New GEOM.GEOM_Object, containing the created torus.
2970 # @ref tui_creation_torus "Example"
2971 def MakeTorusRR(self, theRMajor, theRMinor, theName=None):
2973 Create a torus with given radiuses at the origin of coordinate system.
2976 theRMajor Torus major radius.
2977 theRMinor Torus minor radius.
2978 theName Object name; when specified, this parameter is used
2979 for result publication in the study. Otherwise, if automatic
2980 publication is switched on, default value is used for result name.
2983 New GEOM.GEOM_Object, containing the created torus.
2985 # Example: see GEOM_TestAll.py
2986 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
2987 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
2988 RaiseIfFailed("MakeTorusRR", self.PrimOp)
2989 anObj.SetParameters(Parameters)
2990 self._autoPublish(anObj, theName, "torus")
2993 # end of l3_3d_primitives
2996 ## @addtogroup l3_complex
2999 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
3000 # @param theBase Base shape to be extruded.
3001 # @param thePoint1 First end of extrusion vector.
3002 # @param thePoint2 Second end of extrusion vector.
3003 # @param theScaleFactor Use it to make prism with scaled second base.
3004 # Nagative value means not scaled second base.
3005 # @param theName Object name; when specified, this parameter is used
3006 # for result publication in the study. Otherwise, if automatic
3007 # publication is switched on, default value is used for result name.
3009 # @return New GEOM.GEOM_Object, containing the created prism.
3011 # @ref tui_creation_prism "Example"
3012 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0, theName=None):
3014 Create a shape by extrusion of the base shape along a vector, defined by two points.
3017 theBase Base shape to be extruded.
3018 thePoint1 First end of extrusion vector.
3019 thePoint2 Second end of extrusion vector.
3020 theScaleFactor Use it to make prism with scaled second base.
3021 Nagative value means not scaled second base.
3022 theName Object name; when specified, this parameter is used
3023 for result publication in the study. Otherwise, if automatic
3024 publication is switched on, default value is used for result name.
3027 New GEOM.GEOM_Object, containing the created prism.
3029 # Example: see GEOM_TestAll.py
3032 if theScaleFactor > 0:
3033 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
3034 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
3036 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
3037 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3038 anObj.SetParameters(Parameters)
3039 self._autoPublish(anObj, theName, "prism")
3042 ## Create a shape by extrusion of the base shape along a
3043 # vector, defined by two points, in 2 Ways (forward/backward).
3044 # @param theBase Base shape to be extruded.
3045 # @param thePoint1 First end of extrusion vector.
3046 # @param thePoint2 Second end of extrusion vector.
3047 # @param theName Object name; when specified, this parameter is used
3048 # for result publication in the study. Otherwise, if automatic
3049 # publication is switched on, default value is used for result name.
3051 # @return New GEOM.GEOM_Object, containing the created prism.
3053 # @ref tui_creation_prism "Example"
3054 def MakePrism2Ways(self, theBase, thePoint1, thePoint2, theName=None):
3056 Create a shape by extrusion of the base shape along a
3057 vector, defined by two points, in 2 Ways (forward/backward).
3060 theBase Base shape to be extruded.
3061 thePoint1 First end of extrusion vector.
3062 thePoint2 Second end of extrusion vector.
3063 theName Object name; when specified, this parameter is used
3064 for result publication in the study. Otherwise, if automatic
3065 publication is switched on, default value is used for result name.
3068 New GEOM.GEOM_Object, containing the created prism.
3070 # Example: see GEOM_TestAll.py
3071 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
3072 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
3073 self._autoPublish(anObj, theName, "prism")
3076 ## Create a shape by extrusion of the base shape along the vector,
3077 # i.e. all the space, transfixed by the base shape during its translation
3078 # along the vector on the given distance.
3079 # @param theBase Base shape to be extruded.
3080 # @param theVec Direction of extrusion.
3081 # @param theH Prism dimension along theVec.
3082 # @param theScaleFactor Use it to make prism with scaled second base.
3083 # Negative value means not scaled second base.
3084 # @param theName Object name; when specified, this parameter is used
3085 # for result publication in the study. Otherwise, if automatic
3086 # publication is switched on, default value is used for result name.
3088 # @return New GEOM.GEOM_Object, containing the created prism.
3090 # @ref tui_creation_prism "Example"
3091 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0, theName=None):
3093 Create a shape by extrusion of the base shape along the vector,
3094 i.e. all the space, transfixed by the base shape during its translation
3095 along the vector on the given distance.
3098 theBase Base shape to be extruded.
3099 theVec Direction of extrusion.
3100 theH Prism dimension along theVec.
3101 theScaleFactor Use it to make prism with scaled second base.
3102 Negative value means not scaled second base.
3103 theName Object name; when specified, this parameter is used
3104 for result publication in the study. Otherwise, if automatic
3105 publication is switched on, default value is used for result name.
3108 New GEOM.GEOM_Object, containing the created prism.
3110 # Example: see GEOM_TestAll.py
3113 if theScaleFactor > 0:
3114 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
3115 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
3117 theH,Parameters = ParseParameters(theH)
3118 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
3119 RaiseIfFailed("MakePrismVecH", self.PrimOp)
3120 anObj.SetParameters(Parameters)
3121 self._autoPublish(anObj, theName, "prism")
3124 ## Create a shape by extrusion of the base shape along the vector,
3125 # i.e. all the space, transfixed by the base shape during its translation
3126 # along the vector on the given distance in 2 Ways (forward/backward).
3127 # @param theBase Base shape to be extruded.
3128 # @param theVec Direction of extrusion.
3129 # @param theH Prism dimension along theVec in forward direction.
3130 # @param theName Object name; when specified, this parameter is used
3131 # for result publication in the study. Otherwise, if automatic
3132 # publication is switched on, default value is used for result name.
3134 # @return New GEOM.GEOM_Object, containing the created prism.
3136 # @ref tui_creation_prism "Example"
3137 def MakePrismVecH2Ways(self, theBase, theVec, theH, theName=None):
3139 Create a shape by extrusion of the base shape along the vector,
3140 i.e. all the space, transfixed by the base shape during its translation
3141 along the vector on the given distance in 2 Ways (forward/backward).
3144 theBase Base shape to be extruded.
3145 theVec Direction of extrusion.
3146 theH Prism dimension along theVec in forward direction.
3147 theName Object name; when specified, this parameter is used
3148 for result publication in the study. Otherwise, if automatic
3149 publication is switched on, default value is used for result name.
3152 New GEOM.GEOM_Object, containing the created prism.
3154 # Example: see GEOM_TestAll.py
3155 theH,Parameters = ParseParameters(theH)
3156 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
3157 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
3158 anObj.SetParameters(Parameters)
3159 self._autoPublish(anObj, theName, "prism")
3162 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3163 # @param theBase Base shape to be extruded.
3164 # @param theDX, theDY, theDZ Directions of extrusion.
3165 # @param theScaleFactor Use it to make prism with scaled second base.
3166 # Nagative value means not scaled second base.
3167 # @param theName Object name; when specified, this parameter is used
3168 # for result publication in the study. Otherwise, if automatic
3169 # publication is switched on, default value is used for result name.
3171 # @return New GEOM.GEOM_Object, containing the created prism.
3173 # @ref tui_creation_prism "Example"
3174 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0, theName=None):
3176 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3179 theBase Base shape to be extruded.
3180 theDX, theDY, theDZ Directions of extrusion.
3181 theScaleFactor Use it to make prism with scaled second base.
3182 Nagative value means not scaled second base.
3183 theName Object name; when specified, this parameter is used
3184 for result publication in the study. Otherwise, if automatic
3185 publication is switched on, default value is used for result name.
3188 New GEOM.GEOM_Object, containing the created prism.
3190 # Example: see GEOM_TestAll.py
3193 if theScaleFactor > 0:
3194 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
3195 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
3197 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3198 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
3199 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
3200 anObj.SetParameters(Parameters)
3201 self._autoPublish(anObj, theName, "prism")
3204 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
3205 # i.e. all the space, transfixed by the base shape during its translation
3206 # along the vector on the given distance in 2 Ways (forward/backward).
3207 # @param theBase Base shape to be extruded.
3208 # @param theDX, theDY, theDZ Directions of extrusion.
3209 # @param theName Object name; when specified, this parameter is used
3210 # for result publication in the study. Otherwise, if automatic
3211 # publication is switched on, default value is used for result name.
3213 # @return New GEOM.GEOM_Object, containing the created prism.
3215 # @ref tui_creation_prism "Example"
3216 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ, theName=None):
3218 Create a shape by extrusion of the base shape along the dx, dy, dz direction
3219 i.e. all the space, transfixed by the base shape during its translation
3220 along the vector on the given distance in 2 Ways (forward/backward).
3223 theBase Base shape to be extruded.
3224 theDX, theDY, theDZ Directions of extrusion.
3225 theName Object name; when specified, this parameter is used
3226 for result publication in the study. Otherwise, if automatic
3227 publication is switched on, default value is used for result name.
3230 New GEOM.GEOM_Object, containing the created prism.
3232 # Example: see GEOM_TestAll.py
3233 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
3234 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
3235 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
3236 anObj.SetParameters(Parameters)
3237 self._autoPublish(anObj, theName, "prism")
3240 ## Create a shape by revolution of the base shape around the axis
3241 # on the given angle, i.e. all the space, transfixed by the base
3242 # shape during its rotation around the axis on the given angle.
3243 # @param theBase Base shape to be rotated.
3244 # @param theAxis Rotation axis.
3245 # @param theAngle Rotation angle in radians.
3246 # @param theName Object name; when specified, this parameter is used
3247 # for result publication in the study. Otherwise, if automatic
3248 # publication is switched on, default value is used for result name.
3250 # @return New GEOM.GEOM_Object, containing the created revolution.
3252 # @ref tui_creation_revolution "Example"
3253 def MakeRevolution(self, theBase, theAxis, theAngle, theName=None):
3255 Create a shape by revolution of the base shape around the axis
3256 on the given angle, i.e. all the space, transfixed by the base
3257 shape during its rotation around the axis on the given angle.
3260 theBase Base shape to be rotated.
3261 theAxis Rotation axis.
3262 theAngle Rotation angle in radians.
3263 theName Object name; when specified, this parameter is used
3264 for result publication in the study. Otherwise, if automatic
3265 publication is switched on, default value is used for result name.
3268 New GEOM.GEOM_Object, containing the created revolution.
3270 # Example: see GEOM_TestAll.py
3271 theAngle,Parameters = ParseParameters(theAngle)
3272 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
3273 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
3274 anObj.SetParameters(Parameters)
3275 self._autoPublish(anObj, theName, "revolution")
3278 ## Create a shape by revolution of the base shape around the axis
3279 # on the given angle, i.e. all the space, transfixed by the base
3280 # shape during its rotation around the axis on the given angle in
3281 # both directions (forward/backward)
3282 # @param theBase Base shape to be rotated.
3283 # @param theAxis Rotation axis.
3284 # @param theAngle Rotation angle in radians.
3285 # @param theName Object name; when specified, this parameter is used
3286 # for result publication in the study. Otherwise, if automatic
3287 # publication is switched on, default value is used for result name.
3289 # @return New GEOM.GEOM_Object, containing the created revolution.
3291 # @ref tui_creation_revolution "Example"
3292 def MakeRevolution2Ways(self, theBase, theAxis, theAngle, theName=None):
3294 Create a shape by revolution of the base shape around the axis
3295 on the given angle, i.e. all the space, transfixed by the base
3296 shape during its rotation around the axis on the given angle in
3297 both directions (forward/backward).
3300 theBase Base shape to be rotated.
3301 theAxis Rotation axis.
3302 theAngle Rotation angle in radians.
3303 theName Object name; when specified, this parameter is used
3304 for result publication in the study. Otherwise, if automatic
3305 publication is switched on, default value is used for result name.
3308 New GEOM.GEOM_Object, containing the created revolution.
3310 theAngle,Parameters = ParseParameters(theAngle)
3311 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
3312 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
3313 anObj.SetParameters(Parameters)
3314 self._autoPublish(anObj, theName, "revolution")
3317 ## Create a filling from the given compound of contours.
3318 # @param theShape the compound of contours
3319 # @param theMinDeg a minimal degree of BSpline surface to create
3320 # @param theMaxDeg a maximal degree of BSpline surface to create
3321 # @param theTol2D a 2d tolerance to be reached
3322 # @param theTol3D a 3d tolerance to be reached
3323 # @param theNbIter a number of iteration of approximation algorithm
3324 # @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3325 # @param isApprox if True, BSpline curves are generated in the process
3326 # of surface construction. By default it is False, that means
3327 # the surface is created using given curves. The usage of
3328 # Approximation makes the algorithm work slower, but allows
3329 # building the surface for rather complex cases.
3330 # @param theName Object name; when specified, this parameter is used
3331 # for result publication in the study. Otherwise, if automatic
3332 # publication is switched on, default value is used for result name.
3334 # @return New GEOM.GEOM_Object, containing the created filling surface.
3336 # @ref tui_creation_filling "Example"
3337 def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
3338 theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
3340 Create a filling from the given compound of contours.
3343 theShape the compound of contours
3344 theMinDeg a minimal degree of BSpline surface to create
3345 theMaxDeg a maximal degree of BSpline surface to create
3346 theTol2D a 2d tolerance to be reached
3347 theTol3D a 3d tolerance to be reached
3348 theNbIter a number of iteration of approximation algorithm
3349 theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
3350 isApprox if True, BSpline curves are generated in the process
3351 of surface construction. By default it is False, that means
3352 the surface is created using given curves. The usage of
3353 Approximation makes the algorithm work slower, but allows
3354 building the surface for rather complex cases
3355 theName Object name; when specified, this parameter is used
3356 for result publication in the study. Otherwise, if automatic
3357 publication is switched on, default value is used for result name.
3360 New GEOM.GEOM_Object, containing the created filling surface.
3363 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
3365 # Example: see GEOM_TestAll.py
3366 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
3367 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3368 theTol2D, theTol3D, theNbIter,
3369 theMethod, isApprox)
3370 RaiseIfFailed("MakeFilling", self.PrimOp)
3371 anObj.SetParameters(Parameters)
3372 self._autoPublish(anObj, theName, "filling")
3376 ## Create a filling from the given compound of contours.
3377 # This method corresponds to MakeFilling with isApprox=True
3378 # @param theShape the compound of contours
3379 # @param theMinDeg a minimal degree of BSpline surface to create
3380 # @param theMaxDeg a maximal degree of BSpline surface to create
3381 # @param theTol3D a 3d tolerance to be reached
3382 # @param theName Object name; when specified, this parameter is used
3383 # for result publication in the study. Otherwise, if automatic
3384 # publication is switched on, default value is used for result name.
3386 # @return New GEOM.GEOM_Object, containing the created filling surface.
3388 # @ref tui_creation_filling "Example"
3389 def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
3391 Create a filling from the given compound of contours.
3392 This method corresponds to MakeFilling with isApprox=True
3395 theShape the compound of contours
3396 theMinDeg a minimal degree of BSpline surface to create
3397 theMaxDeg a maximal degree of BSpline surface to create
3398 theTol3D a 3d tolerance to be reached
3399 theName Object name; when specified, this parameter is used
3400 for result publication in the study. Otherwise, if automatic
3401 publication is switched on, default value is used for result name.
3404 New GEOM.GEOM_Object, containing the created filling surface.
3407 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
3409 # Example: see GEOM_TestAll.py
3410 theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
3411 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
3412 0, theTol3D, 0, GEOM.FOM_Default, True)
3413 RaiseIfFailed("MakeFillingNew", self.PrimOp)
3414 anObj.SetParameters(Parameters)
3415 self._autoPublish(anObj, theName, "filling")
3418 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3419 # @param theSeqSections - set of specified sections.
3420 # @param theModeSolid - mode defining building solid or shell
3421 # @param thePreci - precision 3D used for smoothing
3422 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
3423 # @param theName Object name; when specified, this parameter is used
3424 # for result publication in the study. Otherwise, if automatic
3425 # publication is switched on, default value is used for result name.
3427 # @return New GEOM.GEOM_Object, containing the created shell or solid.
3429 # @ref swig_todo "Example"
3430 def MakeThruSections(self, theSeqSections, theModeSolid, thePreci, theRuled, theName=None):
3432 Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
3435 theSeqSections - set of specified sections.
3436 theModeSolid - mode defining building solid or shell
3437 thePreci - precision 3D used for smoothing
3438 theRuled - mode defining type of the result surfaces (ruled or smoothed).
3439 theName Object name; when specified, this parameter is used
3440 for result publication in the study. Otherwise, if automatic
3441 publication is switched on, default value is used for result name.
3444 New GEOM.GEOM_Object, containing the created shell or solid.
3446 # Example: see GEOM_TestAll.py
3447 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
3448 RaiseIfFailed("MakeThruSections", self.PrimOp)
3449 self._autoPublish(anObj, theName, "filling")
3452 ## Create a shape by extrusion of the base shape along
3453 # the path shape. The path shape can be a wire or an edge.
3454 # @param theBase Base shape to be extruded.
3455 # @param thePath Path shape to extrude the base shape along it.
3456 # @param theName Object name; when specified, this parameter is used
3457 # for result publication in the study. Otherwise, if automatic
3458 # publication is switched on, default value is used for result name.
3460 # @return New GEOM.GEOM_Object, containing the created pipe.
3462 # @ref tui_creation_pipe "Example"
3463 def MakePipe(self, theBase, thePath, theName=None):
3465 Create a shape by extrusion of the base shape along
3466 the path shape. The path shape can be a wire or an edge.
3469 theBase Base shape to be extruded.
3470 thePath Path shape to extrude the base shape along it.
3471 theName Object name; when specified, this parameter is used
3472 for result publication in the study. Otherwise, if automatic
3473 publication is switched on, default value is used for result name.
3476 New GEOM.GEOM_Object, containing the created pipe.
3478 # Example: see GEOM_TestAll.py
3479 anObj = self.PrimOp.MakePipe(theBase, thePath)
3480 RaiseIfFailed("MakePipe", self.PrimOp)
3481 self._autoPublish(anObj, theName, "pipe")
3484 ## Create a shape by extrusion of the profile shape along
3485 # the path shape. The path shape can be a wire or an edge.
3486 # the several profiles can be specified in the several locations of path.
3487 # @param theSeqBases - list of Bases shape to be extruded.
3488 # @param theLocations - list of locations on the path corresponding
3489 # specified list of the Bases shapes. Number of locations
3490 # should be equal to number of bases or list of locations can be empty.
3491 # @param thePath - Path shape to extrude the base shape along it.
3492 # @param theWithContact - the mode defining that the section is translated to be in
3493 # contact with the spine.
3494 # @param theWithCorrection - defining that the section is rotated to be
3495 # orthogonal to the spine tangent in the correspondent point
3496 # @param theName Object name; when specified, this parameter is used
3497 # for result publication in the study. Otherwise, if automatic
3498 # publication is switched on, default value is used for result name.
3500 # @return New GEOM.GEOM_Object, containing the created pipe.
3502 # @ref tui_creation_pipe_with_diff_sec "Example"
3503 def MakePipeWithDifferentSections(self, theSeqBases,
3504 theLocations, thePath,
3505 theWithContact, theWithCorrection, theName=None):
3507 Create a shape by extrusion of the profile shape along
3508 the path shape. The path shape can be a wire or an edge.
3509 the several profiles can be specified in the several locations of path.
3512 theSeqBases - list of Bases shape to be extruded.
3513 theLocations - list of locations on the path corresponding
3514 specified list of the Bases shapes. Number of locations
3515 should be equal to number of bases or list of locations can be empty.
3516 thePath - Path shape to extrude the base shape along it.
3517 theWithContact - the mode defining that the section is translated to be in
3518 contact with the spine(0/1)
3519 theWithCorrection - defining that the section is rotated to be
3520 orthogonal to the spine tangent in the correspondent point (0/1)
3521 theName Object name; when specified, this parameter is used
3522 for result publication in the study. Otherwise, if automatic
3523 publication is switched on, default value is used for result name.
3526 New GEOM.GEOM_Object, containing the created pipe.
3528 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
3529 theLocations, thePath,
3530 theWithContact, theWithCorrection)
3531 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
3532 self._autoPublish(anObj, theName, "pipe")
3535 ## Create a shape by extrusion of the profile shape along
3536 # the path shape. The path shape can be a wire or a edge.
3537 # the several profiles can be specified in the several locations of path.
3538 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
3539 # shell or face. If number of faces in neighbour sections
3540 # aren't coincided result solid between such sections will
3541 # be created using external boundaries of this shells.
3542 # @param theSeqSubBases - list of corresponding sub-shapes of section shapes.
3543 # This list is used for searching correspondences between
3544 # faces in the sections. Size of this list must be equal
3545 # to size of list of base shapes.
3546 # @param theLocations - list of locations on the path corresponding
3547 # specified list of the Bases shapes. Number of locations
3548 # should be equal to number of bases. First and last
3549 # locations must be coincided with first and last vertexes
3550 # of path correspondingly.
3551 # @param thePath - Path shape to extrude the base shape along it.
3552 # @param theWithContact - the mode defining that the section is translated to be in
3553 # contact with the spine.
3554 # @param theWithCorrection - defining that the section is rotated to be
3555 # orthogonal to the spine tangent in the correspondent point
3556 # @param theName Object name; when specified, this parameter is used
3557 # for result publication in the study. Otherwise, if automatic
3558 # publication is switched on, default value is used for result name.
3560 # @return New GEOM.GEOM_Object, containing the created solids.
3562 # @ref tui_creation_pipe_with_shell_sec "Example"
3563 def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
3564 theLocations, thePath,
3565 theWithContact, theWithCorrection, theName=None):
3567 Create a shape by extrusion of the profile shape along
3568 the path shape. The path shape can be a wire or a edge.
3569 the several profiles can be specified in the several locations of path.
3572 theSeqBases - list of Bases shape to be extruded. Base shape must be
3573 shell or face. If number of faces in neighbour sections
3574 aren't coincided result solid between such sections will
3575 be created using external boundaries of this shells.
3576 theSeqSubBases - list of corresponding sub-shapes of section shapes.
3577 This list is used for searching correspondences between
3578 faces in the sections. Size of this list must be equal
3579 to size of list of base shapes.
3580 theLocations - list of locations on the path corresponding
3581 specified list of the Bases shapes. Number of locations
3582 should be equal to number of bases. First and last
3583 locations must be coincided with first and last vertexes
3584 of path correspondingly.
3585 thePath - Path shape to extrude the base shape along it.
3586 theWithContact - the mode defining that the section is translated to be in
3587 contact with the spine (0/1)
3588 theWithCorrection - defining that the section is rotated to be
3589 orthogonal to the spine tangent in the correspondent point (0/1)
3590 theName Object name; when specified, this parameter is used
3591 for result publication in the study. Otherwise, if automatic
3592 publication is switched on, default value is used for result name.
3595 New GEOM.GEOM_Object, containing the created solids.
3597 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
3598 theLocations, thePath,
3599 theWithContact, theWithCorrection)
3600 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3601 self._autoPublish(anObj, theName, "pipe")
3604 ## Create a shape by extrusion of the profile shape along
3605 # the path shape. This function is used only for debug pipe
3606 # functionality - it is a version of function MakePipeWithShellSections()
3607 # which give a possibility to recieve information about
3608 # creating pipe between each pair of sections step by step.
3609 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
3610 theLocations, thePath,
3611 theWithContact, theWithCorrection, theName=None):
3613 Create a shape by extrusion of the profile shape along
3614 the path shape. This function is used only for debug pipe
3615 functionality - it is a version of previous function
3616 geompy.MakePipeWithShellSections() which give a possibility to
3617 recieve information about creating pipe between each pair of
3618 sections step by step.
3621 nbsect = len(theSeqBases)
3622 nbsubsect = len(theSeqSubBases)
3623 #print "nbsect = ",nbsect
3624 for i in range(1,nbsect):
3626 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
3627 tmpLocations = [ theLocations[i-1], theLocations[i] ]
3629 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
3630 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
3631 tmpLocations, thePath,
3632 theWithContact, theWithCorrection)
3633 if self.PrimOp.IsDone() == 0:
3634 print "Problems with pipe creation between ",i," and ",i+1," sections"
3635 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
3638 print "Pipe between ",i," and ",i+1," sections is OK"
3643 resc = self.MakeCompound(res)
3644 #resc = self.MakeSewing(res, 0.001)
3645 #print "resc: ",resc
3646 self._autoPublish(resc, theName, "pipe")
3649 ## Create solids between given sections
3650 # @param theSeqBases - list of sections (shell or face).
3651 # @param theLocations - list of corresponding vertexes
3652 # @param theName Object name; when specified, this parameter is used
3653 # for result publication in the study. Otherwise, if automatic
3654 # publication is switched on, default value is used for result name.
3656 # @return New GEOM.GEOM_Object, containing the created solids.
3658 # @ref tui_creation_pipe_without_path "Example"
3659 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
3661 Create solids between given sections
3664 theSeqBases - list of sections (shell or face).
3665 theLocations - list of corresponding vertexes
3666 theName Object name; when specified, this parameter is used
3667 for result publication in the study. Otherwise, if automatic
3668 publication is switched on, default value is used for result name.
3671 New GEOM.GEOM_Object, containing the created solids.
3673 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
3674 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
3675 self._autoPublish(anObj, theName, "pipe")
3678 ## Create a shape by extrusion of the base shape along
3679 # the path shape with constant bi-normal direction along the given vector.
3680 # The path shape can be a wire or an edge.
3681 # @param theBase Base shape to be extruded.
3682 # @param thePath Path shape to extrude the base shape along it.
3683 # @param theVec Vector defines a constant binormal direction to keep the
3684 # same angle beetween the direction and the sections
3685 # along the sweep surface.
3686 # @param theName Object name; when specified, this parameter is used
3687 # for result publication in the study. Otherwise, if automatic
3688 # publication is switched on, default value is used for result name.
3690 # @return New GEOM.GEOM_Object, containing the created pipe.
3692 # @ref tui_creation_pipe "Example"
3693 def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
3695 Create a shape by extrusion of the base shape along
3696 the path shape with constant bi-normal direction along the given vector.
3697 The path shape can be a wire or an edge.
3700 theBase Base shape to be extruded.
3701 thePath Path shape to extrude the base shape along it.
3702 theVec Vector defines a constant binormal direction to keep the
3703 same angle beetween the direction and the sections
3704 along the sweep surface.
3705 theName Object name; when specified, this parameter is used
3706 for result publication in the study. Otherwise, if automatic
3707 publication is switched on, default value is used for result name.
3710 New GEOM.GEOM_Object, containing the created pipe.
3712 # Example: see GEOM_TestAll.py
3713 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
3714 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
3715 self._autoPublish(anObj, theName, "pipe")
3718 ## Makes a thick solid from a face or a shell
3719 # @param theShape Face or Shell to be thicken
3720 # @param theThickness Thickness of the resulting solid
3721 # @param theName Object name; when specified, this parameter is used
3722 # for result publication in the study. Otherwise, if automatic
3723 # publication is switched on, default value is used for result name.
3725 # @return New GEOM.GEOM_Object, containing the created solid
3727 def MakeThickSolid(self, theShape, theThickness, theName=None):
3729 Make a thick solid from a face or a shell
3732 theShape Face or Shell to be thicken
3733 theThickness Thickness of the resulting solid
3734 theName Object name; when specified, this parameter is used
3735 for result publication in the study. Otherwise, if automatic
3736 publication is switched on, default value is used for result name.
3739 New GEOM.GEOM_Object, containing the created solid
3741 # Example: see GEOM_TestAll.py
3742 anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
3743 RaiseIfFailed("MakeThickening", self.PrimOp)
3744 self._autoPublish(anObj, theName, "pipe")
3748 ## Modifies a face or a shell to make it a thick solid
3749 # @param theShape Face or Shell to be thicken
3750 # @param theThickness Thickness of the resulting solid
3752 # @return The modified shape
3754 def Thicken(self, theShape, theThickness):
3756 Modifies a face or a shell to make it a thick solid
3759 theBase Base shape to be extruded.
3760 thePath Path shape to extrude the base shape along it.
3761 theName Object name; when specified, this parameter is used
3762 for result publication in the study. Otherwise, if automatic
3763 publication is switched on, default value is used for result name.
3768 # Example: see GEOM_TestAll.py
3769 anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
3770 RaiseIfFailed("MakeThickening", self.PrimOp)
3773 ## Build a middle path of a pipe-like shape.
3774 # The path shape can be a wire or an edge.
3775 # @param theShape It can be closed or unclosed pipe-like shell
3776 # or a pipe-like solid.
3777 # @param theBase1, theBase2 Two bases of the supposed pipe. This
3778 # should be wires or faces of theShape.
3779 # @param theName Object name; when specified, this parameter is used
3780 # for result publication in the study. Otherwise, if automatic
3781 # publication is switched on, default value is used for result name.
3783 # @note It is not assumed that exact or approximate copy of theShape
3784 # can be obtained by applying existing Pipe operation on the
3785 # resulting "Path" wire taking theBase1 as the base - it is not
3786 # always possible; though in some particular cases it might work
3787 # it is not guaranteed. Thus, RestorePath function should not be
3788 # considered as an exact reverse operation of the Pipe.
3790 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3791 # source pipe's "path".
3793 # @ref tui_creation_pipe_path "Example"
3794 def RestorePath (self, theShape, theBase1, theBase2, theName=None):
3796 Build a middle path of a pipe-like shape.
3797 The path shape can be a wire or an edge.
3800 theShape It can be closed or unclosed pipe-like shell
3801 or a pipe-like solid.
3802 theBase1, theBase2 Two bases of the supposed pipe. This
3803 should be wires or faces of theShape.
3804 theName Object name; when specified, this parameter is used
3805 for result publication in the study. Otherwise, if automatic
3806 publication is switched on, default value is used for result name.
3809 New GEOM_Object, containing an edge or wire that represent
3812 anObj = self.PrimOp.RestorePath(theShape, theBase1, theBase2)
3813 RaiseIfFailed("RestorePath", self.PrimOp)
3814 self._autoPublish(anObj, theName, "path")
3817 ## Build a middle path of a pipe-like shape.
3818 # The path shape can be a wire or an edge.
3819 # @param theShape It can be closed or unclosed pipe-like shell
3820 # or a pipe-like solid.
3821 # @param listEdges1, listEdges2 Two bases of the supposed pipe. This
3822 # should be lists of edges of theShape.
3823 # @param theName Object name; when specified, this parameter is used
3824 # for result publication in the study. Otherwise, if automatic
3825 # publication is switched on, default value is used for result name.
3827 # @note It is not assumed that exact or approximate copy of theShape
3828 # can be obtained by applying existing Pipe operation on the
3829 # resulting "Path" wire taking theBase1 as the base - it is not
3830 # always possible; though in some particular cases it might work
3831 # it is not guaranteed. Thus, RestorePath function should not be
3832 # considered as an exact reverse operation of the Pipe.
3834 # @return New GEOM.GEOM_Object, containing an edge or wire that represent
3835 # source pipe's "path".
3837 # @ref tui_creation_pipe_path "Example"
3838 def RestorePathEdges (self, theShape, listEdges1, listEdges2, theName=None):
3840 Build a middle path of a pipe-like shape.
3841 The path shape can be a wire or an edge.
3844 theShape It can be closed or unclosed pipe-like shell
3845 or a pipe-like solid.
3846 listEdges1, listEdges2 Two bases of the supposed pipe. This
3847 should be lists of edges of theShape.
3848 theName Object name; when specified, this parameter is used
3849 for result publication in the study. Otherwise, if automatic
3850 publication is switched on, default value is used for result name.
3853 New GEOM_Object, containing an edge or wire that represent
3856 anObj = self.PrimOp.RestorePathEdges(theShape, listEdges1, listEdges2)
3857 RaiseIfFailed("RestorePath", self.PrimOp)
3858 self._autoPublish(anObj, theName, "path")
3864 ## @addtogroup l3_advanced
3867 ## Create a linear edge with specified ends.
3868 # @param thePnt1 Point for the first end of edge.
3869 # @param thePnt2 Point for the second end of edge.
3870 # @param theName Object name; when specified, this parameter is used
3871 # for result publication in the study. Otherwise, if automatic
3872 # publication is switched on, default value is used for result name.
3874 # @return New GEOM.GEOM_Object, containing the created edge.
3876 # @ref tui_creation_edge "Example"
3877 def MakeEdge(self, thePnt1, thePnt2, theName=None):
3879 Create a linear edge with specified ends.
3882 thePnt1 Point for the first end of edge.
3883 thePnt2 Point for the second end of edge.
3884 theName Object name; when specified, this parameter is used
3885 for result publication in the study. Otherwise, if automatic
3886 publication is switched on, default value is used for result name.
3889 New GEOM.GEOM_Object, containing the created edge.
3891 # Example: see GEOM_TestAll.py
3892 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
3893 RaiseIfFailed("MakeEdge", self.ShapesOp)
3894 self._autoPublish(anObj, theName, "edge")
3897 ## Create a new edge, corresponding to the given length on the given curve.
3898 # @param theRefCurve The referenced curve (edge).
3899 # @param theLength Length on the referenced curve. It can be negative.
3900 # @param theStartPoint Any point can be selected for it, the new edge will begin
3901 # at the end of \a theRefCurve, close to the selected point.
3902 # If None, start from the first point of \a theRefCurve.
3903 # @param theName Object name; when specified, this parameter is used
3904 # for result publication in the study. Otherwise, if automatic
3905 # publication is switched on, default value is used for result name.
3907 # @return New GEOM.GEOM_Object, containing the created edge.
3909 # @ref tui_creation_edge "Example"
3910 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None, theName=None):
3912 Create a new edge, corresponding to the given length on the given curve.
3915 theRefCurve The referenced curve (edge).
3916 theLength Length on the referenced curve. It can be negative.
3917 theStartPoint Any point can be selected for it, the new edge will begin
3918 at the end of theRefCurve, close to the selected point.
3919 If None, start from the first point of theRefCurve.
3920 theName Object name; when specified, this parameter is used
3921 for result publication in the study. Otherwise, if automatic
3922 publication is switched on, default value is used for result name.
3925 New GEOM.GEOM_Object, containing the created edge.
3927 # Example: see GEOM_TestAll.py
3928 theLength, Parameters = ParseParameters(theLength)
3929 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
3930 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
3931 anObj.SetParameters(Parameters)
3932 self._autoPublish(anObj, theName, "edge")
3935 ## Create an edge from specified wire.
3936 # @param theWire source Wire
3937 # @param theLinearTolerance linear tolerance value (default = 1e-07)
3938 # @param theAngularTolerance angular tolerance value (default = 1e-12)
3939 # @param theName Object name; when specified, this parameter is used
3940 # for result publication in the study. Otherwise, if automatic
3941 # publication is switched on, default value is used for result name.
3943 # @return New GEOM.GEOM_Object, containing the created edge.
3945 # @ref tui_creation_edge "Example"
3946 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12, theName=None):
3948 Create an edge from specified wire.
3952 theLinearTolerance linear tolerance value (default = 1e-07)
3953 theAngularTolerance angular tolerance value (default = 1e-12)
3954 theName Object name; when specified, this parameter is used
3955 for result publication in the study. Otherwise, if automatic
3956 publication is switched on, default value is used for result name.
3959 New GEOM.GEOM_Object, containing the created edge.
3961 # Example: see GEOM_TestAll.py
3962 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
3963 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
3964 self._autoPublish(anObj, theName, "edge")
3967 ## Create a wire from the set of edges and wires.
3968 # @param theEdgesAndWires List of edges and/or wires.
3969 # @param theTolerance Maximum distance between vertices, that will be merged.
3970 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion())
3971 # @param theName Object name; when specified, this parameter is used
3972 # for result publication in the study. Otherwise, if automatic
3973 # publication is switched on, default value is used for result name.
3975 # @return New GEOM.GEOM_Object, containing the created wire.
3977 # @ref tui_creation_wire "Example"
3978 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07, theName=None):
3980 Create a wire from the set of edges and wires.
3983 theEdgesAndWires List of edges and/or wires.
3984 theTolerance Maximum distance between vertices, that will be merged.
3985 Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
3986 theName Object name; when specified, this parameter is used
3987 for result publication in the study. Otherwise, if automatic
3988 publication is switched on, default value is used for result name.
3991 New GEOM.GEOM_Object, containing the created wire.
3993 # Example: see GEOM_TestAll.py
3994 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
3995 RaiseIfFailed("MakeWire", self.ShapesOp)
3996 self._autoPublish(anObj, theName, "wire")
3999 ## Create a face on the given wire.
4000 # @param theWire closed Wire or Edge to build the face on.
4001 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4002 # If the tolerance of the obtained planar face is less
4003 # than 1e-06, this face will be returned, otherwise the
4004 # algorithm tries to build any suitable face on the given
4005 # wire and prints a warning message.
4006 # @param theName Object name; when specified, this parameter is used
4007 # for result publication in the study. Otherwise, if automatic
4008 # publication is switched on, default value is used for result name.
4010 # @return New GEOM.GEOM_Object, containing the created face.
4012 # @ref tui_creation_face "Example"
4013 def MakeFace(self, theWire, isPlanarWanted, theName=None):
4015 Create a face on the given wire.
4018 theWire closed Wire or Edge to build the face on.
4019 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4020 If the tolerance of the obtained planar face is less
4021 than 1e-06, this face will be returned, otherwise the
4022 algorithm tries to build any suitable face on the given
4023 wire and prints a warning message.
4024 theName Object name; when specified, this parameter is used
4025 for result publication in the study. Otherwise, if automatic
4026 publication is switched on, default value is used for result name.
4029 New GEOM.GEOM_Object, containing the created face.
4031 # Example: see GEOM_TestAll.py
4032 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
4033 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4034 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4036 RaiseIfFailed("MakeFace", self.ShapesOp)
4037 self._autoPublish(anObj, theName, "face")
4040 ## Create a face on the given wires set.
4041 # @param theWires List of closed wires or edges to build the face on.
4042 # @param isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4043 # If the tolerance of the obtained planar face is less
4044 # than 1e-06, this face will be returned, otherwise the
4045 # algorithm tries to build any suitable face on the given
4046 # wire and prints a warning message.
4047 # @param theName Object name; when specified, this parameter is used
4048 # for result publication in the study. Otherwise, if automatic
4049 # publication is switched on, default value is used for result name.
4051 # @return New GEOM.GEOM_Object, containing the created face.
4053 # @ref tui_creation_face "Example"
4054 def MakeFaceWires(self, theWires, isPlanarWanted, theName=None):
4056 Create a face on the given wires set.
4059 theWires List of closed wires or edges to build the face on.
4060 isPlanarWanted If TRUE, the algorithm tries to build a planar face.
4061 If the tolerance of the obtained planar face is less
4062 than 1e-06, this face will be returned, otherwise the
4063 algorithm tries to build any suitable face on the given
4064 wire and prints a warning message.
4065 theName Object name; when specified, this parameter is used
4066 for result publication in the study. Otherwise, if automatic
4067 publication is switched on, default value is used for result name.
4070 New GEOM.GEOM_Object, containing the created face.
4072 # Example: see GEOM_TestAll.py
4073 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
4074 if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
4075 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
4077 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
4078 self._autoPublish(anObj, theName, "face")
4081 ## See MakeFaceWires() method for details.
4083 # @ref tui_creation_face "Example 1"
4084 # \n @ref swig_MakeFaces "Example 2"
4085 def MakeFaces(self, theWires, isPlanarWanted, theName=None):
4087 See geompy.MakeFaceWires() method for details.
4089 # Example: see GEOM_TestOthers.py
4090 # note: auto-publishing is done in self.MakeFaceWires()
4091 anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
4094 ## Create a shell from the set of faces and shells.
4095 # @param theFacesAndShells List of faces and/or shells.
4096 # @param theName Object name; when specified, this parameter is used
4097 # for result publication in the study. Otherwise, if automatic
4098 # publication is switched on, default value is used for result name.
4100 # @return New GEOM.GEOM_Object, containing the created shell.
4102 # @ref tui_creation_shell "Example"
4103 def MakeShell(self, theFacesAndShells, theName=None):
4105 Create a shell from the set of faces and shells.
4108 theFacesAndShells List of faces and/or shells.
4109 theName Object name; when specified, this parameter is used
4110 for result publication in the study. Otherwise, if automatic
4111 publication is switched on, default value is used for result name.
4114 New GEOM.GEOM_Object, containing the created shell.
4116 # Example: see GEOM_TestAll.py
4117 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
4118 RaiseIfFailed("MakeShell", self.ShapesOp)
4119 self._autoPublish(anObj, theName, "shell")
4122 ## Create a solid, bounded by the given shells.
4123 # @param theShells Sequence of bounding shells.
4124 # @param theName Object name; when specified, this parameter is used
4125 # for result publication in the study. Otherwise, if automatic
4126 # publication is switched on, default value is used for result name.
4128 # @return New GEOM.GEOM_Object, containing the created solid.
4130 # @ref tui_creation_solid "Example"
4131 def MakeSolid(self, theShells, theName=None):
4133 Create a solid, bounded by the given shells.
4136 theShells Sequence of bounding shells.
4137 theName Object name; when specified, this parameter is used
4138 for result publication in the study. Otherwise, if automatic
4139 publication is switched on, default value is used for result name.
4142 New GEOM.GEOM_Object, containing the created solid.
4144 # Example: see GEOM_TestAll.py
4145 if len(theShells) == 1:
4146 descr = self.MeasuOp.IsGoodForSolid(theShells[0])
4148 # raise RuntimeError, "MakeSolidShells : " + descr
4149 if descr == "WRN_SHAPE_UNCLOSED":
4150 raise RuntimeError, "MakeSolidShells : Unable to create solid from unclosed shape"
4151 anObj = self.ShapesOp.MakeSolidShells(theShells)
4152 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
4153 self._autoPublish(anObj, theName, "solid")
4156 ## Create a compound of the given shapes.
4157 # @param theShapes List of shapes to put in compound.
4158 # @param theName Object name; when specified, this parameter is used
4159 # for result publication in the study. Otherwise, if automatic
4160 # publication is switched on, default value is used for result name.
4162 # @return New GEOM.GEOM_Object, containing the created compound.
4164 # @ref tui_creation_compound "Example"
4165 def MakeCompound(self, theShapes, theName=None):
4167 Create a compound of the given shapes.
4170 theShapes List of shapes to put in compound.
4171 theName Object name; when specified, this parameter is used
4172 for result publication in the study. Otherwise, if automatic
4173 publication is switched on, default value is used for result name.
4176 New GEOM.GEOM_Object, containing the created compound.
4178 # Example: see GEOM_TestAll.py
4179 anObj = self.ShapesOp.MakeCompound(theShapes)
4180 RaiseIfFailed("MakeCompound", self.ShapesOp)
4181 self._autoPublish(anObj, theName, "compound")
4184 # end of l3_advanced
4187 ## @addtogroup l2_measure
4190 ## Gives quantity of faces in the given shape.
4191 # @param theShape Shape to count faces of.
4192 # @return Quantity of faces.
4194 # @ref swig_NumberOf "Example"
4195 def NumberOfFaces(self, theShape):
4197 Gives quantity of faces in the given shape.
4200 theShape Shape to count faces of.
4205 # Example: see GEOM_TestOthers.py
4206 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
4207 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
4210 ## Gives quantity of edges in the given shape.
4211 # @param theShape Shape to count edges of.
4212 # @return Quantity of edges.
4214 # @ref swig_NumberOf "Example"
4215 def NumberOfEdges(self, theShape):
4217 Gives quantity of edges in the given shape.
4220 theShape Shape to count edges of.
4225 # Example: see GEOM_TestOthers.py
4226 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
4227 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
4230 ## Gives quantity of sub-shapes of type theShapeType in the given shape.
4231 # @param theShape Shape to count sub-shapes of.
4232 # @param theShapeType Type of sub-shapes to count (see ShapeType())
4233 # @return Quantity of sub-shapes of given type.
4235 # @ref swig_NumberOf "Example"
4236 def NumberOfSubShapes(self, theShape, theShapeType):
4238 Gives quantity of sub-shapes of type theShapeType in the given shape.
4241 theShape Shape to count sub-shapes of.
4242 theShapeType Type of sub-shapes to count (see geompy.ShapeType)
4245 Quantity of sub-shapes of given type.
4247 # Example: see GEOM_TestOthers.py
4248 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
4249 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
4252 ## Gives quantity of solids in the given shape.
4253 # @param theShape Shape to count solids in.
4254 # @return Quantity of solids.
4256 # @ref swig_NumberOf "Example"
4257 def NumberOfSolids(self, theShape):
4259 Gives quantity of solids in the given shape.
4262 theShape Shape to count solids in.
4267 # Example: see GEOM_TestOthers.py
4268 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
4269 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
4275 ## @addtogroup l3_healing
4278 ## Reverses an orientation the given shape.
4279 # @param theShape Shape to be reversed.
4280 # @param theName Object name; when specified, this parameter is used
4281 # for result publication in the study. Otherwise, if automatic
4282 # publication is switched on, default value is used for result name.
4284 # @return The reversed copy of theShape.
4286 # @ref swig_ChangeOrientation "Example"
4287 def ChangeOrientation(self, theShape, theName=None):
4289 Reverses an orientation the given shape.
4292 theShape Shape to be reversed.
4293 theName Object name; when specified, this parameter is used
4294 for result publication in the study. Otherwise, if automatic
4295 publication is switched on, default value is used for result name.
4298 The reversed copy of theShape.
4300 # Example: see GEOM_TestAll.py
4301 anObj = self.ShapesOp.ChangeOrientation(theShape)
4302 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
4303 self._autoPublish(anObj, theName, "reversed")
4306 ## See ChangeOrientation() method for details.
4308 # @ref swig_OrientationChange "Example"
4309 def OrientationChange(self, theShape, theName=None):
4311 See geompy.ChangeOrientation method for details.
4313 # Example: see GEOM_TestOthers.py
4314 # note: auto-publishing is done in self.ChangeOrientation()
4315 anObj = self.ChangeOrientation(theShape, theName)
4321 ## @addtogroup l4_obtain
4324 ## Retrieve all free faces from the given shape.
4325 # Free face is a face, which is not shared between two shells of the shape.
4326 # @param theShape Shape to find free faces in.
4327 # @return List of IDs of all free faces, contained in theShape.
4329 # @ref tui_measurement_tools_page "Example"
4330 def GetFreeFacesIDs(self,theShape):
4332 Retrieve all free faces from the given shape.
4333 Free face is a face, which is not shared between two shells of the shape.
4336 theShape Shape to find free faces in.
4339 List of IDs of all free faces, contained in theShape.
4341 # Example: see GEOM_TestOthers.py
4342 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
4343 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
4346 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4347 # @param theShape1 Shape to find sub-shapes in.
4348 # @param theShape2 Shape to find shared sub-shapes with.
4349 # @param theShapeType Type of sub-shapes to be retrieved.
4350 # @param theName Object name; when specified, this parameter is used
4351 # for result publication in the study. Otherwise, if automatic
4352 # publication is switched on, default value is used for result name.
4354 # @return List of sub-shapes of theShape1, shared with theShape2.
4356 # @ref swig_GetSharedShapes "Example"
4357 def GetSharedShapes(self, theShape1, theShape2, theShapeType, theName=None):
4359 Get all sub-shapes of theShape1 of the given type, shared with theShape2.
4362 theShape1 Shape to find sub-shapes in.
4363 theShape2 Shape to find shared sub-shapes with.
4364 theShapeType Type of sub-shapes to be retrieved.
4365 theName Object name; when specified, this parameter is used
4366 for result publication in the study. Otherwise, if automatic
4367 publication is switched on, default value is used for result name.
4370 List of sub-shapes of theShape1, shared with theShape2.
4372 # Example: see GEOM_TestOthers.py
4373 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
4374 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
4375 self._autoPublish(aList, theName, "shared")
4378 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
4379 # @param theShapes Shapes to find common sub-shapes of.
4380 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4381 # @param theName Object name; when specified, this parameter is used
4382 # for result publication in the study. Otherwise, if automatic
4383 # publication is switched on, default value is used for result name.
4385 # @return List of objects, that are sub-shapes of all given shapes.
4387 # @ref swig_GetSharedShapes "Example"
4388 def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
4390 Get all sub-shapes, shared by all shapes in the list theShapes.
4393 theShapes Shapes to find common sub-shapes of.
4394 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4395 theName Object name; when specified, this parameter is used
4396 for result publication in the study. Otherwise, if automatic
4397 publication is switched on, default value is used for result name.
4400 List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
4402 # Example: see GEOM_TestOthers.py
4403 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
4404 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
4405 self._autoPublish(aList, theName, "shared")
4408 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4409 # situated relatively the specified plane by the certain way,
4410 # defined through <VAR>theState</VAR> parameter.
4411 # @param theShape Shape to find sub-shapes of.
4412 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4413 # @param theAx1 Vector (or line, or linear edge), specifying normal
4414 # direction and location of the plane to find shapes on.
4415 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4416 # @param theName Object name; when specified, this parameter is used
4417 # for result publication in the study. Otherwise, if automatic
4418 # publication is switched on, default value is used for result name.
4420 # @return List of all found sub-shapes.
4422 # @ref swig_GetShapesOnPlane "Example"
4423 def GetShapesOnPlane(self, theShape, theShapeType, theAx1, theState, theName=None):
4425 Find in theShape all sub-shapes of type theShapeType,
4426 situated relatively the specified plane by the certain way,
4427 defined through theState parameter.
4430 theShape Shape to find sub-shapes of.
4431 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4432 theAx1 Vector (or line, or linear edge), specifying normal
4433 direction and location of the plane to find shapes on.
4434 theState The state of the sub-shapes to find (see GEOM::shape_state)
4435 theName Object name; when specified, this parameter is used
4436 for result publication in the study. Otherwise, if automatic
4437 publication is switched on, default value is used for result name.
4440 List of all found sub-shapes.
4442 # Example: see GEOM_TestOthers.py
4443 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
4444 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
4445 self._autoPublish(aList, theName, "shapeOnPlane")
4448 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4449 # situated relatively the specified plane by the certain way,
4450 # defined through <VAR>theState</VAR> parameter.
4451 # @param theShape Shape to find sub-shapes of.
4452 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4453 # @param theAx1 Vector (or line, or linear edge), specifying normal
4454 # direction and location of the plane to find shapes on.
4455 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4457 # @return List of all found sub-shapes indices.
4459 # @ref swig_GetShapesOnPlaneIDs "Example"
4460 def GetShapesOnPlaneIDs(self, theShape, theShapeType, theAx1, theState):
4462 Find in theShape all sub-shapes of type theShapeType,
4463 situated relatively the specified plane by the certain way,
4464 defined through theState parameter.
4467 theShape Shape to find sub-shapes of.
4468 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4469 theAx1 Vector (or line, or linear edge), specifying normal
4470 direction and location of the plane to find shapes on.
4471 theState The state of the sub-shapes to find (see GEOM::shape_state)
4474 List of all found sub-shapes indices.
4476 # Example: see GEOM_TestOthers.py
4477 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
4478 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
4481 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4482 # situated relatively the specified plane by the certain way,
4483 # defined through <VAR>theState</VAR> parameter.
4484 # @param theShape Shape to find sub-shapes of.
4485 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4486 # @param theAx1 Vector (or line, or linear edge), specifying normal
4487 # direction of the plane to find shapes on.
4488 # @param thePnt Point specifying location of the plane to find shapes on.
4489 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4490 # @param theName Object name; when specified, this parameter is used
4491 # for result publication in the study. Otherwise, if automatic
4492 # publication is switched on, default value is used for result name.
4494 # @return List of all found sub-shapes.
4496 # @ref swig_GetShapesOnPlaneWithLocation "Example"
4497 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState, theName=None):
4499 Find in theShape all sub-shapes of type theShapeType,
4500 situated relatively the specified plane by the certain way,
4501 defined through theState parameter.
4504 theShape Shape to find sub-shapes of.
4505 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4506 theAx1 Vector (or line, or linear edge), specifying normal
4507 direction and location of the plane to find shapes on.
4508 thePnt Point specifying location of the plane to find shapes on.
4509 theState The state of the sub-shapes to find (see GEOM::shape_state)
4510 theName Object name; when specified, this parameter is used
4511 for result publication in the study. Otherwise, if automatic
4512 publication is switched on, default value is used for result name.
4515 List of all found sub-shapes.
4517 # Example: see GEOM_TestOthers.py
4518 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
4519 theAx1, thePnt, theState)
4520 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
4521 self._autoPublish(aList, theName, "shapeOnPlane")
4524 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
4525 # situated relatively the specified plane by the certain way,
4526 # defined through <VAR>theState</VAR> parameter.
4527 # @param theShape Shape to find sub-shapes of.
4528 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4529 # @param theAx1 Vector (or line, or linear edge), specifying normal
4530 # direction of the plane to find shapes on.
4531 # @param thePnt Point specifying location of the plane to find shapes on.
4532 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4534 # @return List of all found sub-shapes indices.
4536 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
4537 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
4539 Find in theShape all sub-shapes of type theShapeType,
4540 situated relatively the specified plane by the certain way,
4541 defined through theState parameter.
4544 theShape Shape to find sub-shapes of.
4545 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4546 theAx1 Vector (or line, or linear edge), specifying normal
4547 direction and location of the plane to find shapes on.
4548 thePnt Point specifying location of the plane to find shapes on.
4549 theState The state of the sub-shapes to find (see GEOM::shape_state)
4552 List of all found sub-shapes indices.
4554 # Example: see GEOM_TestOthers.py
4555 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
4556 theAx1, thePnt, theState)
4557 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
4560 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4561 # the specified cylinder by the certain way, defined through \a theState parameter.
4562 # @param theShape Shape to find sub-shapes of.
4563 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4564 # @param theAxis Vector (or line, or linear edge), specifying
4565 # axis of the cylinder to find shapes on.
4566 # @param theRadius Radius of the cylinder to find shapes on.
4567 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4568 # @param theName Object name; when specified, this parameter is used
4569 # for result publication in the study. Otherwise, if automatic
4570 # publication is switched on, default value is used for result name.
4572 # @return List of all found sub-shapes.
4574 # @ref swig_GetShapesOnCylinder "Example"
4575 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState, theName=None):
4577 Find in theShape all sub-shapes of type theShapeType, situated relatively
4578 the specified cylinder by the certain way, defined through theState parameter.
4581 theShape Shape to find sub-shapes of.
4582 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4583 theAxis Vector (or line, or linear edge), specifying
4584 axis of the cylinder to find shapes on.
4585 theRadius Radius of the cylinder to find shapes on.
4586 theState The state of the sub-shapes to find (see GEOM::shape_state)
4587 theName Object name; when specified, this parameter is used
4588 for result publication in the study. Otherwise, if automatic
4589 publication is switched on, default value is used for result name.
4592 List of all found sub-shapes.
4594 # Example: see GEOM_TestOthers.py
4595 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
4596 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
4597 self._autoPublish(aList, theName, "shapeOnCylinder")
4600 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4601 # the specified cylinder by the certain way, defined through \a theState parameter.
4602 # @param theShape Shape to find sub-shapes of.
4603 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4604 # @param theAxis Vector (or line, or linear edge), specifying
4605 # axis of the cylinder to find shapes on.
4606 # @param theRadius Radius of the cylinder to find shapes on.
4607 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4609 # @return List of all found sub-shapes indices.
4611 # @ref swig_GetShapesOnCylinderIDs "Example"
4612 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
4614 Find in theShape all sub-shapes of type theShapeType, situated relatively
4615 the specified cylinder by the certain way, defined through theState parameter.
4618 theShape Shape to find sub-shapes of.
4619 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4620 theAxis Vector (or line, or linear edge), specifying
4621 axis of the cylinder to find shapes on.
4622 theRadius Radius of the cylinder to find shapes on.
4623 theState The state of the sub-shapes to find (see GEOM::shape_state)
4626 List of all found sub-shapes indices.
4628 # Example: see GEOM_TestOthers.py
4629 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
4630 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
4633 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4634 # the specified cylinder by the certain way, defined through \a theState parameter.
4635 # @param theShape Shape to find sub-shapes of.
4636 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4637 # @param theAxis Vector (or line, or linear edge), specifying
4638 # axis of the cylinder to find shapes on.
4639 # @param thePnt Point specifying location of the bottom of the cylinder.
4640 # @param theRadius Radius of the cylinder to find shapes on.
4641 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4642 # @param theName Object name; when specified, this parameter is used
4643 # for result publication in the study. Otherwise, if automatic
4644 # publication is switched on, default value is used for result name.
4646 # @return List of all found sub-shapes.
4648 # @ref swig_GetShapesOnCylinderWithLocation "Example"
4649 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState, theName=None):
4651 Find in theShape all sub-shapes of type theShapeType, situated relatively
4652 the specified cylinder by the certain way, defined through theState parameter.
4655 theShape Shape to find sub-shapes of.
4656 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4657 theAxis Vector (or line, or linear edge), specifying
4658 axis of the cylinder to find shapes on.
4659 theRadius Radius of the cylinder to find shapes on.
4660 theState The state of the sub-shapes to find (see GEOM::shape_state)
4661 theName Object name; when specified, this parameter is used
4662 for result publication in the study. Otherwise, if automatic
4663 publication is switched on, default value is used for result name.
4666 List of all found sub-shapes.
4668 # Example: see GEOM_TestOthers.py
4669 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4670 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
4671 self._autoPublish(aList, theName, "shapeOnCylinder")
4674 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4675 # the specified cylinder by the certain way, defined through \a theState parameter.
4676 # @param theShape Shape to find sub-shapes of.
4677 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4678 # @param theAxis Vector (or line, or linear edge), specifying
4679 # axis of the cylinder to find shapes on.
4680 # @param thePnt Point specifying location of the bottom of the cylinder.
4681 # @param theRadius Radius of the cylinder to find shapes on.
4682 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4684 # @return List of all found sub-shapes indices
4686 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
4687 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
4689 Find in theShape all sub-shapes of type theShapeType, situated relatively
4690 the specified cylinder by the certain way, defined through theState parameter.
4693 theShape Shape to find sub-shapes of.
4694 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4695 theAxis Vector (or line, or linear edge), specifying
4696 axis of the cylinder to find shapes on.
4697 theRadius Radius of the cylinder to find shapes on.
4698 theState The state of the sub-shapes to find (see GEOM::shape_state)
4701 List of all found sub-shapes indices.
4703 # Example: see GEOM_TestOthers.py
4704 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
4705 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
4708 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4709 # the specified sphere by the certain way, defined through \a theState parameter.
4710 # @param theShape Shape to find sub-shapes of.
4711 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4712 # @param theCenter Point, specifying center of the sphere to find shapes on.
4713 # @param theRadius Radius of the sphere to find shapes on.
4714 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4715 # @param theName Object name; when specified, this parameter is used
4716 # for result publication in the study. Otherwise, if automatic
4717 # publication is switched on, default value is used for result name.
4719 # @return List of all found sub-shapes.
4721 # @ref swig_GetShapesOnSphere "Example"
4722 def GetShapesOnSphere(self, theShape, theShapeType, theCenter, theRadius, theState, theName=None):
4724 Find in theShape all sub-shapes of type theShapeType, situated relatively
4725 the specified sphere by the certain way, defined through theState parameter.
4728 theShape Shape to find sub-shapes of.
4729 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4730 theCenter Point, specifying center of the sphere to find shapes on.
4731 theRadius Radius of the sphere to find shapes on.
4732 theState The state of the sub-shapes to find (see GEOM::shape_state)
4733 theName Object name; when specified, this parameter is used
4734 for result publication in the study. Otherwise, if automatic
4735 publication is switched on, default value is used for result name.
4738 List of all found sub-shapes.
4740 # Example: see GEOM_TestOthers.py
4741 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
4742 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
4743 self._autoPublish(aList, theName, "shapeOnSphere")
4746 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4747 # the specified sphere by the certain way, defined through \a theState parameter.
4748 # @param theShape Shape to find sub-shapes of.
4749 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4750 # @param theCenter Point, specifying center of the sphere to find shapes on.
4751 # @param theRadius Radius of the sphere to find shapes on.
4752 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4754 # @return List of all found sub-shapes indices.
4756 # @ref swig_GetShapesOnSphereIDs "Example"
4757 def GetShapesOnSphereIDs(self, theShape, theShapeType, theCenter, theRadius, theState):
4759 Find in theShape all sub-shapes of type theShapeType, situated relatively
4760 the specified sphere by the certain way, defined through theState parameter.
4763 theShape Shape to find sub-shapes of.
4764 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4765 theCenter Point, specifying center of the sphere to find shapes on.
4766 theRadius Radius of the sphere to find shapes on.
4767 theState The state of the sub-shapes to find (see GEOM::shape_state)
4770 List of all found sub-shapes indices.
4772 # Example: see GEOM_TestOthers.py
4773 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
4774 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
4777 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4778 # the specified quadrangle by the certain way, defined through \a theState parameter.
4779 # @param theShape Shape to find sub-shapes of.
4780 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4781 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4782 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4783 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4784 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4785 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4786 # @param theName Object name; when specified, this parameter is used
4787 # for result publication in the study. Otherwise, if automatic
4788 # publication is switched on, default value is used for result name.
4790 # @return List of all found sub-shapes.
4792 # @ref swig_GetShapesOnQuadrangle "Example"
4793 def GetShapesOnQuadrangle(self, theShape, theShapeType,
4794 theTopLeftPoint, theTopRigthPoint,
4795 theBottomLeftPoint, theBottomRigthPoint, theState, theName=None):
4797 Find in theShape all sub-shapes of type theShapeType, situated relatively
4798 the specified quadrangle by the certain way, defined through theState parameter.
4801 theShape Shape to find sub-shapes of.
4802 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4803 theTopLeftPoint Point, specifying top left corner of a quadrangle
4804 theTopRigthPoint Point, specifying top right corner of a quadrangle
4805 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4806 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4807 theState The state of the sub-shapes to find (see GEOM::shape_state)
4808 theName Object name; when specified, this parameter is used
4809 for result publication in the study. Otherwise, if automatic
4810 publication is switched on, default value is used for result name.
4813 List of all found sub-shapes.
4815 # Example: see GEOM_TestOthers.py
4816 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
4817 theTopLeftPoint, theTopRigthPoint,
4818 theBottomLeftPoint, theBottomRigthPoint, theState)
4819 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
4820 self._autoPublish(aList, theName, "shapeOnQuadrangle")
4823 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4824 # the specified quadrangle by the certain way, defined through \a theState parameter.
4825 # @param theShape Shape to find sub-shapes of.
4826 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4827 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
4828 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
4829 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4830 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4831 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4833 # @return List of all found sub-shapes indices.
4835 # @ref swig_GetShapesOnQuadrangleIDs "Example"
4836 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
4837 theTopLeftPoint, theTopRigthPoint,
4838 theBottomLeftPoint, theBottomRigthPoint, theState):
4840 Find in theShape all sub-shapes of type theShapeType, situated relatively
4841 the specified quadrangle by the certain way, defined through theState parameter.
4844 theShape Shape to find sub-shapes of.
4845 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4846 theTopLeftPoint Point, specifying top left corner of a quadrangle
4847 theTopRigthPoint Point, specifying top right corner of a quadrangle
4848 theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
4849 theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
4850 theState The state of the sub-shapes to find (see GEOM::shape_state)
4853 List of all found sub-shapes indices.
4856 # Example: see GEOM_TestOthers.py
4857 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
4858 theTopLeftPoint, theTopRigthPoint,
4859 theBottomLeftPoint, theBottomRigthPoint, theState)
4860 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
4863 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4864 # the specified \a theBox by the certain way, defined through \a theState parameter.
4865 # @param theBox Shape for relative comparing.
4866 # @param theShape Shape to find sub-shapes of.
4867 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4868 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4869 # @param theName Object name; when specified, this parameter is used
4870 # for result publication in the study. Otherwise, if automatic
4871 # publication is switched on, default value is used for result name.
4873 # @return List of all found sub-shapes.
4875 # @ref swig_GetShapesOnBox "Example"
4876 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState, theName=None):
4878 Find in theShape all sub-shapes of type theShapeType, situated relatively
4879 the specified theBox by the certain way, defined through theState parameter.
4882 theBox Shape for relative comparing.
4883 theShape Shape to find sub-shapes of.
4884 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4885 theState The state of the sub-shapes to find (see GEOM::shape_state)
4886 theName Object name; when specified, this parameter is used
4887 for result publication in the study. Otherwise, if automatic
4888 publication is switched on, default value is used for result name.
4891 List of all found sub-shapes.
4893 # Example: see GEOM_TestOthers.py
4894 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
4895 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
4896 self._autoPublish(aList, theName, "shapeOnBox")
4899 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
4900 # the specified \a theBox by the certain way, defined through \a theState parameter.
4901 # @param theBox Shape for relative comparing.
4902 # @param theShape Shape to find sub-shapes of.
4903 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4904 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4906 # @return List of all found sub-shapes indices.
4908 # @ref swig_GetShapesOnBoxIDs "Example"
4909 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
4911 Find in theShape all sub-shapes of type theShapeType, situated relatively
4912 the specified theBox by the certain way, defined through theState parameter.
4915 theBox Shape for relative comparing.
4916 theShape Shape to find sub-shapes of.
4917 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4918 theState The state of the sub-shapes to find (see GEOM::shape_state)
4921 List of all found sub-shapes indices.
4923 # Example: see GEOM_TestOthers.py
4924 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
4925 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
4928 ## Find in \a theShape all sub-shapes of type \a theShapeType,
4929 # situated relatively the specified \a theCheckShape by the
4930 # certain way, defined through \a theState parameter.
4931 # @param theCheckShape Shape for relative comparing. It must be a solid.
4932 # @param theShape Shape to find sub-shapes of.
4933 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4934 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4935 # @param theName Object name; when specified, this parameter is used
4936 # for result publication in the study. Otherwise, if automatic
4937 # publication is switched on, default value is used for result name.
4939 # @return List of all found sub-shapes.
4941 # @ref swig_GetShapesOnShape "Example"
4942 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None):
4944 Find in theShape all sub-shapes of type theShapeType,
4945 situated relatively the specified theCheckShape by the
4946 certain way, defined through theState parameter.
4949 theCheckShape Shape for relative comparing. It must be a solid.
4950 theShape Shape to find sub-shapes of.
4951 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4952 theState The state of the sub-shapes to find (see GEOM::shape_state)
4953 theName Object name; when specified, this parameter is used
4954 for result publication in the study. Otherwise, if automatic
4955 publication is switched on, default value is used for result name.
4958 List of all found sub-shapes.
4960 # Example: see GEOM_TestOthers.py
4961 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
4962 theShapeType, theState)
4963 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
4964 self._autoPublish(aList, theName, "shapeOnShape")
4967 ## Find in \a theShape all sub-shapes of type \a theShapeType,
4968 # situated relatively the specified \a theCheckShape by the
4969 # certain way, defined through \a theState parameter.
4970 # @param theCheckShape Shape for relative comparing. It must be a solid.
4971 # @param theShape Shape to find sub-shapes of.
4972 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
4973 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
4974 # @param theName Object name; when specified, this parameter is used
4975 # for result publication in the study. Otherwise, if automatic
4976 # publication is switched on, default value is used for result name.
4978 # @return All found sub-shapes as compound.
4980 # @ref swig_GetShapesOnShapeAsCompound "Example"
4981 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None):
4983 Find in theShape all sub-shapes of type theShapeType,
4984 situated relatively the specified theCheckShape by the
4985 certain way, defined through theState parameter.
4988 theCheckShape Shape for relative comparing. It must be a solid.
4989 theShape Shape to find sub-shapes of.
4990 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
4991 theState The state of the sub-shapes to find (see GEOM::shape_state)
4992 theName Object name; when specified, this parameter is used
4993 for result publication in the study. Otherwise, if automatic
4994 publication is switched on, default value is used for result name.
4997 All found sub-shapes as compound.
4999 # Example: see GEOM_TestOthers.py
5000 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
5001 theShapeType, theState)
5002 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
5003 self._autoPublish(anObj, theName, "shapeOnShape")
5006 ## Find in \a theShape all sub-shapes of type \a theShapeType,
5007 # situated relatively the specified \a theCheckShape by the
5008 # certain way, defined through \a theState parameter.
5009 # @param theCheckShape Shape for relative comparing. It must be a solid.
5010 # @param theShape Shape to find sub-shapes of.
5011 # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
5012 # @param theState The state of the sub-shapes to find (see GEOM::shape_state)
5014 # @return List of all found sub-shapes indices.
5016 # @ref swig_GetShapesOnShapeIDs "Example"
5017 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
5019 Find in theShape all sub-shapes of type theShapeType,
5020 situated relatively the specified theCheckShape by the
5021 certain way, defined through theState parameter.
5024 theCheckShape Shape for relative comparing. It must be a solid.
5025 theShape Shape to find sub-shapes of.
5026 theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5027 theState The state of the sub-shapes to find (see GEOM::shape_state)
5030 List of all found sub-shapes indices.
5032 # Example: see GEOM_TestOthers.py
5033 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
5034 theShapeType, theState)
5035 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
5038 ## Get sub-shape(s) of theShapeWhere, which are
5039 # coincident with \a theShapeWhat or could be a part of it.
5040 # @param theShapeWhere Shape to find sub-shapes of.
5041 # @param theShapeWhat Shape, specifying what to find.
5042 # @param isNewImplementation implementation of GetInPlace functionality
5043 # (default = False, old alghorithm based on shape properties)
5044 # @param theName Object name; when specified, this parameter is used
5045 # for result publication in the study. Otherwise, if automatic
5046 # publication is switched on, default value is used for result name.
5048 # @return Group of all found sub-shapes or a single found sub-shape.
5050 # @note This function has a restriction on argument shapes.
5051 # If \a theShapeWhere has curved parts with significantly
5052 # outstanding centres (i.e. the mass centre of a part is closer to
5053 # \a theShapeWhat than to the part), such parts will not be found.
5054 # @image html get_in_place_lost_part.png
5056 # @ref swig_GetInPlace "Example"
5057 def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False, theName=None):
5059 Get sub-shape(s) of theShapeWhere, which are
5060 coincident with theShapeWhat or could be a part of it.
5063 theShapeWhere Shape to find sub-shapes of.
5064 theShapeWhat Shape, specifying what to find.
5065 isNewImplementation Implementation of GetInPlace functionality
5066 (default = False, old alghorithm based on shape properties)
5067 theName Object name; when specified, this parameter is used
5068 for result publication in the study. Otherwise, if automatic
5069 publication is switched on, default value is used for result name.
5072 Group of all found sub-shapes or a single found sub-shape.
5076 This function has a restriction on argument shapes.
5077 If theShapeWhere has curved parts with significantly
5078 outstanding centres (i.e. the mass centre of a part is closer to
5079 theShapeWhat than to the part), such parts will not be found.
5081 # Example: see GEOM_TestOthers.py
5083 if isNewImplementation:
5084 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
5086 anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
5088 RaiseIfFailed("GetInPlace", self.ShapesOp)
5089 self._autoPublish(anObj, theName, "inplace")
5092 ## Get sub-shape(s) of \a theShapeWhere, which are
5093 # coincident with \a theShapeWhat or could be a part of it.
5095 # Implementation of this method is based on a saved history of an operation,
5096 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
5097 # arguments (an argument shape or a sub-shape of an argument shape).
5098 # The operation could be the Partition or one of boolean operations,
5099 # performed on simple shapes (not on compounds).
5101 # @param theShapeWhere Shape to find sub-shapes of.
5102 # @param theShapeWhat Shape, specifying what to find (must be in the
5103 # building history of the ShapeWhere).
5104 # @param theName Object name; when specified, this parameter is used
5105 # for result publication in the study. Otherwise, if automatic
5106 # publication is switched on, default value is used for result name.
5108 # @return Group of all found sub-shapes or a single found sub-shape.
5110 # @ref swig_GetInPlace "Example"
5111 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat, theName=None):
5113 Implementation of this method is based on a saved history of an operation,
5114 produced theShapeWhere. The theShapeWhat must be among this operation's
5115 arguments (an argument shape or a sub-shape of an argument shape).
5116 The operation could be the Partition or one of boolean operations,
5117 performed on simple shapes (not on compounds).
5120 theShapeWhere Shape to find sub-shapes of.
5121 theShapeWhat Shape, specifying what to find (must be in the
5122 building history of the ShapeWhere).
5123 theName Object name; when specified, this parameter is used
5124 for result publication in the study. Otherwise, if automatic
5125 publication is switched on, default value is used for result name.
5128 Group of all found sub-shapes or a single found sub-shape.
5130 # Example: see GEOM_TestOthers.py
5131 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
5132 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
5133 self._autoPublish(anObj, theName, "inplace")
5136 ## Get sub-shape of theShapeWhere, which is
5137 # equal to \a theShapeWhat.
5138 # @param theShapeWhere Shape to find sub-shape of.
5139 # @param theShapeWhat Shape, specifying what to find.
5140 # @param theName Object name; when specified, this parameter is used
5141 # for result publication in the study. Otherwise, if automatic
5142 # publication is switched on, default value is used for result name.
5144 # @return New GEOM.GEOM_Object for found sub-shape.
5146 # @ref swig_GetSame "Example"
5147 def GetSame(self, theShapeWhere, theShapeWhat, theName=None):
5149 Get sub-shape of theShapeWhere, which is
5150 equal to theShapeWhat.
5153 theShapeWhere Shape to find sub-shape of.
5154 theShapeWhat Shape, specifying what to find.
5155 theName Object name; when specified, this parameter is used
5156 for result publication in the study. Otherwise, if automatic
5157 publication is switched on, default value is used for result name.
5160 New GEOM.GEOM_Object for found sub-shape.
5162 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
5163 RaiseIfFailed("GetSame", self.ShapesOp)
5164 self._autoPublish(anObj, theName, "sameShape")
5168 ## Get sub-shape indices of theShapeWhere, which is
5169 # equal to \a theShapeWhat.
5170 # @param theShapeWhere Shape to find sub-shape of.
5171 # @param theShapeWhat Shape, specifying what to find.
5172 # @return List of all found sub-shapes indices.
5174 # @ref swig_GetSame "Example"
5175 def GetSameIDs(self, theShapeWhere, theShapeWhat):
5177 Get sub-shape indices of theShapeWhere, which is
5178 equal to theShapeWhat.
5181 theShapeWhere Shape to find sub-shape of.
5182 theShapeWhat Shape, specifying what to find.
5185 List of all found sub-shapes indices.
5187 anObj = self.ShapesOp.GetSameIDs(theShapeWhere, theShapeWhat)
5188 RaiseIfFailed("GetSameIDs", self.ShapesOp)
5195 ## @addtogroup l4_access
5198 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
5199 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5200 # @param aShape Shape to get sub-shape of.
5201 # @param ListOfID List of sub-shapes indices.
5202 # @param theName Object name; when specified, this parameter is used
5203 # for result publication in the study. Otherwise, if automatic
5204 # publication is switched on, default value is used for result name.
5206 # @return Found sub-shape.
5208 # @ref swig_all_decompose "Example"
5209 def GetSubShape(self, aShape, ListOfID, theName=None):
5211 Obtain a composite sub-shape of aShape, composed from sub-shapes
5212 of aShape, selected by their unique IDs inside aShape
5215 aShape Shape to get sub-shape of.
5216 ListOfID List of sub-shapes indices.
5217 theName Object name; when specified, this parameter is used
5218 for result publication in the study. Otherwise, if automatic
5219 publication is switched on, default value is used for result name.
5224 # Example: see GEOM_TestAll.py
5225 anObj = self.AddSubShape(aShape,ListOfID)
5226 self._autoPublish(anObj, theName, "subshape")
5229 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
5230 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
5231 # @param aShape Shape to get sub-shape of.
5232 # @param aSubShape Sub-shapes of aShape.
5233 # @return ID of found sub-shape.
5235 # @ref swig_all_decompose "Example"
5236 def GetSubShapeID(self, aShape, aSubShape):
5238 Obtain unique ID of sub-shape aSubShape inside aShape
5239 of aShape, selected by their unique IDs inside aShape
5242 aShape Shape to get sub-shape of.
5243 aSubShape Sub-shapes of aShape.
5246 ID of found sub-shape.
5248 # Example: see GEOM_TestAll.py
5249 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
5250 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
5253 ## Obtain unique IDs of sub-shapes <VAR>aSubShapes</VAR> inside <VAR>aShape</VAR>
5254 # This function is provided for performance purpose. The complexity is O(n) with n
5255 # the number of subobjects of aShape
5256 # @param aShape Shape to get sub-shape of.
5257 # @param aSubShapes Sub-shapes of aShape.
5258 # @return list of IDs of found sub-shapes.
5260 # @ref swig_all_decompose "Example"
5261 def GetSubShapesIDs(self, aShape, aSubShapes):
5263 Obtain a list of IDs of sub-shapes aSubShapes inside aShape
5264 This function is provided for performance purpose. The complexity is O(n) with n
5265 the number of subobjects of aShape
5268 aShape Shape to get sub-shape of.
5269 aSubShapes Sub-shapes of aShape.
5272 List of IDs of found sub-shape.
5274 # Example: see GEOM_TestAll.py
5275 anIDs = self.ShapesOp.GetSubShapesIndices(aShape, aSubShapes)
5276 RaiseIfFailed("GetSubShapesIndices", self.ShapesOp)
5282 ## @addtogroup l4_decompose
5285 ## Get all sub-shapes and groups of \a theShape,
5286 # that were created already by any other methods.
5287 # @param theShape Any shape.
5288 # @param theGroupsOnly If this parameter is TRUE, only groups will be
5289 # returned, else all found sub-shapes and groups.
5290 # @return List of existing sub-objects of \a theShape.
5292 # @ref swig_all_decompose "Example"
5293 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
5295 Get all sub-shapes and groups of theShape,
5296 that were created already by any other methods.
5300 theGroupsOnly If this parameter is TRUE, only groups will be
5301 returned, else all found sub-shapes and groups.
5304 List of existing sub-objects of theShape.
5306 # Example: see GEOM_TestAll.py
5307 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
5308 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5311 ## Get all groups of \a theShape,
5312 # that were created already by any other methods.
5313 # @param theShape Any shape.
5314 # @return List of existing groups of \a theShape.
5316 # @ref swig_all_decompose "Example"
5317 def GetGroups(self, theShape):
5319 Get all groups of theShape,
5320 that were created already by any other methods.
5326 List of existing groups of theShape.
5328 # Example: see GEOM_TestAll.py
5329 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
5330 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
5333 ## Explode a shape on sub-shapes of a given type.
5334 # If the shape itself matches the type, it is also returned.
5335 # @param aShape Shape to be exploded.
5336 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5337 # @param theName Object name; when specified, this parameter is used
5338 # for result publication in the study. Otherwise, if automatic
5339 # publication is switched on, default value is used for result name.
5341 # @return List of sub-shapes of type theShapeType, contained in theShape.
5343 # @ref swig_all_decompose "Example"
5344 def SubShapeAll(self, aShape, aType, theName=None):
5346 Explode a shape on sub-shapes of a given type.
5347 If the shape itself matches the type, it is also returned.
5350 aShape Shape to be exploded.
5351 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5352 theName Object name; when specified, this parameter is used
5353 for result publication in the study. Otherwise, if automatic
5354 publication is switched on, default value is used for result name.
5357 List of sub-shapes of type theShapeType, contained in theShape.
5359 # Example: see GEOM_TestAll.py
5360 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), False)
5361 RaiseIfFailed("SubShapeAll", self.ShapesOp)
5362 self._autoPublish(ListObj, theName, "subshape")
5365 ## Explode a shape on sub-shapes of a given type.
5366 # @param aShape Shape to be exploded.
5367 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5368 # @return List of IDs of sub-shapes.
5370 # @ref swig_all_decompose "Example"
5371 def SubShapeAllIDs(self, aShape, aType):
5373 Explode a shape on sub-shapes of a given type.
5376 aShape Shape to be exploded (see geompy.ShapeType)
5377 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5380 List of IDs of sub-shapes.
5382 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), False)
5383 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5386 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5387 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
5388 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5389 # @param aShape Shape to get sub-shape of.
5390 # @param ListOfInd List of sub-shapes indices.
5391 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5392 # @param theName Object name; when specified, this parameter is used
5393 # for result publication in the study. Otherwise, if automatic
5394 # publication is switched on, default value is used for result name.
5396 # @return A compound of sub-shapes of aShape.
5398 # @ref swig_all_decompose "Example"
5399 def SubShape(self, aShape, aType, ListOfInd, theName=None):
5401 Obtain a compound of sub-shapes of aShape,
5402 selected by they indices in list of all sub-shapes of type aType.
5403 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5406 aShape Shape to get sub-shape of.
5407 ListOfID List of sub-shapes indices.
5408 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5409 theName Object name; when specified, this parameter is used
5410 for result publication in the study. Otherwise, if automatic
5411 publication is switched on, default value is used for result name.
5414 A compound of sub-shapes of aShape.
5416 # Example: see GEOM_TestAll.py
5418 AllShapeIDsList = self.SubShapeAllIDs(aShape, EnumToLong( aType ))
5419 for ind in ListOfInd:
5420 ListOfIDs.append(AllShapeIDsList[ind - 1])
5421 # note: auto-publishing is done in self.GetSubShape()
5422 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5425 ## Explode a shape on sub-shapes of a given type.
5426 # Sub-shapes will be sorted by coordinates of their gravity centers.
5427 # If the shape itself matches the type, it is also returned.
5428 # @param aShape Shape to be exploded.
5429 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5430 # @param theName Object name; when specified, this parameter is used
5431 # for result publication in the study. Otherwise, if automatic
5432 # publication is switched on, default value is used for result name.
5434 # @return List of sub-shapes of type theShapeType, contained in theShape.
5436 # @ref swig_SubShapeAllSorted "Example"
5437 def SubShapeAllSortedCentres(self, aShape, aType, theName=None):
5439 Explode a shape on sub-shapes of a given type.
5440 Sub-shapes will be sorted by coordinates of their gravity centers.
5441 If the shape itself matches the type, it is also returned.
5444 aShape Shape to be exploded.
5445 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5446 theName Object name; when specified, this parameter is used
5447 for result publication in the study. Otherwise, if automatic
5448 publication is switched on, default value is used for result name.
5451 List of sub-shapes of type theShapeType, contained in theShape.
5453 # Example: see GEOM_TestAll.py
5454 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, EnumToLong( aType ), True)
5455 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
5456 self._autoPublish(ListObj, theName, "subshape")
5459 ## Explode a shape on sub-shapes of a given type.
5460 # Sub-shapes will be sorted by coordinates of their gravity centers.
5461 # @param aShape Shape to be exploded.
5462 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5463 # @return List of IDs of sub-shapes.
5465 # @ref swig_all_decompose "Example"
5466 def SubShapeAllSortedCentresIDs(self, aShape, aType):
5468 Explode a shape on sub-shapes of a given type.
5469 Sub-shapes will be sorted by coordinates of their gravity centers.
5472 aShape Shape to be exploded.
5473 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5476 List of IDs of sub-shapes.
5478 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, EnumToLong( aType ), True)
5479 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5482 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
5483 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
5484 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5485 # @param aShape Shape to get sub-shape of.
5486 # @param ListOfInd List of sub-shapes indices.
5487 # @param aType Type of sub-shapes to be retrieved (see ShapeType())
5488 # @param theName Object name; when specified, this parameter is used
5489 # for result publication in the study. Otherwise, if automatic
5490 # publication is switched on, default value is used for result name.
5492 # @return A compound of sub-shapes of aShape.
5494 # @ref swig_all_decompose "Example"
5495 def SubShapeSortedCentres(self, aShape, aType, ListOfInd, theName=None):
5497 Obtain a compound of sub-shapes of aShape,
5498 selected by they indices in sorted list of all sub-shapes of type aType.
5499 Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
5502 aShape Shape to get sub-shape of.
5503 ListOfID List of sub-shapes indices.
5504 aType Type of sub-shapes to be retrieved (see geompy.ShapeType)
5505 theName Object name; when specified, this parameter is used
5506 for result publication in the study. Otherwise, if automatic
5507 publication is switched on, default value is used for result name.
5510 A compound of sub-shapes of aShape.
5512 # Example: see GEOM_TestAll.py
5514 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, EnumToLong( aType ))
5515 for ind in ListOfInd:
5516 ListOfIDs.append(AllShapeIDsList[ind - 1])
5517 # note: auto-publishing is done in self.GetSubShape()
5518 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5521 ## Extract shapes (excluding the main shape) of given type.
5522 # @param aShape The shape.
5523 # @param aType The shape type (see ShapeType())
5524 # @param isSorted Boolean flag to switch sorting on/off.
5525 # @param theName Object name; when specified, this parameter is used
5526 # for result publication in the study. Otherwise, if automatic
5527 # publication is switched on, default value is used for result name.
5529 # @return List of sub-shapes of type aType, contained in aShape.
5531 # @ref swig_FilletChamfer "Example"
5532 def ExtractShapes(self, aShape, aType, isSorted = False, theName=None):
5534 Extract shapes (excluding the main shape) of given type.
5538 aType The shape type (see geompy.ShapeType)
5539 isSorted Boolean flag to switch sorting on/off.
5540 theName Object name; when specified, this parameter is used
5541 for result publication in the study. Otherwise, if automatic
5542 publication is switched on, default value is used for result name.
5545 List of sub-shapes of type aType, contained in aShape.
5547 # Example: see GEOM_TestAll.py
5548 ListObj = self.ShapesOp.ExtractSubShapes(aShape, EnumToLong( aType ), isSorted)
5549 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
5550 self._autoPublish(ListObj, theName, "subshape")
5553 ## Get a set of sub-shapes defined by their unique IDs inside <VAR>aShape</VAR>
5554 # @param aShape Main shape.
5555 # @param anIDs List of unique IDs of sub-shapes inside <VAR>aShape</VAR>.
5556 # @param theName Object name; when specified, this parameter is used
5557 # for result publication in the study. Otherwise, if automatic
5558 # publication is switched on, default value is used for result name.
5559 # @return List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5561 # @ref swig_all_decompose "Example"
5562 def SubShapes(self, aShape, anIDs, theName=None):
5564 Get a set of sub-shapes defined by their unique IDs inside theMainShape
5568 anIDs List of unique IDs of sub-shapes inside theMainShape.
5569 theName Object name; when specified, this parameter is used
5570 for result publication in the study. Otherwise, if automatic
5571 publication is switched on, default value is used for result name.
5574 List of GEOM.GEOM_Object, corresponding to found sub-shapes.
5576 # Example: see GEOM_TestAll.py
5577 ListObj = self.ShapesOp.MakeSubShapes(aShape, anIDs)
5578 RaiseIfFailed("SubShapes", self.ShapesOp)
5579 self._autoPublish(ListObj, theName, "subshape")
5582 # end of l4_decompose
5585 ## @addtogroup l4_decompose_d
5588 ## Deprecated method
5589 # It works like SubShapeAllSortedCentres(), but wrongly
5590 # defines centres of faces, shells and solids.
5591 def SubShapeAllSorted(self, aShape, aType, theName=None):
5594 It works like geompy.SubShapeAllSortedCentres, but wrongly
5595 defines centres of faces, shells and solids.
5597 ListObj = self.ShapesOp.MakeExplode(aShape, EnumToLong( aType ), True)
5598 RaiseIfFailed("MakeExplode", self.ShapesOp)
5599 self._autoPublish(ListObj, theName, "subshape")
5602 ## Deprecated method
5603 # It works like SubShapeAllSortedCentresIDs(), but wrongly
5604 # defines centres of faces, shells and solids.
5605 def SubShapeAllSortedIDs(self, aShape, aType):
5608 It works like geompy.SubShapeAllSortedCentresIDs, but wrongly
5609 defines centres of faces, shells and solids.
5611 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, EnumToLong( aType ), True)
5612 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
5615 ## Deprecated method
5616 # It works like SubShapeSortedCentres(), but has a bug
5617 # (wrongly defines centres of faces, shells and solids).
5618 def SubShapeSorted(self, aShape, aType, ListOfInd, theName=None):
5621 It works like geompy.SubShapeSortedCentres, but has a bug
5622 (wrongly defines centres of faces, shells and solids).
5625 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, EnumToLong( aType ))
5626 for ind in ListOfInd:
5627 ListOfIDs.append(AllShapeIDsList[ind - 1])
5628 # note: auto-publishing is done in self.GetSubShape()
5629 anObj = self.GetSubShape(aShape, ListOfIDs, theName)
5632 # end of l4_decompose_d
5635 ## @addtogroup l3_healing
5638 ## Apply a sequence of Shape Healing operators to the given object.
5639 # @param theShape Shape to be processed.
5640 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5641 # @param theParameters List of names of parameters
5642 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5643 # @param theValues List of values of parameters, in the same order
5644 # as parameters are listed in <VAR>theParameters</VAR> list.
5645 # @param theName Object name; when specified, this parameter is used
5646 # for result publication in the study. Otherwise, if automatic
5647 # publication is switched on, default value is used for result name.
5649 # <b> Operators and Parameters: </b> \n
5651 # * \b FixShape - corrects invalid shapes. \n
5652 # - \b FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them. \n
5653 # - \b FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction. \n
5655 # * \b FixFaceSize - removes small faces, such as spots and strips.\n
5656 # - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
5657 # - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
5658 # - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
5660 # * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
5661 # surfaces in segments using a certain angle. \n
5662 # - \b SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5663 # if Angle=180, four if Angle=90, etc). \n
5664 # - \b SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.\n
5666 # * \b SplitClosedFaces - splits closed faces in segments.
5667 # The number of segments depends on the number of splitting points.\n
5668 # - \b SplitClosedFaces.NbSplitPoints - the number of splitting points.\n
5670 # * \b SplitContinuity - splits shapes to reduce continuities of curves and surfaces.\n
5671 # - \b SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.\n
5672 # - \b SplitContinuity.SurfaceContinuity - required continuity for surfaces.\n
5673 # - \b SplitContinuity.CurveContinuity - required continuity for curves.\n
5674 # This and the previous parameters can take the following values:\n
5675 # \b Parametric \b Continuity \n
5676 # \b C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces
5677 # are coincidental. The curves or surfaces may still meet at an angle, giving rise to a sharp corner or edge).\n
5678 # \b C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces are parallel,
5679 # ruling out sharp edges).\n
5680 # \b C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves or surfaces
5681 # are of the same magnitude).\n
5682 # \b CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of curves
5683 # or surfaces (d/du C(u)) are the same at junction. \n
5684 # \b Geometric \b Continuity \n
5685 # \b G1: first derivatives are proportional at junction.\n
5686 # The curve tangents thus have the same direction, but not necessarily the same magnitude.
5687 # i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).\n
5688 # \b G2: first and second derivatives are proportional at junction.
5689 # As the names imply, geometric continuity requires the geometry to be continuous, while parametric
5690 # continuity requires that the underlying parameterization was continuous as well.
5691 # Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.\n
5693 # * \b BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:\n
5694 # - \b BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.\n
5695 # - \b BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.\n
5696 # - \b BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.\n
5697 # - \b BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation
5698 # with the specified parameters.\n
5699 # - \b BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation
5700 # with the specified parameters.\n
5701 # - \b BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.\n
5702 # - \b BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.\n
5703 # - \b BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.\n
5704 # - \b BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.\n
5706 # * \b ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.\n
5707 # - \b ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.\n
5708 # - \b ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.\n
5709 # - \b ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.\n
5710 # - \b ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.\n
5712 # * \b SameParameter - fixes edges of 2D and 3D curves not having the same parameter.\n
5713 # - \b SameParameter.Tolerance3d - defines tolerance for fixing of edges.\n
5716 # @return New GEOM.GEOM_Object, containing processed shape.
5718 # \n @ref tui_shape_processing "Example"
5719 def ProcessShape(self, theShape, theOperators, theParameters, theValues, theName=None):
5721 Apply a sequence of Shape Healing operators to the given object.
5724 theShape Shape to be processed.
5725 theValues List of values of parameters, in the same order
5726 as parameters are listed in theParameters list.
5727 theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
5728 theParameters List of names of parameters
5729 ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
5730 theName Object name; when specified, this parameter is used
5731 for result publication in the study. Otherwise, if automatic
5732 publication is switched on, default value is used for result name.
5734 Operators and Parameters:
5736 * FixShape - corrects invalid shapes.
5737 * FixShape.Tolerance3d - work tolerance for detection of the problems and correction of them.
5738 * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
5739 * FixFaceSize - removes small faces, such as spots and strips.
5740 * FixFaceSize.Tolerance - defines minimum possible face size.
5741 * DropSmallEdges - removes edges, which merge with neighbouring edges.
5742 * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
5743 * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
5744 in segments using a certain angle.
5745 * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
5746 if Angle=180, four if Angle=90, etc).
5747 * SplitAngle.MaxTolerance - maximum possible tolerance among the resulting segments.
5748 * SplitClosedFaces - splits closed faces in segments. The number of segments depends on the number of
5750 * SplitClosedFaces.NbSplitPoints - the number of splitting points.
5751 * SplitContinuity - splits shapes to reduce continuities of curves and surfaces.
5752 * SplitContinuity.Tolerance3d - 3D tolerance for correction of geometry.
5753 * SplitContinuity.SurfaceContinuity - required continuity for surfaces.
5754 * SplitContinuity.CurveContinuity - required continuity for curves.
5755 This and the previous parameters can take the following values:
5757 Parametric Continuity:
5758 C0 (Positional Continuity): curves are joined (the end positions of curves or surfaces are
5759 coincidental. The curves or surfaces may still meet at an angle,
5760 giving rise to a sharp corner or edge).
5761 C1 (Tangential Continuity): first derivatives are equal (the end vectors of curves or surfaces
5762 are parallel, ruling out sharp edges).
5763 C2 (Curvature Continuity): first and second derivatives are equal (the end vectors of curves
5764 or surfaces are of the same magnitude).
5765 CN N-th derivatives are equal (both the direction and the magnitude of the Nth derivatives of
5766 curves or surfaces (d/du C(u)) are the same at junction.
5768 Geometric Continuity:
5769 G1: first derivatives are proportional at junction.
5770 The curve tangents thus have the same direction, but not necessarily the same magnitude.
5771 i.e., C1'(1) = (a,b,c) and C2'(0) = (k*a, k*b, k*c).
5772 G2: first and second derivatives are proportional at junction. As the names imply,
5773 geometric continuity requires the geometry to be continuous, while parametric continuity requires
5774 that the underlying parameterization was continuous as well. Parametric continuity of order n implies
5775 geometric continuity of order n, but not vice-versa.
5776 * BsplineRestriction - converts curves and surfaces to Bsplines and processes them with the following parameters:
5777 * BSplineRestriction.SurfaceMode - approximation of surfaces if restriction is necessary.
5778 * BSplineRestriction.Curve3dMode - conversion of any 3D curve to BSpline and approximation.
5779 * BSplineRestriction.Curve2dMode - conversion of any 2D curve to BSpline and approximation.
5780 * BSplineRestriction.Tolerance3d - defines the possibility of surfaces and 3D curves approximation with
5781 the specified parameters.
5782 * BSplineRestriction.Tolerance2d - defines the possibility of surfaces and 2D curves approximation with
5783 the specified parameters.
5784 * BSplineRestriction.RequiredDegree - required degree of the resulting BSplines.
5785 * BSplineRestriction.RequiredNbSegments - required maximum number of segments of resultant BSplines.
5786 * BSplineRestriction.Continuity3d - continuity of the resulting surfaces and 3D curves.
5787 * BSplineRestriction.Continuity2d - continuity of the resulting 2D curves.
5788 * ToBezier - converts curves and surfaces of any type to Bezier curves and surfaces.
5789 * ToBezier.SurfaceMode - if checked in, allows conversion of surfaces.
5790 * ToBezier.Curve3dMode - if checked in, allows conversion of 3D curves.
5791 * ToBezier.Curve2dMode - if checked in, allows conversion of 2D curves.
5792 * ToBezier.MaxTolerance - defines tolerance for detection and correction of problems.
5793 * SameParameter - fixes edges of 2D and 3D curves not having the same parameter.
5794 * SameParameter.Tolerance3d - defines tolerance for fixing of edges.
5797 New GEOM.GEOM_Object, containing processed shape.
5799 Note: For more information look through SALOME Geometry User's Guide->
5800 -> Introduction to Geometry-> Repairing Operations-> Shape Processing
5802 # Example: see GEOM_TestHealing.py
5803 theValues,Parameters = ParseList(theValues)
5804 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
5805 # To avoid script failure in case of good argument shape
5806 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
5808 RaiseIfFailed("ProcessShape", self.HealOp)
5809 for string in (theOperators + theParameters):
5810 Parameters = ":" + Parameters
5812 anObj.SetParameters(Parameters)
5813 self._autoPublish(anObj, theName, "healed")
5816 ## Remove faces from the given object (shape).
5817 # @param theObject Shape to be processed.
5818 # @param theFaces Indices of faces to be removed, if EMPTY then the method
5819 # removes ALL faces of the given object.
5820 # @param theName Object name; when specified, this parameter is used
5821 # for result publication in the study. Otherwise, if automatic
5822 # publication is switched on, default value is used for result name.
5824 # @return New GEOM.GEOM_Object, containing processed shape.
5826 # @ref tui_suppress_faces "Example"
5827 def SuppressFaces(self, theObject, theFaces, theName=None):
5829 Remove faces from the given object (shape).
5832 theObject Shape to be processed.
5833 theFaces Indices of faces to be removed, if EMPTY then the method
5834 removes ALL faces of the given object.
5835 theName Object name; when specified, this parameter is used
5836 for result publication in the study. Otherwise, if automatic
5837 publication is switched on, default value is used for result name.
5840 New GEOM.GEOM_Object, containing processed shape.
5842 # Example: see GEOM_TestHealing.py
5843 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
5844 RaiseIfFailed("SuppressFaces", self.HealOp)
5845 self._autoPublish(anObj, theName, "suppressFaces")
5848 ## Sewing of some shapes into single shape.
5849 # @param ListShape Shapes to be processed.
5850 # @param theTolerance Required tolerance value.
5851 # @param theName Object name; when specified, this parameter is used
5852 # for result publication in the study. Otherwise, if automatic
5853 # publication is switched on, default value is used for result name.
5855 # @return New GEOM.GEOM_Object, containing processed shape.
5857 # @ref tui_sewing "Example"
5858 def MakeSewing(self, ListShape, theTolerance, theName=None):
5860 Sewing of some shapes into single shape.
5863 ListShape Shapes to be processed.
5864 theTolerance Required tolerance value.
5865 theName Object name; when specified, this parameter is used
5866 for result publication in the study. Otherwise, if automatic
5867 publication is switched on, default value is used for result name.
5870 New GEOM.GEOM_Object, containing processed shape.
5872 # Example: see GEOM_TestHealing.py
5873 comp = self.MakeCompound(ListShape)
5874 # note: auto-publishing is done in self.Sew()
5875 anObj = self.Sew(comp, theTolerance, theName)
5878 ## Sewing of the given object.
5879 # @param theObject Shape to be processed.
5880 # @param theTolerance Required tolerance value.
5881 # @param theName Object name; when specified, this parameter is used
5882 # for result publication in the study. Otherwise, if automatic
5883 # publication is switched on, default value is used for result name.
5885 # @return New GEOM.GEOM_Object, containing processed shape.
5886 def Sew(self, theObject, theTolerance, theName=None):
5888 Sewing of the given object.
5891 theObject Shape to be processed.
5892 theTolerance Required tolerance value.
5893 theName Object name; when specified, this parameter is used
5894 for result publication in the study. Otherwise, if automatic
5895 publication is switched on, default value is used for result name.
5898 New GEOM.GEOM_Object, containing processed shape.
5900 # Example: see MakeSewing() above
5901 theTolerance,Parameters = ParseParameters(theTolerance)
5902 anObj = self.HealOp.Sew(theObject, theTolerance)
5903 RaiseIfFailed("Sew", self.HealOp)
5904 anObj.SetParameters(Parameters)
5905 self._autoPublish(anObj, theName, "sewed")
5908 ## Remove internal wires and edges from the given object (face).
5909 # @param theObject Shape to be processed.
5910 # @param theWires Indices of wires to be removed, if EMPTY then the method
5911 # removes ALL internal wires of the given object.
5912 # @param theName Object name; when specified, this parameter is used
5913 # for result publication in the study. Otherwise, if automatic
5914 # publication is switched on, default value is used for result name.
5916 # @return New GEOM.GEOM_Object, containing processed shape.
5918 # @ref tui_suppress_internal_wires "Example"
5919 def SuppressInternalWires(self, theObject, theWires, theName=None):
5921 Remove internal wires and edges from the given object (face).
5924 theObject Shape to be processed.
5925 theWires Indices of wires to be removed, if EMPTY then the method
5926 removes ALL internal wires of the given object.
5927 theName Object name; when specified, this parameter is used
5928 for result publication in the study. Otherwise, if automatic
5929 publication is switched on, default value is used for result name.
5932 New GEOM.GEOM_Object, containing processed shape.
5934 # Example: see GEOM_TestHealing.py
5935 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
5936 RaiseIfFailed("RemoveIntWires", self.HealOp)
5937 self._autoPublish(anObj, theName, "suppressWires")
5940 ## Remove internal closed contours (holes) from the given object.
5941 # @param theObject Shape to be processed.
5942 # @param theWires Indices of wires to be removed, if EMPTY then the method
5943 # removes ALL internal holes of the given object
5944 # @param theName Object name; when specified, this parameter is used
5945 # for result publication in the study. Otherwise, if automatic
5946 # publication is switched on, default value is used for result name.
5948 # @return New GEOM.GEOM_Object, containing processed shape.
5950 # @ref tui_suppress_holes "Example"
5951 def SuppressHoles(self, theObject, theWires, theName=None):
5953 Remove internal closed contours (holes) from the given object.
5956 theObject Shape to be processed.
5957 theWires Indices of wires to be removed, if EMPTY then the method
5958 removes ALL internal holes of the given object
5959 theName Object name; when specified, this parameter is used
5960 for result publication in the study. Otherwise, if automatic
5961 publication is switched on, default value is used for result name.
5964 New GEOM.GEOM_Object, containing processed shape.
5966 # Example: see GEOM_TestHealing.py
5967 anObj = self.HealOp.FillHoles(theObject, theWires)
5968 RaiseIfFailed("FillHoles", self.HealOp)
5969 self._autoPublish(anObj, theName, "suppressHoles")
5972 ## Close an open wire.
5973 # @param theObject Shape to be processed.
5974 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
5975 # if [ ], then <VAR>theObject</VAR> itself is a wire.
5976 # @param isCommonVertex If True : closure by creation of a common vertex,
5977 # If False : closure by creation of an edge between ends.
5978 # @param theName Object name; when specified, this parameter is used
5979 # for result publication in the study. Otherwise, if automatic
5980 # publication is switched on, default value is used for result name.
5982 # @return New GEOM.GEOM_Object, containing processed shape.
5984 # @ref tui_close_contour "Example"
5985 def CloseContour(self,theObject, theWires, isCommonVertex, theName=None):
5990 theObject Shape to be processed.
5991 theWires Indexes of edge(s) and wire(s) to be closed within theObject's shape,
5992 if [ ], then theObject itself is a wire.
5993 isCommonVertex If True : closure by creation of a common vertex,
5994 If False : closure by creation of an edge between ends.
5995 theName Object name; when specified, this parameter is used
5996 for result publication in the study. Otherwise, if automatic
5997 publication is switched on, default value is used for result name.
6000 New GEOM.GEOM_Object, containing processed shape.
6002 # Example: see GEOM_TestHealing.py
6003 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
6004 RaiseIfFailed("CloseContour", self.HealOp)
6005 self._autoPublish(anObj, theName, "closeContour")
6008 ## Addition of a point to a given edge object.
6009 # @param theObject Shape to be processed.
6010 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
6011 # if -1, then theObject itself is the edge.
6012 # @param theValue Value of parameter on edge or length parameter,
6013 # depending on \a isByParameter.
6014 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1], \n
6015 # if FALSE : \a theValue is treated as a length parameter [0..1]
6016 # @param theName Object name; when specified, this parameter is used
6017 # for result publication in the study. Otherwise, if automatic
6018 # publication is switched on, default value is used for result name.
6020 # @return New GEOM.GEOM_Object, containing processed shape.
6022 # @ref tui_add_point_on_edge "Example"
6023 def DivideEdge(self, theObject, theEdgeIndex, theValue, isByParameter, theName=None):
6025 Addition of a point to a given edge object.
6028 theObject Shape to be processed.
6029 theEdgeIndex Index of edge to be divided within theObject's shape,
6030 if -1, then theObject itself is the edge.
6031 theValue Value of parameter on edge or length parameter,
6032 depending on isByParameter.
6033 isByParameter If TRUE : theValue is treated as a curve parameter [0..1],
6034 if FALSE : theValue is treated as a length parameter [0..1]
6035 theName Object name; when specified, this parameter is used
6036 for result publication in the study. Otherwise, if automatic
6037 publication is switched on, default value is used for result name.
6040 New GEOM.GEOM_Object, containing processed shape.
6042 # Example: see GEOM_TestHealing.py
6043 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
6044 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
6045 RaiseIfFailed("DivideEdge", self.HealOp)
6046 anObj.SetParameters(Parameters)
6047 self._autoPublish(anObj, theName, "divideEdge")
6050 ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6051 # @param theWire Wire to minimize the number of C1 continuous edges in.
6052 # @param theVertices A list of vertices to suppress. If the list
6053 # is empty, all vertices in a wire will be assumed.
6054 # @param theName Object name; when specified, this parameter is used
6055 # for result publication in the study. Otherwise, if automatic
6056 # publication is switched on, default value is used for result name.
6058 # @return New GEOM.GEOM_Object with modified wire.
6060 # @ref tui_fuse_collinear_edges "Example"
6061 def FuseCollinearEdgesWithinWire(self, theWire, theVertices = [], theName=None):
6063 Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
6066 theWire Wire to minimize the number of C1 continuous edges in.
6067 theVertices A list of vertices to suppress. If the list
6068 is empty, all vertices in a wire will be assumed.
6069 theName Object name; when specified, this parameter is used
6070 for result publication in the study. Otherwise, if automatic
6071 publication is switched on, default value is used for result name.
6074 New GEOM.GEOM_Object with modified wire.
6076 anObj = self.HealOp.FuseCollinearEdgesWithinWire(theWire, theVertices)
6077 RaiseIfFailed("FuseCollinearEdgesWithinWire", self.HealOp)
6078 self._autoPublish(anObj, theName, "fuseEdges")
6081 ## Change orientation of the given object. Updates given shape.
6082 # @param theObject Shape to be processed.
6083 # @return Updated <var>theObject</var>
6085 # @ref swig_todo "Example"
6086 def ChangeOrientationShell(self,theObject):
6088 Change orientation of the given object. Updates given shape.
6091 theObject Shape to be processed.
6096 theObject = self.HealOp.ChangeOrientation(theObject)
6097 RaiseIfFailed("ChangeOrientation", self.HealOp)
6100 ## Change orientation of the given object.
6101 # @param theObject Shape to be processed.
6102 # @param theName Object name; when specified, this parameter is used
6103 # for result publication in the study. Otherwise, if automatic
6104 # publication is switched on, default value is used for result name.
6106 # @return New GEOM.GEOM_Object, containing processed shape.
6108 # @ref swig_todo "Example"
6109 def ChangeOrientationShellCopy(self, theObject, theName=None):
6111 Change orientation of the given object.
6114 theObject Shape to be processed.
6115 theName Object name; when specified, this parameter is used
6116 for result publication in the study. Otherwise, if automatic
6117 publication is switched on, default value is used for result name.
6120 New GEOM.GEOM_Object, containing processed shape.
6122 anObj = self.HealOp.ChangeOrientationCopy(theObject)
6123 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
6124 self._autoPublish(anObj, theName, "reversed")
6127 ## Try to limit tolerance of the given object by value \a theTolerance.
6128 # @param theObject Shape to be processed.
6129 # @param theTolerance Required tolerance value.
6130 # @param theName Object name; when specified, this parameter is used
6131 # for result publication in the study. Otherwise, if automatic
6132 # publication is switched on, default value is used for result name.
6134 # @return New GEOM.GEOM_Object, containing processed shape.
6136 # @ref tui_limit_tolerance "Example"
6137 def LimitTolerance(self, theObject, theTolerance = 1e-07, theName=None):
6139 Try to limit tolerance of the given object by value theTolerance.
6142 theObject Shape to be processed.
6143 theTolerance Required tolerance value.
6144 theName Object name; when specified, this parameter is used
6145 for result publication in the study. Otherwise, if automatic
6146 publication is switched on, default value is used for result name.
6149 New GEOM.GEOM_Object, containing processed shape.
6151 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
6152 RaiseIfFailed("LimitTolerance", self.HealOp)
6153 self._autoPublish(anObj, theName, "limitTolerance")
6156 ## Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6157 # that constitute a free boundary of the given shape.
6158 # @param theObject Shape to get free boundary of.
6159 # @param theName Object name; when specified, this parameter is used
6160 # for result publication in the study. Otherwise, if automatic
6161 # publication is switched on, default value is used for result name.
6163 # @return [\a status, \a theClosedWires, \a theOpenWires]
6164 # \n \a status: FALSE, if an error(s) occured during the method execution.
6165 # \n \a theClosedWires: Closed wires on the free boundary of the given shape.
6166 # \n \a theOpenWires: Open wires on the free boundary of the given shape.
6168 # @ref tui_measurement_tools_page "Example"
6169 def GetFreeBoundary(self, theObject, theName=None):
6171 Get a list of wires (wrapped in GEOM.GEOM_Object-s),
6172 that constitute a free boundary of the given shape.
6175 theObject Shape to get free boundary of.
6176 theName Object name; when specified, this parameter is used
6177 for result publication in the study. Otherwise, if automatic
6178 publication is switched on, default value is used for result name.
6181 [status, theClosedWires, theOpenWires]
6182 status: FALSE, if an error(s) occured during the method execution.
6183 theClosedWires: Closed wires on the free boundary of the given shape.
6184 theOpenWires: Open wires on the free boundary of the given shape.
6186 # Example: see GEOM_TestHealing.py
6187 anObj = self.HealOp.GetFreeBoundary(theObject)
6188 RaiseIfFailed("GetFreeBoundary", self.HealOp)
6189 self._autoPublish(anObj[1], theName, "closedWire")
6190 self._autoPublish(anObj[2], theName, "openWire")
6193 ## Replace coincident faces in theShape by one face.
6194 # @param theShape Initial shape.
6195 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
6196 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6197 # otherwise all initial shapes.
6198 # @param theName Object name; when specified, this parameter is used
6199 # for result publication in the study. Otherwise, if automatic
6200 # publication is switched on, default value is used for result name.
6202 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6204 # @ref tui_glue_faces "Example"
6205 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
6207 Replace coincident faces in theShape by one face.
6210 theShape Initial shape.
6211 theTolerance Maximum distance between faces, which can be considered as coincident.
6212 doKeepNonSolids If FALSE, only solids will present in the result,
6213 otherwise all initial shapes.
6214 theName Object name; when specified, this parameter is used
6215 for result publication in the study. Otherwise, if automatic
6216 publication is switched on, default value is used for result name.
6219 New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
6221 # Example: see GEOM_Spanner.py
6222 theTolerance,Parameters = ParseParameters(theTolerance)
6223 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
6225 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
6226 anObj.SetParameters(Parameters)
6227 self._autoPublish(anObj, theName, "glueFaces")
6230 ## Find coincident faces in theShape for possible gluing.
6231 # @param theShape Initial shape.
6232 # @param theTolerance Maximum distance between faces,
6233 # which can be considered as coincident.
6234 # @param theName Object name; when specified, this parameter is used
6235 # for result publication in the study. Otherwise, if automatic
6236 # publication is switched on, default value is used for result name.
6238 # @return GEOM.ListOfGO
6240 # @ref tui_glue_faces "Example"
6241 def GetGlueFaces(self, theShape, theTolerance, theName=None):
6243 Find coincident faces in theShape for possible gluing.
6246 theShape Initial shape.
6247 theTolerance Maximum distance between faces,
6248 which can be considered as coincident.
6249 theName Object name; when specified, this parameter is used
6250 for result publication in the study. Otherwise, if automatic
6251 publication is switched on, default value is used for result name.
6256 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
6257 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
6258 self._autoPublish(anObj, theName, "facesToGlue")
6261 ## Replace coincident faces in theShape by one face
6262 # in compliance with given list of faces
6263 # @param theShape Initial shape.
6264 # @param theTolerance Maximum distance between faces,
6265 # which can be considered as coincident.
6266 # @param theFaces List of faces for gluing.
6267 # @param doKeepNonSolids If FALSE, only solids will present in the result,
6268 # otherwise all initial shapes.
6269 # @param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
6270 # will be glued, otherwise only the edges,
6271 # belonging to <VAR>theFaces</VAR>.
6272 # @param theName Object name; when specified, this parameter is used
6273 # for result publication in the study. Otherwise, if automatic
6274 # publication is switched on, default value is used for result name.
6276 # @return New GEOM.GEOM_Object, containing a copy of theShape
6277 # without some faces.
6279 # @ref tui_glue_faces "Example"
6280 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
6281 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
6283 Replace coincident faces in theShape by one face
6284 in compliance with given list of faces
6287 theShape Initial shape.
6288 theTolerance Maximum distance between faces,
6289 which can be considered as coincident.
6290 theFaces List of faces for gluing.
6291 doKeepNonSolids If FALSE, only solids will present in the result,
6292 otherwise all initial shapes.
6293 doGlueAllEdges If TRUE, all coincident edges of theShape
6294 will be glued, otherwise only the edges,
6295 belonging to theFaces.
6296 theName Object name; when specified, this parameter is used
6297 for result publication in the study. Otherwise, if automatic
6298 publication is switched on, default value is used for result name.
6301 New GEOM.GEOM_Object, containing a copy of theShape
6304 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
6305 doKeepNonSolids, doGlueAllEdges)
6307 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
6308 self._autoPublish(anObj, theName, "glueFaces")
6311 ## Replace coincident edges in theShape by one edge.
6312 # @param theShape Initial shape.
6313 # @param theTolerance Maximum distance between edges, which can be considered as coincident.
6314 # @param theName Object name; when specified, this parameter is used
6315 # for result publication in the study. Otherwise, if automatic
6316 # publication is switched on, default value is used for result name.
6318 # @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6320 # @ref tui_glue_edges "Example"
6321 def MakeGlueEdges(self, theShape, theTolerance, theName=None):
6323 Replace coincident edges in theShape by one edge.
6326 theShape Initial shape.
6327 theTolerance Maximum distance between edges, which can be considered as coincident.
6328 theName Object name; when specified, this parameter is used
6329 for result publication in the study. Otherwise, if automatic
6330 publication is switched on, default value is used for result name.
6333 New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
6335 theTolerance,Parameters = ParseParameters(theTolerance)
6336 anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
6338 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
6339 anObj.SetParameters(Parameters)
6340 self._autoPublish(anObj, theName, "glueEdges")
6343 ## Find coincident edges in theShape for possible gluing.
6344 # @param theShape Initial shape.
6345 # @param theTolerance Maximum distance between edges,
6346 # which can be considered as coincident.
6347 # @param theName Object name; when specified, this parameter is used
6348 # for result publication in the study. Otherwise, if automatic
6349 # publication is switched on, default value is used for result name.
6351 # @return GEOM.ListOfGO
6353 # @ref tui_glue_edges "Example"
6354 def GetGlueEdges(self, theShape, theTolerance, theName=None):
6356 Find coincident edges in theShape for possible gluing.
6359 theShape Initial shape.
6360 theTolerance Maximum distance between edges,
6361 which can be considered as coincident.
6362 theName Object name; when specified, this parameter is used
6363 for result publication in the study. Otherwise, if automatic
6364 publication is switched on, default value is used for result name.
6369 anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
6370 RaiseIfFailed("GetGlueEdges", self.ShapesOp)
6371 self._autoPublish(anObj, theName, "edgesToGlue")
6374 ## Replace coincident edges in theShape by one edge
6375 # in compliance with given list of edges.
6376 # @param theShape Initial shape.
6377 # @param theTolerance Maximum distance between edges,
6378 # which can be considered as coincident.
6379 # @param theEdges List of edges for gluing.
6380 # @param theName Object name; when specified, this parameter is used
6381 # for result publication in the study. Otherwise, if automatic
6382 # publication is switched on, default value is used for result name.
6384 # @return New GEOM.GEOM_Object, containing a copy of theShape
6385 # without some edges.
6387 # @ref tui_glue_edges "Example"
6388 def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
6390 Replace coincident edges in theShape by one edge
6391 in compliance with given list of edges.
6394 theShape Initial shape.
6395 theTolerance Maximum distance between edges,
6396 which can be considered as coincident.
6397 theEdges List of edges for gluing.
6398 theName Object name; when specified, this parameter is used
6399 for result publication in the study. Otherwise, if automatic
6400 publication is switched on, default value is used for result name.
6403 New GEOM.GEOM_Object, containing a copy of theShape
6406 anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
6408 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
6409 self._autoPublish(anObj, theName, "glueEdges")
6415 ## @addtogroup l3_boolean Boolean Operations
6418 # -----------------------------------------------------------------------------
6419 # Boolean (Common, Cut, Fuse, Section)
6420 # -----------------------------------------------------------------------------
6422 ## Perform one of boolean operations on two given shapes.
6423 # @param theShape1 First argument for boolean operation.
6424 # @param theShape2 Second argument for boolean operation.
6425 # @param theOperation Indicates the operation to be done:\n
6426 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6427 # @param theName Object name; when specified, this parameter is used
6428 # for result publication in the study. Otherwise, if automatic
6429 # publication is switched on, default value is used for result name.
6431 # @return New GEOM.GEOM_Object, containing the result shape.
6433 # @ref tui_fuse "Example"
6434 def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
6436 Perform one of boolean operations on two given shapes.
6439 theShape1 First argument for boolean operation.
6440 theShape2 Second argument for boolean operation.
6441 theOperation Indicates the operation to be done:
6442 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
6443 theName Object name; when specified, this parameter is used
6444 for result publication in the study. Otherwise, if automatic
6445 publication is switched on, default value is used for result name.
6448 New GEOM.GEOM_Object, containing the result shape.
6450 # Example: see GEOM_TestAll.py
6451 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
6452 RaiseIfFailed("MakeBoolean", self.BoolOp)
6453 def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
6454 self._autoPublish(anObj, theName, def_names[theOperation])
6457 ## Perform Common boolean operation on two given shapes.
6458 # @param theShape1 First argument for boolean operation.
6459 # @param theShape2 Second argument for boolean operation.
6460 # @param theName Object name; when specified, this parameter is used
6461 # for result publication in the study. Otherwise, if automatic
6462 # publication is switched on, default value is used for result name.
6464 # @return New GEOM.GEOM_Object, containing the result shape.
6466 # @ref tui_common "Example 1"
6467 # \n @ref swig_MakeCommon "Example 2"
6468 def MakeCommon(self, theShape1, theShape2, theName=None):
6470 Perform Common boolean operation on two given shapes.
6473 theShape1 First argument for boolean operation.
6474 theShape2 Second argument for boolean operation.
6475 theName Object name; when specified, this parameter is used
6476 for result publication in the study. Otherwise, if automatic
6477 publication is switched on, default value is used for result name.
6480 New GEOM.GEOM_Object, containing the result shape.
6482 # Example: see GEOM_TestOthers.py
6483 # note: auto-publishing is done in self.MakeBoolean()
6484 return self.MakeBoolean(theShape1, theShape2, 1, theName)
6486 ## Perform Cut boolean operation on two given shapes.
6487 # @param theShape1 First argument for boolean operation.
6488 # @param theShape2 Second argument for boolean operation.
6489 # @param theName Object name; when specified, this parameter is used
6490 # for result publication in the study. Otherwise, if automatic
6491 # publication is switched on, default value is used for result name.
6493 # @return New GEOM.GEOM_Object, containing the result shape.
6495 # @ref tui_cut "Example 1"
6496 # \n @ref swig_MakeCommon "Example 2"
6497 def MakeCut(self, theShape1, theShape2, theName=None):
6499 Perform Cut boolean operation on two given shapes.
6502 theShape1 First argument for boolean operation.
6503 theShape2 Second argument for boolean operation.
6504 theName Object name; when specified, this parameter is used
6505 for result publication in the study. Otherwise, if automatic
6506 publication is switched on, default value is used for result name.
6509 New GEOM.GEOM_Object, containing the result shape.
6512 # Example: see GEOM_TestOthers.py
6513 # note: auto-publishing is done in self.MakeBoolean()
6514 return self.MakeBoolean(theShape1, theShape2, 2, theName)
6516 ## Perform Fuse boolean operation on two given shapes.
6517 # @param theShape1 First argument for boolean operation.
6518 # @param theShape2 Second argument for boolean operation.
6519 # @param theName Object name; when specified, this parameter is used
6520 # for result publication in the study. Otherwise, if automatic
6521 # publication is switched on, default value is used for result name.
6523 # @return New GEOM.GEOM_Object, containing the result shape.
6525 # @ref tui_fuse "Example 1"
6526 # \n @ref swig_MakeCommon "Example 2"
6527 def MakeFuse(self, theShape1, theShape2, theName=None):
6529 Perform Fuse boolean operation on two given shapes.
6532 theShape1 First argument for boolean operation.
6533 theShape2 Second argument for boolean operation.
6534 theName Object name; when specified, this parameter is used
6535 for result publication in the study. Otherwise, if automatic
6536 publication is switched on, default value is used for result name.
6539 New GEOM.GEOM_Object, containing the result shape.
6542 # Example: see GEOM_TestOthers.py
6543 # note: auto-publishing is done in self.MakeBoolean()
6544 return self.MakeBoolean(theShape1, theShape2, 3, theName)
6546 ## Perform Section boolean operation on two given shapes.
6547 # @param theShape1 First argument for boolean operation.
6548 # @param theShape2 Second argument for boolean operation.
6549 # @param theName Object name; when specified, this parameter is used
6550 # for result publication in the study. Otherwise, if automatic
6551 # publication is switched on, default value is used for result name.
6553 # @return New GEOM.GEOM_Object, containing the result shape.
6555 # @ref tui_section "Example 1"
6556 # \n @ref swig_MakeCommon "Example 2"
6557 def MakeSection(self, theShape1, theShape2, theName=None):
6559 Perform Section boolean operation on two given shapes.
6562 theShape1 First argument for boolean operation.
6563 theShape2 Second argument for boolean operation.
6564 theName Object name; when specified, this parameter is used
6565 for result publication in the study. Otherwise, if automatic
6566 publication is switched on, default value is used for result name.
6569 New GEOM.GEOM_Object, containing the result shape.
6572 # Example: see GEOM_TestOthers.py
6573 # note: auto-publishing is done in self.MakeBoolean()
6574 return self.MakeBoolean(theShape1, theShape2, 4, theName)
6579 ## @addtogroup l3_basic_op
6582 ## Perform partition operation.
6583 # @param ListShapes Shapes to be intersected.
6584 # @param ListTools Shapes to intersect theShapes.
6585 # @param Limit Type of resulting shapes (see ShapeType()).\n
6586 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
6587 # type will be detected automatically.
6588 # @param KeepNonlimitShapes if this parameter == 0, then only shapes of
6589 # target type (equal to Limit) are kept in the result,
6590 # else standalone shapes of lower dimension
6591 # are kept also (if they exist).
6592 # @param theName Object name; when specified, this parameter is used
6593 # for result publication in the study. Otherwise, if automatic
6594 # publication is switched on, default value is used for result name.
6596 # @note Each compound from ListShapes and ListTools will be exploded
6597 # in order to avoid possible intersection between shapes from this compound.
6599 # After implementation new version of PartitionAlgo (October 2006)
6600 # other parameters are ignored by current functionality. They are kept
6601 # in this function only for support old versions.
6602 # @param ListKeepInside Shapes, outside which the results will be deleted.
6603 # Each shape from theKeepInside must belong to theShapes also.
6604 # @param ListRemoveInside Shapes, inside which the results will be deleted.
6605 # Each shape from theRemoveInside must belong to theShapes also.
6606 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
6607 # @param ListMaterials Material indices for each shape. Make sence,
6608 # only if theRemoveWebs is TRUE.
6610 # @return New GEOM.GEOM_Object, containing the result shapes.
6612 # @ref tui_partition "Example"
6613 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6614 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6615 KeepNonlimitShapes=0, theName=None):
6617 Perform partition operation.
6620 ListShapes Shapes to be intersected.
6621 ListTools Shapes to intersect theShapes.
6622 Limit Type of resulting shapes (see geompy.ShapeType)
6623 If this parameter is set to -1 ("Auto"), most appropriate shape limit
6624 type will be detected automatically.
6625 KeepNonlimitShapes if this parameter == 0, then only shapes of
6626 target type (equal to Limit) are kept in the result,
6627 else standalone shapes of lower dimension
6628 are kept also (if they exist).
6629 theName Object name; when specified, this parameter is used
6630 for result publication in the study. Otherwise, if automatic
6631 publication is switched on, default value is used for result name.
6633 Each compound from ListShapes and ListTools will be exploded
6634 in order to avoid possible intersection between shapes from
6637 After implementation new version of PartitionAlgo (October 2006) other
6638 parameters are ignored by current functionality. They are kept in this
6639 function only for support old versions.
6642 ListKeepInside Shapes, outside which the results will be deleted.
6643 Each shape from theKeepInside must belong to theShapes also.
6644 ListRemoveInside Shapes, inside which the results will be deleted.
6645 Each shape from theRemoveInside must belong to theShapes also.
6646 RemoveWebs If TRUE, perform Glue 3D algorithm.
6647 ListMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
6650 New GEOM.GEOM_Object, containing the result shapes.
6652 # Example: see GEOM_TestAll.py
6653 if Limit == ShapeType["AUTO"]:
6654 # automatic detection of the most appropriate shape limit type
6656 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6657 Limit = EnumToLong(lim)
6659 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
6660 ListKeepInside, ListRemoveInside,
6661 Limit, RemoveWebs, ListMaterials,
6662 KeepNonlimitShapes);
6663 RaiseIfFailed("MakePartition", self.BoolOp)
6664 self._autoPublish(anObj, theName, "partition")
6667 ## Perform partition operation.
6668 # This method may be useful if it is needed to make a partition for
6669 # compound contains nonintersected shapes. Performance will be better
6670 # since intersection between shapes from compound is not performed.
6672 # Description of all parameters as in previous method MakePartition()
6674 # @note Passed compounds (via ListShapes or via ListTools)
6675 # have to consist of nonintersecting shapes.
6677 # @return New GEOM.GEOM_Object, containing the result shapes.
6679 # @ref swig_todo "Example"
6680 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
6681 ListKeepInside=[], ListRemoveInside=[],
6682 Limit=ShapeType["AUTO"], RemoveWebs=0,
6683 ListMaterials=[], KeepNonlimitShapes=0,
6686 Perform partition operation.
6687 This method may be useful if it is needed to make a partition for
6688 compound contains nonintersected shapes. Performance will be better
6689 since intersection between shapes from compound is not performed.
6692 Description of all parameters as in method geompy.MakePartition
6695 Passed compounds (via ListShapes or via ListTools)
6696 have to consist of nonintersecting shapes.
6699 New GEOM.GEOM_Object, containing the result shapes.
6701 if Limit == ShapeType["AUTO"]:
6702 # automatic detection of the most appropriate shape limit type
6704 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
6705 Limit = EnumToLong(lim)
6707 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
6708 ListKeepInside, ListRemoveInside,
6709 Limit, RemoveWebs, ListMaterials,
6710 KeepNonlimitShapes);
6711 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
6712 self._autoPublish(anObj, theName, "partition")
6715 ## See method MakePartition() for more information.
6717 # @ref tui_partition "Example 1"
6718 # \n @ref swig_Partition "Example 2"
6719 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
6720 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
6721 KeepNonlimitShapes=0, theName=None):
6723 See method geompy.MakePartition for more information.
6725 # Example: see GEOM_TestOthers.py
6726 # note: auto-publishing is done in self.MakePartition()
6727 anObj = self.MakePartition(ListShapes, ListTools,
6728 ListKeepInside, ListRemoveInside,
6729 Limit, RemoveWebs, ListMaterials,
6730 KeepNonlimitShapes, theName);
6733 ## Perform partition of the Shape with the Plane
6734 # @param theShape Shape to be intersected.
6735 # @param thePlane Tool shape, to intersect theShape.
6736 # @param theName Object name; when specified, this parameter is used
6737 # for result publication in the study. Otherwise, if automatic
6738 # publication is switched on, default value is used for result name.
6740 # @return New GEOM.GEOM_Object, containing the result shape.
6742 # @ref tui_partition "Example"
6743 def MakeHalfPartition(self, theShape, thePlane, theName=None):
6745 Perform partition of the Shape with the Plane
6748 theShape Shape to be intersected.
6749 thePlane Tool shape, to intersect theShape.
6750 theName Object name; when specified, this parameter is used
6751 for result publication in the study. Otherwise, if automatic
6752 publication is switched on, default value is used for result name.
6755 New GEOM.GEOM_Object, containing the result shape.
6757 # Example: see GEOM_TestAll.py
6758 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
6759 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
6760 self._autoPublish(anObj, theName, "partition")
6763 # end of l3_basic_op
6766 ## @addtogroup l3_transform
6769 ## Translate the given object along the vector, specified
6770 # by its end points.
6771 # @param theObject The object to be translated.
6772 # @param thePoint1 Start point of translation vector.
6773 # @param thePoint2 End point of translation vector.
6774 # @param theCopy Flag used to translate object itself or create a copy.
6775 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6776 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6777 def TranslateTwoPoints(self, theObject, thePoint1, thePoint2, theCopy=False):
6779 Translate the given object along the vector, specified by its end points.
6782 theObject The object to be translated.
6783 thePoint1 Start point of translation vector.
6784 thePoint2 End point of translation vector.
6785 theCopy Flag used to translate object itself or create a copy.
6788 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6789 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6792 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6794 anObj = self.TrsfOp.TranslateTwoPoints(theObject, thePoint1, thePoint2)
6795 RaiseIfFailed("TranslateTwoPoints", self.TrsfOp)
6798 ## Translate the given object along the vector, specified
6799 # by its end points, creating its copy before the translation.
6800 # @param theObject The object to be translated.
6801 # @param thePoint1 Start point of translation vector.
6802 # @param thePoint2 End point of translation vector.
6803 # @param theName Object name; when specified, this parameter is used
6804 # for result publication in the study. Otherwise, if automatic
6805 # publication is switched on, default value is used for result name.
6807 # @return New GEOM.GEOM_Object, containing the translated object.
6809 # @ref tui_translation "Example 1"
6810 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
6811 def MakeTranslationTwoPoints(self, theObject, thePoint1, thePoint2, theName=None):
6813 Translate the given object along the vector, specified
6814 by its end points, creating its copy before the translation.
6817 theObject The object to be translated.
6818 thePoint1 Start point of translation vector.
6819 thePoint2 End point of translation vector.
6820 theName Object name; when specified, this parameter is used
6821 for result publication in the study. Otherwise, if automatic
6822 publication is switched on, default value is used for result name.
6825 New GEOM.GEOM_Object, containing the translated object.
6827 # Example: see GEOM_TestAll.py
6828 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
6829 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
6830 self._autoPublish(anObj, theName, "translated")
6833 ## Translate the given object along the vector, specified by its components.
6834 # @param theObject The object to be translated.
6835 # @param theDX,theDY,theDZ Components of translation vector.
6836 # @param theCopy Flag used to translate object itself or create a copy.
6837 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6838 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6840 # @ref tui_translation "Example"
6841 def TranslateDXDYDZ(self, theObject, theDX, theDY, theDZ, theCopy=False):
6843 Translate the given object along the vector, specified by its components.
6846 theObject The object to be translated.
6847 theDX,theDY,theDZ Components of translation vector.
6848 theCopy Flag used to translate object itself or create a copy.
6851 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6852 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6854 # Example: see GEOM_TestAll.py
6855 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
6857 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
6859 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
6860 anObj.SetParameters(Parameters)
6861 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
6864 ## Translate the given object along the vector, specified
6865 # by its components, creating its copy before the translation.
6866 # @param theObject The object to be translated.
6867 # @param theDX,theDY,theDZ Components of translation vector.
6868 # @param theName Object name; when specified, this parameter is used
6869 # for result publication in the study. Otherwise, if automatic
6870 # publication is switched on, default value is used for result name.
6872 # @return New GEOM.GEOM_Object, containing the translated object.
6874 # @ref tui_translation "Example"
6875 def MakeTranslation(self,theObject, theDX, theDY, theDZ, theName=None):
6877 Translate the given object along the vector, specified
6878 by its components, creating its copy before the translation.
6881 theObject The object to be translated.
6882 theDX,theDY,theDZ Components of translation vector.
6883 theName Object name; when specified, this parameter is used
6884 for result publication in the study. Otherwise, if automatic
6885 publication is switched on, default value is used for result name.
6888 New GEOM.GEOM_Object, containing the translated object.
6890 # Example: see GEOM_TestAll.py
6891 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
6892 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
6893 anObj.SetParameters(Parameters)
6894 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
6895 self._autoPublish(anObj, theName, "translated")
6898 ## Translate the given object along the given vector.
6899 # @param theObject The object to be translated.
6900 # @param theVector The translation vector.
6901 # @param theCopy Flag used to translate object itself or create a copy.
6902 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6903 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6904 def TranslateVector(self, theObject, theVector, theCopy=False):
6906 Translate the given object along the given vector.
6909 theObject The object to be translated.
6910 theVector The translation vector.
6911 theCopy Flag used to translate object itself or create a copy.
6914 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6915 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6918 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
6920 anObj = self.TrsfOp.TranslateVector(theObject, theVector)
6921 RaiseIfFailed("TranslateVector", self.TrsfOp)
6924 ## Translate the given object along the given vector,
6925 # creating its copy before the translation.
6926 # @param theObject The object to be translated.
6927 # @param theVector The translation vector.
6928 # @param theName Object name; when specified, this parameter is used
6929 # for result publication in the study. Otherwise, if automatic
6930 # publication is switched on, default value is used for result name.
6932 # @return New GEOM.GEOM_Object, containing the translated object.
6934 # @ref tui_translation "Example"
6935 def MakeTranslationVector(self, theObject, theVector, theName=None):
6937 Translate the given object along the given vector,
6938 creating its copy before the translation.
6941 theObject The object to be translated.
6942 theVector The translation vector.
6943 theName Object name; when specified, this parameter is used
6944 for result publication in the study. Otherwise, if automatic
6945 publication is switched on, default value is used for result name.
6948 New GEOM.GEOM_Object, containing the translated object.
6950 # Example: see GEOM_TestAll.py
6951 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
6952 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
6953 self._autoPublish(anObj, theName, "translated")
6956 ## Translate the given object along the given vector on given distance.
6957 # @param theObject The object to be translated.
6958 # @param theVector The translation vector.
6959 # @param theDistance The translation distance.
6960 # @param theCopy Flag used to translate object itself or create a copy.
6961 # @return Translated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
6962 # new GEOM.GEOM_Object, containing the translated object if @a theCopy flag is @c True.
6964 # @ref tui_translation "Example"
6965 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy=False):
6967 Translate the given object along the given vector on given distance.
6970 theObject The object to be translated.
6971 theVector The translation vector.
6972 theDistance The translation distance.
6973 theCopy Flag used to translate object itself or create a copy.
6976 Translated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
6977 new GEOM.GEOM_Object, containing the translated object if theCopy flag is True.
6979 # Example: see GEOM_TestAll.py
6980 theDistance,Parameters = ParseParameters(theDistance)
6981 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
6982 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
6983 anObj.SetParameters(Parameters)
6986 ## Translate the given object along the given vector on given distance,
6987 # creating its copy before the translation.
6988 # @param theObject The object to be translated.
6989 # @param theVector The translation vector.
6990 # @param theDistance The translation distance.
6991 # @param theName Object name; when specified, this parameter is used
6992 # for result publication in the study. Otherwise, if automatic
6993 # publication is switched on, default value is used for result name.
6995 # @return New GEOM.GEOM_Object, containing the translated object.
6997 # @ref tui_translation "Example"
6998 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance, theName=None):
7000 Translate the given object along the given vector on given distance,
7001 creating its copy before the translation.
7004 theObject The object to be translated.
7005 theVector The translation vector.
7006 theDistance The translation distance.
7007 theName Object name; when specified, this parameter is used
7008 for result publication in the study. Otherwise, if automatic
7009 publication is switched on, default value is used for result name.
7012 New GEOM.GEOM_Object, containing the translated object.
7014 # Example: see GEOM_TestAll.py
7015 theDistance,Parameters = ParseParameters(theDistance)
7016 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
7017 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
7018 anObj.SetParameters(Parameters)
7019 self._autoPublish(anObj, theName, "translated")
7022 ## Rotate the given object around the given axis on the given angle.
7023 # @param theObject The object to be rotated.
7024 # @param theAxis Rotation axis.
7025 # @param theAngle Rotation angle in radians.
7026 # @param theCopy Flag used to rotate object itself or create a copy.
7028 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7029 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7031 # @ref tui_rotation "Example"
7032 def Rotate(self, theObject, theAxis, theAngle, theCopy=False):
7034 Rotate the given object around the given axis on the given angle.
7037 theObject The object to be rotated.
7038 theAxis Rotation axis.
7039 theAngle Rotation angle in radians.
7040 theCopy Flag used to rotate object itself or create a copy.
7043 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7044 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7046 # Example: see GEOM_TestAll.py
7048 if isinstance(theAngle,str):
7050 theAngle, Parameters = ParseParameters(theAngle)
7052 theAngle = theAngle*math.pi/180.0
7054 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7056 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
7057 RaiseIfFailed("Rotate", self.TrsfOp)
7058 anObj.SetParameters(Parameters)
7061 ## Rotate the given object around the given axis
7062 # on the given angle, creating its copy before the rotatation.
7063 # @param theObject The object to be rotated.
7064 # @param theAxis Rotation axis.
7065 # @param theAngle Rotation angle in radians.
7066 # @param theName Object name; when specified, this parameter is used
7067 # for result publication in the study. Otherwise, if automatic
7068 # publication is switched on, default value is used for result name.
7070 # @return New GEOM.GEOM_Object, containing the rotated object.
7072 # @ref tui_rotation "Example"
7073 def MakeRotation(self, theObject, theAxis, theAngle, theName=None):
7075 Rotate the given object around the given axis
7076 on the given angle, creating its copy before the rotatation.
7079 theObject The object to be rotated.
7080 theAxis Rotation axis.
7081 theAngle Rotation angle in radians.
7082 theName Object name; when specified, this parameter is used
7083 for result publication in the study. Otherwise, if automatic
7084 publication is switched on, default value is used for result name.
7087 New GEOM.GEOM_Object, containing the rotated object.
7089 # Example: see GEOM_TestAll.py
7091 if isinstance(theAngle,str):
7093 theAngle, Parameters = ParseParameters(theAngle)
7095 theAngle = theAngle*math.pi/180.0
7096 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
7097 RaiseIfFailed("RotateCopy", self.TrsfOp)
7098 anObj.SetParameters(Parameters)
7099 self._autoPublish(anObj, theName, "rotated")
7102 ## Rotate given object around vector perpendicular to plane
7103 # containing three points.
7104 # @param theObject The object to be rotated.
7105 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7106 # containing the three points.
7107 # @param thePoint1,thePoint2 points in a perpendicular plane of the axis.
7108 # @param theCopy Flag used to rotate object itself or create a copy.
7109 # @return Rotated @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7110 # new GEOM.GEOM_Object, containing the rotated object if @a theCopy flag is @c True.
7111 def RotateThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theCopy=False):
7113 Rotate given object around vector perpendicular to plane
7114 containing three points.
7117 theObject The object to be rotated.
7118 theCentPoint central point the axis is the vector perpendicular to the plane
7119 containing the three points.
7120 thePoint1,thePoint2 points in a perpendicular plane of the axis.
7121 theCopy Flag used to rotate object itself or create a copy.
7124 Rotated theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7125 new GEOM.GEOM_Object, containing the rotated object if theCopy flag is True.
7128 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7130 anObj = self.TrsfOp.RotateThreePoints(theObject, theCentPoint, thePoint1, thePoint2)
7131 RaiseIfFailed("RotateThreePoints", self.TrsfOp)
7134 ## Rotate given object around vector perpendicular to plane
7135 # containing three points, creating its copy before the rotatation.
7136 # @param theObject The object to be rotated.
7137 # @param theCentPoint central point the axis is the vector perpendicular to the plane
7138 # containing the three points.
7139 # @param thePoint1,thePoint2 in a perpendicular plane of the axis.
7140 # @param theName Object name; when specified, this parameter is used
7141 # for result publication in the study. Otherwise, if automatic
7142 # publication is switched on, default value is used for result name.
7144 # @return New GEOM.GEOM_Object, containing the rotated object.
7146 # @ref tui_rotation "Example"
7147 def MakeRotationThreePoints(self, theObject, theCentPoint, thePoint1, thePoint2, theName=None):
7149 Rotate given object around vector perpendicular to plane
7150 containing three points, creating its copy before the rotatation.
7153 theObject The object to be rotated.
7154 theCentPoint central point the axis is the vector perpendicular to the plane
7155 containing the three points.
7156 thePoint1,thePoint2 in a perpendicular plane of the axis.
7157 theName Object name; when specified, this parameter is used
7158 for result publication in the study. Otherwise, if automatic
7159 publication is switched on, default value is used for result name.
7162 New GEOM.GEOM_Object, containing the rotated object.
7164 # Example: see GEOM_TestAll.py
7165 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
7166 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
7167 self._autoPublish(anObj, theName, "rotated")
7170 ## Scale the given object by the specified factor.
7171 # @param theObject The object to be scaled.
7172 # @param thePoint Center point for scaling.
7173 # Passing None for it means scaling relatively the origin of global CS.
7174 # @param theFactor Scaling factor value.
7175 # @param theCopy Flag used to scale object itself or create a copy.
7176 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7177 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7178 def Scale(self, theObject, thePoint, theFactor, theCopy=False):
7180 Scale the given object by the specified factor.
7183 theObject The object to be scaled.
7184 thePoint Center point for scaling.
7185 Passing None for it means scaling relatively the origin of global CS.
7186 theFactor Scaling factor value.
7187 theCopy Flag used to scale object itself or create a copy.
7190 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7191 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7193 # Example: see GEOM_TestAll.py
7194 theFactor, Parameters = ParseParameters(theFactor)
7196 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7198 anObj = self.TrsfOp.ScaleShape(theObject, thePoint, theFactor)
7199 RaiseIfFailed("Scale", self.TrsfOp)
7200 anObj.SetParameters(Parameters)
7203 ## Scale the given object by the factor, creating its copy before the scaling.
7204 # @param theObject The object to be scaled.
7205 # @param thePoint Center point for scaling.
7206 # Passing None for it means scaling relatively the origin of global CS.
7207 # @param theFactor Scaling factor value.
7208 # @param theName Object name; when specified, this parameter is used
7209 # for result publication in the study. Otherwise, if automatic
7210 # publication is switched on, default value is used for result name.
7212 # @return New GEOM.GEOM_Object, containing the scaled shape.
7214 # @ref tui_scale "Example"
7215 def MakeScaleTransform(self, theObject, thePoint, theFactor, theName=None):
7217 Scale the given object by the factor, creating its copy before the scaling.
7220 theObject The object to be scaled.
7221 thePoint Center point for scaling.
7222 Passing None for it means scaling relatively the origin of global CS.
7223 theFactor Scaling factor value.
7224 theName Object name; when specified, this parameter is used
7225 for result publication in the study. Otherwise, if automatic
7226 publication is switched on, default value is used for result name.
7229 New GEOM.GEOM_Object, containing the scaled shape.
7231 # Example: see GEOM_TestAll.py
7232 theFactor, Parameters = ParseParameters(theFactor)
7233 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
7234 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
7235 anObj.SetParameters(Parameters)
7236 self._autoPublish(anObj, theName, "scaled")
7239 ## Scale the given object by different factors along coordinate axes.
7240 # @param theObject The object to be scaled.
7241 # @param thePoint Center point for scaling.
7242 # Passing None for it means scaling relatively the origin of global CS.
7243 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7244 # @param theCopy Flag used to scale object itself or create a copy.
7245 # @return Scaled @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7246 # new GEOM.GEOM_Object, containing the scaled object if @a theCopy flag is @c True.
7247 def ScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theCopy=False):
7249 Scale the given object by different factors along coordinate axes.
7252 theObject The object to be scaled.
7253 thePoint Center point for scaling.
7254 Passing None for it means scaling relatively the origin of global CS.
7255 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7256 theCopy Flag used to scale object itself or create a copy.
7259 Scaled theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7260 new GEOM.GEOM_Object, containing the scaled object if theCopy flag is True.
7262 # Example: see GEOM_TestAll.py
7263 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7265 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7266 theFactorX, theFactorY, theFactorZ)
7268 anObj = self.TrsfOp.ScaleShapeAlongAxes(theObject, thePoint,
7269 theFactorX, theFactorY, theFactorZ)
7270 RaiseIfFailed("ScaleAlongAxes", self.TrsfOp)
7271 anObj.SetParameters(Parameters)
7274 ## Scale the given object by different factors along coordinate axes,
7275 # creating its copy before the scaling.
7276 # @param theObject The object to be scaled.
7277 # @param thePoint Center point for scaling.
7278 # Passing None for it means scaling relatively the origin of global CS.
7279 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7280 # @param theName Object name; when specified, this parameter is used
7281 # for result publication in the study. Otherwise, if automatic
7282 # publication is switched on, default value is used for result name.
7284 # @return New GEOM.GEOM_Object, containing the scaled shape.
7286 # @ref swig_scale "Example"
7287 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ, theName=None):
7289 Scale the given object by different factors along coordinate axes,
7290 creating its copy before the scaling.
7293 theObject The object to be scaled.
7294 thePoint Center point for scaling.
7295 Passing None for it means scaling relatively the origin of global CS.
7296 theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
7297 theName Object name; when specified, this parameter is used
7298 for result publication in the study. Otherwise, if automatic
7299 publication is switched on, default value is used for result name.
7302 New GEOM.GEOM_Object, containing the scaled shape.
7304 # Example: see GEOM_TestAll.py
7305 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
7306 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
7307 theFactorX, theFactorY, theFactorZ)
7308 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
7309 anObj.SetParameters(Parameters)
7310 self._autoPublish(anObj, theName, "scaled")
7313 ## Mirror an object relatively the given plane.
7314 # @param theObject The object to be mirrored.
7315 # @param thePlane Plane of symmetry.
7316 # @param theCopy Flag used to mirror object itself or create a copy.
7317 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7318 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7319 def MirrorByPlane(self, theObject, thePlane, theCopy=False):
7321 Mirror an object relatively the given plane.
7324 theObject The object to be mirrored.
7325 thePlane Plane of symmetry.
7326 theCopy Flag used to mirror object itself or create a copy.
7329 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7330 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7333 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7335 anObj = self.TrsfOp.MirrorPlane(theObject, thePlane)
7336 RaiseIfFailed("MirrorByPlane", self.TrsfOp)
7339 ## Create an object, symmetrical
7340 # to the given one relatively the given plane.
7341 # @param theObject The object to be mirrored.
7342 # @param thePlane Plane of symmetry.
7343 # @param theName Object name; when specified, this parameter is used
7344 # for result publication in the study. Otherwise, if automatic
7345 # publication is switched on, default value is used for result name.
7347 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7349 # @ref tui_mirror "Example"
7350 def MakeMirrorByPlane(self, theObject, thePlane, theName=None):
7352 Create an object, symmetrical to the given one relatively the given plane.
7355 theObject The object to be mirrored.
7356 thePlane Plane of symmetry.
7357 theName Object name; when specified, this parameter is used
7358 for result publication in the study. Otherwise, if automatic
7359 publication is switched on, default value is used for result name.
7362 New GEOM.GEOM_Object, containing the mirrored shape.
7364 # Example: see GEOM_TestAll.py
7365 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
7366 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
7367 self._autoPublish(anObj, theName, "mirrored")
7370 ## Mirror an object relatively the given axis.
7371 # @param theObject The object to be mirrored.
7372 # @param theAxis Axis of symmetry.
7373 # @param theCopy Flag used to mirror object itself or create a copy.
7374 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7375 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7376 def MirrorByAxis(self, theObject, theAxis, theCopy=False):
7378 Mirror an object relatively the given axis.
7381 theObject The object to be mirrored.
7382 theAxis Axis of symmetry.
7383 theCopy Flag used to mirror object itself or create a copy.
7386 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7387 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7390 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7392 anObj = self.TrsfOp.MirrorAxis(theObject, theAxis)
7393 RaiseIfFailed("MirrorByAxis", self.TrsfOp)
7396 ## Create an object, symmetrical
7397 # to the given one relatively the given axis.
7398 # @param theObject The object to be mirrored.
7399 # @param theAxis Axis of symmetry.
7400 # @param theName Object name; when specified, this parameter is used
7401 # for result publication in the study. Otherwise, if automatic
7402 # publication is switched on, default value is used for result name.
7404 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7406 # @ref tui_mirror "Example"
7407 def MakeMirrorByAxis(self, theObject, theAxis, theName=None):
7409 Create an object, symmetrical to the given one relatively the given axis.
7412 theObject The object to be mirrored.
7413 theAxis Axis of symmetry.
7414 theName Object name; when specified, this parameter is used
7415 for result publication in the study. Otherwise, if automatic
7416 publication is switched on, default value is used for result name.
7419 New GEOM.GEOM_Object, containing the mirrored shape.
7421 # Example: see GEOM_TestAll.py
7422 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
7423 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
7424 self._autoPublish(anObj, theName, "mirrored")
7427 ## Mirror an object relatively the given point.
7428 # @param theObject The object to be mirrored.
7429 # @param thePoint Point of symmetry.
7430 # @param theCopy Flag used to mirror object itself or create a copy.
7431 # @return Mirrored @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7432 # new GEOM.GEOM_Object, containing the mirrored object if @a theCopy flag is @c True.
7433 def MirrorByPoint(self, theObject, thePoint, theCopy=False):
7435 Mirror an object relatively the given point.
7438 theObject The object to be mirrored.
7439 thePoint Point of symmetry.
7440 theCopy Flag used to mirror object itself or create a copy.
7443 Mirrored theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7444 new GEOM.GEOM_Object, containing the mirrored object if theCopy flag is True.
7446 # Example: see GEOM_TestAll.py
7448 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7450 anObj = self.TrsfOp.MirrorPoint(theObject, thePoint)
7451 RaiseIfFailed("MirrorByPoint", self.TrsfOp)
7454 ## Create an object, symmetrical
7455 # to the given one relatively the given point.
7456 # @param theObject The object to be mirrored.
7457 # @param thePoint Point of symmetry.
7458 # @param theName Object name; when specified, this parameter is used
7459 # for result publication in the study. Otherwise, if automatic
7460 # publication is switched on, default value is used for result name.
7462 # @return New GEOM.GEOM_Object, containing the mirrored shape.
7464 # @ref tui_mirror "Example"
7465 def MakeMirrorByPoint(self, theObject, thePoint, theName=None):
7467 Create an object, symmetrical
7468 to the given one relatively the given point.
7471 theObject The object to be mirrored.
7472 thePoint Point of symmetry.
7473 theName Object name; when specified, this parameter is used
7474 for result publication in the study. Otherwise, if automatic
7475 publication is switched on, default value is used for result name.
7478 New GEOM.GEOM_Object, containing the mirrored shape.
7480 # Example: see GEOM_TestAll.py
7481 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
7482 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
7483 self._autoPublish(anObj, theName, "mirrored")
7486 ## Modify the location of the given object.
7487 # @param theObject The object to be displaced.
7488 # @param theStartLCS Coordinate system to perform displacement from it.\n
7489 # If \a theStartLCS is NULL, displacement
7490 # will be performed from global CS.\n
7491 # If \a theObject itself is used as \a theStartLCS,
7492 # its location will be changed to \a theEndLCS.
7493 # @param theEndLCS Coordinate system to perform displacement to it.
7494 # @param theCopy Flag used to displace object itself or create a copy.
7495 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7496 # new GEOM.GEOM_Object, containing the displaced object if @a theCopy flag is @c True.
7497 def Position(self, theObject, theStartLCS, theEndLCS, theCopy=False):
7499 Modify the Location of the given object by LCS, creating its copy before the setting.
7502 theObject The object to be displaced.
7503 theStartLCS Coordinate system to perform displacement from it.
7504 If theStartLCS is NULL, displacement
7505 will be performed from global CS.
7506 If theObject itself is used as theStartLCS,
7507 its location will be changed to theEndLCS.
7508 theEndLCS Coordinate system to perform displacement to it.
7509 theCopy Flag used to displace object itself or create a copy.
7512 Displaced theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7513 new GEOM.GEOM_Object, containing the displaced object if theCopy flag is True.
7515 # Example: see GEOM_TestAll.py
7517 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7519 anObj = self.TrsfOp.PositionShape(theObject, theStartLCS, theEndLCS)
7520 RaiseIfFailed("Displace", self.TrsfOp)
7523 ## Modify the Location of the given object by LCS,
7524 # creating its copy before the setting.
7525 # @param theObject The object to be displaced.
7526 # @param theStartLCS Coordinate system to perform displacement from it.\n
7527 # If \a theStartLCS is NULL, displacement
7528 # will be performed from global CS.\n
7529 # If \a theObject itself is used as \a theStartLCS,
7530 # its location will be changed to \a theEndLCS.
7531 # @param theEndLCS Coordinate system to perform displacement to it.
7532 # @param theName Object name; when specified, this parameter is used
7533 # for result publication in the study. Otherwise, if automatic
7534 # publication is switched on, default value is used for result name.
7536 # @return New GEOM.GEOM_Object, containing the displaced shape.
7538 # @ref tui_modify_location "Example"
7539 def MakePosition(self, theObject, theStartLCS, theEndLCS, theName=None):
7541 Modify the Location of the given object by LCS, creating its copy before the setting.
7544 theObject The object to be displaced.
7545 theStartLCS Coordinate system to perform displacement from it.
7546 If theStartLCS is NULL, displacement
7547 will be performed from global CS.
7548 If theObject itself is used as theStartLCS,
7549 its location will be changed to theEndLCS.
7550 theEndLCS Coordinate system to perform displacement to it.
7551 theName Object name; when specified, this parameter is used
7552 for result publication in the study. Otherwise, if automatic
7553 publication is switched on, default value is used for result name.
7556 New GEOM.GEOM_Object, containing the displaced shape.
7559 # create local coordinate systems
7560 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
7561 cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
7562 # modify the location of the given object
7563 position = geompy.MakePosition(cylinder, cs1, cs2)
7565 # Example: see GEOM_TestAll.py
7566 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
7567 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
7568 self._autoPublish(anObj, theName, "displaced")
7571 ## Modify the Location of the given object by Path.
7572 # @param theObject The object to be displaced.
7573 # @param thePath Wire or Edge along that the object will be translated.
7574 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7575 # @param theCopy is to create a copy objects if true.
7576 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7577 # @return Displaced @a theObject (GEOM.GEOM_Object) if @a theCopy is @c False or
7578 # new GEOM.GEOM_Object, containing the displaced shape if @a theCopy is @c True.
7580 # @ref tui_modify_location "Example"
7581 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
7583 Modify the Location of the given object by Path.
7586 theObject The object to be displaced.
7587 thePath Wire or Edge along that the object will be translated.
7588 theDistance progress of Path (0 = start location, 1 = end of path location).
7589 theCopy is to create a copy objects if true.
7590 theReverse 0 - for usual direction, 1 - to reverse path direction.
7593 Displaced theObject (GEOM.GEOM_Object) if theCopy is False or
7594 new GEOM.GEOM_Object, containing the displaced shape if theCopy is True.
7597 position = geompy.PositionAlongPath(cylinder, circle, 0.75, 1, 1)
7599 # Example: see GEOM_TestAll.py
7600 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
7601 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7604 ## Modify the Location of the given object by Path, creating its copy before the operation.
7605 # @param theObject The object to be displaced.
7606 # @param thePath Wire or Edge along that the object will be translated.
7607 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
7608 # @param theReverse 0 - for usual direction, 1 - to reverse path direction.
7609 # @param theName Object name; when specified, this parameter is used
7610 # for result publication in the study. Otherwise, if automatic
7611 # publication is switched on, default value is used for result name.
7613 # @return New GEOM.GEOM_Object, containing the displaced shape.
7614 def MakePositionAlongPath(self, theObject, thePath, theDistance, theReverse, theName=None):
7616 Modify the Location of the given object by Path, creating its copy before the operation.
7619 theObject The object to be displaced.
7620 thePath Wire or Edge along that the object will be translated.
7621 theDistance progress of Path (0 = start location, 1 = end of path location).
7622 theReverse 0 - for usual direction, 1 - to reverse path direction.
7623 theName Object name; when specified, this parameter is used
7624 for result publication in the study. Otherwise, if automatic
7625 publication is switched on, default value is used for result name.
7628 New GEOM.GEOM_Object, containing the displaced shape.
7630 # Example: see GEOM_TestAll.py
7631 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, 1, theReverse)
7632 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
7633 self._autoPublish(anObj, theName, "displaced")
7636 ## Offset given shape.
7637 # @param theObject The base object for the offset.
7638 # @param theOffset Offset value.
7639 # @param theCopy Flag used to offset object itself or create a copy.
7640 # @return Modified @a theObject (GEOM.GEOM_Object) if @a theCopy flag is @c False (default) or
7641 # new GEOM.GEOM_Object, containing the result of offset operation if @a theCopy flag is @c True.
7642 def Offset(self, theObject, theOffset, theCopy=False):
7647 theObject The base object for the offset.
7648 theOffset Offset value.
7649 theCopy Flag used to offset object itself or create a copy.
7652 Modified theObject (GEOM.GEOM_Object) if theCopy flag is False (default) or
7653 new GEOM.GEOM_Object, containing the result of offset operation if theCopy flag is True.
7655 theOffset, Parameters = ParseParameters(theOffset)
7657 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7659 anObj = self.TrsfOp.OffsetShape(theObject, theOffset)
7660 RaiseIfFailed("Offset", self.TrsfOp)
7661 anObj.SetParameters(Parameters)
7664 ## Create new object as offset of the given one.
7665 # @param theObject The base object for the offset.
7666 # @param theOffset Offset value.
7667 # @param theName Object name; when specified, this parameter is used
7668 # for result publication in the study. Otherwise, if automatic
7669 # publication is switched on, default value is used for result name.
7671 # @return New GEOM.GEOM_Object, containing the offset object.
7673 # @ref tui_offset "Example"
7674 def MakeOffset(self, theObject, theOffset, theName=None):
7676 Create new object as offset of the given one.
7679 theObject The base object for the offset.
7680 theOffset Offset value.
7681 theName Object name; when specified, this parameter is used
7682 for result publication in the study. Otherwise, if automatic
7683 publication is switched on, default value is used for result name.
7686 New GEOM.GEOM_Object, containing the offset object.
7689 box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
7690 # create a new object as offset of the given object
7691 offset = geompy.MakeOffset(box, 70.)
7693 # Example: see GEOM_TestAll.py
7694 theOffset, Parameters = ParseParameters(theOffset)
7695 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
7696 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
7697 anObj.SetParameters(Parameters)
7698 self._autoPublish(anObj, theName, "offset")
7701 ## Create new object as projection of the given one on a 2D surface.
7702 # @param theSource The source object for the projection. It can be a point, edge or wire.
7703 # @param theTarget The target object. It can be planar or cylindrical face.
7704 # @param theName Object name; when specified, this parameter is used
7705 # for result publication in the study. Otherwise, if automatic
7706 # publication is switched on, default value is used for result name.
7708 # @return New GEOM.GEOM_Object, containing the projection.
7710 # @ref tui_projection "Example"
7711 def MakeProjection(self, theSource, theTarget, theName=None):
7713 Create new object as projection of the given one on a 2D surface.
7716 theSource The source object for the projection. It can be a point, edge or wire.
7717 theTarget The target object. It can be planar or cylindrical face.
7718 theName Object name; when specified, this parameter is used
7719 for result publication in the study. Otherwise, if automatic
7720 publication is switched on, default value is used for result name.
7723 New GEOM.GEOM_Object, containing the projection.
7725 # Example: see GEOM_TestAll.py
7726 anObj = self.TrsfOp.ProjectShapeCopy(theSource, theTarget)
7727 RaiseIfFailed("ProjectShapeCopy", self.TrsfOp)
7728 self._autoPublish(anObj, theName, "projection")
7731 # -----------------------------------------------------------------------------
7733 # -----------------------------------------------------------------------------
7735 ## Translate the given object along the given vector a given number times
7736 # @param theObject The object to be translated.
7737 # @param theVector Direction of the translation. DX if None.
7738 # @param theStep Distance to translate on.
7739 # @param theNbTimes Quantity of translations to be done.
7740 # @param theName Object name; when specified, this parameter is used
7741 # for result publication in the study. Otherwise, if automatic
7742 # publication is switched on, default value is used for result name.
7744 # @return New GEOM.GEOM_Object, containing compound of all
7745 # the shapes, obtained after each translation.
7747 # @ref tui_multi_translation "Example"
7748 def MakeMultiTranslation1D(self, theObject, theVector, theStep, theNbTimes, theName=None):
7750 Translate the given object along the given vector a given number times
7753 theObject The object to be translated.
7754 theVector Direction of the translation. DX if None.
7755 theStep Distance to translate on.
7756 theNbTimes Quantity of translations to be done.
7757 theName Object name; when specified, this parameter is used
7758 for result publication in the study. Otherwise, if automatic
7759 publication is switched on, default value is used for result name.
7762 New GEOM.GEOM_Object, containing compound of all
7763 the shapes, obtained after each translation.
7766 r1d = geompy.MakeMultiTranslation1D(prism, vect, 20, 4)
7768 # Example: see GEOM_TestAll.py
7769 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
7770 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
7771 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
7772 anObj.SetParameters(Parameters)
7773 self._autoPublish(anObj, theName, "multitranslation")
7776 ## Conseqently apply two specified translations to theObject specified number of times.
7777 # @param theObject The object to be translated.
7778 # @param theVector1 Direction of the first translation. DX if None.
7779 # @param theStep1 Step of the first translation.
7780 # @param theNbTimes1 Quantity of translations to be done along theVector1.
7781 # @param theVector2 Direction of the second translation. DY if None.
7782 # @param theStep2 Step of the second translation.
7783 # @param theNbTimes2 Quantity of translations to be done along theVector2.
7784 # @param theName Object name; when specified, this parameter is used
7785 # for result publication in the study. Otherwise, if automatic
7786 # publication is switched on, default value is used for result name.
7788 # @return New GEOM.GEOM_Object, containing compound of all
7789 # the shapes, obtained after each translation.
7791 # @ref tui_multi_translation "Example"
7792 def MakeMultiTranslation2D(self, theObject, theVector1, theStep1, theNbTimes1,
7793 theVector2, theStep2, theNbTimes2, theName=None):
7795 Conseqently apply two specified translations to theObject specified number of times.
7798 theObject The object to be translated.
7799 theVector1 Direction of the first translation. DX if None.
7800 theStep1 Step of the first translation.
7801 theNbTimes1 Quantity of translations to be done along theVector1.
7802 theVector2 Direction of the second translation. DY if None.
7803 theStep2 Step of the second translation.
7804 theNbTimes2 Quantity of translations to be done along theVector2.
7805 theName Object name; when specified, this parameter is used
7806 for result publication in the study. Otherwise, if automatic
7807 publication is switched on, default value is used for result name.
7810 New GEOM.GEOM_Object, containing compound of all
7811 the shapes, obtained after each translation.
7814 tr2d = geompy.MakeMultiTranslation2D(prism, vect1, 20, 4, vect2, 80, 3)
7816 # Example: see GEOM_TestAll.py
7817 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
7818 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
7819 theVector2, theStep2, theNbTimes2)
7820 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
7821 anObj.SetParameters(Parameters)
7822 self._autoPublish(anObj, theName, "multitranslation")
7825 ## Rotate the given object around the given axis a given number times.
7826 # Rotation angle will be 2*PI/theNbTimes.
7827 # @param theObject The object to be rotated.
7828 # @param theAxis The rotation axis. DZ if None.
7829 # @param theNbTimes Quantity of rotations to be done.
7830 # @param theName Object name; when specified, this parameter is used
7831 # for result publication in the study. Otherwise, if automatic
7832 # publication is switched on, default value is used for result name.
7834 # @return New GEOM.GEOM_Object, containing compound of all the
7835 # shapes, obtained after each rotation.
7837 # @ref tui_multi_rotation "Example"
7838 def MultiRotate1DNbTimes (self, theObject, theAxis, theNbTimes, theName=None):
7840 Rotate the given object around the given axis a given number times.
7841 Rotation angle will be 2*PI/theNbTimes.
7844 theObject The object to be rotated.
7845 theAxis The rotation axis. DZ if None.
7846 theNbTimes Quantity of rotations to be done.
7847 theName Object name; when specified, this parameter is used
7848 for result publication in the study. Otherwise, if automatic
7849 publication is switched on, default value is used for result name.
7852 New GEOM.GEOM_Object, containing compound of all the
7853 shapes, obtained after each rotation.
7856 rot1d = geompy.MultiRotate1DNbTimes(prism, vect, 4)
7858 # Example: see GEOM_TestAll.py
7859 theNbTimes, Parameters = ParseParameters(theNbTimes)
7860 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
7861 RaiseIfFailed("MultiRotate1DNbTimes", self.TrsfOp)
7862 anObj.SetParameters(Parameters)
7863 self._autoPublish(anObj, theName, "multirotation")
7866 ## Rotate the given object around the given axis
7867 # a given number times on the given angle.
7868 # @param theObject The object to be rotated.
7869 # @param theAxis The rotation axis. DZ if None.
7870 # @param theAngleStep Rotation angle in radians.
7871 # @param theNbTimes Quantity of rotations to be done.
7872 # @param theName Object name; when specified, this parameter is used
7873 # for result publication in the study. Otherwise, if automatic
7874 # publication is switched on, default value is used for result name.
7876 # @return New GEOM.GEOM_Object, containing compound of all the
7877 # shapes, obtained after each rotation.
7879 # @ref tui_multi_rotation "Example"
7880 def MultiRotate1DByStep(self, theObject, theAxis, theAngleStep, theNbTimes, theName=None):
7882 Rotate the given object around the given axis
7883 a given number times on the given angle.
7886 theObject The object to be rotated.
7887 theAxis The rotation axis. DZ if None.
7888 theAngleStep Rotation angle in radians.
7889 theNbTimes Quantity of rotations to be done.
7890 theName Object name; when specified, this parameter is used
7891 for result publication in the study. Otherwise, if automatic
7892 publication is switched on, default value is used for result name.
7895 New GEOM.GEOM_Object, containing compound of all the
7896 shapes, obtained after each rotation.
7899 rot1d = geompy.MultiRotate1DByStep(prism, vect, math.pi/4, 4)
7901 # Example: see GEOM_TestAll.py
7902 theAngleStep, theNbTimes, Parameters = ParseParameters(theAngleStep, theNbTimes)
7903 anObj = self.TrsfOp.MultiRotate1DByStep(theObject, theAxis, theAngleStep, theNbTimes)
7904 RaiseIfFailed("MultiRotate1DByStep", self.TrsfOp)
7905 anObj.SetParameters(Parameters)
7906 self._autoPublish(anObj, theName, "multirotation")
7909 ## Rotate the given object around the given axis a given
7910 # number times and multi-translate each rotation result.
7911 # Rotation angle will be 2*PI/theNbTimes1.
7912 # Translation direction passes through center of gravity
7913 # of rotated shape and its projection on the rotation axis.
7914 # @param theObject The object to be rotated.
7915 # @param theAxis Rotation axis. DZ if None.
7916 # @param theNbTimes1 Quantity of rotations to be done.
7917 # @param theRadialStep Translation distance.
7918 # @param theNbTimes2 Quantity of translations to be done.
7919 # @param theName Object name; when specified, this parameter is used
7920 # for result publication in the study. Otherwise, if automatic
7921 # publication is switched on, default value is used for result name.
7923 # @return New GEOM.GEOM_Object, containing compound of all the
7924 # shapes, obtained after each transformation.
7926 # @ref tui_multi_rotation "Example"
7927 def MultiRotate2DNbTimes(self, theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
7929 Rotate the given object around the
7930 given axis on the given angle a given number
7931 times and multi-translate each rotation result.
7932 Translation direction passes through center of gravity
7933 of rotated shape and its projection on the rotation axis.
7936 theObject The object to be rotated.
7937 theAxis Rotation axis. DZ if None.
7938 theNbTimes1 Quantity of rotations to be done.
7939 theRadialStep Translation distance.
7940 theNbTimes2 Quantity of translations to be done.
7941 theName Object name; when specified, this parameter is used
7942 for result publication in the study. Otherwise, if automatic
7943 publication is switched on, default value is used for result name.
7946 New GEOM.GEOM_Object, containing compound of all the
7947 shapes, obtained after each transformation.
7950 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
7952 # Example: see GEOM_TestAll.py
7953 theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theNbTimes1, theRadialStep, theNbTimes2)
7954 anObj = self.TrsfOp.MultiRotate2DNbTimes(theObject, theAxis, theNbTimes1, theRadialStep, theNbTimes2)
7955 RaiseIfFailed("MultiRotate2DNbTimes", self.TrsfOp)
7956 anObj.SetParameters(Parameters)
7957 self._autoPublish(anObj, theName, "multirotation")
7960 ## Rotate the given object around the
7961 # given axis on the given angle a given number
7962 # times and multi-translate each rotation result.
7963 # Translation direction passes through center of gravity
7964 # of rotated shape and its projection on the rotation axis.
7965 # @param theObject The object to be rotated.
7966 # @param theAxis Rotation axis. DZ if None.
7967 # @param theAngleStep Rotation angle in radians.
7968 # @param theNbTimes1 Quantity of rotations to be done.
7969 # @param theRadialStep Translation distance.
7970 # @param theNbTimes2 Quantity of translations to be done.
7971 # @param theName Object name; when specified, this parameter is used
7972 # for result publication in the study. Otherwise, if automatic
7973 # publication is switched on, default value is used for result name.
7975 # @return New GEOM.GEOM_Object, containing compound of all the
7976 # shapes, obtained after each transformation.
7978 # @ref tui_multi_rotation "Example"
7979 def MultiRotate2DByStep (self, theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, theName=None):
7981 Rotate the given object around the
7982 given axis on the given angle a given number
7983 times and multi-translate each rotation result.
7984 Translation direction passes through center of gravity
7985 of rotated shape and its projection on the rotation axis.
7988 theObject The object to be rotated.
7989 theAxis Rotation axis. DZ if None.
7990 theAngleStep Rotation angle in radians.
7991 theNbTimes1 Quantity of rotations to be done.
7992 theRadialStep Translation distance.
7993 theNbTimes2 Quantity of translations to be done.
7994 theName Object name; when specified, this parameter is used
7995 for result publication in the study. Otherwise, if automatic
7996 publication is switched on, default value is used for result name.
7999 New GEOM.GEOM_Object, containing compound of all the
8000 shapes, obtained after each transformation.
8003 rot2d = geompy.MultiRotate2D(prism, vect, math.pi/3, 4, 50, 5)
8005 # Example: see GEOM_TestAll.py
8006 theAngleStep, theNbTimes1, theRadialStep, theNbTimes2, Parameters = ParseParameters(theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8007 anObj = self.TrsfOp.MultiRotate2DByStep(theObject, theAxis, theAngleStep, theNbTimes1, theRadialStep, theNbTimes2)
8008 RaiseIfFailed("MultiRotate2DByStep", self.TrsfOp)
8009 anObj.SetParameters(Parameters)
8010 self._autoPublish(anObj, theName, "multirotation")
8013 ## The same, as MultiRotate1DNbTimes(), but axis is given by direction and point
8015 # @ref swig_MakeMultiRotation "Example"
8016 def MakeMultiRotation1DNbTimes(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8018 The same, as geompy.MultiRotate1DNbTimes, but axis is given by direction and point
8021 pz = geompy.MakeVertex(0, 0, 100)
8022 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8023 MultiRot1D = geompy.MakeMultiRotation1DNbTimes(prism, vy, pz, 6)
8025 # Example: see GEOM_TestOthers.py
8026 aVec = self.MakeLine(aPoint,aDir)
8027 # note: auto-publishing is done in self.MultiRotate1D()
8028 anObj = self.MultiRotate1DNbTimes(aShape, aVec, aNbTimes, theName)
8031 ## The same, as MultiRotate1DByStep(), but axis is given by direction and point
8033 # @ref swig_MakeMultiRotation "Example"
8034 def MakeMultiRotation1DByStep(self, aShape, aDir, aPoint, anAngle, aNbTimes, theName=None):
8036 The same, as geompy.MultiRotate1D, but axis is given by direction and point
8039 pz = geompy.MakeVertex(0, 0, 100)
8040 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8041 MultiRot1D = geompy.MakeMultiRotation1DByStep(prism, vy, pz, math.pi/3, 6)
8043 # Example: see GEOM_TestOthers.py
8044 aVec = self.MakeLine(aPoint,aDir)
8045 # note: auto-publishing is done in self.MultiRotate1D()
8046 anObj = self.MultiRotate1DByStep(aShape, aVec, anAngle, aNbTimes, theName)
8049 ## The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8051 # @ref swig_MakeMultiRotation "Example"
8052 def MakeMultiRotation2DNbTimes(self, aShape, aDir, aPoint, nbtimes1, aStep, nbtimes2, theName=None):
8054 The same, as MultiRotate2DNbTimes(), but axis is given by direction and point
8057 pz = geompy.MakeVertex(0, 0, 100)
8058 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8059 MultiRot2D = geompy.MakeMultiRotation2DNbTimes(f12, vy, pz, 6, 30, 3)
8061 # Example: see GEOM_TestOthers.py
8062 aVec = self.MakeLine(aPoint,aDir)
8063 # note: auto-publishing is done in self.MultiRotate2DNbTimes()
8064 anObj = self.MultiRotate2DNbTimes(aShape, aVec, nbtimes1, aStep, nbtimes2, theName)
8067 ## The same, as MultiRotate2DByStep(), but axis is given by direction and point
8069 # @ref swig_MakeMultiRotation "Example"
8070 def MakeMultiRotation2DByStep(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8072 The same, as MultiRotate2DByStep(), but axis is given by direction and point
8075 pz = geompy.MakeVertex(0, 0, 100)
8076 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8077 MultiRot2D = geompy.MakeMultiRotation2DByStep(f12, vy, pz, math.pi/4, 6, 30, 3)
8079 # Example: see GEOM_TestOthers.py
8080 aVec = self.MakeLine(aPoint,aDir)
8081 # note: auto-publishing is done in self.MultiRotate2D()
8082 anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8085 # end of l3_transform
8088 ## @addtogroup l3_transform_d
8091 ## Deprecated method. Use MultiRotate1DNbTimes instead.
8092 def MultiRotate1D(self, theObject, theAxis, theNbTimes, theName=None):
8094 Deprecated method. Use MultiRotate1DNbTimes instead.
8096 print "The method MultiRotate1D is DEPRECATED. Use MultiRotate1DNbTimes instead."
8097 return self.MultiRotate1DNbTimes(theObject, theAxis, theNbTimes, theName)
8099 ## The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8100 # This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8101 def MultiRotate2D(self, theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2, theName=None):
8103 The same, as MultiRotate2DByStep(), but theAngle is in degrees.
8104 This method is DEPRECATED. Use MultiRotate2DByStep() instead.
8107 rot2d = geompy.MultiRotate2D(prism, vect, 60, 4, 50, 5)
8109 print "The method MultiRotate2D is DEPRECATED. Use MultiRotate2DByStep instead."
8110 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
8111 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
8112 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
8113 anObj.SetParameters(Parameters)
8114 self._autoPublish(anObj, theName, "multirotation")
8117 ## The same, as MultiRotate1D(), but axis is given by direction and point
8118 # This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8119 def MakeMultiRotation1D(self, aShape, aDir, aPoint, aNbTimes, theName=None):
8121 The same, as geompy.MultiRotate1D, but axis is given by direction and point.
8122 This method is DEPRECATED. Use MakeMultiRotation1DNbTimes instead.
8125 pz = geompy.MakeVertex(0, 0, 100)
8126 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8127 MultiRot1D = geompy.MakeMultiRotation1D(prism, vy, pz, 6)
8129 print "The method MakeMultiRotation1D is DEPRECATED. Use MakeMultiRotation1DNbTimes instead."
8130 aVec = self.MakeLine(aPoint,aDir)
8131 # note: auto-publishing is done in self.MultiRotate1D()
8132 anObj = self.MultiRotate1D(aShape, aVec, aNbTimes, theName)
8135 ## The same, as MultiRotate2D(), but axis is given by direction and point
8136 # This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8137 def MakeMultiRotation2D(self, aShape, aDir, aPoint, anAngle, nbtimes1, aStep, nbtimes2, theName=None):
8139 The same, as MultiRotate2D(), but axis is given by direction and point
8140 This method is DEPRECATED. Use MakeMultiRotation2DByStep instead.
8143 pz = geompy.MakeVertex(0, 0, 100)
8144 vy = geompy.MakeVectorDXDYDZ(0, 100, 0)
8145 MultiRot2D = geompy.MakeMultiRotation2D(f12, vy, pz, 45, 6, 30, 3)
8147 print "The method MakeMultiRotation2D is DEPRECATED. Use MakeMultiRotation2DByStep instead."
8148 aVec = self.MakeLine(aPoint,aDir)
8149 # note: auto-publishing is done in self.MultiRotate2D()
8150 anObj = self.MultiRotate2D(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
8153 # end of l3_transform_d
8156 ## @addtogroup l3_local
8159 ## Perform a fillet on all edges of the given shape.
8160 # @param theShape Shape, to perform fillet on.
8161 # @param theR Fillet radius.
8162 # @param theName Object name; when specified, this parameter is used
8163 # for result publication in the study. Otherwise, if automatic
8164 # publication is switched on, default value is used for result name.
8166 # @return New GEOM.GEOM_Object, containing the result shape.
8168 # @ref tui_fillet "Example 1"
8169 # \n @ref swig_MakeFilletAll "Example 2"
8170 def MakeFilletAll(self, theShape, theR, theName=None):
8172 Perform a fillet on all edges of the given shape.
8175 theShape Shape, to perform fillet on.
8177 theName Object name; when specified, this parameter is used
8178 for result publication in the study. Otherwise, if automatic
8179 publication is switched on, default value is used for result name.
8182 New GEOM.GEOM_Object, containing the result shape.
8185 filletall = geompy.MakeFilletAll(prism, 10.)
8187 # Example: see GEOM_TestOthers.py
8188 theR,Parameters = ParseParameters(theR)
8189 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
8190 RaiseIfFailed("MakeFilletAll", self.LocalOp)
8191 anObj.SetParameters(Parameters)
8192 self._autoPublish(anObj, theName, "fillet")
8195 ## Perform a fillet on the specified edges/faces of the given shape
8196 # @param theShape Shape, to perform fillet on.
8197 # @param theR Fillet radius.
8198 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR> (see ShapeType())
8199 # @param theListShapes Global indices of edges/faces to perform fillet on.
8200 # @param theName Object name; when specified, this parameter is used
8201 # for result publication in the study. Otherwise, if automatic
8202 # publication is switched on, default value is used for result name.
8204 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8206 # @return New GEOM.GEOM_Object, containing the result shape.
8208 # @ref tui_fillet "Example"
8209 def MakeFillet(self, theShape, theR, theShapeType, theListShapes, theName=None):
8211 Perform a fillet on the specified edges/faces of the given shape
8214 theShape Shape, to perform fillet on.
8216 theShapeType Type of shapes in theListShapes (see geompy.ShapeTypes)
8217 theListShapes Global indices of edges/faces to perform fillet on.
8218 theName Object name; when specified, this parameter is used
8219 for result publication in the study. Otherwise, if automatic
8220 publication is switched on, default value is used for result name.
8223 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8226 New GEOM.GEOM_Object, containing the result shape.
8229 # get the list of IDs (IDList) for the fillet
8230 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8232 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8233 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8234 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8235 # make a fillet on the specified edges of the given shape
8236 fillet = geompy.MakeFillet(prism, 10., geompy.ShapeType["EDGE"], IDlist_e)
8238 # Example: see GEOM_TestAll.py
8239 theR,Parameters = ParseParameters(theR)
8241 if theShapeType == ShapeType["EDGE"]:
8242 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
8243 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
8245 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
8246 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
8247 anObj.SetParameters(Parameters)
8248 self._autoPublish(anObj, theName, "fillet")
8251 ## The same that MakeFillet() but with two Fillet Radius R1 and R2
8252 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes, theName=None):
8254 The same that geompy.MakeFillet but with two Fillet Radius R1 and R2
8257 # get the list of IDs (IDList) for the fillet
8258 prism_edges = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["EDGE"])
8260 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
8261 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
8262 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[2]))
8263 # make a fillet on the specified edges of the given shape
8264 fillet = geompy.MakeFillet(prism, 10., 15., geompy.ShapeType["EDGE"], IDlist_e)
8266 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
8268 if theShapeType == ShapeType["EDGE"]:
8269 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
8270 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
8272 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
8273 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
8274 anObj.SetParameters(Parameters)
8275 self._autoPublish(anObj, theName, "fillet")
8278 ## Perform a fillet on the specified edges of the given shape
8279 # @param theShape Wire Shape to perform fillet on.
8280 # @param theR Fillet radius.
8281 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8282 # \note Global index of sub-shape can be obtained, using method GetSubShapeID()
8283 # \note The list of vertices could be empty,
8284 # in this case fillet will done done at all vertices in wire
8285 # @param doIgnoreSecantVertices If FALSE, fillet radius is always limited
8286 # by the length of the edges, nearest to the fillet vertex.
8287 # But sometimes the next edge is C1 continuous with the one, nearest to
8288 # the fillet point, and such two (or more) edges can be united to allow
8289 # bigger radius. Set this flag to TRUE to allow collinear edges union,
8290 # thus ignoring the secant vertex (vertices).
8291 # @param theName Object name; when specified, this parameter is used
8292 # for result publication in the study. Otherwise, if automatic
8293 # publication is switched on, default value is used for result name.
8295 # @return New GEOM.GEOM_Object, containing the result shape.
8297 # @ref tui_fillet2d "Example"
8298 def MakeFillet1D(self, theShape, theR, theListOfVertexes, doIgnoreSecantVertices = True, theName=None):
8300 Perform a fillet on the specified edges of the given shape
8303 theShape Wire Shape to perform fillet on.
8305 theListOfVertexes Global indices of vertexes to perform fillet on.
8306 doIgnoreSecantVertices If FALSE, fillet radius is always limited
8307 by the length of the edges, nearest to the fillet vertex.
8308 But sometimes the next edge is C1 continuous with the one, nearest to
8309 the fillet point, and such two (or more) edges can be united to allow
8310 bigger radius. Set this flag to TRUE to allow collinear edges union,
8311 thus ignoring the secant vertex (vertices).
8312 theName Object name; when specified, this parameter is used
8313 for result publication in the study. Otherwise, if automatic
8314 publication is switched on, default value is used for result name.
8316 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8318 The list of vertices could be empty,in this case fillet will done done at all vertices in wire
8321 New GEOM.GEOM_Object, containing the result shape.
8325 Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
8326 # make fillet at given wire vertices with giver radius
8327 Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
8329 # Example: see GEOM_TestAll.py
8330 theR,doIgnoreSecantVertices,Parameters = ParseParameters(theR,doIgnoreSecantVertices)
8331 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes, doIgnoreSecantVertices)
8332 RaiseIfFailed("MakeFillet1D", self.LocalOp)
8333 anObj.SetParameters(Parameters)
8334 self._autoPublish(anObj, theName, "fillet")
8337 ## Perform a fillet at the specified vertices of the given face/shell.
8338 # @param theShape Face or Shell shape to perform fillet on.
8339 # @param theR Fillet radius.
8340 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
8341 # @param theName Object name; when specified, this parameter is used
8342 # for result publication in the study. Otherwise, if automatic
8343 # publication is switched on, default value is used for result name.
8345 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8347 # @return New GEOM.GEOM_Object, containing the result shape.
8349 # @ref tui_fillet2d "Example"
8350 def MakeFillet2D(self, theShape, theR, theListOfVertexes, theName=None):
8352 Perform a fillet at the specified vertices of the given face/shell.
8355 theShape Face or Shell shape to perform fillet on.
8357 theListOfVertexes Global indices of vertexes to perform fillet on.
8358 theName Object name; when specified, this parameter is used
8359 for result publication in the study. Otherwise, if automatic
8360 publication is switched on, default value is used for result name.
8362 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8365 New GEOM.GEOM_Object, containing the result shape.
8368 face = geompy.MakeFaceHW(100, 100, 1)
8369 fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
8371 # Example: see GEOM_TestAll.py
8372 theR,Parameters = ParseParameters(theR)
8373 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
8374 RaiseIfFailed("MakeFillet2D", self.LocalOp)
8375 anObj.SetParameters(Parameters)
8376 self._autoPublish(anObj, theName, "fillet")
8379 ## Perform a symmetric chamfer on all edges of the given shape.
8380 # @param theShape Shape, to perform chamfer on.
8381 # @param theD Chamfer size along each face.
8382 # @param theName Object name; when specified, this parameter is used
8383 # for result publication in the study. Otherwise, if automatic
8384 # publication is switched on, default value is used for result name.
8386 # @return New GEOM.GEOM_Object, containing the result shape.
8388 # @ref tui_chamfer "Example 1"
8389 # \n @ref swig_MakeChamferAll "Example 2"
8390 def MakeChamferAll(self, theShape, theD, theName=None):
8392 Perform a symmetric chamfer on all edges of the given shape.
8395 theShape Shape, to perform chamfer on.
8396 theD Chamfer size along each face.
8397 theName Object name; when specified, this parameter is used
8398 for result publication in the study. Otherwise, if automatic
8399 publication is switched on, default value is used for result name.
8402 New GEOM.GEOM_Object, containing the result shape.
8405 chamfer_all = geompy.MakeChamferAll(prism, 10.)
8407 # Example: see GEOM_TestOthers.py
8408 theD,Parameters = ParseParameters(theD)
8409 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
8410 RaiseIfFailed("MakeChamferAll", self.LocalOp)
8411 anObj.SetParameters(Parameters)
8412 self._autoPublish(anObj, theName, "chamfer")
8415 ## Perform a chamfer on edges, common to the specified faces,
8416 # with distance D1 on the Face1
8417 # @param theShape Shape, to perform chamfer on.
8418 # @param theD1 Chamfer size along \a theFace1.
8419 # @param theD2 Chamfer size along \a theFace2.
8420 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8421 # @param theName Object name; when specified, this parameter is used
8422 # for result publication in the study. Otherwise, if automatic
8423 # publication is switched on, default value is used for result name.
8425 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8427 # @return New GEOM.GEOM_Object, containing the result shape.
8429 # @ref tui_chamfer "Example"
8430 def MakeChamferEdge(self, theShape, theD1, theD2, theFace1, theFace2, theName=None):
8432 Perform a chamfer on edges, common to the specified faces,
8433 with distance D1 on the Face1
8436 theShape Shape, to perform chamfer on.
8437 theD1 Chamfer size along theFace1.
8438 theD2 Chamfer size along theFace2.
8439 theFace1,theFace2 Global indices of two faces of theShape.
8440 theName Object name; when specified, this parameter is used
8441 for result publication in the study. Otherwise, if automatic
8442 publication is switched on, default value is used for result name.
8445 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8448 New GEOM.GEOM_Object, containing the result shape.
8451 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8452 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8453 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8454 chamfer_e = geompy.MakeChamferEdge(prism, 10., 10., f_ind_1, f_ind_2)
8456 # Example: see GEOM_TestAll.py
8457 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8458 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
8459 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
8460 anObj.SetParameters(Parameters)
8461 self._autoPublish(anObj, theName, "chamfer")
8464 ## Perform a chamfer on edges
8465 # @param theShape Shape, to perform chamfer on.
8466 # @param theD Chamfer length
8467 # @param theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8468 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
8469 # @param theName Object name; when specified, this parameter is used
8470 # for result publication in the study. Otherwise, if automatic
8471 # publication is switched on, default value is used for result name.
8473 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8475 # @return New GEOM.GEOM_Object, containing the result shape.
8476 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2, theName=None):
8478 Perform a chamfer on edges
8481 theShape Shape, to perform chamfer on.
8482 theD1 Chamfer size along theFace1.
8483 theAngle Angle of chamfer (angle in radians or a name of variable which defines angle in degrees).
8484 theFace1,theFace2 Global indices of two faces of theShape.
8485 theName Object name; when specified, this parameter is used
8486 for result publication in the study. Otherwise, if automatic
8487 publication is switched on, default value is used for result name.
8490 Global index of sub-shape can be obtained, using method geompy.GetSubShapeID
8493 New GEOM.GEOM_Object, containing the result shape.
8496 prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
8497 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
8498 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
8500 chamfer_e = geompy.MakeChamferEdge(prism, 10., ang, f_ind_1, f_ind_2)
8503 if isinstance(theAngle,str):
8505 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8507 theAngle = theAngle*math.pi/180.0
8508 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
8509 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
8510 anObj.SetParameters(Parameters)
8511 self._autoPublish(anObj, theName, "chamfer")
8514 ## Perform a chamfer on all edges of the specified faces,
8515 # with distance D1 on the first specified face (if several for one edge)
8516 # @param theShape Shape, to perform chamfer on.
8517 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
8518 # connected to the edge, are in \a theFaces, \a theD1
8519 # will be get along face, which is nearer to \a theFaces beginning.
8520 # @param theD2 Chamfer size along another of two faces, connected to the edge.
8521 # @param theFaces Sequence of global indices of faces of \a theShape.
8522 # @param theName Object name; when specified, this parameter is used
8523 # for result publication in the study. Otherwise, if automatic
8524 # publication is switched on, default value is used for result name.
8526 # @note Global index of sub-shape can be obtained, using method GetSubShapeID().
8528 # @return New GEOM.GEOM_Object, containing the result shape.
8530 # @ref tui_chamfer "Example"
8531 def MakeChamferFaces(self, theShape, theD1, theD2, theFaces, theName=None):
8533 Perform a chamfer on all edges of the specified faces,
8534 with distance D1 on the first specified face (if several for one edge)
8537 theShape Shape, to perform chamfer on.
8538 theD1 Chamfer size along face from theFaces. If both faces,
8539 connected to the edge, are in theFaces, theD1
8540 will be get along face, which is nearer to theFaces beginning.
8541 theD2 Chamfer size along another of two faces, connected to the edge.
8542 theFaces Sequence of global indices of faces of theShape.
8543 theName Object name; when specified, this parameter is used
8544 for result publication in the study. Otherwise, if automatic
8545 publication is switched on, default value is used for result name.
8547 Note: Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
8550 New GEOM.GEOM_Object, containing the result shape.
8552 # Example: see GEOM_TestAll.py
8553 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8554 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
8555 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
8556 anObj.SetParameters(Parameters)
8557 self._autoPublish(anObj, theName, "chamfer")
8560 ## The Same that 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)
8563 # @ref swig_FilletChamfer "Example"
8564 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces, theName=None):
8566 The Same that geompy.MakeChamferFaces but with params theD is chamfer lenght and
8567 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8570 if isinstance(theAngle,str):
8572 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8574 theAngle = theAngle*math.pi/180.0
8575 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
8576 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
8577 anObj.SetParameters(Parameters)
8578 self._autoPublish(anObj, theName, "chamfer")
8581 ## Perform a chamfer on edges,
8582 # with distance D1 on the first specified face (if several for one edge)
8583 # @param theShape Shape, to perform chamfer on.
8584 # @param theD1,theD2 Chamfer size
8585 # @param theEdges Sequence of edges of \a theShape.
8586 # @param theName Object name; when specified, this parameter is used
8587 # for result publication in the study. Otherwise, if automatic
8588 # publication is switched on, default value is used for result name.
8590 # @return New GEOM.GEOM_Object, containing the result shape.
8592 # @ref swig_FilletChamfer "Example"
8593 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges, theName=None):
8595 Perform a chamfer on edges,
8596 with distance D1 on the first specified face (if several for one edge)
8599 theShape Shape, to perform chamfer on.
8600 theD1,theD2 Chamfer size
8601 theEdges Sequence of edges of theShape.
8602 theName Object name; when specified, this parameter is used
8603 for result publication in the study. Otherwise, if automatic
8604 publication is switched on, default value is used for result name.
8607 New GEOM.GEOM_Object, containing the result shape.
8609 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
8610 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
8611 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
8612 anObj.SetParameters(Parameters)
8613 self._autoPublish(anObj, theName, "chamfer")
8616 ## The Same that MakeChamferEdges() but with params theD is chamfer lenght and
8617 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8618 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges, theName=None):
8620 The Same that geompy.MakeChamferEdges but with params theD is chamfer lenght and
8621 theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
8624 if isinstance(theAngle,str):
8626 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
8628 theAngle = theAngle*math.pi/180.0
8629 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
8630 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
8631 anObj.SetParameters(Parameters)
8632 self._autoPublish(anObj, theName, "chamfer")
8635 ## @sa MakeChamferEdge(), MakeChamferFaces()
8637 # @ref swig_MakeChamfer "Example"
8638 def MakeChamfer(self, aShape, d1, d2, aShapeType, ListShape, theName=None):
8640 See geompy.MakeChamferEdge() and geompy.MakeChamferFaces() functions for more information.
8642 # Example: see GEOM_TestOthers.py
8644 # note: auto-publishing is done in self.MakeChamferEdge() or self.MakeChamferFaces()
8645 if aShapeType == ShapeType["EDGE"]:
8646 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1],theName)
8648 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape,theName)
8651 ## Remove material from a solid by extrusion of the base shape on the given distance.
8652 # @param theInit Shape to remove material from. It must be a solid or
8653 # a compound made of a single solid.
8654 # @param theBase Closed edge or wire defining the base shape to be extruded.
8655 # @param theH Prism dimension along the normal to theBase
8656 # @param theAngle Draft angle in degrees.
8657 # @param theName Object name; when specified, this parameter is used
8658 # for result publication in the study. Otherwise, if automatic
8659 # publication is switched on, default value is used for result name.
8661 # @return New GEOM.GEOM_Object, containing the initial shape with removed material
8663 # @ref tui_creation_prism "Example"
8664 def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
8666 Add material to a solid by extrusion of the base shape on the given distance.
8669 theInit Shape to remove material from. It must be a solid or a compound made of a single solid.
8670 theBase Closed edge or wire defining the base shape to be extruded.
8671 theH Prism dimension along the normal to theBase
8672 theAngle Draft angle in degrees.
8673 theName Object name; when specified, this parameter is used
8674 for result publication in the study. Otherwise, if automatic
8675 publication is switched on, default value is used for result name.
8678 New GEOM.GEOM_Object, containing the initial shape with removed material.
8680 # Example: see GEOM_TestAll.py
8681 #theH,Parameters = ParseParameters(theH)
8682 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
8683 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8684 #anObj.SetParameters(Parameters)
8685 self._autoPublish(anObj, theName, "extrudedCut")
8688 ## Add material to a solid by extrusion of the base shape on the given distance.
8689 # @param theInit Shape to add material to. It must be a solid or
8690 # a compound made of a single solid.
8691 # @param theBase Closed edge or wire defining the base shape to be extruded.
8692 # @param theH Prism dimension along the normal to theBase
8693 # @param theAngle Draft angle in degrees.
8694 # @param theName Object name; when specified, this parameter is used
8695 # for result publication in the study. Otherwise, if automatic
8696 # publication is switched on, default value is used for result name.
8698 # @return New GEOM.GEOM_Object, containing the initial shape with added material
8700 # @ref tui_creation_prism "Example"
8701 def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
8703 Add material to a solid by extrusion of the base shape on the given distance.
8706 theInit Shape to add material to. It must be a solid or a compound made of a single solid.
8707 theBase Closed edge or wire defining the base shape to be extruded.
8708 theH Prism dimension along the normal to theBase
8709 theAngle Draft angle in degrees.
8710 theName Object name; when specified, this parameter is used
8711 for result publication in the study. Otherwise, if automatic
8712 publication is switched on, default value is used for result name.
8715 New GEOM.GEOM_Object, containing the initial shape with added material.
8717 # Example: see GEOM_TestAll.py
8718 #theH,Parameters = ParseParameters(theH)
8719 anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
8720 RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
8721 #anObj.SetParameters(Parameters)
8722 self._autoPublish(anObj, theName, "extrudedBoss")
8728 ## @addtogroup l3_basic_op
8731 ## Perform an Archimde operation on the given shape with given parameters.
8732 # The object presenting the resulting face is returned.
8733 # @param theShape Shape to be put in water.
8734 # @param theWeight Weight og the shape.
8735 # @param theWaterDensity Density of the water.
8736 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
8737 # @param theName Object name; when specified, this parameter is used
8738 # for result publication in the study. Otherwise, if automatic
8739 # publication is switched on, default value is used for result name.
8741 # @return New GEOM.GEOM_Object, containing a section of \a theShape
8742 # by a plane, corresponding to water level.
8744 # @ref tui_archimede "Example"
8745 def Archimede(self, theShape, theWeight, theWaterDensity, theMeshDeflection, theName=None):
8747 Perform an Archimde operation on the given shape with given parameters.
8748 The object presenting the resulting face is returned.
8751 theShape Shape to be put in water.
8752 theWeight Weight og the shape.
8753 theWaterDensity Density of the water.
8754 theMeshDeflection Deflection of the mesh, using to compute the section.
8755 theName Object name; when specified, this parameter is used
8756 for result publication in the study. Otherwise, if automatic
8757 publication is switched on, default value is used for result name.
8760 New GEOM.GEOM_Object, containing a section of theShape
8761 by a plane, corresponding to water level.
8763 # Example: see GEOM_TestAll.py
8764 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
8765 theWeight,theWaterDensity,theMeshDeflection)
8766 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
8767 RaiseIfFailed("MakeArchimede", self.LocalOp)
8768 anObj.SetParameters(Parameters)
8769 self._autoPublish(anObj, theName, "archimede")
8772 # end of l3_basic_op
8775 ## @addtogroup l2_measure
8778 ## Get point coordinates
8781 # @ref tui_measurement_tools_page "Example"
8782 def PointCoordinates(self,Point):
8784 Get point coordinates
8789 # Example: see GEOM_TestMeasures.py
8790 aTuple = self.MeasuOp.PointCoordinates(Point)
8791 RaiseIfFailed("PointCoordinates", self.MeasuOp)
8794 ## Get vector coordinates
8797 # @ref tui_measurement_tools_page "Example"
8798 def VectorCoordinates(self,Vector):
8800 Get vector coordinates
8806 p1=self.GetFirstVertex(Vector)
8807 p2=self.GetLastVertex(Vector)
8809 X1=self.PointCoordinates(p1)
8810 X2=self.PointCoordinates(p2)
8812 return (X2[0]-X1[0],X2[1]-X1[1],X2[2]-X1[2])
8815 ## Compute cross product
8816 # @return vector w=u^v
8818 # @ref tui_measurement_tools_page "Example"
8819 def CrossProduct(self, Vector1, Vector2):
8821 Compute cross product
8823 Returns: vector w=u^v
8825 u=self.VectorCoordinates(Vector1)
8826 v=self.VectorCoordinates(Vector2)
8827 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])
8831 ## Compute cross product
8832 # @return dot product p=u.v
8834 # @ref tui_measurement_tools_page "Example"
8835 def DotProduct(self, Vector1, Vector2):
8837 Compute cross product
8839 Returns: dot product p=u.v
8841 u=self.VectorCoordinates(Vector1)
8842 v=self.VectorCoordinates(Vector2)
8843 p=u[0]*v[0]+u[1]*v[1]+u[2]*v[2]
8848 ## Get summarized length of all wires,
8849 # area of surface and volume of the given shape.
8850 # @param theShape Shape to define properties of.
8851 # @return [theLength, theSurfArea, theVolume]\n
8852 # theLength: Summarized length of all wires of the given shape.\n
8853 # theSurfArea: Area of surface of the given shape.\n
8854 # theVolume: Volume of the given shape.
8856 # @ref tui_measurement_tools_page "Example"
8857 def BasicProperties(self,theShape):
8859 Get summarized length of all wires,
8860 area of surface and volume of the given shape.
8863 theShape Shape to define properties of.
8866 [theLength, theSurfArea, theVolume]
8867 theLength: Summarized length of all wires of the given shape.
8868 theSurfArea: Area of surface of the given shape.
8869 theVolume: Volume of the given shape.
8871 # Example: see GEOM_TestMeasures.py
8872 aTuple = self.MeasuOp.GetBasicProperties(theShape)
8873 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
8876 ## Get parameters of bounding box of the given shape
8877 # @param theShape Shape to obtain bounding box of.
8878 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
8879 # Xmin,Xmax: Limits of shape along OX axis.
8880 # Ymin,Ymax: Limits of shape along OY axis.
8881 # Zmin,Zmax: Limits of shape along OZ axis.
8883 # @ref tui_measurement_tools_page "Example"
8884 def BoundingBox (self, theShape):
8886 Get parameters of bounding box of the given shape
8889 theShape Shape to obtain bounding box of.
8892 [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
8893 Xmin,Xmax: Limits of shape along OX axis.
8894 Ymin,Ymax: Limits of shape along OY axis.
8895 Zmin,Zmax: Limits of shape along OZ axis.
8897 # Example: see GEOM_TestMeasures.py
8898 aTuple = self.MeasuOp.GetBoundingBox(theShape)
8899 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
8902 ## Get bounding box of the given shape
8903 # @param theShape Shape to obtain bounding box of.
8904 # @param theName Object name; when specified, this parameter is used
8905 # for result publication in the study. Otherwise, if automatic
8906 # publication is switched on, default value is used for result name.
8908 # @return New GEOM.GEOM_Object, containing the created box.
8910 # @ref tui_measurement_tools_page "Example"
8911 def MakeBoundingBox (self, theShape, theName=None):
8913 Get bounding box of the given shape
8916 theShape Shape to obtain bounding box of.
8917 theName Object name; when specified, this parameter is used
8918 for result publication in the study. Otherwise, if automatic
8919 publication is switched on, default value is used for result name.
8922 New GEOM.GEOM_Object, containing the created box.
8924 # Example: see GEOM_TestMeasures.py
8925 anObj = self.MeasuOp.MakeBoundingBox(theShape)
8926 RaiseIfFailed("MakeBoundingBox", self.MeasuOp)
8927 self._autoPublish(anObj, theName, "bndbox")
8930 ## Get inertia matrix and moments of inertia of theShape.
8931 # @param theShape Shape to calculate inertia of.
8932 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
8933 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
8934 # Ix,Iy,Iz: Moments of inertia of the given shape.
8936 # @ref tui_measurement_tools_page "Example"
8937 def Inertia(self,theShape):
8939 Get inertia matrix and moments of inertia of theShape.
8942 theShape Shape to calculate inertia of.
8945 [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
8946 I(1-3)(1-3): Components of the inertia matrix of the given shape.
8947 Ix,Iy,Iz: Moments of inertia of the given shape.
8949 # Example: see GEOM_TestMeasures.py
8950 aTuple = self.MeasuOp.GetInertia(theShape)
8951 RaiseIfFailed("GetInertia", self.MeasuOp)
8954 ## Get if coords are included in the shape (ST_IN or ST_ON)
8955 # @param theShape Shape
8956 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
8957 # @param tolerance to be used (default is 1.0e-7)
8958 # @return list_of_boolean = [res1, res2, ...]
8959 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
8961 Get if coords are included in the shape (ST_IN or ST_ON)
8965 coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
8966 tolerance to be used (default is 1.0e-7)
8969 list_of_boolean = [res1, res2, ...]
8971 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
8973 ## Get minimal distance between the given shapes.
8974 # @param theShape1,theShape2 Shapes to find minimal distance between.
8975 # @return Value of the minimal distance between the given shapes.
8977 # @ref tui_measurement_tools_page "Example"
8978 def MinDistance(self, theShape1, theShape2):
8980 Get minimal distance between the given shapes.
8983 theShape1,theShape2 Shapes to find minimal distance between.
8986 Value of the minimal distance between the given shapes.
8988 # Example: see GEOM_TestMeasures.py
8989 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
8990 RaiseIfFailed("GetMinDistance", self.MeasuOp)
8993 ## Get minimal distance between the given shapes.
8994 # @param theShape1,theShape2 Shapes to find minimal distance between.
8995 # @return Value of the minimal distance between the given shapes, in form of list
8996 # [Distance, DX, DY, DZ].
8998 # @ref swig_all_measure "Example"
8999 def MinDistanceComponents(self, theShape1, theShape2):
9001 Get minimal distance between the given shapes.
9004 theShape1,theShape2 Shapes to find minimal distance between.
9007 Value of the minimal distance between the given shapes, in form of list
9008 [Distance, DX, DY, DZ]
9010 # Example: see GEOM_TestMeasures.py
9011 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
9012 RaiseIfFailed("GetMinDistance", self.MeasuOp)
9013 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
9016 ## Get closest points of the given shapes.
9017 # @param theShape1,theShape2 Shapes to find closest points of.
9018 # @return The number of found solutions (-1 in case of infinite number of
9019 # solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9021 # @ref tui_measurement_tools_page "Example"
9022 def ClosestPoints (self, theShape1, theShape2):
9024 Get closest points of the given shapes.
9027 theShape1,theShape2 Shapes to find closest points of.
9030 The number of found solutions (-1 in case of infinite number of
9031 solutions) and a list of (X, Y, Z) coordinates for all couples of points.
9033 # Example: see GEOM_TestMeasures.py
9034 aTuple = self.MeasuOp.ClosestPoints(theShape1, theShape2)
9035 RaiseIfFailed("ClosestPoints", self.MeasuOp)
9038 ## Get angle between the given shapes in degrees.
9039 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9040 # @note If both arguments are vectors, the angle is computed in accordance
9041 # with their orientations, otherwise the minimum angle is computed.
9042 # @return Value of the angle between the given shapes in degrees.
9044 # @ref tui_measurement_tools_page "Example"
9045 def GetAngle(self, theShape1, theShape2):
9047 Get angle between the given shapes in degrees.
9050 theShape1,theShape2 Lines or linear edges to find angle between.
9053 If both arguments are vectors, the angle is computed in accordance
9054 with their orientations, otherwise the minimum angle is computed.
9057 Value of the angle between the given shapes in degrees.
9059 # Example: see GEOM_TestMeasures.py
9060 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
9061 RaiseIfFailed("GetAngle", self.MeasuOp)
9064 ## Get angle between the given shapes in radians.
9065 # @param theShape1,theShape2 Lines or linear edges to find angle between.
9066 # @note If both arguments are vectors, the angle is computed in accordance
9067 # with their orientations, otherwise the minimum angle is computed.
9068 # @return Value of the angle between the given shapes in radians.
9070 # @ref tui_measurement_tools_page "Example"
9071 def GetAngleRadians(self, theShape1, theShape2):
9073 Get angle between the given shapes in radians.
9076 theShape1,theShape2 Lines or linear edges to find angle between.
9080 If both arguments are vectors, the angle is computed in accordance
9081 with their orientations, otherwise the minimum angle is computed.
9084 Value of the angle between the given shapes in radians.
9086 # Example: see GEOM_TestMeasures.py
9087 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
9088 RaiseIfFailed("GetAngle", self.MeasuOp)
9091 ## Get angle between the given vectors in degrees.
9092 # @param theShape1,theShape2 Vectors to find angle between.
9093 # @param theFlag If True, the normal vector is defined by the two vectors cross,
9094 # if False, the opposite vector to the normal vector is used.
9095 # @return Value of the angle between the given vectors in degrees.
9097 # @ref tui_measurement_tools_page "Example"
9098 def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
9100 Get angle between the given vectors in degrees.
9103 theShape1,theShape2 Vectors to find angle between.
9104 theFlag If True, the normal vector is defined by the two vectors cross,
9105 if False, the opposite vector to the normal vector is used.
9108 Value of the angle between the given vectors in degrees.
9110 anAngle = self.MeasuOp.GetAngleBtwVectors(theShape1, theShape2)
9112 anAngle = 360. - anAngle
9113 RaiseIfFailed("GetAngleVectors", self.MeasuOp)
9116 ## The same as GetAngleVectors, but the result is in radians.
9117 def GetAngleRadiansVectors(self, theShape1, theShape2, theFlag = True):
9119 Get angle between the given vectors in radians.
9122 theShape1,theShape2 Vectors to find angle between.
9123 theFlag If True, the normal vector is defined by the two vectors cross,
9124 if False, the opposite vector to the normal vector is used.
9127 Value of the angle between the given vectors in radians.
9129 anAngle = self.GetAngleVectors(theShape1, theShape2, theFlag)*math.pi/180.
9132 ## @name Curve Curvature Measurement
9133 # Methods for receiving radius of curvature of curves
9134 # in the given point
9137 ## Measure curvature of a curve at a point, set by parameter.
9138 # @param theCurve a curve.
9139 # @param theParam parameter.
9140 # @return radius of curvature of \a theCurve.
9142 # @ref swig_todo "Example"
9143 def CurveCurvatureByParam(self, theCurve, theParam):
9145 Measure curvature of a curve at a point, set by parameter.
9152 radius of curvature of theCurve.
9154 # Example: see GEOM_TestMeasures.py
9155 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
9156 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
9159 ## Measure curvature of a curve at a point.
9160 # @param theCurve a curve.
9161 # @param thePoint given point.
9162 # @return radius of curvature of \a theCurve.
9164 # @ref swig_todo "Example"
9165 def CurveCurvatureByPoint(self, theCurve, thePoint):
9167 Measure curvature of a curve at a point.
9171 thePoint given point.
9174 radius of curvature of theCurve.
9176 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
9177 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
9181 ## @name Surface Curvature Measurement
9182 # Methods for receiving max and min radius of curvature of surfaces
9183 # in the given point
9186 ## Measure max radius of curvature of surface.
9187 # @param theSurf the given surface.
9188 # @param theUParam Value of U-parameter on the referenced surface.
9189 # @param theVParam Value of V-parameter on the referenced surface.
9190 # @return max radius of curvature of theSurf.
9192 ## @ref swig_todo "Example"
9193 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9195 Measure max radius of curvature of surface.
9198 theSurf the given surface.
9199 theUParam Value of U-parameter on the referenced surface.
9200 theVParam Value of V-parameter on the referenced surface.
9203 max radius of curvature of theSurf.
9205 # Example: see GEOM_TestMeasures.py
9206 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9207 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
9210 ## Measure max radius of curvature of surface in the given point
9211 # @param theSurf the given surface.
9212 # @param thePoint given point.
9213 # @return max radius of curvature of theSurf.
9215 ## @ref swig_todo "Example"
9216 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
9218 Measure max radius of curvature of surface in the given point.
9221 theSurf the given surface.
9222 thePoint given point.
9225 max radius of curvature of theSurf.
9227 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
9228 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
9231 ## Measure min radius of curvature of surface.
9232 # @param theSurf the given surface.
9233 # @param theUParam Value of U-parameter on the referenced surface.
9234 # @param theVParam Value of V-parameter on the referenced surface.
9235 # @return min radius of curvature of theSurf.
9237 ## @ref swig_todo "Example"
9238 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
9240 Measure min radius of curvature of surface.
9243 theSurf the given surface.
9244 theUParam Value of U-parameter on the referenced surface.
9245 theVParam Value of V-parameter on the referenced surface.
9248 Min radius of curvature of theSurf.
9250 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
9251 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
9254 ## Measure min radius of curvature of surface in the given point
9255 # @param theSurf the given surface.
9256 # @param thePoint given point.
9257 # @return min radius of curvature of theSurf.
9259 ## @ref swig_todo "Example"
9260 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
9262 Measure min radius of curvature of surface in the given point.
9265 theSurf the given surface.
9266 thePoint given point.
9269 Min radius of curvature of theSurf.
9271 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
9272 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
9276 ## Get min and max tolerances of sub-shapes of theShape
9277 # @param theShape Shape, to get tolerances of.
9278 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]\n
9279 # FaceMin,FaceMax: Min and max tolerances of the faces.\n
9280 # EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
9281 # VertMin,VertMax: Min and max tolerances of the vertices.
9283 # @ref tui_measurement_tools_page "Example"
9284 def Tolerance(self,theShape):
9286 Get min and max tolerances of sub-shapes of theShape
9289 theShape Shape, to get tolerances of.
9292 [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
9293 FaceMin,FaceMax: Min and max tolerances of the faces.
9294 EdgeMin,EdgeMax: Min and max tolerances of the edges.
9295 VertMin,VertMax: Min and max tolerances of the vertices.
9297 # Example: see GEOM_TestMeasures.py
9298 aTuple = self.MeasuOp.GetTolerance(theShape)
9299 RaiseIfFailed("GetTolerance", self.MeasuOp)
9302 ## Obtain description of the given shape (number of sub-shapes of each type)
9303 # @param theShape Shape to be described.
9304 # @return Description of the given shape.
9306 # @ref tui_measurement_tools_page "Example"
9307 def WhatIs(self,theShape):
9309 Obtain description of the given shape (number of sub-shapes of each type)
9312 theShape Shape to be described.
9315 Description of the given shape.
9317 # Example: see GEOM_TestMeasures.py
9318 aDescr = self.MeasuOp.WhatIs(theShape)
9319 RaiseIfFailed("WhatIs", self.MeasuOp)
9322 ## Obtain quantity of shapes of the given type in \a theShape.
9323 # If \a theShape is of type \a theType, it is also counted.
9324 # @param theShape Shape to be described.
9325 # @param theType the given ShapeType().
9326 # @return Quantity of shapes of type \a theType in \a theShape.
9328 # @ref tui_measurement_tools_page "Example"
9329 def NbShapes (self, theShape, theType):
9331 Obtain quantity of shapes of the given type in theShape.
9332 If theShape is of type theType, it is also counted.
9335 theShape Shape to be described.
9336 theType the given geompy.ShapeType
9339 Quantity of shapes of type theType in theShape.
9341 # Example: see GEOM_TestMeasures.py
9342 listSh = self.SubShapeAllIDs(theShape, theType)
9344 t = EnumToLong(theShape.GetShapeType())
9345 theType = EnumToLong(theType)
9351 ## Obtain quantity of shapes of each type in \a theShape.
9352 # The \a theShape is also counted.
9353 # @param theShape Shape to be described.
9354 # @return Dictionary of ShapeType() with bound quantities of shapes.
9356 # @ref tui_measurement_tools_page "Example"
9357 def ShapeInfo (self, theShape):
9359 Obtain quantity of shapes of each type in theShape.
9360 The theShape is also counted.
9363 theShape Shape to be described.
9366 Dictionary of geompy.ShapeType with bound quantities of shapes.
9368 # Example: see GEOM_TestMeasures.py
9370 for typeSh in ShapeType:
9371 if typeSh in ( "AUTO", "SHAPE" ): continue
9372 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
9374 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
9381 ## Get a point, situated at the centre of mass of theShape.
9382 # @param theShape Shape to define centre of mass of.
9383 # @param theName Object name; when specified, this parameter is used
9384 # for result publication in the study. Otherwise, if automatic
9385 # publication is switched on, default value is used for result name.
9387 # @return New GEOM.GEOM_Object, containing the created point.
9389 # @ref tui_measurement_tools_page "Example"
9390 def MakeCDG(self, theShape, theName=None):
9392 Get a point, situated at the centre of mass of theShape.
9395 theShape Shape to define centre of mass of.
9396 theName Object name; when specified, this parameter is used
9397 for result publication in the study. Otherwise, if automatic
9398 publication is switched on, default value is used for result name.
9401 New GEOM.GEOM_Object, containing the created point.
9403 # Example: see GEOM_TestMeasures.py
9404 anObj = self.MeasuOp.GetCentreOfMass(theShape)
9405 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
9406 self._autoPublish(anObj, theName, "centerOfMass")
9409 ## Get a vertex sub-shape by index depended with orientation.
9410 # @param theShape Shape to find sub-shape.
9411 # @param theIndex Index to find vertex by this index (starting from zero)
9412 # @param theName Object name; when specified, this parameter is used
9413 # for result publication in the study. Otherwise, if automatic
9414 # publication is switched on, default value is used for result name.
9416 # @return New GEOM.GEOM_Object, containing the created vertex.
9418 # @ref tui_measurement_tools_page "Example"
9419 def GetVertexByIndex(self, theShape, theIndex, theName=None):
9421 Get a vertex sub-shape by index depended with orientation.
9424 theShape Shape to find sub-shape.
9425 theIndex Index to find vertex by this index (starting from zero)
9426 theName Object name; when specified, this parameter is used
9427 for result publication in the study. Otherwise, if automatic
9428 publication is switched on, default value is used for result name.
9431 New GEOM.GEOM_Object, containing the created vertex.
9433 # Example: see GEOM_TestMeasures.py
9434 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
9435 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
9436 self._autoPublish(anObj, theName, "vertex")
9439 ## Get the first vertex of wire/edge depended orientation.
9440 # @param theShape Shape to find first vertex.
9441 # @param theName Object name; when specified, this parameter is used
9442 # for result publication in the study. Otherwise, if automatic
9443 # publication is switched on, default value is used for result name.
9445 # @return New GEOM.GEOM_Object, containing the created vertex.
9447 # @ref tui_measurement_tools_page "Example"
9448 def GetFirstVertex(self, theShape, theName=None):
9450 Get the first vertex of wire/edge depended orientation.
9453 theShape Shape to find first vertex.
9454 theName Object name; when specified, this parameter is used
9455 for result publication in the study. Otherwise, if automatic
9456 publication is switched on, default value is used for result name.
9459 New GEOM.GEOM_Object, containing the created vertex.
9461 # Example: see GEOM_TestMeasures.py
9462 # note: auto-publishing is done in self.GetVertexByIndex()
9463 anObj = self.GetVertexByIndex(theShape, 0, theName)
9464 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
9467 ## Get the last vertex of wire/edge depended orientation.
9468 # @param theShape Shape to find last vertex.
9469 # @param theName Object name; when specified, this parameter is used
9470 # for result publication in the study. Otherwise, if automatic
9471 # publication is switched on, default value is used for result name.
9473 # @return New GEOM.GEOM_Object, containing the created vertex.
9475 # @ref tui_measurement_tools_page "Example"
9476 def GetLastVertex(self, theShape, theName=None):
9478 Get the last vertex of wire/edge depended orientation.
9481 theShape Shape to find last vertex.
9482 theName Object name; when specified, this parameter is used
9483 for result publication in the study. Otherwise, if automatic
9484 publication is switched on, default value is used for result name.
9487 New GEOM.GEOM_Object, containing the created vertex.
9489 # Example: see GEOM_TestMeasures.py
9490 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
9491 # note: auto-publishing is done in self.GetVertexByIndex()
9492 anObj = self.GetVertexByIndex(theShape, (nb_vert-1), theName)
9493 RaiseIfFailed("GetLastVertex", self.MeasuOp)
9496 ## Get a normale to the given face. If the point is not given,
9497 # the normale is calculated at the center of mass.
9498 # @param theFace Face to define normale of.
9499 # @param theOptionalPoint Point to compute the normale at.
9500 # @param theName Object name; when specified, this parameter is used
9501 # for result publication in the study. Otherwise, if automatic
9502 # publication is switched on, default value is used for result name.
9504 # @return New GEOM.GEOM_Object, containing the created vector.
9506 # @ref swig_todo "Example"
9507 def GetNormal(self, theFace, theOptionalPoint = None, theName=None):
9509 Get a normale to the given face. If the point is not given,
9510 the normale is calculated at the center of mass.
9513 theFace Face to define normale of.
9514 theOptionalPoint Point to compute the normale at.
9515 theName Object name; when specified, this parameter is used
9516 for result publication in the study. Otherwise, if automatic
9517 publication is switched on, default value is used for result name.
9520 New GEOM.GEOM_Object, containing the created vector.
9522 # Example: see GEOM_TestMeasures.py
9523 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
9524 RaiseIfFailed("GetNormal", self.MeasuOp)
9525 self._autoPublish(anObj, theName, "normal")
9528 ## Check a topology of the given shape.
9529 # @param theShape Shape to check validity of.
9530 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
9531 # if TRUE, the shape's geometry will be checked also.
9532 # @param theReturnStatus If FALSE and if theShape is invalid, a description \n
9533 # of problem is printed.
9534 # if TRUE and if theShape is invalid, the description
9535 # of problem is also returned.
9536 # @return TRUE, if the shape "seems to be valid".
9538 # @ref tui_measurement_tools_page "Example"
9539 def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
9541 Check a topology of the given shape.
9544 theShape Shape to check validity of.
9545 theIsCheckGeom If FALSE, only the shape's topology will be checked,
9546 if TRUE, the shape's geometry will be checked also.
9547 theReturnStatus If FALSE and if theShape is invalid, a description
9548 of problem is printed.
9549 if TRUE and if theShape is invalid, the description
9550 of problem is returned.
9553 TRUE, if the shape "seems to be valid".
9554 If theShape is invalid, prints a description of problem.
9555 This description can also be returned.
9557 # Example: see GEOM_TestMeasures.py
9559 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
9560 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
9562 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
9563 RaiseIfFailed("CheckShape", self.MeasuOp)
9565 if theReturnStatus == 0:
9567 if theReturnStatus == 1:
9568 return (IsValid, Status)
9571 ## Detect self-intersections in the given shape.
9572 # @param theShape Shape to check.
9573 # @return TRUE, if the shape contains no self-intersections.
9575 # @ref tui_measurement_tools_page "Example"
9576 def CheckSelfIntersections(self, theShape):
9578 Detect self-intersections in the given shape.
9581 theShape Shape to check.
9584 TRUE, if the shape contains no self-intersections.
9586 # Example: see GEOM_TestMeasures.py
9587 (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
9588 RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
9591 ## Get position (LCS) of theShape.
9593 # Origin of the LCS is situated at the shape's center of mass.
9594 # Axes of the LCS are obtained from shape's location or,
9595 # if the shape is a planar face, from position of its plane.
9597 # @param theShape Shape to calculate position of.
9598 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9599 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
9600 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9601 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9603 # @ref swig_todo "Example"
9604 def GetPosition(self,theShape):
9606 Get position (LCS) of theShape.
9607 Origin of the LCS is situated at the shape's center of mass.
9608 Axes of the LCS are obtained from shape's location or,
9609 if the shape is a planar face, from position of its plane.
9612 theShape Shape to calculate position of.
9615 [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
9616 Ox,Oy,Oz: Coordinates of shape's LCS origin.
9617 Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
9618 Xx,Xy,Xz: Coordinates of shape's LCS X direction.
9620 # Example: see GEOM_TestMeasures.py
9621 aTuple = self.MeasuOp.GetPosition(theShape)
9622 RaiseIfFailed("GetPosition", self.MeasuOp)
9625 ## Get kind of theShape.
9627 # @param theShape Shape to get a kind of.
9628 # @return Returns a kind of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
9629 # and a list of parameters, describing the shape.
9630 # @note Concrete meaning of each value, returned via \a theIntegers
9631 # or \a theDoubles list depends on the kind() of the shape.
9633 # @ref swig_todo "Example"
9634 def KindOfShape(self,theShape):
9636 Get kind of theShape.
9639 theShape Shape to get a kind of.
9642 a kind of shape in terms of GEOM_IKindOfShape.shape_kind enumeration
9643 and a list of parameters, describing the shape.
9645 Concrete meaning of each value, returned via theIntegers
9646 or theDoubles list depends on the geompy.kind of the shape
9648 # Example: see GEOM_TestMeasures.py
9649 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
9650 RaiseIfFailed("KindOfShape", self.MeasuOp)
9652 aKind = aRoughTuple[0]
9653 anInts = aRoughTuple[1]
9654 aDbls = aRoughTuple[2]
9656 # Now there is no exception from this rule:
9657 aKindTuple = [aKind] + aDbls + anInts
9659 # If they are we will regroup parameters for such kind of shape.
9661 #if aKind == kind.SOME_KIND:
9662 # # SOME_KIND int int double int double double
9663 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
9670 ## @addtogroup l2_import_export
9673 ## Import a shape from the BREP or IGES or STEP file
9674 # (depends on given format) with given name.
9675 # @param theFileName The file, containing the shape.
9676 # @param theFormatName Specify format for the file reading.
9677 # Available formats can be obtained with InsertOp.ImportTranslators() method.
9678 # If format 'IGES_SCALE' is used instead of 'IGES' or
9679 # format 'STEP_SCALE' is used instead of 'STEP',
9680 # length unit will be set to 'meter' and result model will be scaled.
9681 # @param theName Object name; when specified, this parameter is used
9682 # for result publication in the study. Otherwise, if automatic
9683 # publication is switched on, default value is used for result name.
9685 # @return New GEOM.GEOM_Object, containing the imported shape.
9687 # @ref swig_Import_Export "Example"
9688 def ImportFile(self, theFileName, theFormatName, theName=None):
9690 Import a shape from the BREP or IGES or STEP file
9691 (depends on given format) with given name.
9694 theFileName The file, containing the shape.
9695 theFormatName Specify format for the file reading.
9696 Available formats can be obtained with geompy.InsertOp.ImportTranslators() method.
9697 If format 'IGES_SCALE' is used instead of 'IGES' or
9698 format 'STEP_SCALE' is used instead of 'STEP',
9699 length unit will be set to 'meter' and result model will be scaled.
9700 theName Object name; when specified, this parameter is used
9701 for result publication in the study. Otherwise, if automatic
9702 publication is switched on, default value is used for result name.
9705 New GEOM.GEOM_Object, containing the imported shape.
9707 # Example: see GEOM_TestOthers.py
9708 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
9709 RaiseIfFailed("ImportFile", self.InsertOp)
9710 self._autoPublish(anObj, theName, "imported")
9713 ## Deprecated analog of ImportFile()
9714 def Import(self, theFileName, theFormatName, theName=None):
9716 Deprecated analog of geompy.ImportFile, kept for backward compatibility only.
9718 print "WARNING: Function Import is deprecated, use ImportFile instead"
9719 # note: auto-publishing is done in self.ImportFile()
9720 return self.ImportFile(theFileName, theFormatName, theName)
9722 ## Shortcut to ImportFile() for BREP format.
9723 # Import a shape from the BREP file with given name.
9724 # @param theFileName The file, containing the shape.
9725 # @param theName Object name; when specified, this parameter is used
9726 # for result publication in the study. Otherwise, if automatic
9727 # publication is switched on, default value is used for result name.
9729 # @return New GEOM.GEOM_Object, containing the imported shape.
9731 # @ref swig_Import_Export "Example"
9732 def ImportBREP(self, theFileName, theName=None):
9734 geompy.ImportFile(...) function for BREP format
9735 Import a shape from the BREP file with given name.
9738 theFileName The file, containing the shape.
9739 theName Object name; when specified, this parameter is used
9740 for result publication in the study. Otherwise, if automatic
9741 publication is switched on, default value is used for result name.
9744 New GEOM.GEOM_Object, containing the imported shape.
9746 # Example: see GEOM_TestOthers.py
9747 # note: auto-publishing is done in self.ImportFile()
9748 return self.ImportFile(theFileName, "BREP", theName)
9750 ## Shortcut to ImportFile() for IGES format
9751 # Import a shape from the IGES file with given name.
9752 # @param theFileName The file, containing the shape.
9753 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9754 # and result model will be scaled, if its units are not meters.
9755 # If False (default), file length units will be taken into account.
9756 # @param theName Object name; when specified, this parameter is used
9757 # for result publication in the study. Otherwise, if automatic
9758 # publication is switched on, default value is used for result name.
9760 # @return New GEOM.GEOM_Object, containing the imported shape.
9762 # @ref swig_Import_Export "Example"
9763 def ImportIGES(self, theFileName, ignoreUnits = False, theName=None):
9765 geompy.ImportFile(...) function for IGES format
9768 theFileName The file, containing the shape.
9769 ignoreUnits If True, file length units will be ignored (set to 'meter')
9770 and result model will be scaled, if its units are not meters.
9771 If False (default), file length units will be taken into account.
9772 theName Object name; when specified, this parameter is used
9773 for result publication in the study. Otherwise, if automatic
9774 publication is switched on, default value is used for result name.
9777 New GEOM.GEOM_Object, containing the imported shape.
9779 # Example: see GEOM_TestOthers.py
9780 # note: auto-publishing is done in self.ImportFile()
9782 return self.ImportFile(theFileName, "IGES_SCALE", theName)
9783 return self.ImportFile(theFileName, "IGES", theName)
9785 ## Return length unit from given IGES file
9786 # @param theFileName The file, containing the shape.
9787 # @return String, containing the units name.
9789 # @ref swig_Import_Export "Example"
9790 def GetIGESUnit(self, theFileName):
9792 Return length units from given IGES file
9795 theFileName The file, containing the shape.
9798 String, containing the units name.
9800 # Example: see GEOM_TestOthers.py
9801 aUnitName = self.InsertOp.ReadValue(theFileName, "IGES", "LEN_UNITS")
9804 ## Shortcut to ImportFile() for STEP format
9805 # Import a shape from the STEP file with given name.
9806 # @param theFileName The file, containing the shape.
9807 # @param ignoreUnits If True, file length units will be ignored (set to 'meter')
9808 # and result model will be scaled, if its units are not meters.
9809 # If False (default), file length units will be taken into account.
9810 # @param theName Object name; when specified, this parameter is used
9811 # for result publication in the study. Otherwise, if automatic
9812 # publication is switched on, default value is used for result name.
9814 # @return New GEOM.GEOM_Object, containing the imported shape.
9816 # @ref swig_Import_Export "Example"
9817 def ImportSTEP(self, theFileName, ignoreUnits = False, theName=None):
9819 geompy.ImportFile(...) function for STEP format
9822 theFileName The file, containing the shape.
9823 ignoreUnits If True, file length units will be ignored (set to 'meter')
9824 and result model will be scaled, if its units are not meters.
9825 If False (default), file length units will be taken into account.
9826 theName Object name; when specified, this parameter is used
9827 for result publication in the study. Otherwise, if automatic
9828 publication is switched on, default value is used for result name.
9831 New GEOM.GEOM_Object, containing the imported shape.
9833 # Example: see GEOM_TestOthers.py
9834 # note: auto-publishing is done in self.ImportFile()
9836 return self.ImportFile(theFileName, "STEP_SCALE", theName)
9837 return self.ImportFile(theFileName, "STEP", theName)
9839 ## Return length unit from given IGES or STEP file
9840 # @param theFileName The file, containing the shape.
9841 # @return String, containing the units name.
9843 # @ref swig_Import_Export "Example"
9844 def GetSTEPUnit(self, theFileName):
9846 Return length units from given STEP file
9849 theFileName The file, containing the shape.
9852 String, containing the units name.
9854 # Example: see GEOM_TestOthers.py
9855 aUnitName = self.InsertOp.ReadValue(theFileName, "STEP", "LEN_UNITS")
9858 ## Read a shape from the binary stream, containing its bounding representation (BRep).
9859 # @note This method will not be dumped to the python script by DumpStudy functionality.
9860 # @note GEOM.GEOM_Object.GetShapeStream() method can be used to obtain the shape's BRep stream.
9861 # @param theStream The BRep binary stream.
9862 # @param theName Object name; when specified, this parameter is used
9863 # for result publication in the study. Otherwise, if automatic
9864 # publication is switched on, default value is used for result name.
9866 # @return New GEOM_Object, containing the shape, read from theStream.
9868 # @ref swig_Import_Export "Example"
9869 def RestoreShape (self, theStream, theName=None):
9871 Read a shape from the binary stream, containing its bounding representation (BRep).
9874 shape.GetShapeStream() method can be used to obtain the shape's BRep stream.
9877 theStream The BRep binary stream.
9878 theName Object name; when specified, this parameter is used
9879 for result publication in the study. Otherwise, if automatic
9880 publication is switched on, default value is used for result name.
9883 New GEOM_Object, containing the shape, read from theStream.
9885 # Example: see GEOM_TestOthers.py
9886 anObj = self.InsertOp.RestoreShape(theStream)
9887 RaiseIfFailed("RestoreShape", self.InsertOp)
9888 self._autoPublish(anObj, theName, "restored")
9891 ## Export the given shape into a file with given name.
9892 # @param theObject Shape to be stored in the file.
9893 # @param theFileName Name of the file to store the given shape in.
9894 # @param theFormatName Specify format for the shape storage.
9895 # Available formats can be obtained with
9896 # geompy.InsertOp.ExportTranslators()[0] method.
9898 # @ref swig_Import_Export "Example"
9899 def Export(self, theObject, theFileName, theFormatName):
9901 Export the given shape into a file with given name.
9904 theObject Shape to be stored in the file.
9905 theFileName Name of the file to store the given shape in.
9906 theFormatName Specify format for the shape storage.
9907 Available formats can be obtained with
9908 geompy.InsertOp.ExportTranslators()[0] method.
9910 # Example: see GEOM_TestOthers.py
9911 self.InsertOp.Export(theObject, theFileName, theFormatName)
9912 if self.InsertOp.IsDone() == 0:
9913 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
9917 ## Shortcut to Export() for BREP format
9919 # @ref swig_Import_Export "Example"
9920 def ExportBREP(self,theObject, theFileName):
9922 geompy.Export(...) function for BREP format
9924 # Example: see GEOM_TestOthers.py
9925 return self.Export(theObject, theFileName, "BREP")
9927 ## Shortcut to Export() for IGES format
9929 # @ref swig_Import_Export "Example"
9930 def ExportIGES(self,theObject, theFileName):
9932 geompy.Export(...) function for IGES format
9934 # Example: see GEOM_TestOthers.py
9935 return self.Export(theObject, theFileName, "IGES")
9937 ## Shortcut to Export() for STEP format
9939 # @ref swig_Import_Export "Example"
9940 def ExportSTEP(self,theObject, theFileName):
9942 geompy.Export(...) function for STEP format
9944 # Example: see GEOM_TestOthers.py
9945 return self.Export(theObject, theFileName, "STEP")
9947 # end of l2_import_export
9950 ## @addtogroup l3_blocks
9953 ## Create a quadrangle face from four edges. Order of Edges is not
9954 # important. It is not necessary that edges share the same vertex.
9955 # @param E1,E2,E3,E4 Edges for the face bound.
9956 # @param theName Object name; when specified, this parameter is used
9957 # for result publication in the study. Otherwise, if automatic
9958 # publication is switched on, default value is used for result name.
9960 # @return New GEOM.GEOM_Object, containing the created face.
9962 # @ref tui_building_by_blocks_page "Example"
9963 def MakeQuad(self, E1, E2, E3, E4, theName=None):
9965 Create a quadrangle face from four edges. Order of Edges is not
9966 important. It is not necessary that edges share the same vertex.
9969 E1,E2,E3,E4 Edges for the face bound.
9970 theName Object name; when specified, this parameter is used
9971 for result publication in the study. Otherwise, if automatic
9972 publication is switched on, default value is used for result name.
9975 New GEOM.GEOM_Object, containing the created face.
9978 qface1 = geompy.MakeQuad(edge1, edge2, edge3, edge4)
9980 # Example: see GEOM_Spanner.py
9981 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
9982 RaiseIfFailed("MakeQuad", self.BlocksOp)
9983 self._autoPublish(anObj, theName, "quad")
9986 ## Create a quadrangle face on two edges.
9987 # The missing edges will be built by creating the shortest ones.
9988 # @param E1,E2 Two opposite edges for the face.
9989 # @param theName Object name; when specified, this parameter is used
9990 # for result publication in the study. Otherwise, if automatic
9991 # publication is switched on, default value is used for result name.
9993 # @return New GEOM.GEOM_Object, containing the created face.
9995 # @ref tui_building_by_blocks_page "Example"
9996 def MakeQuad2Edges(self, E1, E2, theName=None):
9998 Create a quadrangle face on two edges.
9999 The missing edges will be built by creating the shortest ones.
10002 E1,E2 Two opposite edges for the face.
10003 theName Object name; when specified, this parameter is used
10004 for result publication in the study. Otherwise, if automatic
10005 publication is switched on, default value is used for result name.
10008 New GEOM.GEOM_Object, containing the created face.
10012 p1 = geompy.MakeVertex( 0., 0., 0.)
10013 p2 = geompy.MakeVertex(150., 30., 0.)
10014 p3 = geompy.MakeVertex( 0., 120., 50.)
10015 p4 = geompy.MakeVertex( 0., 40., 70.)
10017 edge1 = geompy.MakeEdge(p1, p2)
10018 edge2 = geompy.MakeEdge(p3, p4)
10019 # create a quadrangle face from two edges
10020 qface2 = geompy.MakeQuad2Edges(edge1, edge2)
10022 # Example: see GEOM_Spanner.py
10023 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
10024 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
10025 self._autoPublish(anObj, theName, "quad")
10028 ## Create a quadrangle face with specified corners.
10029 # The missing edges will be built by creating the shortest ones.
10030 # @param V1,V2,V3,V4 Corner vertices for the face.
10031 # @param theName Object name; when specified, this parameter is used
10032 # for result publication in the study. Otherwise, if automatic
10033 # publication is switched on, default value is used for result name.
10035 # @return New GEOM.GEOM_Object, containing the created face.
10037 # @ref tui_building_by_blocks_page "Example 1"
10038 # \n @ref swig_MakeQuad4Vertices "Example 2"
10039 def MakeQuad4Vertices(self, V1, V2, V3, V4, theName=None):
10041 Create a quadrangle face with specified corners.
10042 The missing edges will be built by creating the shortest ones.
10045 V1,V2,V3,V4 Corner vertices for the face.
10046 theName Object name; when specified, this parameter is used
10047 for result publication in the study. Otherwise, if automatic
10048 publication is switched on, default value is used for result name.
10051 New GEOM.GEOM_Object, containing the created face.
10055 p1 = geompy.MakeVertex( 0., 0., 0.)
10056 p2 = geompy.MakeVertex(150., 30., 0.)
10057 p3 = geompy.MakeVertex( 0., 120., 50.)
10058 p4 = geompy.MakeVertex( 0., 40., 70.)
10059 # create a quadrangle from four points in its corners
10060 qface3 = geompy.MakeQuad4Vertices(p1, p2, p3, p4)
10062 # Example: see GEOM_Spanner.py
10063 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
10064 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
10065 self._autoPublish(anObj, theName, "quad")
10068 ## Create a hexahedral solid, bounded by the six given faces. Order of
10069 # faces is not important. It is not necessary that Faces share the same edge.
10070 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10071 # @param theName Object name; when specified, this parameter is used
10072 # for result publication in the study. Otherwise, if automatic
10073 # publication is switched on, default value is used for result name.
10075 # @return New GEOM.GEOM_Object, containing the created solid.
10077 # @ref tui_building_by_blocks_page "Example 1"
10078 # \n @ref swig_MakeHexa "Example 2"
10079 def MakeHexa(self, F1, F2, F3, F4, F5, F6, theName=None):
10081 Create a hexahedral solid, bounded by the six given faces. Order of
10082 faces is not important. It is not necessary that Faces share the same edge.
10085 F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
10086 theName Object name; when specified, this parameter is used
10087 for result publication in the study. Otherwise, if automatic
10088 publication is switched on, default value is used for result name.
10091 New GEOM.GEOM_Object, containing the created solid.
10094 solid = geompy.MakeHexa(qface1, qface2, qface3, qface4, qface5, qface6)
10096 # Example: see GEOM_Spanner.py
10097 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
10098 RaiseIfFailed("MakeHexa", self.BlocksOp)
10099 self._autoPublish(anObj, theName, "hexa")
10102 ## Create a hexahedral solid between two given faces.
10103 # The missing faces will be built by creating the smallest ones.
10104 # @param F1,F2 Two opposite faces for the hexahedral solid.
10105 # @param theName Object name; when specified, this parameter is used
10106 # for result publication in the study. Otherwise, if automatic
10107 # publication is switched on, default value is used for result name.
10109 # @return New GEOM.GEOM_Object, containing the created solid.
10111 # @ref tui_building_by_blocks_page "Example 1"
10112 # \n @ref swig_MakeHexa2Faces "Example 2"
10113 def MakeHexa2Faces(self, F1, F2, theName=None):
10115 Create a hexahedral solid between two given faces.
10116 The missing faces will be built by creating the smallest ones.
10119 F1,F2 Two opposite faces for the hexahedral solid.
10120 theName Object name; when specified, this parameter is used
10121 for result publication in the study. Otherwise, if automatic
10122 publication is switched on, default value is used for result name.
10125 New GEOM.GEOM_Object, containing the created solid.
10128 solid1 = geompy.MakeHexa2Faces(qface1, qface2)
10130 # Example: see GEOM_Spanner.py
10131 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
10132 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
10133 self._autoPublish(anObj, theName, "hexa")
10139 ## @addtogroup l3_blocks_op
10142 ## Get a vertex, found in the given shape by its coordinates.
10143 # @param theShape Block or a compound of blocks.
10144 # @param theX,theY,theZ Coordinates of the sought vertex.
10145 # @param theEpsilon Maximum allowed distance between the resulting
10146 # vertex and point with the given coordinates.
10147 # @param theName Object name; when specified, this parameter is used
10148 # for result publication in the study. Otherwise, if automatic
10149 # publication is switched on, default value is used for result name.
10151 # @return New GEOM.GEOM_Object, containing the found vertex.
10153 # @ref swig_GetPoint "Example"
10154 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon, theName=None):
10156 Get a vertex, found in the given shape by its coordinates.
10159 theShape Block or a compound of blocks.
10160 theX,theY,theZ Coordinates of the sought vertex.
10161 theEpsilon Maximum allowed distance between the resulting
10162 vertex and point with the given coordinates.
10163 theName Object name; when specified, this parameter is used
10164 for result publication in the study. Otherwise, if automatic
10165 publication is switched on, default value is used for result name.
10168 New GEOM.GEOM_Object, containing the found vertex.
10171 pnt = geompy.GetPoint(shape, -50, 50, 50, 0.01)
10173 # Example: see GEOM_TestOthers.py
10174 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
10175 RaiseIfFailed("GetPoint", self.BlocksOp)
10176 self._autoPublish(anObj, theName, "vertex")
10179 ## Find a vertex of the given shape, which has minimal distance to the given point.
10180 # @param theShape Any shape.
10181 # @param thePoint Point, close to the desired vertex.
10182 # @param theName Object name; when specified, this parameter is used
10183 # for result publication in the study. Otherwise, if automatic
10184 # publication is switched on, default value is used for result name.
10186 # @return New GEOM.GEOM_Object, containing the found vertex.
10188 # @ref swig_GetVertexNearPoint "Example"
10189 def GetVertexNearPoint(self, theShape, thePoint, theName=None):
10191 Find a vertex of the given shape, which has minimal distance to the given point.
10194 theShape Any shape.
10195 thePoint Point, close to the desired vertex.
10196 theName Object name; when specified, this parameter is used
10197 for result publication in the study. Otherwise, if automatic
10198 publication is switched on, default value is used for result name.
10201 New GEOM.GEOM_Object, containing the found vertex.
10204 pmidle = geompy.MakeVertex(50, 0, 50)
10205 edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle)
10207 # Example: see GEOM_TestOthers.py
10208 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
10209 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
10210 self._autoPublish(anObj, theName, "vertex")
10213 ## Get an edge, found in the given shape by two given vertices.
10214 # @param theShape Block or a compound of blocks.
10215 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
10216 # @param theName Object name; when specified, this parameter is used
10217 # for result publication in the study. Otherwise, if automatic
10218 # publication is switched on, default value is used for result name.
10220 # @return New GEOM.GEOM_Object, containing the found edge.
10222 # @ref swig_GetEdge "Example"
10223 def GetEdge(self, theShape, thePoint1, thePoint2, theName=None):
10225 Get an edge, found in the given shape by two given vertices.
10228 theShape Block or a compound of blocks.
10229 thePoint1,thePoint2 Points, close to the ends of the desired edge.
10230 theName Object name; when specified, this parameter is used
10231 for result publication in the study. Otherwise, if automatic
10232 publication is switched on, default value is used for result name.
10235 New GEOM.GEOM_Object, containing the found edge.
10237 # Example: see GEOM_Spanner.py
10238 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
10239 RaiseIfFailed("GetEdge", self.BlocksOp)
10240 self._autoPublish(anObj, theName, "edge")
10243 ## Find an edge of the given shape, which has minimal distance to the given point.
10244 # @param theShape Block or a compound of blocks.
10245 # @param thePoint Point, close to the desired edge.
10246 # @param theName Object name; when specified, this parameter is used
10247 # for result publication in the study. Otherwise, if automatic
10248 # publication is switched on, default value is used for result name.
10250 # @return New GEOM.GEOM_Object, containing the found edge.
10252 # @ref swig_GetEdgeNearPoint "Example"
10253 def GetEdgeNearPoint(self, theShape, thePoint, theName=None):
10255 Find an edge of the given shape, which has minimal distance to the given point.
10258 theShape Block or a compound of blocks.
10259 thePoint Point, close to the desired edge.
10260 theName Object name; when specified, this parameter is used
10261 for result publication in the study. Otherwise, if automatic
10262 publication is switched on, default value is used for result name.
10265 New GEOM.GEOM_Object, containing the found edge.
10267 # Example: see GEOM_TestOthers.py
10268 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
10269 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
10270 self._autoPublish(anObj, theName, "edge")
10273 ## Returns a face, found in the given shape by four given corner vertices.
10274 # @param theShape Block or a compound of blocks.
10275 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10276 # @param theName Object name; when specified, this parameter is used
10277 # for result publication in the study. Otherwise, if automatic
10278 # publication is switched on, default value is used for result name.
10280 # @return New GEOM.GEOM_Object, containing the found face.
10282 # @ref swig_todo "Example"
10283 def GetFaceByPoints(self, theShape, thePoint1, thePoint2, thePoint3, thePoint4, theName=None):
10285 Returns a face, found in the given shape by four given corner vertices.
10288 theShape Block or a compound of blocks.
10289 thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
10290 theName Object name; when specified, this parameter is used
10291 for result publication in the study. Otherwise, if automatic
10292 publication is switched on, default value is used for result name.
10295 New GEOM.GEOM_Object, containing the found face.
10297 # Example: see GEOM_Spanner.py
10298 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
10299 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
10300 self._autoPublish(anObj, theName, "face")
10303 ## Get a face of block, found in the given shape by two given edges.
10304 # @param theShape Block or a compound of blocks.
10305 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
10306 # @param theName Object name; when specified, this parameter is used
10307 # for result publication in the study. Otherwise, if automatic
10308 # publication is switched on, default value is used for result name.
10310 # @return New GEOM.GEOM_Object, containing the found face.
10312 # @ref swig_todo "Example"
10313 def GetFaceByEdges(self, theShape, theEdge1, theEdge2, theName=None):
10315 Get a face of block, found in the given shape by two given edges.
10318 theShape Block or a compound of blocks.
10319 theEdge1,theEdge2 Edges, close to the edges of the desired face.
10320 theName Object name; when specified, this parameter is used
10321 for result publication in the study. Otherwise, if automatic
10322 publication is switched on, default value is used for result name.
10325 New GEOM.GEOM_Object, containing the found face.
10327 # Example: see GEOM_Spanner.py
10328 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
10329 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
10330 self._autoPublish(anObj, theName, "face")
10333 ## Find a face, opposite to the given one in the given block.
10334 # @param theBlock Must be a hexahedral solid.
10335 # @param theFace Face of \a theBlock, opposite to the desired face.
10336 # @param theName Object name; when specified, this parameter is used
10337 # for result publication in the study. Otherwise, if automatic
10338 # publication is switched on, default value is used for result name.
10340 # @return New GEOM.GEOM_Object, containing the found face.
10342 # @ref swig_GetOppositeFace "Example"
10343 def GetOppositeFace(self, theBlock, theFace, theName=None):
10345 Find a face, opposite to the given one in the given block.
10348 theBlock Must be a hexahedral solid.
10349 theFace Face of theBlock, opposite to the desired face.
10350 theName Object name; when specified, this parameter is used
10351 for result publication in the study. Otherwise, if automatic
10352 publication is switched on, default value is used for result name.
10355 New GEOM.GEOM_Object, containing the found face.
10357 # Example: see GEOM_Spanner.py
10358 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
10359 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
10360 self._autoPublish(anObj, theName, "face")
10363 ## Find a face of the given shape, which has minimal distance to the given point.
10364 # @param theShape Block or a compound of blocks.
10365 # @param thePoint Point, close to the desired face.
10366 # @param theName Object name; when specified, this parameter is used
10367 # for result publication in the study. Otherwise, if automatic
10368 # publication is switched on, default value is used for result name.
10370 # @return New GEOM.GEOM_Object, containing the found face.
10372 # @ref swig_GetFaceNearPoint "Example"
10373 def GetFaceNearPoint(self, theShape, thePoint, theName=None):
10375 Find a face of the given shape, which has minimal distance to the given point.
10378 theShape Block or a compound of blocks.
10379 thePoint Point, close to the desired face.
10380 theName Object name; when specified, this parameter is used
10381 for result publication in the study. Otherwise, if automatic
10382 publication is switched on, default value is used for result name.
10385 New GEOM.GEOM_Object, containing the found face.
10387 # Example: see GEOM_Spanner.py
10388 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
10389 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
10390 self._autoPublish(anObj, theName, "face")
10393 ## Find a face of block, whose outside normale has minimal angle with the given vector.
10394 # @param theBlock Block or a compound of blocks.
10395 # @param theVector Vector, close to the normale of the desired face.
10396 # @param theName Object name; when specified, this parameter is used
10397 # for result publication in the study. Otherwise, if automatic
10398 # publication is switched on, default value is used for result name.
10400 # @return New GEOM.GEOM_Object, containing the found face.
10402 # @ref swig_todo "Example"
10403 def GetFaceByNormale(self, theBlock, theVector, theName=None):
10405 Find a face of block, whose outside normale has minimal angle with the given vector.
10408 theBlock Block or a compound of blocks.
10409 theVector Vector, close to the normale of the desired face.
10410 theName Object name; when specified, this parameter is used
10411 for result publication in the study. Otherwise, if automatic
10412 publication is switched on, default value is used for result name.
10415 New GEOM.GEOM_Object, containing the found face.
10417 # Example: see GEOM_Spanner.py
10418 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
10419 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
10420 self._autoPublish(anObj, theName, "face")
10423 ## Find all sub-shapes of type \a theShapeType of the given shape,
10424 # which have minimal distance to the given point.
10425 # @param theShape Any shape.
10426 # @param thePoint Point, close to the desired shape.
10427 # @param theShapeType Defines what kind of sub-shapes is searched GEOM::shape_type
10428 # @param theTolerance The tolerance for distances comparison. All shapes
10429 # with distances to the given point in interval
10430 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
10431 # @param theName Object name; when specified, this parameter is used
10432 # for result publication in the study. Otherwise, if automatic
10433 # publication is switched on, default value is used for result name.
10435 # @return New GEOM_Object, containing a group of all found shapes.
10437 # @ref swig_GetShapesNearPoint "Example"
10438 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07, theName=None):
10440 Find all sub-shapes of type theShapeType of the given shape,
10441 which have minimal distance to the given point.
10444 theShape Any shape.
10445 thePoint Point, close to the desired shape.
10446 theShapeType Defines what kind of sub-shapes is searched (see GEOM::shape_type)
10447 theTolerance The tolerance for distances comparison. All shapes
10448 with distances to the given point in interval
10449 [minimal_distance, minimal_distance + theTolerance] will be gathered.
10450 theName Object name; when specified, this parameter is used
10451 for result publication in the study. Otherwise, if automatic
10452 publication is switched on, default value is used for result name.
10455 New GEOM_Object, containing a group of all found shapes.
10457 # Example: see GEOM_TestOthers.py
10458 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
10459 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
10460 self._autoPublish(anObj, theName, "group")
10463 # end of l3_blocks_op
10466 ## @addtogroup l4_blocks_measure
10469 ## Check, if the compound of blocks is given.
10470 # To be considered as a compound of blocks, the
10471 # given shape must satisfy the following conditions:
10472 # - Each element of the compound should be a Block (6 faces and 12 edges).
10473 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10474 # - The compound should be connexe.
10475 # - The glue between two quadrangle faces should be applied.
10476 # @param theCompound The compound to check.
10477 # @return TRUE, if the given shape is a compound of blocks.
10478 # If theCompound is not valid, prints all discovered errors.
10480 # @ref tui_measurement_tools_page "Example 1"
10481 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
10482 def CheckCompoundOfBlocks(self,theCompound):
10484 Check, if the compound of blocks is given.
10485 To be considered as a compound of blocks, the
10486 given shape must satisfy the following conditions:
10487 - Each element of the compound should be a Block (6 faces and 12 edges).
10488 - A connection between two Blocks should be an entire quadrangle face or an entire edge.
10489 - The compound should be connexe.
10490 - The glue between two quadrangle faces should be applied.
10493 theCompound The compound to check.
10496 TRUE, if the given shape is a compound of blocks.
10497 If theCompound is not valid, prints all discovered errors.
10499 # Example: see GEOM_Spanner.py
10500 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
10501 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
10503 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
10507 ## Retrieve all non blocks solids and faces from \a theShape.
10508 # @param theShape The shape to explore.
10509 # @param theName Object name; when specified, this parameter is used
10510 # for result publication in the study. Otherwise, if automatic
10511 # publication is switched on, default value is used for result name.
10513 # @return A tuple of two GEOM_Objects. The first object is a group of all
10514 # non block solids (= not 6 faces, or with 6 faces, but with the
10515 # presence of non-quadrangular faces). The second object is a
10516 # group of all non quadrangular faces.
10518 # @ref tui_measurement_tools_page "Example 1"
10519 # \n @ref swig_GetNonBlocks "Example 2"
10520 def GetNonBlocks (self, theShape, theName=None):
10522 Retrieve all non blocks solids and faces from theShape.
10525 theShape The shape to explore.
10526 theName Object name; when specified, this parameter is used
10527 for result publication in the study. Otherwise, if automatic
10528 publication is switched on, default value is used for result name.
10531 A tuple of two GEOM_Objects. The first object is a group of all
10532 non block solids (= not 6 faces, or with 6 faces, but with the
10533 presence of non-quadrangular faces). The second object is a
10534 group of all non quadrangular faces.
10537 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
10539 # Example: see GEOM_Spanner.py
10540 aTuple = self.BlocksOp.GetNonBlocks(theShape)
10541 RaiseIfFailed("GetNonBlocks", self.BlocksOp)
10542 self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
10545 ## Remove all seam and degenerated edges from \a theShape.
10546 # Unite faces and edges, sharing one surface. It means that
10547 # this faces must have references to one C++ surface object (handle).
10548 # @param theShape The compound or single solid to remove irregular edges from.
10549 # @param doUnionFaces If True, then unite faces. If False (the default value),
10550 # do not unite faces.
10551 # @param theName Object name; when specified, this parameter is used
10552 # for result publication in the study. Otherwise, if automatic
10553 # publication is switched on, default value is used for result name.
10555 # @return Improved shape.
10557 # @ref swig_RemoveExtraEdges "Example"
10558 def RemoveExtraEdges(self, theShape, doUnionFaces=False, theName=None):
10560 Remove all seam and degenerated edges from theShape.
10561 Unite faces and edges, sharing one surface. It means that
10562 this faces must have references to one C++ surface object (handle).
10565 theShape The compound or single solid to remove irregular edges from.
10566 doUnionFaces If True, then unite faces. If False (the default value),
10567 do not unite faces.
10568 theName Object name; when specified, this parameter is used
10569 for result publication in the study. Otherwise, if automatic
10570 publication is switched on, default value is used for result name.
10575 # Example: see GEOM_TestOthers.py
10576 nbFacesOptimum = -1 # -1 means do not unite faces
10577 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
10578 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
10579 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
10580 self._autoPublish(anObj, theName, "removeExtraEdges")
10583 ## Check, if the given shape is a blocks compound.
10584 # Fix all detected errors.
10585 # \note Single block can be also fixed by this method.
10586 # @param theShape The compound to check and improve.
10587 # @param theName Object name; when specified, this parameter is used
10588 # for result publication in the study. Otherwise, if automatic
10589 # publication is switched on, default value is used for result name.
10591 # @return Improved compound.
10593 # @ref swig_CheckAndImprove "Example"
10594 def CheckAndImprove(self, theShape, theName=None):
10596 Check, if the given shape is a blocks compound.
10597 Fix all detected errors.
10600 Single block can be also fixed by this method.
10603 theShape The compound to check and improve.
10604 theName Object name; when specified, this parameter is used
10605 for result publication in the study. Otherwise, if automatic
10606 publication is switched on, default value is used for result name.
10611 # Example: see GEOM_TestOthers.py
10612 anObj = self.BlocksOp.CheckAndImprove(theShape)
10613 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
10614 self._autoPublish(anObj, theName, "improved")
10617 # end of l4_blocks_measure
10620 ## @addtogroup l3_blocks_op
10623 ## Get all the blocks, contained in the given compound.
10624 # @param theCompound The compound to explode.
10625 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
10626 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
10627 # @param theName Object name; when specified, this parameter is used
10628 # for result publication in the study. Otherwise, if automatic
10629 # publication is switched on, default value is used for result name.
10631 # @note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10633 # @return List of GEOM.GEOM_Object, containing the retrieved blocks.
10635 # @ref tui_explode_on_blocks "Example 1"
10636 # \n @ref swig_MakeBlockExplode "Example 2"
10637 def MakeBlockExplode(self, theCompound, theMinNbFaces, theMaxNbFaces, theName=None):
10639 Get all the blocks, contained in the given compound.
10642 theCompound The compound to explode.
10643 theMinNbFaces If solid has lower number of faces, it is not a block.
10644 theMaxNbFaces If solid has higher number of faces, it is not a block.
10645 theName Object name; when specified, this parameter is used
10646 for result publication in the study. Otherwise, if automatic
10647 publication is switched on, default value is used for result name.
10650 If theMaxNbFaces = 0, the maximum number of faces is not restricted.
10653 List of GEOM.GEOM_Object, containing the retrieved blocks.
10655 # Example: see GEOM_TestOthers.py
10656 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
10657 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
10658 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
10659 for anObj in aList:
10660 anObj.SetParameters(Parameters)
10662 self._autoPublish(aList, theName, "block")
10665 ## Find block, containing the given point inside its volume or on boundary.
10666 # @param theCompound Compound, to find block in.
10667 # @param thePoint Point, close to the desired block. If the point lays on
10668 # boundary between some blocks, we return block with nearest center.
10669 # @param theName Object name; when specified, this parameter is used
10670 # for result publication in the study. Otherwise, if automatic
10671 # publication is switched on, default value is used for result name.
10673 # @return New GEOM.GEOM_Object, containing the found block.
10675 # @ref swig_todo "Example"
10676 def GetBlockNearPoint(self, theCompound, thePoint, theName=None):
10678 Find block, containing the given point inside its volume or on boundary.
10681 theCompound Compound, to find block in.
10682 thePoint Point, close to the desired block. If the point lays on
10683 boundary between some blocks, we return block with nearest center.
10684 theName Object name; when specified, this parameter is used
10685 for result publication in the study. Otherwise, if automatic
10686 publication is switched on, default value is used for result name.
10689 New GEOM.GEOM_Object, containing the found block.
10691 # Example: see GEOM_Spanner.py
10692 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
10693 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
10694 self._autoPublish(anObj, theName, "block")
10697 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10698 # @param theCompound Compound, to find block in.
10699 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
10700 # @param theName Object name; when specified, this parameter is used
10701 # for result publication in the study. Otherwise, if automatic
10702 # publication is switched on, default value is used for result name.
10704 # @return New GEOM.GEOM_Object, containing the found block.
10706 # @ref swig_GetBlockByParts "Example"
10707 def GetBlockByParts(self, theCompound, theParts, theName=None):
10709 Find block, containing all the elements, passed as the parts, or maximum quantity of them.
10712 theCompound Compound, to find block in.
10713 theParts List of faces and/or edges and/or vertices to be parts of the found block.
10714 theName Object name; when specified, this parameter is used
10715 for result publication in the study. Otherwise, if automatic
10716 publication is switched on, default value is used for result name.
10719 New GEOM_Object, containing the found block.
10721 # Example: see GEOM_TestOthers.py
10722 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
10723 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
10724 self._autoPublish(anObj, theName, "block")
10727 ## Return all blocks, containing all the elements, passed as the parts.
10728 # @param theCompound Compound, to find blocks in.
10729 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10730 # @param theName Object name; when specified, this parameter is used
10731 # for result publication in the study. Otherwise, if automatic
10732 # publication is switched on, default value is used for result name.
10734 # @return List of GEOM.GEOM_Object, containing the found blocks.
10736 # @ref swig_todo "Example"
10737 def GetBlocksByParts(self, theCompound, theParts, theName=None):
10739 Return all blocks, containing all the elements, passed as the parts.
10742 theCompound Compound, to find blocks in.
10743 theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
10744 theName Object name; when specified, this parameter is used
10745 for result publication in the study. Otherwise, if automatic
10746 publication is switched on, default value is used for result name.
10749 List of GEOM.GEOM_Object, containing the found blocks.
10751 # Example: see GEOM_Spanner.py
10752 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
10753 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
10754 self._autoPublish(aList, theName, "block")
10757 ## Multi-transformate block and glue the result.
10758 # Transformation is defined so, as to superpose direction faces.
10759 # @param Block Hexahedral solid to be multi-transformed.
10760 # @param DirFace1 ID of First direction face.
10761 # @param DirFace2 ID of Second direction face.
10762 # @param NbTimes Quantity of transformations to be done.
10763 # @param theName Object name; when specified, this parameter is used
10764 # for result publication in the study. Otherwise, if automatic
10765 # publication is switched on, default value is used for result name.
10767 # @note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10769 # @return New GEOM.GEOM_Object, containing the result shape.
10771 # @ref tui_multi_transformation "Example"
10772 def MakeMultiTransformation1D(self, Block, DirFace1, DirFace2, NbTimes, theName=None):
10774 Multi-transformate block and glue the result.
10775 Transformation is defined so, as to superpose direction faces.
10778 Block Hexahedral solid to be multi-transformed.
10779 DirFace1 ID of First direction face.
10780 DirFace2 ID of Second direction face.
10781 NbTimes Quantity of transformations to be done.
10782 theName Object name; when specified, this parameter is used
10783 for result publication in the study. Otherwise, if automatic
10784 publication is switched on, default value is used for result name.
10787 Unique ID of sub-shape can be obtained, using method GetSubShapeID().
10790 New GEOM.GEOM_Object, containing the result shape.
10792 # Example: see GEOM_Spanner.py
10793 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
10794 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
10795 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
10796 anObj.SetParameters(Parameters)
10797 self._autoPublish(anObj, theName, "transformed")
10800 ## Multi-transformate block and glue the result.
10801 # @param Block Hexahedral solid to be multi-transformed.
10802 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
10803 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
10804 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
10805 # @param theName Object name; when specified, this parameter is used
10806 # for result publication in the study. Otherwise, if automatic
10807 # publication is switched on, default value is used for result name.
10809 # @return New GEOM.GEOM_Object, containing the result shape.
10811 # @ref tui_multi_transformation "Example"
10812 def MakeMultiTransformation2D(self, Block, DirFace1U, DirFace2U, NbTimesU,
10813 DirFace1V, DirFace2V, NbTimesV, theName=None):
10815 Multi-transformate block and glue the result.
10818 Block Hexahedral solid to be multi-transformed.
10819 DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
10820 DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
10821 NbTimesU,NbTimesV Quantity of transformations to be done.
10822 theName Object name; when specified, this parameter is used
10823 for result publication in the study. Otherwise, if automatic
10824 publication is switched on, default value is used for result name.
10827 New GEOM.GEOM_Object, containing the result shape.
10829 # Example: see GEOM_Spanner.py
10830 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
10831 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
10832 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
10833 DirFace1V, DirFace2V, NbTimesV)
10834 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
10835 anObj.SetParameters(Parameters)
10836 self._autoPublish(anObj, theName, "transformed")
10839 ## Build all possible propagation groups.
10840 # Propagation group is a set of all edges, opposite to one (main)
10841 # edge of this group directly or through other opposite edges.
10842 # Notion of Opposite Edge make sence only on quadrangle face.
10843 # @param theShape Shape to build propagation groups on.
10844 # @param theName Object name; when specified, this parameter is used
10845 # for result publication in the study. Otherwise, if automatic
10846 # publication is switched on, default value is used for result name.
10848 # @return List of GEOM.GEOM_Object, each of them is a propagation group.
10850 # @ref swig_Propagate "Example"
10851 def Propagate(self, theShape, theName=None):
10853 Build all possible propagation groups.
10854 Propagation group is a set of all edges, opposite to one (main)
10855 edge of this group directly or through other opposite edges.
10856 Notion of Opposite Edge make sence only on quadrangle face.
10859 theShape Shape to build propagation groups on.
10860 theName Object name; when specified, this parameter is used
10861 for result publication in the study. Otherwise, if automatic
10862 publication is switched on, default value is used for result name.
10865 List of GEOM.GEOM_Object, each of them is a propagation group.
10867 # Example: see GEOM_TestOthers.py
10868 listChains = self.BlocksOp.Propagate(theShape)
10869 RaiseIfFailed("Propagate", self.BlocksOp)
10870 self._autoPublish(listChains, theName, "propagate")
10873 # end of l3_blocks_op
10876 ## @addtogroup l3_groups
10879 ## Creates a new group which will store sub-shapes of theMainShape
10880 # @param theMainShape is a GEOM object on which the group is selected
10881 # @param theShapeType defines a shape type of the group (see GEOM::shape_type)
10882 # @param theName Object name; when specified, this parameter is used
10883 # for result publication in the study. Otherwise, if automatic
10884 # publication is switched on, default value is used for result name.
10886 # @return a newly created GEOM group (GEOM.GEOM_Object)
10888 # @ref tui_working_with_groups_page "Example 1"
10889 # \n @ref swig_CreateGroup "Example 2"
10890 def CreateGroup(self, theMainShape, theShapeType, theName=None):
10892 Creates a new group which will store sub-shapes of theMainShape
10895 theMainShape is a GEOM object on which the group is selected
10896 theShapeType defines a shape type of the group:"COMPOUND", "COMPSOLID",
10897 "SOLID", "SHELL", "FACE", "WIRE", "EDGE", "VERTEX", "SHAPE".
10898 theName Object name; when specified, this parameter is used
10899 for result publication in the study. Otherwise, if automatic
10900 publication is switched on, default value is used for result name.
10903 a newly created GEOM group
10906 group = geompy.CreateGroup(Box, geompy.ShapeType["FACE"])
10909 # Example: see GEOM_TestOthers.py
10910 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
10911 RaiseIfFailed("CreateGroup", self.GroupOp)
10912 self._autoPublish(anObj, theName, "group")
10915 ## Adds a sub-object with ID theSubShapeId to the group
10916 # @param theGroup is a GEOM group to which the new sub-shape is added
10917 # @param theSubShapeID is a sub-shape ID in the main object.
10918 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
10920 # @ref tui_working_with_groups_page "Example"
10921 def AddObject(self,theGroup, theSubShapeID):
10923 Adds a sub-object with ID theSubShapeId to the group
10926 theGroup is a GEOM group to which the new sub-shape is added
10927 theSubShapeID is a sub-shape ID in the main object.
10930 Use method GetSubShapeID() to get an unique ID of the sub-shape
10932 # Example: see GEOM_TestOthers.py
10933 self.GroupOp.AddObject(theGroup, theSubShapeID)
10934 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
10935 RaiseIfFailed("AddObject", self.GroupOp)
10939 ## Removes a sub-object with ID \a theSubShapeId from the group
10940 # @param theGroup is a GEOM group from which the new sub-shape is removed
10941 # @param theSubShapeID is a sub-shape ID in the main object.
10942 # \note Use method GetSubShapeID() to get an unique ID of the sub-shape
10944 # @ref tui_working_with_groups_page "Example"
10945 def RemoveObject(self,theGroup, theSubShapeID):
10947 Removes a sub-object with ID theSubShapeId from the group
10950 theGroup is a GEOM group from which the new sub-shape is removed
10951 theSubShapeID is a sub-shape ID in the main object.
10954 Use method GetSubShapeID() to get an unique ID of the sub-shape
10956 # Example: see GEOM_TestOthers.py
10957 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
10958 RaiseIfFailed("RemoveObject", self.GroupOp)
10961 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10962 # @param theGroup is a GEOM group to which the new sub-shapes are added.
10963 # @param theSubShapes is a list of sub-shapes to be added.
10965 # @ref tui_working_with_groups_page "Example"
10966 def UnionList (self,theGroup, theSubShapes):
10968 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10971 theGroup is a GEOM group to which the new sub-shapes are added.
10972 theSubShapes is a list of sub-shapes to be added.
10974 # Example: see GEOM_TestOthers.py
10975 self.GroupOp.UnionList(theGroup, theSubShapes)
10976 RaiseIfFailed("UnionList", self.GroupOp)
10979 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10980 # @param theGroup is a GEOM group to which the new sub-shapes are added.
10981 # @param theSubShapes is a list of indices of sub-shapes to be added.
10983 # @ref swig_UnionIDs "Example"
10984 def UnionIDs(self,theGroup, theSubShapes):
10986 Adds to the group all the given shapes. No errors, if some shapes are alredy included.
10989 theGroup is a GEOM group to which the new sub-shapes are added.
10990 theSubShapes is a list of indices of sub-shapes to be added.
10992 # Example: see GEOM_TestOthers.py
10993 self.GroupOp.UnionIDs(theGroup, theSubShapes)
10994 RaiseIfFailed("UnionIDs", self.GroupOp)
10997 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
10998 # @param theGroup is a GEOM group from which the sub-shapes are removed.
10999 # @param theSubShapes is a list of sub-shapes to be removed.
11001 # @ref tui_working_with_groups_page "Example"
11002 def DifferenceList (self,theGroup, theSubShapes):
11004 Removes from the group all the given shapes. No errors, if some shapes are not included.
11007 theGroup is a GEOM group from which the sub-shapes are removed.
11008 theSubShapes is a list of sub-shapes to be removed.
11010 # Example: see GEOM_TestOthers.py
11011 self.GroupOp.DifferenceList(theGroup, theSubShapes)
11012 RaiseIfFailed("DifferenceList", self.GroupOp)
11015 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
11016 # @param theGroup is a GEOM group from which the sub-shapes are removed.
11017 # @param theSubShapes is a list of indices of sub-shapes to be removed.
11019 # @ref swig_DifferenceIDs "Example"
11020 def DifferenceIDs(self,theGroup, theSubShapes):
11022 Removes from the group all the given shapes. No errors, if some shapes are not included.
11025 theGroup is a GEOM group from which the sub-shapes are removed.
11026 theSubShapes is a list of indices of sub-shapes to be removed.
11028 # Example: see GEOM_TestOthers.py
11029 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
11030 RaiseIfFailed("DifferenceIDs", self.GroupOp)
11033 ## Union of two groups.
11034 # New group is created. It will contain all entities
11035 # which are present in groups theGroup1 and theGroup2.
11036 # @param theGroup1, theGroup2 are the initial GEOM groups
11037 # to create the united group from.
11038 # @param theName Object name; when specified, this parameter is used
11039 # for result publication in the study. Otherwise, if automatic
11040 # publication is switched on, default value is used for result name.
11042 # @return a newly created GEOM group.
11044 # @ref tui_union_groups_anchor "Example"
11045 def UnionGroups (self, theGroup1, theGroup2, theName=None):
11047 Union of two groups.
11048 New group is created. It will contain all entities
11049 which are present in groups theGroup1 and theGroup2.
11052 theGroup1, theGroup2 are the initial GEOM groups
11053 to create the united group from.
11054 theName Object name; when specified, this parameter is used
11055 for result publication in the study. Otherwise, if automatic
11056 publication is switched on, default value is used for result name.
11059 a newly created GEOM group.
11061 # Example: see GEOM_TestOthers.py
11062 aGroup = self.GroupOp.UnionGroups(theGroup1, theGroup2)
11063 RaiseIfFailed("UnionGroups", self.GroupOp)
11064 self._autoPublish(aGroup, theName, "group")
11067 ## Intersection of two groups.
11068 # New group is created. It will contain only those entities
11069 # which are present in both groups theGroup1 and theGroup2.
11070 # @param theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11071 # @param theName Object name; when specified, this parameter is used
11072 # for result publication in the study. Otherwise, if automatic
11073 # publication is switched on, default value is used for result name.
11075 # @return a newly created GEOM group.
11077 # @ref tui_intersect_groups_anchor "Example"
11078 def IntersectGroups (self, theGroup1, theGroup2, theName=None):
11080 Intersection of two groups.
11081 New group is created. It will contain only those entities
11082 which are present in both groups theGroup1 and theGroup2.
11085 theGroup1, theGroup2 are the initial GEOM groups to get common part of.
11086 theName Object name; when specified, this parameter is used
11087 for result publication in the study. Otherwise, if automatic
11088 publication is switched on, default value is used for result name.
11091 a newly created GEOM group.
11093 # Example: see GEOM_TestOthers.py
11094 aGroup = self.GroupOp.IntersectGroups(theGroup1, theGroup2)
11095 RaiseIfFailed("IntersectGroups", self.GroupOp)
11096 self._autoPublish(aGroup, theName, "group")
11099 ## Cut of two groups.
11100 # New group is created. It will contain entities which are
11101 # present in group theGroup1 but are not present in group theGroup2.
11102 # @param theGroup1 is a GEOM group to include elements of.
11103 # @param theGroup2 is a GEOM group to exclude elements of.
11104 # @param theName Object name; when specified, this parameter is used
11105 # for result publication in the study. Otherwise, if automatic
11106 # publication is switched on, default value is used for result name.
11108 # @return a newly created GEOM group.
11110 # @ref tui_cut_groups_anchor "Example"
11111 def CutGroups (self, theGroup1, theGroup2, theName=None):
11114 New group is created. It will contain entities which are
11115 present in group theGroup1 but are not present in group theGroup2.
11118 theGroup1 is a GEOM group to include elements of.
11119 theGroup2 is a GEOM group to exclude elements of.
11120 theName Object name; when specified, this parameter is used
11121 for result publication in the study. Otherwise, if automatic
11122 publication is switched on, default value is used for result name.
11125 a newly created GEOM group.
11127 # Example: see GEOM_TestOthers.py
11128 aGroup = self.GroupOp.CutGroups(theGroup1, theGroup2)
11129 RaiseIfFailed("CutGroups", self.GroupOp)
11130 self._autoPublish(aGroup, theName, "group")
11133 ## Union of list of groups.
11134 # New group is created. It will contain all entities that are
11135 # present in groups listed in theGList.
11136 # @param theGList is a list of GEOM groups to create the united group from.
11137 # @param theName Object name; when specified, this parameter is used
11138 # for result publication in the study. Otherwise, if automatic
11139 # publication is switched on, default value is used for result name.
11141 # @return a newly created GEOM group.
11143 # @ref tui_union_groups_anchor "Example"
11144 def UnionListOfGroups (self, theGList, theName=None):
11146 Union of list of groups.
11147 New group is created. It will contain all entities that are
11148 present in groups listed in theGList.
11151 theGList is a list of GEOM groups to create the united group from.
11152 theName Object name; when specified, this parameter is used
11153 for result publication in the study. Otherwise, if automatic
11154 publication is switched on, default value is used for result name.
11157 a newly created GEOM group.
11159 # Example: see GEOM_TestOthers.py
11160 aGroup = self.GroupOp.UnionListOfGroups(theGList)
11161 RaiseIfFailed("UnionListOfGroups", self.GroupOp)
11162 self._autoPublish(aGroup, theName, "group")
11165 ## Cut of lists of groups.
11166 # New group is created. It will contain only entities
11167 # which are present in groups listed in theGList1 but
11168 # are not present in groups from theGList2.
11169 # @param theGList1 is a list of GEOM groups to include elements of.
11170 # @param theGList2 is a list of GEOM groups to exclude elements of.
11171 # @param theName Object name; when specified, this parameter is used
11172 # for result publication in the study. Otherwise, if automatic
11173 # publication is switched on, default value is used for result name.
11175 # @return a newly created GEOM group.
11177 # @ref tui_intersect_groups_anchor "Example"
11178 def IntersectListOfGroups (self, theGList, theName=None):
11180 Cut of lists of groups.
11181 New group is created. It will contain only entities
11182 which are present in groups listed in theGList1 but
11183 are not present in groups from theGList2.
11186 theGList1 is a list of GEOM groups to include elements of.
11187 theGList2 is a list of GEOM groups to exclude elements of.
11188 theName Object name; when specified, this parameter is used
11189 for result publication in the study. Otherwise, if automatic
11190 publication is switched on, default value is used for result name.
11193 a newly created GEOM group.
11195 # Example: see GEOM_TestOthers.py
11196 aGroup = self.GroupOp.IntersectListOfGroups(theGList)
11197 RaiseIfFailed("IntersectListOfGroups", self.GroupOp)
11198 self._autoPublish(aGroup, theName, "group")
11201 ## Cut of lists of groups.
11202 # New group is created. It will contain only entities
11203 # which are present in groups listed in theGList1 but
11204 # are not present in groups from theGList2.
11205 # @param theGList1 is a list of GEOM groups to include elements of.
11206 # @param theGList2 is a list of GEOM groups to exclude elements of.
11207 # @param theName Object name; when specified, this parameter is used
11208 # for result publication in the study. Otherwise, if automatic
11209 # publication is switched on, default value is used for result name.
11211 # @return a newly created GEOM group.
11213 # @ref tui_cut_groups_anchor "Example"
11214 def CutListOfGroups (self, theGList1, theGList2, theName=None):
11216 Cut of lists of groups.
11217 New group is created. It will contain only entities
11218 which are present in groups listed in theGList1 but
11219 are not present in groups from theGList2.
11222 theGList1 is a list of GEOM groups to include elements of.
11223 theGList2 is a list of GEOM groups to exclude elements of.
11224 theName Object name; when specified, this parameter is used
11225 for result publication in the study. Otherwise, if automatic
11226 publication is switched on, default value is used for result name.
11229 a newly created GEOM group.
11231 # Example: see GEOM_TestOthers.py
11232 aGroup = self.GroupOp.CutListOfGroups(theGList1, theGList2)
11233 RaiseIfFailed("CutListOfGroups", self.GroupOp)
11234 self._autoPublish(aGroup, theName, "group")
11237 ## Returns a list of sub-objects ID stored in the group
11238 # @param theGroup is a GEOM group for which a list of IDs is requested
11240 # @ref swig_GetObjectIDs "Example"
11241 def GetObjectIDs(self,theGroup):
11243 Returns a list of sub-objects ID stored in the group
11246 theGroup is a GEOM group for which a list of IDs is requested
11248 # Example: see GEOM_TestOthers.py
11249 ListIDs = self.GroupOp.GetObjects(theGroup)
11250 RaiseIfFailed("GetObjects", self.GroupOp)
11253 ## Returns a type of sub-objects stored in the group
11254 # @param theGroup is a GEOM group which type is returned.
11256 # @ref swig_GetType "Example"
11257 def GetType(self,theGroup):
11259 Returns a type of sub-objects stored in the group
11262 theGroup is a GEOM group which type is returned.
11264 # Example: see GEOM_TestOthers.py
11265 aType = self.GroupOp.GetType(theGroup)
11266 RaiseIfFailed("GetType", self.GroupOp)
11269 ## Convert a type of geom object from id to string value
11270 # @param theId is a GEOM obect type id.
11271 # @return type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11272 # @ref swig_GetType "Example"
11273 def ShapeIdToType(self, theId):
11275 Convert a type of geom object from id to string value
11278 theId is a GEOM obect type id.
11281 type of geom object (POINT, VECTOR, PLANE, LINE, TORUS, ... )
11308 return "REVOLUTION"
11356 return "FREE_BOUNDS"
11364 return "THRUSECTIONS"
11366 return "COMPOUNDFILTER"
11368 return "SHAPES_ON_SHAPE"
11370 return "ELLIPSE_ARC"
11372 return "3DSKETCHER"
11378 return "PIPETSHAPE"
11379 return "Shape Id not exist."
11381 ## Returns a main shape associated with the group
11382 # @param theGroup is a GEOM group for which a main shape object is requested
11383 # @return a GEOM object which is a main shape for theGroup
11385 # @ref swig_GetMainShape "Example"
11386 def GetMainShape(self,theGroup):
11388 Returns a main shape associated with the group
11391 theGroup is a GEOM group for which a main shape object is requested
11394 a GEOM object which is a main shape for theGroup
11396 Example of usage: BoxCopy = geompy.GetMainShape(CreateGroup)
11398 # Example: see GEOM_TestOthers.py
11399 anObj = self.GroupOp.GetMainShape(theGroup)
11400 RaiseIfFailed("GetMainShape", self.GroupOp)
11403 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
11404 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11405 # @param theShape given shape (see GEOM.GEOM_Object)
11406 # @param min_length minimum length of edges of theShape
11407 # @param max_length maximum length of edges of theShape
11408 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11409 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11410 # @param theName Object name; when specified, this parameter is used
11411 # for result publication in the study. Otherwise, if automatic
11412 # publication is switched on, default value is used for result name.
11414 # @return a newly created GEOM group of edges
11416 # @@ref swig_todo "Example"
11417 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1, theName=None):
11419 Create group of edges of theShape, whose length is in range [min_length, max_length].
11420 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11423 theShape given shape
11424 min_length minimum length of edges of theShape
11425 max_length maximum length of edges of theShape
11426 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11427 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11428 theName Object name; when specified, this parameter is used
11429 for result publication in the study. Otherwise, if automatic
11430 publication is switched on, default value is used for result name.
11433 a newly created GEOM group of edges.
11435 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
11436 edges_in_range = []
11438 Props = self.BasicProperties(edge)
11439 if min_length <= Props[0] and Props[0] <= max_length:
11440 if (not include_min) and (min_length == Props[0]):
11443 if (not include_max) and (Props[0] == max_length):
11446 edges_in_range.append(edge)
11448 if len(edges_in_range) <= 0:
11449 print "No edges found by given criteria"
11452 # note: auto-publishing is done in self.CreateGroup()
11453 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"], theName)
11454 self.UnionList(group_edges, edges_in_range)
11458 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
11459 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
11460 # @param min_length minimum length of edges of selected shape
11461 # @param max_length maximum length of edges of selected shape
11462 # @param include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11463 # @param include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11464 # @return a newly created GEOM group of edges
11465 # @ref swig_todo "Example"
11466 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
11468 Create group of edges of selected shape, whose length is in range [min_length, max_length].
11469 If include_min/max == 0, edges with length == min/max_length will not be included in result.
11472 min_length minimum length of edges of selected shape
11473 max_length maximum length of edges of selected shape
11474 include_max indicating if edges with length == max_length should be included in result, 1-yes, 0-no (default=1)
11475 include_min indicating if edges with length == min_length should be included in result, 1-yes, 0-no (default=1)
11478 a newly created GEOM group of edges.
11480 nb_selected = sg.SelectedCount()
11481 if nb_selected < 1:
11482 print "Select a shape before calling this function, please."
11484 if nb_selected > 1:
11485 print "Only one shape must be selected"
11488 id_shape = sg.getSelected(0)
11489 shape = IDToObject( id_shape )
11491 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
11495 if include_min: left_str = " <= "
11496 if include_max: right_str = " <= "
11498 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
11499 + left_str + "length" + right_str + `max_length`)
11501 sg.updateObjBrowser(1)
11508 ## @addtogroup l4_advanced
11511 ## Create a T-shape object with specified caracteristics for the main
11512 # and the incident pipes (radius, width, half-length).
11513 # The extremities of the main pipe are located on junctions points P1 and P2.
11514 # The extremity of the incident pipe is located on junction point P3.
11515 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11516 # the main plane of the T-shape is XOY.
11517 # @param theR1 Internal radius of main pipe
11518 # @param theW1 Width of main pipe
11519 # @param theL1 Half-length of main pipe
11520 # @param theR2 Internal radius of incident pipe (R2 < R1)
11521 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11522 # @param theL2 Half-length of incident pipe
11523 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11524 # @param theP1 1st junction point of main pipe
11525 # @param theP2 2nd junction point of main pipe
11526 # @param theP3 Junction point of incident pipe
11527 # @param theName Object name; when specified, this parameter is used
11528 # for result publication in the study. Otherwise, if automatic
11529 # publication is switched on, default value is used for result name.
11531 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11533 # @ref tui_creation_pipetshape "Example"
11534 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None, theName=None):
11536 Create a T-shape object with specified caracteristics for the main
11537 and the incident pipes (radius, width, half-length).
11538 The extremities of the main pipe are located on junctions points P1 and P2.
11539 The extremity of the incident pipe is located on junction point P3.
11540 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11541 the main plane of the T-shape is XOY.
11544 theR1 Internal radius of main pipe
11545 theW1 Width of main pipe
11546 theL1 Half-length of main pipe
11547 theR2 Internal radius of incident pipe (R2 < R1)
11548 theW2 Width of incident pipe (R2+W2 < R1+W1)
11549 theL2 Half-length of incident pipe
11550 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11551 theP1 1st junction point of main pipe
11552 theP2 2nd junction point of main pipe
11553 theP3 Junction point of incident pipe
11554 theName Object name; when specified, this parameter is used
11555 for result publication in the study. Otherwise, if automatic
11556 publication is switched on, default value is used for result name.
11559 List of GEOM_Object, containing the created shape and propagation groups.
11562 # create PipeTShape object
11563 pipetshape = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0)
11564 # create PipeTShape object with position
11565 pipetshape_position = geompy.MakePipeTShape(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, True, P1, P2, P3)
11567 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
11568 if (theP1 and theP2 and theP3):
11569 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
11571 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
11572 RaiseIfFailed("MakePipeTShape", self.AdvOp)
11573 if Parameters: anObj[0].SetParameters(Parameters)
11574 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11575 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11578 ## Create a T-shape object with chamfer and with specified caracteristics for the main
11579 # and the incident pipes (radius, width, half-length). The chamfer is
11580 # created on the junction of the pipes.
11581 # The extremities of the main pipe are located on junctions points P1 and P2.
11582 # The extremity of the incident pipe is located on junction point P3.
11583 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11584 # the main plane of the T-shape is XOY.
11585 # @param theR1 Internal radius of main pipe
11586 # @param theW1 Width of main pipe
11587 # @param theL1 Half-length of main pipe
11588 # @param theR2 Internal radius of incident pipe (R2 < R1)
11589 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11590 # @param theL2 Half-length of incident pipe
11591 # @param theH Height of the chamfer.
11592 # @param theW Width of the chamfer.
11593 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11594 # @param theP1 1st junction point of main pipe
11595 # @param theP2 2nd junction point of main pipe
11596 # @param theP3 Junction point of incident pipe
11597 # @param theName Object name; when specified, this parameter is used
11598 # for result publication in the study. Otherwise, if automatic
11599 # publication is switched on, default value is used for result name.
11601 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11603 # @ref tui_creation_pipetshape "Example"
11604 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None, theName=None):
11606 Create a T-shape object with chamfer and with specified caracteristics for the main
11607 and the incident pipes (radius, width, half-length). The chamfer is
11608 created on the junction of the pipes.
11609 The extremities of the main pipe are located on junctions points P1 and P2.
11610 The extremity of the incident pipe is located on junction point P3.
11611 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11612 the main plane of the T-shape is XOY.
11615 theR1 Internal radius of main pipe
11616 theW1 Width of main pipe
11617 theL1 Half-length of main pipe
11618 theR2 Internal radius of incident pipe (R2 < R1)
11619 theW2 Width of incident pipe (R2+W2 < R1+W1)
11620 theL2 Half-length of incident pipe
11621 theH Height of the chamfer.
11622 theW Width of the chamfer.
11623 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11624 theP1 1st junction point of main pipe
11625 theP2 2nd junction point of main pipe
11626 theP3 Junction point of incident pipe
11627 theName Object name; when specified, this parameter is used
11628 for result publication in the study. Otherwise, if automatic
11629 publication is switched on, default value is used for result name.
11632 List of GEOM_Object, containing the created shape and propagation groups.
11635 # create PipeTShape with chamfer object
11636 pipetshapechamfer = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0)
11637 # create PipeTShape with chamfer object with position
11638 pipetshapechamfer_position = geompy.MakePipeTShapeChamfer(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 20.0, 20.0, True, P1, P2, P3)
11640 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
11641 if (theP1 and theP2 and theP3):
11642 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
11644 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
11645 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
11646 if Parameters: anObj[0].SetParameters(Parameters)
11647 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11648 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11651 ## Create a T-shape object with fillet and with specified caracteristics for the main
11652 # and the incident pipes (radius, width, half-length). The fillet is
11653 # created on the junction of the pipes.
11654 # The extremities of the main pipe are located on junctions points P1 and P2.
11655 # The extremity of the incident pipe is located on junction point P3.
11656 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11657 # the main plane of the T-shape is XOY.
11658 # @param theR1 Internal radius of main pipe
11659 # @param theW1 Width of main pipe
11660 # @param theL1 Half-length of main pipe
11661 # @param theR2 Internal radius of incident pipe (R2 < R1)
11662 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
11663 # @param theL2 Half-length of incident pipe
11664 # @param theRF Radius of curvature of fillet.
11665 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11666 # @param theP1 1st junction point of main pipe
11667 # @param theP2 2nd junction point of main pipe
11668 # @param theP3 Junction point of incident pipe
11669 # @param theName Object name; when specified, this parameter is used
11670 # for result publication in the study. Otherwise, if automatic
11671 # publication is switched on, default value is used for result name.
11673 # @return List of GEOM.GEOM_Object, containing the created shape and propagation groups.
11675 # @ref tui_creation_pipetshape "Example"
11676 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None, theName=None):
11678 Create a T-shape object with fillet and with specified caracteristics for the main
11679 and the incident pipes (radius, width, half-length). The fillet is
11680 created on the junction of the pipes.
11681 The extremities of the main pipe are located on junctions points P1 and P2.
11682 The extremity of the incident pipe is located on junction point P3.
11685 If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
11686 the main plane of the T-shape is XOY.
11687 theR1 Internal radius of main pipe
11688 theW1 Width of main pipe
11689 heL1 Half-length of main pipe
11690 theR2 Internal radius of incident pipe (R2 < R1)
11691 theW2 Width of incident pipe (R2+W2 < R1+W1)
11692 theL2 Half-length of incident pipe
11693 theRF Radius of curvature of fillet.
11694 theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
11695 theP1 1st junction point of main pipe
11696 theP2 2nd junction point of main pipe
11697 theP3 Junction point of incident pipe
11698 theName Object name; when specified, this parameter is used
11699 for result publication in the study. Otherwise, if automatic
11700 publication is switched on, default value is used for result name.
11703 List of GEOM_Object, containing the created shape and propagation groups.
11706 # create PipeTShape with fillet object
11707 pipetshapefillet = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0)
11708 # create PipeTShape with fillet object with position
11709 pipetshapefillet_position = geompy.MakePipeTShapeFillet(80.0, 20.0, 200.0, 50.0, 20.0, 200.0, 5.0, True, P1, P2, P3)
11712 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
11713 if (theP1 and theP2 and theP3):
11714 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
11716 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
11717 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
11718 if Parameters: anObj[0].SetParameters(Parameters)
11719 def_names = [ "pipeTShape" ] + [ "pipeTShape_grp_%d" % i for i in range(1, len(anObj)) ]
11720 self._autoPublish(anObj, _toListOfNames(theName, len(anObj)), def_names)
11723 ## This function allows creating a disk already divided into blocks. It
11724 # can be used to create divided pipes for later meshing in hexaedra.
11725 # @param theR Radius of the disk
11726 # @param theOrientation Orientation of the plane on which the disk will be built
11727 # 1 = XOY, 2 = OYZ, 3 = OZX
11728 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11729 # @param theName Object name; when specified, this parameter is used
11730 # for result publication in the study. Otherwise, if automatic
11731 # publication is switched on, default value is used for result name.
11733 # @return New GEOM_Object, containing the created shape.
11735 # @ref tui_creation_divideddisk "Example"
11736 def MakeDividedDisk(self, theR, theOrientation, thePattern, theName=None):
11738 Creates a disk, divided into blocks. It can be used to create divided pipes
11739 for later meshing in hexaedra.
11742 theR Radius of the disk
11743 theOrientation Orientation of the plane on which the disk will be built:
11744 1 = XOY, 2 = OYZ, 3 = OZX
11745 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11746 theName Object name; when specified, this parameter is used
11747 for result publication in the study. Otherwise, if automatic
11748 publication is switched on, default value is used for result name.
11751 New GEOM_Object, containing the created shape.
11753 theR, Parameters = ParseParameters(theR)
11754 anObj = self.AdvOp.MakeDividedDisk(theR, 67.0, theOrientation, thePattern)
11755 RaiseIfFailed("MakeDividedDisk", self.AdvOp)
11756 if Parameters: anObj.SetParameters(Parameters)
11757 self._autoPublish(anObj, theName, "dividedDisk")
11760 ## This function allows creating a disk already divided into blocks. It
11761 # can be used to create divided pipes for later meshing in hexaedra.
11762 # @param theCenter Center of the disk
11763 # @param theVector Normal vector to the plane of the created disk
11764 # @param theRadius Radius of the disk
11765 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11766 # @param theName Object name; when specified, this parameter is used
11767 # for result publication in the study. Otherwise, if automatic
11768 # publication is switched on, default value is used for result name.
11770 # @return New GEOM_Object, containing the created shape.
11772 # @ref tui_creation_divideddisk "Example"
11773 def MakeDividedDiskPntVecR(self, theCenter, theVector, theRadius, thePattern, theName=None):
11775 Creates a disk already divided into blocks. It can be used to create divided pipes
11776 for later meshing in hexaedra.
11779 theCenter Center of the disk
11780 theVector Normal vector to the plane of the created disk
11781 theRadius Radius of the disk
11782 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11783 theName Object name; when specified, this parameter is used
11784 for result publication in the study. Otherwise, if automatic
11785 publication is switched on, default value is used for result name.
11788 New GEOM_Object, containing the created shape.
11790 theRadius, Parameters = ParseParameters(theRadius)
11791 anObj = self.AdvOp.MakeDividedDiskPntVecR(theCenter, theVector, theRadius, 67.0, thePattern)
11792 RaiseIfFailed("MakeDividedDiskPntVecR", self.AdvOp)
11793 if Parameters: anObj.SetParameters(Parameters)
11794 self._autoPublish(anObj, theName, "dividedDisk")
11797 ## Builds a cylinder prepared for hexa meshes
11798 # @param theR Radius of the cylinder
11799 # @param theH Height of the cylinder
11800 # @param thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11801 # @param theName Object name; when specified, this parameter is used
11802 # for result publication in the study. Otherwise, if automatic
11803 # publication is switched on, default value is used for result name.
11805 # @return New GEOM_Object, containing the created shape.
11807 # @ref tui_creation_dividedcylinder "Example"
11808 def MakeDividedCylinder(self, theR, theH, thePattern, theName=None):
11810 Builds a cylinder prepared for hexa meshes
11813 theR Radius of the cylinder
11814 theH Height of the cylinder
11815 thePattern Division pattern. It can be GEOM.SQUARE or GEOM.HEXAGON
11816 theName Object name; when specified, this parameter is used
11817 for result publication in the study. Otherwise, if automatic
11818 publication is switched on, default value is used for result name.
11821 New GEOM_Object, containing the created shape.
11823 theR, theH, Parameters = ParseParameters(theR, theH)
11824 anObj = self.AdvOp.MakeDividedCylinder(theR, theH, thePattern)
11825 RaiseIfFailed("MakeDividedCylinder", self.AdvOp)
11826 if Parameters: anObj.SetParameters(Parameters)
11827 self._autoPublish(anObj, theName, "dividedCylinder")
11830 #@@ insert new functions before this line @@ do not remove this line @@#
11832 # end of l4_advanced
11835 ## Create a copy of the given object
11837 # @param theOriginal geometry object for copy
11838 # @param theName Object name; when specified, this parameter is used
11839 # for result publication in the study. Otherwise, if automatic
11840 # publication is switched on, default value is used for result name.
11842 # @return New GEOM_Object, containing the copied shape.
11844 # @ingroup l1_geompy_auxiliary
11845 # @ref swig_MakeCopy "Example"
11846 def MakeCopy(self, theOriginal, theName=None):
11848 Create a copy of the given object
11851 theOriginal geometry object for copy
11852 theName Object name; when specified, this parameter is used
11853 for result publication in the study. Otherwise, if automatic
11854 publication is switched on, default value is used for result name.
11857 New GEOM_Object, containing the copied shape.
11859 Example of usage: Copy = geompy.MakeCopy(Box)
11861 # Example: see GEOM_TestAll.py
11862 anObj = self.InsertOp.MakeCopy(theOriginal)
11863 RaiseIfFailed("MakeCopy", self.InsertOp)
11864 self._autoPublish(anObj, theName, "copy")
11867 ## Add Path to load python scripts from
11868 # @param Path a path to load python scripts from
11869 # @ingroup l1_geompy_auxiliary
11870 def addPath(self,Path):
11872 Add Path to load python scripts from
11875 Path a path to load python scripts from
11877 if (sys.path.count(Path) < 1):
11878 sys.path.append(Path)
11882 ## Load marker texture from the file
11883 # @param Path a path to the texture file
11884 # @return unique texture identifier
11885 # @ingroup l1_geompy_auxiliary
11886 def LoadTexture(self, Path):
11888 Load marker texture from the file
11891 Path a path to the texture file
11894 unique texture identifier
11896 # Example: see GEOM_TestAll.py
11897 ID = self.InsertOp.LoadTexture(Path)
11898 RaiseIfFailed("LoadTexture", self.InsertOp)
11901 ## Get internal name of the object based on its study entry
11902 # @note This method does not provide an unique identifier of the geometry object.
11903 # @note This is internal function of GEOM component, though it can be used outside it for
11904 # appropriate reason (e.g. for identification of geometry object).
11905 # @param obj geometry object
11906 # @return unique object identifier
11907 # @ingroup l1_geompy_auxiliary
11908 def getObjectID(self, obj):
11910 Get internal name of the object based on its study entry.
11911 Note: this method does not provide an unique identifier of the geometry object.
11912 It is an internal function of GEOM component, though it can be used outside GEOM for
11913 appropriate reason (e.g. for identification of geometry object).
11916 obj geometry object
11919 unique object identifier
11922 entry = salome.ObjectToID(obj)
11923 if entry is not None:
11924 lst = entry.split(":")
11926 ID = lst[-1] # -1 means last item in the list
11927 return "GEOM_" + ID
11932 ## Add marker texture. @a Width and @a Height parameters
11933 # specify width and height of the texture in pixels.
11934 # If @a RowData is @c True, @a Texture parameter should represent texture data
11935 # packed into the byte array. If @a RowData is @c False (default), @a Texture
11936 # parameter should be unpacked string, in which '1' symbols represent opaque
11937 # pixels and '0' represent transparent pixels of the texture bitmap.
11939 # @param Width texture width in pixels
11940 # @param Height texture height in pixels
11941 # @param Texture texture data
11942 # @param RowData if @c True, @a Texture data are packed in the byte stream
11943 # @return unique texture identifier
11944 # @ingroup l1_geompy_auxiliary
11945 def AddTexture(self, Width, Height, Texture, RowData=False):
11947 Add marker texture. Width and Height parameters
11948 specify width and height of the texture in pixels.
11949 If RowData is True, Texture parameter should represent texture data
11950 packed into the byte array. If RowData is False (default), Texture
11951 parameter should be unpacked string, in which '1' symbols represent opaque
11952 pixels and '0' represent transparent pixels of the texture bitmap.
11955 Width texture width in pixels
11956 Height texture height in pixels
11957 Texture texture data
11958 RowData if True, Texture data are packed in the byte stream
11961 return unique texture identifier
11963 if not RowData: Texture = PackData(Texture)
11964 ID = self.InsertOp.AddTexture(Width, Height, Texture)
11965 RaiseIfFailed("AddTexture", self.InsertOp)
11969 #Register the new proxy for GEOM_Gen
11970 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)